CN-834 fix: 修复npm下钻ip过滤未生效的问题
This commit is contained in:
@@ -198,7 +198,18 @@
|
||||
</template>
|
||||
<script>
|
||||
import { ref } from 'vue'
|
||||
import { operationType, unitTypes, networkTable, tableColumnType, networkDefaultLimit, curTabState, storageKey, dbDrilldownTableConfig, fromRoute } from '@/utils/constants'
|
||||
import {
|
||||
operationType,
|
||||
unitTypes,
|
||||
networkTable,
|
||||
tableColumnType,
|
||||
networkDefaultLimit,
|
||||
curTabState,
|
||||
storageKey,
|
||||
dbDrilldownTableConfig,
|
||||
fromRoute,
|
||||
drillDownPanelTypeMapping
|
||||
} from '@/utils/constants'
|
||||
import { get } from '@/utils/http'
|
||||
import unitConvert from '@/utils/unit-convert'
|
||||
import { getChainRatio, computeScore, urlParamsHandler, overwriteUrl, readDrilldownTableConfigByUser, combineDrilldownTableWithUserConfig, getDnsMapData, handleSpecialValue, getConfigVersion } from '@/utils/tools'
|
||||
@@ -1462,7 +1473,23 @@ export default {
|
||||
}
|
||||
},
|
||||
getQueryCondition () {
|
||||
return this.$route.query.queryCondition ? this.$route.query.queryCondition : ''
|
||||
const queryCondition = this.getUrlParam('queryCondition')
|
||||
const fourthPanel = this.getUrlParam('fourthPanel', -1, true)
|
||||
const dimensionType = this.getUrlParam('dimensionType', '')
|
||||
const fourthMenu = this.getUrlParam('fourthMenu', '')
|
||||
const tabIndex = this.getUrlParam('tabIndex', 0, true)
|
||||
|
||||
if (fourthPanel === drillDownPanelTypeMapping.npmOverviewIp) {
|
||||
if (dimensionType === 'clientIp' || dimensionType === 'serverIp' || dimensionType === 'ip') {
|
||||
if (tabIndex === 0) {
|
||||
return `common_client_ip='${fourthMenu}'`
|
||||
} else if (tabIndex === 1) {
|
||||
return `common_server_ip='${fourthMenu}'`
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return queryCondition
|
||||
},
|
||||
getUrlParam (param, defaultValue, isNumber) {
|
||||
if (isNumber) {
|
||||
|
||||
@@ -73,7 +73,7 @@ export default {
|
||||
} else {
|
||||
condition = this.queryCondition
|
||||
}
|
||||
const type = this.dimensionType || this.networkOverviewBeforeTab
|
||||
let type = this.dimensionType || this.networkOverviewBeforeTab
|
||||
const params = {
|
||||
startTime: getSecond(this.timeFilter.startTime),
|
||||
endTime: getSecond(this.timeFilter.endTime),
|
||||
@@ -85,10 +85,13 @@ export default {
|
||||
this.side = 'server'
|
||||
}
|
||||
if (condition && (typeof condition !== 'object') && type) {
|
||||
if (type === 'clientIp') {
|
||||
params.q = `ip='${condition.split(/'(.*?)'/)[1]}' and side='client'`
|
||||
} else if (type === 'serverIp') {
|
||||
params.q = `ip='${condition.split(/'(.*?)'/)[1]}' and side='server'`
|
||||
if (type === 'clientIp' || type === 'serverIp') {
|
||||
if (parseFloat(this.tabIndex) === 0) {
|
||||
type = 'clientIp'
|
||||
} else if (parseFloat(this.tabIndex) === 1) {
|
||||
type = 'serverIp'
|
||||
}
|
||||
params.q = `ip='${condition.split(/'(.*?)'/)[1]}'`
|
||||
} else if (type === 'clientCity') {
|
||||
params.q = `client_city='${condition.split(/'(.*?)'/)[1]}'`
|
||||
} else if (type === 'serverCity') {
|
||||
|
||||
@@ -145,7 +145,7 @@ export default {
|
||||
}
|
||||
// const conditionStr = this.$route.query.queryCondition ? this.$route.query.queryCondition : ''
|
||||
let condition = ''
|
||||
const type = this.dimensionType
|
||||
let type = this.dimensionType
|
||||
if (this.queryCondition.indexOf(' OR ') > -1) {
|
||||
condition = this.queryCondition.split(/["|'](.*?)["|']/)
|
||||
} else {
|
||||
@@ -161,13 +161,19 @@ export default {
|
||||
endTime: getSecond(this.timeFilter.endTime)
|
||||
}
|
||||
if (type) {
|
||||
if (type === 'clientIp' || type === 'serverIp') {
|
||||
if (parseFloat(this.tabIndex) === 0) {
|
||||
type = 'clientIp'
|
||||
} else if (parseFloat(this.tabIndex) === 1) {
|
||||
type = 'serverIp'
|
||||
}
|
||||
params.q = `ip='${condition.split(/'(.*?)'/)[1]}'`
|
||||
}
|
||||
params.type = type
|
||||
}
|
||||
if (condition && (typeof condition !== 'object') && type) {
|
||||
if (type === 'clientIp') {
|
||||
params.q = `ip='${condition.split(/'(.*?)'/)[1]}' and side='client'`
|
||||
} else if (type === 'serverIp') {
|
||||
params.q = `ip='${condition.split(/'(.*?)'/)[1]}' and side='server'`
|
||||
if (type === 'clientIp' || type === 'serverIp') {
|
||||
params.q = `ip='${condition.split(/'(.*?)'/)[1]}'`
|
||||
} else if (type === 'clientCity') {
|
||||
params.q = `client_city='${condition.split(/'(.*?)'/)[1]}'`
|
||||
} else if (type === 'serverCity') {
|
||||
|
||||
Reference in New Issue
Block a user