From 7f8dd45c213b9e001805972f4eea76a634a17389 Mon Sep 17 00:00:00 2001 From: Bai Date: Fri, 3 Feb 2023 15:00:30 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E8=B5=84=E4=BA=A7?= =?UTF-8?q?=E8=AF=A6=E6=83=85-=E8=B4=A6=E5=8F=B7=E5=88=97=E8=A1=A8-?= =?UTF-8?q?=E6=A8=A1=E7=89=88=E8=B4=A6=E5=8F=B7=E5=88=97=E8=A1=A8=E8=B7=B3?= =?UTF-8?q?=E8=BD=AC=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/i18n/langs/en.json | 4 + src/i18n/langs/ja.json | 6 +- src/i18n/langs/zh.json | 6 +- .../AssetPermission/AssetPermissionList.vue | 98 +++++++------------ src/views/perms/const.js | 43 +++++++- .../UserDetail/UserAssetPermissionRules.vue | 37 +------ 6 files changed, 96 insertions(+), 98 deletions(-) diff --git a/src/i18n/langs/en.json b/src/i18n/langs/en.json index 1ddde5918..e89e61f5e 100644 --- a/src/i18n/langs/en.json +++ b/src/i18n/langs/en.json @@ -787,6 +787,10 @@ "isValid": "Validity", "fromTicket": "From ticket", "isEffective": "Effective", + "NodeSearchStrategy": "Node search Strategy", + "OnlySearchCurrentNodePerm": "Search only for the perms of the current node perms", + "SearchAncestorNodePerm": "Search perms for both current node and ancestor nodes", + "AssetName": "Asset name", "nodeCount": "Node count", "refreshFail": "Refresh fail", "refreshPermissionCache": "Refresh permission cache", diff --git a/src/i18n/langs/ja.json b/src/i18n/langs/ja.json index d5f13e824..791aa3919 100644 --- a/src/i18n/langs/ja.json +++ b/src/i18n/langs/ja.json @@ -790,7 +790,11 @@ "hostName": "ホスト名", "isValid": "有効", "fromTicket": "ワークオーダーから", - "isEffective": "機能する", + "isEffective": "効果的", + "NodeSearchStrategy": "ノード検索戦略", + "OnlySearchCurrentNodePerm": "現在のノードと祖先ノードの両方の権限を検索", + "SearchAncestorNodePerm": "現在のノードの認可のみを検索", + "AssetName": "アセット名", "nodeCount": "ノード数", "refreshFail": "更新に失敗しました", "refreshPermissionCache": "認可キャッシュの更新", diff --git a/src/i18n/langs/zh.json b/src/i18n/langs/zh.json index 4141c6ee7..b9ef76e5a 100644 --- a/src/i18n/langs/zh.json +++ b/src/i18n/langs/zh.json @@ -993,7 +993,11 @@ "hostName": "主机名", "isValid": "有效", "fromTicket": "来自工单", - "isEffective": "起作用的", + "isEffective": "已生效的", + "NodeSearchStrategy": "节点搜索策略", + "SearchAncestorNodePerm": "同时搜索当前节点和祖先节点的授权", + "OnlySearchCurrentNodePerm": "仅搜索当前节点的授权", + "AssetName": "资产名称", "nodeCount": "节点数量", "refreshFail": "刷新失败", "refreshPermissionCache": "刷新授权缓存", diff --git a/src/views/perms/AssetPermission/AssetPermissionList.vue b/src/views/perms/AssetPermission/AssetPermissionList.vue index b0f947a4f..35e3b15c8 100644 --- a/src/views/perms/AssetPermission/AssetPermissionList.vue +++ b/src/views/perms/AssetPermission/AssetPermissionList.vue @@ -18,6 +18,7 @@ import AssetTreeTable from '@/components/AssetTreeTable' import PermBulkUpdateDialog from './components/PermBulkUpdateDialog' import AmountFormatter from '@/components/TableFormatters/AmountFormatter' import { mapGetters } from 'vuex' +import { AssetPermissionListPageSearchConfigOptions } from '../const' export default { components: { @@ -157,66 +158,43 @@ export default { createInNewPage: true, searchConfig: { url: '', - options: [ - { label: this.$t('common.Name'), value: 'name' }, - { - label: this.$t('perms.isValid'), value: 'is_valid', - children: [ - { - value: '1', - label: this.$t('common.Yes') - }, - { - value: '0', - label: this.$t('common.No') - } - ] - }, - { - label: this.$t('perms.fromTicket'), value: 'from_ticket', - children: [ - { - value: '1', - label: this.$t('common.Yes') - }, - { - value: '0', - label: this.$t('common.No') - } - ] - }, - { - label: this.$t('perms.isEffective'), value: 'is_effective', - children: [ - { - value: '1', - label: this.$t('common.Yes') - }, - { - value: '0', - label: this.$t('common.No') - } - ] - }, - { label: this.$t('common.Username'), value: 'username' }, - { label: this.$t('perms.UserGroups'), value: 'user_group' }, - { label: this.$t('perms.IP'), value: 'ip' }, - { label: this.$t('perms.hostName'), value: 'hostname' }, - { label: this.$t('perms.SystemUser'), value: 'system_user' }, - { - label: this.$t('perms.Inherit'), value: 'all', - children: [ - { - value: '1', - label: this.$t('perms.Include') - }, - { - value: '0', - label: this.$t('perms.Exclude') - } - ] - } - ] + options: AssetPermissionListPageSearchConfigOptions + // options: [ + // { label: this.$t('common.Name'), value: 'name' }, + // { label: this.$t('common.Username'), value: 'username' }, + // { label: this.$t('perms.UserGroups'), value: 'user_group' }, + // { label: this.$t('perms.AssetName'), value: 'asset_name' }, + // { label: this.$t('assets.AssetAddress'), value: 'ip' }, + // { label: this.$t('perms.Account'), value: 'accounts' }, + // { + // label: this.$t('perms.NodeSearchStrategy'), value: 'all', + // children: [ + // { value: '0', label: this.$t('perms.OnlySearchCurrentNodePerm') }, + // { value: '1', label: this.$t('perms.SearchAncestorNodePerm') } + // ] + // }, + // { + // label: this.$t('perms.isValid'), value: 'is_valid', + // children: [ + // { value: '1', label: this.$t('common.Yes') }, + // { value: '0', label: this.$t('common.No') } + // ] + // }, + // { + // label: this.$t('perms.isEffective'), value: 'is_effective', + // children: [ + // { value: '1', label: this.$t('common.Yes') }, + // { value: '0', label: this.$t('common.No') } + // ] + // }, + // { + // label: this.$t('perms.fromTicket'), value: 'from_ticket', + // children: [ + // { value: '1', label: this.$t('common.Yes') }, + // { value: '0', label: this.$t('common.No') } + // ] + // } + // ] }, hasBulkUpdate: true, handleBulkUpdate: ({ selectedRows }) => { diff --git a/src/views/perms/const.js b/src/views/perms/const.js index 7bb2501ef..b8feb1562 100644 --- a/src/views/perms/const.js +++ b/src/views/perms/const.js @@ -1 +1,42 @@ -export const remoteApplication = ['chrome', 'mysql_workbench', 'vmware_client', 'custom'] +import i18n from '@/i18n/i18n' + +export const UserAssetPermissionListPageSearchConfigOptions = [ + { label: i18n.t('common.Name'), value: 'name' }, + { label: i18n.t('common.Username'), value: 'username' }, + { label: i18n.t('perms.UserGroups'), value: 'user_group' }, + { label: i18n.t('perms.AssetName'), value: 'asset_name' }, + { label: i18n.t('assets.AssetAddress'), value: 'ip' }, + { label: i18n.t('perms.Account'), value: 'accounts' }, + { + label: i18n.t('perms.isValid'), value: 'is_valid', + children: [ + { value: '1', label: i18n.t('common.Yes') }, + { value: '0', label: i18n.t('common.No') } + ] + }, + { + label: i18n.t('perms.isEffective'), value: 'is_effective', + children: [ + { value: '1', label: i18n.t('common.Yes') }, + { value: '0', label: i18n.t('common.No') } + ] + }, + { + label: i18n.t('perms.fromTicket'), value: 'from_ticket', + children: [ + { value: '1', label: i18n.t('common.Yes') }, + { value: '0', label: i18n.t('common.No') } + ] + } +] + +export const AssetPermissionListPageSearchConfigOptions = [ + ...UserAssetPermissionListPageSearchConfigOptions, + { + label: i18n.t('perms.NodeSearchStrategy'), value: 'all', + children: [ + { value: '0', label: i18n.t('perms.OnlySearchCurrentNodePerm') }, + { value: '1', label: i18n.t('perms.SearchAncestorNodePerm') } + ] + } +] diff --git a/src/views/users/User/UserDetail/UserAssetPermissionRules.vue b/src/views/users/User/UserDetail/UserAssetPermissionRules.vue index 2850c01bf..5bf908f7f 100644 --- a/src/views/users/User/UserDetail/UserAssetPermissionRules.vue +++ b/src/views/users/User/UserDetail/UserAssetPermissionRules.vue @@ -5,6 +5,7 @@