diff --git a/nezha-fronted/src/assets/css/common/loading.scss b/nezha-fronted/src/assets/css/common/loading.scss index f4af96a93..426ef4fe1 100644 --- a/nezha-fronted/src/assets/css/common/loading.scss +++ b/nezha-fronted/src/assets/css/common/loading.scss @@ -8,7 +8,8 @@ height: 100%; width: 100%; position: absolute; - z-index: 2000; + // z-index: 2000; + z-index: 1000; background-color: $--background-color-empty; opacity: 0.8; margin: 0; diff --git a/nezha-fronted/src/assets/css/components/common/bottomBox/bottomBox.scss b/nezha-fronted/src/assets/css/components/common/bottomBox/bottomBox.scss index 59d471e22..63ea1476d 100644 --- a/nezha-fronted/src/assets/css/components/common/bottomBox/bottomBox.scss +++ b/nezha-fronted/src/assets/css/components/common/bottomBox/bottomBox.scss @@ -45,7 +45,7 @@ } } } - & > .bottom-panel { + & > .bottom-dashboard { padding: 15px 10px 0px 10px !important; } } @@ -190,7 +190,7 @@ transition: 0.4s height; } -.bottom-panel { +.bottom-dashboard { background-color: $--background-color-empty; height: calc(100% - 30px); } diff --git a/nezha-fronted/src/assets/css/components/common/bottomBox/panelTabNew.scss b/nezha-fronted/src/assets/css/components/common/bottomBox/dashboardTab.scss similarity index 99% rename from nezha-fronted/src/assets/css/components/common/bottomBox/panelTabNew.scss rename to nezha-fronted/src/assets/css/components/common/bottomBox/dashboardTab.scss index c607404a4..4255bd244 100644 --- a/nezha-fronted/src/assets/css/components/common/bottomBox/panelTabNew.scss +++ b/nezha-fronted/src/assets/css/components/common/bottomBox/dashboardTab.scss @@ -1,4 +1,4 @@ -.panel-tab-new { +.dashboard-tab { .panel { height: 100%; } diff --git a/nezha-fronted/src/assets/css/components/index.scss b/nezha-fronted/src/assets/css/components/index.scss index 01da4de7a..b9f2e1321 100644 --- a/nezha-fronted/src/assets/css/components/index.scss +++ b/nezha-fronted/src/assets/css/components/index.scss @@ -12,7 +12,7 @@ @import './common/alert/alertMessageInfo.scss'; @import './common/alert/alertDaysInfo.scss'; @import './common/bottomBox/bottomBox.scss'; -@import './common/bottomBox/panelTabNew.scss'; +@import './common/bottomBox/dashboardTab.scss'; @import './common/bottomBox/issueTab.scss'; @import './common/bottomBox/terminalLogCMDTab.scss'; @import './common/bottomBox/terminalLogMonitorTab.scss'; diff --git a/nezha-fronted/src/components/chart/assetInfoData.js b/nezha-fronted/src/components/chart/assetInfoData.js index 84d232f7d..98654703c 100644 --- a/nezha-fronted/src/components/chart/assetInfoData.js +++ b/nezha-fronted/src/components/chart/assetInfoData.js @@ -21,9 +21,7 @@ const data = { name: 'ADC-Serve' }, fields: [], - cabinet: { - name: '机柜' - }, + cabinet: null, pingInfo: { status: 0, rtt: null diff --git a/nezha-fronted/src/components/chart/chart/chart-table.vue b/nezha-fronted/src/components/chart/chart/chart-table.vue index df35bbebe..c0b01298b 100644 --- a/nezha-fronted/src/components/chart/chart/chart-table.vue +++ b/nezha-fronted/src/components/chart/chart/chart-table.vue @@ -130,7 +130,7 @@ export default { type: Object }, // 看板id - panelId: { + dashboardId: { type: Number, default: 0 }, @@ -179,7 +179,7 @@ export default { xAxis: [], theData: [] // series数据组 }, - panelIdInner: '', // 看板id=panelId,原写作chart,由set_data获取 + panelIdInner: '', // 看板id=dashboardId,原写作chart,由set_data获取 firstLoad: false, // 是否第一次加载 chartType: 'table', // 图表类型 screenModal: false, @@ -357,7 +357,7 @@ export default { this.screenPageObj.pageSize = this.pageObj.pageSize }, // 设置数据, filter区分 - setData (chartItem, seriesItem, panelId, filter, area, errorMsg) { + setData (chartItem, seriesItem, dashboardId, filter, area, errorMsg) { if (filter) { this.stableFilter = filter } @@ -416,7 +416,7 @@ export default { }) this.firstShow = true // 展示操作按键 - this.panelIdInner = panelId + this.panelIdInner = dashboardId this.storedTableData = seriesItem this.storedScreanTableData = seriesItem this.storedTableData = Object.assign([], this.storedTableData.reverse()) diff --git a/nezha-fronted/src/components/chart/chart/chartMap.vue b/nezha-fronted/src/components/chart/chart/chartMap.vue index 1665c83b0..f90059829 100644 --- a/nezha-fronted/src/components/chart/chart/chartMap.vue +++ b/nezha-fronted/src/components/chart/chart/chartMap.vue @@ -12,7 +12,7 @@
-
{{$t('panel.assetOk')}}
+
{{$t('dashboard.assetOk')}}
@@ -20,7 +20,7 @@
{{dcStat.asset.ok}}
-
{{$t('panel.assetAlarm')}}
+
{{$t('dashboard.assetAlarm')}}
@@ -31,7 +31,7 @@
-
{{$t('overall.agent')}} {{$t('config.agent.up')}}}
+
{{$t('overall.agent')}} {{$t('config.agent.up')}}
diff --git a/nezha-fronted/src/components/chart/chart/line-chart-block.vue b/nezha-fronted/src/components/chart/chart/line-chart-block.vue index 6c95fd271..78efac75f 100644 --- a/nezha-fronted/src/components/chart/chart/line-chart-block.vue +++ b/nezha-fronted/src/components/chart/chart/line-chart-block.vue @@ -220,7 +220,7 @@ export default { type: Object }, // 看板id - panelId: { + dashboardId: { type: Number, default: 0 }, @@ -254,7 +254,7 @@ export default { return function (from, type) { let code = '' switch (from) { - case this.$CONSTANTS.fromRoute.panel: + case this.$CONSTANTS.fromRoute.dashboard: if (type == 'chartToEdit') { code = '' } @@ -286,7 +286,7 @@ export default { xAxis: [], theData: [] // series数据组 }, - panelIdInner: '', // 看板id=panelId,原写作chart,由set_data获取 + panelIdInner: '', // 看板id=dashboardId,原写作chart,由set_data获取 chartName: '', firstLoad: false, // 是否第一次加载 divFirstShow: false, @@ -1018,9 +1018,9 @@ export default { delete option.yAxis.maxInterval } if (this.fromTopo) { - const panelTime = localStorage.getItem('panelTime') ? JSON.parse(localStorage.getItem('panelTime')) : ['', ''] - if (panelTime[0]) { - const numInterval = new Date(panelTime[1]).getTime() - new Date(panelTime[0]).getTime() + const dashboardTime = localStorage.getItem('dashboardTime') ? JSON.parse(localStorage.getItem('dashboardTime')) : ['', ''] + if (dashboardTime[0]) { + const numInterval = new Date(dashboardTime[1]).getTime() - new Date(dashboardTime[0]).getTime() if (numInterval >= 60 * 60 * 1000) { option.xAxis.minInterval = 20 * 60 * 1000 } else if (numInterval >= 30 * 60 * 1000 && numInterval < 60 * 60 * 1000) { @@ -1460,7 +1460,7 @@ export default { } }, // 设置数据, filter区分 - setData (chartItem, seriesItem, panelId, filter, legend, area, errorMsg) { + setData (chartItem, seriesItem, dashboardId, filter, legend, area, errorMsg) { legend && this.setColor(legend.length) legend && legend.forEach((t, i) => { t.color = this.bgColorList[i] }) this.filter.from = filter.from @@ -1486,7 +1486,7 @@ export default { this.$refs['localLoading' + this.chartIndex].startLoading() this.divFirstShow = true this.firstShow = true // 展示操作按键 - this.panelIdInner = panelId + this.panelIdInner = dashboardId this.data = chartItem this.seriesItem = seriesItem this.seriesItemScreen = seriesItem @@ -2125,9 +2125,9 @@ export default { let minInterval = '' let splitNumber = '' if (this.fromTopo) { - const panelTime = localStorage.getItem('panelTime') ? JSON.parse(localStorage.getItem('panelTime')) : ['', ''] - if (panelTime[0]) { - const numInterval = new Date(panelTime[1]).getTime() - new Date(panelTime[0]).getTime() + const dashboardTime = localStorage.getItem('dashboardTime') ? JSON.parse(localStorage.getItem('dashboardTime')) : ['', ''] + if (dashboardTime[0]) { + const numInterval = new Date(dashboardTime[1]).getTime() - new Date(dashboardTime[0]).getTime() if (numInterval >= 60 * 60 * 1000) { minInterval = 20 * 60 * 1000 } else if (numInterval >= 30 * 60 * 1000 && numInterval < 60 * 60 * 1000) { diff --git a/nezha-fronted/src/components/chart/chartList.vue b/nezha-fronted/src/components/chart/chartList.vue index e6760bada..7b27c7bac 100644 --- a/nezha-fronted/src/components/chart/chartList.vue +++ b/nezha-fronted/src/components/chart/chartList.vue @@ -107,7 +107,7 @@ export default { name: 'chartList', props: { // TODO isModel - panelId: {}, + dashboardId: {}, chartDetailInfo: Object, timeRange: Array, // 时间范围 isGroup: Boolean, @@ -231,7 +231,7 @@ export default { findItem.h = newH // bus.$emit('groupMove', this.copyDataList, this.groupInfo) } - this.$put('/visual/panel/chart/modify', { + this.$put('/visual/dashboard/chart/modify', { id: i, span: newW, height: newH @@ -338,11 +338,11 @@ export default { } }) const params = { - panelId: this.panelId, + dashboardId: this.dashboardId, charts: charts } if (charts && charts.length) { - this.$put('/visual/panel/chart/weights', params).then(() => { + this.$put('/visual/dashboard/chart/weights', params).then(() => { const position = getLayoutPosition(this.copyDataList) this.$store.commit('setChartLastPosition', position) }) @@ -480,11 +480,11 @@ export default { } }) const chartParams = { - panelId: this.panelId, + dashboardId: this.dashboardId, charts: charts } if (charts && charts.length) { - this.$put('/visual/panel/chart/weights', chartParams).then(() => { + this.$put('/visual/dashboard/chart/weights', chartParams).then(() => { if (params.cb) { params.cb() } diff --git a/nezha-fronted/src/components/chart/defaultLineData.js b/nezha-fronted/src/components/chart/defaultLineData.js index e001a0879..b5c5fed06 100644 --- a/nezha-fronted/src/components/chart/defaultLineData.js +++ b/nezha-fronted/src/components/chart/defaultLineData.js @@ -3,7 +3,7 @@ const data = { loaded: true, showHeader: true, name: '', - panelId: 1244, + dashboardId: 1244, groupId: 0, span: 4, height: 4, @@ -54,7 +54,7 @@ const data = { } ], sync: null, - panel: { + dashboard: { id: 1244, name: 'testnodata', createBy: null, @@ -71,7 +71,7 @@ const data = { group: { id: 0, name: null, - panelId: null, + dashboardId: null, groupId: null, span: null, height: null, @@ -89,7 +89,7 @@ const data = { y: null, elements: null, sync: null, - panel: null, + dashboard: null, group: null, children: null, chartNums: null, diff --git a/nezha-fronted/src/components/chart/defaultLogData.js b/nezha-fronted/src/components/chart/defaultLogData.js index 799c598f0..4419ea689 100644 --- a/nezha-fronted/src/components/chart/defaultLogData.js +++ b/nezha-fronted/src/components/chart/defaultLogData.js @@ -3,7 +3,7 @@ const data = { loaded: true, showHeader: true, name: '', - panelId: 1244, + dashboardId: 1244, groupId: 0, span: 4, height: 4, @@ -42,7 +42,7 @@ const data = { y: 12, elements: [], sync: null, - panel: { + dashboard: { id: 1244, name: 'testnodata', createBy: null, @@ -59,7 +59,7 @@ const data = { group: { id: 0, name: null, - panelId: null, + dashboardId: null, groupId: null, span: null, height: null, @@ -77,7 +77,7 @@ const data = { y: null, elements: null, sync: null, - panel: null, + dashboard: null, group: null, children: null, chartNums: null, diff --git a/nezha-fronted/src/components/chart/defaultTableData.js b/nezha-fronted/src/components/chart/defaultTableData.js index c7e1b4464..15d9395d6 100644 --- a/nezha-fronted/src/components/chart/defaultTableData.js +++ b/nezha-fronted/src/components/chart/defaultTableData.js @@ -2,7 +2,7 @@ const TableData = { id: 697356, name: 'Table', loaded: true, - panelId: 1479, + dashboardId: 1479, groupId: 0, span: 4.0, height: 3.0, @@ -41,7 +41,7 @@ const TableData = { y: 10.0, elements: [], sync: null, - panel: { + dashboard: { id: 1479, name: 'Chart Component Configuration Test', createBy: null, @@ -58,7 +58,7 @@ const TableData = { group: { id: 0, name: null, - panelId: null, + dashboardId: null, groupId: null, span: null, height: null, @@ -76,7 +76,7 @@ const TableData = { y: null, elements: null, sync: null, - panel: null, + dashboard: null, group: null, children: null, chartNums: null, diff --git a/nezha-fronted/src/components/chart/panelChart.vue b/nezha-fronted/src/components/chart/panelChart.vue index 62d6569ce..a3db4e393 100644 --- a/nezha-fronted/src/components/chart/panelChart.vue +++ b/nezha-fronted/src/components/chart/panelChart.vue @@ -359,8 +359,8 @@ export default { } // assetInfo or endpointInfo let linkId = '' - if (this.from == 'panel') { - linkId = this.chartInfo.panel.link + if (this.from == 'dashboard') { + linkId = this.chartInfo.varId } else { linkId = this.chartDetailInfo.id } @@ -718,7 +718,7 @@ export default { }, chartSync () { this.loading = true - this.$post('visual/panel/chart/syncTmpl', { ids: [this.chartInfo.id] }).then(res => { + this.$post('visual/dashboard/chart/syncTmpl', { ids: [this.chartInfo.id] }).then(res => { if (res.code === 200) { this.$message.success(this.$t('tip.syncSuccess')) this.$emit('refreshPanel') diff --git a/nezha-fronted/src/components/chart/tempGroup.js b/nezha-fronted/src/components/chart/tempGroup.js index d24ee4cf7..26acdc1a7 100644 --- a/nezha-fronted/src/components/chart/tempGroup.js +++ b/nezha-fronted/src/components/chart/tempGroup.js @@ -1,7 +1,7 @@ const group = { id: -2, name: 'groupTemp', - panelId: 1346, + dashboardId: 1346, groupId: 0, span: 12, height: 1, @@ -21,9 +21,9 @@ const group = { y: 0, elements: null, sync: null, - panel: { + dashboard: { id: 1346, - name: 'panel-newChart', + name: 'dashboard-newChart', createBy: null, type: null, link: null, @@ -38,7 +38,7 @@ const group = { group: { id: 0, name: null, - panelId: null, + dashboardId: null, groupId: null, span: null, height: null, @@ -56,7 +56,7 @@ const group = { y: null, elements: null, sync: null, - panel: null, + dashboard: null, group: null, children: null, chartNums: null, diff --git a/nezha-fronted/src/components/common/ChartDiagram/diagram.vue b/nezha-fronted/src/components/common/ChartDiagram/diagram.vue index bb87d6433..7f3f62bbd 100644 --- a/nezha-fronted/src/components/common/ChartDiagram/diagram.vue +++ b/nezha-fronted/src/components/common/ChartDiagram/diagram.vue @@ -673,9 +673,9 @@ export default { }) }) } - const panelTime = localStorage.getItem('panelTime') ? JSON.parse(localStorage.getItem('panelTime')) : ['', ''] - const endTime = panelTime[1] || this.filterTime[1] - const startTime = panelTime[0] || this.filterTime[0] + const dashboardTime = localStorage.getItem('dashboardTime') ? JSON.parse(localStorage.getItem('dashboardTime')) : ['', ''] + const endTime = dashboardTime[1] || this.filterTime[1] + const startTime = dashboardTime[0] || this.filterTime[0] const step = bus.getStep(startTime, endTime) data.pens && data.pens.forEach((item, index) => { this.chartGetData.push({ id: item.id, res: [] }) diff --git a/nezha-fronted/src/components/common/bottomBox/bottomBox.vue b/nezha-fronted/src/components/common/bottomBox/bottomBox.vue index 5db71b662..9a7e70843 100644 --- a/nezha-fronted/src/components/common/bottomBox/bottomBox.vue +++ b/nezha-fronted/src/components/common/bottomBox/bottomBox.vue @@ -23,8 +23,6 @@ - - @@ -38,7 +36,7 @@ - + @@ -50,16 +48,16 @@ - + - + - + - + @@ -94,9 +92,8 @@ import commentsBottomTab from './tabs/commentsBottomTab' import vsysBottomTab from './tabs/vsysBottomTab' import endpointQuery from './tabs/endpointQuery' import recordRulesQuery from './tabs/recordRulesQuery' -import endpointTab from './tabs/endpointTab' import endpointTabNew from './tabs/endpointTabNew' -import panelTabNew from './tabs/panelTabNew' +import dashboardTab from './tabs/dashboardTab' import terminalLogRecordTab from './tabs/terminalLogRecordTab' import terminalLogSftpTab from './tabs/terminalLogSftpTab' import terminalLogMonitorTab from './tabs/terminalLogMonitorTab' @@ -127,7 +124,6 @@ export default { networkBottomTab, cabinetTab, alertMessageTab, - endpointTab, terminalLogRecordTab, terminalLogSftpTab, terminalLogMonitorTab, @@ -137,7 +133,7 @@ export default { endpointTabNew, alertMessageTabNew, endpointQuery, - panelTabNew, + dashboardTab, assetTab, assetSubTab, alertRuleEvalLog, @@ -194,7 +190,7 @@ export default { }, asset: { assetTabTitle: [ - { prop: 'panelTab', name: this.$t('overall.dashboard') }, + { prop: 'dashboardTab', name: this.$t('overall.dashboard') }, { prop: 'alertMessageTab', name: this.$t('overall.alert') }, { prop: 'endpointTab', name: this.$t('asset.endpoint') }, { prop: 'log', name: this.$t('dashboard.panel.chartForm.typeVal.log.label') } @@ -202,14 +198,13 @@ export default { }, module: { moduleTabTitle: [ - // { prop: 'panel', name: 'Detail' }, { prop: 'endpoint', name: this.$t('asset.endpoint') }, { prop: 'moduleAlertMessage', name: this.$t('overall.alert') } ] }, endpoint: { endpointTabTitle: [ - { prop: 'panelTab', name: this.$t('overall.dashboard') }, + { prop: 'dashboardTab', name: this.$t('overall.dashboard') }, { prop: 'endpointAlertMessage', name: this.$t('overall.alert') }, { prop: 'Metrics', name: this.$t('overall.metric') }, { prop: 'log', name: this.$t('dashboard.panel.chartForm.typeVal.log.label') } @@ -217,12 +212,12 @@ export default { }, chartTemp: { chartTempTabTitle: [ - { prop: 'panel', name: this.$t('overall.tempPrev') } + { prop: 'dashboardTab', name: this.$t('overall.tempPrev') } ] }, dashboardTemp: { dashboardTempTabTitle: [ - { prop: 'panel', name: this.$t('overall.dashboardTemp') } + { prop: 'dashboardTab', name: this.$t('overall.dashboardTemp') } ] }, alertRule: { @@ -311,7 +306,7 @@ export default { const hasProcess = this.obj && this.obj.clientState == '1' const hasVays = this.obj && this.obj.model && this.obj.model.tsgAppliance == '1' const tabs = [ - { prop: 'panelTab', name: this.$t('overall.dashboard') }, + { prop: 'dashboardTab', name: this.$t('overall.dashboard') }, { prop: 'alertMessageTab', name: this.$t('overall.alert') }, { prop: 'endpointTab', name: this.$t('asset.endpoint') }, { prop: 'log', name: this.$t('dashboard.panel.chartForm.typeVal.log.label') } @@ -332,7 +327,7 @@ export default { const config = this.obj.configs.find(c => c.type === 'logs') const hasLog = config && config.enable === 1 const tabs = [ - { prop: 'panelTab', name: this.$t('overall.dashboard') }, + { prop: 'dashboardTab', name: this.$t('overall.dashboard') }, { prop: 'endpointAlertMessage', name: this.$t('overall.alert') }, { prop: 'Metrics', name: this.$t('overall.metric') } ] diff --git a/nezha-fronted/src/components/common/bottomBox/nzBottomDataList.vue b/nezha-fronted/src/components/common/bottomBox/nzBottomDataList.vue index 9382465b9..9ff6cff3b 100644 --- a/nezha-fronted/src/components/common/bottomBox/nzBottomDataList.vue +++ b/nezha-fronted/src/components/common/bottomBox/nzBottomDataList.vue @@ -99,8 +99,8 @@ export default { subContentClass () { const className = [] switch (this.targetTab) { - case 'panelTab': - className.push('nz-table-list bottom-panel') + case 'dashboardTab': + className.push('nz-table-list bottom-dashboard') break case 'log': { className.push('bottom-log') diff --git a/nezha-fronted/src/components/common/bottomBox/tabs/alertMessageTab.vue b/nezha-fronted/src/components/common/bottomBox/tabs/alertMessageTab.vue index 1d17afd0a..563e59fd4 100644 --- a/nezha-fronted/src/components/common/bottomBox/tabs/alertMessageTab.vue +++ b/nezha-fronted/src/components/common/bottomBox/tabs/alertMessageTab.vue @@ -11,10 +11,10 @@ -
{{$t("overall.detail")}}
{{$t("alert.alertMessage")}}
{{$t("asset.endpoint")}}
+
+
{{$t("overall.detail")}}
+
{{$t("alert.alertMessage")}}
+
{{$t("asset.endpoint")}}
{{$t("overall.query")}}
diff --git a/nezha-fronted/src/components/common/bottomBox/tabs/panelTabNew.vue b/nezha-fronted/src/components/common/bottomBox/tabs/dashboardTab.vue similarity index 93% rename from nezha-fronted/src/components/common/bottomBox/tabs/panelTabNew.vue rename to nezha-fronted/src/components/common/bottomBox/tabs/dashboardTab.vue index e5965c938..bad7cbf7e 100644 --- a/nezha-fronted/src/components/common/bottomBox/tabs/panelTabNew.vue +++ b/nezha-fronted/src/components/common/bottomBox/tabs/dashboardTab.vue @@ -1,5 +1,5 @@ @@ -52,7 +52,7 @@
- + @@ -67,8 +67,8 @@ :showLock="from === fromRoute.endpoint" class="top-tool-export margin-r-10" export-file-name="endpoint-charts" - export-url="/visual/panel/export" - import-url="/visual/panel/import" + export-url="/visual/dashboard/export" + import-url="/visual/dashboard/import" @afterImport="getTableData" :exportBoxShow="true" @export="exportType" @@ -81,7 +81,7 @@
{{ $t('overall.syncChart') }}
--> - +
{{ $t('overall.snapshoot') }}
@@ -117,7 +117,7 @@ { + this.$get('visual/dashboard?pageSize=-1').then(response => { if (response.code === 200) { this.panelData = response.data.list for (let i = 0; i < this.panelData.length; i++) { @@ -363,7 +363,7 @@ export default { addChart () { this.chart = this.newChart() this.chart.param.thresholds = [{ value: undefined, color: randomcolor() }] - this.chart.panelId = this.showPanel.id + this.chart.dashboardId = this.showPanel.id this.chart.panelName = this.showPanel.name this.$nextTick(() => { this.$refs.addChartModal.isStable = 'stable' @@ -371,7 +371,7 @@ export default { }, addChartByTemp () { this.chart = JSON.parse(JSON.stringify(this.blankChartTemp)) - this.chart.panelId = this.showPanel.id + this.chart.dashboardId = this.showPanel.id if (this.from === fromRoute.endpoint) { this.chart.varType = 2 } @@ -396,7 +396,7 @@ export default { if (refresh) { this.refresh() if (this.from === fromRoute.chartTemp) { - this.$get('/visual/panel/chart', { ids: this.obj.id }).then(res => { + this.$get('/visual/dashboard/chart', { ids: this.obj.id }).then(res => { res.data.list.forEach(item => { if (!item.children) { item.children = [] @@ -404,7 +404,7 @@ export default { }) this.panelDataList = res.data.list if (this.panelDataList.length > 0) { - this.showPanel.id = this.filter.panelId = 0 + this.showPanel.id = this.filter.dashboardId = 0 this.getData(this.filter) } else { this.chartListLoading = false @@ -422,7 +422,7 @@ export default { this.chart = JSON.parse(JSON.stringify(data)) this.chart.x = 0 this.chart.y = 0 - this.chart.panelId = this.showPanel.id + this.chart.dashboardId = this.showPanel.id this.chart.panelName = this.showPanel.name this.chart.id = '' this.chart.elements.forEach((item) => { @@ -438,12 +438,12 @@ export default { } } else { this.rightBox.loading = true - this.$get('visual/panel/chart/' + data.id).then(res => { + this.$get('visual/dashboard/chart/' + data.id).then(res => { this.rightBox.loading = false if (res.code === 200) { const chartData = res.data this.chart = JSON.parse(JSON.stringify(chartData)) - this.chart.panelId = this.showPanel.id + this.chart.dashboardId = this.showPanel.id this.chart.panelName = this.showPanel.name this.chart.param = JSON.parse(this.chart.param) if (!this.chart.groupId || this.chart.groupId == -1) { @@ -474,7 +474,7 @@ export default { cancelButtonText: this.$t('tip.no'), type: 'warning' }).then(() => { - this.$delete('visual/panel/chart?ids=' + data.id).then(response => { + this.$delete('visual/dashboard/chart?ids=' + data.id).then(response => { if (response.code === 200) { this.$message({ duration: 2000, @@ -494,7 +494,7 @@ export default { addGroupItem (groupId) { this.chart = this.newChart() this.chart.groupId = groupId - this.chart.panelId = this.showPanel.id + this.chart.dashboardId = this.showPanel.id this.chart.panelName = this.showPanel.name this.chart.isGroup = true this.rightBox.chart.show = true @@ -508,7 +508,7 @@ export default { }, // 获取数据,用在子页面 getData (params) { - if (!this.hasButton('panel_view')) { + if (!this.hasButton('dashboard_view')) { return } this.chartListLoading = true @@ -521,7 +521,7 @@ export default { params.from = this.from } if (this.from !== 'chartTemp') { - this.$get('visual/panel/chart?panelId=' + params.panelId + '&groupId=0' + '&pageSize=-1').then(response => { + this.$get('visual/dashboard/chart?dashboardId=' + params.dashboardId + '&groupId=0' + '&pageSize=-1').then(response => { if (response.code === 200) { this.chartListLoading = false this.dataList = response.data.list.map(item => { @@ -550,7 +550,7 @@ export default { this.setSearchTime(nowTimeType.type, nowTimeType.value) this.filter.start_time = bus.timeFormate(this.searchTime[0]) this.filter.end_time = bus.timeFormate(this.searchTime[1]) - this.filter.panelId = this.showPanel.id + this.filter.dashboardId = this.showPanel.id this.getData(this.filter) this.$store.dispatch('dispatchPanelTime', { time: this.searchTime, @@ -596,10 +596,10 @@ export default { if (this.from === this.fromRoute.chartTemp) { this.variablesInit = true if (this.obj.type === 'group') { - this.$get('/visual/panel/chart', { ids: this.obj.id }).then(res => { + this.$get('/visual/dashboard/chart', { ids: this.obj.id }).then(res => { this.panelDataList = res.data.list if (this.panelDataList.length > 0) { - this.showPanel.id = this.filter.panelId = 0 + this.showPanel.id = this.filter.dashboardId = 0 this.getData(this.filter) } }) @@ -607,15 +607,15 @@ export default { } this.panelDataList = [this.obj] if (this.panelDataList.length > 0) { - this.showPanel.id = this.filter.panelId = 0 + this.showPanel.id = this.filter.dashboardId = 0 this.getData(this.filter) } } else if (this.from === this.fromRoute.dashboardTemp) { - this.$get('visual/panel', { type: 'template', ids: this.obj.id }).then(response => { + this.$get('visual/dashboard', { type: 'template', ids: this.obj.id }).then(response => { if (response.code === 200) { this.panelData = response.data.list if (this.panelData.length > 0) { - this.filter.panelId = this.panelData[0].id + this.filter.dashboardId = this.panelData[0].id this.showPanel = this.$loadsh.cloneDeep(this.panelData[0]) this.variables = this.$loadsh.get(this.panelData, '[0].param.variables') this.getData(this.filter) @@ -628,12 +628,12 @@ export default { } }) } else { - this.$get('visual/panel', { type: this.from, link: linkId || this.obj.id }).then(response => { + this.$get('visual/dashboard', { type: this.from, link: linkId || this.obj.id }).then(response => { if (response.code === 200) { this.panelData = response.data.list if (this.panelData.length > 0) { - // this.showPanel.id = this.filter.panelId = this.panelData[0].id - this.filter.panelId = this.panelData[0].id + // this.showPanel.id = this.filter.dashboardId = this.panelData[0].id + this.filter.dashboardId = this.panelData[0].id this.showPanel = this.$loadsh.cloneDeep(this.panelData[0]) this.variables = this.$loadsh.get(this.panelData, '[0].param.variables') this.getData(this.filter) @@ -780,7 +780,7 @@ export default { this.$store.dispatch('dispatchHomeLoading', true) const params = {} params.tmplId = this.showPanel.id - this.$post('visual/panel/syncTmpl', params).then(res => { + this.$post('visual/dashboard/syncTmpl', params).then(res => { this.$store.dispatch('dispatchHomeLoading', false) if (res.code === 200) { this.getTableData(this.obj.id) @@ -918,7 +918,7 @@ export default { } } }, - // 监听图表联动配置panelId + // 监听图表联动配置 'showPanel.param.chartShare': { handler (value) { // 每次切换联动模式 tooltip设置显示 diff --git a/nezha-fronted/src/components/common/bottomBox/tabs/endpointQuery.vue b/nezha-fronted/src/components/common/bottomBox/tabs/endpointQuery.vue index fb8755c72..8cdec9f66 100644 --- a/nezha-fronted/src/components/common/bottomBox/tabs/endpointQuery.vue +++ b/nezha-fronted/src/components/common/bottomBox/tabs/endpointQuery.vue @@ -45,7 +45,7 @@ - +
{{$t("project.endpoint.dialogTitle")}}
@@ -216,7 +217,7 @@ export default { } }, createSuccess (type, response, param, panel) { - this.$confirm(this.$t('dashboard.metric.goPanelTip'), this.$t('tip.saveSuccess'), { + this.$confirm(this.$t('dashboard.metric.goDashboardTip'), this.$t('tip.saveSuccess'), { confirmButtonText: this.$t('tip.yes'), cancelButtonText: this.$t('tip.no'), type: 'success' @@ -225,7 +226,7 @@ export default { this.$store.state.showPanel.id = panel.id this.$store.state.showPanel.name = panel.name this.$router.push({ - path: '/panel', + path: '/dashboard', query: { t: +new Date() } diff --git a/nezha-fronted/src/components/common/bottomBox/tabs/endpointTab.vue b/nezha-fronted/src/components/common/bottomBox/tabs/endpointTab.vue deleted file mode 100644 index 7fcfb885b..000000000 --- a/nezha-fronted/src/components/common/bottomBox/tabs/endpointTab.vue +++ /dev/null @@ -1,563 +0,0 @@ - - - diff --git a/nezha-fronted/src/components/common/detailView/nzDetailView.vue b/nezha-fronted/src/components/common/detailView/nzDetailView.vue index c03739a04..cdebc3a1e 100644 --- a/nezha-fronted/src/components/common/detailView/nzDetailView.vue +++ b/nezha-fronted/src/components/common/detailView/nzDetailView.vue @@ -52,7 +52,7 @@ v-if="detailViewRightObj" :from="from" :obj="detailViewRightObj" - :target-tab="'panelTab'" + :target-tab="'dashboardTab'" />
diff --git a/nezha-fronted/src/components/common/detailView/view/detailViewRight.vue b/nezha-fronted/src/components/common/detailView/view/detailViewRight.vue index 5c343126b..8e5bfe4ce 100644 --- a/nezha-fronted/src/components/common/detailView/view/detailViewRight.vue +++ b/nezha-fronted/src/components/common/detailView/view/detailViewRight.vue @@ -6,8 +6,6 @@ - - @@ -21,7 +19,7 @@ - + @@ -33,14 +31,14 @@ - + - + - + @@ -59,9 +57,8 @@ import assetSubTab from '@/components/common/bottomBox/tabs/assetSubTab' import commentsBottomTab from '@/components/common/bottomBox/tabs/commentsBottomTab' import vsysBottomTab from '@/components/common/bottomBox/tabs/vsysBottomTab' import endpointQuery from '@/components/common/bottomBox/tabs/endpointQuery' -import endpointTab from '@/components/common/bottomBox/tabs/endpointTab' import endpointTabNew from '@/components/common/bottomBox/tabs/endpointTabNew' -import panelTabNew from '@/components/common/bottomBox/tabs/panelTabNew' +import dashboardTab from '@/components/common/bottomBox/tabs/dashboardTab' import terminalLogRecordTab from '@/components/common/bottomBox/tabs/terminalLogRecordTab' import terminalLogSftpTab from '@/components/common/bottomBox/tabs/terminalLogSftpTab' import terminalLogMonitorTab from '@/components/common/bottomBox/tabs/terminalLogMonitorTab' @@ -83,7 +80,6 @@ export default { LogBottomTab, cabinetTab, alertMessageTab, - endpointTab, terminalLogRecordTab, terminalLogSftpTab, terminalLogMonitorTab, @@ -93,7 +89,7 @@ export default { endpointTabNew, alertMessageTabNew, endpointQuery, - panelTabNew, + dashboardTab, assetTab, assetSubTab, 'detail-right-top': detailRightTop, @@ -159,7 +155,7 @@ export default { }, asset: { assetTabTitle: [ - { prop: 'panelTab', name: this.$t('overall.dashboard') }, + { prop: 'dashboardTab', name: this.$t('overall.dashboard') }, { prop: 'alertMessageTab', name: this.$t('overall.alert') }, { prop: 'endpointTab', name: this.$t('asset.endpoint') }, { prop: 'log', name: this.$t('dashboard.panel.chartForm.typeVal.log.label') } @@ -167,14 +163,13 @@ export default { }, module: { moduleTabTitle: [ - // { prop: 'panel', name: 'Detail' }, { prop: 'endpoint', name: this.$t('asset.endpoint') }, { prop: 'moduleAlertMessage', name: this.$t('overall.alert') } ] }, endpoint: { endpointTabTitle: [ - { prop: 'panelTab', name: this.$t('overall.detail') }, + { prop: 'dashboardTab', name: this.$t('overall.detail') }, { prop: 'endpointAlertMessage', name: this.$t('overall.alert') }, { prop: 'endpointQuery', name: this.$t('overall.metric') }, { prop: 'log', name: this.$t('dashboard.panel.chartForm.typeVal.log.label') } @@ -182,7 +177,7 @@ export default { }, chartTemp: { chartTempTabTitle: [ - { prop: 'panel', name: this.$t('overall.tempPrev') } + { prop: 'dashboardTab', name: this.$t('overall.tempPrev') } ] }, alertRule: { @@ -236,7 +231,7 @@ export default { const hasProcess = this.obj && this.obj.clientState == '1' const hasVays = this.obj && this.obj.model && this.obj.model.tsgAppliance == '1' const tabs = [ - { prop: 'panelTab', name: this.$t('overall.dashboard') }, + { prop: 'dashboardTab', name: this.$t('overall.dashboard') }, { prop: 'alertMessageTab', name: this.$t('overall.alert') }, { prop: 'endpointTab', name: this.$t('asset.endpoint') }, { prop: 'log', name: this.$t('dashboard.panel.chartForm.typeVal.log.label') } @@ -258,7 +253,7 @@ export default { const config = this.obj.configs.find(c => c.type === 'logs') const hasLog = config && config.enable === 1 const tabs = [ - { prop: 'panelTab', name: this.$t('overall.detail') }, + { prop: 'dashboardTab', name: this.$t('overall.detail') }, { prop: 'endpointAlertMessage', name: this.$t('overall.alert') }, { prop: 'endpointQuery', name: this.$t('overall.metrics') } ] @@ -310,9 +305,9 @@ export default { return } if (this.from === fromRoute.asset) { - this.targetTab = 'panelTab' + this.targetTab = 'dashboardTab' } else if (this.from === fromRoute.endpoint) { - this.targetTab = 'panelTab' + this.targetTab = 'dashboardTab' } else if (this.from === fromRoute.module) { this.targetTab = 'endpoint' } else if (this.from === fromRoute.alertRule) { diff --git a/nezha-fronted/src/components/common/exportXLSX.vue b/nezha-fronted/src/components/common/exportXLSX.vue deleted file mode 100644 index 43e99365f..000000000 --- a/nezha-fronted/src/components/common/exportXLSX.vue +++ /dev/null @@ -1,435 +0,0 @@ - - - - - - - diff --git a/nezha-fronted/src/components/common/js/constants.js b/nezha-fronted/src/components/common/js/constants.js index 078fd7656..8dbd2e396 100644 --- a/nezha-fronted/src/components/common/js/constants.js +++ b/nezha-fronted/src/components/common/js/constants.js @@ -406,7 +406,7 @@ export const theme = [ export const sameLabels = ['instance', 'module', 'project', 'asset', 'endpoint', 'datacenter', 'datacenter_id', 'endpoint_id', 'module_id', 'nz_agent_id', 'project_id'] // 公共组件的跳转来源 export const fromRoute = { - panel: 'panel', + dashboard: 'dashboard', explore: 'explore', alertMessage: 'alertMessage', alertRule: 'alertRule', diff --git a/nezha-fronted/src/components/common/js/tools.js b/nezha-fronted/src/components/common/js/tools.js index f25720320..e8f29fd82 100644 --- a/nezha-fronted/src/components/common/js/tools.js +++ b/nezha-fronted/src/components/common/js/tools.js @@ -600,7 +600,7 @@ export const chartResizeTool = { if (data.height != originalData.height || data.span != originalData.span) { originalData.height = data.height originalData.span = data.span - vm.$put('/visual/panel/chart/modify', originalData) + vm.$put('/visual/dashboard/chart/modify', originalData) } // 关闭背景阴影 shadow.classList.remove('resize-shadow-active') diff --git a/nezha-fronted/src/components/common/language/cn.js b/nezha-fronted/src/components/common/language/cn.js index 4bde619de..f84147b8d 100644 --- a/nezha-fronted/src/components/common/language/cn.js +++ b/nezha-fronted/src/components/common/language/cn.js @@ -284,7 +284,7 @@ const cn = { singleStatErrorTip: '仅支持返回单个系列/表的查询', panelForm: { panelName: '面板名称', - panelId: 'ID' + dashboardId: 'ID' }, createChartTitle: '新增图表', createChartTempTitle: '新增图表模板', diff --git a/nezha-fronted/src/components/common/language/en.js b/nezha-fronted/src/components/common/language/en.js index 5838b26bd..e3efee8de 100644 --- a/nezha-fronted/src/components/common/language/en.js +++ b/nezha-fronted/src/components/common/language/en.js @@ -293,7 +293,7 @@ const en = { singleStatErrorTip: 'Only queries that return single series/table is supported', panelForm: { panelName: 'Panel name', // "面板名称" - panelId: 'ID' // ID + dashboardId: 'ID' // ID }, // 图表-侧滑框 createChartTitle: 'New chart', // "新增图表" diff --git a/nezha-fronted/src/components/common/mixin/exportHtml.js b/nezha-fronted/src/components/common/mixin/exportHtml.js index 5d0726d56..18814c536 100644 --- a/nezha-fronted/src/components/common/mixin/exportHtml.js +++ b/nezha-fronted/src/components/common/mixin/exportHtml.js @@ -15,13 +15,13 @@ export default { }) const params = { format: 'html', - panelId: this.showPanel.id, + dashboardId: this.showPanel.id, start: this.$stringTimeParseToUnix(bus.formateTimeToTime(this.searchTime[0])), end: this.$stringTimeParseToUnix(bus.formateTimeToTime(this.searchTime[1])), vars: vars } this.$store.dispatch('dispatchHomeLoading', true) - this.$get('/visual/panel/snapshot', params, 'blob').then(res => { + this.$get('/visual/dashboard/snapshot', params, 'blob').then(res => { this.$store.dispatch('dispatchHomeLoading', false) const self = this let fileName = name diff --git a/nezha-fronted/src/components/common/mixin/routerPathParams.js b/nezha-fronted/src/components/common/mixin/routerPathParams.js index a66d33354..2ae81fc08 100644 --- a/nezha-fronted/src/components/common/mixin/routerPathParams.js +++ b/nezha-fronted/src/components/common/mixin/routerPathParams.js @@ -149,6 +149,7 @@ export default { } } else { delete params.selectObj + delete params.targetTab } this.$router.replace({ path: path, query: params }).catch(err => {}) } else if (from === 'nzDetailList' && this.detailViewRightObj) { diff --git a/nezha-fronted/src/components/common/popBox/guide.vue b/nezha-fronted/src/components/common/popBox/guide.vue index f395c52d7..fa306bb7b 100644 --- a/nezha-fronted/src/components/common/popBox/guide.vue +++ b/nezha-fronted/src/components/common/popBox/guide.vue @@ -50,7 +50,7 @@ @@ -107,11 +107,11 @@ export default { permissionCode: 'project_view' }, { - route: '/panel', + route: '/dashboard', title: this.$t('guide.visualization'), icon: 'nz-icon nz-icon-visualization', tip: this.$t('guide.visualizationTip'), - permissionCode: 'panel_view' + permissionCode: 'dashboard_view' }, { route: '/alertRule', @@ -288,16 +288,16 @@ export default { }) break } - case 'panel': { + case 'dashboard': { if (!this.hasButton('main_add')) { return } this.$emit('close') this.$router.push({ - path: '/panel', + path: '/dashboard', query: { t: +new Date(), - add: 'panel' + add: 'dashboard' } }) break @@ -308,7 +308,7 @@ export default { } this.$emit('close') this.$router.push({ - path: '/panel', + path: '/dashboard', query: { t: +new Date(), add: 'chart' diff --git a/nezha-fronted/src/components/common/popBox/selectDashboard.vue b/nezha-fronted/src/components/common/popBox/selectDashboard.vue index 1a01bacf1..889176391 100644 --- a/nezha-fronted/src/components/common/popBox/selectDashboard.vue +++ b/nezha-fronted/src/components/common/popBox/selectDashboard.vue @@ -263,7 +263,7 @@ export default { // 新增收藏 addStarred: bus.debounceFn(function (data) { const params = { - type: 'panel', + type: 'dashboard', tid: data.id } this.$post('/sys/user/starred', params).then(async response => { @@ -290,7 +290,7 @@ export default { 300, true), // 删除收藏 delStarred: bus.debounceFn(function (data) { - this.$delete('/sys/user/starred?type=panel&tid=' + data.id).then(async response => { + this.$delete('/sys/user/starred?type=dashboard&tid=' + data.id).then(async response => { if (response.code === 200) { data.starred = 0 // 更新panelData收藏状态 @@ -345,7 +345,7 @@ export default { } }) } - this.$put('visual/panel/tree', toUpdate) + this.$put('visual/dashboard/tree', toUpdate) }, deletePanel (data) { this.$emit('deletePanel', data) diff --git a/nezha-fronted/src/components/common/popBox/selectPanel.vue b/nezha-fronted/src/components/common/popBox/selectPanel.vue index b7bd2b309..6ddc2714d 100644 --- a/nezha-fronted/src/components/common/popBox/selectPanel.vue +++ b/nezha-fronted/src/components/common/popBox/selectPanel.vue @@ -132,7 +132,7 @@ export default { }) } - this.$put('visual/panel/tree', toUpdate) + this.$put('visual/dashboard/tree', toUpdate) }, deletePanel (data) { this.$emit('deletePanel', data) diff --git a/nezha-fronted/src/components/common/popBox/topToolMoreOptions.vue b/nezha-fronted/src/components/common/popBox/topToolMoreOptions.vue index a891804af..72773bc68 100644 --- a/nezha-fronted/src/components/common/popBox/topToolMoreOptions.vue +++ b/nezha-fronted/src/components/common/popBox/topToolMoreOptions.vue @@ -6,7 +6,7 @@ -
{{$t('dashboard.panel.editPanelTitle')}}
+
{{$t('dashboard.panel.editPanelTitle')}}
{{!panelLock ? $t("overall.locked") : $t("overall.unlocked")}}
@@ -279,7 +279,7 @@ export default { language () { return this.$store.getters.getLanguage }, // 判断是否是dashboard isDashboard () { - return this.importUrl === '/visual/panel/import' + return this.importUrl === '/visual/dashboard/import' }, // asset,endpoint dashboard导出选项不支持 all data assetOrEndpoint () { @@ -379,8 +379,8 @@ export default { url = '/monitor/module/cancelImport' } else if (this.importUrl.indexOf('rule') > -1) { url = '/alert/rule/cancelImport' - } else if (this.importUrl.indexOf('panel') > -1) { - url = 'visual/panel/cancelImport' + } else if (this.importUrl.indexOf('dashboard') > -1) { + url = 'visual/dashboard/cancelImport' } else if (this.importUrl.indexOf('tmpl') > -1) { url = '/expression/tmpl/cancelImport' } else if (this.importUrl.indexOf('dc/cabinet') > -1) { @@ -489,8 +489,8 @@ export default { } else if (this.importUrl.indexOf('asset') > -1) { url = '/asset/asset/template' param.type = 'asset' - } else if (this.importUrl.indexOf('panel') > -1) { - url = 'visual/panel/template' + } else if (this.importUrl.indexOf('dashboard') > -1) { + url = 'visual/dashboard/template' param.type = this.paramsType } else if (this.importUrl.indexOf('endpoint') > -1) { url = '/monitor/endpoint/template' @@ -536,7 +536,7 @@ export default { } }) } - if (this.exportUrl.indexOf('panel') > -1) { + if (this.exportUrl.indexOf('dashboard') > -1) { if (this.paramsType !== 'template') { params.pageSize = -1 } @@ -545,8 +545,8 @@ export default { delete params.id delete params.searchName delete params.value - params.ids = params.panelId - delete params.panelId + params.ids = params.dashboardId + delete params.dashboardId } params.language = localStorage.getItem('nz-language') || 'en' params.format = this.importBox.format @@ -570,13 +570,13 @@ export default { }) } params.pageSize = -1 - if (this.exportUrl.indexOf('panel') > -1) { + if (this.exportUrl.indexOf('dashboard') > -1) { delete params.start_time delete params.end_time delete params.id delete params.searchName delete params.value - delete params.panelId + delete params.dashboardId } // if (this.importUrl.indexOf('endpoint') > -1){ // delete params.moduleId @@ -603,13 +603,13 @@ export default { }) } params.pageSize = -1 - if (this.exportUrl.indexOf('panel') > -1) { + if (this.exportUrl.indexOf('dashboard') > -1) { delete params.start_time delete params.end_time delete params.id delete params.searchName delete params.value - delete params.panelId + delete params.dashboardId } // if (this.importUrl.indexOf('endpoint') > -1){ // delete params.moduleId @@ -744,7 +744,7 @@ export default { return year + split + month + split + day + ' ' + hours + split + minutes + split + seconds }, editPanel () { - this.$get('visual/panel/' + this.params.panelId).then(res => { + this.$get('visual/dashboard/' + this.params.dashboardId).then(res => { if (res.code === 200) { this.panel = res.data if (!this.$loadsh.get(this.panel, 'param.report', '')) { diff --git a/nezha-fronted/src/components/common/project/L5/topoTooltip.vue b/nezha-fronted/src/components/common/project/L5/topoTooltip.vue index ad04ab265..66382ef52 100644 --- a/nezha-fronted/src/components/common/project/L5/topoTooltip.vue +++ b/nezha-fronted/src/components/common/project/L5/topoTooltip.vue @@ -74,11 +74,11 @@ export default { data () { return { tempDom: { height: 250, width: '' }, - chartDataTemp: { id: 8832, prev: null, next: null, panelId: 0, title: '123', span: 12, height: 0, createAt: '2021-01-27 07:36:19', unit: 2, weight: 0, pid: null, buildIn: null, seq: null, param: { last: 0, legendValue: { total: 'off', min: 'off', avg: 'off', last: 'off', max: 'off' }, threshold: '', url: '', nullType: 'null' }, sync: null, asset: null, isLoaded: true, from: '__vue_devtool_undefined__', draggable: true, resizable: true, editable: true }, + chartDataTemp: { id: 8832, prev: null, next: null, dashboardId: 0, title: '123', span: 12, height: 0, createAt: '2021-01-27 07:36:19', unit: 2, weight: 0, pid: null, buildIn: null, seq: null, param: { last: 0, legendValue: { total: 'off', min: 'off', avg: 'off', last: 'off', max: 'off' }, threshold: '', url: '', nullType: 'null' }, sync: null, asset: null, isLoaded: true, from: '__vue_devtool_undefined__', draggable: true, resizable: true, editable: true }, chartData: {}, filter: { end_time: bus.timeFormate(bus.getOffsetTimezoneData(), 'YYYY-MM-DD HH:mm:ss'), - panelId: 0, + dashboardId: 0, searchName: '', start_time: bus.timeFormate(bus.getOffsetTimezoneData(-1), 'YYYY-MM-DD HH:mm:ss') } @@ -126,13 +126,13 @@ export default { if (len === 0) { this.$nextTick(() => { if (this.$refs['editChart' + chartItem.type]) { - this.$refs['editChart' + chartItem.type].setData(chartItem, [], this.filter.panelId, this.filter, []) + this.$refs['editChart' + chartItem.type].setData(chartItem, [], this.filter.dashboardId, this.filter, []) } }) } else { - const panelTime = localStorage.getItem('panelTime') ? JSON.parse(localStorage.getItem('panelTime')) : ['', ''] - const endTime = panelTime[1] || bus.timeFormate(bus.getOffsetTimezoneData(), 'YYYY-MM-DD HH:mm:ss') - const startTime = panelTime[0] || bus.timeFormate(bus.getOffsetTimezoneData(-1), 'YYYY-MM-DD HH:mm:ss') + const dashboardTime = localStorage.getItem('dashboardTime') ? JSON.parse(localStorage.getItem('dashboardTime')) : ['', ''] + const endTime = dashboardTime[1] || bus.timeFormate(bus.getOffsetTimezoneData(), 'YYYY-MM-DD HH:mm:ss') + const startTime = dashboardTime[0] || bus.timeFormate(bus.getOffsetTimezoneData(-1), 'YYYY-MM-DD HH:mm:ss') const step = bus.getStep(startTime, endTime) this.$nextTick(() => { const axiosArr = chartItem.elements.map((ele) => { @@ -368,7 +368,7 @@ export default { singleStatRlt: singleStatRlt, legend: legend, tableData: tableData, - panelId: this.filter.panelId, + dashboardId: this.filter.dashboardId, filter: this.filter, filterType: filterType, errorMsg: errorMsg @@ -376,10 +376,10 @@ export default { if (chartItem.type === 'table') { // 表格 if (filterType === 'showFullScreen') { // 全屏查询 this.$refs['editChart' + chartItem.type].setData(chartItem, tableData, - this.filter.panelId, this.filter, filterType, errorMsg) + this.filter.dashboardId, this.filter, filterType, errorMsg) } else { this.$refs['editChart' + chartItem.type].setData(chartItem, tableData, - this.filter.panelId, this.filter, '', errorMsg) + this.filter.dashboardId, this.filter, '', errorMsg) } } else if (chartItem.type === 'line' || chartItem.type === 'bar' || chartItem.type === 'stackArea' || chartItem.type === 4 || chartItem.type == 'pie') { if (series.length && chartItem.type === 4) { // 曲线汇总 @@ -387,18 +387,18 @@ export default { } if (filterType === 'showFullScreen') { // 全屏查询 this.$refs['editChart' + chartItem.type].setData(chartItem, series, - this.filter.panelId, this.filter, legend, filterType, errorMsg) + this.filter.dashboardId, this.filter, legend, filterType, errorMsg) } else { this.$refs['editChart' + chartItem.type].setData(chartItem, series, - this.filter.panelId, this.filter, legend, '', errorMsg) + this.filter.dashboardId, this.filter, legend, '', errorMsg) } } else if (chartItem.type === 'singleStat') { if (filterType === 'showFullScreen') { // 全屏查询 this.$refs['editChart' + chartItem.type].setData(chartItem, singleStatRlt, - this.filter.panelId, this.filter, filterType, errorMsg) + this.filter.dashboardId, this.filter, filterType, errorMsg) } else { this.$refs['editChart' + chartItem.type].setData(chartItem, singleStatRlt, - this.filter.panelId, this.filter, '', errorMsg) + this.filter.dashboardId, this.filter, '', errorMsg) } } } @@ -407,27 +407,27 @@ export default { if (this.$refs['editChart' + chartItem.type]) { if (type === 'table') { if (filterType === 'showFullScreen') { // table的全屏查询 - this.$refs['editChart' + chartItem.type].setData(chartItem, [], this.filter.panelId, + this.$refs['editChart' + chartItem.type].setData(chartItem, [], this.filter.dashboardId, this.filter, filterType) } else { - this.$refs['editChart' + chartItem.type].setData(chartItem, [], this.filter.panelId, + this.$refs['editChart' + chartItem.type].setData(chartItem, [], this.filter.dashboardId, this.filter) } } else if (type === 'line' || type === 'bar' || type === 'stackArea' || chartItem.type === 4 || chartItem.type === 'pie') { if (filterType === 'showFullScreen') { // table的全屏查询 - this.$refs['editChart' + chartItem.type].setData(chartItem, [], this.filter.panelId, + this.$refs['editChart' + chartItem.type].setData(chartItem, [], this.filter.dashboardId, this.filter, filterType) } else { - this.$refs['editChart' + chartItem.type].setData(chartItem, [], this.filter.panelId, + this.$refs['editChart' + chartItem.type].setData(chartItem, [], this.filter.dashboardId, this.filter) } } else if (chartItem.type === 'singleStat') { if (filterType === 'showFullScreen') { // 全屏查询 this.$refs['editChart' + chartItem.type].setData(chartItem, '', - this.filter.panelId, this.filter, filterType) + this.filter.dashboardId, this.filter, filterType) } else { this.$refs['editChart' + chartItem.type].setData(chartItem, '', - this.filter.panelId, this.filter) + this.filter.dashboardId, this.filter) } } } diff --git a/nezha-fronted/src/components/common/rightBox/administration/modelBox.vue b/nezha-fronted/src/components/common/rightBox/administration/modelBox.vue index f07ee60cf..3ac27ebf6 100644 --- a/nezha-fronted/src/components/common/rightBox/administration/modelBox.vue +++ b/nezha-fronted/src/components/common/rightBox/administration/modelBox.vue @@ -31,7 +31,7 @@ :data="chartlList" :tb-columns="ChartSearchShowFields" :params="{ - varType: 1, panelId: 0, + varType: 1, dashboardId: 0, returnChildren:0,groupId:0, }" :multiple="true" @@ -47,7 +47,7 @@ > --> - + @@ -159,7 +159,7 @@ export default { handler (n) { this.isEdit = true this.editModel = JSON.parse(JSON.stringify(n)) - this.editModel.panelId = n.panelId ? n.panelId + '' : '' + this.editModel.dashboardId = n.dashboardId ? n.dashboardId + '' : '' } } }, @@ -183,7 +183,7 @@ export default { if (valid) { const params = { ...this.editModel, - panelId: this.editModel.panelId == '' ? null : Number(this.editModel.panelId) + dashboardId: this.editModel.dashboardId == '' ? null : Number(this.editModel.dashboardId) } if (this.editModel.id) { this.$put(this.url, params).then(res => { @@ -258,13 +258,13 @@ export default { }, // /* 获取chart列表数据 */ // ChartTemplateList () { - // this.$get('visual/panel/chart', { pageSize: -1, varType: 1, panelId: 0, groupId: 0, returnChildren: 0 }).then(res => { + // this.$get('visual/dashboard/chart', { pageSize: -1, varType: 1, dashboardId: 0, groupId: 0, returnChildren: 0 }).then(res => { // this.chartlList = res.data.list // }) // }, /* 获取Dashboard列表数据 */ DashboardTemplateList () { - this.$get('visual/panel', { pageSize: -1, varType: 1, type: 'template' }).then(res => { + this.$get('visual/dashboard', { pageSize: -1, varType: 1, type: 'template' }).then(res => { this.dashboardList = res.data.list }) }, diff --git a/nezha-fronted/src/components/common/rightBox/batchAddEndpoint.vue b/nezha-fronted/src/components/common/rightBox/batchAddEndpoint.vue index 48ee7ccaa..c3196688d 100644 --- a/nezha-fronted/src/components/common/rightBox/batchAddEndpoint.vue +++ b/nezha-fronted/src/components/common/rightBox/batchAddEndpoint.vue @@ -18,7 +18,7 @@ :data="moduleList" :tb-columns="ChartSearchShowFields" :params="{ - varType: 2, panelId: 0, + varType: 2, dashboardId: 0, returnChildren:0,groupId:0, }" :multiple="true" @@ -37,7 +37,7 @@ :data="assetDataList" :tb-columns="columns" :params="{ - varType: 2, panelId: 0, + varType: 2, dashboardId: 0, returnChildren:0,groupId:0, }" :multiple="true" diff --git a/nezha-fronted/src/components/common/rightBox/chart/chartRightBox.vue b/nezha-fronted/src/components/common/rightBox/chart/chartRightBox.vue index 40995d17b..14abf4637 100644 --- a/nezha-fronted/src/components/common/rightBox/chart/chartRightBox.vue +++ b/nezha-fronted/src/components/common/rightBox/chart/chartRightBox.vue @@ -234,7 +234,7 @@ export default { const arr = [this.$refs.chartForm.validate()] arr.push(this.$refs['childrenFrom' + this.editChart.datasource].$refs.chartForm.validate()) Promise.all(arr).then(res => { - this.editChart.panelId = this.panelId + this.editChart.dashboardId = this.dashboardId const params = JSON.parse(JSON.stringify(this.editChart)) if (params.param.valueMapping) { params.param.valueMapping.forEach(item => { @@ -284,19 +284,19 @@ export default { params.param.datasource[0].filter = params.param.datasource[0].filter.filter(item => item.value) } if (params.id) { // 修改 - this.$put('visual/panel/chart', params).then(response => { + this.$put('visual/dashboard/chart', params).then(response => { if (response.code === 200) { this.$message({ duration: 1000, type: 'success', message: this.$t('tip.saveSuccess') }) if (resetFlag) { bus.$emit('creat-chart-success', { ...params, cb: function () { - self.$emit('on-create-success', { id: this.panelId, name: this.panelName }) + self.$emit('on-create-success', { id: this.dashboardId, name: this.panelName }) self.esc(true) } }) } else { - self.$emit('on-create-success', { id: this.panelId, name: this.panelName }) + self.$emit('on-create-success', { id: this.dashboardId, name: this.panelName }) self.esc(true) } } else { @@ -304,19 +304,19 @@ export default { } }) } else { // 新增 - this.$post('visual/panel/chart', params).then(response => { + this.$post('visual/dashboard/chart', params).then(response => { if (response.code === 200) { this.$message({ duration: 1000, type: 'success', message: this.$t('tip.saveSuccess') }) if (resetFlag) { bus.$emit('creat-chart-success', { ...params, cb: function () { - self.$emit('on-create-success', { id: this.panelId, name: this.panelName }) + self.$emit('on-create-success', { id: this.dashboardId, name: this.panelName }) self.esc(true) } }) } else { - self.$emit('on-create-success', { id: this.panelId, name: this.panelName }) + self.$emit('on-create-success', { id: this.dashboardId, name: this.panelName }) self.esc(true) } } else { @@ -332,9 +332,9 @@ export default { selectPanel (panel) { this.panelName = panel.name this.editChart.panelName = panel.name - this.panelId = panel.id + this.dashboardId = panel.id this.editChart.groupId = '' - this.$get('visual/panel/chart?panelId=' + this.panelId + '&pageSize=-1').then(response => { + this.$get('visual/dashboard/chart?dashboardId=' + this.dashboardId + '&pageSize=-1').then(response => { if (response.code === 200) { this.groupArr = [] response.data.list.forEach((item, index) => { @@ -352,7 +352,7 @@ export default { this.$emit('reloadOnlyPanel') }, getGroupList () { - this.$get('visual/panel/chart?panelId=' + this.panelId + '&pageSize=-1').then(response => { + this.$get('visual/dashboard/chart?dashboardId=' + this.dashboardId + '&pageSize=-1').then(response => { if (response.code === 200) { this.groupArr = [] response.data.list.forEach((item, index) => { @@ -525,7 +525,7 @@ export default { deep: true, handler () { if (this.showPanel && (this.showPanel.id || this.from === 'chartTemp')) { - this.panelId = this.showPanel.id + this.dashboardId = this.showPanel.id this.panelName = this.showPanel.name this.editChart.panelName = this.showPanel.name } diff --git a/nezha-fronted/src/components/common/rightBox/chartTempBox.vue b/nezha-fronted/src/components/common/rightBox/chartTempBox.vue index a08675372..d265c33fb 100644 --- a/nezha-fronted/src/components/common/rightBox/chartTempBox.vue +++ b/nezha-fronted/src/components/common/rightBox/chartTempBox.vue @@ -43,7 +43,7 @@ :data="chartTempArr" :tb-columns="ChartSearchShowFields" :params="{ - varType: 2, panelId: 0, + varType: 2, dashboardId: 0, returnChildren:0,groupId:0, }" :multiple="false" @@ -111,7 +111,7 @@ export default { return { fromRoute, editChartTemp: {}, - url: 'visual/panel/chart/fromTmpl', + url: 'visual/dashboard/chart/fromTmpl', rules: { // 表单校验规则 varType: [ { required: true, message: this.$t('validate.required'), trigger: 'blur' } @@ -330,7 +330,7 @@ export default { // dc, brand, model, type }, getChartTempData () { - this.$get('visual/panel/chart', { pageSize: -1, panelId: 0, returnChildren: 0, varType: this.editChartTemp.varType, groupId: 0 }).then(response => { + this.$get('visual/dashboard/chart', { pageSize: -1, dashboardId: 0, returnChildren: 0, varType: this.editChartTemp.varType, groupId: 0 }).then(response => { if (response.code === 200) { this.chartTempArr = response.data.list } diff --git a/nezha-fronted/src/components/common/rightBox/dashboardTempBox.vue b/nezha-fronted/src/components/common/rightBox/dashboardTempBox.vue index b0d0b3be8..85bca5128 100644 --- a/nezha-fronted/src/components/common/rightBox/dashboardTempBox.vue +++ b/nezha-fronted/src/components/common/rightBox/dashboardTempBox.vue @@ -79,7 +79,7 @@ export default { mixins: [editRigthBox], data () { return { - url: '/visual/panel/fromTmpl', + url: '/visual/dashboard/fromTmpl', rules: { name: [ { required: true, message: this.$t('validate.required'), trigger: 'blur' } @@ -224,7 +224,7 @@ export default { }, 50), // 获取dashboard模板列表 getDashboardTempData () { - this.$get('visual/panel', { type: 'template', pageSize: -1 }).then(response => { + this.$get('visual/dashboard', { type: 'template', pageSize: -1 }).then(response => { if (response.code === 200) { this.templateList = response.data.list } diff --git a/nezha-fronted/src/components/common/rightBox/editEndpointBoxNew.vue b/nezha-fronted/src/components/common/rightBox/editEndpointBoxNew.vue index 92cd1e3e4..51be5e8d9 100644 --- a/nezha-fronted/src/components/common/rightBox/editEndpointBoxNew.vue +++ b/nezha-fronted/src/components/common/rightBox/editEndpointBoxNew.vue @@ -47,7 +47,7 @@ :data="assetList" :tb-columns="columns" :params="{ - varType: 2, panelId: 0, + varType: 2, dashboardId: 0, returnChildren:0,groupId:0, }" @values="renderEndpoint" @@ -89,7 +89,7 @@ - + @@ -1471,7 +1471,7 @@ export default { }, /* 获取chart列表数据 */ ChartTemplateList () { - this.$get('visual/panel/chart', { pageSize: -1, varType: 2, panelId: 0, returnChildren: 0, groupId: 0 }).then(res => { + this.$get('visual/dashboard/chart', { pageSize: -1, varType: 2, dashboardId: 0, returnChildren: 0, groupId: 0 }).then(res => { this.chartTempList = res.data.list }) }, diff --git a/nezha-fronted/src/components/common/rightBox/issueBox.vue b/nezha-fronted/src/components/common/rightBox/issueBox.vue index 1ce64b4ff..5ef033273 100644 --- a/nezha-fronted/src/components/common/rightBox/issueBox.vue +++ b/nezha-fronted/src/components/common/rightBox/issueBox.vue @@ -66,7 +66,7 @@ :data="assetList" :tb-columns="columns" :params="{ - varType: 1, panelId: 0, + varType: 1, dashboardId: 0, returnChildren:0,groupId:0, }" :multiple="true" @@ -278,7 +278,7 @@ export default { methods: { /* 获取asset列表数据 */ assetTemplateList () { - this.$get('asset/asset', { pageSize: -1, varType: 1, panelId: 0, groupId: 0 }).then(res => { + this.$get('asset/asset', { pageSize: -1, varType: 1, dashboardId: 0, groupId: 0 }).then(res => { this.assetList = res.data.list }) }, diff --git a/nezha-fronted/src/components/common/rightBox/moduleBox.vue b/nezha-fronted/src/components/common/rightBox/moduleBox.vue index cb2bf8c3a..ea36048d3 100644 --- a/nezha-fronted/src/components/common/rightBox/moduleBox.vue +++ b/nezha-fronted/src/components/common/rightBox/moduleBox.vue @@ -61,7 +61,7 @@ > - + @@ -1109,7 +1109,7 @@ export default { } if (valid) { this.prevent_opt.save = true - params.panelId = this.editModule.panelId !== '' ? Number(this.editModule.panelId) : null + params.dashboardId = this.editModule.dashboardId !== '' ? Number(this.editModule.dashboardId) : null if (this.editModule.id) { this.$put('monitor/module', params).then(response => { if (response.code === 200) { @@ -1502,7 +1502,7 @@ export default { }, /* 获取Dashboard列表数据 */ DashboardTemplateList () { - this.$get('visual/panel', { pageSize: -1, varType: 2, type: 'template' }).then(res => { + this.$get('visual/dashboard', { pageSize: -1, varType: 2, type: 'template' }).then(res => { this.dashboardList = res.data.list }) }, @@ -1579,7 +1579,7 @@ export default { handler (n, o) { this.isEdit = true this.editModule = JSON.parse(JSON.stringify(n)) - this.editModule.panelId = n.panelId ? n.panelId + '' : '' + this.editModule.dashboardId = n.dashboardId ? n.dashboardId + '' : '' this.activeName = 'Basic' this.activeNameLogs = this.editModule.configs[1].config.map(() => 'Basic') this.logsCopyValue = this.editModule.configs[1].config.map(() => '') diff --git a/nezha-fronted/src/components/common/rightBox/panelBox.vue b/nezha-fronted/src/components/common/rightBox/panelBox.vue index fdc5d08cf..f09a6edf9 100644 --- a/nezha-fronted/src/components/common/rightBox/panelBox.vue +++ b/nezha-fronted/src/components/common/rightBox/panelBox.vue @@ -381,7 +381,7 @@ export default { mixins: [editRigthBox], data () { return { - url: 'visual/panel', + url: 'visual/dashboard', editPanel: {}, isShow: 0, userData: [], diff --git a/nezha-fronted/src/components/common/snapshotProgress/snapshotProgress.vue b/nezha-fronted/src/components/common/snapshotProgress/snapshotProgress.vue index 20565e158..0319e6d45 100644 --- a/nezha-fronted/src/components/common/snapshotProgress/snapshotProgress.vue +++ b/nezha-fronted/src/components/common/snapshotProgress/snapshotProgress.vue @@ -106,13 +106,13 @@ export default { }) const params = { format: 'html', - panelId: this.showPanel.id, + dashboardId: this.showPanel.id, start: this.$stringTimeParseToUnix(bus.formateTimeToTime(this.searchTime[0])), end: this.$stringTimeParseToUnix(bus.formateTimeToTime(this.searchTime[1])), vars: vars } // 创建任务 - const res = await this.$post('/visual/panel/snapshot/task', params) + const res = await this.$post('/visual/dashboard/snapshot/task', params) if (res.code === 200) { this.tid = res.data.tid this.getResult() @@ -123,7 +123,7 @@ export default { this.task = setInterval(async () => { if (this.process < 100) { try { - const res = await this.$get('/visual/panel/snapshot/result/' + this.tid) + const res = await this.$get('/visual/dashboard/snapshot/result/' + this.tid) this.total = res.data.taskId.total this.done = res.data.taskId.done this.process = parseFloat(res.data.taskId.process) @@ -137,7 +137,7 @@ export default { }, // 导出快照 downloadSnapshot () { - this.$get('/visual/panel/snapshot/download/' + this.tid, {}, 'blob').then(res => { + this.$get('/visual/dashboard/snapshot/download/' + this.tid, {}, 'blob').then(res => { const self = this const fileName = this.showPanel.name if (res.type == 'application/json') { @@ -204,7 +204,7 @@ export default { beforeDestroy () { this.clearTimer() if (this.tid) { - this.$get('/visual/panel/snapshot/cancel/' + this.tid) + this.$get('/visual/dashboard/snapshot/cancel/' + this.tid) } } } diff --git a/nezha-fronted/src/components/common/table/asset/assetTable.vue b/nezha-fronted/src/components/common/table/asset/assetTable.vue index 7a0dfab86..d5f21b468 100644 --- a/nezha-fronted/src/components/common/table/asset/assetTable.vue +++ b/nezha-fronted/src/components/common/table/asset/assetTable.vue @@ -12,7 +12,7 @@ @header-dragend="dragend" @sort-change="tableDataSort" @selection-change="selectionChange" - @row-dblclick="(row)=>{$emit('showBottomBox', 'panelTab', row)}" + @row-dblclick="(row)=>{$emit('showBottomBox', 'dashboardTab', row)}" > {{$t('overall.option')}}
- +
diff --git a/nezha-fronted/src/components/common/table/settings/chartTmplTable.vue b/nezha-fronted/src/components/common/table/settings/chartTmplTable.vue index 07c5a89b6..ed78f3b20 100644 --- a/nezha-fronted/src/components/common/table/settings/chartTmplTable.vue +++ b/nezha-fronted/src/components/common/table/settings/chartTmplTable.vue @@ -9,7 +9,7 @@ @header-dragend="dragend" @sort-change="tableDataSort" @selection-change="selectionChange" - @row-dblclick="(row)=>{showBottomBox('panel', row)}" + @row-dblclick="(row)=>{showBottomBox('dashboardTab', row)}" >
{{$t('overall.option')}}
- +
diff --git a/nezha-fronted/src/components/common/table/settings/dashboardTmplTable.vue b/nezha-fronted/src/components/common/table/settings/dashboardTmplTable.vue index 774c0e259..ebee5d996 100644 --- a/nezha-fronted/src/components/common/table/settings/dashboardTmplTable.vue +++ b/nezha-fronted/src/components/common/table/settings/dashboardTmplTable.vue @@ -9,7 +9,7 @@ @header-dragend="dragend" @sort-change="tableDataSort" @selection-change="selectionChange" - @row-dblclick="(row)=>{showBottomBox('panel', row)}" + @row-dblclick="(row)=>{showBottomBox('dashboardTab', row)}" >
{{$t('overall.option')}}
- +
diff --git a/nezha-fronted/src/components/common/table/settings/endpointTable.vue b/nezha-fronted/src/components/common/table/settings/endpointTable.vue index a9b5fc68f..17d995882 100644 --- a/nezha-fronted/src/components/common/table/settings/endpointTable.vue +++ b/nezha-fronted/src/components/common/table/settings/endpointTable.vue @@ -11,7 +11,7 @@ @cell-mouse-enter="cellMouseEnter" @sort-change="tableDataSort" @selection-change="selectionChange" - @row-dblclick="(row)=>{$emit('showBottomBox', 'panelTab', row)}" + @row-dblclick="(row)=>{$emit('showBottomBox', 'dashboardTab', row)}" > {{$t('overall.option')}}
- +
diff --git a/nezha-fronted/src/components/common/table/settings/modelTable.vue b/nezha-fronted/src/components/common/table/settings/modelTable.vue index 02e744e1e..1a29e7c5b 100644 --- a/nezha-fronted/src/components/common/table/settings/modelTable.vue +++ b/nezha-fronted/src/components/common/table/settings/modelTable.vue @@ -64,8 +64,8 @@ -