diff --git a/nezha-fronted/src/components/charts/chart-detail.vue b/nezha-fronted/src/components/charts/chart-detail.vue index 4db3ad90a..67d3d5732 100644 --- a/nezha-fronted/src/components/charts/chart-detail.vue +++ b/nezha-fronted/src/components/charts/chart-detail.vue @@ -76,7 +76,7 @@ -
+
{{key}}
{{key}}
@@ -119,57 +119,8 @@
- -
-
- {{projectKey[key]}} -
{{projectKey[key]}}
-
-
- - -
-
- -
-
- {{moduleKey[key]}} -
{{moduleKey[key]}}
-
-
- - - -
-
- -
+
{{endpointKey[key]}}
{{endpointKey[key]}}
diff --git a/nezha-fronted/src/components/charts/chart-list.vue b/nezha-fronted/src/components/charts/chart-list.vue index 4aaec8440..438d1c177 100644 --- a/nezha-fronted/src/components/charts/chart-list.vue +++ b/nezha-fronted/src/components/charts/chart-list.vue @@ -116,7 +116,7 @@ @dropmenu-change="(show) => {dropmenuChange(item.id, show)}" :chart-index="index"> - + - @@ -164,7 +164,7 @@ export default { }, endpoint: { endpointTabTitle: [ - // { prop: 'panel', name: 'Detail' }, + { prop: 'panelTab', name: this.$t('overall.detail') }, { prop: 'endpointQuery', name: 'Query' }, { prop: 'endpointAlertMessage', name: this.$t('overall.alert') } ] diff --git a/nezha-fronted/src/components/common/bottomBox/tabs/alertMessageTabNew.vue b/nezha-fronted/src/components/common/bottomBox/tabs/alertMessageTabNew.vue index a11a6f90c..a40307952 100644 --- a/nezha-fronted/src/components/common/bottomBox/tabs/alertMessageTabNew.vue +++ b/nezha-fronted/src/components/common/bottomBox/tabs/alertMessageTabNew.vue @@ -285,6 +285,24 @@ export default { }) } }, + del (row) { + const self = this + this.$confirm(this.$t('tip.confirmDelete'), { + confirmButtonText: this.$t('tip.yes'), + cancelButtonText: this.$t('tip.no'), + type: 'warning' + }).then(() => { + this.$delete(this.url + '?ids=' + row.id + '&state=3').then(response => { + if (response.code === 200) { + self.delFlag = true + this.$message({ duration: 2000, type: 'success', message: this.$t('tip.deleteSuccess') }) + self.getTableData() + } else { + this.$message.error(response.msg) + } + }) + }) + }, getTableData (state) { if (state) { this.state = state diff --git a/nezha-fronted/src/components/common/bottomBox/tabs/panelTabNew.vue b/nezha-fronted/src/components/common/bottomBox/tabs/panelTabNew.vue index df35d4c00..6c7ed8892 100644 --- a/nezha-fronted/src/components/common/bottomBox/tabs/panelTabNew.vue +++ b/nezha-fronted/src/components/common/bottomBox/tabs/panelTabNew.vue @@ -10,28 +10,13 @@ > + + + + + +
@@ -90,6 +114,7 @@ import bus from '../../../../libs/bus' import subDataListMixin from '@/components/common/mixin/subDataList' import nzBottomDataList from '@/components/common/bottomBox/nzBottomDataList' import { fromRoute } from '@/components/common/js/constants' +import chartTempBox from '@/components/common/rightBox/chartTempBox' import topToolMoreOptions from '@/components/common/popBox/topToolMoreOptions' export default { name: 'panelTabNew', @@ -107,7 +132,12 @@ export default { showTopBtn: false, // top按钮 visible: false, rightBox: { // 面板弹出框相关 - show: false + chart: { + show: false + }, + chartTemp: { + show: false + } }, tableHover: false, searchTime: bus.getTimezontDateRange(), @@ -161,7 +191,13 @@ export default { showPanel: { name: '', type: this.from, - id: '' + id: null + }, + blankChartTemp: { + varType: 1, + pid: '', + panelId: null, + varIds: [] }, // removeModal: false, // 删除弹出 // deleteObj: {}, // 删除对象 @@ -174,7 +210,8 @@ export default { chartBox, chartList, nzBottomDataList, - topToolMoreOptions + topToolMoreOptions, + chartTempBox }, methods: { // 刷新 @@ -192,7 +229,18 @@ export default { /* 图表相关操作--start */ addChart () { this.chart = this.newChart() - this.rightBox.show = true + this.rightBox.chart.show = true + }, + addChartByTemp () { + this.chart = Object.assign({}, this.blankChartTemp) + this.chart.panelId = this.showPanel.id + if (this.from === fromRoute.endpoint) { + this.chart.varType = 2 + } + if (this.from === fromRoute.asset || this.from === fromRoute.endpoint) { + this.chart.varIds.push(this.obj.id) + } + this.rightBox.chartTemp.show = true }, newChart () { return JSON.parse(JSON.stringify(this.blankChart)) @@ -202,7 +250,8 @@ export default { this.$emit('changeTab', tab) }, closeRightBox (refresh) { - this.rightBox.show = false + this.rightBox.chart.show = false + this.rightBox.chartTemp.show = false if (refresh) { this.refresh() if (this.from === fromRoute.chartTemp) { @@ -227,7 +276,7 @@ export default { data.param = { url: '', threshold: '' } } this.chart = JSON.parse(JSON.stringify(data)) - this.rightBox.show = true + this.rightBox.chart.show = true }, // 移除图表:弹出确认框询问 delChart (data, from) { @@ -256,7 +305,7 @@ export default { this.chart.panelId = this.showPanel.id this.chart.panelName = this.showPanel.name this.chart.isGroup = true - this.rightBox.show = true + this.rightBox.chart.show = true }, delChartOk () { this.getData(this.filter) @@ -322,10 +371,10 @@ export default { }, // 公用操作 getTableData (linkId) { - if (this.from === this.fromRoute.alertRule || this.from === this.fromRoute.endpoint) { + if (this.from === this.fromRoute.alertRule) { this.getData(this.filter) } else { - if (this.from == this.$CONSTANTS.fromRoute.chartTemp) { + if (this.from === this.fromRoute.chartTemp) { if (this.obj.type === 'group') { this.$get('/visual/panel/chart', { ids: this.obj.id, groupId: 0 }).then(res => { res.data.list.forEach(item => { @@ -497,7 +546,7 @@ export default { this.$message.error(res.msg) } }) - }, + } }, mounted () { this.scrollbarWrap = this.$refs.dashboardScrollbar diff --git a/nezha-fronted/src/components/common/language/cn.js b/nezha-fronted/src/components/common/language/cn.js index 490b24853..11edd5899 100644 --- a/nezha-fronted/src/components/common/language/cn.js +++ b/nezha-fronted/src/components/common/language/cn.js @@ -14,6 +14,9 @@ const cn = { twoDay: '2 天', week: '1 周', folder: '文件夹', + key: '键名', + state: '状态', + projectName: '系统名称', startTime: '开始时间', endTime: '结束时间', metric: '指标', @@ -76,7 +79,7 @@ const cn = { createPrometheusServer: '新增Agent', createDatacenter: '新增数据中心', active: '活跃', - type: '类别', + type: '类型', detail: '详细信息', changePin: '修改密码', createCabinet: '新增机柜', @@ -630,7 +633,7 @@ const cn = { assetPing: 'Ping', lastReply: 'Ping最后应答', vendor: '厂商', - name: 'Name', + name: '名称', dc: '数据中心', type: '主机地址', pingInfo: 'Ping' diff --git a/nezha-fronted/src/components/common/language/en.js b/nezha-fronted/src/components/common/language/en.js index 7688a3760..7e0abb12b 100644 --- a/nezha-fronted/src/components/common/language/en.js +++ b/nezha-fronted/src/components/common/language/en.js @@ -20,6 +20,9 @@ const en = { twoDay: '2 days', week: '1 week', folder: 'Folder', + key: 'Key', + state: 'State', + projectName: 'project name', startTime: 'Start time', endTime: 'End time', metric: 'Metric', @@ -126,7 +129,7 @@ const en = { copySuccess: 'Copy success', parent: 'Parent', dc: 'Data center', - labels: 'Labels', + labels: 'Label', moreOption: 'More option', copy: 'Copy', silence: 'Silence', diff --git a/nezha-fronted/src/components/common/mixin/table.js b/nezha-fronted/src/components/common/mixin/table.js index b35101501..968b45da3 100644 --- a/nezha-fronted/src/components/common/mixin/table.js +++ b/nezha-fronted/src/components/common/mixin/table.js @@ -25,10 +25,6 @@ export default { methods: { tableOperation ([command, row, param]) { switch (command) { - case 'edit': { - this.$emit('edit', row) - break - } case 'delete': { this.$emit('del', row) break @@ -37,21 +33,8 @@ export default { this.$emit('showBottomBox', 'recordTab', row) break } - case 'cli': { - this.$emit('cli', row) - break - } - case 'duplicate': { - this.$emit('duplicate', row) - break - } - case 'copy': { - this.$emit('copy', row) - break - } - case 'shutdown': { - // this.$emit('copy', row) - this.$emit('shutdown', row) + case 'endpointQuery': { + this.$emit('showBottomBox', 'endpointQuery', row) break } case 'sync': { @@ -60,6 +43,7 @@ export default { break } default: + this.$emit(command, row) break } }, diff --git a/nezha-fronted/src/components/common/popBox/topToolMoreOptions.vue b/nezha-fronted/src/components/common/popBox/topToolMoreOptions.vue index 653684db7..ba1ec45ca 100644 --- a/nezha-fronted/src/components/common/popBox/topToolMoreOptions.vue +++ b/nezha-fronted/src/components/common/popBox/topToolMoreOptions.vue @@ -7,6 +7,7 @@
{{panelLock ? $t("overall.locked") : $t("overall.unlocked")}}
+
{{$t('overall.importExcel')}}
@@ -14,10 +15,8 @@
{{$t('overall.exportExcel')}}
+ - @@ -27,9 +26,6 @@
{{$t('overall.importTip')}}
{{$t('overall.dragFileTip')}},{{$t('overall.or')}} {{$t('overall.clickUpload')}}
-