diff --git a/nezha-fronted/src/assets/css/common.scss b/nezha-fronted/src/assets/css/common.scss
index dd5fea04c..65fb76be4 100644
--- a/nezha-fronted/src/assets/css/common.scss
+++ b/nezha-fronted/src/assets/css/common.scss
@@ -743,3 +743,6 @@ i.nz-icon-override{
.el-form-item__error {
padding-top: 0;
}
+input::placeholder{
+ text-transform:capitalize;
+}
diff --git a/nezha-fronted/src/components/chart/panelChart.vue b/nezha-fronted/src/components/chart/panelChart.vue
index c8bccc99a..61220592e 100644
--- a/nezha-fronted/src/components/chart/panelChart.vue
+++ b/nezha-fronted/src/components/chart/panelChart.vue
@@ -244,6 +244,13 @@ export default {
}
this.chartInfo.loaded && this.query(elements, startTime, endTime, step, params, isRefresh)
},
+ getIemStep (element, step) {
+ let myStep = step
+ if (element.step) {
+ myStep = element.step + 's'
+ }
+ return myStep
+ },
query (elements, startTime, endTime, step, params, isRefresh) { // 获取chart的数据
this.isError = false
this.allDataLength = 0
@@ -271,10 +278,11 @@ export default {
urlPre += '/logs/loki'
}
let requests = elements.map((element) => {
+ const myStep = this.getIemStep(element, step)
if (this.from === fromRoute.chartTemp || this.from === fromRoute.dashboardTemp) {
return chartTempData
}
- let query = `${urlPre}/api/v1/query_range?start=${startTime}&end=${endTime}&step=${step}`
+ let query = `${urlPre}/api/v1/query_range?start=${startTime}&end=${endTime}&step=${myStep}`
if (isTimeSeries(this.chartInfo.type)) {
let nullType = this.chartInfo.param.nullType || 'null'
nullType = (nullType === 'connected' ? 'null' : nullType)
@@ -298,10 +306,11 @@ export default {
})
if (this.multipleTime) {
const multipleRequests = elements.map((element) => {
+ const myStep = this.getIemStep(element, step)
if (this.from === fromRoute.chartTemp || this.from === fromRoute.dashboardTemp) {
return chartTempData
}
- let query = `${urlPre}/api/v1/query_range?start=${startTime - this.minusTime / 1000}&end=${endTime - this.minusTime / 1000}&step=${step}`
+ let query = `${urlPre}/api/v1/query_range?start=${startTime - this.minusTime / 1000}&end=${endTime - this.minusTime / 1000}&step=${myStep}`
if (isTimeSeries(this.chartInfo.type)) {
let nullType = this.chartInfo.param.nullType || 'null'
nullType = (nullType === 'connected' ? 'null' : nullType)
@@ -351,7 +360,8 @@ export default {
}
if (comparisonSt && comparisonEt) {
const comparisonRequests = elements.map((element) => {
- let query = `${urlPre}/api/v1/query_range?start=${comparisonSt}&end=${comparisonEt}&step=${step}`
+ const myStep = this.getIemStep(element, step)
+ let query = `${urlPre}/api/v1/query_range?start=${comparisonSt}&end=${comparisonEt}&step=${myStep}`
if (element.filter) {
query += `&filter=${element.filter}`
}
diff --git a/nezha-fronted/src/components/common/project/meta2d/js/meta2dMainCalc.js b/nezha-fronted/src/components/common/project/meta2d/js/meta2dMainCalc.js
index b2b2c5ec8..10945884a 100644
--- a/nezha-fronted/src/components/common/project/meta2d/js/meta2dMainCalc.js
+++ b/nezha-fronted/src/components/common/project/meta2d/js/meta2dMainCalc.js
@@ -82,7 +82,7 @@ export default {
const meta2dOptions = {
minScale: this.minScale,
// maxScale: 2,
- autoAnchor: false,
+ autoAnchor: false
// disableAnchor: true
}
const meta2d = new window.Meta2d(this.meta2dId, meta2dOptions)
@@ -131,8 +131,12 @@ export default {
startTime = this.timeRange[0]
endTime = this.timeRange[1]
} else if (this.filterTime) {
- startTime = this.filterTime[0]
- endTime = this.filterTime[1]
+ startTime = this.momentStrToTimestamp(this.filterTime[0])
+ endTime = this.momentStrToTimestamp(this.filterTime[1])
+ }
+ if (typeof (startTime) == 'string') {
+ startTime = this.momentStrToTimestamp(this.filterTime[0])
+ endTime = this.momentStrToTimestamp(this.filterTime[1])
}
this.getQueryValues(this.querysArray, startTime, endTime).then((arr) => {
this.clacTopoData(this.$lodash.cloneDeep(this.topoData), arr).then((data) => {
diff --git a/nezha-fronted/src/components/common/rightBox/chart/chartConfig.vue b/nezha-fronted/src/components/common/rightBox/chart/chartConfig.vue
index f8831f022..d3241b4b3 100644
--- a/nezha-fronted/src/components/common/rightBox/chart/chartConfig.vue
+++ b/nezha-fronted/src/components/common/rightBox/chart/chartConfig.vue
@@ -106,6 +106,13 @@
+
+ {{$t('overall.step')}}
+
+
+
+
+
@@ -1341,7 +1348,11 @@ export default {
}
},
mixins: [promqlInputMixin, publicConfig, chartTypeShow],
- computed: {},
+ computed: {
+ minStep () {
+ return this.nzDefaultConfig.minStep
+ }
+ },
data () {
return {
rules: {
diff --git a/nezha-fronted/src/components/common/rightBox/chart/chartRightBox.vue b/nezha-fronted/src/components/common/rightBox/chart/chartRightBox.vue
index fe46069ce..7aa4f1b3e 100644
--- a/nezha-fronted/src/components/common/rightBox/chart/chartRightBox.vue
+++ b/nezha-fronted/src/components/common/rightBox/chart/chartRightBox.vue
@@ -381,7 +381,7 @@ export default {
height: 4,
unit: 2,
type: 'line',
- elements: [{ expression: '', legend: '', type: 'expert', id: '', name: 'A', state: 1 }],
+ elements: [{ expression: '', legend: '', type: 'expert', id: '', name: 'A', state: 1 , step: undefined}],
param: {
stack: 0,
nullType: 'null',
@@ -423,7 +423,7 @@ export default {
height: 4,
unit: 2,
type: 'log',
- elements: [{ expression: '', legend: '', type: 'expert', id: '', name: 'A', state: 1 }],
+ elements: [{ expression: '', legend: '', type: 'expert', id: '', name: 'A', state: 1 , step: undefined}],
param: {
enable: {
thresholds: false,
diff --git a/nezha-fronted/src/components/common/rightBox/chart/publicConfig.js b/nezha-fronted/src/components/common/rightBox/chart/publicConfig.js
index 4cd0bb2b4..d9615393b 100644
--- a/nezha-fronted/src/components/common/rightBox/chart/publicConfig.js
+++ b/nezha-fronted/src/components/common/rightBox/chart/publicConfig.js
@@ -327,7 +327,8 @@ export default {
legend: this.expressionsShow[i].legend,
name: this.expressionName[i],
state: this.expressionsShow[i].state,
- orderNum: i
+ orderNum: i,
+ step: this.expressionsShow[i].step
})
}
})
@@ -407,7 +408,8 @@ export default {
error: '',
legend: '',
elementId: '',
- state: 1
+ state: 1,
+ step: undefined
})
this.expressionChange()
} else {
@@ -420,7 +422,8 @@ export default {
error: '',
elementId: item.id,
legend: item.legend,
- state: item.state
+ state: item.state,
+ step: item.step
})
}
},
diff --git a/nezha-fronted/src/components/page/dashboard/dashboard.vue b/nezha-fronted/src/components/page/dashboard/dashboard.vue
index 8ea5d6347..22b508e6e 100644
--- a/nezha-fronted/src/components/page/dashboard/dashboard.vue
+++ b/nezha-fronted/src/components/page/dashboard/dashboard.vue
@@ -272,7 +272,7 @@ export default {
pointSize: 6
}
},
- elements: [{ expression: '', legend: '', type: 'expert', id: '', name: 'A', state: 1, orderNum: 0 }],
+ elements: [{ expression: '', legend: '', type: 'expert', id: '', name: 'A', state: 1, orderNum: 0 , step: undefined}],
panel: '',
sync: 0,
remark: '',