fix: 修复detection问题
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
<div class="overview__title">Fields</div>
|
||||
<div class="overview__row">
|
||||
<div class="row__label">{{$t('entities.category')}}</div>
|
||||
<div class="row__content">{{basicInfo.appCategory}}</div>
|
||||
<div class="row__content">{{basicInfo.appCategory || '-'}}</div>
|
||||
</div>
|
||||
<div class="overview__row">
|
||||
<div class="row__label">{{$t('entities.subcategory')}}</div>
|
||||
@@ -35,8 +35,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { get } from '@/utils/http'
|
||||
import { api } from '@/utils/api'
|
||||
import { api, getData } from '@/utils/api'
|
||||
import { eventSeverityColor } from '@/utils/constants'
|
||||
export default {
|
||||
name: 'DetectionPerformanceEventAppOverview',
|
||||
@@ -74,21 +73,17 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
query () {
|
||||
this.basicInfo = {
|
||||
}
|
||||
this.queryBasic().then(responses => {
|
||||
responses && (this.basicInfo = responses)
|
||||
})
|
||||
},
|
||||
queryBasic () {
|
||||
return new Promise((resolve, reject) => {
|
||||
try {
|
||||
get(api.detection.performanceEvent.overviewBasic, { serverIp: this.detection.appName }).then(response => {
|
||||
if (response.code === 200) {
|
||||
this.basicInfo = response.data.result[0]
|
||||
resolve(response.data.result)
|
||||
} else {
|
||||
reject(response)
|
||||
}
|
||||
getData(api.detection.performanceEvent.overviewBasic, { serverIp: this.detection.appName }).then(data => {
|
||||
resolve(data[0])
|
||||
}).catch(error => {
|
||||
reject(error)
|
||||
})
|
||||
} catch (e) {
|
||||
reject(e)
|
||||
|
||||
Reference in New Issue
Block a user