fix: 修复导入引起的问题

This commit is contained in:
ibuler
2022-03-16 15:27:12 +08:00
committed by Jiangjie.Bai
parent f6bef8d77a
commit c032dee40c
4 changed files with 22 additions and 17 deletions

View File

@@ -43,6 +43,7 @@ export function getResourceNameByPath(path) {
export function getResourceFromApiUrl(apiUrl) {
const re = new RegExp('/api/v1/([A-Za-z0-9_-]+)/([A-Za-z0-9_-]+)/.*')
console.log('Api url: ', apiUrl)
const matched = apiUrl.match(re)
if (!matched) {
return { path: '', app: '', resource: '' }

View File

@@ -6,7 +6,7 @@
import { GenericListTable } from '@/layout/components'
import { DetailFormatter } from '@/components/TableFormatters'
import { openTaskPage } from '@/utils/jms'
import { AppPlanDatabase } from '@/views/perms/const'
import { AppPlanDatabase } from '@/views/applications/const'
export default {
name: 'AppChangeAuthPlanList',

View File

@@ -4,7 +4,20 @@
<script>
import { GenericListPage } from '@/layout/components'
import { DATABASE } from '@/views/perms/const'
import { DATABASE } from '@/views/applications/const'
function getAppType(arr) {
const searchAppType = []
if (arr.length < 1) return searchAppType
arr.forEach((i) => {
const option = {
value: i.name,
label: i.title
}
searchAppType.push(option)
})
return searchAppType
}
export default {
components: {
@@ -22,7 +35,10 @@ export default {
],
columnsShow: {
min: ['name', 'actions'],
default: ['name', 'type_display', 'attrs.host', 'attrs.port', 'attrs.database', 'comment', 'actions']
default: [
'name', 'type_display', 'attrs.host', 'attrs.port',
'attrs.database', 'comment', 'actions'
]
},
columnsMeta: {
type_display: {
@@ -75,7 +91,7 @@ export default {
{
value: 'type',
label: this.$t('applications.type'),
children: this.getAppType(appType)
children: getAppType(appType)
}
]
},
@@ -89,18 +105,6 @@ export default {
}
},
methods: {
getAppType(arr) {
const searchAppType = []
if (arr.length < 1) return searchAppType
arr.forEach((i) => {
const option = {
value: i.name,
label: i.title
}
searchAppType.push(option)
})
return searchAppType
}
}
}
</script>

View File

@@ -51,7 +51,7 @@ export default {
title: this.$t('xpack.ComponentMonitor'),
name: 'Monitor',
hidden: () => {
return !this.$hasPerm('terminal.view_terminal') && this.$store.getters.hasValidLicense
return !(this.$hasPerm('terminal.view_terminal') && this.$store.getters.hasValidLicense)
}
}
]