diff --git a/nezha-fronted/src/components/charts/chart-detail.vue b/nezha-fronted/src/components/charts/chart-detail.vue index 3bbd0a336..5f6c24922 100644 --- a/nezha-fronted/src/components/charts/chart-detail.vue +++ b/nezha-fronted/src/components/charts/chart-detail.vue @@ -163,7 +163,7 @@
{{endpointKey[key]}}
- +
@@ -245,6 +286,7 @@ detail: [], //展示的详情 unit: {}, show: [0], //控制展开/隐藏 + deepShow: [], //控制二级/三级的展开/隐藏 isError:false, errorContent:'', loading:Object, @@ -362,6 +404,13 @@ this.show.push(index); } }, + showDeep(index) { + if (this.deepShow.indexOf(index) > -1) { + this.deepShow.splice(this.deepShow.indexOf(index), 1); + } else { + this.deepShow.push(index); + } + }, startLoading(area){ this.$refs['localLoading'+this.chartIndex].startLoading(); }, diff --git a/nezha-fronted/src/components/charts/chart-list.vue b/nezha-fronted/src/components/charts/chart-list.vue index d1724ed7a..1226a15f8 100644 --- a/nezha-fronted/src/components/charts/chart-list.vue +++ b/nezha-fronted/src/components/charts/chart-list.vue @@ -1445,6 +1445,20 @@ let data = {}; d.forEach(item => { data[item.name] = item.nums; + !data._module_ ? (data._module_ = {}) : ""; + if (item.module && item.module instanceof Array && item.module.length > 0) { + data._module_[item.name] = {};; + item.module.forEach(m => { + data._module_[item.name][m.name] = m.nums; + !data._module_[item.name]._endpoint_ ? (data._module_[item.name]._endpoint_ = {}) : ""; + if (m.endpoint && m.endpoint instanceof Array && m.endpoint.length > 0) { + data._module_[item.name]._endpoint_[m.name] = {}; + m.endpoint.forEach(e => { + data._module_[item.name]._endpoint_[m.name][e.name] = e.nums; + }) + } + }) + } }); return data; } diff --git a/nezha-fronted/src/components/charts/chart.scss b/nezha-fronted/src/components/charts/chart.scss index b8f9eb8b0..fa1074e3e 100644 --- a/nezha-fronted/src/components/charts/chart.scss +++ b/nezha-fronted/src/components/charts/chart.scss @@ -293,7 +293,7 @@ .chart-info { padding-top: 6px; width: 100%; - height: calc(100% - 10px); + height: calc(100% - 34px); } .active-icon { margin: 0; @@ -314,22 +314,23 @@ line-height: 25px; user-select: none; } - .chart-sub-content { + .chart-sub-content, .chart-third-content, .chart-forth-content { width: 100%; box-sizing: border-box; - .content-item>div { + >.content-item>.item-tip { display: inline-block; box-sizing: border-box; } - .content-item>div:not(.content-item-value-muti) { + >.content-item>.item-tip:not(.content-item-value-muti) { padding: 0 3px 0 13px; } - .content-item { + >.content-item { font-size: 13px; line-height: 26px; - border-bottom: 1px solid rgb(235, 238, 245); + border-top: 1px solid rgb(235, 238, 245); display: flex; position: relative; + flex-wrap: wrap; .item-tip> { .item-tip-hide { display: none; @@ -368,6 +369,16 @@ .item-tip:hover>.item-tip-show { display: block; } + .item-tip.deep { + padding-left: 26px; + box-sizing: border-box; + height: 26px; + } + .item-tip.deepp { + padding-left: 39px; + box-sizing: border-box; + height: 26px; + } .tag-value:hover .item-tip-show { display: block; } @@ -379,7 +390,7 @@ .content-item-key { color: #666; width: 35%; - height: 100%; + height: 26px; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; @@ -428,6 +439,14 @@ } } } + .chart-sub-content { + >.content-item:first-of-type { + border-top: none; + } + >.content-item:last-of-type { + border-bottom: 1px solid rgb(235, 238, 245); + } + } } .chart-url { .url-container {