diff --git a/nezha-fronted/src/assets/css/common.scss b/nezha-fronted/src/assets/css/common.scss index 921bcd3fb..deaa6a728 100644 --- a/nezha-fronted/src/assets/css/common.scss +++ b/nezha-fronted/src/assets/css/common.scss @@ -98,6 +98,9 @@ .colorffa416 { color: #ffa416; } +.colorfa901c { + color: $--color-primary; +} .colorec7f66 { color: #ec7f66; } @@ -720,4 +723,4 @@ i.nz-icon-override{ cursor: default; } } -} \ No newline at end of file +} diff --git a/nezha-fronted/src/assets/css/components/common/timePicker.scss b/nezha-fronted/src/assets/css/components/common/timePicker.scss index e26460726..7e84762a1 100644 --- a/nezha-fronted/src/assets/css/components/common/timePicker.scss +++ b/nezha-fronted/src/assets/css/components/common/timePicker.scss @@ -171,8 +171,8 @@ background: $--background-color-empty; box-shadow: 0 3px 6px -4px rgba(0, 0, 0, 0.12), 0 6px 16px 0 rgba(0, 0, 0, 0.08), 0 9px 28px 8px rgba(0, 0, 0, 0.05); position: absolute; - right: 4%; - top: 50px; + right: 80px; + top: 40px; z-index: 1; .date-range-panel-content-left { diff --git a/nezha-fronted/src/components/common/bottomBox/bottomBox.vue b/nezha-fronted/src/components/common/bottomBox/bottomBox.vue index b0306d356..a60574380 100644 --- a/nezha-fronted/src/components/common/bottomBox/bottomBox.vue +++ b/nezha-fronted/src/components/common/bottomBox/bottomBox.vue @@ -161,6 +161,33 @@ export default { obj: { immediate: true, handler (n) { + if (this.from === this.fromRoute.asset) { + const hasSub = this.obj && this.obj.childrenNum + const hasProcess = this.obj && this.obj.clientState == '1' + const hasVays = this.obj && this.obj.model && this.obj.model.tsgAppliance == '1' + if (this.targetTab === 'assetSubTab' && !hasSub) { + this.$nextTick(() => { + this.changeTab('dashboardTab') + }) + } + if (this.targetTab === 'process' && !hasProcess) { + this.$nextTick(() => { + this.changeTab('dashboardTab') + }) + } + if (this.targetTab === 'vsys' && !hasVays) { + this.$nextTick(() => { + this.changeTab('dashboardTab') + }) + } + } + if (this.from === this.fromRoute.endpoint) { + const config = this.obj.configs.find(c => c.type === 'logs') + const hasLog = config && config.enable === 1 + if (this.targetTab === 'log' && !hasLog) { + this.changeTab('dashboardTab') + } + } } } }, @@ -309,11 +336,12 @@ export default { return config && config.enable === 1 }, assetTabs () { + const id = this.obj.id const hasSub = this.obj && this.obj.childrenNum const hasProcess = this.obj && this.obj.clientState == '1' const hasVays = this.obj && this.obj.model && this.obj.model.tsgAppliance == '1' const tabs = [ - { prop: 'dashboardTab', name: this.$t('overall.dashboard') }, + { prop: 'dashboardTab', name: this.$t('overall.dashboard'), id: id }, { prop: 'alertMessageTab', name: this.$t('overall.alert') }, { prop: 'endpointTab', name: this.$t('asset.endpoint') }, { prop: 'log', name: this.$t('dashboard.dashboard.chartForm.typeVal.log.label') } @@ -331,10 +359,11 @@ export default { return tabs }, endpointTabs () { + const id = this.obj.id const config = this.obj.configs.find(c => c.type === 'logs') const hasLog = config && config.enable === 1 const tabs = [ - { prop: 'dashboardTab', name: this.$t('overall.dashboard') }, + { prop: 'dashboardTab', name: this.$t('overall.dashboard'), id: id }, { prop: 'endpointAlertMessage', name: this.$t('overall.alert') }, { prop: 'Metrics', name: this.$t('overall.metric') } ] diff --git a/nezha-fronted/src/components/common/bottomBox/tabs/dashboardTab.vue b/nezha-fronted/src/components/common/bottomBox/tabs/dashboardTab.vue index 38171d957..e96c01804 100644 --- a/nezha-fronted/src/components/common/bottomBox/tabs/dashboardTab.vue +++ b/nezha-fronted/src/components/common/bottomBox/tabs/dashboardTab.vue @@ -15,7 +15,7 @@