diff --git a/src/assets/css/components/views/charts2/npmTrafficLine.scss b/src/assets/css/components/views/charts2/npmTrafficLine.scss index df0cb0cb..6ca3a0a0 100644 --- a/src/assets/css/components/views/charts2/npmTrafficLine.scss +++ b/src/assets/css/components/views/charts2/npmTrafficLine.scss @@ -53,6 +53,9 @@ border-radius: 4px; height: calc(100% - 32px); width: 100%; + .panel-chart__no-data { + height: calc(100% - 32px); + } .chart-drawing { height: 100%; width: 100%; diff --git a/src/views/charts2/charts/npm/NpmTrafficLine.vue b/src/views/charts2/charts/npm/NpmTrafficLine.vue index b387d66e..8c4f56bf 100644 --- a/src/views/charts2/charts/npm/NpmTrafficLine.vue +++ b/src/views/charts2/charts/npm/NpmTrafficLine.vue @@ -366,6 +366,8 @@ export default { if (this.isNoData) { this.npmQuantity = [ { name: 'networkAppPerformance.tcpConnectionEstablishLatency', show: true, positioning: 0, data: [], unitType: unitTypes.time }, + { name: 'networkAppPerformance.httpResponse', show: true, positioning: 0, data: [], unitType: unitTypes.time }, + { name: 'networkAppPerformance.sslResponseLatency', show: true, positioning: 0, data: [], unitType: unitTypes.time }, { name: 'networkAppPerformance.packetLoss', show: true, positioning: 0, data: [], unitType: unitTypes.percent }, { name: 'overall.packetRetrans', show: true, positioning: 0, data: [], unitType: unitTypes.percent } ] @@ -385,9 +387,9 @@ export default { this.echartsInit(this.npmQuantity) } else if (t.type === 'tcpLostlenPercent' && val === 'tcpLostlenPercent') { const npmQuantity = _.cloneDeep(this.npmQuantity) - npmQuantity[1].data = t.tcpLostlenPercent.values ? t.tcpLostlenPercent.values : [] + npmQuantity[3].data = t.tcpLostlenPercent.values ? t.tcpLostlenPercent.values : [] npmQuantity.forEach((e, i) => { - if (i !== 1) { + if (i !== 3) { e.show = false } else { e.show = true @@ -397,9 +399,9 @@ export default { this.echartsInit(this.npmQuantity) } else if (t.type === 'pktRetransPercent' && val === 'pktRetransPercent') { const npmQuantity = _.cloneDeep(this.npmQuantity) - npmQuantity[2].data = t.pktRetransPercent.values ? t.pktRetransPercent.values : [] + npmQuantity[4].data = t.pktRetransPercent.values ? t.pktRetransPercent.values : [] npmQuantity.forEach((e, i) => { - if (i !== 2) { + if (i !== 4) { e.show = false } else { e.show = true @@ -419,18 +421,22 @@ export default { this.toggleLoading(true) get(api.npm.overview.totalHttpResponseDelay, params).then(res => { if (res.code === 200) { - this.isNoData = res.data.length === 0 + this.isNoData = res.data.result.length === 0 if (this.isNoData) { this.npmQuantity = [ - { name: 'networkAppPerformance.httpResponse', show: true, positioning: 0, data: [], unitType: unitTypes.time } + { name: 'networkAppPerformance.tcpConnectionEstablishLatency', show: true, positioning: 0, data: [], unitType: unitTypes.time }, + { name: 'networkAppPerformance.httpResponse', show: true, positioning: 0, data: [], unitType: unitTypes.time }, + { name: 'networkAppPerformance.sslResponseLatency', show: true, positioning: 0, data: [], unitType: unitTypes.time }, + { name: 'networkAppPerformance.packetLoss', show: true, positioning: 0, data: [], unitType: unitTypes.percent }, + { name: 'overall.packetRetrans', show: true, positioning: 0, data: [], unitType: unitTypes.percent } ] } res.data.result.forEach(t => { if (t.type === 'httpResponseLatency' && val === 'httpResponseLatency') { const npmQuantity = _.cloneDeep(this.npmQuantity) - npmQuantity[0].data = t.httpResponseLatency.values ? t.httpResponseLatency.values : [] + npmQuantity[1].data = t.httpResponseLatency.values ? t.httpResponseLatency.values : [] npmQuantity.forEach((e, i) => { - if (i !== 0) { + if (i !== 1) { e.show = false } else { e.show = true @@ -450,18 +456,22 @@ export default { this.toggleLoading(true) get(api.npm.overview.totalSslConDelay, params).then(res => { if (res.code === 200) { - this.isNoData = res.data.length === 0 + this.isNoData = res.data.result.length === 0 if (this.isNoData) { this.npmQuantity = [ - { name: 'networkAppPerformance.sslResponseLatency', show: true, positioning: 0, data: [], unitType: unitTypes.time } + { name: 'networkAppPerformance.tcpConnectionEstablishLatency', show: true, positioning: 0, data: [], unitType: unitTypes.time }, + { name: 'networkAppPerformance.httpResponse', show: true, positioning: 0, data: [], unitType: unitTypes.time }, + { name: 'networkAppPerformance.sslResponseLatency', show: true, positioning: 0, data: [], unitType: unitTypes.time }, + { name: 'networkAppPerformance.packetLoss', show: true, positioning: 0, data: [], unitType: unitTypes.percent }, + { name: 'overall.packetRetrans', show: true, positioning: 0, data: [], unitType: unitTypes.percent } ] } res.data.result.forEach(t => { if (t.type === 'sslConLatency' && val === 'sslConLatency') { const npmQuantity = _.cloneDeep(this.npmQuantity) - npmQuantity[0].data = t.sslConLatency.values ? t.sslConLatency.values : [] + npmQuantity[2].data = t.sslConLatency.values ? t.sslConLatency.values : [] npmQuantity.forEach((e, i) => { - if (i !== 0) { + if (i !== 2) { e.show = false } else { e.show = true