diff --git a/src/i18n/langs/en.json b/src/i18n/langs/en.json index b65181813..81ece958b 100644 --- a/src/i18n/langs/en.json +++ b/src/i18n/langs/en.json @@ -99,6 +99,8 @@ "NoSQLProtocol": "NoSQL Protocol" }, "assets": { + "sshkeyAccount": "ssh key account", + "passwordAccount": "Password account", "SelectTemplate": "Select template", "InAssetDetail": "Update account information in asset details", "SecretType": "Secret type", diff --git a/src/i18n/langs/ja.json b/src/i18n/langs/ja.json index 958170c13..36a2730c1 100644 --- a/src/i18n/langs/ja.json +++ b/src/i18n/langs/ja.json @@ -104,6 +104,8 @@ "NoSQLProtocol": "非リレーショナルデータベース" }, "assets": { + "sshkeyAccount": "SSHキー", + "passwordAccount": "パスワード", "SelectTemplate": "テンプレートの選択", "InAssetDetail": "資産詳細でのアカウント情報の更新", "SecretType": "機密タイプ", diff --git a/src/i18n/langs/zh.json b/src/i18n/langs/zh.json index 83350d20b..b93d15379 100644 --- a/src/i18n/langs/zh.json +++ b/src/i18n/langs/zh.json @@ -103,6 +103,8 @@ "NoSQLProtocol": "非关系数据库" }, "assets": { + "sshkeyAccount": "密钥账号", + "passwordAccount": "密码账号", "Category": "类别", "AccountDetail": "账号详情", "Accounts": "账号列表", diff --git a/src/views/assets/Domain/DomainDetail/GatewayList.vue b/src/views/assets/Domain/DomainDetail/GatewayList.vue index 070309150..3170f6b17 100644 --- a/src/views/assets/Domain/DomainDetail/GatewayList.vue +++ b/src/views/assets/Domain/DomainDetail/GatewayList.vue @@ -54,7 +54,10 @@ export default { return { tableConfig: { url: `/api/v1/assets/gateways/?domain=${this.$route.params.id}`, - columns: ['name', 'address', 'platform', 'connectivity', 'is_active', 'actions'], + columns: [ + 'name', 'address', 'platform', 'password_account', + 'ssh_key_account', 'connectivity', 'is_active', 'actions' + ], columnsMeta: { name: { sortable: 'custom', @@ -69,6 +72,34 @@ export default { address: { width: '140px' }, + password_account: { + label: this.$t('assets.passwordAccount'), + formatter: function(row) { + const [accountInfo] = row.effective_accounts.filter( + item => item.secret_type === 'password' + ) + if (!accountInfo) return - + const to = { + name: 'AssetAccountDetail', + params: { id: accountInfo.id } + } + return { accountInfo.username } + } + }, + ssh_key_account: { + label: this.$t('assets.sshkeyAccount'), + formatter: function(row) { + const [accountInfo] = row.effective_accounts.filter( + item => item.secret_type === 'ssh_key' + ) + if (!accountInfo) return - + const to = { + name: 'AssetAccountDetail', + params: { id: accountInfo.id } + } + return { accountInfo.username } + } + }, actions: { formatterArgs: { updateRoute: 'GatewayUpdate',