From 95007a52a5aaa84c13e824536e53c21b7391309f Mon Sep 17 00:00:00 2001 From: ibuler Date: Thu, 17 Jun 2021 11:24:35 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix(assets):=20=E4=BF=AE=E5=A4=8D=E8=B5=84?= =?UTF-8?q?=E4=BA=A7=E5=88=9B=E5=BB=BA=E6=97=B6=EF=BC=8C=E6=B2=A1=E6=9C=89?= =?UTF-8?q?=E6=8A=8A=E8=8A=82=E7=82=B9=E5=B8=A6=E8=BF=87=E5=8E=BB=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/ListTable/TableAction/LeftSide.vue | 9 ++++++--- src/views/assets/Asset/AssetList.vue | 9 +++++---- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/components/ListTable/TableAction/LeftSide.vue b/src/components/ListTable/TableAction/LeftSide.vue index bc2df2fbc..d7694b545 100644 --- a/src/components/ListTable/TableAction/LeftSide.vue +++ b/src/components/ListTable/TableAction/LeftSide.vue @@ -32,7 +32,7 @@ export default { default: '' }, createRoute: { - type: [String, Object], + type: [String, Object, Function], default: function() { return this.$route.name.replace('List', 'Create') } @@ -149,10 +149,13 @@ export default { }, methods: { handleCreate() { - let route = {} + let route if (typeof this.createRoute === 'string') { + route = { name: this.createRoute } route.name = this.createRoute - } else { + } else if (typeof this.createRoute === 'function') { + route = this.createRoute() + } else if (typeof this.createRoute === 'object') { route = this.createRoute } this.$router.push(route) diff --git a/src/views/assets/Asset/AssetList.vue b/src/views/assets/Asset/AssetList.vue index 30bc28978..ea63c20be 100644 --- a/src/views/assets/Asset/AssetList.vue +++ b/src/views/assets/Asset/AssetList.vue @@ -186,10 +186,11 @@ export default { } }, headerActions: { - // canCreate: false, - createRoute: { - name: 'AssetCreate', - query: this.$route.query + createRoute: () => { + return { + name: 'AdminUserCreate', + query: this.$route.query || {} + } }, searchConfig: { options: [ From 27a78c3b23585c2f1daa606e91907b7089459f69 Mon Sep 17 00:00:00 2001 From: Bai Date: Thu, 17 Jun 2021 12:12:22 +0800 Subject: [PATCH 2/2] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9=E5=BA=94=E7=94=A8?= =?UTF-8?q?=E8=B4=A6=E5=8F=B7(k8s)=E5=AF=BC=E5=87=BA/=E6=9F=A5=E7=9C=8B?= =?UTF-8?q?=E5=9D=87=E6=98=BE=E7=A4=BAtoken=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/i18n/langs/cn.json | 3 ++- src/i18n/langs/en.json | 3 ++- .../ApplicationAccount/ApplicationAccountList.vue | 8 ++++++-- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/i18n/langs/cn.json b/src/i18n/langs/cn.json index 898f575a1..812cc9720 100644 --- a/src/i18n/langs/cn.json +++ b/src/i18n/langs/cn.json @@ -204,7 +204,8 @@ "ipDomain": "IP(域名)", "HostProtocol": "主机协议", "DatabaseProtocol": "数据库协议", - "OtherProtocol": "其它协议" + "OtherProtocol": "其它协议", + "PasswordOrToken": "密码 / 令牌" }, "audits": { "Hosts": "主机", diff --git a/src/i18n/langs/en.json b/src/i18n/langs/en.json index 041b33f26..dce4b7cb1 100644 --- a/src/i18n/langs/en.json +++ b/src/i18n/langs/en.json @@ -203,7 +203,8 @@ "ipDomain": "IP(Domain)", "HostProtocol": "Host Protocol", "DatabaseProtocol": "Database Protocol", - "OtherProtocol": "Other Protocol" + "OtherProtocol": "Other Protocol", + "PasswordOrToken": "Password / Token" }, "audits": { "Hosts": "Host", diff --git a/src/views/accounts/ApplicationAccount/ApplicationAccountList.vue b/src/views/accounts/ApplicationAccount/ApplicationAccountList.vue index 1020532ee..d7668f557 100644 --- a/src/views/accounts/ApplicationAccount/ApplicationAccountList.vue +++ b/src/views/accounts/ApplicationAccount/ApplicationAccountList.vue @@ -22,7 +22,7 @@ - + @@ -195,7 +195,11 @@ export default { this.$axios.get(`/api/v1/assets/system-users/${this.MFAInfo.systemUser.id}/auth-info/`).then(res => { this.MFAConfirmed = true this.MFAInfo.username = res.username - this.MFAInfo.password = res.password + if (res.protocol === 'k8s') { + this.MFAInfo.password = res.token + } else { + this.MFAInfo.password = res.password + } }) } else { this.showMFADialog = true