From 647cd8c9e5ed39f63778b71b523cc761a9f45137 Mon Sep 17 00:00:00 2001 From: zhangyu Date: Mon, 25 Apr 2022 14:43:54 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=97=B6=E9=97=B4=E9=80=89=E6=8B=A9?= =?UTF-8?q?=E5=99=A8=20=E6=A0=B7=E5=BC=8F=E8=B0=83=E6=95=B4=20=E4=BB=A5?= =?UTF-8?q?=E5=8F=8A=20=E4=BF=AE=E6=94=B9=E5=B7=B2=E7=99=BB=E5=BD=95?= =?UTF-8?q?=E7=9A=84=E7=94=A8=E6=88=B7=20=E6=9C=AA=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E4=B8=BB=E9=A2=98=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../css/components/common/timePicker.scss | 8 ++--- .../page/dashboard/explore/promqlInput.vue | 36 +++++++++++++------ nezha-fronted/src/permission.js | 2 ++ 3 files changed, 31 insertions(+), 15 deletions(-) diff --git a/nezha-fronted/src/assets/css/components/common/timePicker.scss b/nezha-fronted/src/assets/css/components/common/timePicker.scss index 47432bc42..6b42f61ce 100644 --- a/nezha-fronted/src/assets/css/components/common/timePicker.scss +++ b/nezha-fronted/src/assets/css/components/common/timePicker.scss @@ -8,7 +8,7 @@ line-height: 40px; height: 40px; box-sizing: border-box; - border: 1px solid $--border-color-base; + border: 1px solid $--border-color-light; border-radius: $--border-radius-small; } .calendar.calendar--small { @@ -122,12 +122,12 @@ padding: 0 10px; display: flex; justify-content: space-around; - height: 26px; + height: 30px; background: $--background-color-empty; - border: 1px solid $--border-color-light; + //border: 1px solid $--border-color-light; box-shadow: 0 2px 4px 0 rgba(51, 51, 51, 0.02); border-radius: 2px; - line-height: 26px; + line-height: 30px; transition: width .3s; .cn-icon { diff --git a/nezha-fronted/src/components/page/dashboard/explore/promqlInput.vue b/nezha-fronted/src/components/page/dashboard/explore/promqlInput.vue index edefebb9f..905af90a6 100644 --- a/nezha-fronted/src/components/page/dashboard/explore/promqlInput.vue +++ b/nezha-fronted/src/components/page/dashboard/explore/promqlInput.vue @@ -76,15 +76,18 @@ class="input-box" @click="dropDownVisible = false" > -
- + >
{{ errorMsg }} @@ -231,8 +234,10 @@ @click="dropDownVisible = false" v-if="plugins.indexOf('metric-input') > -1" > -
- + >
{{ errorMsg }}
@@ -528,8 +534,7 @@ export default { } }, mounted () { - this.initCodeMirror() - if (!this.fromFatherData && this.type !== 'logs') { + if (!this.fromFatherData && this.type !== 'log') { this.queryMetrics() } }, @@ -1092,7 +1097,7 @@ export default { // console.log(n, n[this.index]) this.codeMirrorValue[this.index] = n[this.index] } - } + }, // codeMirrorValue:{ // deep:true, @@ -1103,6 +1108,15 @@ export default { // } // } // } + type: { + deep: true, + immediate: true, + handler(n) { + if (n !== 'log') { + this.initCodeMirror() + } + } + } } } diff --git a/nezha-fronted/src/permission.js b/nezha-fronted/src/permission.js index 4b5bb2463..021ade4dd 100644 --- a/nezha-fronted/src/permission.js +++ b/nezha-fronted/src/permission.js @@ -143,6 +143,8 @@ router.beforeEach((to, from, next) => { }) }) } else { + const theme = localStorage.getItem(`nz-user-${localStorage.getItem('nz-user-id')}-theme`) || 'light' + document.getElementsByTagName('body')[0].setAttribute('class', 'theme-' + theme) resolve() } })