From 27871652ab2f91fd0a9c11d7dced6fa68879a9f7 Mon Sep 17 00:00:00 2001 From: "Aries.lsy" <”Aries.lsy@fanruan.com“> Date: Mon, 18 Jul 2022 18:52:19 +0800 Subject: [PATCH 1/2] =?UTF-8?q?REPORT-75699=20fix:=E7=BC=96=E8=BE=91?= =?UTF-8?q?=E8=BF=9E=E6=8E=A5=E6=97=B6principal=E5=80=BC=E4=B8=8E=E9=80=89?= =?UTF-8?q?=E9=A1=B9=E5=88=9D=E5=A7=8B=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/crud/decision.api.ts | 4 ++++ .../pages/maintain/forms/components/form.jdbc.ts | 15 +++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/src/modules/crud/decision.api.ts b/src/modules/crud/decision.api.ts index 5a5c8ce..d399399 100644 --- a/src/modules/crud/decision.api.ts +++ b/src/modules/crud/decision.api.ts @@ -124,6 +124,10 @@ export class DecisionApi implements Api { return requestPost(`switch/principal`, value); } + getPrincipals(keytab: string) { + return requestGet(`/principals?keytabPath=${keytab}`, {}); + } + private sendEditStatusEvent(name: string, type: string): Promise { return new Promise(resolve => { if (Dec && Dec.socket.connected) { diff --git a/src/modules/pages/maintain/forms/components/form.jdbc.ts b/src/modules/pages/maintain/forms/components/form.jdbc.ts index 3e1685d..9415eb7 100644 --- a/src/modules/pages/maintain/forms/components/form.jdbc.ts +++ b/src/modules/pages/maintain/forms/components/form.jdbc.ts @@ -121,6 +121,7 @@ export class FormJdbc extends BI.Widget { } = connectionData as ConnectionJDBC; this.oldPassword = password; this.oldSshSecret = sshSecret; + !BI.isUndefined(principal) && this.getPrincipals(keyPath, principal); const { initialSize, @@ -1335,6 +1336,20 @@ export class FormJdbc extends BI.Widget { this.form.keyPath.setFileInfo(KerberosParams); } + public getPrincipals(keyPath, principal) { + let self = this; + api.getPrincipals(keyPath).then(res => { + const principalsItems = BI.map(res.data, function(index, item) { + return { + text: item, + value: item + } + }); + self.form.principal.populate(principalsItems); + self.form.principal.setValue(principal); + }) + } + public changePrincipal() { let self = this; const KerberosParams = BI.extend({},{ From 787aa83b90e8f4778373ae9ce14f37100339d5c8 Mon Sep 17 00:00:00 2001 From: "Aries.lsy" <”Aries.lsy@fanruan.com“> Date: Tue, 19 Jul 2022 09:50:17 +0800 Subject: [PATCH 2/2] =?UTF-8?q?REPORT-75699=20fix:=E8=A7=84=E8=8C=83?= =?UTF-8?q?=E6=96=B9=E6=B3=95=E5=91=BD=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/pages/maintain/forms/components/form.jdbc.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/modules/pages/maintain/forms/components/form.jdbc.ts b/src/modules/pages/maintain/forms/components/form.jdbc.ts index 9415eb7..fdfce5c 100644 --- a/src/modules/pages/maintain/forms/components/form.jdbc.ts +++ b/src/modules/pages/maintain/forms/components/form.jdbc.ts @@ -121,7 +121,7 @@ export class FormJdbc extends BI.Widget { } = connectionData as ConnectionJDBC; this.oldPassword = password; this.oldSshSecret = sshSecret; - !BI.isUndefined(principal) && this.getPrincipals(keyPath, principal); + !BI.isUndefined(principal) && this.initPrincipals(keyPath, principal); const { initialSize, @@ -1336,7 +1336,7 @@ export class FormJdbc extends BI.Widget { this.form.keyPath.setFileInfo(KerberosParams); } - public getPrincipals(keyPath, principal) { + public initPrincipals(keyPath, principal) { let self = this; api.getPrincipals(keyPath).then(res => { const principalsItems = BI.map(res.data, function(index, item) {