fix: 修改alertMessage图表显示错误的问题
This commit is contained in:
@@ -316,7 +316,7 @@ export default {
|
||||
this.$refs.messageChart.startLoading()
|
||||
const axiosArr = []
|
||||
const paramStr = JSON.stringify(this.promQueryParamConvert(this.currentMsg))
|
||||
axiosArr.push(axios.get('/prom/api/v1/query_range?query=' + paramStr.substring(1, paramStr.length - 1).replace(/\+/g, '%2B').replace(/ /g, '%20').replace(/\\/g, '') + '&start=' + this.$stringTimeParseToUnix(start) + '&end=' + this.$stringTimeParseToUnix(end) + '&step=' + step))
|
||||
axiosArr.push(axios.get('/prom/api/v1/query_range?query=' + paramStr.substring(1, paramStr.length - 1) + '&start=' + this.$stringTimeParseToUnix(start) + '&end=' + this.$stringTimeParseToUnix(end) + '&step=' + step))
|
||||
this.legend = []
|
||||
this.chartDatas = []
|
||||
axios.all(axiosArr).then(res => {
|
||||
@@ -463,7 +463,7 @@ export default {
|
||||
})
|
||||
},
|
||||
promQueryParamConvert (obj) {
|
||||
let r = '(' + obj.alertRule.expr + ')'
|
||||
let r = '(' + obj.alertRule.expr.replace(/\"/g, '\'') + ')'
|
||||
let intoLabels = false
|
||||
obj.labels = JSON.parse(obj.labels)
|
||||
if (Object.keys(obj.labels).length > 0) {
|
||||
|
||||
Reference in New Issue
Block a user