Browse Source

Pull request #6863: REPORT-89173 fix: JNDI入口屏蔽

Merge in DEC/decision-webui-dcm from ~AUSTIN.DUAN/decision-webui-dcm:release/11.0 to release/11.0

* commit '49779bdcbd5e26f106848b9e968e6fb3628c8f48':
  无JIRA任务,处理下类型
  REPORT-89173 fix: JNDI入口屏蔽
release/11.0
Austin.Duan-段嗣跃 2 years ago
parent
commit
6c09907778
  1. 5
      src/modules/crud/api.ts
  2. 5
      src/modules/crud/decision.api.ts
  3. 4
      src/modules/crud/design.api.ts
  4. 15
      src/modules/pages/database/database.model.ts
  5. 13
      src/modules/pages/database/database.ts

5
src/modules/crud/api.ts

@ -93,4 +93,9 @@ export interface Api {
*
*/
getHyperlink(name: string): string;
/**
* JNDI数据库类型可用状态
*/
getJNDIDatabaseStatus(): Promise<{ data?: boolean }>;
}

5
src/modules/crud/decision.api.ts

@ -134,6 +134,11 @@ export class DecisionApi implements Api {
return requestPut(`kdc/timeout?timeout=${value}`, {})
}
// 获取当前lic是否可以使用JNDI数据库类型
getJNDIDatabaseStatus(): Promise<{ data?: boolean }> {
return requestGet('databasetype/limit', {});
}
private sendEditStatusEvent(name: string, type: string): Promise<SocketResult> {
return new Promise(resolve => {
if (Dec && Dec.socket.connected) {

4
src/modules/crud/design.api.ts

@ -88,4 +88,8 @@ export class DesignApi implements Api {
// 设计器获取超链
return '';
}
getJNDIDatabaseStatus() {
return Promise.resolve({ data: true });
}
}

15
src/modules/pages/database/database.model.ts

@ -2,6 +2,8 @@ import { model, Model } from '@core/core';
import { AppModel } from 'src/modules/app.model';
import { getAllDatabaseTypes } from '../../app.service';
import { DatabaseType } from '../../app.typings';
import { connectionType } from '@constants/env';
import { OTHER_JDBC } from '@constants/constant';
@model()
export class DatebaseModel extends Model<{
@ -20,8 +22,18 @@ export class DatebaseModel extends Model<{
isInternal: true,
isPlugin: true,
datebaseTypes: getAllDatabaseTypes().filter(item => item.commonly),
isJNDILimit: false,
};
}
computed = {
otherDatabases: () => {
return this.model.isJNDILimit
? [OTHER_JDBC]
: [OTHER_JDBC, connectionType.JNDI];
}
}
actions = {
setSearch: (search: string) => {
this.model.search = search;
@ -42,5 +54,8 @@ export class DatebaseModel extends Model<{
setDatebaseTypeSelected(datebaseType: string) {
this.model.datebaseTypeSelected = datebaseType;
},
setJNDILimit: (v: boolean) => {
this.model.isJNDILimit = v;
},
}
}

13
src/modules/pages/database/database.ts

@ -6,6 +6,10 @@ import { connectionType } from '@constants/env';
import { DatebaseType } from './database_type/database_type';
import { getAllDatabaseTypes } from '../../app.service';
import { ButtonGroup, MultiSelectItem, SearchEditor } from '@fui/core';
import { ApiFactory } from 'src/modules/crud/apiFactory';
const api = new ApiFactory().create();
@shortcut()
@store(DatebaseModel)
export class Datebase extends BI.Widget {
@ -65,6 +69,7 @@ export class Datebase extends BI.Widget {
mounted() {
this.store.setFilter(DATEBASE_FILTER_TYPE.COMMONLY);
this.store.setDatebaseTypeSelected('');
this.getDatabaseTypeLimit();
}
render() {
@ -250,11 +255,17 @@ export class Datebase extends BI.Widget {
this.store.setDatebaseTypes(this.allDatabaseTypes.filter(item => item.commonly));
break;
case DATEBASE_FILTER_TYPE.OTHER:
this.store.setDatebaseTypes(this.allDatabaseTypes.filter(item => item.type === connectionType.JNDI || item.type === OTHER_JDBC));
this.store.setDatebaseTypes(this.allDatabaseTypes.filter(item => this.model.otherDatabases.includes(item.type)));
break;
default:
this.store.setDatebaseTypes(this.allDatabaseTypes.filter(item => item.type !== connectionType.JNDI && item.type !== OTHER_JDBC));
break;
}
}
// 获取JNDI
private async getDatabaseTypeLimit() {
const result = await api.getJNDIDatabaseStatus();
this.store.setJNDILimit(result);
}
}

Loading…
Cancel
Save