fix: 去除转义 replace 方法
This commit is contained in:
@@ -451,7 +451,7 @@ export default {
|
|||||||
const axiosArr = []
|
const axiosArr = []
|
||||||
const paramStr = this.currentMsg ? JSON.stringify(this.promQueryParamConvert(this.currentMsg)) : null
|
const paramStr = this.currentMsg ? JSON.stringify(this.promQueryParamConvert(this.currentMsg)) : null
|
||||||
if (paramStr && paramStr.trim() != '""') {
|
if (paramStr && paramStr.trim() != '""') {
|
||||||
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.legend = []
|
||||||
this.chartDatas = []
|
this.chartDatas = []
|
||||||
axios.all(axiosArr).then(res => {
|
axios.all(axiosArr).then(res => {
|
||||||
@@ -650,7 +650,7 @@ export default {
|
|||||||
item.labels = JSON.parse(item.labels)
|
item.labels = JSON.parse(item.labels)
|
||||||
if (item.alertRule.buildIn !== 1) {
|
if (item.alertRule.buildIn !== 1) {
|
||||||
const paramStr = JSON.stringify(this.promQueryParamConvert(item))
|
const paramStr = JSON.stringify(this.promQueryParamConvert(item))
|
||||||
axiosAll.push(axios.get('/prom/api/v1/query?query=' + paramStr.substring(1, paramStr.length - 1).replace(/\+/g, '%2B').replace(/ /g, '%20').replace(/\\/g, '')))
|
axiosAll.push(axios.get('/prom/api/v1/query?query=' + paramStr.substring(1, paramStr.length - 1)))
|
||||||
} else {
|
} else {
|
||||||
axiosAll.push('')
|
axiosAll.push('')
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -414,7 +414,7 @@ export default {
|
|||||||
}
|
}
|
||||||
const axiosArr = []
|
const axiosArr = []
|
||||||
const paramStr = JSON.stringify(this.promQueryParamConvert(this.currentMsg))
|
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.legend = []
|
||||||
this.chartDatas = []
|
this.chartDatas = []
|
||||||
axios.all(axiosArr).then(res => {
|
axios.all(axiosArr).then(res => {
|
||||||
@@ -538,7 +538,7 @@ export default {
|
|||||||
item.labels = JSON.parse(item.labels)
|
item.labels = JSON.parse(item.labels)
|
||||||
if (item.alertRule.buildIn != 1) {
|
if (item.alertRule.buildIn != 1) {
|
||||||
const paramStr = JSON.stringify(this.promQueryParamConvert(item))
|
const paramStr = JSON.stringify(this.promQueryParamConvert(item))
|
||||||
axiosAll.push(axios.get('/prom/api/v1/query?query=' + paramStr.substring(1, paramStr.length - 1).replace(/\+/g, '%2B').replace(/ /g, '%20').replace(/\\/g, '')))
|
axiosAll.push(axios.get('/prom/api/v1/query?query=' + paramStr.substring(1, paramStr.length - 1)))
|
||||||
} else {
|
} else {
|
||||||
axiosAll.push('')
|
axiosAll.push('')
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -275,7 +275,7 @@ export default {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
console.log(this.legend, this.chartDatas)
|
// console.log(this.legend, this.chartDatas)
|
||||||
this.$refs.messageChart.setRandomColors(this.chartDatas.length)
|
this.$refs.messageChart.setRandomColors(this.chartDatas.length)
|
||||||
this.$refs.messageChart.setLegend(this.legend)
|
this.$refs.messageChart.setLegend(this.legend)
|
||||||
this.$refs.messageChart.setSeries(this.chartDatas)
|
this.$refs.messageChart.setSeries(this.chartDatas)
|
||||||
|
|||||||
@@ -313,7 +313,7 @@ export default {
|
|||||||
this.$refs.messageChart.startLoading()
|
this.$refs.messageChart.startLoading()
|
||||||
const axiosArr = []
|
const axiosArr = []
|
||||||
const paramStr = JSON.stringify(this.promQueryParamConvert(this.currentMsg))
|
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.legend = []
|
||||||
this.chartDatas = []
|
this.chartDatas = []
|
||||||
axios.all(axiosArr).then(res => {
|
axios.all(axiosArr).then(res => {
|
||||||
|
|||||||
Reference in New Issue
Block a user