Browse Source

REPORT-75699 fix:编辑连接时principal值与选项初始化

feature/x
Aries.lsy 3 years ago
parent
commit
27871652ab
  1. 4
      src/modules/crud/decision.api.ts
  2. 15
      src/modules/pages/maintain/forms/components/form.jdbc.ts

4
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<SocketResult> {
return new Promise(resolve => {
if (Dec && Dec.socket.connected) {

15
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({},{

Loading…
Cancel
Save