diff --git a/src/i18n/langs/cn.json b/src/i18n/langs/cn.json index 89c76ac63..a43b4ff17 100644 --- a/src/i18n/langs/cn.json +++ b/src/i18n/langs/cn.json @@ -676,6 +676,7 @@ "RunUser": "运行用户" }, "users": { + "LoginConfirm": "登录确认人", "SSHKey": "SSH公钥", "TermsAndConditions": "条款和条件", "IAgree": "我同意", diff --git a/src/i18n/langs/en.json b/src/i18n/langs/en.json index 63cb5b3c4..61f8e1aff 100644 --- a/src/i18n/langs/en.json +++ b/src/i18n/langs/en.json @@ -659,6 +659,7 @@ "RenameNode": "Rename node" }, "users": { + "LoginConfirm": "Login approvers", "SSHKey": "SSH Key", "TermsAndConditions": "Terms and conditions", "IAgree": "I agree", diff --git a/src/views/users/User/UserDetail/UserInfo.vue b/src/views/users/User/UserDetail/UserInfo.vue index 2749e494d..af0c605ee 100644 --- a/src/views/users/User/UserDetail/UserInfo.vue +++ b/src/views/users/User/UserDetail/UserInfo.vue @@ -6,6 +6,7 @@ + @@ -183,6 +184,32 @@ export default { }) return this.$axios.post(relationUrl, data) } + }, + loginConfirmSetting: { + icon: 'fa-user', + title: this.$t('users.LoginConfirm'), + objectsAjax: { + url: '/api/v1/users/users/' + }, + hasObjectsId: this.object.login_confirm_settings, + performDelete: (item) => { + const objectId = this.object.id + const relationUrl = `/api/v1/authentication/login-confirm-settings/${objectId}/` + const data = { + reviewers: this.object.login_confirm_settings.filter(approver => approver !== item.value) + } + return this.$axios.patch(relationUrl, data) + }, + performAdd: (items) => { + const objectId = this.object.id + const relationUrl = `/api/v1/authentication/login-confirm-settings/${objectId}/` + const data = { + reviewers: [...this.object.login_confirm_settings, ...items.map(v => { + return v.value + })] + } + return this.$axios.patch(relationUrl, data) + } } } }, diff --git a/src/views/xpack/Cloud/Account/AccountCreateUpdate.vue b/src/views/xpack/Cloud/Account/AccountCreateUpdate.vue index b8060f505..c2ad52aff 100644 --- a/src/views/xpack/Cloud/Account/AccountCreateUpdate.vue +++ b/src/views/xpack/Cloud/Account/AccountCreateUpdate.vue @@ -20,7 +20,9 @@ export default { ], url: '/api/v1/xpack/cloud/accounts/', fieldsMeta: { - } + }, + updateSuccessNextRoute: { name: 'CloudCenter' }, + createSuccessNextRoute: { name: 'CloudCenter' } } } } diff --git a/src/views/xpack/Cloud/SyncInstanceTask/SyncInstanceTaskCreateUpdate.vue b/src/views/xpack/Cloud/SyncInstanceTask/SyncInstanceTaskCreateUpdate.vue index a2375de7d..88de44453 100644 --- a/src/views/xpack/Cloud/SyncInstanceTask/SyncInstanceTaskCreateUpdate.vue +++ b/src/views/xpack/Cloud/SyncInstanceTask/SyncInstanceTaskCreateUpdate.vue @@ -85,7 +85,9 @@ export default { } } } - } + }, + updateSuccessNextRoute: { name: 'CloudCenter' }, + createSuccessNextRoute: { name: 'CloudCenter' } } } } diff --git a/src/views/xpack/Cloud/SyncInstanceTask/SyncInstanceTaskList.vue b/src/views/xpack/Cloud/SyncInstanceTask/SyncInstanceTaskList.vue index a09c49165..957642bd8 100644 --- a/src/views/xpack/Cloud/SyncInstanceTask/SyncInstanceTaskList.vue +++ b/src/views/xpack/Cloud/SyncInstanceTask/SyncInstanceTaskList.vue @@ -17,7 +17,18 @@ export default { 'name', 'account_name', 'history_count', 'instance_count', 'periodic_display', 'date_last_sync', 'comment', 'actions' ], - columnsMeta: {} + columnsMeta: { + actions: { + formatterArgs: { + onUpdate: ({ row }) => { + this.$router.push({ name: 'SyncInstanceTaskUpdate', params: { id: row.id }}) + } + } + }, + name: { + formatter: null + } + } }, headerActions: { hasBulkDelete: false,