-
{{$t('panel.asset.id')}}
+
ID
{{chartDetail ? chartDetail.id : '--'}}
-
{{$t('panel.asset.name')}}
+
{{$t('overall.name')}}
{{chartDetail? chartDetail.name : '--' }}
-
{{$t('panel.asset.manageIp')}}
-
{{chartDetail ? chartDetail.manageIp : '--'}}
+
{{$t('overall.project')}}
+
{{chartDetail && chartDetail.project ? chartDetail.project.name : '--' }}
-
{{$t('panel.asset.type')}}
-
{{chartDetail.type ? chartDetail.type.name : '--'}}
-
-
-
{{$t('panel.asset.state')}}
-
{{chartDetail.state ? chartDetail.state.name : '--'}}
-
-
-
Ping
+
{{$t('overall.module')}}
-
-
{{chartDetail && chartDetail.pingInfo && chartDetail.pingInfo.rtt ? chartDetail.pingInfo.rtt + 'ms':''}}
+
+
{{chartDetail.module && chartDetail.module ? chartDetail.module.name : '--'}}
-
{{$t('panel.asset.dc')}}
-
{{chartDetail.dc ? chartDetail.dc.name : '--'}}
-
-
-
{{$t('panel.asset.cabinet')}}
-
{{chartDetail.cabinet ? chartDetail.cabinet.name : '--'}}
-
-
-
{{$t('panel.asset.brand')}}
-
{{chartDetail.brand ? chartDetail.brand.name : '--'}}
-
-
-
{{$t('panel.asset.model')}}
-
{{chartDetail.model ? chartDetail.model.name : '--'}}
-
-
-
{{$t('panel.asset.label')}}
-
-
-
-
{{item.name}}
-
{{item.value[0]}}
-
-
+
{{$t('overall.asset')}}
+
+
+ {{chartDetail && chartDetail.asset ? chartDetail.asset.name : '--'}}
-
{{ $t('asset') }}
+
{{$t('overall.alert')}}
- {{chartDetail ? chartDetail.alertNum : 0}}
+ {{chartDetail && chartDetail.alertNum ? chartDetail.alertNum : 0}}
-
Endpoint
+
{{$t('overall.state')}}
-
- {{chartDetail ? chartDetail.endpointNum : 0}}
+
+ {{$t('project.endpoint.metrics')}}
+
+
+
+
+
+
+
+
+
+
+
+ {{$t('project.endpoint.logs')}}
+
+
+
+
+
+
+
+
+
+
diff --git a/nezha-fronted/src/components/chart/chartList.vue b/nezha-fronted/src/components/chart/chartList.vue
index 64136a8ec..617d934fd 100644
--- a/nezha-fronted/src/components/chart/chartList.vue
+++ b/nezha-fronted/src/components/chart/chartList.vue
@@ -45,6 +45,7 @@
@edit-chart="$emit('edit-chart', item)"
:chart-info="item"
:time-range="timeRange"
+ :chart-detail-info="chartDetailInfo"
@showFullscreen="showFullscreen"
>
@@ -92,8 +93,8 @@ export default {
props: {
// TODO isModel
from: { type: String },
- panelId: { },
- obj: Object,
+ panelId: {},
+ chartDetailInfo: Object,
timeRange: Array, // 时间范围
panelLock: { type: Boolean, default: true },
isGroup: { type: Boolean, default: false },
@@ -282,19 +283,23 @@ export default {
this.gridLayoutLoading = true
this.noData = !n || n.length < 1
const tempList = n.map(item => {
- const param = item.param
- // try {
- // param = JSON.parse(item.param)
- // } catch (e) {
- // console.info(e)
- // }
- const height = (item.type === 'group' && item.param.collapse) ? this.headerH : item.height
- param.showHeader = true
+ let param = ''
+ let height = ''
+ if (item.param) {
+ param = item.param
+ // try {
+ // param = JSON.parse(item.param)
+ // } catch (e) {
+ // console.info(e)
+ // }
+ height = (item.type === 'group' && item.param.collapse) ? this.headerH : item.height
+ param.showHeader = true
+ }
return {
...item,
i: item.id,
w: item.span,
- h: height,
+ h: height || 4,
x: item.x || 0,
y: item.y || 0,
param
diff --git a/nezha-fronted/src/components/chart/panelChart.vue b/nezha-fronted/src/components/chart/panelChart.vue
index 5666615f2..01976d0be 100644
--- a/nezha-fronted/src/components/chart/panelChart.vue
+++ b/nezha-fronted/src/components/chart/panelChart.vue
@@ -45,7 +45,8 @@ export default {
chartInfo: Object, // 其中的param json串已转化为对象
timeRange: Array, // 时间范围
isFullscreen: Boolean,
- panelLock: Boolean
+ panelLock: Boolean,
+ chartDetailInfo: Object
},
data () {
return {
@@ -94,7 +95,20 @@ export default {
query (elements, startTime, endTime, step) {
try {
switch (this.chartInfo.datasource) {
- case 'metrics':
+ case 'metrics': {
+ if (this.chartInfo.type === 'assetInfo') {
+ console.log(this.chartDetailInfo)
+ this.$get('asset/asset/' + this.chartDetailInfo.id).then(res => {
+ console.log(res)
+ this.chartData = res.data
+ })
+ }
+ if (this.chartInfo.type === 'endpointInfo') {
+ this.$get('monitor/endpoint/' + this.chartDetailInfo.id).then(res => {
+ this.chartData = res.data
+ })
+ }
+ }
case 'logs': {
let urlPre = ''
if (this.chartInfo.datasource === 'metrics') {
@@ -141,7 +155,7 @@ export default {
break
}
case 'system': {
- console.log(this.chartInfo)
+ console.log(this.chartInfo.type)
const params = {
q: '',
stat: startTime,
@@ -180,20 +194,6 @@ export default {
if (this.chartInfo.type === 'map') {
this.chartData = ['map']
}
- if (this.chartInfo.type === 'assetInfo') {
- this.$get('asset/asset/' + 545).then(res => {
- if (res.code === 200) {
- this.chartData = res.data
- }
- })
- }
- if (this.chartInfo.type === 'endpointInfo') {
- this.$get('monitor/endpoint/' + 1).then(res => {
- if (res.code === 200) {
- this.chartData = res.data
- }
- })
- }
break
}
}
diff --git a/nezha-fronted/src/components/common/bottomBox/tabs/panelTabNew.vue b/nezha-fronted/src/components/common/bottomBox/tabs/panelTabNew.vue
index 7dcf73886..0148ac39c 100644
--- a/nezha-fronted/src/components/common/bottomBox/tabs/panelTabNew.vue
+++ b/nezha-fronted/src/components/common/bottomBox/tabs/panelTabNew.vue
@@ -94,21 +94,30 @@