From 833e44024f047243cf9421e219cc0b3b3d09c692 Mon Sep 17 00:00:00 2001 From: ibuler Date: Thu, 12 Sep 2024 11:33:33 +0800 Subject: [PATCH 001/216] perf: change pkg deps --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index a3c730c84..a8e19d7e5 100644 --- a/package.json +++ b/package.json @@ -120,7 +120,7 @@ "serve-static": "^1.13.2", "strip-ansi": "^7.1.0", "svg-sprite-loader": "4.1.3", - "svgo": "1.2.2", + "svgo": "1.2.4", "vue-i18n-extract": "^1.1.1", "vue-template-compiler": "2.6.10" }, From 77a0100add615409de4f04fd4d31615e331b08ac Mon Sep 17 00:00:00 2001 From: ibuler Date: Thu, 12 Sep 2024 18:56:34 +0800 Subject: [PATCH 002/216] perf: add pam panel --- src/icons/svg/pam.svg | 8 + .../components/NavHeader/ViewSwitcher.vue | 1 + src/router/index.js | 2 + src/router/pam/automations.js | 318 ++++++++++++++++++ src/router/pam/index.js | 80 +++++ src/router/pam/security.js | 86 +++++ src/router/pam/service.js | 86 +++++ src/views/pam/Account/AccountList.vue | 133 ++++++++ 8 files changed, 714 insertions(+) create mode 100644 src/icons/svg/pam.svg create mode 100644 src/router/pam/automations.js create mode 100644 src/router/pam/index.js create mode 100644 src/router/pam/security.js create mode 100644 src/router/pam/service.js create mode 100644 src/views/pam/Account/AccountList.vue diff --git a/src/icons/svg/pam.svg b/src/icons/svg/pam.svg new file mode 100644 index 000000000..bf5a18065 --- /dev/null +++ b/src/icons/svg/pam.svg @@ -0,0 +1,8 @@ + + + + + diff --git a/src/layout/components/NavHeader/ViewSwitcher.vue b/src/layout/components/NavHeader/ViewSwitcher.vue index a1f44c5f6..7b0577384 100644 --- a/src/layout/components/NavHeader/ViewSwitcher.vue +++ b/src/layout/components/NavHeader/ViewSwitcher.vue @@ -115,6 +115,7 @@ export default { this.tipHasRead = '1' this.iShowTip = false } + console.log('Route to: ', routeName) this.$router.push(routeName) this.$emit('view-change', routeName) } diff --git a/src/router/index.js b/src/router/index.js index 2e7f255db..ce5bce788 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -32,6 +32,7 @@ import workbenchViewRoutes from './workbench' import ticketsRoutes from './tickets' import settingsRoutes from './settings' import profileRoutes from './profile' +import pamViewRoutes from './pam' import { getPropView } from '@/utils/jms' import store from '@/store' @@ -92,6 +93,7 @@ export const viewRoutes = [ consoleViewRoutes, auditViewRoutes, workbenchViewRoutes, + pamViewRoutes, ticketsRoutes, settingsRoutes, profileRoutes diff --git a/src/router/pam/automations.js b/src/router/pam/automations.js new file mode 100644 index 000000000..7fa60d7b1 --- /dev/null +++ b/src/router/pam/automations.js @@ -0,0 +1,318 @@ +import empty from '@/layout/empty.vue' +import i18n from '@/i18n/i18n' + +export default [ + { + path: 'account-gather', + component: empty, + redirect: { + name: 'AccountGatherList' + }, + name: 'AccountGather', + meta: { + title: i18n.t('AccountGatherList'), + app: 'accounts', + icon: 'client' + // activeMenu: '/console/accounts/automations', + }, + children: [ + { + path: '', + component: () => import('@/views/accounts/AccountGather/index.vue'), + name: 'AccountGatherList', + meta: { + menuTitle: i18n.t('GatherAccounts'), + title: i18n.t('AccountGatherTaskList'), + // activeMenu: '/console/accounts/automations', + permissions: ['accounts.view_gatheredaccount'] + } + }, + { + path: 'create', + component: () => import('@/views/accounts/AccountGather/TaskCreateUpdate'), + name: 'AccountGatherTaskCreate', + hidden: true, + meta: { + title: i18n.t('AccountGatherTaskCreate'), + // activeMenu: '/console/accounts/automations', + permissions: ['accounts.add_gatheraccountsautomation'] + } + }, + { + path: ':id', + component: () => import('@/views/accounts/AccountGather/TaskDetail/index'), + name: 'AccountGatherTaskDetail', + hidden: true, + meta: { + title: i18n.t('AccountGatherTaskDetail'), + // activeMenu: '/console/accounts/automations', + permissions: ['accounts.view_gatheraccountsautomation'] + } + }, + { + path: ':id/update', + component: () => import('@/views/accounts/AccountGather/TaskCreateUpdate'), + name: 'AccountGatherTaskUpdate', + hidden: true, + meta: { + title: i18n.t('AccountGatherTaskUpdate'), + action: 'update', + permissions: ['accounts.change_gatheraccountsautomation'], + activeMenu: '/accounts/account-gather' + } + }, + { + path: 'executions', + component: () => import('@/views/accounts/AccountGather/TaskDetail/TaskExecutionList.vue'), + name: 'AccountGatherTaskExecutionList', + hidden: true, + meta: { + title: i18n.t('ExecutionList'), + // activeMenu: '/console/accounts/automations', + permissions: ['accounts.view_gatheraccountsexecution'] + } + }, + { + path: 'executions/:id', + component: () => import('@/views/accounts/AccountGather/TaskDetail/AccountGatherExecutionDetail/index.vue'), + name: 'AccountGatherExecutionDetail', + hidden: true, + meta: { + title: i18n.t('ExecutionDetail'), + // activeMenu: '/console/accounts/automations', + permissions: ['accounts.view_gatheraccountsexecution'] + } + } + ] + }, + { + path: 'account-push', + name: 'AccountRisk', + component: empty, + redirect: { + name: 'AccountPushList' + }, + meta: { + app: 'accounts', + name: 'BaseAccountPushList', + icon: 'accounts', + resource: 'pushaccountautomation' + }, + children: [ + { + path: '', + component: () => import('@/views/accounts/AccountPush/index.vue'), + name: 'AccountPushList', + meta: { + title: i18n.t('AccountPushList'), + menuTitle: i18n.t('AccountPushList'), + permissions: ['accounts.view_pushaccountautomation'] + } + }, + { + path: 'create', + component: () => import('@/views/accounts/AccountPush/AccountPushCreateUpdate.vue'), + name: 'AccountPushCreate', + hidden: true, + meta: { + title: i18n.t('AccountPushCreate'), + // activeMenu: '/console/accounts/automations', + permissions: ['accounts.add_pushaccountautomation'] + } + }, + { + path: ':id/update', + component: () => import('@/views/accounts/AccountPush/AccountPushCreateUpdate.vue'), + name: 'AccountPushUpdate', + hidden: true, + meta: { + title: i18n.t('AccountPushUpdate'), + // activeMenu: '/console/accounts/automations', + permissions: ['accounts.change_pushaccountautomation'] + } + }, + { + path: ':id', + component: () => import('@/views/accounts/AccountPush/AccountPushDetail/index.vue'), + name: 'AccountPushDetail', + hidden: true, + meta: { + title: i18n.t('AccountPushList'), + // activeMenu: '/console/accounts/automations', + permissions: ['accounts.view_pushaccountautomation'] + } + }, + { + path: 'executions', + component: () => import('@/views/accounts/AccountPush/AccountPushExecutionList.vue'), + name: 'AccountPushExecutionList', + hidden: true, + meta: { + title: i18n.t('ExecutionList'), + // activeMenu: '/console/accounts/automations', + permissions: ['accounts.view_pushaccountexecution'] + } + }, + { + path: 'executions/:id', + component: () => import('@/views/accounts/AccountPush/AccountPushExecutionDetail/index.vue'), + name: 'AccountPushExecutionDetail', + hidden: true, + meta: { + title: i18n.t('ExecutionDetail'), + // activeMenu: '/console/accounts/automations', + permissions: ['accounts.view_pushaccountexecution'] + } + } + ] + }, + { + path: 'account-change-secret', + name: 'AccountChangeSecret', + component: empty, + redirect: { + name: 'AccountChangeSecretList' + }, + meta: { + title: i18n.t('BaseAccountChangeSecret'), + icon: 'basic', + app: 'accounts' + }, + children: [ + { + path: '', + component: () => import('@/views/accounts/AccountChangeSecret/index.vue'), + name: 'AccountChangeSecretList', + meta: { + menuTitle: i18n.t('ChangeCredentials'), + title: i18n.t('AccountChangeSecret'), + permissions: ['accounts.view_changesecretautomation'] + } + }, + { + path: 'create', + component: () => import('@/views/accounts/AccountChangeSecret/AccountChangeSecretCreateUpdate.vue'), + name: 'AccountChangeSecretCreate', + hidden: true, + meta: { + title: i18n.t('AssetChangeSecretCreate'), + permissions: ['accounts.add_changesecretautomation'] + } + }, + { + path: ':id/update', + component: () => import('@/views/accounts/AccountChangeSecret/AccountChangeSecretCreateUpdate.vue'), + name: 'AccountChangeSecretUpdate', + hidden: true, + meta: { + title: i18n.t('AssetChangeSecretUpdate'), + permissions: ['accounts.change_changesecretautomation'] + } + }, + { + path: ':id', + component: () => import('@/views/accounts/AccountChangeSecret/AccountChangeSecretDetail/index.vue'), + name: 'AccountChangeSecretDetail', + hidden: true, + meta: { + title: i18n.t('AccountChangeSecret'), + permissions: ['accounts.view_changesecretautomation'] + } + }, + { + path: 'executions', + component: () => import('@/views/accounts/AccountChangeSecret/AccountChangeSecretDetail/AccountChangeSecretExecution/AccountChangeSecretExecutionList.vue'), + name: 'AccountChangeSecretExecutionList', + hidden: true, + meta: { + title: i18n.t('ExecutionList'), + permissions: ['accounts.view_changesecretexecution'] + } + }, + { + path: 'executions/:id', + component: () => import('@/views/accounts/AccountChangeSecret/AccountChangeSecretDetail/AccountChangeSecretExecution/AccountChangeSecretExecutionDetail/index.vue'), + name: 'AccountChangeSecretExecutionDetail', + hidden: true, + meta: { + title: i18n.t('ExecutionDetail'), + permissions: ['accounts.view_changesecretexecution'] + } + } + ] + }, + { + path: 'account-backup', + component: empty, + name: 'AccountBackup', + redirect: { + name: 'AccountBackupList' + }, + meta: { + title: i18n.t('AccountBackup'), + app: 'accounts', + icon: 'clean', + resource: 'accountbackupautomation' + }, + children: [ + { + path: '', + component: () => import('@/views/accounts/AccountBackup/index.vue'), + name: 'AccountBackupList', + meta: { + menuTitle: i18n.t('AccountBackup'), + title: i18n.t('AccountBackupList'), + // activeMenu: '/console/accounts/automations', + permissions: ['accounts.view_accountbackupautomation'] + } + }, + { + path: 'create', + component: () => import('@/views/accounts/AccountBackup/AccountBackupCreateUpdate.vue'), + name: 'AccountBackupCreate', + meta: { + title: i18n.t('AccountBackupCreate'), + // activeMenu: '/console/accounts/automations', + action: 'create' + }, + hidden: true + }, + { + path: ':id/update', + component: () => import('@/views/accounts/AccountBackup/AccountBackupCreateUpdate.vue'), + name: 'AccountBackupUpdate', + meta: { + title: i18n.t('AccountBackupUpdate'), + // activeMenu: '/console/accounts/automations', + action: 'update' + }, + hidden: true + }, + { + path: ':id', + component: () => import('@/views/accounts/AccountBackup/AccountBackupDetail/index.vue'), + name: 'AccountBackupDetail', + // activeMenu: '/console/accounts/automations', + meta: { + title: i18n.t('AccountBackupDetail'), + activeMenu: '/console/accounts/automations' + }, + hidden: true + }, + { + path: 'executions', + component: () => import('@/views/accounts/AccountBackup/AccountBackupDetail/AccountBackupExecution/AccountBackupExecutionList.vue'), + name: 'AccountBackupExecutionList', + meta: { title: i18n.t('ExecutionDetail') }, + hidden: true + }, + { + path: 'executions/:id', + component: () => import('@/views/accounts/AccountBackup/AccountBackupDetail/AccountBackupExecution/AccountBackupExecutionDetail/index.vue'), + name: 'AccountBackupExecutionDetail', + meta: { title: i18n.t('ExecutionDetail') }, + hidden: true + } + ] + } +] diff --git a/src/router/pam/index.js b/src/router/pam/index.js new file mode 100644 index 000000000..5f3f2597c --- /dev/null +++ b/src/router/pam/index.js @@ -0,0 +1,80 @@ +import Layout from '@/layout' +import i18n from '@/i18n/i18n' + +import empty from '@/layout/empty' +import store from '@/store' +import automations from './automations' +import services from './service' +import security from './security' + +export default { + path: '/pam/', + name: 'pam', + component: Layout, + redirect: '/pam/dashboard', + meta: { + title: i18n.t('PAM'), + icon: 'pam', + type: 'view', + showNavSwitcher: () => { + return store.getters.consoleOrgs.length > 0 + }, + permissions: [], + view: 'pam' + }, + children: [ + { + path: '/pam/dashboard', + component: () => import('@/views/dashboard/Audit/index'), + name: 'PamDashboard', + meta: { + icon: 'dashboard', + title: i18n.t('Dashboard'), + permissions: [] + } + }, + { + path: '/pam/accounts', + name: 'PamAccounts', + component: () => import('@/views/pam/Account/AccountList.vue'), + meta: { + title: i18n.t('Accounts'), + icon: 'accounts', + permissions: [] + } + }, + { + path: '/pam/automations', + name: 'AccountAutomation', + component: empty, + // redirect: '/audit/sessions/sessions', + meta: { + title: i18n.t('Automation'), + icon: 'accounts', + permissions: [] + }, + children: automations + }, + { + path: '/pam/security', + name: 'AccountSecurity', + component: empty, + meta: { + title: i18n.t('Security'), + icon: 'accounts', + permissions: [] + }, + children: security + }, + { + path: '/pam/services', + name: 'AccountService', + meta: { + title: i18n.t('Service'), + icon: 'accounts', + permissions: [] + }, + children: services + } + ] +} diff --git a/src/router/pam/security.js b/src/router/pam/security.js new file mode 100644 index 000000000..20b5d465f --- /dev/null +++ b/src/router/pam/security.js @@ -0,0 +1,86 @@ +import empty from '@/layout/empty.vue' +import i18n from '@/i18n/i18n' + +export default [ + { + path: 'risk', + name: 'AccountRisk', + component: empty, + redirect: { + name: 'AccountPushList' + }, + meta: { + app: 'accounts', + name: 'BaseAccountRisk', + icon: 'accounts', + resource: 'pushaccountautomation' + }, + children: [ + { + path: '', + component: () => import('@/views/accounts/AccountPush/index.vue'), + name: 'AccountPushList', + meta: { + title: i18n.t('风险扫描'), + menuTitle: i18n.t('风险扫描'), + permissions: ['accounts.view_pushaccountautomation'] + } + }, + { + path: 'create', + component: () => import('@/views/accounts/AccountPush/AccountPushCreateUpdate.vue'), + name: 'AccountPushCreate', + hidden: true, + meta: { + title: i18n.t('AccountPushCreate'), + // activeMenu: '/console/accounts/automations', + permissions: ['accounts.add_pushaccountautomation'] + } + }, + { + path: ':id/update', + component: () => import('@/views/accounts/AccountPush/AccountPushCreateUpdate.vue'), + name: 'AccountPushUpdate', + hidden: true, + meta: { + title: i18n.t('AccountPushUpdate'), + // activeMenu: '/console/accounts/automations', + permissions: ['accounts.change_pushaccountautomation'] + } + }, + { + path: ':id', + component: () => import('@/views/accounts/AccountPush/AccountPushDetail/index.vue'), + name: 'AccountPushDetail', + hidden: true, + meta: { + title: i18n.t('AccountPushList'), + // activeMenu: '/console/accounts/automations', + permissions: ['accounts.view_pushaccountautomation'] + } + }, + { + path: 'executions', + component: () => import('@/views/accounts/AccountPush/AccountPushExecutionList.vue'), + name: 'AccountPushExecutionList', + hidden: true, + meta: { + title: i18n.t('ExecutionList'), + // activeMenu: '/console/accounts/automations', + permissions: ['accounts.view_pushaccountexecution'] + } + }, + { + path: 'executions/:id', + component: () => import('@/views/accounts/AccountPush/AccountPushExecutionDetail/index.vue'), + name: 'AccountPushExecutionDetail', + hidden: true, + meta: { + title: i18n.t('ExecutionDetail'), + // activeMenu: '/console/accounts/automations', + permissions: ['accounts.view_pushaccountexecution'] + } + } + ] + } +] diff --git a/src/router/pam/service.js b/src/router/pam/service.js new file mode 100644 index 000000000..1c965dbac --- /dev/null +++ b/src/router/pam/service.js @@ -0,0 +1,86 @@ +import empty from '@/layout/empty.vue' +import i18n from '@/i18n/i18n' + +export default [ + { + path: 'service', + name: 'AccountService', + component: empty, + redirect: { + name: 'AccountServiceList' + }, + meta: { + app: 'accounts', + name: 'AccountService', + icon: 'accounts', + resource: 'pushaccountautomation' + }, + children: [ + { + path: '', + component: () => import('@/views/accounts/AccountPush/index.vue'), + name: 'AccountServiceList', + meta: { + title: i18n.t('服务对接'), + menuTitle: i18n.t('服务对接'), + permissions: ['accounts.view_pushaccountautomation'] + } + }, + { + path: 'create', + component: () => import('@/views/accounts/AccountPush/AccountPushCreateUpdate.vue'), + name: 'AccountPushCreate', + hidden: true, + meta: { + title: i18n.t('AccountPushCreate'), + // activeMenu: '/console/accounts/automations', + permissions: ['accounts.add_pushaccountautomation'] + } + }, + { + path: ':id/update', + component: () => import('@/views/accounts/AccountPush/AccountPushCreateUpdate.vue'), + name: 'AccountPushUpdate', + hidden: true, + meta: { + title: i18n.t('AccountPushUpdate'), + // activeMenu: '/console/accounts/automations', + permissions: ['accounts.change_pushaccountautomation'] + } + }, + { + path: ':id', + component: () => import('@/views/accounts/AccountPush/AccountPushDetail/index.vue'), + name: 'AccountPushDetail', + hidden: true, + meta: { + title: i18n.t('AccountPushList'), + // activeMenu: '/console/accounts/automations', + permissions: ['accounts.view_pushaccountautomation'] + } + }, + { + path: 'executions', + component: () => import('@/views/accounts/AccountPush/AccountPushExecutionList.vue'), + name: 'AccountPushExecutionList', + hidden: true, + meta: { + title: i18n.t('ExecutionList'), + // activeMenu: '/console/accounts/automations', + permissions: ['accounts.view_pushaccountexecution'] + } + }, + { + path: 'executions/:id', + component: () => import('@/views/accounts/AccountPush/AccountPushExecutionDetail/index.vue'), + name: 'AccountPushExecutionDetail', + hidden: true, + meta: { + title: i18n.t('ExecutionDetail'), + // activeMenu: '/console/accounts/automations', + permissions: ['accounts.view_pushaccountexecution'] + } + } + ] + } +] diff --git a/src/views/pam/Account/AccountList.vue b/src/views/pam/Account/AccountList.vue new file mode 100644 index 000000000..f09eb182e --- /dev/null +++ b/src/views/pam/Account/AccountList.vue @@ -0,0 +1,133 @@ + + + + + From 1477712c78b2aa8928587618cc65ef34c8dcc3a3 Mon Sep 17 00:00:00 2001 From: ibuler Date: Thu, 19 Sep 2024 09:57:54 +0800 Subject: [PATCH 003/216] =?UTF-8?q?perf:=20=E4=BF=AE=E6=94=B9=20Pam?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/router/pam/activity.js | 54 +++++ src/router/pam/automations.js | 81 -------- src/router/pam/index.js | 20 +- src/router/pam/security.js | 85 +++----- .../AccountScan/AccountPushCreateUpdate.vue | 164 +++++++++++++++ .../AccountPushDetail/AccountPushInfo.vue | 96 +++++++++ .../AccountScan/AccountPushDetail/index.vue | 40 ++++ .../AccountPushExecutionInfo.vue | 55 +++++ .../AccountPushExecutionTaskList.vue | 194 ++++++++++++++++++ .../AccountPushExecutionDetail/index.vue | 57 +++++ .../AccountScan/AccountPushExecutionList.vue | 135 ++++++++++++ src/views/pam/AccountScan/AccountPushList.vue | 118 +++++++++++ src/views/pam/AccountScan/index.vue | 41 ++++ 13 files changed, 996 insertions(+), 144 deletions(-) create mode 100644 src/router/pam/activity.js create mode 100644 src/views/pam/AccountScan/AccountPushCreateUpdate.vue create mode 100644 src/views/pam/AccountScan/AccountPushDetail/AccountPushInfo.vue create mode 100644 src/views/pam/AccountScan/AccountPushDetail/index.vue create mode 100644 src/views/pam/AccountScan/AccountPushExecutionDetail/AccountPushExecutionInfo.vue create mode 100644 src/views/pam/AccountScan/AccountPushExecutionDetail/AccountPushExecutionTaskList.vue create mode 100644 src/views/pam/AccountScan/AccountPushExecutionDetail/index.vue create mode 100644 src/views/pam/AccountScan/AccountPushExecutionList.vue create mode 100644 src/views/pam/AccountScan/AccountPushList.vue create mode 100644 src/views/pam/AccountScan/index.vue diff --git a/src/router/pam/activity.js b/src/router/pam/activity.js new file mode 100644 index 000000000..10c26163f --- /dev/null +++ b/src/router/pam/activity.js @@ -0,0 +1,54 @@ +import empty from '@/layout/empty.vue' +import i18n from '@/i18n/i18n' + +export default [ + { + path: 'session', + name: 'AccountSession', + component: empty, + meta: { + app: 'accounts', + name: 'BaseAccountSession', + icon: 'accounts', + resource: 'pushaccountautomation' + }, + children: [ + { + path: '', + component: () => import('@/views/pam/AccountScan/index.vue'), + name: 'AccountPushList', + meta: { + title: i18n.t('账号会话'), + menuTitle: i18n.t('账号会话'), + permissions: ['accounts.view_pushaccountautomation'] + } + } + ] + }, + { + path: 'activity', + name: 'AccountActivity', + component: empty, + redirect: { + name: 'AccountPushList' + }, + meta: { + app: 'accounts', + name: 'BaseAccountRisk', + icon: 'accounts', + resource: 'pushaccountautomation' + }, + children: [ + { + path: '', + component: () => import('@/views/accounts/AccountPush/index.vue'), + name: 'AccountPushList', + meta: { + title: i18n.t('活动记录'), + menuTitle: i18n.t('活动记录'), + permissions: ['accounts.view_pushaccountautomation'] + } + } + ] + } +] diff --git a/src/router/pam/automations.js b/src/router/pam/automations.js index 7fa60d7b1..21675997e 100644 --- a/src/router/pam/automations.js +++ b/src/router/pam/automations.js @@ -85,87 +85,6 @@ export default [ } ] }, - { - path: 'account-push', - name: 'AccountRisk', - component: empty, - redirect: { - name: 'AccountPushList' - }, - meta: { - app: 'accounts', - name: 'BaseAccountPushList', - icon: 'accounts', - resource: 'pushaccountautomation' - }, - children: [ - { - path: '', - component: () => import('@/views/accounts/AccountPush/index.vue'), - name: 'AccountPushList', - meta: { - title: i18n.t('AccountPushList'), - menuTitle: i18n.t('AccountPushList'), - permissions: ['accounts.view_pushaccountautomation'] - } - }, - { - path: 'create', - component: () => import('@/views/accounts/AccountPush/AccountPushCreateUpdate.vue'), - name: 'AccountPushCreate', - hidden: true, - meta: { - title: i18n.t('AccountPushCreate'), - // activeMenu: '/console/accounts/automations', - permissions: ['accounts.add_pushaccountautomation'] - } - }, - { - path: ':id/update', - component: () => import('@/views/accounts/AccountPush/AccountPushCreateUpdate.vue'), - name: 'AccountPushUpdate', - hidden: true, - meta: { - title: i18n.t('AccountPushUpdate'), - // activeMenu: '/console/accounts/automations', - permissions: ['accounts.change_pushaccountautomation'] - } - }, - { - path: ':id', - component: () => import('@/views/accounts/AccountPush/AccountPushDetail/index.vue'), - name: 'AccountPushDetail', - hidden: true, - meta: { - title: i18n.t('AccountPushList'), - // activeMenu: '/console/accounts/automations', - permissions: ['accounts.view_pushaccountautomation'] - } - }, - { - path: 'executions', - component: () => import('@/views/accounts/AccountPush/AccountPushExecutionList.vue'), - name: 'AccountPushExecutionList', - hidden: true, - meta: { - title: i18n.t('ExecutionList'), - // activeMenu: '/console/accounts/automations', - permissions: ['accounts.view_pushaccountexecution'] - } - }, - { - path: 'executions/:id', - component: () => import('@/views/accounts/AccountPush/AccountPushExecutionDetail/index.vue'), - name: 'AccountPushExecutionDetail', - hidden: true, - meta: { - title: i18n.t('ExecutionDetail'), - // activeMenu: '/console/accounts/automations', - permissions: ['accounts.view_pushaccountexecution'] - } - } - ] - }, { path: 'account-change-secret', name: 'AccountChangeSecret', diff --git a/src/router/pam/index.js b/src/router/pam/index.js index 5f3f2597c..c23632a85 100644 --- a/src/router/pam/index.js +++ b/src/router/pam/index.js @@ -2,10 +2,10 @@ import Layout from '@/layout' import i18n from '@/i18n/i18n' import empty from '@/layout/empty' -import store from '@/store' import automations from './automations' import services from './service' import security from './security' +import activity from './activity' export default { path: '/pam/', @@ -13,12 +13,10 @@ export default { component: Layout, redirect: '/pam/dashboard', meta: { - title: i18n.t('PAM'), + title: '特权账号', icon: 'pam', type: 'view', - showNavSwitcher: () => { - return store.getters.consoleOrgs.length > 0 - }, + showNavSwitcher: true, permissions: [], view: 'pam' }, @@ -60,7 +58,7 @@ export default { name: 'AccountSecurity', component: empty, meta: { - title: i18n.t('Security'), + title: i18n.t('安全中心'), icon: 'accounts', permissions: [] }, @@ -75,6 +73,16 @@ export default { permissions: [] }, children: services + }, + { + path: '/pam/activity', + name: 'AccountActivity', + meta: { + title: i18n.t('Activity'), + icon: 'accounts', + permissions: [] + }, + children: activity } ] } diff --git a/src/router/pam/security.js b/src/router/pam/security.js index 20b5d465f..5e1617179 100644 --- a/src/router/pam/security.js +++ b/src/router/pam/security.js @@ -2,6 +2,32 @@ import empty from '@/layout/empty.vue' import i18n from '@/i18n/i18n' export default [ + { + path: 'scan', + name: 'AccountScan', + component: empty, + redirect: { + name: 'AccountPushList' + }, + meta: { + app: 'accounts', + name: 'BaseAccountRisk', + icon: 'accounts', + resource: 'pushaccountautomation' + }, + children: [ + { + path: '', + component: () => import('@/views/pam/AccountScan/index.vue'), + name: 'AccountPushList', + meta: { + title: i18n.t('账号检查'), + menuTitle: i18n.t('账号检查'), + permissions: ['accounts.view_pushaccountautomation'] + } + } + ] + }, { path: 'risk', name: 'AccountRisk', @@ -21,65 +47,10 @@ export default [ component: () => import('@/views/accounts/AccountPush/index.vue'), name: 'AccountPushList', meta: { - title: i18n.t('风险扫描'), - menuTitle: i18n.t('风险扫描'), + title: i18n.t('风险分析'), + menuTitle: i18n.t('风险分析'), permissions: ['accounts.view_pushaccountautomation'] } - }, - { - path: 'create', - component: () => import('@/views/accounts/AccountPush/AccountPushCreateUpdate.vue'), - name: 'AccountPushCreate', - hidden: true, - meta: { - title: i18n.t('AccountPushCreate'), - // activeMenu: '/console/accounts/automations', - permissions: ['accounts.add_pushaccountautomation'] - } - }, - { - path: ':id/update', - component: () => import('@/views/accounts/AccountPush/AccountPushCreateUpdate.vue'), - name: 'AccountPushUpdate', - hidden: true, - meta: { - title: i18n.t('AccountPushUpdate'), - // activeMenu: '/console/accounts/automations', - permissions: ['accounts.change_pushaccountautomation'] - } - }, - { - path: ':id', - component: () => import('@/views/accounts/AccountPush/AccountPushDetail/index.vue'), - name: 'AccountPushDetail', - hidden: true, - meta: { - title: i18n.t('AccountPushList'), - // activeMenu: '/console/accounts/automations', - permissions: ['accounts.view_pushaccountautomation'] - } - }, - { - path: 'executions', - component: () => import('@/views/accounts/AccountPush/AccountPushExecutionList.vue'), - name: 'AccountPushExecutionList', - hidden: true, - meta: { - title: i18n.t('ExecutionList'), - // activeMenu: '/console/accounts/automations', - permissions: ['accounts.view_pushaccountexecution'] - } - }, - { - path: 'executions/:id', - component: () => import('@/views/accounts/AccountPush/AccountPushExecutionDetail/index.vue'), - name: 'AccountPushExecutionDetail', - hidden: true, - meta: { - title: i18n.t('ExecutionDetail'), - // activeMenu: '/console/accounts/automations', - permissions: ['accounts.view_pushaccountexecution'] - } } ] } diff --git a/src/views/pam/AccountScan/AccountPushCreateUpdate.vue b/src/views/pam/AccountScan/AccountPushCreateUpdate.vue new file mode 100644 index 000000000..39c095290 --- /dev/null +++ b/src/views/pam/AccountScan/AccountPushCreateUpdate.vue @@ -0,0 +1,164 @@ + + + + + diff --git a/src/views/pam/AccountScan/AccountPushDetail/AccountPushInfo.vue b/src/views/pam/AccountScan/AccountPushDetail/AccountPushInfo.vue new file mode 100644 index 000000000..b8eb9ed32 --- /dev/null +++ b/src/views/pam/AccountScan/AccountPushDetail/AccountPushInfo.vue @@ -0,0 +1,96 @@ + + + + + diff --git a/src/views/pam/AccountScan/AccountPushDetail/index.vue b/src/views/pam/AccountScan/AccountPushDetail/index.vue new file mode 100644 index 000000000..983b7d479 --- /dev/null +++ b/src/views/pam/AccountScan/AccountPushDetail/index.vue @@ -0,0 +1,40 @@ + + + + + diff --git a/src/views/pam/AccountScan/AccountPushExecutionDetail/AccountPushExecutionInfo.vue b/src/views/pam/AccountScan/AccountPushExecutionDetail/AccountPushExecutionInfo.vue new file mode 100644 index 000000000..1c5814633 --- /dev/null +++ b/src/views/pam/AccountScan/AccountPushExecutionDetail/AccountPushExecutionInfo.vue @@ -0,0 +1,55 @@ + + + + + diff --git a/src/views/pam/AccountScan/AccountPushExecutionDetail/AccountPushExecutionTaskList.vue b/src/views/pam/AccountScan/AccountPushExecutionDetail/AccountPushExecutionTaskList.vue new file mode 100644 index 000000000..eff8a3feb --- /dev/null +++ b/src/views/pam/AccountScan/AccountPushExecutionDetail/AccountPushExecutionTaskList.vue @@ -0,0 +1,194 @@ + + + + + diff --git a/src/views/pam/AccountScan/AccountPushExecutionDetail/index.vue b/src/views/pam/AccountScan/AccountPushExecutionDetail/index.vue new file mode 100644 index 000000000..8595a7b08 --- /dev/null +++ b/src/views/pam/AccountScan/AccountPushExecutionDetail/index.vue @@ -0,0 +1,57 @@ + + + + + diff --git a/src/views/pam/AccountScan/AccountPushExecutionList.vue b/src/views/pam/AccountScan/AccountPushExecutionList.vue new file mode 100644 index 000000000..38322c1d3 --- /dev/null +++ b/src/views/pam/AccountScan/AccountPushExecutionList.vue @@ -0,0 +1,135 @@ + + + diff --git a/src/views/pam/AccountScan/AccountPushList.vue b/src/views/pam/AccountScan/AccountPushList.vue new file mode 100644 index 000000000..575b585a6 --- /dev/null +++ b/src/views/pam/AccountScan/AccountPushList.vue @@ -0,0 +1,118 @@ + + + diff --git a/src/views/pam/AccountScan/index.vue b/src/views/pam/AccountScan/index.vue new file mode 100644 index 000000000..c16fdf88f --- /dev/null +++ b/src/views/pam/AccountScan/index.vue @@ -0,0 +1,41 @@ + + + From a23a0d0197de49a2103375231506389c931f782d Mon Sep 17 00:00:00 2001 From: ibuler Date: Fri, 11 Oct 2024 17:59:00 +0800 Subject: [PATCH 004/216] perf: update perm --- .../Apps/AccountListTable/AccountList.vue | 41 ++++- src/components/Table/AutoDataTable/index.vue | 2 + .../TableFormatters/ActionsFormatter.vue | 2 +- .../TableFormatters/PlatformFormatter.vue | 60 +++++++ .../TableFormatters/ShowKeyCopyFormatter.vue | 2 +- src/components/Table/TableFormatters/index.js | 3 + .../components/NavHeader/Organization.vue | 2 +- src/router/console/index.js | 2 +- src/router/pam/index.js | 4 +- src/store/modules/users.js | 1 + src/utils/jms.js | 22 ++- src/utils/startup.js | 2 +- .../Asset/AssetList/components/BaseList.vue | 5 +- .../AssetList/components/PlatformDialog.vue | 28 +--- src/views/dashboard/Pam/AccountSummary.vue | 123 ++++++++++++++ .../dashboard/Pam/AssetProportionSummary.vue | 60 +++++++ src/views/dashboard/Pam/DataSummary.vue | 104 ++++++++++++ src/views/dashboard/Pam/RankSummary.vue | 64 ++++++++ src/views/dashboard/Pam/RiskSummary.vue | 123 ++++++++++++++ src/views/dashboard/Pam/SummaryChart.vue | 124 ++++++++++++++ src/views/dashboard/Pam/UserAssetActivity.vue | 74 +++++++++ src/views/dashboard/Pam/index.vue | 53 ++++++ src/views/pam/Account/AccountList.vue | 154 +++++++++++------- src/views/pam/Account/AssetList.vue | 24 +++ src/views/pam/Account/index.vue | 49 ++++++ 25 files changed, 1031 insertions(+), 97 deletions(-) create mode 100644 src/components/Table/TableFormatters/PlatformFormatter.vue create mode 100644 src/views/dashboard/Pam/AccountSummary.vue create mode 100644 src/views/dashboard/Pam/AssetProportionSummary.vue create mode 100644 src/views/dashboard/Pam/DataSummary.vue create mode 100644 src/views/dashboard/Pam/RankSummary.vue create mode 100644 src/views/dashboard/Pam/RiskSummary.vue create mode 100644 src/views/dashboard/Pam/SummaryChart.vue create mode 100644 src/views/dashboard/Pam/UserAssetActivity.vue create mode 100644 src/views/dashboard/Pam/index.vue create mode 100644 src/views/pam/Account/AssetList.vue create mode 100644 src/views/pam/Account/index.vue diff --git a/src/components/Apps/AccountListTable/AccountList.vue b/src/components/Apps/AccountListTable/AccountList.vue index f5e834739..cbba1f9fc 100644 --- a/src/components/Apps/AccountListTable/AccountList.vue +++ b/src/components/Apps/AccountListTable/AccountList.vue @@ -49,7 +49,7 @@ + + diff --git a/src/components/Table/TableFormatters/ShowKeyCopyFormatter.vue b/src/components/Table/TableFormatters/ShowKeyCopyFormatter.vue index f4d1656ef..84e62c920 100644 --- a/src/components/Table/TableFormatters/ShowKeyCopyFormatter.vue +++ b/src/components/Table/TableFormatters/ShowKeyCopyFormatter.vue @@ -23,8 +23,8 @@ v-if="item.has" :key="index" :content="item.tooltip" + :open-delay="500" effect="dark" - open-delay="500" placement="top" > diff --git a/src/components/Table/TableFormatters/index.js b/src/components/Table/TableFormatters/index.js index b3782104d..9032d53d4 100644 --- a/src/components/Table/TableFormatters/index.js +++ b/src/components/Table/TableFormatters/index.js @@ -18,6 +18,7 @@ import ProtocolsFormatter from './ProtocolsFormatter.vue' import TagChoicesFormatter from './TagChoicesFormatter.vue' import SwitchFormatter from './SwitchFormatter.vue' import AccountInfoFormatter from './AccountInfoFormatter.vue' +import PlatformFormatter from './PlatformFormatter.vue' export default { DetailFormatter, @@ -39,6 +40,7 @@ export default { TagChoicesFormatter, LabelsFormatter, SwitchFormatter, + PlatformFormatter, AccountInfoFormatter } @@ -62,5 +64,6 @@ export { TagChoicesFormatter, LabelsFormatter, SwitchFormatter, + PlatformFormatter, AccountInfoFormatter } diff --git a/src/layout/components/NavHeader/Organization.vue b/src/layout/components/NavHeader/Organization.vue index ada5512a0..7e00f82b0 100644 --- a/src/layout/components/NavHeader/Organization.vue +++ b/src/layout/components/NavHeader/Organization.vue @@ -82,7 +82,7 @@ export default { ] } const hasPerms = this.$hasPerm('orgs.view_organization | orgs.add_organization') - const isConsole = this.currentViewRoute.name === 'console' + const isConsole = ['console'].includes(this.currentViewRoute.name) return hasPerms && isConsole ? orgActions : {} }, orgChoicesGroup() { diff --git a/src/router/console/index.js b/src/router/console/index.js index 4c50cd610..bbccc7183 100644 --- a/src/router/console/index.js +++ b/src/router/console/index.js @@ -27,7 +27,7 @@ export default { children: [ { path: '/console/dashboard', - component: () => import('@/views/dashboard/Console/index'), + component: () => import('@/views/dashboard/Console/index.vue'), name: 'AdminDashboard', meta: { icon: 'dashboard', diff --git a/src/router/pam/index.js b/src/router/pam/index.js index c23632a85..55d7eb0a5 100644 --- a/src/router/pam/index.js +++ b/src/router/pam/index.js @@ -23,7 +23,7 @@ export default { children: [ { path: '/pam/dashboard', - component: () => import('@/views/dashboard/Audit/index'), + component: () => import('@/views/dashboard/Pam/index'), name: 'PamDashboard', meta: { icon: 'dashboard', @@ -34,7 +34,7 @@ export default { { path: '/pam/accounts', name: 'PamAccounts', - component: () => import('@/views/pam/Account/AccountList.vue'), + component: () => import('@/views/pam/Account/index.vue'), meta: { title: i18n.t('Accounts'), icon: 'accounts', diff --git a/src/store/modules/users.js b/src/store/modules/users.js index af0871a61..d42e30518 100644 --- a/src/store/modules/users.js +++ b/src/store/modules/users.js @@ -188,6 +188,7 @@ const actions = { commit('SET_MFA_VERIFY') }, changeToView({ commit }, viewName) { + console.log('Change to view') const mapper = { console: state.consoleOrgs, audit: state.auditOrgs, diff --git a/src/utils/jms.js b/src/utils/jms.js index 9cb63fe4b..d2a32ebab 100644 --- a/src/utils/jms.js +++ b/src/utils/jms.js @@ -96,7 +96,8 @@ export function getPermedViews() { ['audit', store.getters.auditOrgs.length > 0], ['workbench', true], ['tickets', hasPermission('tickets.view_ticket')], - ['settings', hasPermission('settings.view_setting')] + ['settings', hasPermission('settings.view_setting')], + ['pam', store.getters.consoleOrgs.length > 0] ] return viewShowMapper.filter(i => i[1]).map(i => i[0]) } @@ -155,3 +156,22 @@ export function IsSupportPauseSessionType(terminalType) { const supportedType = ['koko', 'lion', 'chen', 'kael'] return supportedType.includes(terminalType) } + +export function loadPlatformIcon(name, type) { + const platformMap = { + 'Huawei': 'huawei', + 'Cisco': 'cisco', + 'Gateway': 'gateway', + 'macOS': 'macos', + 'BSD': 'bsd', + 'Vmware-vSphere': 'vmware' + } + + const value = platformMap[name] || type + + try { + return require(`@/assets/img/icons/${value}.png`) + } catch (error) { + return require(`@/assets/img/icons/other.png`) + } +} diff --git a/src/utils/startup.js b/src/utils/startup.js index a5e368a02..668bd172d 100644 --- a/src/utils/startup.js +++ b/src/utils/startup.js @@ -131,7 +131,7 @@ export async function checkUserFirstLogin({ to, from, next }) { export async function changeCurrentViewIfNeed({ to, from, next }) { let viewName = to.path.split('/')[1] // 这几个是需要检测的, 切换视图组织时,避免 404, 这里不能加 settings, 因为 默认没有返回 setting 组织(System) 的管理权限 - if (['console', 'audit', 'workbench', 'tickets', ''].indexOf(viewName) === -1) { + if (['console', 'audit', 'workbench', 'tickets', 'pam', ''].indexOf(viewName) === -1) { Vue.$log.debug('Current view no need check', viewName) return } diff --git a/src/views/assets/Asset/AssetList/components/BaseList.vue b/src/views/assets/Asset/AssetList/components/BaseList.vue index c480425d3..f252838a3 100644 --- a/src/views/assets/Asset/AssetList/components/BaseList.vue +++ b/src/views/assets/Asset/AssetList/components/BaseList.vue @@ -23,7 +23,7 @@ + + diff --git a/src/views/dashboard/Pam/AssetProportionSummary.vue b/src/views/dashboard/Pam/AssetProportionSummary.vue new file mode 100644 index 000000000..fbee35614 --- /dev/null +++ b/src/views/dashboard/Pam/AssetProportionSummary.vue @@ -0,0 +1,60 @@ + -
+
- -
  • - {{ this.$t('CreateNode') }} -
  • -
  • - {{ this.$t('RenameNode') }} -
  • -
  • - {{ this.$t('DeleteNode') }} -
  • + +
    + +
  • + {{ item.name }} +
  • +
  • + +
  • @@ -17,13 +24,15 @@ + + diff --git a/src/views/assets/Cloud/Account/components/TimingPanel.vue b/src/views/assets/Cloud/Account/components/TimingPanel.vue index a89b2af24..c2b01c22c 100644 --- a/src/views/assets/Cloud/Account/components/TimingPanel.vue +++ b/src/views/assets/Cloud/Account/components/TimingPanel.vue @@ -3,15 +3,15 @@ ref="form" class="form" v-bind="settings" - @submitSuccess="handleSubmitSuccess" @performFinished="handlePerformFinished" + @submitSuccess="handleSubmitSuccess" /> + + diff --git a/src/views/pam/Account/AccountList.vue b/src/views/pam/Account/AccountList.vue index be5abda83..5874f430d 100644 --- a/src/views/pam/Account/AccountList.vue +++ b/src/views/pam/Account/AccountList.vue @@ -1,6 +1,6 @@ From b772580f991166a2f93ea449563b2082ff68ca7c Mon Sep 17 00:00:00 2001 From: wangruidong <940853815@qq.com> Date: Thu, 28 Nov 2024 10:29:03 +0800 Subject: [PATCH 037/216] feat: Add Account Activity List --- src/router/pam/activity.js | 10 +-- .../AccountActivity/AccountActivityList.vue | 84 +++++++++++++++++++ 2 files changed, 89 insertions(+), 5 deletions(-) create mode 100644 src/views/accounts/AccountActivity/AccountActivityList.vue diff --git a/src/router/pam/activity.js b/src/router/pam/activity.js index 1ab3a4b1b..dc6d1f479 100644 --- a/src/router/pam/activity.js +++ b/src/router/pam/activity.js @@ -36,19 +36,19 @@ export default [ }, meta: { app: 'accounts', - name: 'BaseAccountRisk', + name: 'BaseAccountActivity', icon: 'activity', - resource: 'pushaccountautomation' + resource: 'operate-logs' }, children: [ { path: '', - component: () => import('@/views/accounts/AccountPush/index.vue'), - name: 'AccountPushList', + component: () => import('@/views/accounts/AccountActivity/AccountActivityList.vue'), + name: 'AccountActivityList', meta: { title: i18n.t('活动记录'), menuTitle: i18n.t('活动记录'), - permissions: ['accounts.view_pushaccountautomation'] + permissions: ['audits.view_operatelog'] } } ] diff --git a/src/views/accounts/AccountActivity/AccountActivityList.vue b/src/views/accounts/AccountActivity/AccountActivityList.vue new file mode 100644 index 000000000..8b8c4f3d5 --- /dev/null +++ b/src/views/accounts/AccountActivity/AccountActivityList.vue @@ -0,0 +1,84 @@ + + + + + From 11d40b4be17f2686727427f5dfc0392d589b8700 Mon Sep 17 00:00:00 2001 From: zhaojisen <1301338853@qq.com> Date: Thu, 28 Nov 2024 18:03:23 +0800 Subject: [PATCH 038/216] perf: Add pam template --- .../Apps/ResourceActivity/index.vue | 2 +- .../Table/ListTable/TableAction/LeftSide.vue | 62 ++++++- .../Table/TableFormatters/DetailFormatter.vue | 2 + src/layout/components/Page/index.vue | 1 + src/router/console/accounts.js | 104 +++++------ .../AccountTemplateDetail/Account.vue | 4 +- .../AccountTemplateDetail/Detail.vue | 4 +- src/views/pam/Account/AccountTemplate.vue | 174 ++++++++++++++++++ src/views/pam/Account/index.vue | 7 + 9 files changed, 293 insertions(+), 67 deletions(-) create mode 100644 src/views/pam/Account/AccountTemplate.vue diff --git a/src/components/Apps/ResourceActivity/index.vue b/src/components/Apps/ResourceActivity/index.vue index f4db72f5f..ba9c7f629 100644 --- a/src/components/Apps/ResourceActivity/index.vue +++ b/src/components/Apps/ResourceActivity/index.vue @@ -1,7 +1,7 @@ + + diff --git a/src/components/Table/TableFormatters/DetailFormatter.vue b/src/components/Table/TableFormatters/DetailFormatter.vue index a33a38ef6..54659466d 100644 --- a/src/components/Table/TableFormatters/DetailFormatter.vue +++ b/src/components/Table/TableFormatters/DetailFormatter.vue @@ -106,6 +106,8 @@ export default { goDetail() { const detailRoute = this.getDetailRoute() + console.log('%c DEBUG[ detailRoute ]-97:', 'font-size:13px; background:pink; color:#7B68EE;', detailRoute) + if (this.formatterArgs.openInNewPage) { this.linkClicked = this.formatterArgs.removeColorOnClick const { href } = this.$router.resolve(detailRoute) diff --git a/src/layout/components/Page/index.vue b/src/layout/components/Page/index.vue index 47917e5ed..8b285176f 100644 --- a/src/layout/components/Page/index.vue +++ b/src/layout/components/Page/index.vue @@ -132,6 +132,7 @@ export default { ::v-deep > div { margin-bottom: 50px; + height: 100%; } } } diff --git a/src/router/console/accounts.js b/src/router/console/accounts.js index 82feeba15..3fa51ab79 100644 --- a/src/router/console/accounts.js +++ b/src/router/console/accounts.js @@ -67,57 +67,57 @@ export default [ } } ] - }, - { - path: 'account-template', - component: empty, - redirect: { - name: 'AccountTemplateList' - }, - meta: { - title: i18n.t('AccountTemplate'), - app: 'accounts', - icon: 'template', - permissions: ['accounts.view_accounttemplate'] - }, - children: [ - { - path: '', - name: 'AccountTemplateList', - component: () => import('@/views/accounts/AccountTemplate/AccountTemplateList'), - meta: { - menuTitle: i18n.t('MenuAccountTemplates'), - title: i18n.t('AccountTemplateList'), - permissions: ['accounts.view_accounttemplate'] - } - }, - { - path: 'create', - component: () => import('@/views/accounts/AccountTemplate/AccountTemplateCreateUpdate.vue'), - name: 'AccountTemplateCreate', - meta: { - title: i18n.t('CreateAccountTemplate'), - action: 'create' - }, - hidden: true - }, - { - path: ':id/update', - component: () => import('@/views/accounts/AccountTemplate/AccountTemplateCreateUpdate.vue'), - name: 'AccountTemplateUpdate', - meta: { - title: i18n.t('UpdateAccountTemplate'), - action: 'update' - }, - hidden: true - }, - { - path: ':id', - component: () => import('@/views/accounts/AccountTemplate/AccountTemplateDetail/index.vue'), - name: 'AccountTemplateDetail', - meta: { title: i18n.t('AccountTemplate') }, - hidden: true - } - ] } + // { + // path: 'account-template', + // component: empty, + // redirect: { + // name: 'AccountTemplateList' + // }, + // meta: { + // title: i18n.t('AccountTemplate'), + // app: 'accounts', + // icon: 'template', + // permissions: ['accounts.view_accounttemplate'] + // }, + // children: [ + // { + // path: '', + // name: 'AccountTemplateList', + // component: () => import('@/views/accounts/AccountTemplate/AccountTemplateList'), + // meta: { + // menuTitle: i18n.t('MenuAccountTemplates'), + // title: i18n.t('AccountTemplateList'), + // permissions: ['accounts.view_accounttemplate'] + // } + // }, + // { + // path: 'create', + // component: () => import('@/views/accounts/AccountTemplate/AccountTemplateCreateUpdate.vue'), + // name: 'AccountTemplateCreate', + // meta: { + // title: i18n.t('CreateAccountTemplate'), + // action: 'create' + // }, + // hidden: true + // }, + // { + // path: ':id/update', + // component: () => import('@/views/accounts/AccountTemplate/AccountTemplateCreateUpdate.vue'), + // name: 'AccountTemplateUpdate', + // meta: { + // title: i18n.t('UpdateAccountTemplate'), + // action: 'update' + // }, + // hidden: true + // }, + // { + // path: ':id', + // component: () => import('@/views/accounts/AccountTemplate/AccountTemplateDetail/index.vue'), + // name: 'AccountTemplateDetail', + // meta: { title: i18n.t('AccountTemplate') }, + // hidden: true + // } + // ] + // } ] diff --git a/src/views/accounts/AccountTemplate/AccountTemplateDetail/Account.vue b/src/views/accounts/AccountTemplate/AccountTemplateDetail/Account.vue index 4b8a257b4..8221ebb83 100644 --- a/src/views/accounts/AccountTemplate/AccountTemplateDetail/Account.vue +++ b/src/views/accounts/AccountTemplate/AccountTemplateDetail/Account.vue @@ -8,10 +8,10 @@ - + - + - + - + diff --git a/src/views/pam/Account/AccountTemplate.vue b/src/views/pam/Account/AccountTemplate.vue new file mode 100644 index 000000000..f5b7175dc --- /dev/null +++ b/src/views/pam/Account/AccountTemplate.vue @@ -0,0 +1,174 @@ + + + + + diff --git a/src/views/pam/Account/index.vue b/src/views/pam/Account/index.vue index 2d88dc5b6..eb430917a 100644 --- a/src/views/pam/Account/index.vue +++ b/src/views/pam/Account/index.vue @@ -33,6 +33,12 @@ export default { title: this.$t('Asset'), icon: 'fa-inbox', component: () => import('@/views/pam/Account/AssetList.vue') + }, + { + name: 'AccountTemplateList', + title: this.$t('AccountTemplate'), + icon: 'fa-copy', + component: () => import('@/views/pam/Account/AccountTemplate.vue') } ] } @@ -46,4 +52,5 @@ export default { From 7a6c156aaa9076d9a8e3580d8530bf8d01700135 Mon Sep 17 00:00:00 2001 From: fit2bot <68588906+fit2bot@users.noreply.github.com> Date: Mon, 2 Dec 2024 10:33:13 +0800 Subject: [PATCH 039/216] feat: PAM Service (#4474) * feat: PAM Service * perf: Remove useless * perf: Add go module download value --------- Co-authored-by: jiangweidong <1053570670@qq.com> --- src/components/Dialog/Secret.vue | 96 ++++++++ .../Form/FormFields/UploadField.vue | 2 +- src/components/Table/CardTable/SmallCard.vue | 32 +++ .../Table/CardTable/components/CardPanel.vue | 176 +++++++++++++++ .../Table/CardTable}/components/InfoPanel.vue | 18 +- src/components/Table/CardTable/index.vue | 19 +- src/router/pam/service.js | 69 ++---- .../assets/Cloud/Account/AccountList.vue | 119 ++++++++-- .../Cloud/Account/components/AccountPanel.vue | 205 ------------------ src/views/pam/ServiceIntegration/SDKList.vue | 115 ++++++++++ .../ServiceIntegrationCreateUpdate.vue | 99 +++++++++ .../ServiceIntegrationInfo.vue | 67 ++++++ .../ServiceIntegrationDetail/index.vue | 43 ++++ .../ServiceIntegrationList.vue | 51 +++++ .../components/CallRecords.vue | 60 +++++ src/views/pam/ServiceIntegration/index.vue | 49 +++++ src/views/profile/AccessKey/index.vue | 48 +--- 17 files changed, 941 insertions(+), 327 deletions(-) create mode 100644 src/components/Dialog/Secret.vue create mode 100644 src/components/Table/CardTable/SmallCard.vue create mode 100644 src/components/Table/CardTable/components/CardPanel.vue rename src/{views/assets/Cloud/Account => components/Table/CardTable}/components/InfoPanel.vue (75%) delete mode 100644 src/views/assets/Cloud/Account/components/AccountPanel.vue create mode 100644 src/views/pam/ServiceIntegration/SDKList.vue create mode 100644 src/views/pam/ServiceIntegration/ServiceIntegrationCreateUpdate.vue create mode 100644 src/views/pam/ServiceIntegration/ServiceIntegrationDetail/ServiceIntegrationInfo.vue create mode 100644 src/views/pam/ServiceIntegration/ServiceIntegrationDetail/index.vue create mode 100644 src/views/pam/ServiceIntegration/ServiceIntegrationList.vue create mode 100644 src/views/pam/ServiceIntegration/components/CallRecords.vue create mode 100644 src/views/pam/ServiceIntegration/index.vue diff --git a/src/components/Dialog/Secret.vue b/src/components/Dialog/Secret.vue new file mode 100644 index 000000000..d3b30a396 --- /dev/null +++ b/src/components/Dialog/Secret.vue @@ -0,0 +1,96 @@ + + + + + diff --git a/src/components/Form/FormFields/UploadField.vue b/src/components/Form/FormFields/UploadField.vue index 2feb09afd..26aaab3b4 100644 --- a/src/components/Form/FormFields/UploadField.vue +++ b/src/components/Form/FormFields/UploadField.vue @@ -8,7 +8,7 @@
    {{ tip }}
    - +
    diff --git a/src/components/Table/CardTable/SmallCard.vue b/src/components/Table/CardTable/SmallCard.vue new file mode 100644 index 000000000..ce4631589 --- /dev/null +++ b/src/components/Table/CardTable/SmallCard.vue @@ -0,0 +1,32 @@ + + + diff --git a/src/components/Table/CardTable/components/CardPanel.vue b/src/components/Table/CardTable/components/CardPanel.vue new file mode 100644 index 000000000..661a9cd74 --- /dev/null +++ b/src/components/Table/CardTable/components/CardPanel.vue @@ -0,0 +1,176 @@ + + + + + diff --git a/src/views/assets/Cloud/Account/components/InfoPanel.vue b/src/components/Table/CardTable/components/InfoPanel.vue similarity index 75% rename from src/views/assets/Cloud/Account/components/InfoPanel.vue rename to src/components/Table/CardTable/components/InfoPanel.vue index 2d806f0ef..a86526c59 100644 --- a/src/views/assets/Cloud/Account/components/InfoPanel.vue +++ b/src/components/Table/CardTable/components/InfoPanel.vue @@ -1,9 +1,7 @@ @@ -38,14 +36,18 @@ export default { .panel-item { text-align: left; - padding: 5px 0; + padding: 3px 0; line-height: 20px; - @include textOverflow; .item-label { text-align: left; - display: inline-block; - width: 100px; + } + .item-label::after { + content: ':'; + margin-left: 1px; + } + .text-info { + @include textOverflow; } } diff --git a/src/components/Table/CardTable/index.vue b/src/components/Table/CardTable/index.vue index 9915141b7..5db80d112 100644 --- a/src/components/Table/CardTable/index.vue +++ b/src/components/Table/CardTable/index.vue @@ -10,7 +10,7 @@ - + - + {{ $t('Enterprise') }} @@ -85,6 +92,10 @@ export default { }, props: { // 定义 table 的配置 + columns: { + type: Number, + default: 3 + }, tableConfig: { type: Object, default: () => ({}) @@ -100,6 +111,10 @@ export default { subComponent: { type: Object, default: () => null + }, + subComponentProps: { + type: Object, + default: () => ({}) } }, data() { diff --git a/src/router/pam/service.js b/src/router/pam/service.js index bf9411d5e..75e94769c 100644 --- a/src/router/pam/service.js +++ b/src/router/pam/service.js @@ -3,82 +3,57 @@ import i18n from '@/i18n/i18n' export default [ { - path: 'service', - name: 'AccountService', + path: 'services', + name: 'ServiceIntegration', component: empty, redirect: { - name: 'AccountServiceList' + name: 'ServiceIntegrationList' }, meta: { app: 'accounts', - name: 'AccountService', + name: 'ServiceIntegration', icon: 'service', - resource: 'pushaccountautomation' + resource: 'serviceintegration' }, children: [ { path: '', - component: () => import('@/views/accounts/AccountPush/index.vue'), - name: 'AccountServiceList', + component: () => import('@/views/pam/ServiceIntegration/index.vue'), + name: 'ServiceIntegrationList', meta: { - title: i18n.t('服务对接'), - menuTitle: i18n.t('服务对接'), - permissions: ['accounts.view_pushaccountautomation'] + title: i18n.t('ServiceIntegration'), + menuTitle: i18n.t('ServiceIntegration'), + permissions: ['accounts.view_serviceintegration'] } }, { path: 'create', - component: () => import('@/views/accounts/AccountPush/AccountPushCreateUpdate.vue'), - name: 'AccountPushCreate', + component: () => import('@/views/pam/ServiceIntegration/ServiceIntegrationCreateUpdate.vue'), + name: 'ServiceIntegrationCreate', hidden: true, meta: { - title: i18n.t('AccountPushCreate'), - // activeMenu: '/console/accounts/automations', - permissions: ['accounts.add_pushaccountautomation'] + title: i18n.t('ServiceIntegrationCreate'), + permissions: ['accounts.add_serviceintegration'] } }, { path: ':id/update', - component: () => import('@/views/accounts/AccountPush/AccountPushCreateUpdate.vue'), - name: 'AccountPushUpdate', + component: () => import('@/views/pam/ServiceIntegration/ServiceIntegrationCreateUpdate.vue'), + name: 'ServiceIntegrationUpdate', hidden: true, meta: { - title: i18n.t('AccountPushUpdate'), - // activeMenu: '/console/accounts/automations', - permissions: ['accounts.change_pushaccountautomation'] + title: i18n.t('ServiceIntegrationUpdate'), + permissions: ['accounts.change_serviceintegration'] } }, { path: ':id', - component: () => import('@/views/accounts/AccountPush/AccountPushDetail/index.vue'), - name: 'AccountCheckDetail', + component: () => import('@/views/pam/ServiceIntegration/ServiceIntegrationDetail/index.vue'), + name: 'ServiceIntegrationDetail', hidden: true, meta: { - title: i18n.t('AccountPushList'), - // activeMenu: '/console/accounts/automations', - permissions: ['accounts.view_pushaccountautomation'] - } - }, - { - path: 'executions', - component: () => import('@/views/accounts/AccountPush/AccountPushExecutionList.vue'), - name: 'AccountPushExecutionList', - hidden: true, - meta: { - title: i18n.t('ExecutionList'), - // activeMenu: '/console/accounts/automations', - permissions: ['accounts.view_pushaccountexecution'] - } - }, - { - path: 'executions/:id', - component: () => import('@/views/accounts/AccountPush/AccountPushExecutionDetail/index.vue'), - name: 'AccountCheckExecutionDetail', - hidden: true, - meta: { - title: i18n.t('ExecutionDetail'), - // activeMenu: '/console/accounts/automations', - permissions: ['accounts.view_pushaccountexecution'] + title: i18n.t('ServiceIntegrationDetail'), + permissions: ['accounts.view_serviceintegration'] } } ] diff --git a/src/views/assets/Cloud/Account/AccountList.vue b/src/views/assets/Cloud/Account/AccountList.vue index dcb03f09d..d403d63d7 100644 --- a/src/views/assets/Cloud/Account/AccountList.vue +++ b/src/views/assets/Cloud/Account/AccountList.vue @@ -1,11 +1,35 @@ @@ -15,23 +39,27 @@ import { baiducloud, state_private, fc, gcp, huaweicloud, huaweicloud_private, jdcloud, kingsoftcloud, lan, nutanix, openstack, qcloud, qcloud_lighthouse, qingcloud_private, scp, ucloud, vmware, volcengine, zstack } from '../const' -import rules from '@/components/Form/DataForm/rules' import CreateDialog from './components/CreateDialog.vue' -import CardTable from '@/components/Table/CardTable' -import AccountPanel from './components/AccountPanel' +import SmallCard from '@/components/Table/CardTable/SmallCard.vue' import { ACCOUNT_PROVIDER_ATTRS_MAP } from '@/views/assets/Cloud/const' +import Dialog from '@/components/Dialog/index.vue' +import AssetPanel from './components/AssetPanel.vue' +import AuthPanel from './components/AuthPanel.vue' +import { toSafeLocalDateStr } from '@/utils/time' export default { name: 'CloudAccountList', components: { - CardTable, + AuthPanel, + AssetPanel, + Dialog, + SmallCard, CreateDialog }, data() { const vm = this return { - colWidth: 6, - subComponent: AccountPanel, + object: null, tableConfig: { url: '/api/v1/xpack/cloud/accounts/', permissions: { @@ -103,21 +131,64 @@ export default { providerConfig: { providers: [] }, - account: {}, visible: false, - testLoading: false, - select2: { - allowCreate: true, - multiple: false - }, - regionRules: [rules.Required] + updateVisible: false, + onlineSyncVisible: false, + subComponentProps: { + handleUpdate: (obj) => { + this.object = obj + this.updateVisible = true + }, + getImage: (obj) => { + return ACCOUNT_PROVIDER_ATTRS_MAP[obj.provider.value].image + }, + getInfos: (obj) => { + return [ + { + title: this.$tc('TotalSyncRegion'), + content: obj?.task.regions.length + }, + { + title: this.$tc('TotalSyncAsset'), + content: obj?.task.instance_count + }, + { + title: this.$tc('DateLastSync'), + content: toSafeLocalDateStr(obj?.task.date_last_sync) + } + ] + }, + actions: [ + { + id: 'online-sync', + name: this.$tc('SyncOnline'), + icon: 'el-icon-thumb', + callback: this.handleOnlineExecute, + disabled: !this.$hasPerm('xpack.change_syncinstancetask') + } + ] + } } }, watch: { visible: { handler(val) { if (!val) { - this.$refs.accountTable.reloadTable() + this.$refs.table.reloadTable() + } + } + }, + onlineSyncVisible: { + handler(newValue) { + if (newValue === false) { + this.$refs.table.reloadTable() + } + } + }, + updateVisible: { + handler(newValue) { + if (newValue === false) { + this.$refs.table.reloadTable() } } } @@ -129,6 +200,14 @@ export default { return 200 } return status + }, + handleOnlineExecute(obj) { + this.object = obj + this.onlineSyncVisible = true + }, + onSubmitSuccess() { + this.$refs.table.reloadTable() + this.updateVisible = false } } } diff --git a/src/views/assets/Cloud/Account/components/AccountPanel.vue b/src/views/assets/Cloud/Account/components/AccountPanel.vue deleted file mode 100644 index 54f92ca6b..000000000 --- a/src/views/assets/Cloud/Account/components/AccountPanel.vue +++ /dev/null @@ -1,205 +0,0 @@ - - - - - diff --git a/src/views/pam/ServiceIntegration/SDKList.vue b/src/views/pam/ServiceIntegration/SDKList.vue new file mode 100644 index 000000000..3d8b13918 --- /dev/null +++ b/src/views/pam/ServiceIntegration/SDKList.vue @@ -0,0 +1,115 @@ + + + + + diff --git a/src/views/pam/ServiceIntegration/ServiceIntegrationCreateUpdate.vue b/src/views/pam/ServiceIntegration/ServiceIntegrationCreateUpdate.vue new file mode 100644 index 000000000..a8200f7ff --- /dev/null +++ b/src/views/pam/ServiceIntegration/ServiceIntegrationCreateUpdate.vue @@ -0,0 +1,99 @@ + + + diff --git a/src/views/pam/ServiceIntegration/ServiceIntegrationDetail/ServiceIntegrationInfo.vue b/src/views/pam/ServiceIntegration/ServiceIntegrationDetail/ServiceIntegrationInfo.vue new file mode 100644 index 000000000..61d99a72a --- /dev/null +++ b/src/views/pam/ServiceIntegration/ServiceIntegrationDetail/ServiceIntegrationInfo.vue @@ -0,0 +1,67 @@ + + + diff --git a/src/views/pam/ServiceIntegration/ServiceIntegrationDetail/index.vue b/src/views/pam/ServiceIntegration/ServiceIntegrationDetail/index.vue new file mode 100644 index 000000000..995b9a231 --- /dev/null +++ b/src/views/pam/ServiceIntegration/ServiceIntegrationDetail/index.vue @@ -0,0 +1,43 @@ + + + diff --git a/src/views/pam/ServiceIntegration/ServiceIntegrationList.vue b/src/views/pam/ServiceIntegration/ServiceIntegrationList.vue new file mode 100644 index 000000000..08661dc38 --- /dev/null +++ b/src/views/pam/ServiceIntegration/ServiceIntegrationList.vue @@ -0,0 +1,51 @@ + + + diff --git a/src/views/pam/ServiceIntegration/components/CallRecords.vue b/src/views/pam/ServiceIntegration/components/CallRecords.vue new file mode 100644 index 000000000..1f7e785dc --- /dev/null +++ b/src/views/pam/ServiceIntegration/components/CallRecords.vue @@ -0,0 +1,60 @@ + + + diff --git a/src/views/pam/ServiceIntegration/index.vue b/src/views/pam/ServiceIntegration/index.vue new file mode 100644 index 000000000..fe49d3b8c --- /dev/null +++ b/src/views/pam/ServiceIntegration/index.vue @@ -0,0 +1,49 @@ + + + diff --git a/src/views/profile/AccessKey/index.vue b/src/views/profile/AccessKey/index.vue index 835a74da0..2ad8f83f5 100644 --- a/src/views/profile/AccessKey/index.vue +++ b/src/views/profile/AccessKey/index.vue @@ -6,39 +6,18 @@ :help-tip="helpMessage" :table-config="tableConfig" /> - - - {{ warningText }} -
    -
    - ID: - {{ key.id }} -
    -
    - Secret: - {{ key.secret }} -
    -
    -
    -
    +
    From 2ee139c92ba31020db49170e85aa14ce6729a41e Mon Sep 17 00:00:00 2001 From: fit2bot <68588906+fit2bot@users.noreply.github.com> Date: Mon, 2 Dec 2024 10:33:46 +0800 Subject: [PATCH 040/216] perf: Change secret dashboard (#4473) * perf: Change secret dashboard * style: Modify layout --------- Co-authored-by: feng <1304903146@qq.com> Co-authored-by: zhaojisen <1301338853@qq.com> --- .../AccountChangeDashboard.vue | 13 - .../accounts/AccountChangeSecret/index.vue | 2 +- .../dashboard/ChangeSecret/AccountSummary.vue | 84 ++++++ .../dashboard/ChangeSecret/CardSummary.vue | 122 ++++++++ .../dashboard/ChangeSecret/DataSummary.vue | 92 +++++++ .../ChangeSecret/FailedAccountSummary.vue | 90 ++++++ .../dashboard/ChangeSecret/LineChart.vue | 260 ++++++++++++++++++ .../dashboard/ChangeSecret/TrendSummary.vue | 60 ++++ src/views/dashboard/ChangeSecret/index.vue | 80 ++++++ 9 files changed, 789 insertions(+), 14 deletions(-) delete mode 100644 src/views/accounts/AccountChangeSecret/AccountChangeDashboard.vue create mode 100644 src/views/dashboard/ChangeSecret/AccountSummary.vue create mode 100644 src/views/dashboard/ChangeSecret/CardSummary.vue create mode 100644 src/views/dashboard/ChangeSecret/DataSummary.vue create mode 100644 src/views/dashboard/ChangeSecret/FailedAccountSummary.vue create mode 100644 src/views/dashboard/ChangeSecret/LineChart.vue create mode 100644 src/views/dashboard/ChangeSecret/TrendSummary.vue create mode 100644 src/views/dashboard/ChangeSecret/index.vue diff --git a/src/views/accounts/AccountChangeSecret/AccountChangeDashboard.vue b/src/views/accounts/AccountChangeSecret/AccountChangeDashboard.vue deleted file mode 100644 index 2a445937a..000000000 --- a/src/views/accounts/AccountChangeSecret/AccountChangeDashboard.vue +++ /dev/null @@ -1,13 +0,0 @@ - - - - - diff --git a/src/views/accounts/AccountChangeSecret/index.vue b/src/views/accounts/AccountChangeSecret/index.vue index 6ed5c7147..abc30c9e7 100644 --- a/src/views/accounts/AccountChangeSecret/index.vue +++ b/src/views/accounts/AccountChangeSecret/index.vue @@ -18,7 +18,7 @@ export default { { title: this.$t('Overview'), name: 'AccountChangeDashboard', - component: () => import('@/views/accounts/AccountChangeSecret/AccountChangeDashboard.vue') + component: () => import('@/views/dashboard/ChangeSecret') }, { title: this.$t('AccountChangeSecret'), diff --git a/src/views/dashboard/ChangeSecret/AccountSummary.vue b/src/views/dashboard/ChangeSecret/AccountSummary.vue new file mode 100644 index 000000000..9d1d21433 --- /dev/null +++ b/src/views/dashboard/ChangeSecret/AccountSummary.vue @@ -0,0 +1,84 @@ + From 4a8c84ee9daa3925e49d516a69a7af47eb0e192c Mon Sep 17 00:00:00 2001 From: w940853815 <940853815@qq.com> Date: Wed, 8 Jan 2025 14:32:48 +0800 Subject: [PATCH 133/216] perf: Add risk change_password_add handle --- .../Table/TableFormatters/DiscoverConfirmFormatter.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Table/TableFormatters/DiscoverConfirmFormatter.vue b/src/components/Table/TableFormatters/DiscoverConfirmFormatter.vue index 151263f7f..0c58172db 100644 --- a/src/components/Table/TableFormatters/DiscoverConfirmFormatter.vue +++ b/src/components/Table/TableFormatters/DiscoverConfirmFormatter.vue @@ -128,7 +128,7 @@ export default { has: !this.row.present }, { - name: 'add_account_after_change_password', + name: 'change_password_add', label: this.$t('Add account after changing password'), has: !this.row.present } From b9a0bbf12d506081369ca97d2eddb752e9b313ab Mon Sep 17 00:00:00 2001 From: zhaojisen <1301338853@qq.com> Date: Wed, 8 Jan 2025 16:03:49 +0800 Subject: [PATCH 134/216] Perf: Optimize the DataSummary style --- src/views/dashboard/Pam/DataSummary.vue | 15 +- src/views/dashboard/Pam/SummaryChart.vue | 238 +++++++++++++++-------- src/views/dashboard/Pam/index.vue | 15 +- 3 files changed, 180 insertions(+), 88 deletions(-) diff --git a/src/views/dashboard/Pam/DataSummary.vue b/src/views/dashboard/Pam/DataSummary.vue index a22ce194c..7fc134015 100644 --- a/src/views/dashboard/Pam/DataSummary.vue +++ b/src/views/dashboard/Pam/DataSummary.vue @@ -1,7 +1,7 @@