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) {