fix: 修改正则 \s 为 \r|\n
This commit is contained in:
@@ -517,7 +517,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=' + encodeURIComponent(this.currentMsg.alertRule.expr.replace(/\"/g, '\'').replace(/\s+/g, '')) + '&start=' + this.$stringTimeParseToUnix(start) + '&end=' + this.$stringTimeParseToUnix(end) + '&step=' + step + '&filter=' + encodeURIComponent(decodeURIComponent(this.promQueryParamLabels(this.currentMsg.labels)))))
|
axiosArr.push(axios.get('/prom/api/v1/query_range?query=' + encodeURIComponent(this.currentMsg.alertRule.expr.replace(/\"/g, '\'').replace(/\r|\n+/g, '')) + '&start=' + this.$stringTimeParseToUnix(start) + '&end=' + this.$stringTimeParseToUnix(end) + '&step=' + step + '&filter=' + encodeURIComponent(decodeURIComponent(this.promQueryParamLabels(this.currentMsg.labels)))))
|
||||||
this.legend = []
|
this.legend = []
|
||||||
this.chartDatas = []
|
this.chartDatas = []
|
||||||
axios.all(axiosArr).then(res => {
|
axios.all(axiosArr).then(res => {
|
||||||
@@ -760,7 +760,7 @@ export default {
|
|||||||
this.getAlerScreetList()
|
this.getAlerScreetList()
|
||||||
},
|
},
|
||||||
promQueryParamConvert (obj) {
|
promQueryParamConvert (obj) {
|
||||||
let r = '(' + obj.alertRule.expr.replace(/\"/g, '\'').replace(/\s+/g, '') + ')'
|
let r = '(' + obj.alertRule.expr.replace(/\"/g, '\'').replace(/\r|\n+/g, '') + ')'
|
||||||
let intoLabels = false
|
let intoLabels = false
|
||||||
obj.labels = JSON.parse(obj.labels)
|
obj.labels = JSON.parse(obj.labels)
|
||||||
if (Object.keys(obj.labels).length > 0) {
|
if (Object.keys(obj.labels).length > 0) {
|
||||||
|
|||||||
@@ -264,7 +264,7 @@ export default {
|
|||||||
if (this.$refs.messageChart) {
|
if (this.$refs.messageChart) {
|
||||||
this.$refs.messageChart.startLoading()
|
this.$refs.messageChart.startLoading()
|
||||||
const axiosArr = []
|
const axiosArr = []
|
||||||
axiosArr.push(axios.get('/prom/api/v1/query_range?query=' + encodeURIComponent(this.currentMsg.alertRule.expr.replace(/\s+/g, '')) + '&start=' + this.$stringTimeParseToUnix(start) + '&end=' + this.$stringTimeParseToUnix(end) + '&step=' + step + '&filter=' + encodeURIComponent(decodeURIComponent(this.promQueryParamLabels(this.currentMsg.labels)))))
|
axiosArr.push(axios.get('/prom/api/v1/query_range?query=' + encodeURIComponent(this.currentMsg.alertRule.expr.replace(/\r|\n+/g, '')) + '&start=' + this.$stringTimeParseToUnix(start) + '&end=' + this.$stringTimeParseToUnix(end) + '&step=' + step + '&filter=' + encodeURIComponent(decodeURIComponent(this.promQueryParamLabels(this.currentMsg.labels)))))
|
||||||
this.legend = []
|
this.legend = []
|
||||||
this.chartDatas = []
|
this.chartDatas = []
|
||||||
axios.all(axiosArr).then(res => {
|
axios.all(axiosArr).then(res => {
|
||||||
@@ -426,7 +426,7 @@ export default {
|
|||||||
},
|
},
|
||||||
promQueryParamConvert (alert) {
|
promQueryParamConvert (alert) {
|
||||||
const obj = { ...alert }
|
const obj = { ...alert }
|
||||||
let r = '(' + obj.alertRule.expr.replace(/\"/g, '\'').replace(/\s+/g, '') + ')'
|
let r = '(' + obj.alertRule.expr.replace(/\"/g, '\'').replace(/\r|\n+/g, '') + ')'
|
||||||
let intoLabels = false
|
let intoLabels = false
|
||||||
obj.labels = JSON.parse(obj.labels)
|
obj.labels = JSON.parse(obj.labels)
|
||||||
if (Object.keys(obj.labels).length > 0) {
|
if (Object.keys(obj.labels).length > 0) {
|
||||||
|
|||||||
@@ -1097,6 +1097,8 @@ export default {
|
|||||||
setTimeout('document.getElementById("one-input").focus()', 500)
|
setTimeout('document.getElementById("one-input").focus()', 500)
|
||||||
this.input_list = false
|
this.input_list = false
|
||||||
this.delcriteriaBool = false
|
this.delcriteriaBool = false
|
||||||
|
} else if(this.searchMsg.searchLabelList.find(key => this.select_list[this.sreach_num].label == key.label).readonly) {
|
||||||
|
this.input_sreach = ''
|
||||||
} else {
|
} else {
|
||||||
if (this.input_sreach == '') {
|
if (this.input_sreach == '') {
|
||||||
this.delcriteriaBool = true
|
this.delcriteriaBool = true
|
||||||
|
|||||||
@@ -511,7 +511,7 @@ export default {
|
|||||||
if (this.$refs.messageChart) {
|
if (this.$refs.messageChart) {
|
||||||
this.$refs.messageChart.startLoading()
|
this.$refs.messageChart.startLoading()
|
||||||
const axiosArr = []
|
const axiosArr = []
|
||||||
axiosArr.push(axios.get('/prom/api/v1/query_range?query=' + encodeURIComponent(this.currentMsg.alertRule.expr.replace(/\"/g, '\'').replace(/\s+/g, '')) + '&start=' + this.$stringTimeParseToUnix(start) + '&end=' + this.$stringTimeParseToUnix(end) + '&step=' + step + '&filter=' + encodeURIComponent(decodeURIComponent(this.promQueryParamLabels(this.currentMsg.labels)))))
|
axiosArr.push(axios.get('/prom/api/v1/query_range?query=' + encodeURIComponent(this.currentMsg.alertRule.expr.replace(/\"/g, '\'').replace(/\r|\n+/g, '')) + '&start=' + this.$stringTimeParseToUnix(start) + '&end=' + this.$stringTimeParseToUnix(end) + '&step=' + step + '&filter=' + encodeURIComponent(decodeURIComponent(this.promQueryParamLabels(this.currentMsg.labels)))))
|
||||||
this.legend = []
|
this.legend = []
|
||||||
this.chartDatas = []
|
this.chartDatas = []
|
||||||
axios.all(axiosArr).then(res => {
|
axios.all(axiosArr).then(res => {
|
||||||
@@ -904,7 +904,7 @@ export default {
|
|||||||
},
|
},
|
||||||
promQueryParamConvert (alert) {
|
promQueryParamConvert (alert) {
|
||||||
const obj = { ...alert }
|
const obj = { ...alert }
|
||||||
let r = '(' + obj.alertRule.expr.replace(/\"/g, '\'').replace(/\s+/g, '') + ')'
|
let r = '(' + obj.alertRule.expr.replace(/\"/g, '\'').replace(/\r|\n+/g, '') + ')'
|
||||||
let intoLabels = false
|
let intoLabels = false
|
||||||
obj.labels = JSON.parse(obj.labels)
|
obj.labels = JSON.parse(obj.labels)
|
||||||
if (Object.keys(obj.labels).length > 0) {
|
if (Object.keys(obj.labels).length > 0) {
|
||||||
|
|||||||
Reference in New Issue
Block a user