Browse Source

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

Merge in DEC/decision-webui-dcm from ~ARIES.LSY/decision-webui-dcm:feature/x to feature/x

* commit '787aa83b90e8f4778373ae9ce14f37100339d5c8':
  REPORT-75699 fix:规范方法命名
  REPORT-75699 fix:编辑连接时principal值与选项初始化
feature/x
Aries.Lsy 2 years ago
parent
commit
99e37a7c64
  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); return requestPost(`switch/principal`, value);
} }
getPrincipals(keytab: string) {
return requestGet(`/principals?keytabPath=${keytab}`, {});
}
private sendEditStatusEvent(name: string, type: string): Promise<SocketResult> { private sendEditStatusEvent(name: string, type: string): Promise<SocketResult> {
return new Promise(resolve => { return new Promise(resolve => {
if (Dec && Dec.socket.connected) { 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; } = connectionData as ConnectionJDBC;
this.oldPassword = password; this.oldPassword = password;
this.oldSshSecret = sshSecret; this.oldSshSecret = sshSecret;
!BI.isUndefined(principal) && this.initPrincipals(keyPath, principal);
const { const {
initialSize, initialSize,
@ -1335,6 +1336,20 @@ export class FormJdbc extends BI.Widget {
this.form.keyPath.setFileInfo(KerberosParams); this.form.keyPath.setFileInfo(KerberosParams);
} }
public initPrincipals(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() { public changePrincipal() {
let self = this; let self = this;
const KerberosParams = BI.extend({},{ const KerberosParams = BI.extend({},{

Loading…
Cancel
Save