feat: 添加 CommandFilterAclDetail, CommandGroupDetail 页面

This commit is contained in:
Bai
2022-12-04 20:01:35 +08:00
parent 18150eb8ab
commit d3c297d24f
14 changed files with 265 additions and 41 deletions

View File

@@ -9,6 +9,8 @@
"PleaseClickLeftAssetToViewGatheredUser": "Gathered user list, please click on the assets on the left to view"
},
"acl": {
"IgnoreCase": "Ignore case",
"Content": "Content",
"CommandFilterACL": "Command filter",
"CommandGroup": "Command group",
"name": "Name",

View File

@@ -9,6 +9,8 @@
"PleaseClickLeftAssetToViewGatheredUser": "ユーザーリストを収集し、左側の資産をクリックして表示します。"
},
"acl": {
"IgnoreCase": "大文字小文字を無視する",
"Content": "コンテンツ",
"CommandFilterACL": "命令フィルタリング",
"CommandGroup": "コマンドグループ",
"name": "名前",

View File

@@ -9,6 +9,8 @@
"PleaseClickLeftAssetToViewGatheredUser": "收集用户列表,点击左侧资产进行查看"
},
"acl": {
"IgnoreCase": "忽略大小写",
"Content": "内容",
"CommandFilterACL": "命令过滤",
"CommandGroup": "命令组",
"name": "名称",

View File

@@ -66,7 +66,7 @@ export default [
{
path: ':id',
name: 'AssetAclDetail',
component: () => import('@/views/acl/AssetAcl/AssetAclDetail'),
component: () => import('@/views/acl/AssetAcl/AssetAclDetail/index'),
hidden: true,
meta: { title: i18n.t('route.AssetAclDetail') }
},
@@ -86,7 +86,8 @@ export default [
meta: {
title: i18n.t('route.CommandFilterAclList'),
app: 'acls',
resource: 'commandfilteracl'
resource: 'commandfilteracl',
activeMenu: '/console/perms/cmd-acls'
},
children: [
// Command Filter ACL
@@ -107,7 +108,7 @@ export default [
{
path: ':id',
name: 'CommandFilterAclDetail',
component: () => import('@/views/acl/CommandAcl/CommandFilterAcl/CommandFilterAclDetail'),
component: () => import('@/views/acl/CommandAcl/CommandFilterAcl/CommandFilterAclDetail/index'),
hidden: true,
meta: { title: i18n.t('route.CommandFilterAclDetail') }
},
@@ -127,7 +128,8 @@ export default [
meta: {
title: i18n.t('route.CommandGroupList'),
app: 'acls',
resource: 'commandgroup'
resource: 'commandgroup',
activeMenu: '/console/perms/cmd-acls'
},
hidden: true,
children: [
@@ -135,30 +137,42 @@ export default [
{
path: '',
name: 'CommandGroupList',
component: () => import('@/views/acl/CommandAcl/CommandGroup/CommandGroupList'),
component: () => import('@/views/acl/CommandAcl/index'),
hidden: true,
meta: { title: i18n.t('route.CommandGroupList') }
meta: {
title: i18n.t('route.CommandGroupList'),
activeMenu: '/console/perms/cmd-acls'
}
},
{
path: 'create',
name: 'CommandGroupCreate',
component: () => import('@/views/acl/CommandAcl/CommandGroup/CommandGroupCreateUpdate'),
hidden: true,
meta: { title: i18n.t('route.CommandGroupCreate') }
meta: {
title: i18n.t('route.CommandGroupCreate'),
activeMenu: '/console/perms/cmd-acls'
}
},
{
path: ':id',
name: 'CommandGroupDetail',
component: () => import('@/views/acl/CommandAcl/CommandGroup/CommandGroupDetail'),
component: () => import('@/views/acl/CommandAcl/CommandGroup/CommandGroupDetail/index'),
hidden: true,
meta: { title: i18n.t('route.CommandGroupDetail') }
meta: {
title: i18n.t('route.CommandGroupDetail'),
activeMenu: '/console/perms/cmd-acls'
}
},
{
path: ':id/update',
name: 'CommandGroupUpdate',
component: () => import('@/views/acl/CommandAcl/CommandGroup/CommandGroupCreateUpdate'),
hidden: true,
meta: { title: i18n.t('route.CommandGroupUpdate') }
meta: {
title: i18n.t('route.CommandGroupUpdate'),
activeMenu: '/console/perms/cmd-acls'
}
}
]
}

View File

@@ -46,7 +46,7 @@ export default {
value: this.object.assets.address_group.toString()
},
{
key: this.$t('acl.account_username'),
key: this.$t('acl.AccountUsername'),
value: this.object.accounts.username_group.toString()
},
{

View File

@@ -8,21 +8,21 @@
<script>
import { GenericDetailPage } from '@/layout/components'
import detail from './detail.vue'
import Detail from './Detail.vue'
export default {
components: {
GenericDetailPage,
detail
Detail
},
data() {
return {
TaskDetail: {},
config: {
activeMenu: 'detail',
activeMenu: 'Detail',
submenu: [
{
title: this.$t('acl.RuleDetail'),
name: 'detail'
name: 'Detail'
}
],
hasRightSide: true,

View File

@@ -1,13 +0,0 @@
<template>
<div />
</template>
<script>
export default {
name: 'CommandFilterAclDetail'
}
</script>
<style scoped>
</style>

View File

@@ -0,0 +1,66 @@
<template>
<el-row :gutter="20">
<el-col :md="14" :sm="24">
<DetailCard :items="detailCardItems" />
</el-col>
</el-row>
</template>
<script>
import DetailCard from '@/components/DetailCard'
export default {
name: 'CommandFilterAclDetail',
components: {
DetailCard
},
props: {
object: {
type: Object,
default: () => {}
}
},
data() {
return {
}
},
computed: {
detailCardItems() {
return [
{
key: this.$t('common.Name'),
value: this.object.name
},
{
key: this.$t('acl.UserUsername'),
value: this.object.users.username_group.toString()
},
{
key: this.$t('acl.AssetName'),
value: this.object.assets.name_group.toString()
},
{
key: this.$t('acl.AssetAddress'),
value: this.object.assets.address_group.toString()
},
{
key: this.$t('acl.AccountUsername'),
value: this.object.accounts.username_group.toString()
},
{
key: this.$t('acl.CommandGroup'),
value: this.object.command_groups.map((commandGroup) => { return commandGroup.name }).join(' | ')
},
{
key: this.$t('assets.Comment'),
value: this.object.comment
}
]
}
}
}
</script>
<style scoped>
</style>

View File

@@ -0,0 +1,46 @@
<template>
<GenericDetailPage
:object.sync="CommandFilterAcl"
:active-menu.sync="config.activeMenu"
v-bind="config"
v-on="$listeners"
>
<keep-alive>
<component :is="config.activeMenu" :object="CommandFilterAcl" />
</keep-alive>
</GenericDetailPage>
</template>
<script>
import { GenericDetailPage, TabPage } from '@/layout/components'
import Detail from './Detail.vue'
export default {
components: {
GenericDetailPage,
TabPage,
Detail
},
data() {
return {
CommandFilterAcl: {},
config: {
url: '/api/v1/acls/command-filter-acls',
activeMenu: 'Detail',
submenu: [
{
title: this.$t('common.BasicInfo'),
name: 'Detail'
}
],
actions: {
}
}
}
}
}
</script>
<style scoped>
</style>

View File

@@ -4,6 +4,7 @@
<script>
import { ListTable } from '@/components'
import { DetailFormatter } from '@/components/TableFormatters'
export default {
components: {
@@ -31,6 +32,12 @@ export default {
]
},
columnsMeta: {
name: {
formatter: DetailFormatter,
formatterArgs: {
route: 'CommandFilterAclDetail'
}
},
user_username_group: {
prop: 'users.username_group',
showOverflowTooltip: true,

View File

@@ -1,13 +0,0 @@
<template>
<div />
</template>
<script>
export default {
name: 'CommandGroupDetail'
}
</script>
<style scoped>
</style>

View File

@@ -0,0 +1,58 @@
<template>
<el-row :gutter="20">
<el-col :md="14" :sm="24">
<DetailCard :items="detailCardItems" />
</el-col>
</el-row>
</template>
<script>
import DetailCard from '@/components/DetailCard'
export default {
name: 'CommandGroupDetail',
components: {
DetailCard
},
props: {
object: {
type: Object,
default: () => {}
}
},
data() {
return {
}
},
computed: {
detailCardItems() {
return [
{
key: this.$t('common.Name'),
value: this.object.name
},
{
key: this.$t('assets.Type'),
value: this.object.type.label
},
{
key: this.$t('acl.IgnoreCase'),
value: this.object.ignore_case
},
{
key: this.$t('acl.Content'),
value: this.object.content
},
{
key: this.$t('assets.Comment'),
value: this.object.comment
}
]
}
}
}
</script>
<style scoped>
</style>

View File

@@ -0,0 +1,46 @@
<template>
<GenericDetailPage
:object.sync="CommandGroup"
:active-menu.sync="config.activeMenu"
v-bind="config"
v-on="$listeners"
>
<keep-alive>
<component :is="config.activeMenu" :object="CommandGroup" />
</keep-alive>
</GenericDetailPage>
</template>
<script>
import { GenericDetailPage, TabPage } from '@/layout/components'
import Detail from './Detail.vue'
export default {
components: {
GenericDetailPage,
TabPage,
Detail
},
data() {
return {
CommandGroup: {},
config: {
url: '/api/v1/acls/command-groups',
activeMenu: 'Detail',
submenu: [
{
title: this.$t('common.BasicInfo'),
name: 'Detail'
}
],
actions: {
}
}
}
}
}
</script>
<style scoped>
</style>

View File

@@ -4,6 +4,7 @@
<script>
import { ListTable } from '@/components'
import { DetailFormatter } from '@/components/TableFormatters'
export default {
components: {
@@ -25,6 +26,12 @@ export default {
default: ['name', 'content', 'actions']
},
columnsMeta: {
name: {
formatter: DetailFormatter,
formatterArgs: {
route: 'CommandGroupDetail'
}
},
actions: {
formatterArgs: {
updateRoute: 'CommandGroupUpdate'