Merge branch 'dev-2.0' of https://git.mesalab.cn/nezha/nezha-fronted into dev-2.0
This commit is contained in:
@@ -15,7 +15,11 @@ if [[ 'all' == "${BUILD_MODE}" ]];then
|
||||
\cp -rf ../static/Tiles/ $DIST_PATH/static/
|
||||
fi
|
||||
echo 'start create zip...'
|
||||
find ./ * -exec touch -t $(date +%Y%m%d0000.00) {} \;
|
||||
|
||||
#find ./ * -exec touch -t $(date +%Y%m%d0000.00) {} \;
|
||||
|
||||
find ./ * -exec touch -t 202104301200.00 {} \;
|
||||
|
||||
zip -rX nz-gui.zip ./* >/dev/null
|
||||
|
||||
MD5=$(md5sum nz-gui.zip |awk '{print $1}'|cut -c 1-8)
|
||||
|
||||
@@ -197,13 +197,13 @@ if(process.env.NODE_ENV == 'development'){
|
||||
onBuildStart: ['/bin/bash '+path.join(__dirname,'script')+'/buildStart.sh'],
|
||||
onBuildEnd: ['/bin/bash '+path.join(__dirname,'script')+'/buildEnd.sh '+process.env.BUILD_MODE]
|
||||
}),
|
||||
new fileManagerPlugin({
|
||||
onStart:[
|
||||
{
|
||||
delete:[path.join(__dirname,'../dist/') ]
|
||||
}
|
||||
],
|
||||
})
|
||||
// new fileManagerPlugin({
|
||||
// onStart:[
|
||||
// {
|
||||
// delete:[path.join(__dirname,'../dist/') ]
|
||||
// }
|
||||
// ],
|
||||
// })
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -301,7 +301,7 @@ export default {
|
||||
return (key, value) => {
|
||||
if (key == 'type') {
|
||||
if (value == 1) {
|
||||
value = this.$t('project.project.project')
|
||||
value = this.$t('project.project.projectName')
|
||||
} else if (value == 2) {
|
||||
value = this.$t('module.module.module')
|
||||
} else if (value == 3) {
|
||||
|
||||
@@ -357,7 +357,7 @@ export default {
|
||||
path: this.$t('project.endpoint.path'),
|
||||
param: this.$t('project.endpoint.param'),
|
||||
state: this.$t('alert.list.state'),
|
||||
project: this.$t('project.project.project'),
|
||||
project: this.$t('project.project.projectName'),
|
||||
module: this.$t('project.module.module')
|
||||
}
|
||||
}
|
||||
|
||||
@@ -184,7 +184,7 @@
|
||||
<loading :ref="'localLoadingScreen'+chartIndex"></loading>
|
||||
</el-dialog>
|
||||
</div>
|
||||
<span class="vue-resizable-handle" @mousedown="startResize" v-if="filter.from != $CONSTANTS.fromRoute.rule && !isLock"></span>
|
||||
<span class="vue-resizable-handle" @mousedown="startResize" v-if="!isLock"></span>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -1,129 +1,125 @@
|
||||
<template>
|
||||
<div :class="calcHeight(that.position,that)" :style="calcPosition(that.position,that)" ref="alertLabels">
|
||||
<div class="alert-label-info" v-if="type==='asset'" v-loading="loading">
|
||||
<div class="alert-label-box">
|
||||
<div class="alert-label-title">ID</div>
|
||||
<div class="alert-label-value">{{alertLabelData?alertLabelData.id:''}}</div>
|
||||
</div>
|
||||
<div class="alert-label-box">
|
||||
<div class="alert-label-title">SN</div>
|
||||
<div class="alert-label-value">{{alertLabelData?alertLabelData.sn:''}}</div>
|
||||
</div>
|
||||
<div class="alert-label-box">
|
||||
<div class="alert-label-title">Host</div>
|
||||
<div class="alert-label-value">{{alertLabelData?alertLabelData.host:''}}</div>
|
||||
</div>
|
||||
<div class="alert-label-box">
|
||||
<div class="alert-label-title">State</div>
|
||||
<div class="alert-label-value">{{alertLabelData?(alertStateStr(alertLabelData.state)):''}}</div>
|
||||
</div>
|
||||
<div class="alert-label-box">
|
||||
<div class="alert-label-title">Ping</div>
|
||||
<div class="alert-label-value">
|
||||
<div v-if="alertLabelData" :class="{'active-icon green':alertLabelData.pingStatus == 1,'active-icon red':alertLabelData.pingStatus == 0}"></div>
|
||||
<span v-if="alertLabelData">{{alertLabelData.pingRtt?alertLabelData.pingRtt+'ms':''}}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="alert-label-box">
|
||||
<div class="alert-label-title">Asset Type</div>
|
||||
<div class="alert-label-value">{{alertLabelData?alertLabelData.assetType:''}}</div>
|
||||
</div>
|
||||
<div class="alert-label-box">
|
||||
<div class="alert-label-title">Vendor</div>
|
||||
<div class="alert-label-value">{{alertLabelData?alertLabelData.vendor:''}}</div>
|
||||
</div>
|
||||
<div class="alert-label-box">
|
||||
<div class="alert-label-title">Model</div>
|
||||
<div class="alert-label-value">{{alertLabelData?alertLabelData.model:''}}</div>
|
||||
</div>
|
||||
<div class="alert-label-box">
|
||||
<div class="alert-label-title">PingLastReply</div>
|
||||
<div class="alert-label-value">{{alertLabelData?alertLabelData.pingLastReply:''}}</div>
|
||||
</div>
|
||||
<div class="alert-label-box">
|
||||
<div class="alert-label-title">Alert</div>
|
||||
<div class="alert-label-value">
|
||||
<span v-if="alertLabelData" :class="{danger:alertLabelData.alert>0,success:alertLabelData.alert<=0}">{{alertLabelData.alert + alertActiveStr()}}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="alert-label-box">
|
||||
<div class="alert-label-title">DC</div>
|
||||
<div class="alert-label-value">{{alertLabelData?alertLabelData.dataCenter:''}}</div>
|
||||
</div>
|
||||
<div class="alert-label-box">
|
||||
<div class="alert-label-title">Endpoint</div>
|
||||
<div class="alert-label-value">{{alertLabelData?alertLabelData.endpoint:''}}</div>
|
||||
</div>
|
||||
<div class="alert-label-box">
|
||||
<div class="alert-label-title">Administrator</div>
|
||||
<div class="alert-label-value">{{alertLabelData?alertLabelData.principal:''}}</div>
|
||||
<div class="alert-label-info" v-if="type==='asset'" v-loading="loading">
|
||||
<div class="alert-label-box">
|
||||
<div class="alert-label-title">ID</div>
|
||||
<div class="alert-label-value">{{alertLabelData && alertLabelData.id ? alertLabelData.id : '--'}}</div>
|
||||
</div>
|
||||
<div class="alert-label-box">
|
||||
<div class="alert-label-title">Name</div>
|
||||
<div class="alert-label-value">{{alertLabelData && alertLabelData.name ? alertLabelData.name : '--'}}</div>
|
||||
</div>
|
||||
<div class="alert-label-box">
|
||||
<div class="alert-label-title">SN</div>
|
||||
<div class="alert-label-value">{{alertLabelData && alertLabelData.sn ? alertLabelData.sn:'--'}}</div>
|
||||
</div>
|
||||
<div class="alert-label-box">
|
||||
<div class="alert-label-title">ManageIp</div>
|
||||
<div class="alert-label-value">{{alertLabelData && alertLabelData.manageIp ? alertLabelData.manageIp : '--'}}</div>
|
||||
</div>
|
||||
<div class="alert-label-box">
|
||||
<div class="alert-label-title">State</div>
|
||||
<div class="alert-label-value">{{alertLabelData && alertLabelData.state && alertLabelData.state.name ? alertLabelData.state.name : '--'}}</div>
|
||||
</div>
|
||||
<div class="alert-label-box">
|
||||
<div class="alert-label-title">Ping</div>
|
||||
<div class="alert-label-value">
|
||||
<div v-if="alertLabelData" :class="{'green-bg': alertLabelData && alertLabelData.pingInfo && alertLabelData.pingInfo.status === 1,'red-bg': alertLabelData && alertLabelData.pingInfo && alertLabelData.pingInfo.status === 0}" class="active-icon"></div>
|
||||
<span v-if="alertLabelData">{{alertLabelData && alertLabelData.pingInfo && alertLabelData.pingInfo.rtt ? alertLabelData.pingInfo.rtt + 'ms':'--'}}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="alert-label-box">
|
||||
<div class="alert-label-title">Asset Type</div>
|
||||
<div class="alert-label-value">{{alertLabelData && alertLabelData.type && alertLabelData.type.name ? alertLabelData.type.name:'--'}}</div>
|
||||
</div>
|
||||
<div class="alert-label-box">
|
||||
<div class="alert-label-title">Brand</div>
|
||||
<div class="alert-label-value">{{alertLabelData && alertLabelData.brand && alertLabelData.brand.name ? alertLabelData.brand.name : '--'}}</div>
|
||||
</div>
|
||||
<div class="alert-label-box">
|
||||
<div class="alert-label-title">Model</div>
|
||||
<div class="alert-label-value">{{alertLabelData && alertLabelData.model && alertLabelData.model.name ? alertLabelData.model.name : '--'}}</div>
|
||||
</div>
|
||||
<div class="alert-label-box">
|
||||
<div class="alert-label-title">PingLastReply</div>
|
||||
<div class="alert-label-value">{{alertLabelData && alertLabelData.pingInfo && alertLabelData.pingInfo.lastUpdate ? alertLabelData.pingInfo.lastUpdate : '--'}}</div>
|
||||
</div>
|
||||
<div class="alert-label-box">
|
||||
<div class="alert-label-title">Alert</div>
|
||||
<div class="alert-label-value">
|
||||
<span v-if="alertLabelData" :class="alertLabelData && alertLabelData.alertNum > 0 ? 'danger' : 'success'">{{alertLabelData && alertLabelData.alertNum ? alertLabelData.alertNum : 0 + ' ' + alertActiveStr()}}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="alert-label-box">
|
||||
<div class="alert-label-title">DC</div>
|
||||
<div class="alert-label-value">{{alertLabelData && alertLabelData.dc && alertLabelData.dc.name ? alertLabelData.dc.name : '--'}}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="alert-label-info" v-if="type==='module'" v-loading="loading">
|
||||
<div class="alert-label-box">
|
||||
<div class="alert-label-title">ID</div>
|
||||
<div class="alert-label-value">{{alertLabelData?alertLabelData.id:''}}</div>
|
||||
</div>
|
||||
<div class="alert-label-box">
|
||||
<div class="alert-label-title">Name</div>
|
||||
<div class="alert-label-value">{{alertLabelData?alertLabelData.name:''}}</div>
|
||||
</div>
|
||||
<div class="alert-label-box">
|
||||
<div class="alert-label-title">Project</div>
|
||||
<div class="alert-label-value">{{alertLabelData?alertLabelData.project.name:''}}</div>
|
||||
</div>
|
||||
<div class="alert-label-box">
|
||||
<div class="alert-label-title">Description</div>
|
||||
<div class="alert-label-value">{{alertLabelData?(alertLabelData.remark?alertLabelData.remark:'-'):''}}</div>
|
||||
</div>
|
||||
<div class="alert-label-info" v-if="type==='module'" v-loading="loading">
|
||||
<div class="alert-label-box">
|
||||
<div class="alert-label-title">ID</div>
|
||||
<div class="alert-label-value">{{alertLabelData && alertLabelData.id ? alertLabelData.id : '--'}}</div>
|
||||
</div>
|
||||
<div class="alert-label-box">
|
||||
<div class="alert-label-title">Name</div>
|
||||
<div class="alert-label-value">{{alertLabelData && alertLabelData.name ? alertLabelData.name : '--'}}</div>
|
||||
</div>
|
||||
<div class="alert-label-box">
|
||||
<div class="alert-label-title">Project</div>
|
||||
<div class="alert-label-value">{{alertLabelData && alertLabelData.project && alertLabelData.project.name ?alertLabelData.project.name : '--'}}</div>
|
||||
</div>
|
||||
<div class="alert-label-box">
|
||||
<div class="alert-label-title">Description</div>
|
||||
<div class="alert-label-value">{{alertLabelData && alertLabelData.remark ? alertLabelData.remark : '-'}}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="alert-label-info" v-if="type==='project'" v-loading="loading">
|
||||
<div class="alert-label-box">
|
||||
<div class="alert-label-title">ID</div>
|
||||
<div class="alert-label-value">{{alertLabelData?alertLabelData.id:''}}</div>
|
||||
</div>
|
||||
<div class="alert-label-box">
|
||||
<div class="alert-label-title">Name</div>
|
||||
<div class="alert-label-value">{{alertLabelData?alertLabelData.name:''}}</div>
|
||||
</div>
|
||||
<div class="alert-label-box">
|
||||
<div class="alert-label-title">Description</div>
|
||||
<div class="alert-label-value">{{alertLabelData?(alertLabelData.remark?alertLabelData.remark:'-'):''}}</div>
|
||||
</div>
|
||||
<div class="alert-label-info" v-if="type==='project'" v-loading="loading">
|
||||
<div class="alert-label-box">
|
||||
<div class="alert-label-title">ID</div>
|
||||
<div class="alert-label-value">{{alertLabelData && alertLabelData ? alertLabelData.id : '--'}}</div>
|
||||
</div>
|
||||
<div class="alert-label-box">
|
||||
<div class="alert-label-title">Name</div>
|
||||
<div class="alert-label-value">{{alertLabelData && alertLabelData ? alertLabelData.name : '--'}}</div>
|
||||
</div>
|
||||
<div class="alert-label-box">
|
||||
<div class="alert-label-title">Description</div>
|
||||
<div class="alert-label-value">{{alertLabelData && alertLabelData.remark ? alertLabelData.remark : '--'}}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="alert-label-info" v-if="type==='endpoint'" v-loading="loading">
|
||||
<div class="alert-label-box">
|
||||
<div class="alert-label-title">ID</div>
|
||||
<div class="alert-label-value">{{alertLabelData?alertLabelData.id:''}}</div>
|
||||
</div>
|
||||
<div class="alert-label-box">
|
||||
<div class="alert-label-title">Project</div>
|
||||
<div class="alert-label-value">{{alertLabelData?alertLabelData.project.name:''}}</div>
|
||||
</div>
|
||||
<div class="alert-label-box">
|
||||
<div class="alert-label-title">Module</div>
|
||||
<div class="alert-label-value">{{alertLabelData?alertLabelData.module.name:''}}</div>
|
||||
</div>
|
||||
<div class="alert-label-box">
|
||||
<div class="alert-label-title">Labels</div>
|
||||
<div class="alert-label-value">{{alertLabelData?alertLabelData.labels:''}}</div>
|
||||
</div>
|
||||
<div class="alert-label-box">
|
||||
<div class="alert-label-title">Host</div>
|
||||
<div class="alert-label-value">{{alertLabelData?alertLabelData.host:''}}</div>
|
||||
</div>
|
||||
<div class="alert-label-box">
|
||||
<div class="alert-label-title">Port</div>
|
||||
<div class="alert-label-value">{{alertLabelData?alertLabelData.port:''}}</div>
|
||||
</div>
|
||||
<div class="alert-label-box">
|
||||
<div class="alert-label-title">Path</div>
|
||||
<div class="alert-label-value">{{alertLabelData?alertLabelData.path:''}}</div>
|
||||
</div>
|
||||
<div class="alert-label-info" v-if="type==='endpoint'" v-loading="loading">
|
||||
<div class="alert-label-box">
|
||||
<div class="alert-label-title">ID</div>
|
||||
<div class="alert-label-value">{{alertLabelData && alertLabelData.id ? alertLabelData.id : '--'}}</div>
|
||||
</div>
|
||||
<div class="alert-label-box">
|
||||
<div class="alert-label-title">Project</div>
|
||||
<div class="alert-label-value">{{alertLabelData && alertLabelData.project && alertLabelData.project.name ? alertLabelData.project.name : '--'}}</div>
|
||||
</div>
|
||||
<div class="alert-label-box">
|
||||
<div class="alert-label-title">Module</div>
|
||||
<div class="alert-label-value">{{alertLabelData && alertLabelData.module && alertLabelData.module.name ? alertLabelData.module.name : '--'}}</div>
|
||||
</div>
|
||||
<div class="alert-label-box">
|
||||
<div class="alert-label-title">Labels</div>
|
||||
<div class="alert-label-value">{{alertLabelData && alertLabelData.labels ? alertLabelData.labels : '--'}}</div>
|
||||
</div>
|
||||
<div class="alert-label-box">
|
||||
<div class="alert-label-title">Host</div>
|
||||
<div class="alert-label-value">{{alertLabelData && alertLabelData.host ? alertLabelData.host : '--'}}</div>
|
||||
</div>
|
||||
<div class="alert-label-box">
|
||||
<div class="alert-label-title">Port</div>
|
||||
<div class="alert-label-value">{{alertLabelData && alertLabelData.port ? alertLabelData.port : '--'}}</div>
|
||||
</div>
|
||||
<div class="alert-label-box">
|
||||
<div class="alert-label-title">Path</div>
|
||||
<div class="alert-label-value">{{alertLabelData && alertLabelData.path ? alertLabelData.path : '--'}}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -181,6 +177,28 @@ export default {
|
||||
},
|
||||
components: {
|
||||
|
||||
},
|
||||
watch: {
|
||||
id: {
|
||||
immediate: true,
|
||||
deep: true,
|
||||
handler (n) {
|
||||
this.init()
|
||||
}
|
||||
},
|
||||
that: {
|
||||
immediate: true,
|
||||
deep: true,
|
||||
handler (n) {
|
||||
}
|
||||
},
|
||||
LRTriangle: {
|
||||
immediate: true,
|
||||
deep: true,
|
||||
handler (n) {
|
||||
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
calcPosition () {
|
||||
@@ -215,6 +233,49 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
init () {
|
||||
this.loading = true
|
||||
if (this.type === 'asset') {
|
||||
this.$get('asset/asset/' + this.id).then((res) => {
|
||||
if (res.msg === 'success') {
|
||||
this.loading = false
|
||||
this.alertLabelData = res.data
|
||||
} else {
|
||||
this.$message.error(res.msg)
|
||||
}
|
||||
})
|
||||
}
|
||||
if (this.type === 'project') {
|
||||
this.$get('monitor/project/' + this.id).then((res) => {
|
||||
if (res.msg === 'success') {
|
||||
this.loading = false
|
||||
this.alertLabelData = res.data
|
||||
} else {
|
||||
this.$message.error(res.msg)
|
||||
}
|
||||
})
|
||||
}
|
||||
if (this.type === 'module') {
|
||||
this.$get('monitor/module/' + this.id).then((res) => {
|
||||
if (res.msg === 'success') {
|
||||
this.loading = false
|
||||
this.alertLabelData = res.data
|
||||
} else {
|
||||
this.$message.error(res.msg)
|
||||
}
|
||||
})
|
||||
}
|
||||
if (this.type === 'endpoint') {
|
||||
this.$get('monitor/endpoint/' + this.id).then((res) => {
|
||||
if (res.msg === 'success') {
|
||||
this.loading = false
|
||||
this.alertLabelData = res.data
|
||||
} else {
|
||||
this.$message.error(res.msg)
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
alertActiveStr () {
|
||||
return this.$t('overall.active')
|
||||
},
|
||||
@@ -226,48 +287,7 @@ export default {
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted () {
|
||||
if (this.type === 'asset') {
|
||||
this.$get('/asset/info?id=' + this.id).then((res) => {
|
||||
if (res.msg === 'success') {
|
||||
this.loading = false
|
||||
this.alertLabelData = res.data.Basic
|
||||
} else {
|
||||
this.$message.error(res.msg)
|
||||
}
|
||||
})
|
||||
}
|
||||
if (this.type === 'project') {
|
||||
this.$get('/project?id=' + this.id).then((res) => {
|
||||
if (res.msg === 'success') {
|
||||
this.loading = false
|
||||
this.alertLabelData = res.data.list[0]
|
||||
} else {
|
||||
this.$message.error(res.msg)
|
||||
}
|
||||
})
|
||||
}
|
||||
if (this.type === 'module') {
|
||||
this.$get('/module?id=' + this.id).then((res) => {
|
||||
if (res.msg === 'success') {
|
||||
this.loading = false
|
||||
this.alertLabelData = res.data.list[0]
|
||||
} else {
|
||||
this.$message.error(res.msg)
|
||||
}
|
||||
})
|
||||
}
|
||||
if (this.type === 'endpoint') {
|
||||
this.$get('/endpoint?id=' + this.id).then((res) => {
|
||||
if (res.msg === 'success') {
|
||||
this.loading = false
|
||||
this.alertLabelData = res.data.list[0]
|
||||
} else {
|
||||
this.$message.error(res.msg)
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
mounted () {},
|
||||
beforeDestroy () {
|
||||
|
||||
}
|
||||
|
||||
@@ -58,6 +58,8 @@
|
||||
<panel-tab-new v-if="from === fromRoute.chartTemp && targetTab === 'panel'" v-show="subResizeShow" :detail="detail" :from="from" :tabs="tabs.chartTemp.chartTempTabTitle" :obj="obj" :targetTab.sync="targetTab" @changeTab="changeTab"></panel-tab-new>
|
||||
<!--alertRule Tab-->
|
||||
<alertMessageTabNew v-if="from === fromRoute.alertRule && targetTab === 'alertRuleAlertMessage'" v-show="subResizeShow" :from="from" :obj="obj" :tabs="tabs.alertRule.alertRule" @changeTab="changeTab" :targetTab="targetTab"></alertMessageTabNew>
|
||||
<!--model 下滑-->
|
||||
<asset-tab v-if="(from === fromRoute.model) && targetTab === 'asset'" :tabs="tabs.model" ref="assetTab" :from="from" :obj="obj" @changeTab="changeTab" @exit="closeSubList"></asset-tab>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -157,26 +159,29 @@ export default {
|
||||
moduleTabTitle: [
|
||||
// { prop: 'panel', name: 'Detail' },
|
||||
{ prop: 'endpoint', name: this.$t('asset.endpoint') },
|
||||
{ prop: 'moduleAlertMessage', name: 'Alerts' }
|
||||
{ prop: 'moduleAlertMessage', name: this.$t('overall.alert') }
|
||||
]
|
||||
},
|
||||
endpoint: {
|
||||
endpointTabTitle: [
|
||||
// { prop: 'panel', name: 'Detail' },
|
||||
{ prop: 'endpointQuery', name: 'Query' },
|
||||
{ prop: 'endpointAlertMessage', name: 'Alerts' }
|
||||
{ prop: 'endpointAlertMessage', name: this.$t('overall.alert') }
|
||||
]
|
||||
},
|
||||
chartTemp: {
|
||||
chartTempTabTitle: [
|
||||
{ prop: 'panel', name: 'Template preview' }
|
||||
{ prop: 'panel', name: this.$t('overall.tempPrev') }
|
||||
]
|
||||
},
|
||||
alertRule: {
|
||||
alertRule: [
|
||||
{ prop: 'alertRuleAlertMessage', name: 'Alerts' }
|
||||
{ prop: 'alertRuleAlertMessage', name: this.$t('overall.alert') }
|
||||
]
|
||||
},
|
||||
model: [
|
||||
{ prop: 'asset', name: this.$t('asset.assets'), active: true }
|
||||
],
|
||||
dc: {
|
||||
cabinet: [
|
||||
{ prop: 'cabinet', name: this.$t('config.dc.cabinets'), active: true },
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<div>
|
||||
<div class="top-tools top-tools--sub">
|
||||
<div class="top-tool-left">
|
||||
<div class="sub-list-title">{{title}}:<slot name="title"></slot></div>
|
||||
<div class="sub-list-title">{{bottomHeaderTitle}}:<slot name="title"></slot></div>
|
||||
<div class="sub-list-tabs">
|
||||
<div v-for="tab in tabs" :key="tab.prop" :class="{'sub-list-tab--active': tab.active || tab.prop=== targetTab}" class="sub-list-tab" @click="changeTab(tab.prop)">{{tab.name}}</div>
|
||||
</div>
|
||||
@@ -82,8 +82,12 @@ export default {
|
||||
default: true
|
||||
},
|
||||
title: {
|
||||
type: String,
|
||||
default: 'Name'
|
||||
type: String
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
bottomHeaderTitle () {
|
||||
return this.title || this.$t('overall.name')
|
||||
}
|
||||
},
|
||||
data () {
|
||||
|
||||
@@ -198,7 +198,7 @@ export default {
|
||||
disabled: false
|
||||
}, {
|
||||
id: 20,
|
||||
name: this.$t('project.project.project'),
|
||||
name: this.$t('project.project.projectName'),
|
||||
type: 'project',
|
||||
label: 'project',
|
||||
disabled: false
|
||||
@@ -272,7 +272,7 @@ export default {
|
||||
return (key, value) => {
|
||||
if (key == 'type') {
|
||||
if (value == 1) {
|
||||
value = this.$t('project.project.project')
|
||||
value = this.$t('project.project.projectName')
|
||||
} else if (value == 2) {
|
||||
value = this.$t('module.module.module')
|
||||
} else if (value == 3) {
|
||||
|
||||
@@ -52,6 +52,7 @@ import subDataListMixin from '@/components/common/mixin/subDataList'
|
||||
import nzBottomDataList from '@/components/common/bottomBox/nzBottomDataList'
|
||||
import assetTable from '@/components/common/table/asset/assetTable'
|
||||
import assetBox from '@/components/common/rightBox/asset/assetBox'
|
||||
import {fromRoute} from "@/components/common/js/constants";
|
||||
export default {
|
||||
name: 'assetTab',
|
||||
mixins: [dataListMixin, subDataListMixin],
|
||||
@@ -193,6 +194,10 @@ export default {
|
||||
deep: true,
|
||||
handler (n, o) {
|
||||
this.searchLabel.dcIds = n.id
|
||||
if ( this.from === fromRoute.model) {
|
||||
delete this.searchLabel.dcIds
|
||||
this.searchLabel.modelIds = n.id
|
||||
}
|
||||
this.getTableData()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -193,7 +193,7 @@ export default {
|
||||
prop: 'id',
|
||||
show: true
|
||||
}, {
|
||||
label: this.$t('project.project.project'),
|
||||
label: this.$t('project.project.projectName'),
|
||||
prop: 'project',
|
||||
show: true,
|
||||
width: '120'
|
||||
@@ -288,7 +288,7 @@ export default {
|
||||
readonly: true
|
||||
}, {
|
||||
id: 34,
|
||||
name: this.$t('project.project.project'),
|
||||
name: this.$t('project.project.projectName'),
|
||||
// name: this.$t('asset.asset'),
|
||||
type: 'input',
|
||||
label: 'projectName',
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
</template>
|
||||
</nz-bottom-data-list>
|
||||
<transition name="right-box">
|
||||
<edit-endpoint-box-new v-if="rightBox.editShow" :module="object" @close="closeRightEditBox" :disabled="true" :type="'edit'"></edit-endpoint-box-new>
|
||||
<edit-endpoint-box-new v-if="rightBox.editShow" :module="object" @close="closeRightEditBox" :disabled="true" :optionType="'edit'"></edit-endpoint-box-new>
|
||||
</transition>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -1,6 +1,11 @@
|
||||
<template>
|
||||
<div :class="['delete-button',(deleteObjs.length<1?'':'delete-button-light')]">
|
||||
<button :id="id" :class="{'nz-btn-disabled' : deleteObjs.length<1}" class="top-tool-btn top-tool-btn--delete" @click="batchDelete"><span><i class="nz-icon nz-icon-delete" ></i></span></button>
|
||||
<button v-if="this.type === 'button'" :id="id" :class="{'nz-btn-disabled' : deleteObjs.length<1}" class="top-tool-btn top-tool-btn--delete" @click="batchDelete">
|
||||
<span><i class="nz-icon nz-icon-delete" ></i></span>
|
||||
</button>
|
||||
<div v-if="this.type === 'link'" :id="id" :class="{'nz-btn-disabled' : deleteObjs.length<1}" class="top-tool-btn top-tool-btn--delete" @click="batchDelete">
|
||||
<span><i class="nz-icon nz-icon-delete" ></i>{{title}}</span>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -12,7 +17,14 @@ export default {
|
||||
deleteObjs: Array,
|
||||
api: String,
|
||||
clickFunction: Function,
|
||||
id: String
|
||||
id: String,
|
||||
type: {
|
||||
type: String,
|
||||
default: 'button'
|
||||
},
|
||||
title: {
|
||||
type: String
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
batchDelete: function () {
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
</template>
|
||||
<template v-for="(item, index) in linkData">
|
||||
<el-menu-item :key="index" :index="'0-' + index">
|
||||
<span class="linkTitle"><a :href='item.url' :title="item.name" class="nz-a" rel="noopener norefferrer" target="_blank">{{item.name}}</a></span>
|
||||
<span class="linkTitle"><a :href='item.url' :title="item.name" class="nz-a" rel="noopener noreferrer" target="_blank">{{item.name}}</a></span>
|
||||
</el-menu-item>
|
||||
</template>
|
||||
</el-submenu>
|
||||
@@ -253,7 +253,7 @@ export default {
|
||||
},
|
||||
createMenu: [ // 新增按钮内容
|
||||
{
|
||||
label: this.$t('project.project.project'),
|
||||
label: this.$t('project.project.projectName'),
|
||||
url: 'project',
|
||||
type: 1,
|
||||
permission: 'header_add_project'
|
||||
|
||||
@@ -10,7 +10,7 @@ export function resetZIndex (e) {
|
||||
}
|
||||
export function getUUID () {
|
||||
function S4 () {
|
||||
return (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1)
|
||||
return (((1 + window.crypto.getRandomValues(new Uint32Array(10))[0]) * 0x10000) | 0).toString(16).substring(1)
|
||||
}
|
||||
|
||||
return (S4() + S4() + '-' + S4() + '-' + S4() + '-' + S4() + '-' + S4() + S4() + S4())
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
function randomcolor () {
|
||||
function randomcolor () {/*
|
||||
let e = null
|
||||
const t = {}
|
||||
r('monochrome', null, [
|
||||
@@ -309,7 +309,7 @@ function randomcolor () {
|
||||
return [t, Math.round(n * s / (o < 1 ? o : 2 - o) * 1e4) / 100, o / 2 * 100]
|
||||
}
|
||||
return n()
|
||||
}
|
||||
*/}
|
||||
|
||||
export {
|
||||
randomcolor
|
||||
|
||||
@@ -122,7 +122,11 @@ const cn = {
|
||||
moreOption: '更多选项',
|
||||
copy: '复制',
|
||||
silence: '静默',
|
||||
labels: '标签'
|
||||
labels: '标签',
|
||||
editType: '类型',
|
||||
searchCondition: '搜索条件',
|
||||
batchDel: '批量删除',
|
||||
tempPrev: '模板预览'
|
||||
},
|
||||
setup: {
|
||||
step0: '欢迎',
|
||||
@@ -1193,7 +1197,7 @@ const cn = {
|
||||
},
|
||||
project: {
|
||||
project: '名称',
|
||||
projectName: '系统名称',
|
||||
projectName: '系统',
|
||||
editProject: '编辑系统',
|
||||
description: '描述',
|
||||
createProject: '新增系统'
|
||||
|
||||
@@ -127,7 +127,11 @@ const en = {
|
||||
labels: 'Labels',
|
||||
moreOption: 'More option',
|
||||
copy: 'Copy',
|
||||
silence: 'Silence'
|
||||
silence: 'Silence',
|
||||
editType: 'Type',
|
||||
searchCondition: 'Search condition',
|
||||
batchDel: 'Batches delete',
|
||||
tempPrev: 'Template preview'
|
||||
},
|
||||
pageSize: '/page',
|
||||
setup: {
|
||||
@@ -1203,7 +1207,7 @@ const en = {
|
||||
},
|
||||
project: {
|
||||
project: 'Name', // "系统"
|
||||
projectName: 'Project name', // "系统名称"
|
||||
projectName: 'Project', // "系统名称"
|
||||
editProject: 'Edit project', // "编辑系统"
|
||||
description: 'Description', // "描述"
|
||||
createProject: 'New project'// "新增系统"
|
||||
|
||||
@@ -26,7 +26,6 @@ export default {
|
||||
tableOperation ([command, row, param]) {
|
||||
switch (command) {
|
||||
case 'edit': {
|
||||
console.info(1, command, row)
|
||||
this.$emit('edit', row)
|
||||
break
|
||||
}
|
||||
|
||||
@@ -158,7 +158,7 @@ export default {
|
||||
rollbackImport () {
|
||||
let url
|
||||
if (this.importUrl.indexOf('asset') > -1) {
|
||||
url = '/asset/cancelImport'
|
||||
url = '/asset/asset/cancelImport'
|
||||
} else if (this.importUrl.indexOf('endpoint') > -1) {
|
||||
url = '/monitor/endpoint/cancelImport'
|
||||
} else if (this.importUrl.indexOf('rule') > -1) {
|
||||
@@ -227,7 +227,7 @@ export default {
|
||||
|
||||
let url = null
|
||||
if (this.importUrl.indexOf('asset') > -1) {
|
||||
url = '/asset/template'
|
||||
url = '/asset/asset/template'
|
||||
} else if (this.importUrl.indexOf('rule') > -1) {
|
||||
url = '/alert/rule/template'
|
||||
} else if (this.importUrl.indexOf('panel') > -1) {
|
||||
|
||||
@@ -1884,8 +1884,14 @@ export default {
|
||||
outline: none;
|
||||
}
|
||||
|
||||
/deep/ .el-input-number:focus {
|
||||
.el-input-number__decrease, .el-input-number__increase {
|
||||
visibility: visible;
|
||||
outline: none;
|
||||
}
|
||||
}
|
||||
/deep/ .el-input-number:focus-within {
|
||||
/deep/ .el-input-number__decrease, /deep/ .el-input-number__increase {
|
||||
.el-input-number__decrease, .el-input-number__increase {
|
||||
visibility: visible;
|
||||
outline: none;
|
||||
}
|
||||
|
||||
@@ -203,7 +203,7 @@ export default {
|
||||
return (key, value) => {
|
||||
if (key == 'type') {
|
||||
if (value == 1) {
|
||||
value = this.$t('project.project.project')
|
||||
value = this.$t('project.project.projectName')
|
||||
} else if (value == 2) {
|
||||
value = this.$t('module.module.module')
|
||||
} else if (value == 3) {
|
||||
@@ -284,7 +284,7 @@ export default {
|
||||
disabled: false
|
||||
}, {
|
||||
id: 22,
|
||||
name: this.$t('project.project.project'),
|
||||
name: this.$t('project.project.projectName'),
|
||||
type: 'project',
|
||||
label: 'project',
|
||||
disabled: false
|
||||
|
||||
@@ -130,7 +130,7 @@ export default {
|
||||
return (key, value) => {
|
||||
if (key == 'type') {
|
||||
if (value == 1) {
|
||||
value = this.$t('project.project.project')
|
||||
value = this.$t('project.project.projectName')
|
||||
} else if (value == 2) {
|
||||
value = this.$t('module.module.module')
|
||||
} else if (value == 3) {
|
||||
|
||||
@@ -116,7 +116,7 @@ export default {
|
||||
return (key, value) => {
|
||||
if (key == 'type') {
|
||||
if (value == 1) {
|
||||
value = this.$t('project.project.project')
|
||||
value = this.$t('project.project.projectName')
|
||||
} else if (value == 2) {
|
||||
value = this.$t('module.module.module')
|
||||
} else if (value == 3) {
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
<div class="right-box-form-box right-box__container" style="overflow: hidden">
|
||||
<el-form class="right-box-form right-box-form-left" label-position = "top" ref="addEndpoint" :model="endpoint" :rules="rules">
|
||||
<!--project-->
|
||||
<el-form-item :label='$t("project.project.project")' prop="projectId" class="select-warp">
|
||||
<el-form-item :label='$t("project.project.projectName")' prop="projectId" class="select-warp">
|
||||
<el-select @change="((val) => {changeProject(val)})" value-key="id" popper-class="config-dropdown" v-model="currentProjectCopy" placeholder="" size="small" id="add-endpoint-project">
|
||||
<el-option v-for="item in projectList" :key="item.id" :label="item.name" :value="item" :id="'project-'+item.id"></el-option>
|
||||
</el-select>
|
||||
|
||||
@@ -3,14 +3,14 @@
|
||||
<div class="right-box__header">
|
||||
<div class="header__title">{{$t('asset.batchEditAsset')}}</div>
|
||||
<div class="header__operation">
|
||||
<span><i class="nz-icon nz-icon-close"></i></span>
|
||||
<span @click="esc"><i class="nz-icon nz-icon-close"></i></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="right-box__container">
|
||||
<div class="container__form">
|
||||
<!-- Edit type -->
|
||||
<el-form ref="assetEditForm" :model="editData" :rules="rules" label-position="top" label-width="120px">
|
||||
<el-form-item :label="$t('overall.name')" prop="editType">
|
||||
<el-form-item :label="$t('overall.editType')" prop="editType">
|
||||
<el-select v-model="editData.editType" class="right-box__select" popper-class="right-box-select-dropdown prevent-clickoutside" size="small" value-key="value">
|
||||
<el-option v-for="type in assetConstants.editTypeOptions" :key="type.value" :label="type.label" :value="type.value"/>
|
||||
</el-select>
|
||||
|
||||
@@ -373,7 +373,7 @@ export default {
|
||||
disabled: false
|
||||
}, {
|
||||
id: 34,
|
||||
name: this.$t('project.project.project'),
|
||||
name: this.$t('project.project.projectName'),
|
||||
// name: this.$t('asset.asset'),
|
||||
type: 'input',
|
||||
label: 'projectName',
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
<div class="right-box-form-box">
|
||||
<el-form class="right-box-form right-box-form-left" :model="editEndpoint" label-position = "top" label-width="120px" :rules="rules" ref="endpointForm">
|
||||
<!--project-->
|
||||
<el-form-item :label="$t('project.project.project')" prop="project.id">
|
||||
<el-form-item :label="$t('project.project.projectName')" prop="project.id">
|
||||
<el-select @change="((val) => {changeProject(val);})" value-key="id" popper-class="config-dropdown" v-model="editEndpoint.projectId" placeholder="" size="small" id="edit-endpoint-input-project">
|
||||
<el-option :id="'edit-project-'+item.id" v-for="item in projectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
|
||||
</el-select>
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
<el-input placeholder="" maxlength="64" show-word-limit v-model="editEndpoint.name" size="small" id="module-box-input-name"></el-input>
|
||||
</el-form-item>
|
||||
<!--project-->
|
||||
<el-form-item :label='$t("project.project.project")' prop="projectId">
|
||||
<el-form-item :label='$t("project.project.projectName")' prop="projectId">
|
||||
<el-select value-key="id" popper-class="config-dropdown" v-model="editEndpoint.projectId" placeholder="" size="small" id="module-box-input-project" @change="changeProject" :disabled="disabled">
|
||||
<el-option :id="'module-project-'+item.id" v-for="item in projectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
|
||||
</el-select>
|
||||
@@ -121,18 +121,18 @@
|
||||
</el-form-item>
|
||||
<transition name="el-zoom-in-top">
|
||||
<div v-show="showAllBasicOption" >
|
||||
<!--name pattern-->
|
||||
<el-form-item :label='$t("project.endpoint.pattern")' prop="pattern" class="half-form-item">
|
||||
<!-- <el-input placeholder="" v-model=""></el-input>-->
|
||||
<el-autocomplete
|
||||
class="inline-input"
|
||||
size="small"
|
||||
id="module-box-input-pattern"
|
||||
v-model="editEndpoint.endpointNameTmpl"
|
||||
:fetch-suggestions="querySearch"
|
||||
placeholder="请输入内容"
|
||||
></el-autocomplete>
|
||||
</el-form-item>
|
||||
<!-- <!–name pattern–>-->
|
||||
<!-- <el-form-item :label='$t("project.endpoint.pattern")' prop="pattern" class="half-form-item">-->
|
||||
<!-- <!– <el-input placeholder="" v-model=""></el-input>–>-->
|
||||
<!-- <el-autocomplete-->
|
||||
<!-- class="inline-input"-->
|
||||
<!-- size="small"-->
|
||||
<!-- id="module-box-input-pattern"-->
|
||||
<!-- v-model="editEndpoint.endpointNameTmpl"-->
|
||||
<!-- :fetch-suggestions="querySearch"-->
|
||||
<!-- placeholder="请输入内容"-->
|
||||
<!-- ></el-autocomplete>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!--scrape_interval-->
|
||||
<el-form-item :label='$t("project.endpoint.scrape_interval")' prop="scrape_interval" class="half-form-item">
|
||||
<el-input :placeholder='$t("project.endpoint.scrape_interval_placeholder")' v-model.number="editEndpoint.configs.scrape_interval" size="small" id="module-box-input-scrape_interval">
|
||||
|
||||
@@ -122,7 +122,7 @@
|
||||
id="module-box-input-pattern"
|
||||
v-model="editModule.endpointNameTmpl"
|
||||
:fetch-suggestions="querySearch"
|
||||
placeholder="请输入内容"
|
||||
:placeholder="$t('overall.placeHolder')"
|
||||
></el-autocomplete>
|
||||
</el-form-item>
|
||||
<!--scrape_interval-->
|
||||
|
||||
@@ -128,7 +128,7 @@ import table from '@/components/common/mixin/table'
|
||||
import nzAlertTag from '../../../page/alert/nzAlertTag'
|
||||
import chartDataFormat from '../../../charts/chartDataFormat'
|
||||
import alertRuleInfo from '../../alert/alertRuleInfo'
|
||||
import alertLabel from '../../alert/alertLabel2'
|
||||
import alertLabel from '../../alert/alertLabel'
|
||||
import { calcDurationByStringTimeB } from '../../js/tools'
|
||||
export default {
|
||||
name: 'alertMessageTable',
|
||||
@@ -224,7 +224,7 @@ export default {
|
||||
return (key, value) => {
|
||||
if (key == 'type') {
|
||||
if (value == 1) {
|
||||
value = this.$t('project.project.project')
|
||||
value = this.$t('project.project.projectName')
|
||||
} else if (value == 2) {
|
||||
value = this.$t('module.module.module')
|
||||
} else if (value == 3) {
|
||||
|
||||
@@ -60,13 +60,14 @@
|
||||
fixed="right">
|
||||
<div slot="header" class="table-operation-title">{{$t('overall.option')}}</div>
|
||||
<div slot-scope="scope" class="table-operation-items">
|
||||
<button class="table-operation-item" @click="showBottomBox('operationLogTab', scope.row)"><i class="nz-icon nz-icon-view1"></i></button>
|
||||
<button class="table-operation-item" @click="$emit('edit', scope.row)"><i class="nz-icon nz-icon-edit"></i></button>
|
||||
<!-- <button class="table-operation-item" @click="showBottomBox('operationLogTab', scope.row)"><i class="nz-icon nz-icon-view1"></i></button>-->
|
||||
<el-dropdown size="medium" trigger="hover" @command="tableOperation">
|
||||
<div class="table-operation-item table-operation-item--more">
|
||||
<span>…</span><i class="nz-icon nz-icon-arrow-down"></i>
|
||||
</div>
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item :command="['edit', scope.row]"><i class="nz-icon nz-icon-edit"></i><span class="operation-dropdown-text">{{$t('overall.edit')}}</span></el-dropdown-item>
|
||||
<!-- <el-dropdown-item :command="['edit', scope.row]"><i class="nz-icon nz-icon-edit"></i><span class="operation-dropdown-text">{{$t('overall.edit')}}</span></el-dropdown-item>-->
|
||||
<el-dropdown-item :command="['delete', scope.row]" :disabled="scope.row.id === 1"><i class="nz-icon nz-icon-delete"></i><span class="operation-dropdown-text">{{$t('overall.delete')}}</span></el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
@@ -88,19 +89,19 @@ export default {
|
||||
prop: 'id',
|
||||
show: true,
|
||||
width: 80,
|
||||
sortable:'custom'
|
||||
sortable: 'custom'
|
||||
}, {
|
||||
label: this.$t('config.model.name'),
|
||||
prop: 'name',
|
||||
show: true,
|
||||
width: 160,
|
||||
sortable:'custom'
|
||||
width: 450,
|
||||
sortable: 'custom'
|
||||
}, {
|
||||
label: this.$t('config.model.brand'),
|
||||
prop: 'brand',
|
||||
show: true,
|
||||
width: 160
|
||||
,sortable:'custom'
|
||||
width: 160,
|
||||
sortable: 'custom'
|
||||
}, {
|
||||
label: this.$t('config.model.remark'),
|
||||
prop: 'remark',
|
||||
@@ -110,7 +111,7 @@ export default {
|
||||
prop: 'assetNum',
|
||||
show: true,
|
||||
width: 200,
|
||||
sortable:'custom'
|
||||
sortable: 'custom'
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -118,7 +119,7 @@ export default {
|
||||
methods: {
|
||||
|
||||
},
|
||||
created() {
|
||||
created () {
|
||||
},
|
||||
computed: {
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ export default {
|
||||
height: calc(100% - 50px);
|
||||
background-color: #f6f6f6;
|
||||
width: 100%;
|
||||
|
||||
padding-right: 10px;
|
||||
&>div {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
<el-dropdown-item v-for="(item, index) in linkData" :key="index" :index="'0-' + index">
|
||||
<span class="link-title">
|
||||
<i class="nz-icon nz-icon-link"></i>
|
||||
<a :href='item.url' :title="item.name" class="nz-a" target="_blank">{{item.name}}</a>
|
||||
<a :href='item.url' rel="noopener noreferrer" :title="item.name" class="nz-a" target="_blank">{{item.name}}</a>
|
||||
</span>
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
@@ -79,7 +79,7 @@ export default {
|
||||
// 顶部菜单相关
|
||||
createMenu: [ // 新增按钮内容
|
||||
{
|
||||
label: this.$t('project.project.project'),
|
||||
label: this.$t('project.project.projectName'),
|
||||
url: 'project',
|
||||
type: 1,
|
||||
permission: 'header_add_project'
|
||||
|
||||
@@ -89,7 +89,7 @@
|
||||
<div slot="title">
|
||||
{{$t("project.endpoint.dialogTitle")}}
|
||||
<div class="float-right panel-calendar dialog-tool" style="display: flex">
|
||||
<pick-time v-model="searchTime" :refresh-data-func="queryChartDate" :use-chart-unit="false" :use-refresh="false" style="height: 28px;" @unitChange="chartUnitChange"></pick-time>
|
||||
<pick-time v-model="searchTimeDialog" :refresh-data-func="queryChartDate" :use-chart-unit="false" :use-refresh="false" style="height: 28px;" @unitChange="chartUnitChange"></pick-time>
|
||||
</div>
|
||||
</div>
|
||||
<chart ref="messageChart" :unit="chartUnit" name="alertMessageChart"></chart>
|
||||
@@ -132,6 +132,7 @@ export default {
|
||||
sameLabels: ['instance', 'module', 'project', 'asset', 'endpoint', 'datacenter'],
|
||||
legend: [],
|
||||
searchTime: [],
|
||||
searchTimeDialog: [],
|
||||
searchTimeSelect: bus.getTimezontDateRange(),
|
||||
currentMsg: {},
|
||||
chartUnit: 5,
|
||||
@@ -193,7 +194,7 @@ export default {
|
||||
return (key, value) => {
|
||||
if (key == 'type') {
|
||||
if (value == 1) {
|
||||
value = this.$t('project.project.project')
|
||||
value = this.$t('project.project.projectName')
|
||||
} else if (value == 2) {
|
||||
value = this.$t('module.module.module')
|
||||
} else if (value == 3) {
|
||||
@@ -227,10 +228,12 @@ export default {
|
||||
})
|
||||
},
|
||||
messageDetail (row) {
|
||||
this.currentMsg = { ...row }
|
||||
this.graphShow = true
|
||||
this.$nextTick(() => {
|
||||
this.queryChartDate()
|
||||
this.$get('/alert/rule/' + row.alertRule.id).then(res => {
|
||||
this.currentMsg = { ...row, alertRule: { ...res.data } }
|
||||
this.graphShow = true
|
||||
this.$nextTick(() => {
|
||||
this.queryChartDate()
|
||||
})
|
||||
})
|
||||
},
|
||||
queryMessage (alertMessage) {
|
||||
@@ -245,7 +248,7 @@ export default {
|
||||
// const end = this.searchTime[1] ? this.searchTime[1] : getTime(0, 'h')
|
||||
const start = this.currentMsg.startAt
|
||||
const end = this.currentMsg.endAt
|
||||
this.searchTime = [start, end]
|
||||
this.searchTimeDialog = [start, end]
|
||||
const timeDiff = (new Date(end).getTime() - new Date(start).getTime()) / 1000 / (24 * 60 * 60)
|
||||
let step = '15s'
|
||||
if (timeDiff < 1) {
|
||||
@@ -321,7 +324,7 @@ export default {
|
||||
chartData.name += '}'
|
||||
const legend = {
|
||||
name: chartData.name,
|
||||
alias: alias,
|
||||
alias: chartData.name,
|
||||
isGray: false
|
||||
}
|
||||
this.legend.push(legend)
|
||||
@@ -342,7 +345,7 @@ export default {
|
||||
this.$refs.messageChart.endLoading()
|
||||
})
|
||||
} catch (err) {
|
||||
this.$message.error(err)
|
||||
// this.$message.error(err)
|
||||
this.$refs.messageChart.endLoading()
|
||||
}
|
||||
})
|
||||
@@ -410,13 +413,14 @@ export default {
|
||||
promQueryParamConvert (obj) {
|
||||
let r = '(' + obj.alertRule.expr + ')'
|
||||
let intoLabels = false
|
||||
obj.labels = JSON.parse(obj.labels)
|
||||
if (Object.keys(obj.labels).length > 0) {
|
||||
r += (function () {
|
||||
let group = ' and ' + '(group({'
|
||||
let by = ' by ('
|
||||
|
||||
for (const k in obj.labels) {
|
||||
if (k != 'alertname' && k != 'severity') {
|
||||
if (k != 'alertname' && k != 'severity' && k != 'severity_id') {
|
||||
intoLabels = true
|
||||
group += k
|
||||
group += '='
|
||||
@@ -581,7 +585,26 @@ export default {
|
||||
this.$refs.dataTable.$refs.dataTable.bodyWrapper.scrollTop = 0
|
||||
}
|
||||
this.getTableData()
|
||||
}
|
||||
},
|
||||
computeDistance (str) {
|
||||
let width = 0
|
||||
const html = document.createElement('span')
|
||||
html.innerText = str
|
||||
html.className = 'getTextWidth'
|
||||
document.querySelector('body').appendChild(html)
|
||||
width = document.querySelector('.getTextWidth').offsetWidth
|
||||
document.querySelector('.getTextWidth').remove()
|
||||
return Number('-' + (width + 5))
|
||||
},
|
||||
returnMarkArea () {
|
||||
if (this.currentMsg) {
|
||||
if (this.currentMsg.alertRule.operator == '>' || this.currentMsg.alertRule.operator == '>=') {
|
||||
return [{ yAxis: this.currentMsg.alertRule.threshold }, {}]
|
||||
} else {
|
||||
return [{}, { yAxis: this.currentMsg.alertRule.threshold }]
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -10,30 +10,36 @@
|
||||
@search="search"
|
||||
>
|
||||
<template v-slot:top-tool-right>
|
||||
<button id="asset-filter" :class="{ 'is-focus': dataListLayout.indexOf('clickSearch') > -1 }" class="top-tool-btn margin-r-10" @click.stop="showClickSearch">
|
||||
<i class="nz-icon nz-icon-funnel"></i>
|
||||
<button id="asset-create-asset" v-has="'asset_add'" :title="$t('overall.createAsset')" class="top-tool-btn" @click.stop="add">
|
||||
<i class="nz-icon nz-icon-create-square"></i>
|
||||
</button>
|
||||
<export-excel
|
||||
ref="export"
|
||||
id="asset-list"
|
||||
:params="searchLabel"
|
||||
:permissions="{import: 'asset_add', export: 'asset_view'}"
|
||||
class="top-tool-export margin-r-10"
|
||||
export-file-name="asset"
|
||||
<top-tool-more-options
|
||||
id="model"
|
||||
:params="filter"
|
||||
:permissions="{
|
||||
import: 'asset_add',
|
||||
export: 'asset_view'
|
||||
}"
|
||||
class="top-tool-export margin-l-10 margin-r-10"
|
||||
export-file-name="chart"
|
||||
export-url="/asset/asset/export"
|
||||
import-url="/asset/asset/import"
|
||||
@afterImport="getTableData"
|
||||
>
|
||||
<template slot="optionZone">
|
||||
<button id="asset-create-asset" v-has="'asset_add'" :title="$t('overall.createAsset')" class="top-tool-btn" @click.stop="add">
|
||||
<i class="nz-icon nz-icon-create-square"></i>
|
||||
</button>
|
||||
<template v-slot:before>
|
||||
<div>
|
||||
<el-dropdown-item>
|
||||
<div id="asset-batch-asset" v-has="'asset_edit'" @click.stop="batchEdit"><i class="nz-icon nz-icon-batch-edit"></i>{{$t('overall.batchEdit')}}</div>
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item>
|
||||
<div id="asset-filte" :class="{ 'is-focus': dataListLayout.indexOf('clickSearch') > -1 }" v-has="'asset_edit'" @click.stop="showClickSearch"><i class="nz-icon nz-icon-funnel"></i>{{$t('overall.searchCondition')}}</div>
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item>
|
||||
<delete-button :type="'link'" :title="$t('overall.batchDel')" id="asset-list-batch-delete" v-has="'asset_delete'" :api="url" :delete-objs="batchDeleteObjs" @after="getTableData" @before="delFlag=true"></delete-button>
|
||||
</el-dropdown-item>
|
||||
</div>
|
||||
</template>
|
||||
</export-excel>
|
||||
<button id="asset-batch-asset" v-has="'asset_edit'" :title="$t('overall.batchEdit')" class="top-tool-btn margin-r-10" @click.stop="batchEdit">
|
||||
<i class="nz-icon nz-icon-batch-edit"></i>
|
||||
</button>
|
||||
<delete-button id="asset-list-batch-delete" v-has="'asset_delete'" :api="url" :delete-objs="batchDeleteObjs" @after="getTableData" @before="delFlag=true"></delete-button>
|
||||
</top-tool-more-options>
|
||||
</template>
|
||||
<template v-slot:search>
|
||||
<click-search ref="clickSearch" :select-value.sync="selectValue" :title-search-list="titleSearchList" @reload="reloadTable"/>
|
||||
@@ -85,7 +91,6 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import exportXLSX from '@/components/common/exportXLSX'
|
||||
import deleteButton from '@/components/common/deleteButton'
|
||||
import assetBox from '@/components/common/rightBox/asset/assetBox'
|
||||
import assetBatchEditBox from '@/components/common/rightBox/asset/assetBatchEditBox'
|
||||
@@ -93,6 +98,7 @@ import nzDataList from '@/components/common/table/nzDataList'
|
||||
import dataListMixin from '@/components/common/mixin/dataList'
|
||||
import assetTable from '@/components/common/table/asset/assetTable'
|
||||
import clickSearch from '@/components/common/labelFilter/clickSearch'
|
||||
import topToolMoreOptions from '@/components/common/popBox/topToolMoreOptions'
|
||||
|
||||
export default {
|
||||
name: 'asset',
|
||||
@@ -103,7 +109,7 @@ export default {
|
||||
assetBatchEditBox,
|
||||
assetTable,
|
||||
clickSearch,
|
||||
'export-excel': exportXLSX
|
||||
topToolMoreOptions
|
||||
},
|
||||
mixins: [dataListMixin],
|
||||
data () {
|
||||
|
||||
@@ -86,7 +86,7 @@
|
||||
<div v-show="showIntroduce" class="introduce-view">
|
||||
<div class="info-room">
|
||||
<div class="col-md-9 doc-content">
|
||||
<h1 class="page-header">Query examples<a class="header-anchor" href="https://prometheus.io/docs/prometheus/latest/querying/examples/" target="_blank" rel="noopener norefferrer"><i style="font-size: 16px;" class="nz-icon nz-icon-link1"></i></a></h1>
|
||||
<h1 class="page-header">Query examples<a class="header-anchor" href="https://prometheus.io/docs/prometheus/latest/querying/examples/" target="_blank" rel="noopener noreferrer"><i style="font-size: 16px;" class="nz-icon nz-icon-link1"></i></a></h1>
|
||||
<div class="content-divider"></div>
|
||||
<h2 >
|
||||
Simple time series selection
|
||||
|
||||
@@ -458,7 +458,7 @@ const tooltipPieOption = {
|
||||
{
|
||||
type: 'pie',
|
||||
animation: false,
|
||||
center: ['25%', '60%'],
|
||||
center: ['25%', '53%'],
|
||||
radius: [36, 48],
|
||||
data: [],
|
||||
label: {
|
||||
|
||||
@@ -621,6 +621,9 @@
|
||||
padding-bottom: 5px;
|
||||
box-shadow: 1px 2px 4px 0 rgba(0, 0, 0, 0.12), -1px 1px 4px -1px rgba(205, 205, 205, 0.47);
|
||||
}
|
||||
#tooltip-chart--endpoint{
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
}
|
||||
}
|
||||
.over-num{
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div class="panel list-page">
|
||||
<div class="main-list">
|
||||
<div class="main-container">
|
||||
<div class="main-container" style="padding-right: 0">
|
||||
<div class="top-tools">
|
||||
<div v-if="panelData.length == 0" class="top-tool-left" style="margin-left: 10px;">
|
||||
<button id="panel-add-panel" class="nz-btn nz-btn-style-light nz-btn-size-small" @click="toAdd"><i class="nz-icon nz-icon-create-square"></i> {{$t("dashboard.panel.createPanelTitleSec")}}</button>
|
||||
|
||||
@@ -103,7 +103,6 @@ export default new Vue({
|
||||
'm+': time.getMinutes(), // 分
|
||||
's+': time.getSeconds(), // 秒
|
||||
'q+': Math.floor((time.getMonth() + 3) / 3), // 季度
|
||||
a: time.getHours() > 12 ? 'pm' : 'am',
|
||||
S: time.getMilliseconds(), // 毫秒
|
||||
w: week
|
||||
}
|
||||
@@ -117,7 +116,6 @@ export default new Vue({
|
||||
: ((`00${o[k]}`).substr((`${o[k]}`).length)))
|
||||
}
|
||||
})
|
||||
fm = fm.replace('h', time.getHours() > 12 ? time.getHours() - 12 : time.getHours())
|
||||
return fm
|
||||
},
|
||||
// 格式化tag为字符串表达式
|
||||
|
||||
Reference in New Issue
Block a user