diff --git a/nezha-fronted/src/components/common/popBox/guide.vue b/nezha-fronted/src/components/common/popBox/guide.vue index 522c3cafa..ac5e961ee 100644 --- a/nezha-fronted/src/components/common/popBox/guide.vue +++ b/nezha-fronted/src/components/common/popBox/guide.vue @@ -4,6 +4,7 @@ :visible.sync="visible" custom-class="guild-pop" width="1000px" + @close="close" >
@@ -119,7 +120,7 @@ export default { }, methods: { close () { - this.visible = false + this.$emit('close') }, enter (index) { this.interval = setInterval(() => { @@ -130,13 +131,27 @@ export default { this.interval && clearInterval(this.interval) }, downloadAgent () { - // TODO + this.$emit('close') + this.$router.push({ + path: '/agent', + query: { + t: +new Date(), + download: 'agent' + } + }) }, openTerminal () { - // TODO + this.$emit('close') + this.$router.push({ + path: '/asset', + query: { + t: +new Date() + } + }) + this.$store.commit('openConsole') }, jump (route) { - this.visible = false + this.$emit('close') this.$router.push({ path: route, query: { @@ -145,7 +160,7 @@ export default { }) }, jumpAndOpen (cmd, open) { - this.visible = false + this.$emit('close') switch (cmd) { case 'dc': { this.$router.push({ @@ -177,6 +192,16 @@ export default { }) break } + case 'importAsset': { + this.$router.push({ + path: '/asset', + query: { + t: +new Date(), + importAsset: 'importAsset' + } + }) + break + } case 'project': { this.$router.push({ path: '/monitor/project', @@ -207,6 +232,16 @@ export default { }) break } + case 'importEndpoint': { + this.$router.push({ + path: '/monitor/endpoint', + query: { + t: +new Date(), + importEndpoint: 'importEndpoint' + } + }) + break + } case 'panel': { this.$router.push({ path: '/panel', @@ -237,12 +272,24 @@ export default { }) break } + case 'cabinet': { + this.$router.push({ + path: '/dc', + query: { + t: +new Date(), + add: 'cabinet' + } + }) + break + } default: break } + // location.reload() } }, watch: { showDialog (n) { + console.log(n) this.visible = n }, activeIndex (n) { diff --git a/nezha-fronted/src/components/common/rightBox/cabinetBox.vue b/nezha-fronted/src/components/common/rightBox/cabinetBox.vue index f9f3e4ce0..adf17065f 100644 --- a/nezha-fronted/src/components/common/rightBox/cabinetBox.vue +++ b/nezha-fronted/src/components/common/rightBox/cabinetBox.vue @@ -1,16 +1,21 @@ diff --git a/nezha-fronted/src/components/page/alert/alertRule.vue b/nezha-fronted/src/components/page/alert/alertRule.vue index 7c199c25b..ed6038c1a 100644 --- a/nezha-fronted/src/components/page/alert/alertRule.vue +++ b/nezha-fronted/src/components/page/alert/alertRule.vue @@ -162,11 +162,17 @@ export default { } }, mounted () { - // 是否弹出侧滑 - const add = this.$route.query.add - if (add) { - if (add === 'alertRule') { - this.add() + }, + watch: { + $route: { + immediate: true, + handler () { + const add = this.$route.query.add + if (add) { + if (add === 'alertRule') { + this.add() + } + } } } } diff --git a/nezha-fronted/src/components/page/asset/asset.vue b/nezha-fronted/src/components/page/asset/asset.vue index 218aac5d6..34f907ebb 100644 --- a/nezha-fronted/src/components/page/asset/asset.vue +++ b/nezha-fronted/src/components/page/asset/asset.vue @@ -14,6 +14,7 @@ { + this.$refs.export.showImportBox(1) + }) + } } } } diff --git a/nezha-fronted/src/components/page/config/agent.vue b/nezha-fronted/src/components/page/config/agent.vue index a9acc2833..5f95520a2 100644 --- a/nezha-fronted/src/components/page/config/agent.vue +++ b/nezha-fronted/src/components/page/config/agent.vue @@ -270,11 +270,22 @@ export default { } }, mounted () { - // 是否弹出侧滑 - const add = this.$route.query.add - if (add) { - if (add === 'agent') { - this.add() + }, + watch: { + $route: { + immediate: true, + handler () { + // 是否弹出侧滑 + const add = this.$route.query.add + const download = this.$route.query.download + if (add) { + if (add === 'agent') { + this.add() + } + } + if (download) { + this.toDownloadAgent() + } } } } diff --git a/nezha-fronted/src/components/page/config/dc.vue b/nezha-fronted/src/components/page/config/dc.vue index 6bfc1159e..1fb9651f0 100644 --- a/nezha-fronted/src/components/page/config/dc.vue +++ b/nezha-fronted/src/components/page/config/dc.vue @@ -39,10 +39,14 @@ + + +