@@ -287,6 +323,11 @@ export default {
]
}
},
+ computed : {
+ minStep () {
+ return this.nzDefaultConfig.minStep
+ }
+ },
mounted () {
this.init()
},
@@ -304,7 +345,9 @@ export default {
statistic: this.expressionsShow[i].statistic || 'last',
name: this.expressionName[i],
state: this.expressionsShow[i].state,
- orderNum: i
+ orderNum: i,
+ step: this.expressionsShow[i].step || undefined,
+ queryType: this.expressionsShow[i].queryType || 1,
})
})
} else {
@@ -312,6 +355,10 @@ export default {
}
this.change()
},
+ queryTypeChange (index) {
+ this.expressionsShow[index].step = undefined
+ this.expressionChange(index)
+ },
switchExpression (index, flag) {
if (flag === 1) {
this.$set(this.expressionsShow[index], 'state', 0)
@@ -379,7 +426,9 @@ export default {
unit: 1,
statistic: 'last',
elementId: '',
- state: 1
+ state: 1,
+ step: undefined,
+ queryType: 1,
})
this.expressionChange()
} else {
@@ -394,7 +443,9 @@ export default {
legend: item.legend,
unit: item.unit || 1,
statistic: item.statistic || 'last',
- state: item.state
+ state: item.state,
+ step: item.step || undefined,
+ queryType: item.queryType || 1,
})
}
},
diff --git a/nezha-fronted/src/components/common/rightBox/chart/chartConfig.vue b/nezha-fronted/src/components/common/rightBox/chart/chartConfig.vue
index bd0c05bf6..f88a60c4d 100644
--- a/nezha-fronted/src/components/common/rightBox/chart/chartConfig.vue
+++ b/nezha-fronted/src/components/common/rightBox/chart/chartConfig.vue
@@ -124,8 +124,8 @@
- Range
- Instant
+ {{$t('dashboard.dashboard.chartForm.valMapping.range')}}
+ {{$t('overall.instant')}}
@@ -142,9 +142,8 @@
:min="minStep"
:precision="0"
:controls="false"
- class="append_unit"
:placeholder="$t('overall.auto')"
- :data-unit="$t('overall.seconds')">
+ >
diff --git a/nezha-fronted/src/components/page/dashboard/explore/exploreItem.vue b/nezha-fronted/src/components/page/dashboard/explore/exploreItem.vue
index 7b02faa48..fa36aee78 100644
--- a/nezha-fronted/src/components/page/dashboard/explore/exploreItem.vue
+++ b/nezha-fronted/src/components/page/dashboard/explore/exploreItem.vue
@@ -189,8 +189,8 @@
- Range
- Instant
+ {{$t('dashboard.dashboard.chartForm.valMapping.range')}}
+ {{$t('overall.instant')}}
@@ -4039,18 +4039,19 @@ export default {
const promqlInputIndexs = []
const queryExpression = []
// 过滤掉state为0的元素
+ let step = bus.getStep(bus.formateTimeToTime(this.filterTime[0]), bus.formateTimeToTime(this.filterTime[1]))
this.expressions.forEach((item, index) => {
if (item != '' && this.promqlKeys[index].state && !this.promqlKeys[index].matrix) {
- let step = bus.getStep(bus.formateTimeToTime(this.filterTime[0]), bus.formateTimeToTime(this.filterTime[1]))
+ let queryStep = step
if (this.promqlKeys[index].step) {
- step = this.promqlKeys[index].step
+ queryStep = this.promqlKeys[index].step + 's'
}
promqlInputIndexs.push(index)
queryExpression.push(item)
if (this.promqlKeys[index].queryType === 2) {
requestArr.push(this.$get('/prom/api/v1/query_instant?query=' + encodeURIComponent(item) + '&time=' + this.$stringTimeParseToUnix(bus.formateTimeToTime(this.filterTime[1]))))
} else {
- requestArr.push(this.$get('/prom/api/v1/query_range?query=' + encodeURIComponent(item) + '&start=' + this.$stringTimeParseToUnix(bus.formateTimeToTime(this.filterTime[0])) + '&end=' + this.$stringTimeParseToUnix(bus.formateTimeToTime(this.filterTime[1])) + '&step=' + step + '&nullType=null'))
+ requestArr.push(this.$get('/prom/api/v1/query_range?query=' + encodeURIComponent(item) + '&start=' + this.$stringTimeParseToUnix(bus.formateTimeToTime(this.filterTime[0])) + '&end=' + this.$stringTimeParseToUnix(bus.formateTimeToTime(this.filterTime[1])) + '&step=' + queryStep + '&nullType=null'))
}
}
})
diff --git a/nezha-fronted/src/components/page/dashboard/explore/queryPrompt/queryPrompt.vue b/nezha-fronted/src/components/page/dashboard/explore/queryPrompt/queryPrompt.vue
index f54148051..48bd82845 100644
--- a/nezha-fronted/src/components/page/dashboard/explore/queryPrompt/queryPrompt.vue
+++ b/nezha-fronted/src/components/page/dashboard/explore/queryPrompt/queryPrompt.vue
@@ -23,9 +23,9 @@
-
1.Select label names and values
+
{{$t('queryPrompt.logTitle1')}}
-
2.Resulting selector
+
{{$t('queryPrompt.logTitle2')}}