fix: 修复数个bug

1.asset-account exporter项在编辑时不可见;
2.asset cli下拉选择项中去掉snmp;
3.alert-rule 文字标题更改;
4.修复endpoint-query时会自己弹出chartbox的问题;
5.优化了asset-box代码逻辑
This commit is contained in:
chenjinsong
2020-07-06 19:49:04 +08:00
parent c8beabe69a
commit 09a50ffc60
9 changed files with 81 additions and 72 deletions

View File

@@ -107,7 +107,7 @@
<chart ref="endpointChart" :unit="chartUnit"></chart>
</el-dialog>
<chart-box ref="addChartModal" :panel-data="panelData" @on-create-success="createSuccess" @reloadOnlyPanel="getPanelData" @reload="getPanelData" :show-panel="{}"></chart-box>
<chart-box v-if="rightBox.show" ref="addChartModal" :panel-data="panelData" @on-create-success="createSuccess" @reloadOnlyPanel="getPanelData" @reload="getPanelData" :show-panel="{}"></chart-box>
</span>
</template>
@@ -155,7 +155,8 @@
panelData: [], //chart-box的panel下拉框数据,
hideSameLabels: true,
sameLabels:['instance','module','project','asset','endpoint','datacenter'],
chartUnit:5
chartUnit:5,
rightBox: {show: false}
}
},
methods: {
@@ -163,22 +164,25 @@
this.$emit('changeTab', tab);
},
saveChart() { //新增chart
this.$refs.addChartModal.setTitle(this.$t("dashboard.panel.createChartTitle"));
this.$refs.addChartModal.show(true);
let metricInfo = {};
metricInfo.elements = [];
//console.info("aaa", this.selectedEndpoints)
for(let i = 0; i < this.selectedEndpoints.length; i++) {
let type = 'expert';
// if (this.selectedEndpoints[i].type == '1') {
// type = 'expert';
// } else if (this.selectedEndpoints[i].type == '2') {
// type = 'normal';
// }
metricInfo.elements.push({expression: this.selectedEndpoints[i].element, type: type});
}
this.$refs.addChartModal.createData(-1, metricInfo);
this.$refs.addChartModal.setUnit(this.chartUnit)
this.rightBox.show = true;
this.$nextTick(() => {
this.$refs.addChartModal.setTitle(this.$t("dashboard.panel.createChartTitle"));
this.$refs.addChartModal.show(true);
let metricInfo = {};
metricInfo.elements = [];
//console.info("aaa", this.selectedEndpoints)
for(let i = 0; i < this.selectedEndpoints.length; i++) {
let type = 'expert';
// if (this.selectedEndpoints[i].type == '1') {
// type = 'expert';
// } else if (this.selectedEndpoints[i].type == '2') {
// type = 'normal';
// }
metricInfo.elements.push({expression: this.selectedEndpoints[i].element, type: type});
}
this.$refs.addChartModal.createData(-1, metricInfo);
this.$refs.addChartModal.setUnit(this.chartUnit)
});
},
dropdownHandler(show) {
if (show) {