diff --git a/nezha-fronted/src/assets/css/components/common/rightBox/chartRightBox/chartRightBox.scss b/nezha-fronted/src/assets/css/components/common/rightBox/chartRightBox/chartRightBox.scss index 977bb863a..015663356 100644 --- a/nezha-fronted/src/assets/css/components/common/rightBox/chartRightBox/chartRightBox.scss +++ b/nezha-fronted/src/assets/css/components/common/rightBox/chartRightBox/chartRightBox.scss @@ -113,5 +113,32 @@ padding: 1px 3px; } } + .system-chart-config { + display: flex; + height: 150px; + align-items: center; + margin-bottom: 10px; + } + .system-chart-config-left{ + width: 40%; + height: 100%; + overflow-y: auto; + .system-chart-item { + font-size: 14px; + padding: 3px 5px; + } + .system-chart-item:hover{ + color: $--color-primary; + background: $--background-color-base !important; + } + .system-chart-item.is-select{ + color: $--color-text-secondary; + } + } + .system-chart-config-right{ + flex: 1; + margin-left: 10px; + height: 100%; + } } } diff --git a/nezha-fronted/src/components/common/rightBox/chart/chartRightBox.vue b/nezha-fronted/src/components/common/rightBox/chart/chartRightBox.vue index c37bf16e9..1d206fa5c 100644 --- a/nezha-fronted/src/components/common/rightBox/chart/chartRightBox.vue +++ b/nezha-fronted/src/components/common/rightBox/chart/chartRightBox.vue @@ -67,7 +67,7 @@ - + @@ -261,6 +261,24 @@ export default { } } } + if (this.editChart.datasource == 3) { + this.editChart = { + ...this.editChart, + span: 4, + height: 4, + unit: 2, + type: 'stat', + param: { + refer: 1, + system: '', + systemGroup: '', + systemSelect: '', + sort: 'desc', + limit: 100 + } + } + delete this.editChart.elements + } if (this.editChart.datasource == 4) { this.editChart = { ...this.editChart, @@ -271,6 +289,7 @@ export default { url: '' } } + delete this.editChart.elements } }, editChartChange (newEditChart) { diff --git a/nezha-fronted/src/components/common/rightBox/chart/otherChartConfig.vue b/nezha-fronted/src/components/common/rightBox/chart/otherChartConfig.vue index 105b849b1..4ff8594c7 100644 --- a/nezha-fronted/src/components/common/rightBox/chart/otherChartConfig.vue +++ b/nezha-fronted/src/components/common/rightBox/chart/otherChartConfig.vue @@ -46,7 +46,7 @@ size="small"/> - + - - content - - - {{$t('dashboard.panel.chartForm.displayConfig')}} - - - - - - - {{item.name}} - - - - - - - - - - - - - - - - - - - span-{{item}} - - - + + + + + + {{item.name}} + + + + + + - - - - + + + + + + + + + + + + + + + + + + + + + + + {{$t('dashboard.panel.chartForm.displayConfig')}} + + + + - + + {{item.name}} + + + + + + - span-{{item}} - - - - - + + + + + + + + + + + + + span-{{item}} + + + + + + + + + + span-{{item}} + + + + + + diff --git a/nezha-fronted/src/components/common/rightBox/chart/systemConfigJson.js b/nezha-fronted/src/components/common/rightBox/chart/systemConfigJson.js index dadbbc8b6..b699b61d5 100644 --- a/nezha-fronted/src/components/common/rightBox/chart/systemConfigJson.js +++ b/nezha-fronted/src/components/common/rightBox/chart/systemConfigJson.js @@ -1,47 +1,48 @@ const data = [{ name: 'asset', datasql: 'SELECT t.*,atc.vm,atc.vmh,atc.NAME as type,assc.NAME as state,ab.NAME as brand,am.NAME as model,dc.NAME as datacenterName,cabinet.NAME as cabinet,ap.`status` as ping FROM asset_asset t LEFT JOIN asset_type_conf atc ON t.type_id = atc.id LEFT JOIN asset_state_conf assc ON t.state_id = assc.id LEFT JOIN asset_brand ab ON t.brand_id = ab.id LEFT JOIN asset_model am ON t.model_id = am.id LEFT JOIN dc ON t.dc_id = dc.id LEFT JOIN cabinet ON t.cabinet_id = cabinet.id LEFT JOIN asset_ping ap ON t.id = ap.asset_id', - group: [{ - name: 'datacenter', - expr: 'datacenterName', - type: 2 - }, { - name: 'name', - expr: 'name', - type: 2 - }, { - name: 'vm', - expr: 'vm', - type: 2 - }, { - name: 'vmh', - expr: 'vmh', - type: 2 - }, { - name: 'type', - expr: 'type', - type: 2 - }, { - name: 'state', - expr: 'state', - type: 2 - }, { - name: 'brand', - expr: 'brand', - type: 2 - }, { - name: 'model', - expr: 'model', - type: 2 - }, { - name: 'cabinet', - expr: 'cabinet', - type: 2 - }, { - name: 'status', - expr: 'ping', - type: 2 - } + group: [ + { + name: 'datacenter', + expr: 'datacenterName', + type: 2 + }, { + name: 'name', + expr: 'name', + type: 2 + }, { + name: 'vm', + expr: 'vm', + type: 2 + }, { + name: 'vmh', + expr: 'vmh', + type: 2 + }, { + name: 'type', + expr: 'type', + type: 2 + }, { + name: 'state', + expr: 'state', + type: 2 + }, { + name: 'brand', + expr: 'brand', + type: 2 + }, { + name: 'model', + expr: 'model', + type: 2 + }, { + name: 'cabinet', + expr: 'cabinet', + type: 2 + }, { + name: 'status', + expr: 'ping', + type: 2 + } ], select: [{ name: 'count',