fix: 更新实体详情折线图接口

This commit is contained in:
刘洪洪
2023-06-01 15:26:36 +08:00
parent 7037085ba1
commit a9e73792e3
3 changed files with 6 additions and 5 deletions

View File

@@ -2,7 +2,7 @@ import Mock from 'mockjs'
const openMock = true const openMock = true
if (openMock) { 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 titleList = ['totalBitsRate', 'inboundBitsRate', 'outboundBitsRate', 'internalBitsRate', 'throughBitsRate', 'other']
const arr = [{ type: 'Bits/s' }, { type: 'Packets/s' }, { type: 'Sessions/s' }] const arr = [{ type: 'Bits/s' }, { type: 'Packets/s' }, { type: 'Sessions/s' }]

View File

@@ -231,7 +231,7 @@ export const api = {
drilldownTrafficAnalysis: '/interface/dns/overview/drilldown/trafficAnalysis' drilldownTrafficAnalysis: '/interface/dns/overview/drilldown/trafficAnalysis'
}, },
entity: { entity: {
totalTrafficAnalysis: 'interface/entityDetail/totalTrafficAnalysis', throughput: BASE_CONFIG.apiVersion + '/entity/detail/traffic/throughput',
securityEvent: 'interface/entityDetail/securityEvent', securityEvent: 'interface/entityDetail/securityEvent',
performanceEvent: 'interface/entityDetail/performanceEvent', performanceEvent: 'interface/entityDetail/performanceEvent',
domainNameResolutionRelatedApp: 'interface/entity/detail/overview/ip/relatedApp', domainNameResolutionRelatedApp: 'interface/entity/detail/overview/ip/relatedApp',

View File

@@ -208,8 +208,10 @@ export default {
const newVal = val ? _.clone(val) : this.metric const newVal = val ? _.clone(val) : this.metric
const params = { const params = {
resource: this.entity.entityName,
startTime: getSecond(this.timeFilter.startTime), startTime: getSecond(this.timeFilter.startTime),
endTime: getSecond(this.timeFilter.endTime) endTime: getSecond(this.timeFilter.endTime),
metric: newVal
} }
if (this.queryCondition) { if (this.queryCondition) {
@@ -217,8 +219,7 @@ export default {
} }
this.toggleLoading(true) this.toggleLoading(true)
// axios.get(api.netWorkOverview.totalTrafficAnalysis, { params: params }).then(response => { axios.get(`${api.entity.throughput}/${this.entity.entityType}`, { params: params }).then(response => {
axios.get(api.entity.totalTrafficAnalysis, { params: params }).then(response => {
const res = response.data const res = response.data
if (res.code === 200) { if (res.code === 200) {