From a9e73792e3a17b06cd2ac58008d035366cb325d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E6=B4=AA=E6=B4=AA?= <2498601771@qq.com> Date: Thu, 1 Jun 2023 15:26:36 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=9B=B4=E6=96=B0=E5=AE=9E=E4=BD=93?= =?UTF-8?q?=E8=AF=A6=E6=83=85=E6=8A=98=E7=BA=BF=E5=9B=BE=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/mock/entity.js | 2 +- src/utils/api.js | 2 +- src/views/charts2/charts/entityDetail/EntityDetailLine.vue | 7 ++++--- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/mock/entity.js b/src/mock/entity.js index 78dec587..f4c87fcd 100644 --- a/src/mock/entity.js +++ b/src/mock/entity.js @@ -2,7 +2,7 @@ import Mock from 'mockjs' const openMock = true if (openMock) { - Mock.mock(new RegExp(BASE_CONFIG.baseUrl + 'interface/entityDetail/totalTrafficAnalysis.*'), 'get', function (requestObj) { + Mock.mock(new RegExp(BASE_CONFIG.baseUrl + BASE_CONFIG.apiVersion + '/entity/detail/traffic/throughput.*'), 'get', function (requestObj) { const titleList = ['totalBitsRate', 'inboundBitsRate', 'outboundBitsRate', 'internalBitsRate', 'throughBitsRate', 'other'] const arr = [{ type: 'Bits/s' }, { type: 'Packets/s' }, { type: 'Sessions/s' }] diff --git a/src/utils/api.js b/src/utils/api.js index a2fdad26..d312e391 100644 --- a/src/utils/api.js +++ b/src/utils/api.js @@ -231,7 +231,7 @@ export const api = { drilldownTrafficAnalysis: '/interface/dns/overview/drilldown/trafficAnalysis' }, entity: { - totalTrafficAnalysis: 'interface/entityDetail/totalTrafficAnalysis', + throughput: BASE_CONFIG.apiVersion + '/entity/detail/traffic/throughput', securityEvent: 'interface/entityDetail/securityEvent', performanceEvent: 'interface/entityDetail/performanceEvent', domainNameResolutionRelatedApp: 'interface/entity/detail/overview/ip/relatedApp', diff --git a/src/views/charts2/charts/entityDetail/EntityDetailLine.vue b/src/views/charts2/charts/entityDetail/EntityDetailLine.vue index f343d8ff..bb5e8e20 100644 --- a/src/views/charts2/charts/entityDetail/EntityDetailLine.vue +++ b/src/views/charts2/charts/entityDetail/EntityDetailLine.vue @@ -208,8 +208,10 @@ export default { const newVal = val ? _.clone(val) : this.metric const params = { + resource: this.entity.entityName, startTime: getSecond(this.timeFilter.startTime), - endTime: getSecond(this.timeFilter.endTime) + endTime: getSecond(this.timeFilter.endTime), + metric: newVal } if (this.queryCondition) { @@ -217,8 +219,7 @@ export default { } this.toggleLoading(true) - // axios.get(api.netWorkOverview.totalTrafficAnalysis, { params: params }).then(response => { - axios.get(api.entity.totalTrafficAnalysis, { params: params }).then(response => { + axios.get(`${api.entity.throughput}/${this.entity.entityType}`, { params: params }).then(response => { const res = response.data if (res.code === 200) {