From 87c4dd2a86ae1f050cdb8efdd167ced0eaeeef15 Mon Sep 17 00:00:00 2001 From: xinwen Date: Mon, 8 Jun 2020 16:58:56 +0800 Subject: [PATCH 1/4] =?UTF-8?q?[Feature]=20=E6=B7=BB=E5=8A=A0=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E7=99=BB=E5=BD=95=E5=AE=A1=E6=89=B9=E4=BA=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/i18n/langs/cn.json | 1 + src/i18n/langs/en.json | 1 + src/views/users/User/UserDetail/UserInfo.vue | 27 ++++++++++++++++++++ 3 files changed, 29 insertions(+) diff --git a/src/i18n/langs/cn.json b/src/i18n/langs/cn.json index b50bc44fe..e81fd8d82 100644 --- a/src/i18n/langs/cn.json +++ b/src/i18n/langs/cn.json @@ -671,6 +671,7 @@ "RunUser": "运行用户" }, "users": { + "LoginConfirm": "登录确认人", "SSHKey": "SSH公钥", "TermsAndConditions": "条款和条件", "IAgree": "我同意", diff --git a/src/i18n/langs/en.json b/src/i18n/langs/en.json index 8ddb64893..6d94458b1 100644 --- a/src/i18n/langs/en.json +++ b/src/i18n/langs/en.json @@ -654,6 +654,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..1110f3a36 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) + } } } }, From 54208aad75cc102f8fecb432bb04f1ffab46e6b7 Mon Sep 17 00:00:00 2001 From: xinwen Date: Mon, 8 Jun 2020 17:12:50 +0800 Subject: [PATCH 2/4] =?UTF-8?q?[Update]=20=E8=B0=83=E6=95=B4=E7=99=BB?= =?UTF-8?q?=E5=BD=95=E5=AE=A1=E6=89=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/users/User/UserDetail/UserInfo.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/views/users/User/UserDetail/UserInfo.vue b/src/views/users/User/UserDetail/UserInfo.vue index 1110f3a36..af0c605ee 100644 --- a/src/views/users/User/UserDetail/UserInfo.vue +++ b/src/views/users/User/UserDetail/UserInfo.vue @@ -6,7 +6,7 @@ - + From d50e25c43293d3d75fde8200a7f4509cc8b6fe8a Mon Sep 17 00:00:00 2001 From: xinwen Date: Mon, 8 Jun 2020 18:12:05 +0800 Subject: [PATCH 3/4] =?UTF-8?q?[Fix]=20Xpack-=E4=BA=91=E7=AE=A1=E4=B8=AD?= =?UTF-8?q?=E5=BF=83-=E5=88=9B=E5=BB=BA=E5=90=8C=E6=AD=A5=E5=AE=9E?= =?UTF-8?q?=E4=BE=8B=E5=90=8E=E5=8D=95=E5=87=BB=E8=AF=A5=E5=90=8C=E6=AD=A5?= =?UTF-8?q?=E5=AE=9E=E4=BE=8B=E5=90=8D=E7=A7=B0=E4=B8=8D=E8=83=BD=E8=B7=B3?= =?UTF-8?q?=E8=BD=AC=E8=87=B3=E8=AF=A6=E6=83=85=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../xpack/Cloud/SyncInstanceTask/SyncInstanceTaskList.vue | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/views/xpack/Cloud/SyncInstanceTask/SyncInstanceTaskList.vue b/src/views/xpack/Cloud/SyncInstanceTask/SyncInstanceTaskList.vue index a09c49165..b7176a6e3 100644 --- a/src/views/xpack/Cloud/SyncInstanceTask/SyncInstanceTaskList.vue +++ b/src/views/xpack/Cloud/SyncInstanceTask/SyncInstanceTaskList.vue @@ -17,7 +17,11 @@ export default { 'name', 'account_name', 'history_count', 'instance_count', 'periodic_display', 'date_last_sync', 'comment', 'actions' ], - columnsMeta: {} + columnsMeta: { + name: { + formatter: null + } + } }, headerActions: { hasBulkDelete: false, From 887b1a7a9de1b52fae9085bc102d653aebbd6d5e Mon Sep 17 00:00:00 2001 From: OrangeM21 Date: Mon, 8 Jun 2020 20:57:23 +0800 Subject: [PATCH 4/4] =?UTF-8?q?[fix]=E6=9B=B4=E6=96=B0=E4=BA=91=E7=AE=A1?= =?UTF-8?q?=E4=B8=AD=E5=BF=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/xpack/Cloud/Account/AccountCreateUpdate.vue | 4 +++- .../SyncInstanceTask/SyncInstanceTaskCreateUpdate.vue | 4 +++- .../Cloud/SyncInstanceTask/SyncInstanceTaskList.vue | 10 +++++++++- 3 files changed, 15 insertions(+), 3 deletions(-) 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..7b95816bb 100644 --- a/src/views/xpack/Cloud/SyncInstanceTask/SyncInstanceTaskList.vue +++ b/src/views/xpack/Cloud/SyncInstanceTask/SyncInstanceTaskList.vue @@ -17,7 +17,15 @@ 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 }}) + } + } + } + } }, headerActions: { hasBulkDelete: false,