[Update] 增加远程应用列表组件

This commit is contained in:
jym503558564
2020-04-02 16:44:01 +08:00
parent cbfc52adfe
commit 3793c484ec
6 changed files with 128 additions and 8 deletions

View File

@@ -263,7 +263,7 @@ const cn = {
'remote_app_detail': '远程应用详情',
'update_remote_app': '更新远程应用',
'name': '名称',
'app_type': '应用类型',
'appType': '应用类型',
'asset': '资产',
'action': '操作',
'update': '更新',

View File

@@ -175,14 +175,14 @@ export const constantRoutes = [
children: [
{
path: 'remote-apps',
name: 'remoteAppList',
component: () => import('@/views/tree/index'),
name: 'RemoteAppList',
component: () => import('@/views/applications/RemoteAppList'),
meta: { title: 'RemoteApp' }
},
{
path: 'database-apps',
name: 'DatabaseAppList',
component: () => import('@/views/tree/index'),
component: () => import('@/views/applications/DatabaseAppList'),
meta: { title: 'DatabaseApp' }
}
]

View File

@@ -0,0 +1,64 @@
<template>
<GenericListPage :table-config="tableConfig" :header-actions="headerActions" />
</template>
<script>
import { GenericListPage } from '@/layout/components'
import DetailFormatter from '@/components/DataTable/formatters/DetailFormatter'
export default {
components: {
GenericListPage
},
data() {
return {
showTree: true,
tableConfig: {
url: '/api/v1/applications/database-apps/',
columns: [
{
prop: 'name',
label: this.$t('applications.name'),
formatter: DetailFormatter,
sortable: true,
route: 'DatabaseAppDetail'
},
{
prop: 'get_type_display',
label: this.$t('applications.appType')
},
{
prop: 'host',
label: this.$t('applications.host')
},
{
prop: 'port',
label: this.$t('applications.port')
},
{
prop: 'database',
label: this.$t('applications.database')
},
{
prop: 'comment',
label: this.$t('applications.comment')
}
],
tableActions: {
hasEdit: true,
editRoute: '404'
}
},
headerActions: {
hasDelete: false,
hasUpdate: false,
createRoute: 'DatabaseAppCreate'
}
}
}
}
</script>
<style>
</style>

View File

@@ -0,0 +1,56 @@
<template>
<GenericListPage :table-config="tableConfig" :header-actions="headerActions" />
</template>
<script>
import { GenericListPage } from '@/layout/components'
import DetailFormatter from '@/components/DataTable/formatters/DetailFormatter'
export default {
components: {
GenericListPage
},
data() {
return {
showTree: true,
tableConfig: {
url: '/api/v1/applications/remote-apps/',
columns: [
{
prop: 'name',
label: this.$t('applications.name'),
formatter: DetailFormatter,
sortable: true,
route: 'RemoteAppDetail'
},
{
prop: 'get_type_display',
label: this.$t('applications.appType')
},
{
prop: 'asset_info',
label: this.$t('applications.asset')
},
{
prop: 'comment',
label: this.$t('applications.comment')
}
],
tableActions: {
hasEdit: true,
editRoute: '404'
}
},
headerActions: {
hasDelete: false,
hasUpdate: false,
createRoute: 'RemoteAppCreate'
}
}
}
}
</script>
<style>
</style>

View File

@@ -32,7 +32,7 @@ export default {
label: this.$t('assets.systemUser')
},
{
prop: '',
prop: 'comment',
label: this.$t('assets.comment')
}
],

View File

@@ -21,14 +21,14 @@ export default {
label: this.$t('assets.name'),
formatter: DetailFormatter,
sortable: true,
route: 'CommandFilterDetail'
route: 'PlatformDetail'
},
{
prop: 'base',
label: this.$t('assets.BasePlatform')
},
{
prop: '',
prop: 'comment',
label: this.$t('assets.comment')
}
],
@@ -40,7 +40,7 @@ export default {
headerActions: {
hasDelete: false,
hasUpdate: false,
createRoute: 'CommandFilterCreate'
createRoute: 'PlatformCreate'
}
}
}