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:
chenjinsong
2020-07-07 20:45:13 +08:00
parent f98c1724c4
commit ffcfaff389
11 changed files with 144 additions and 122 deletions

View File

@@ -494,77 +494,88 @@
queryAlertTrendData() {
this.$refs.chartbox.startLoading();
this.chartSeries = [];
this.$get('/prom/api/v1/query_range', this.trendParamHandle('rx')).then(response=>{
if(response.status == 'success'){
if(response.data.result){
let series={
name: 'RX',
symbol:'none', //去掉点
smooth:0.2, //曲线变平滑
data: [],
type:'line',
lineStyle: {
width: 1,
opacity: 0.9
},
};
if (response.data.result.length > 0) {
series.data=response.data.result[0].values.map((item)=>{
return [item[0]*1000,item[1]];
});
}
this.chartSeries.push(series);
if (this.chartSeries.length == 2) {
this.$refs.chartbox.modifyOption("tooltip", "backgroundColor", "rgba(221,228,237,1)");
this.$refs.chartbox.modifyOption("tooltip", "textStyle", {color: "#000"});
this.$refs.chartbox.modifyOption("grid", "top", 30);
this.$refs.chartbox.modifyOption("grid", "left", 0);
this.$refs.chartbox.modifyOption("grid", "right", 30);
this.$refs.chartbox.modifyOption("grid", "bottom", 8);
this.$refs.chartbox.modifyOption("grid", "containLabel", true);
this.$refs.chartbox.setSeries(this.chartSeries);
this.$refs.chartbox.endLoading();
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){
let series={
name: 'RX',
symbol:'none', //去掉点
smooth:0.2, //曲线变平滑
data: [],
type:'line',
lineStyle: {
width: 1,
opacity: 0.9
},
};
if (response.data.result.length > 0) {
series.data=response.data.result[0].values.map((item)=>{
return [item[0]*1000,item[1]];
});
}
this.chartSeries.push(series);
if (this.chartSeries.length == 2) {
this.$refs.chartbox.modifyOption("tooltip", "backgroundColor", "rgba(221,228,237,1)");
this.$refs.chartbox.modifyOption("tooltip", "textStyle", {color: "#000"});
this.$refs.chartbox.modifyOption("grid", "top", 30);
this.$refs.chartbox.modifyOption("grid", "left", 0);
this.$refs.chartbox.modifyOption("grid", "right", 30);
this.$refs.chartbox.modifyOption("grid", "bottom", 8);
this.$refs.chartbox.modifyOption("grid", "containLabel", true);
this.$refs.chartbox.setSeries(this.chartSeries);
}
}
resolve(true);
}else{
console.error(response);
resolve(false);
}
}else{
console.error(response)
}
});
});
this.$get('/prom/api/v1/query_range', this.trendParamHandle('tx')).then(response=>{
if(response.status == 'success'){
if(response.data.result){
let series={
name: 'TX',
symbol:'none', //去掉点
smooth:0.2, //曲线变平滑
data: [],
type:'line',
lineStyle: {
width: 1,
opacity: 0.9
},
};
if (response.data.result.length > 0) {
series.data=response.data.result[0].values.map((item)=>{
return [item[0]*1000,item[1]];
});
}
this.chartSeries.push(series);
if (this.chartSeries.length == 2) {
this.$refs.chartbox.modifyOption("tooltip", "backgroundColor", "rgba(221,228,237,1)");
this.$refs.chartbox.modifyOption("tooltip", "textStyle", {color: "#000"});
this.$refs.chartbox.modifyOption("grid", "top", 30);
this.$refs.chartbox.modifyOption("grid", "left", 0);
this.$refs.chartbox.modifyOption("grid", "right", 30);
this.$refs.chartbox.modifyOption("grid", "bottom", 8);
this.$refs.chartbox.setSeries(this.chartSeries);
this.$refs.chartbox.endLoading();
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){
let series={
name: 'TX',
symbol:'none', //去掉点
smooth:0.2, //曲线变平滑
data: [],
type:'line',
lineStyle: {
width: 1,
opacity: 0.9
},
};
if (response.data.result.length > 0) {
series.data=response.data.result[0].values.map((item)=>{
return [item[0]*1000,item[1]];
});
}
this.chartSeries.push(series);
if (this.chartSeries.length == 2) {
this.$refs.chartbox.modifyOption("tooltip", "backgroundColor", "rgba(221,228,237,1)");
this.$refs.chartbox.modifyOption("tooltip", "textStyle", {color: "#000"});
this.$refs.chartbox.modifyOption("grid", "top", 30);
this.$refs.chartbox.modifyOption("grid", "left", 0);
this.$refs.chartbox.modifyOption("grid", "right", 30);
this.$refs.chartbox.modifyOption("grid", "bottom", 8);
this.$refs.chartbox.setSeries(this.chartSeries);
//this.$refs.chartbox.endLoading();
}
}
resolve(true);
}else{
console.error(response)
resolve(false);
}
}else{
console.error(response)
}
});
});
Promise.all([rxPromise, txPromise]).then(resolve => {
this.$refs.chartbox.endLoading();
}, reject => {
this.$refs.chartbox.endLoading();
});
},
trendParamHandle(t) {