diff --git a/src/components/AccountListTable/index.vue b/src/components/AccountListTable/index.vue index 119959943..15eec5cda 100644 --- a/src/components/AccountListTable/index.vue +++ b/src/components/AccountListTable/index.vue @@ -98,11 +98,24 @@ export default { columnsShow: { min: ['name', 'username', 'actions'], default: [ - 'name', 'hostname', 'ip', 'username', - 'version', 'privileged', 'actions' + 'name', 'username', 'version', 'privileged', 'actions', 'secret_type', 'actions' ] }, columnsMeta: { + name: { + showOverflowTooltip: true, + formatter: function(row) { + const to = { + name: 'AssetAccountDetail', + params: { id: row.id } + } + if (vm.$hasPerm('assets.view_account')) { + return { row.name } + } else { + return { row.name } + } + } + }, asset: { label: this.$t('assets.Asset'), showOverflowTooltip: true, diff --git a/src/components/AssetSelect/index.vue b/src/components/AssetSelect/index.vue index 1838211d3..ca7d4b738 100644 --- a/src/components/AssetSelect/index.vue +++ b/src/components/AssetSelect/index.vue @@ -31,7 +31,7 @@ diff --git a/src/components/AutoDataZTree/index.vue b/src/components/AutoDataZTree/index.vue index f6cfb30fb..d1bcba777 100644 --- a/src/components/AutoDataZTree/index.vue +++ b/src/components/AutoDataZTree/index.vue @@ -128,9 +128,9 @@ export default { query['asset'] = '' url = `${this.setting.url}${combinator}node_id=${objectId}&show_current_asset=${show_current_asset}` } else if (treeNode.meta.type === 'asset') { - query['asset'] = treeNode.meta.data.id + query['asset'] = treeNode.meta.data?.id || treeNode.id query['node'] = '' - url = `${this.setting.url}${combinator}asset_id=${objectId}&show_current_asset=${show_current_asset}` + url = `${this.setting.url}${combinator}asset_id=${query.asset}&show_current_asset=${show_current_asset}` } this.$router.push({ query }) this.$emit('urlChange', url) diff --git a/src/components/TableFormatters/DialogDetailFormatter.vue b/src/components/TableFormatters/DialogDetailFormatter.vue index 099fb2428..db21fc746 100644 --- a/src/components/TableFormatters/DialogDetailFormatter.vue +++ b/src/components/TableFormatters/DialogDetailFormatter.vue @@ -68,7 +68,9 @@ export default { diff --git a/src/i18n/langs/en.json b/src/i18n/langs/en.json index 7b0117f27..0f7a06adf 100644 --- a/src/i18n/langs/en.json +++ b/src/i18n/langs/en.json @@ -104,6 +104,7 @@ }, "assets": { "UserSwitchFrom": "User switch from", + "AssetAddress": "IP/Host", "sshkeyAccount": "ssh key account", "passwordAccount": "Password account", "SelectTemplate": "Select template", @@ -180,6 +181,7 @@ "DomainHelpMessage": "The domain function is added to address the fact that some environments (such as the hybrid cloud) cannot be connected directly by jumping on the gateway server.\nJMS => Domain gateway => Target assets", "FullName": "Full name", "Gateway": "Gateway", + "GatewayList": "Gateway", "GatewayProtocolHelpText": "SSH protocol gateway, support proxy SSH, RDP, VNC", "Hostname": "Hostname", "IP": "IP", @@ -412,7 +414,6 @@ "Push": "Push", "Receivers": "Receivers", "QuickUpdate": "Quick update", - "QuickSelect": "Quick select", "RemoveSuccessMsg": "Remove success", "Reset": "Reset", "Search": "Search", diff --git a/src/i18n/langs/ja.json b/src/i18n/langs/ja.json index 97b20f89c..b343e67da 100644 --- a/src/i18n/langs/ja.json +++ b/src/i18n/langs/ja.json @@ -109,6 +109,7 @@ "NoSQLProtocol": "非リレーショナルデータベース" }, "assets": { + "AssetAddress": "IP/ホスト名", "UserSwitchFrom": "ユーザーは", "sshkeyAccount": "SSHキー", "passwordAccount": "パスワード", diff --git a/src/i18n/langs/zh.json b/src/i18n/langs/zh.json index baa38f0ae..563e796ab 100644 --- a/src/i18n/langs/zh.json +++ b/src/i18n/langs/zh.json @@ -419,6 +419,7 @@ "DateLast3Months": "最近三月", "DateLastMonth": "最近一月", "DateLastWeek": "最近一周", + "DateStart": "开始日期", "Delete": "删除", "Disable": "禁用", "Download": "下载", @@ -493,7 +494,6 @@ "dateCreated": "创建日期", "dateExpired": "失效日期", "dateFinished": "完成日期", - "DateStart": "开始日期", "deleteErrorMsg": "删除失败", "deleteFailedMsg": "删除失败", "deleteSelected": "删除所选", @@ -1675,7 +1675,6 @@ "OpenStack": "OpenStack", "GCP": "谷歌云", "FC": "Fusion Compute", - "LAN": "局域网", "AWS_China": "AWS(中国)", "AWS_Int": "AWS(国际)", "HuaweiCloud": "华为云", diff --git a/src/views/accounts/AssetAccount/AssetAccountDetail/Detail.vue b/src/views/accounts/AssetAccount/AssetAccountDetail/Detail.vue index 9dce77690..de651ac07 100644 --- a/src/views/accounts/AssetAccount/AssetAccountDetail/Detail.vue +++ b/src/views/accounts/AssetAccount/AssetAccountDetail/Detail.vue @@ -33,7 +33,7 @@ export default { return { quickActions: [ { - title: this.$t('assets.PrivilegedTemplate'), + title: this.$t('assets.Privileged'), type: 'switcher', attrs: { model: vm.object.privileged, diff --git a/src/views/accounts/AssetAccount/AssetAccountList.vue b/src/views/accounts/AssetAccount/AssetAccountList.vue index a456b156f..239bd9ac5 100644 --- a/src/views/accounts/AssetAccount/AssetAccountList.vue +++ b/src/views/accounts/AssetAccount/AssetAccountList.vue @@ -45,7 +45,7 @@ export default { url = setUrlParam(url, 'asset', '') url = setUrlParam(url, 'node', nodeId) } else if (treeNode.meta.type === 'asset') { - const assetId = treeNode.meta.data.id + const assetId = treeNode.meta.data?.id || treeNode?.id url = setUrlParam(url, 'node', '') url = setUrlParam(url, 'asset', assetId) } diff --git a/src/views/accounts/ChangeSecreAtutomation/ChangeSecreAtutomationDetail/index.vue b/src/views/accounts/ChangeSecreAtutomation/ChangeSecreAtutomationDetail/index.vue index 419b813b4..ba89c2889 100644 --- a/src/views/accounts/ChangeSecreAtutomation/ChangeSecreAtutomationDetail/index.vue +++ b/src/views/accounts/ChangeSecreAtutomation/ChangeSecreAtutomationDetail/index.vue @@ -23,8 +23,8 @@ export default { return { plan: { name: '', username: '', comment: '' }, config: { - activeMenu: 'ChangeAuthPlanInfo', - url: '/api/v1/assets/change-secret-automations/', + activeMenu: 'ChangeSecreAtutomationInfo', + url: '/api/v1/assets/change-secret-automations', submenu: [ { title: this.$t('common.BasicInfo'), diff --git a/src/views/accounts/ChangeSecreAtutomation/fields.js b/src/views/accounts/ChangeSecreAtutomation/fields.js index 76d4a2ccc..1a79ad646 100644 --- a/src/views/accounts/ChangeSecreAtutomation/fields.js +++ b/src/views/accounts/ChangeSecreAtutomation/fields.js @@ -52,6 +52,11 @@ export const getFields = () => { rules: [ { required: false } ], + el: { + canSelect: (row) => { + return row.enabled_info.change_secret_enabled + } + }, label: i18n.t('xpack.Asset') }, passphrase: { diff --git a/src/views/assets/Asset/AssetList/AllList.vue b/src/views/assets/Asset/AssetList/AllList.vue index 2ddd40dac..8f652f936 100644 --- a/src/views/assets/Asset/AssetList/AllList.vue +++ b/src/views/assets/Asset/AssetList/AllList.vue @@ -98,7 +98,7 @@ export default { url = setUrlParam(url, 'asset', '') url = setUrlParam(url, 'node', nodeId) } else if (treeNode.meta.type === 'asset') { - const assetId = treeNode.meta.data.id + const assetId = treeNode.meta.data?.id || treeNode.id url = setUrlParam(url, 'node', '') url = setUrlParam(url, 'asset', assetId) } diff --git a/src/views/assets/Domain/DomainCreateUpdate.vue b/src/views/assets/Domain/DomainCreateUpdate.vue index 3a460763b..4a3fac94e 100644 --- a/src/views/assets/Domain/DomainCreateUpdate.vue +++ b/src/views/assets/Domain/DomainCreateUpdate.vue @@ -23,7 +23,10 @@ export default { component: AssetSelect, label: this.$t('assets.Assets'), el: { - value: [] + value: [], + canSelect: (row) => { + return row.enabled_info.domain_enabled + } } } }, diff --git a/src/views/assets/Domain/DomainDetail/GatewayList.vue b/src/views/assets/Domain/DomainDetail/GatewayList.vue index 3170f6b17..f22cd95c0 100644 --- a/src/views/assets/Domain/DomainDetail/GatewayList.vue +++ b/src/views/assets/Domain/DomainDetail/GatewayList.vue @@ -55,8 +55,7 @@ export default { tableConfig: { url: `/api/v1/assets/gateways/?domain=${this.$route.params.id}`, columns: [ - 'name', 'address', 'platform', 'password_account', - 'ssh_key_account', 'connectivity', 'is_active', 'actions' + 'name', 'address', 'platform', 'connectivity', 'is_active', 'actions' ], columnsMeta: { name: { @@ -72,34 +71,6 @@ 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', diff --git a/src/views/assets/Domain/DomainDetail/index.vue b/src/views/assets/Domain/DomainDetail/index.vue index e25168b52..2a1d0ba78 100644 --- a/src/views/assets/Domain/DomainDetail/index.vue +++ b/src/views/assets/Domain/DomainDetail/index.vue @@ -28,7 +28,7 @@ export default { name: 'Detail' }, { - title: this.$t('assets.Gateway'), + title: this.$t('assets.GatewayList'), name: 'GatewayList', hidden: () => !this.$hasPerm('assets.view_gateway') } diff --git a/src/views/assets/Domain/DomainList.vue b/src/views/assets/Domain/DomainList.vue index 2239ff394..cf03c83c9 100644 --- a/src/views/assets/Domain/DomainList.vue +++ b/src/views/assets/Domain/DomainList.vue @@ -15,27 +15,32 @@ export default { tableConfig: { url: '/api/v1/assets/domains/', columns: [ - 'name', 'asset_count', 'application_count', 'gateway_count', 'date_created', - 'comment', 'org_name', 'actions' + 'name', 'asset_count', 'gateway_count', 'comment', + 'date_created', 'org_name', 'actions' ], columnsShow: { min: ['name', 'actions'], - default: ['name', 'asset_count', 'application_count', 'gateway_count', 'comment', 'actions'] + default: ['name', 'asset_count', 'gateway_count', 'comment', 'actions'] }, columnsMeta: { asset_count: { - label: this.$t('assets.Assets') - }, - application_count: { - label: this.$t('assets.Applications') + prop: 'assets', + label: this.$t('assets.Assets'), + formatter: function(row) { + return { row.assets.length } + } }, gateway_count: { + prop: 'gateways', label: this.$t('assets.Gateway'), formatter: DetailFormatter, formatterArgs: { permissions: 'assets.view_gateway', routeQuery: { activeTab: 'GatewayList' + }, + getTitle: function({ cellValue }) { + return cellValue.length } } } diff --git a/src/views/dashboard/Audit/DataSummary.vue b/src/views/dashboard/Audit/DataSummary.vue index 1eb831891..c12980152 100644 --- a/src/views/dashboard/Audit/DataSummary.vue +++ b/src/views/dashboard/Audit/DataSummary.vue @@ -1,10 +1,24 @@ @@ -62,17 +76,22 @@ export default { &total_count_commands=1 &total_count_commands_danger=1 `) + const logActive = data.total_count_user_login_success_logs === 0 ? 0 : ((data.total_count_user_login_success_logs / data.total_count_user_login_logs) * 100).toFixed(0) + const logTotal = logActive === 100 ? 0 : 100 - logActive const logs = [ - { name: this.$t('dashboard.ActiveUser'), value: data.total_count_user_login_logs }, - { name: this.$t('dashboard.InActiveUser'), value: data.total_count_user_login_success_logs } + { name: this.$t('dashboard.ActiveUser'), value: logActive }, + { name: this.$t('dashboard.InActiveUser'), value: logTotal } ] this.$set(this.logConfig, 'data', logs) this.$set(this.logConfig, 'total', data.total_count_user_login_logs) this.$set(this.logConfig, 'active', data.total_count_user_login_success_logs) this.$set(this.logConfig, 'weekAdd', data.total_count_user_login_success_logs) + + const assetActive = data.total_count_commands_danger === 0 ? 0 : ((data.total_count_commands_danger / data.total_count_commands) * 100).toFixed(0) + const assetTotal = assetActive === 100 ? 0 : 100 - assetActive const assets = [ - { name: this.$t('dashboard.ActiveAsset'), value: data.total_count_commands }, - { name: this.$t('dashboard.InActiveAsset'), value: data.total_count_commands_danger } + { name: this.$t('dashboard.ActiveAsset'), value: assetActive }, + { name: this.$t('dashboard.InActiveAsset'), value: assetTotal } ] this.$set(this.assetConfig, 'data', assets) this.$set(this.assetConfig, 'total', data.total_count_commands) diff --git a/src/views/dashboard/Audit/RightSummary.vue b/src/views/dashboard/Audit/RightSummary.vue index ae9a9d28c..ca6037f81 100644 --- a/src/views/dashboard/Audit/RightSummary.vue +++ b/src/views/dashboard/Audit/RightSummary.vue @@ -6,7 +6,7 @@ - + @@ -33,6 +33,10 @@ export default { title: this.$t('dashboard.SessionTrend'), tip: this.$t('dashboard.SessionTrend') }, + chartTitleConfig: { + title: this.$t('route.BatchCommand'), + tip: this.$t('route.BatchCommand') + }, chartConfig: { datesMetrics: [], secondaryName: this.$t('dashboard.IndexName'), diff --git a/src/views/dashboard/Console/DataSummary.vue b/src/views/dashboard/Console/DataSummary.vue index e48f3e303..2a0a065a0 100644 --- a/src/views/dashboard/Console/DataSummary.vue +++ b/src/views/dashboard/Console/DataSummary.vue @@ -51,22 +51,27 @@ export default { async init() { const data = await this.$axios.get(`/api/v1/index/?total_count_users=1 &total_count_users_this_week=1 - &total_count_today_login_users=1 + &total_count_login_users=1 &total_count_assets=1 &total_count_assets_this_week=1 &total_count_today_active_assets=1 `) + const userActive = data.total_count_login_users === 0 ? 0 : ((data.total_count_login_users / data.total_count_users) * 100).toFixed(0) + const userTotal = userActive === 100 ? 0 : 100 - userActive const users = [ - { name: this.$t('dashboard.ActiveUser'), value: data.total_count_users }, - { name: this.$t('dashboard.InActiveUser'), value: data.total_count_today_login_users } + { name: this.$t('dashboard.ActiveUser'), value: userActive }, + { name: this.$t('dashboard.InActiveUser'), value: userTotal } ] this.$set(this.userConfig, 'data', users) this.$set(this.userConfig, 'total', data.total_count_users) - this.$set(this.userConfig, 'active', data.total_count_today_login_users) + this.$set(this.userConfig, 'active', data.total_count_login_users) this.$set(this.userConfig, 'weekAdd', data.total_count_users_this_week) + + const assetActive = data.total_count_today_active_assets === 0 ? 0 : ((data.total_count_today_active_assets / data.total_count_assets) * 100).toFixed(0) + const assetTotal = assetActive === 100 ? 0 : 100 - assetActive const assets = [ - { name: this.$t('dashboard.ActiveAsset'), value: data.total_count_assets }, - { name: this.$t('dashboard.InActiveAsset'), value: data.total_count_today_active_assets } + { name: this.$t('dashboard.ActiveAsset'), value: assetActive }, + { name: this.$t('dashboard.InActiveAsset'), value: assetTotal } ] this.$set(this.assetConfig, 'data', assets) this.$set(this.assetConfig, 'total', data.total_count_assets) diff --git a/src/views/dashboard/components/DataCard.vue b/src/views/dashboard/components/DataCard.vue index c6d015b58..648daa42c 100644 --- a/src/views/dashboard/components/DataCard.vue +++ b/src/views/dashboard/components/DataCard.vue @@ -1,20 +1,22 @@