diff --git a/nezha-fronted/src/components/charts/chart-list.vue b/nezha-fronted/src/components/charts/chart-list.vue index 5698c2398..7c771ed18 100644 --- a/nezha-fronted/src/components/charts/chart-list.vue +++ b/nezha-fronted/src/components/charts/chart-list.vue @@ -304,7 +304,8 @@ export default { obj: Object, panelLock: { type: Boolean, default: false }, hasGroup: { type: Boolean, default: true }, - panelDataList: Array + panelDataList: Array, + nowTimeType: {} }, components: { @@ -973,7 +974,12 @@ export default { let startTime = '' let endTime = '' if (filterType === 'refresh') { // 刷新 - const now = new Date(bus.computeTimezone(new Date().getTime())) + let now = null + if (this.nowTimeType.id === 0 && this.nowTimeType.value === -1) { + now = new Date(this.filter.start_time) + } else { + now = new Date(bus.computeTimezone(new Date().getTime())) + } const origin = new Date(this.filter.end_time) const numInterval = now.getTime() - origin.getTime() if (numInterval >= 60000) { // 大于1分钟,则start、end均往后移numInterval,否则时间不变 diff --git a/nezha-fronted/src/components/common/ChartDiagram/diagram.vue b/nezha-fronted/src/components/common/ChartDiagram/diagram.vue index c7ed153a4..bcaf34626 100644 --- a/nezha-fronted/src/components/common/ChartDiagram/diagram.vue +++ b/nezha-fronted/src/components/common/ChartDiagram/diagram.vue @@ -681,7 +681,7 @@ export default { resolve({ data: '', status: 'no query' }) }) } - query += '&nullType=' + 'connected' + query += '&nullType=' + 'null' return this.$get('/prom/api/v1/query_range?query=' + query + '&start=' + this.$stringTimeParseToUnix(startTime) + '&end=' + this.$stringTimeParseToUnix(endTime) + '&step=' + step) }) } diff --git a/nezha-fronted/src/components/common/project/L5/topoTooltip.vue b/nezha-fronted/src/components/common/project/L5/topoTooltip.vue index c3ff30469..6aebc46a2 100644 --- a/nezha-fronted/src/components/common/project/L5/topoTooltip.vue +++ b/nezha-fronted/src/components/common/project/L5/topoTooltip.vue @@ -74,7 +74,7 @@ export default { data () { return { tempDom: { height: 250, width: '' }, - chartDataTemp: { id: 8832, prev: null, next: null, panelId: 0, title: '123', span: 12, height: 0, createAt: '2021-01-27 07:36:19', unit: 2, weight: 0, pid: null, buildIn: null, seq: null, param: { last: 0, legendValue: { total: 'off', min: 'off', avg: 'off', last: 'off', max: 'off' }, threshold: '', url: '', nullType: 'connected' }, sync: null, asset: null, isLoaded: true, from: '__vue_devtool_undefined__', draggable: true, resizable: true, editable: true }, + chartDataTemp: { id: 8832, prev: null, next: null, panelId: 0, title: '123', span: 12, height: 0, createAt: '2021-01-27 07:36:19', unit: 2, weight: 0, pid: null, buildIn: null, seq: null, param: { last: 0, legendValue: { total: 'off', min: 'off', avg: 'off', last: 'off', max: 'off' }, threshold: '', url: '', nullType: 'null' }, sync: null, asset: null, isLoaded: true, from: '__vue_devtool_undefined__', draggable: true, resizable: true, editable: true }, chartData: {}, filter: { end_time: bus.timeFormate(bus.getOffsetTimezoneData(), 'yyyy-MM-dd hh:mm:ss'), @@ -108,7 +108,7 @@ export default { chartData.param = { legendValue: { total: 'off', min: 'off', avg: 'off', last: 'off', max: 'off' }, last: 0, - nullType: 'connected', + nullType: 'null', threshold: '', url: '', valueMapping: { mapping: [{ color: { bac: '#fff', text: '#000' }, text: '', value: '' }], type: 'text' }, diff --git a/nezha-fronted/src/components/common/project/topologyL5.vue b/nezha-fronted/src/components/common/project/topologyL5.vue index b4064ca62..2285a6fb6 100644 --- a/nezha-fronted/src/components/common/project/topologyL5.vue +++ b/nezha-fronted/src/components/common/project/topologyL5.vue @@ -686,7 +686,7 @@ export default { resolve({ data: '', status: 'no query' }) }) } - query += '&nullType=' + 'connected' + query += '&nullType=' + 'null' return this.$get('/prom/api/v1/query_range?query=' + query + '&start=' + this.$stringTimeParseToUnix(startTime) + '&end=' + this.$stringTimeParseToUnix(endTime) + '&step=' + step) }) } diff --git a/nezha-fronted/src/components/page/dashboard/panel.vue b/nezha-fronted/src/components/page/dashboard/panel.vue index 245e44eeb..226e28115 100644 --- a/nezha-fronted/src/components/page/dashboard/panel.vue +++ b/nezha-fronted/src/components/page/dashboard/panel.vue @@ -82,7 +82,7 @@
- +
@@ -215,7 +215,8 @@ export default { filterPanel: '', // ---图表相关参数--end scrollbarWrap: null, - batchDeleteObjs: [] + batchDeleteObjs: [], + nowTimeType: {} } }, components: { @@ -470,6 +471,7 @@ export default { // 选择日期变化 dateChange (val) { const nowTimeType = this.$refs.pickTime.$refs.timePicker.nowTimeType + this.nowTimeType = this.$refs.pickTime.$refs.timePicker.nowTimeType this.setSearchTime(nowTimeType.type, nowTimeType.value, nowTimeType) this.filter.start_time = bus.timeFormate(this.searchTime[0], 'yyyy-MM-dd hh:mm:ss') this.filter.end_time = bus.timeFormate(this.searchTime[1], 'yyyy-MM-dd hh:mm:ss')