diff --git a/nezha-fronted/src/assets/css/components/common/rightBox/alertRuleBox.scss b/nezha-fronted/src/assets/css/components/common/rightBox/alertRuleBox.scss index 15c0219c8..bcaf315f8 100644 --- a/nezha-fronted/src/assets/css/components/common/rightBox/alertRuleBox.scss +++ b/nezha-fronted/src/assets/css/components/common/rightBox/alertRuleBox.scss @@ -60,7 +60,7 @@ width: 100%; } .query-row .metric-selector-input-box { - width: calc(100% - 120px); + width: calc(100% - 120px) !important; } .el-input-number--small { diff --git a/nezha-fronted/src/assets/css/components/page/dashboard/chartBox.scss b/nezha-fronted/src/assets/css/components/page/dashboard/chartBox.scss index 883f38fd6..a0f267a6b 100644 --- a/nezha-fronted/src/assets/css/components/page/dashboard/chartBox.scss +++ b/nezha-fronted/src/assets/css/components/page/dashboard/chartBox.scss @@ -137,9 +137,14 @@ z-index: 10; } /* metric input */ -.metric-selector-input-box { - width: calc(100% - 160px) !important; - .input-box { - margin: 0 !important; +.right-box { + .el-form{ + .metric-selector-input-box { + width: calc(100% - 120px); + .input-box { + margin: 0 !important; + } + } } } + diff --git a/nezha-fronted/src/components/chart/panelChart.vue b/nezha-fronted/src/components/chart/panelChart.vue index 5a5e0f403..0c9c43836 100644 --- a/nezha-fronted/src/components/chart/panelChart.vue +++ b/nezha-fronted/src/components/chart/panelChart.vue @@ -144,16 +144,17 @@ export default { }, // 参数 isRefresh 标识是否是刷新操作 getChartData (isRefresh, params) { // 获取chart的数据前的准备 主要用于处理时间参数 + console.log(isRefresh) this.loading = true // TODO assetInfo、endpointInfo、echarts等进行不同的处理 let startTime = '' let endTime = '' if (isRefresh) { // 刷新则视情况更新时间范围 const now = new Date(bus.computeTimezone(new Date().getTime())) - const origin = new Date(this.timeRange[1]) + const origin = new Date(bus.timeFormate(bus.formateTimeToTime(this.timeRange[1]), 'YYYY-MM-DD HH:mm:ss')) const numInterval = now.getTime() - origin.getTime() if (numInterval >= 60000) { // 大于1分钟,则start、end均往后移numInterval,否则时间不变 - startTime = bus.getNewTime(bus.formateTimeToTime(this.timeRange[0]), numInterval) + startTime = bus.getNewTime(bus.formateTimeToTime(this.timeRange[0]), numInterval, 'YYYY-MM-DD HH:mm:ss') endTime = bus.timeFormate(now, 'YYYY-MM-DD HH:mm:ss') } else { startTime = bus.formateTimeToTime(this.timeRange[0]) diff --git a/nezha-fronted/src/components/common/mixin/editRigthBox.js b/nezha-fronted/src/components/common/mixin/editRigthBox.js index c359d9aa5..b1e37f64e 100644 --- a/nezha-fronted/src/components/common/mixin/editRigthBox.js +++ b/nezha-fronted/src/components/common/mixin/editRigthBox.js @@ -33,7 +33,6 @@ export default { assetAdd.addEventListener('click', this.saveNext) }, saveNext () { - console.log(this.assetId) this.$router.push({ path: this.messageParams.route, query: this.messageParams.params diff --git a/nezha-fronted/src/components/common/nezhaColor.vue b/nezha-fronted/src/components/common/nezhaColor.vue index 37de7d08a..c41cda962 100644 --- a/nezha-fronted/src/components/common/nezhaColor.vue +++ b/nezha-fronted/src/components/common/nezhaColor.vue @@ -75,9 +75,23 @@ export default { showText: { type: Boolean, default: true + }, + isTopo: { + type: Boolean, + default: false + } + }, + watch: { + valueArr: { + handler (n) { + if (this.isTopo) { + this.keyName = this.valueArr[0].name + this.colors = this.valueArr[0].value || randomcolor() + 'FF' + } + }, + deep: true } }, - watch: {}, data () { return { colors: '#ffffff', diff --git a/nezha-fronted/src/components/common/project/L5/CanvasProps.vue b/nezha-fronted/src/components/common/project/L5/CanvasProps.vue index 92c896490..2a7b80abc 100644 --- a/nezha-fronted/src/components/common/project/L5/CanvasProps.vue +++ b/nezha-fronted/src/components/common/project/L5/CanvasProps.vue @@ -106,7 +106,7 @@
- @@ -224,6 +224,7 @@ :from-father-data="true" :metricOptionsParent="metricOptions" :id="index" + :pqid="'vm'" :key="index" :ref="'promql-'+index" :expression-list="selection.pen.data.expressAllArr" @@ -401,7 +402,7 @@
{{ $t('project.topology.bac') }}
-
@@ -409,7 +410,7 @@
{{ $t('project.topology.iconColor') }}
-
@@ -430,7 +431,7 @@
-
@@ -636,14 +637,14 @@
{{ $t('project.topology.lineColor') }}
-
{{ $t('project.topology.arrowColor') }}
-
@@ -678,7 +679,7 @@
{{ $t('project.topology.fontColor') }}
-
@@ -862,7 +863,7 @@ - + @@ -909,7 +910,7 @@
-
@@ -1423,7 +1424,7 @@ export default { // immediate:false, // }, selection: { - handler () { + handler (n) { // this.loading = false if (this.selection.pen && this.selection.pen.data && (!this.selection.pen.data.expressAllArr || this.selection.pen.data.expressAllArr.length === 0)) { this.selection.pen.data.expressAllArr = [''] @@ -1433,6 +1434,14 @@ export default { deep: true, immediate: true }, + 'selection.pen.data': { + handler (n) { + // this.loading = false + if (this.selection.pen && JSON.stringify(this.selection.pen.type)) { + this.$emit('change', this.selection.pen) + } + } + }, fromDiagram: { handler () { if (this.selection.pen && this.selection.pen.data) { diff --git a/nezha-fronted/src/components/common/project/topologyL5.vue b/nezha-fronted/src/components/common/project/topologyL5.vue index d169e8b33..ebf26251c 100644 --- a/nezha-fronted/src/components/common/project/topologyL5.vue +++ b/nezha-fronted/src/components/common/project/topologyL5.vue @@ -1201,6 +1201,9 @@ export default { } if (!Array.isArray(data) && data) { // 判断不是数组 提前个data配置好节点属性 if (data.type === 0 && !data.data.moduleId) { + if (!data.fillStyle) { + data.fillStyle = '#FFFFFF00' + } data.data = { ...data.data, moduleId: '', @@ -1208,8 +1211,8 @@ export default { show: false, error: false, animatePlay: false, - fillStyle: data.fillStyle, - strokeStyle: data.strokeStyle, + fillStyle: data.fillStyle || '#ffffff', + strokeStyle: data.strokeStyle || '#ffffff', gradientColor: '#bae7ff', gradientType: 0, lineWidth: this.nodeDefaultWidth(data.name), diff --git a/nezha-fronted/src/components/common/searchInput.vue b/nezha-fronted/src/components/common/searchInput.vue index 22b398ee1..8b315e1b1 100644 --- a/nezha-fronted/src/components/common/searchInput.vue +++ b/nezha-fronted/src/components/common/searchInput.vue @@ -930,7 +930,6 @@ export default { } else if (val.type === 'project') { objectInfo.projectIds = val.valnum } else if (val.label === 'assetState') { - console.log(val) objectInfo.state = val.valnum } else if (val.label === 'assetType') { objectInfo.typeIds = val.valnum diff --git a/nezha-fronted/src/components/page/dashboard/explore/promqlInput.vue b/nezha-fronted/src/components/page/dashboard/explore/promqlInput.vue index 16d9d83ac..e111b634f 100644 --- a/nezha-fronted/src/components/page/dashboard/explore/promqlInput.vue +++ b/nezha-fronted/src/components/page/dashboard/explore/promqlInput.vue @@ -235,7 +235,7 @@ v-if="plugins.indexOf('metric-input') > -1" >
@@ -435,6 +435,9 @@ export default { }, props: { index: { type: Number }, + pqid: { + type: String, default: '' + }, expressionList: {}, plugins: { type: Array }, styleType: Number, @@ -654,7 +657,7 @@ export default { const view = new EditorView({ state: EditorViewstate, // parent: document.getElementById('editor') - parent: document.getElementById('editor' + self.index) + parent: document.getElementById(this.pqid + 'editor' + self.index) }) self.newView = view } else { @@ -663,7 +666,6 @@ export default { // const to = self.codeMirrorValue.length const to = self.oldcCodeLength const from = self.oldcCodeLength - // console.log(from, to) self.newView.dispatch( self.newView.state.update({ effects: dynamicConfigCompartment.reconfigure(dynamicConfig), @@ -1096,6 +1098,14 @@ export default { handler (n, o) { // console.log(n, n[this.index]) this.codeMirrorValue[this.index] = n[this.index] + setTimeout(() => { + const text = this.newView.state.doc.toString() + this.newView.dispatch( + this.newView.state.update({ + changes: { from: 0, to: text.length, insert: this.codeMirrorValue[this.index] } + }) + ) + }, 200) } }, diff --git a/nezha-fronted/src/components/page/monitor/endpoint/endpointList.vue b/nezha-fronted/src/components/page/monitor/endpoint/endpointList.vue index c0d2587d0..7b88b9084 100644 --- a/nezha-fronted/src/components/page/monitor/endpoint/endpointList.vue +++ b/nezha-fronted/src/components/page/monitor/endpoint/endpointList.vue @@ -106,10 +106,13 @@ @@ -365,7 +368,8 @@ export default { editShow: false, show: false, batchModify: false, - batchAdd: false + batchAdd: false, + batchShow: false }, titleSearch: {}, titleSearchList: { @@ -795,6 +799,9 @@ export default { batchAdd () { this.rightBox.batchAdd = true }, + batchEdit () { + this.rightBox.batchShow = true + }, rollbackImport () { this.$delete('monitor/endpoint/cancelImport' + '?seq=' + this.importResult.seq).then(response => { if (response.code == 200) { diff --git a/nezha-fronted/src/libs/bus.js b/nezha-fronted/src/libs/bus.js index b2101691a..d03f4fbf3 100644 --- a/nezha-fronted/src/libs/bus.js +++ b/nezha-fronted/src/libs/bus.js @@ -223,10 +223,13 @@ export default new Vue({ new Date(this.computeTimezone(new Date().getTime())) ] }, - getNewTime (time, num) { + getNewTime (time, num, fmt) { + if (!fmt) { + fmt = localStorage.getItem('nz-default-dateFormat') || 'YYYY-MM-DD HH:mm:ss' + } const date = new Date(time) const newDate = new Date(parseInt(date.getTime(), 10) + num) - return this.timeFormate(newDate, localStorage.getItem('nz-default-dateFormat') ? localStorage.getItem('nz-default-dateFormat') : 'YYYY-MM-DD HH:mm:ss') + return this.timeFormate(newDate, fmt) }, getOffsetTimezoneData (offset = 0) { return new Date(this.computeTimezone(new Date().getTime())).setHours(new Date(this.computeTimezone(new Date().getTime())).getHours() + offset)