From c27dd0baeff08c280de8aeb607a76a598a8d8c27 Mon Sep 17 00:00:00 2001 From: Orange Date: Tue, 17 Nov 2020 14:49:38 +0800 Subject: [PATCH 01/13] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E7=BF=BB?= =?UTF-8?q?=E8=AF=91=E7=BC=BA=E5=A4=B1=E5=92=8C=E6=9B=B4=E6=96=B0=E7=B3=BB?= =?UTF-8?q?=E7=BB=9F=E7=94=A8=E6=88=B7=E7=9A=84=E8=A1=A8=E5=8D=95=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/i18n/langs/en.json | 1 + src/views/assets/SystemUser/SystemUserCreateUpdate.vue | 3 +++ 2 files changed, 4 insertions(+) diff --git a/src/i18n/langs/en.json b/src/i18n/langs/en.json index b85103683..298d2fe8b 100644 --- a/src/i18n/langs/en.json +++ b/src/i18n/langs/en.json @@ -787,6 +787,7 @@ "Asset": "Asset", "SystemUser": "System user", "Applicant": "Applicant", + "RequestAssetPerm": "Request asset perm", "Pending": "Open", "Approved": "Approved", "Rejected": "Rejected", diff --git a/src/views/assets/SystemUser/SystemUserCreateUpdate.vue b/src/views/assets/SystemUser/SystemUserCreateUpdate.vue index 2781adf45..aaf6a0329 100644 --- a/src/views/assets/SystemUser/SystemUserCreateUpdate.vue +++ b/src/views/assets/SystemUser/SystemUserCreateUpdate.vue @@ -191,6 +191,9 @@ export default { if (formValue.update_password || formValue.protocol === 'k8s') { return true } + if (formValue.login_mode === 'login_mode') { + return true + } return !this.$route.params.id } }, From 0cba2b3116b3b0bd5d105e31393d3241328c454c Mon Sep 17 00:00:00 2001 From: Orange Date: Mon, 16 Nov 2020 18:55:09 +0800 Subject: [PATCH 02/13] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=88=A0?= =?UTF-8?q?=E9=99=A4=E5=BA=94=E7=94=A8=E7=9A=84=E6=8F=90=E7=A4=BA=E6=A1=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/applications/DatabaseApp/DatabaseAppList.vue | 4 ++-- src/views/applications/KubernetesApp/KubernetesAppList.vue | 4 ++-- src/views/applications/RemoteApp/RemoteAppList.vue | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/views/applications/DatabaseApp/DatabaseAppList.vue b/src/views/applications/DatabaseApp/DatabaseAppList.vue index bb52d2f76..28ebce429 100644 --- a/src/views/applications/DatabaseApp/DatabaseAppList.vue +++ b/src/views/applications/DatabaseApp/DatabaseAppList.vue @@ -37,12 +37,12 @@ export default { actions: { prop: '', formatterArgs: { - onDelete: function({ row, col, cellValue, reload }) { + performDelete: function({ row, col, cellValue, reload }) { this.$axios.delete( `/api/v1/applications/applications/${row.id}/` ).then(res => { this.$refs.GenericListTable.$refs.ListTable.reloadTable() - this.$message.success(this.$t('common.deleteSuccessMsg')) + // this.$message.success(this.$t('common.deleteSuccessMsg')) }).catch(error => { this.$message.error(this.$t('common.deleteErrorMsg' + ' ' + error)) }) diff --git a/src/views/applications/KubernetesApp/KubernetesAppList.vue b/src/views/applications/KubernetesApp/KubernetesAppList.vue index bd123b552..45d75d638 100644 --- a/src/views/applications/KubernetesApp/KubernetesAppList.vue +++ b/src/views/applications/KubernetesApp/KubernetesAppList.vue @@ -29,12 +29,12 @@ export default { actions: { prop: '', formatterArgs: { - onDelete: function({ row, col, cellValue, reload }) { + performDelete: function({ row, col, cellValue, reload }) { this.$axios.delete( `/api/v1/applications/applications/${row.id}/` ).then(res => { this.$refs.GenericListTable.$refs.ListTable.reloadTable() - this.$message.success(this.$t('common.deleteSuccessMsg')) + // this.$message.success(this.$t('common.deleteSuccessMsg')) }).catch(error => { this.$message.error(this.$t('common.deleteErrorMsg' + ' ' + error)) }) diff --git a/src/views/applications/RemoteApp/RemoteAppList.vue b/src/views/applications/RemoteApp/RemoteAppList.vue index 976547662..ed550a17f 100644 --- a/src/views/applications/RemoteApp/RemoteAppList.vue +++ b/src/views/applications/RemoteApp/RemoteAppList.vue @@ -38,12 +38,12 @@ export default { onUpdate: ({ row }) => { vm.$router.push({ name: 'RemoteAppUpdate', params: { id: row.id }, query: { type: row.type }}) }, - onDelete: function({ row, col, cellValue, reload }) { + performDelete: function({ row, col, cellValue, reload }) { this.$axios.delete( `/api/v1/applications/applications/${row.id}/` ).then(res => { this.$refs.GenericListTable.$refs.ListTable.reloadTable() - this.$message.success(this.$t('common.deleteSuccessMsg')) + // this.$message.success(this.$t('common.deleteSuccessMsg')) }).catch(error => { this.$message.error(this.$t('common.deleteErrorMsg' + ' ' + error)) }) From 777c3710700660a4231235b87c3e23824408ddcd Mon Sep 17 00:00:00 2001 From: fit2bot <68588906+fit2bot@users.noreply.github.com> Date: Tue, 17 Nov 2020 16:33:40 +0800 Subject: [PATCH 03/13] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=B7=A5?= =?UTF-8?q?=E5=8D=95=E6=8F=90=E4=BA=A4=E6=97=B6=E5=BF=85=E9=A1=BB=E8=BE=93?= =?UTF-8?q?=E5=85=A5=E7=B3=BB=E7=BB=9F=E7=94=A8=E6=88=B7=E7=9A=84=E6=8F=90?= =?UTF-8?q?=E9=86=92=20(#503)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: 修复工单提交时必须输入系统用户的提醒 * fix: 去掉多余的console.log Co-authored-by: Orange --- src/views/applications/RemoteApp/RemoteAppList.vue | 1 - src/views/tickets/RequestAssetPerm/Detail/TicketDetail.vue | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/views/applications/RemoteApp/RemoteAppList.vue b/src/views/applications/RemoteApp/RemoteAppList.vue index ed550a17f..ac431bbaa 100644 --- a/src/views/applications/RemoteApp/RemoteAppList.vue +++ b/src/views/applications/RemoteApp/RemoteAppList.vue @@ -28,7 +28,6 @@ export default { label: this.$t('assets.Assets'), showOverflowTooltip: true, formatter: function(row, column, cellValue, index) { - console.log(row, column, cellValue) const route = { to: { name: 'AssetDetail', params: { id: cellValue }}} return { row.attrs.asset_info.hostname } } diff --git a/src/views/tickets/RequestAssetPerm/Detail/TicketDetail.vue b/src/views/tickets/RequestAssetPerm/Detail/TicketDetail.vue index 745db6235..c6df55316 100644 --- a/src/views/tickets/RequestAssetPerm/Detail/TicketDetail.vue +++ b/src/views/tickets/RequestAssetPerm/Detail/TicketDetail.vue @@ -156,7 +156,7 @@ export default { window.location.reload() }, handleApprove() { - if (this.requestForm.asset.length === 0 || this.requestForm.systemuser === '') { + if (this.requestForm.asset.length === 0 || this.requestForm.systemuser.length === 0) { return this.$message.error(this.$t('common.NeedAssetsAndSystemUserErrMsg')) } else { this.$axios.patch(`/api/v1/tickets/tickets/request-asset-perm/${this.object.id}/`, { From 254a2b58cc293bc486e0cbffa0e30918a7d8bdc9 Mon Sep 17 00:00:00 2001 From: Orange Date: Mon, 16 Nov 2020 16:30:59 +0800 Subject: [PATCH 04/13] =?UTF-8?q?fix:=20=E7=94=A8=E6=88=B7=E6=9D=A5?= =?UTF-8?q?=E6=BA=90=E4=B8=8D=E6=98=AF=E6=9C=AC=E5=9C=B0=E6=97=B6=E7=A6=81?= =?UTF-8?q?=E7=94=A8=E6=9B=B4=E6=96=B0=E5=AF=86=E7=A0=81=E5=92=8C=E6=9B=B4?= =?UTF-8?q?=E6=96=B0SSH?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/userviews/users/UserProfile/ProfileInfo.vue | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/userviews/users/UserProfile/ProfileInfo.vue b/src/userviews/users/UserProfile/ProfileInfo.vue index 7a592e12d..93682a897 100644 --- a/src/userviews/users/UserProfile/ProfileInfo.vue +++ b/src/userviews/users/UserProfile/ProfileInfo.vue @@ -65,7 +65,8 @@ export default { title: this.$t('users.UpdatePassword'), attrs: { type: 'primary', - label: this.$t('common.Update') + label: this.$t('common.Update'), + disabled: this.$store.state.users.profile.source !== 'local' }, callbacks: { click: function() { @@ -77,7 +78,8 @@ export default { title: this.$t('users.UpdateSSHKey'), attrs: { type: 'primary', - label: this.$t('common.Update') + label: this.$t('common.Update'), + disabled: this.$store.state.users.profile.source !== 'local' }, callbacks: { click: function() { From 21223fddeab11b85e488e53e8d2748c757358fd5 Mon Sep 17 00:00:00 2001 From: Orange Date: Mon, 16 Nov 2020 18:36:53 +0800 Subject: [PATCH 05/13] =?UTF-8?q?perf:=20=E4=BC=98=E5=8C=96=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E8=AF=A6=E6=83=85=E4=B8=AD=E6=8E=88=E6=9D=83=E7=9A=84?= =?UTF-8?q?=E5=BA=94=E7=94=A8=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/i18n/langs/cn.json | 2 + src/i18n/langs/en.json | 2 + ...ue => UserApplicationsPermissionRules.vue} | 16 ++++--- ...teApps.vue => UserGrantedApplications.vue} | 11 +++-- src/views/users/User/UserDetail/index.vue | 48 +++++++++---------- 5 files changed, 44 insertions(+), 35 deletions(-) rename src/views/users/User/UserDetail/{UserRemoteAppPermissionRules.vue => UserApplicationsPermissionRules.vue} (72%) rename src/views/users/User/UserDetail/{UserGrantedRemoteApps.vue => UserGrantedApplications.vue} (71%) diff --git a/src/i18n/langs/cn.json b/src/i18n/langs/cn.json index 258766a3f..15ed7c8ce 100644 --- a/src/i18n/langs/cn.json +++ b/src/i18n/langs/cn.json @@ -903,6 +903,8 @@ "grantedK8Ss": "授权的Kubernetes", "grantedDatabases": "授权的数据库", "grantedRemoteApps": "授权的远程应用", + "grantedApplications": "授权的应用", + "ApplicationPermissionRules": "应用授权规则", "remoteAppPermissionRules": "远程应用授权规则" }, "dateLastLogin": "最后登录日期", diff --git a/src/i18n/langs/en.json b/src/i18n/langs/en.json index 298d2fe8b..508615069 100644 --- a/src/i18n/langs/en.json +++ b/src/i18n/langs/en.json @@ -892,6 +892,8 @@ "grantedK8Ss":"Granted K8Ss", "grantedDatabases": "Granted databases", "grantedRemoteApps": "Granted remote apps", + "grantedApplications": "Granted applications", + "ApplicationPermissionRules": "Application permission rules", "remoteAppPermissionRules": "Remote app permission rules" }, "UpdatePassword": "", diff --git a/src/views/users/User/UserDetail/UserRemoteAppPermissionRules.vue b/src/views/users/User/UserDetail/UserApplicationsPermissionRules.vue similarity index 72% rename from src/views/users/User/UserDetail/UserRemoteAppPermissionRules.vue rename to src/views/users/User/UserDetail/UserApplicationsPermissionRules.vue index ca811c3c6..2862d9de0 100644 --- a/src/views/users/User/UserDetail/UserRemoteAppPermissionRules.vue +++ b/src/views/users/User/UserDetail/UserApplicationsPermissionRules.vue @@ -18,12 +18,16 @@ export default { data() { return { tableConfig: { - url: `/api/v1/perms/remote-app-permissions/?user_id=${this.object.id}&draw=1`, - columns: ['name', 'users_amount', 'user_groups_amount', 'remote_apps_amount', 'system_users_amount', 'is_valid', 'actions'], + url: `/api/v1/perms/application-permissions/?user_id=${this.object.id}&draw=1`, + columns: [ + 'name', 'category_display', 'users_amount', 'user_groups_amount', + 'applications_amount', 'system_users_amount', + 'is_valid', 'actions' + ], columnsMeta: { name: { formatterArgs: { - route: 'RemoteAppPermissionDetail' + route: 'ApplicationPermissionDetail' }, showOverflowTooltip: true }, @@ -35,8 +39,8 @@ export default { label: this.$t('users.UserGroups'), width: '110px' }, - remote_apps_amount: { - label: this.$t('assets.RemoteApps'), + applications_amount: { + label: this.$t('assets.Applications'), width: '110px' }, system_users_amount: { @@ -48,7 +52,7 @@ export default { updateRoute: 'RemoteAppPermissionUpdate', performDelete: ({ row, col }) => { const id = row.id - const url = `/api/v1/perms/remote-app-permissions/${id}/?user_id=${this.object.id}&draw=1` + const url = `/api/v1/perms/application-permissions/${id}/?user_id=${this.object.id}&draw=1` return this.$axios.delete(url) } } diff --git a/src/views/users/User/UserDetail/UserGrantedRemoteApps.vue b/src/views/users/User/UserDetail/UserGrantedApplications.vue similarity index 71% rename from src/views/users/User/UserDetail/UserGrantedRemoteApps.vue rename to src/views/users/User/UserDetail/UserGrantedApplications.vue index 154e5f52f..20c6733e3 100644 --- a/src/views/users/User/UserDetail/UserGrantedRemoteApps.vue +++ b/src/views/users/User/UserDetail/UserGrantedApplications.vue @@ -5,7 +5,7 @@