fix: 修复数个bug
1.asset exporter项在编辑asset时隐藏; 2.module 新增时默认端口161/9100; 3.asset detail feature重复数据; 4.刚进入panel时新增chart时不应该有panel选项; 5.overview 流量图表 处理查询折线数据异常的情况; 6.alert-msg和alert-rule二级的msg表头保持一致; 7.alert-rule detail告警数量 靠左对齐
This commit is contained in:
@@ -75,9 +75,11 @@
|
||||
|
||||
<div class="content-item-value item-tip" :id="`value-${index}-${i}`" :class="{'content-item-value-muti': Array.isArray(value) && value.length > 0}">
|
||||
<template v-if="Array.isArray(value) && value.length>0">
|
||||
<div v-if="typeof value[0] == 'string'" class="item-value-sub" v-for="(_item, _index) in value" :key="_index">{{_item}}</div>
|
||||
<template v-if="typeof value[0] == 'string'">
|
||||
<div class="item-value-sub" v-for="(_item, _index) in value" :key="_index">{{_item}}</div>
|
||||
</template>
|
||||
<template v-else>
|
||||
<el-table
|
||||
v-else
|
||||
class="nz-table asset-info-table"
|
||||
:data="value"
|
||||
tooltip-effect="light"
|
||||
@@ -100,6 +102,8 @@
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</template>
|
||||
|
||||
</template>
|
||||
<template v-else-if="key">
|
||||
<span class="content-text">{{value ? value : " "}}</span>
|
||||
<div class="item-tip-hide item-tip-value el-popover" :class="itemTip(`value-${index}`, key, i, ready)">{{value}}</div>
|
||||
@@ -377,20 +381,15 @@
|
||||
this.$chartResizeTool.start(vm, this.data, e);
|
||||
},
|
||||
setLabels:function(source){
|
||||
let labels=[];
|
||||
source.forEach(item=>{
|
||||
labels=labels.concat(Object.keys(item))
|
||||
})
|
||||
labels=Array.from(new Set(labels));
|
||||
|
||||
labels=labels.map(item=>{
|
||||
let labels = Object.keys(source[0]);
|
||||
labels = labels.map(item=>{
|
||||
return{
|
||||
label:this.replaceSplit(item),
|
||||
prop:item,
|
||||
show:true,
|
||||
}
|
||||
});
|
||||
console.info(labels)
|
||||
console.info(labels);
|
||||
return labels;
|
||||
},
|
||||
replaceSplit(key){
|
||||
|
||||
@@ -379,6 +379,16 @@
|
||||
box-sizing: border-box;
|
||||
height: 26px;
|
||||
}
|
||||
.item-tip.deep:nth-of-type(2) {
|
||||
padding-left: 13px;
|
||||
box-sizing: border-box;
|
||||
height: 26px;
|
||||
}
|
||||
.item-tip.deepp:last-of-type {
|
||||
padding-left: 13px;
|
||||
box-sizing: border-box;
|
||||
height: 26px;
|
||||
}
|
||||
.tag-value:hover .item-tip-show {
|
||||
display: block;
|
||||
}
|
||||
|
||||
@@ -276,7 +276,7 @@
|
||||
prop: 'endAt',
|
||||
show: true,
|
||||
}, {
|
||||
label: this.$t('alert.list.current'),
|
||||
label: this.$t('overall.value'),
|
||||
prop: 'current',
|
||||
show: true
|
||||
}, {
|
||||
|
||||
@@ -509,12 +509,12 @@
|
||||
//this.$router.go(-1);
|
||||
},
|
||||
getLinkData(){
|
||||
console.log('aaa');
|
||||
//console.log('aaa');
|
||||
this.$get('link').then(response=>{
|
||||
console.log(response);
|
||||
//console.log(response);
|
||||
// this.linkData=response.data;
|
||||
this.$store.commit('setLinkData',response.data);
|
||||
console.log(this.$store)
|
||||
//console.log(this.$store)
|
||||
});
|
||||
},
|
||||
},
|
||||
|
||||
@@ -692,7 +692,7 @@
|
||||
immediate: true,
|
||||
deep: true,
|
||||
handler(n, o) {
|
||||
if (n.type && n.type.toLowerCase() == 'snmp') {
|
||||
if (!n.id && n.type && n.type.toLowerCase() == 'snmp') {
|
||||
n.port = 161;
|
||||
this.expandedWalkData = [];
|
||||
this.$nextTick(() => {
|
||||
@@ -701,6 +701,8 @@
|
||||
for (let i = 0; i < n.walk.length; i++) {
|
||||
this.expandedWalkData.push(n.walk[i].substring(0, n.walk[i].lastIndexOf(".")));
|
||||
}
|
||||
} else if (!n.id && n.type && n.type.toLowerCase() == 'http') {
|
||||
n.port = 9100;
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -69,9 +69,10 @@
|
||||
>
|
||||
<template slot-scope="scope" :column="item">
|
||||
<template v-if="item.prop == 'alertRule'">
|
||||
<div class="link too-long-split"
|
||||
<!--<div class="link too-long-split"
|
||||
@click="viewRule(scope.row[item.prop].id)" :id="'view-rule-'+scope.row[item.prop].id"
|
||||
v-if="scope.row[item.prop].alertName">{{scope.row[item.prop].alertName}}</div>
|
||||
v-if="scope.row[item.prop].alertName">{{scope.row[item.prop].alertName}}</div>-->
|
||||
<span class="too-long-split"v-if="scope.row[item.prop].alertName">{{scope.row[item.prop].alertName}}</span>
|
||||
<template v-else>-</template>
|
||||
</template>
|
||||
<!--<div v-else-if="item.prop == 'type'" class="content-right-options">
|
||||
|
||||
@@ -73,8 +73,8 @@
|
||||
>
|
||||
<template slot-scope="scope" :column="item">
|
||||
<div v-if="item.prop == 'option'" class="content-right-options">
|
||||
<span :title="$t('overall.view')" @click="detail(scope.row)" class="content-right-option" :id="'dc-detail-'+scope.row.id"><i class="nz-icon nz-icon-view"></i></span>
|
||||
|
||||
<!--<span :title="$t('overall.view')" @click="detail(scope.row)" class="content-right-option" :id="'dc-detail-'+scope.row.id"><i class="nz-icon nz-icon-view"></i></span>
|
||||
-->
|
||||
<span :title="$t('overall.edit')" @click="edit(scope.row)" class="content-right-option" :id="'dc-edit-'+scope.row.id"><i class="nz-icon nz-icon-edit"></i></span>
|
||||
|
||||
<span :title="$t('overall.delete')" @click="del(scope.row)" class="content-right-option" :id="'dc-del-'+scope.row.id"><i class="el-icon-delete"></i></span>
|
||||
|
||||
@@ -394,13 +394,13 @@
|
||||
'promql-input': promqlInput,
|
||||
},
|
||||
mounted() {
|
||||
if(this.showPanel){
|
||||
this.panelName2 = this.showPanel.name;
|
||||
}
|
||||
this.rightBox.show = true;
|
||||
this.isUrl = false;
|
||||
this.isSingleStat = false;
|
||||
this.$nextTick(() => {
|
||||
if(this.showPanel){
|
||||
this.panelName2 = this.showPanel.name;
|
||||
}
|
||||
this.initElements();
|
||||
});
|
||||
},
|
||||
|
||||
@@ -494,7 +494,7 @@
|
||||
queryAlertTrendData() {
|
||||
this.$refs.chartbox.startLoading();
|
||||
this.chartSeries = [];
|
||||
|
||||
let rxPromise = new Promise((resolve, reject) => {
|
||||
this.$get('/prom/api/v1/query_range', this.trendParamHandle('rx')).then(response=>{
|
||||
if(response.status == 'success'){
|
||||
if(response.data.result){
|
||||
@@ -524,13 +524,16 @@
|
||||
this.$refs.chartbox.modifyOption("grid", "bottom", 8);
|
||||
this.$refs.chartbox.modifyOption("grid", "containLabel", true);
|
||||
this.$refs.chartbox.setSeries(this.chartSeries);
|
||||
this.$refs.chartbox.endLoading();
|
||||
}
|
||||
}
|
||||
resolve(true);
|
||||
}else{
|
||||
console.error(response)
|
||||
console.error(response);
|
||||
resolve(false);
|
||||
}
|
||||
});
|
||||
});
|
||||
let txPromise = new Promise((resolve, reject) => {
|
||||
this.$get('/prom/api/v1/query_range', this.trendParamHandle('tx')).then(response=>{
|
||||
if(response.status == 'success'){
|
||||
if(response.data.result){
|
||||
@@ -559,13 +562,21 @@
|
||||
this.$refs.chartbox.modifyOption("grid", "right", 30);
|
||||
this.$refs.chartbox.modifyOption("grid", "bottom", 8);
|
||||
this.$refs.chartbox.setSeries(this.chartSeries);
|
||||
this.$refs.chartbox.endLoading();
|
||||
//this.$refs.chartbox.endLoading();
|
||||
}
|
||||
}
|
||||
resolve(true);
|
||||
}else{
|
||||
console.error(response)
|
||||
resolve(false);
|
||||
}
|
||||
});
|
||||
});
|
||||
Promise.all([rxPromise, txPromise]).then(resolve => {
|
||||
this.$refs.chartbox.endLoading();
|
||||
}, reject => {
|
||||
this.$refs.chartbox.endLoading();
|
||||
});
|
||||
},
|
||||
trendParamHandle(t) {
|
||||
let before;
|
||||
|
||||
@@ -226,7 +226,7 @@
|
||||
}
|
||||
this.filter.searchName='';
|
||||
//this.$refs.searchInput.select();
|
||||
this.showPanel = val
|
||||
this.showPanel = val;
|
||||
this.filter.panelId = this.showPanel.id;
|
||||
// let curTime = this.$refs.calendarPanel.getCurrentTime();
|
||||
let curTime=this.searchTime;
|
||||
@@ -429,15 +429,13 @@
|
||||
let isInitData = false;
|
||||
if (response.data.list.length > 0) {
|
||||
if (this.$store.state.showPanel.id !== 0 && this.$store.state.showPanel.name !== '') {
|
||||
this.showPanel.name = this.$store.state.showPanel.name;
|
||||
this.showPanel.id = this.$store.state.showPanel.id;
|
||||
this.showPanel = this.$store.state.showPanel;
|
||||
}
|
||||
if (clearShowPanel) {
|
||||
this.showPanel.id = '';
|
||||
}
|
||||
if (this.showPanel.id === '') {
|
||||
this.showPanel.id = response.data.list[0].id;
|
||||
this.showPanel.name = response.data.list[0].name;
|
||||
if (!this.showPanel.id) {
|
||||
this.showPanel = response.data.list[0];
|
||||
this.filter.panelId = this.showPanel.id;
|
||||
this.getData(this.filter);
|
||||
isInitData = true;
|
||||
@@ -453,7 +451,7 @@
|
||||
}
|
||||
this.$store.state.showPanel.id = 0;
|
||||
this.$store.state.showPanel.name = '';
|
||||
|
||||
this.$store.state.showPanel.type = 'dashboard';
|
||||
}else {
|
||||
if(response.msg){
|
||||
this.$message.error(response.msg);
|
||||
@@ -580,7 +578,7 @@
|
||||
});
|
||||
}
|
||||
this.panelDataDragTmp = [...this.panelData];
|
||||
console.log(this.panelDataDragTmp)
|
||||
//console.log(this.panelDataDragTmp)
|
||||
},
|
||||
end (event) {
|
||||
// console.info("end event:", event)
|
||||
|
||||
@@ -33,7 +33,8 @@ const store = new Vuex.Store({
|
||||
},
|
||||
showPanel:{
|
||||
id:0,
|
||||
name:''
|
||||
name:'',
|
||||
type: "dashboard"
|
||||
},
|
||||
consoleShow:false,//是否显示console窗口
|
||||
consoleCount:0,//当前console窗口数
|
||||
|
||||
Reference in New Issue
Block a user