mirror of
https://github.com/jumpserver/lina.git
synced 2025-09-28 15:55:24 +00:00
perf: 修改平台类别
This commit is contained in:
@@ -39,11 +39,10 @@
|
|||||||
:title="'选择模版'"
|
:title="'选择模版'"
|
||||||
:visible.sync="templateTable.visible"
|
:visible.sync="templateTable.visible"
|
||||||
:destroy-on-close="true"
|
:destroy-on-close="true"
|
||||||
:show-cancel="false"
|
|
||||||
:show-confirm="false"
|
|
||||||
width="70%"
|
width="70%"
|
||||||
|
@submit="onSelectTemplate"
|
||||||
>
|
>
|
||||||
<ListTable v-bind="templateTable" />
|
<AutoDataTable :config="templateTable.tableConfig" />
|
||||||
</Dialog>
|
</Dialog>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -51,12 +50,12 @@
|
|||||||
<script>
|
<script>
|
||||||
import Dialog from '@/components/Dialog'
|
import Dialog from '@/components/Dialog'
|
||||||
import AccountCreateForm from '@/components/AccountCreateForm'
|
import AccountCreateForm from '@/components/AccountCreateForm'
|
||||||
import ListTable from '@/components/ListTable'
|
import AutoDataTable from '@/components/AutoDataTable'
|
||||||
export default {
|
export default {
|
||||||
name: 'AssetAccounts',
|
name: 'AssetAccounts',
|
||||||
components: {
|
components: {
|
||||||
Dialog,
|
Dialog,
|
||||||
ListTable,
|
AutoDataTable,
|
||||||
AccountCreateForm
|
AccountCreateForm
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
@@ -79,9 +78,12 @@ export default {
|
|||||||
visible: false,
|
visible: false,
|
||||||
tableConfig: {
|
tableConfig: {
|
||||||
url: '/api/v1/assets/account-templates/',
|
url: '/api/v1/assets/account-templates/',
|
||||||
columns: ['name', 'username', 'privileged', 'actions']
|
columns: ['name', 'username', 'privileged', 'actions'],
|
||||||
},
|
columnsMeta: {
|
||||||
headerActions: {
|
privileged: {
|
||||||
|
width: '100px'
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -133,6 +135,9 @@ export default {
|
|||||||
},
|
},
|
||||||
onAddFromTemplateClick() {
|
onAddFromTemplateClick() {
|
||||||
this.templateTable.visible = true
|
this.templateTable.visible = true
|
||||||
|
},
|
||||||
|
onSelectTemplate() {
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -100,7 +100,7 @@
|
|||||||
"CreateDatabase": "Create asset - Database",
|
"CreateDatabase": "Create asset - Database",
|
||||||
"CreateHost": "Create asset - Host",
|
"CreateHost": "Create asset - Host",
|
||||||
"CreateRemoteApp": "Create asset - Remote app",
|
"CreateRemoteApp": "Create asset - Remote app",
|
||||||
"CreateNetworkDevice": "Create asset - Network device",
|
"CreateDevice": "Create asset - Network device",
|
||||||
"CreateCloud": "Create asset - Cloud platform",
|
"CreateCloud": "Create asset - Cloud platform",
|
||||||
"CreateWeb": "Create asset - web",
|
"CreateWeb": "Create asset - web",
|
||||||
"SelectPlatforms": "Select platforms",
|
"SelectPlatforms": "Select platforms",
|
||||||
|
@@ -105,7 +105,7 @@
|
|||||||
"CreateDatabase": "資産の作成 - データベース",
|
"CreateDatabase": "資産の作成 - データベース",
|
||||||
"CreateHost": "資産の作成 - ホスト",
|
"CreateHost": "資産の作成 - ホスト",
|
||||||
"CreateRemoteApp": "資産の作成 - リモートアプリケーション",
|
"CreateRemoteApp": "資産の作成 - リモートアプリケーション",
|
||||||
"CreateNetworkDevice": "資産の作成 - ネットワークデバイス",
|
"CreateDevice": "資産の作成 - ネットワークデバイス",
|
||||||
"CreateCloud": "資産の作成 - クラウドプラットフォーム",
|
"CreateCloud": "資産の作成 - クラウドプラットフォーム",
|
||||||
"CreateWeb": "資産の作成 - ウェブ",
|
"CreateWeb": "資産の作成 - ウェブ",
|
||||||
"SelectPlatforms": "プラットフォームを選択",
|
"SelectPlatforms": "プラットフォームを選択",
|
||||||
|
@@ -105,7 +105,7 @@
|
|||||||
"CreateDatabase": "创建资产-数据库",
|
"CreateDatabase": "创建资产-数据库",
|
||||||
"CreateHost": "创建资产-主机",
|
"CreateHost": "创建资产-主机",
|
||||||
"CreateRemoteApp": "创建资产-远程应用",
|
"CreateRemoteApp": "创建资产-远程应用",
|
||||||
"CreateNetworkDevice": "创建资产-网络设备",
|
"CreateDevice": "创建资产-网络设备",
|
||||||
"CreateCloud": "创建资产-云平台",
|
"CreateCloud": "创建资产-云平台",
|
||||||
"CreateWeb": "创建资产-web",
|
"CreateWeb": "创建资产-web",
|
||||||
"SelectPlatforms": "选择平台",
|
"SelectPlatforms": "选择平台",
|
||||||
@@ -729,7 +729,7 @@
|
|||||||
"AssetDetail": "资产详情",
|
"AssetDetail": "资产详情",
|
||||||
"AssetList": "资产列表",
|
"AssetList": "资产列表",
|
||||||
"HostList": "主机列表",
|
"HostList": "主机列表",
|
||||||
"NetworkDevices": "网络设备",
|
"Devices": "网络设备",
|
||||||
"Databases": "数据库",
|
"Databases": "数据库",
|
||||||
"Session": "会话",
|
"Session": "会话",
|
||||||
"AssetPermission": "资产授权",
|
"AssetPermission": "资产授权",
|
||||||
|
@@ -92,30 +92,30 @@ export default [
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'networks',
|
path: 'devices',
|
||||||
component: empty,
|
component: empty,
|
||||||
redirect: '',
|
redirect: '',
|
||||||
hidden: true,
|
hidden: true,
|
||||||
meta: { title: i18n.t('route.networking'), permissions: ['assets.view_asset'] },
|
meta: { title: i18n.t('route.devices'), permissions: ['assets.view_asset'] },
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
path: '',
|
path: '',
|
||||||
name: 'NetworkingList',
|
name: 'DeviceList',
|
||||||
component: () => import('@/views/assets/Asset/AssetList/NetworkList.vue'),
|
component: () => import('@/views/assets/Asset/AssetList/DeviceList.vue'),
|
||||||
hidden: true,
|
hidden: true,
|
||||||
meta: { title: i18n.t('route.HostList'), activeMenu: '/console/assets/assets' }
|
meta: { title: i18n.t('route.HostList'), activeMenu: '/console/assets/assets' }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'create',
|
path: 'create',
|
||||||
name: 'NetworkingCreate',
|
name: 'DeviceCreate',
|
||||||
component: () => import('@/views/assets/Asset/AssetCreateUpdate/NetworkCreateUpdate.vue'),
|
component: () => import('@/views/assets/Asset/AssetCreateUpdate/DeviceCreateUpdate.vue'),
|
||||||
hidden: true,
|
hidden: true,
|
||||||
meta: { title: i18n.t('assets.CreateNetworkDevice'), activeMenu: '/console/assets/assets' }
|
meta: { title: i18n.t('assets.CreateDevice'), activeMenu: '/console/assets/assets' }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: ':id/update',
|
path: ':id/update',
|
||||||
name: 'NetworkingUpdate',
|
name: 'DeviceUpdate',
|
||||||
component: () => import('@/views/assets/Asset/AssetCreateUpdate/NetworkCreateUpdate.vue'),
|
component: () => import('@/views/assets/Asset/AssetCreateUpdate/DeviceCreateUpdate.vue'),
|
||||||
hidden: true,
|
hidden: true,
|
||||||
meta: { title: i18n.t('route.AssetUpdate'), activeMenu: '/console/assets/assets' }
|
meta: { title: i18n.t('route.AssetUpdate'), activeMenu: '/console/assets/assets' }
|
||||||
}
|
}
|
||||||
@@ -131,7 +131,7 @@ export default [
|
|||||||
{
|
{
|
||||||
path: '',
|
path: '',
|
||||||
name: 'CloudsPlatformList',
|
name: 'CloudsPlatformList',
|
||||||
component: () => import('@/views/assets/Asset/AssetList/CloudsPlatformList.vue'),
|
component: () => import('@/views/assets/Asset/AssetList/CloudList.vue'),
|
||||||
hidden: true,
|
hidden: true,
|
||||||
meta: { title: i18n.t('route.HostList'), activeMenu: '/console/assets/assets' }
|
meta: { title: i18n.t('route.HostList'), activeMenu: '/console/assets/assets' }
|
||||||
},
|
},
|
||||||
|
@@ -71,7 +71,7 @@ export default {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'networking',
|
id: 'networking',
|
||||||
label: 'Networking',
|
label: 'Device',
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
id: 'switch',
|
id: 'switch',
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<GenericCreateUpdatePage v-if="!iConfig.loading" v-bind="iConfig" />
|
<GenericCreateUpdatePage v-if="!loading" v-bind="iConfig" />
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
@@ -21,8 +21,8 @@ export default {
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
loading: true,
|
||||||
defaultConfig: {
|
defaultConfig: {
|
||||||
loading: true,
|
|
||||||
initial: {},
|
initial: {},
|
||||||
platform: {},
|
platform: {},
|
||||||
url: '/api/v1/assets/hosts/',
|
url: '/api/v1/assets/hosts/',
|
||||||
@@ -60,18 +60,15 @@ export default {
|
|||||||
},
|
},
|
||||||
async created() {
|
async created() {
|
||||||
try {
|
try {
|
||||||
await this.setPlatformInitial()
|
await this.setInitial()
|
||||||
|
await this.setPlatformConstrains()
|
||||||
} finally {
|
} finally {
|
||||||
this.defaultConfig.loading = false
|
this.loading = false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
async setPlatformInitial() {
|
async setInitial() {
|
||||||
const nodesInitial = []
|
const nodesInitial = this.$route.query['node'] ? [this.$route.query['node']] : []
|
||||||
if (!this.defaultConfig.initial) this.$set(this.defaultConfig, 'initial', {})
|
|
||||||
if (this.$route.query['node']) {
|
|
||||||
nodesInitial.push(this.$route.query.node)
|
|
||||||
}
|
|
||||||
const platformId = this.$route.query['platform'] || 1
|
const platformId = this.$route.query['platform'] || 1
|
||||||
const url = `/api/v1/assets/platforms/${platformId}/`
|
const url = `/api/v1/assets/platforms/${platformId}/`
|
||||||
this.platform = await this.$axios.get(url)
|
this.platform = await this.$axios.get(url)
|
||||||
@@ -83,6 +80,8 @@ export default {
|
|||||||
protocols: this.platform.protocols || []
|
protocols: this.platform.protocols || []
|
||||||
}
|
}
|
||||||
this.defaultConfig.initial = Object.assign({}, initial, this.defaultConfig.initial)
|
this.defaultConfig.initial = Object.assign({}, initial, this.defaultConfig.initial)
|
||||||
|
},
|
||||||
|
async setPlatformConstrains() {
|
||||||
this.$set(this.defaultConfig.fieldsMeta.protocols.el, 'choices', (this.platform['protocols'] || []))
|
this.$set(this.defaultConfig.fieldsMeta.protocols.el, 'choices', (this.platform['protocols'] || []))
|
||||||
this.$set(this.defaultConfig.fieldsMeta.accounts.el, 'protocols', (this.platform['protocols'] || []))
|
this.$set(this.defaultConfig.fieldsMeta.accounts.el, 'protocols', (this.platform['protocols'] || []))
|
||||||
const hiddenCheckFields = ['protocols', 'domain']
|
const hiddenCheckFields = ['protocols', 'domain']
|
@@ -1,13 +1,13 @@
|
|||||||
<template>
|
<template>
|
||||||
<BaseCreateUpdate v-bind="$data" />
|
<BaseAssetCreateUpdate v-bind="$data" />
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import BaseCreateUpdate from './components/BaseCreateUpdate'
|
import BaseAssetCreateUpdate from './BaseAssetCreateUpdate'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'CloudCreateUpdate',
|
name: 'CloudCreateUpdate',
|
||||||
components: { BaseCreateUpdate },
|
components: { BaseAssetCreateUpdate },
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
url: '/api/v1/assets/clouds/',
|
url: '/api/v1/assets/clouds/',
|
||||||
|
@@ -1,13 +1,13 @@
|
|||||||
<template>
|
<template>
|
||||||
<BaseCreateUpdate v-bind="$data" />
|
<BaseAssetCreateUpdate v-bind="$data" />
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import BaseCreateUpdate from './components/BaseCreateUpdate'
|
import BaseAssetCreateUpdate from './BaseAssetCreateUpdate'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'DatabaseCreateUpdate',
|
name: 'DatabaseCreateUpdate',
|
||||||
components: { BaseCreateUpdate },
|
components: { BaseAssetCreateUpdate },
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
url: '/api/v1/assets/databases/',
|
url: '/api/v1/assets/databases/',
|
||||||
|
@@ -0,0 +1,20 @@
|
|||||||
|
<template>
|
||||||
|
<BaseAssetCreateUpdate v-bind="$data" />
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import BaseAssetCreateUpdate from './BaseAssetCreateUpdate'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'DeviceCreateUpdate',
|
||||||
|
components: { BaseAssetCreateUpdate },
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
url: '/api/v1/assets/assets/devices/'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
</style>
|
@@ -1,13 +1,13 @@
|
|||||||
<template>
|
<template>
|
||||||
<BaseCreateUpdate v-bind="$data" />
|
<BaseAssetCreateUpdate v-bind="$data" />
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import BaseCreateUpdate from './components/BaseCreateUpdate'
|
import BaseAssetCreateUpdate from './BaseAssetCreateUpdate'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'HostCreateUpdate',
|
name: 'HostCreateUpdate',
|
||||||
components: { BaseCreateUpdate },
|
components: { BaseAssetCreateUpdate },
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
url: '/api/v1/assets/hosts/'
|
url: '/api/v1/assets/hosts/'
|
||||||
|
@@ -1,20 +0,0 @@
|
|||||||
<template>
|
|
||||||
<BaseCreateUpdate v-bind="$data" />
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import BaseCreateUpdate from './components/BaseCreateUpdate'
|
|
||||||
|
|
||||||
export default {
|
|
||||||
name: 'NetworkingCreateUpdate',
|
|
||||||
components: { BaseCreateUpdate },
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
url: '/api/v1/assets//assets/networks/'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style>
|
|
||||||
</style>
|
|
@@ -1,13 +1,13 @@
|
|||||||
<template>
|
<template>
|
||||||
<BaseCreateUpdate v-bind="$data" />
|
<BaseAssetCreateUpdate v-bind="$data" />
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import BaseCreateUpdate from './components/BaseCreateUpdate'
|
import BaseAssetCreateUpdate from './BaseAssetCreateUpdate'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'WebCreateUpdate',
|
name: 'WebCreateUpdate',
|
||||||
components: { BaseCreateUpdate },
|
components: { BaseAssetCreateUpdate },
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
url: '/api/v1/assets/web/',
|
url: '/api/v1/assets/web/',
|
||||||
|
@@ -12,10 +12,10 @@ export default {
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
config: {
|
config: {
|
||||||
url: '/api/v1/assets/networks/',
|
url: '/api/v1/assets/devices/',
|
||||||
category: 'networking',
|
category: 'device',
|
||||||
headerActions: {
|
headerActions: {
|
||||||
createRoute: 'NetworkingCreate'
|
createRoute: 'DeviceCreate'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@@ -193,7 +193,6 @@ export default {
|
|||||||
vm.$hasPerm('assets.change_asset')
|
vm.$hasPerm('assets.change_asset')
|
||||||
},
|
},
|
||||||
callback: ({ selectedRows }) => {
|
callback: ({ selectedRows }) => {
|
||||||
console.log('selectedRows: ----------------------ss', selectedRows)
|
|
||||||
vm.updateSelectedDialogSetting.selectedRows = selectedRows
|
vm.updateSelectedDialogSetting.selectedRows = selectedRows
|
||||||
vm.updateSelectedDialogSetting.visible = true
|
vm.updateSelectedDialogSetting.visible = true
|
||||||
}
|
}
|
||||||
|
@@ -31,10 +31,10 @@ export default {
|
|||||||
component: () => import('@/views/assets/Asset/AssetList/HostList.vue')
|
component: () => import('@/views/assets/Asset/AssetList/HostList.vue')
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: this.$t('route.NetworkDevices'),
|
title: this.$t('route.Devices'),
|
||||||
name: 'networks',
|
name: 'devices',
|
||||||
hidden: () => false,
|
hidden: () => false,
|
||||||
component: () => import('@/views/assets/Asset/AssetList/NetworkList.vue')
|
component: () => import('@/views/assets/Asset/AssetList/DeviceList.vue')
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: this.$t('route.Databases'),
|
title: this.$t('route.Databases'),
|
||||||
@@ -43,10 +43,10 @@ export default {
|
|||||||
component: () => import('@/views/assets/Asset/AssetList/DatabaseList.vue')
|
component: () => import('@/views/assets/Asset/AssetList/DatabaseList.vue')
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: this.$t('assets.CloudPlatform'),
|
title: this.$t('assets.Clouds'),
|
||||||
name: 'clouds',
|
name: 'clouds',
|
||||||
hidden: () => false,
|
hidden: () => false,
|
||||||
component: () => import('@/views/assets/Asset/AssetList/CloudsPlatformList.vue')
|
component: () => import('@/views/assets/Asset/AssetList/CloudList.vue')
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'Web',
|
title: 'Web',
|
||||||
|
@@ -35,21 +35,18 @@ export default {
|
|||||||
comment: '',
|
comment: '',
|
||||||
charset: 'utf8',
|
charset: 'utf8',
|
||||||
category_type: ['host', 'linux'],
|
category_type: ['host', 'linux'],
|
||||||
automation: {
|
automation: {}
|
||||||
}
|
|
||||||
},
|
},
|
||||||
fields: [
|
fields: [
|
||||||
[this.$t('common.Basic'), [
|
[this.$t('common.Basic'), [
|
||||||
'name', 'category_type'
|
'name', 'category_type', 'charset', 'domain_enabled'
|
||||||
]],
|
]],
|
||||||
|
['网络设备', ['brand']],
|
||||||
['配置', [
|
['配置', [
|
||||||
'protocols_enabled', 'protocols',
|
'protocols_enabled', 'protocols',
|
||||||
'charset', 'domain_enabled', 'brand',
|
|
||||||
'su_enabled', 'su_method'
|
'su_enabled', 'su_method'
|
||||||
]],
|
]],
|
||||||
['自动化', [
|
['自动化', ['automation']],
|
||||||
'automation'
|
|
||||||
]],
|
|
||||||
[this.$t('common.Other'), ['comment']]
|
[this.$t('common.Other'), ['comment']]
|
||||||
],
|
],
|
||||||
fieldsMeta: {
|
fieldsMeta: {
|
||||||
@@ -87,6 +84,7 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
brand: {},
|
||||||
protocols_enabled: {
|
protocols_enabled: {
|
||||||
el: {
|
el: {
|
||||||
disabled: false
|
disabled: false
|
||||||
@@ -161,9 +159,10 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.fieldsMeta.protocols.el.choices = constraints['protocols'] || []
|
this.fieldsMeta.protocols.el.choices = constraints['protocols'] || []
|
||||||
await this.setOpsMethods(constraints)
|
this.fieldsMeta.brand.hidden = () => constraints['brand_enabled'] !== true
|
||||||
|
await this.setAutomationMethods(constraints)
|
||||||
},
|
},
|
||||||
async setOpsMethods(constraints) {
|
async setAutomationMethods(constraints) {
|
||||||
const category = this.$route.query.category
|
const category = this.$route.query.category
|
||||||
const type = this.$route.query.type
|
const type = this.$route.query.type
|
||||||
const allMethods = await this.$axios.get('/api/v1/assets/platforms/ops-methods/') || []
|
const allMethods = await this.$axios.get('/api/v1/assets/platforms/ops-methods/') || []
|
||||||
|
@@ -14,7 +14,6 @@
|
|||||||
<script>
|
<script>
|
||||||
import { GenericListTable, TabPage } from '@/layout/components'
|
import { GenericListTable, TabPage } from '@/layout/components'
|
||||||
import { ChoicesDisplayFormatter } from '@/components/TableFormatters'
|
import { ChoicesDisplayFormatter } from '@/components/TableFormatters'
|
||||||
import { Categories } from '@/views/assets/const'
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
@@ -26,7 +25,7 @@ export default {
|
|||||||
return {
|
return {
|
||||||
loading: true,
|
loading: true,
|
||||||
tab: {
|
tab: {
|
||||||
submenu: Categories,
|
submenu: [],
|
||||||
activeMenu: 'host'
|
activeMenu: 'host'
|
||||||
},
|
},
|
||||||
tableConfig: {
|
tableConfig: {
|
||||||
@@ -105,7 +104,7 @@ export default {
|
|||||||
},
|
},
|
||||||
async mounted() {
|
async mounted() {
|
||||||
try {
|
try {
|
||||||
await this.$store.dispatch('assets/getAssetCategories')
|
await this.setCategories()
|
||||||
await this.changeMoreCreates()
|
await this.changeMoreCreates()
|
||||||
} finally {
|
} finally {
|
||||||
this.loading = false
|
this.loading = false
|
||||||
@@ -117,6 +116,15 @@ export default {
|
|||||||
this.headerActions.moreCreates.dropdown = this.$store.state.assets.assetCategoriesDropdown.filter(item => {
|
this.headerActions.moreCreates.dropdown = this.$store.state.assets.assetCategoriesDropdown.filter(item => {
|
||||||
return item.category === this.tab.activeMenu
|
return item.category === this.tab.activeMenu
|
||||||
})
|
})
|
||||||
|
},
|
||||||
|
async setCategories() {
|
||||||
|
const state = await this.$store.dispatch('assets/getAssetCategories')
|
||||||
|
this.tab.submenu = state.assetCategories.map(item => {
|
||||||
|
return {
|
||||||
|
title: item.display_name,
|
||||||
|
name: item.value
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -81,26 +81,3 @@ export const assetFieldsMeta = () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export const Categories = [
|
|
||||||
{
|
|
||||||
title: '主机',
|
|
||||||
name: 'host'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '网络设备',
|
|
||||||
name: 'networking'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '数据库',
|
|
||||||
name: 'database'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '云平台',
|
|
||||||
name: 'cloud'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: 'Web',
|
|
||||||
name: 'web'
|
|
||||||
}
|
|
||||||
]
|
|
||||||
|
Reference in New Issue
Block a user