From 339c1ab227564a20d3fc002264f1e36847e00fee Mon Sep 17 00:00:00 2001 From: w940853815 <940853815@qq.com> Date: Wed, 12 Feb 2025 18:13:20 +0800 Subject: [PATCH 1/3] perf: Add Java, Node, Go, and cURL demo code --- src/views/pam/Integration/SDKList.vue | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/views/pam/Integration/SDKList.vue b/src/views/pam/Integration/SDKList.vue index bffc14a37..0da621350 100644 --- a/src/views/pam/Integration/SDKList.vue +++ b/src/views/pam/Integration/SDKList.vue @@ -40,12 +40,15 @@ export default { }, data() { return { - currentLanguage: 'python', + currentLanguage: 'curl', readme: '', code: '', languages: [ + { label: 'cURL', value: 'curl' }, { label: 'Python', value: 'python' }, - { label: 'Go', value: 'go' } + { label: 'Go', value: 'go' }, + { label: 'Java', value: 'java' }, + { label: 'Node.js', value: 'node' } ] } }, @@ -73,7 +76,15 @@ export default { const url = `/api/v1/accounts/integration-applications/sdks/?language=${this.currentLanguage}` this.$axios.get(url).then(res => { this.readme = res.readme - this.code = `\`\`\`${this.currentLanguage}\n${res.code}\n\`\`\`` + const highlightMapper = { + 'curl': 'bash', + 'python': 'python', + 'go': 'go', + 'java': 'java', + 'node': 'javascript' + } + const language = highlightMapper[this.currentLanguage] || 'bash' + this.code = `\`\`\`${language}\n${res.code}\n\`\`\`` this.$nextTick(() => { this.highlightCode() }) From b52484874243299eab882b87b00be79e45580796 Mon Sep 17 00:00:00 2001 From: feng <1304903146@qq.com> Date: Wed, 12 Feb 2025 11:43:45 +0800 Subject: [PATCH 2/3] perf: Translate --- src/router/pam/activity.js | 4 +-- src/router/pam/automations.js | 7 ++--- .../AccountBackupDetail/index.vue | 8 ++--- .../AccountBackupExecutionList.vue | 26 ++++++++++------- .../AccountBackup/AccountBackupList.vue | 10 ++----- .../AccountChangeSecretExecutionList.vue | 22 +++++++------- .../accounts/AccountChangeSecret/index.vue | 4 +-- .../AccountDiscover/TaskExecutionList.vue | 24 +++++++-------- .../AccountPush/AccountPushDetail/index.vue | 4 +-- .../AccountPush/AccountPushExecutionList.vue | 29 +++++++++++-------- src/views/accounts/AccountPush/index.vue | 2 +- src/views/dashboard/Pam/SummaryChart.vue | 2 +- src/views/pam/RiskDetect/index.vue | 2 +- 13 files changed, 68 insertions(+), 76 deletions(-) diff --git a/src/router/pam/activity.js b/src/router/pam/activity.js index 705c0f292..1c6611faf 100644 --- a/src/router/pam/activity.js +++ b/src/router/pam/activity.js @@ -20,7 +20,7 @@ export default [ component: () => import('@/views/sessions/SessionList/index.vue'), name: 'AccountSessionList', meta: { - title: i18n.t('AccountSessions'), + title: i18n.t('SessionList'), permissions: [] } } @@ -45,7 +45,7 @@ export default [ component: () => import('@/views/accounts/AccountActivity/AccountActivityList.vue'), name: 'AccountActivityList', meta: { - title: i18n.t('AccountActivity'), + title: i18n.t('Activity'), permissions: ['audits.view_operatelog'] } } diff --git a/src/router/pam/automations.js b/src/router/pam/automations.js index 6c42d6bdb..0ee15754a 100644 --- a/src/router/pam/automations.js +++ b/src/router/pam/automations.js @@ -113,7 +113,7 @@ export default [ name: 'AccountChangeSecretList', meta: { menuTitle: i18n.t('ChangeSecret'), - title: i18n.t('AccountChangeSecret'), + title: i18n.t('ChangeSecret'), permissions: ['accounts.view_changesecretautomation'] } }, @@ -143,7 +143,7 @@ export default [ name: 'AccountChangeSecretDetail', hidden: true, meta: { - title: i18n.t('AccountChangeSecret'), + title: i18n.t('ChangeSecret'), permissions: ['accounts.view_changesecretautomation'] } }, @@ -296,8 +296,7 @@ export default [ component: () => import('@/views/accounts/AccountBackup/AccountBackupDetail/index.vue'), name: 'AccountBackupDetail', meta: { - title: i18n.t('AccountBackupDetail'), - activeMenu: '/console/accounts/automations' + title: i18n.t('AccountBackupDetail') }, hidden: true }, diff --git a/src/views/accounts/AccountBackup/AccountBackupDetail/index.vue b/src/views/accounts/AccountBackup/AccountBackupDetail/index.vue index f8229d7f7..14e7a92c6 100644 --- a/src/views/accounts/AccountBackup/AccountBackupDetail/index.vue +++ b/src/views/accounts/AccountBackup/AccountBackupDetail/index.vue @@ -20,18 +20,14 @@ export default { return { plan: { name: '', comment: '' }, config: { - url: `/api/v1/accounts/account-backup-plans/`, + url: `/api/v1/accounts/account-backup-plans`, activeMenu: 'AccountBackupInfo', submenu: [ { title: this.$t('Basic'), name: 'AccountBackupInfo' } - ], - actions: { - detailApiUrl: `/api/v1/accounts/account-backup-plans/`, - deleteSuccessRoute: 'AccountBackupList' - } + ] } } } diff --git a/src/views/accounts/AccountBackup/AccountBackupExecution/AccountBackupExecutionList.vue b/src/views/accounts/AccountBackup/AccountBackupExecution/AccountBackupExecutionList.vue index fae3ead87..5457187b0 100644 --- a/src/views/accounts/AccountBackup/AccountBackupExecution/AccountBackupExecutionList.vue +++ b/src/views/accounts/AccountBackup/AccountBackupExecution/AccountBackupExecutionList.vue @@ -24,17 +24,30 @@ export default { tableConfig: { url: '/api/v1/accounts/account-backup-plan-executions/', columns: [ - 'automation', 'trigger', + 'automation', 'backup_name', 'trigger', 'date_start', 'date_finished', 'duration', 'actions' ], columnsShow: { default: [ - 'automation', 'trigger', + 'automation', 'backup_name', 'trigger', 'date_start', 'date_finished', 'duration', 'actions' ] }, columnsMeta: { automation: { + label: this.$t('ID'), + formatter: DetailFormatter, + formatterArgs: { + route: 'AccountBackupExecutionDetail', + getRoute: ({ row }) => ({ + name: 'AccountBackupExecutionDetail', + params: { id: row.id } + }), + drawer: true, + can: this.$hasPerm('accounts.view_backupaccountexecution') + } + }, + backup_name: { label: this.$t('DisplayName'), formatter: DetailFormatter, formatterArgs: { @@ -67,15 +80,6 @@ export default { openTaskPage(row['id']) } }, - { - name: 'detail', - title: this.$t('Detail'), - type: 'info', - can: this.$hasPerm('accounts.view_backupaccountexecution'), - callback: function({ row }) { - return this.$router.push({ name: 'AccountBackupExecutionDetail', params: { id: row.id }}) - } - }, { name: 'report', title: this.$t('Report'), diff --git a/src/views/accounts/AccountBackup/AccountBackupList.vue b/src/views/accounts/AccountBackup/AccountBackupList.vue index 3baa65cfd..2b4f41828 100644 --- a/src/views/accounts/AccountBackup/AccountBackupList.vue +++ b/src/views/accounts/AccountBackup/AccountBackupList.vue @@ -8,9 +8,9 @@