Browse Source

Merge pull request #1130 in DEC/decision-webui-dcm from bugfix/10.0 to feature/10.0

* commit '0ed1f93a9f665658f21eaf4bcf6df3b657b24322':
  KERNEL-6541 修改xtype写法
research/11.0
superman 4 years ago
parent
commit
34ca564981
  1. 4
      src/index.ts
  2. 7
      src/modules/app.model.ts
  3. 28
      src/modules/app.ts
  4. 5
      src/modules/components/collapse/collapse.model.ts
  5. 9
      src/modules/components/collapse/collapse.ts
  6. 5
      src/modules/components/link_button/link.ts
  7. 5
      src/modules/components/test_status/test_status.model.ts
  8. 35
      src/modules/components/test_status/test_status.ts
  9. 6
      src/modules/components/test_status/tip_icon/tip_fail.model.ts
  10. 23
      src/modules/components/test_status/tip_icon/tip_fail.ts
  11. 5
      src/modules/components/test_status/tip_icon/tip_icon.ts
  12. 6
      src/modules/components/text_checker/text_checker.ts
  13. 42
      src/modules/core/core.ts
  14. 5
      src/modules/pages/connection/components/form_item/form_item.ts
  15. 22
      src/modules/pages/connection/connection.model.ts
  16. 25
      src/modules/pages/connection/connection.ts
  17. 16
      src/modules/pages/connection/connection_jdbc/connection_jdbc.model.ts
  18. 60
      src/modules/pages/connection/connection_jdbc/connection_jdbc.ts
  19. 15
      src/modules/pages/connection/connection_jndi/connection_jndi.model.ts
  20. 51
      src/modules/pages/connection/connection_jndi/connection_jndi.ts
  21. 17
      src/modules/pages/connection/connection_plugin/connection_plugin.model.ts
  22. 9
      src/modules/pages/connection/connection_plugin/connection_plugin.ts
  23. 16
      src/modules/pages/connection/list/list.model.ts
  24. 14
      src/modules/pages/connection/list/list.ts
  25. 26
      src/modules/pages/connection/list/list_item/list_item.model.ts
  26. 9
      src/modules/pages/connection/list/list_item/list_item.ts
  27. 17
      src/modules/pages/connection_pool/connection_pool.model.ts
  28. 17
      src/modules/pages/connection_pool/connection_pool.ts
  29. 13
      src/modules/pages/connection_pool/list_item/list_item.model.ts
  30. 9
      src/modules/pages/connection_pool/list_item/list_item.ts
  31. 14
      src/modules/pages/connection_pool/pool/pool.model.ts
  32. 9
      src/modules/pages/connection_pool/pool/pool.ts
  33. 16
      src/modules/pages/database/database.model.ts
  34. 21
      src/modules/pages/database/database.ts
  35. 12
      src/modules/pages/database/database.typings.d.ts
  36. 15
      src/modules/pages/database/database_type/database_type.model.ts
  37. 9
      src/modules/pages/database/database_type/database_type.ts
  38. 13
      src/modules/pages/database/filter/filter.model.ts
  39. 8
      src/modules/pages/database/filter/filter.ts
  40. 10
      src/modules/pages/index.ts
  41. 6
      src/modules/pages/maintain/components/form_item/form_item.ts
  42. 104
      src/modules/pages/maintain/forms/components/form.jdbc.ts
  43. 54
      src/modules/pages/maintain/forms/components/form.jndi.ts
  44. 4
      src/modules/pages/maintain/forms/components/form.plugin.ts
  45. 38
      src/modules/pages/maintain/forms/form.model.ts
  46. 8
      src/modules/pages/maintain/forms/form.server.ts
  47. 24
      src/modules/pages/maintain/forms/form.ts
  48. 23
      src/modules/pages/maintain/maintain.model.ts
  49. 17
      src/modules/pages/maintain/maintain.ts
  50. 16
      src/modules/title/title.model.ts
  51. 13
      src/modules/title/title.ts
  52. 16
      src/modules/title/title_database/title_datebase.model.ts
  53. 10
      src/modules/title/title_database/title_datebase.ts
  54. 23
      src/modules/title/title_maintain/title_maintain.model.ts
  55. 11
      src/modules/title/title_maintain/title_maintain.ts

4
src/index.ts

@ -1,5 +1,5 @@
import { AppXtype } from './modules/app';
import { App } from './modules/app';
BI.createWidget({
type: AppXtype,
type: App.xtype,
element: '#wrapper',
});

7
src/modules/app.model.ts

@ -2,11 +2,12 @@ import { PAGE_INDEX, DATEBASE_FILTER_TYPE } from './constants/constant';
import { Model, model } from '@core/core';
import { Connection } from 'src/modules/crud/crud.typings';
import { getAllDatabaseTypes } from './app.service';
export const AppModelXtype = 'dec.dcm.model.main';
@model(AppModelXtype)
@model()
export class AppModel extends Model {
childContext = ['pageIndex', 'datebaseTypeSelected', 'datebaseTypeSelectedOne', 'filter', 'connections', 'connectionSelected', 'connectionSelectedOne', 'saveEvent', 'testEvent', 'isCopy'];
static xtype = 'dec.dcm.model.main';
childContext = <const>['pageIndex', 'datebaseTypeSelected', 'datebaseTypeSelectedOne', 'filter', 'connections', 'connectionSelected', 'connectionSelectedOne', 'saveEvent', 'testEvent', 'isCopy'];
state() {
return {

28
src/modules/app.ts

@ -1,16 +1,20 @@
import { shortcut, store } from '@core/core';
import { TitleXtype } from './title/title';
import { Title } from './title/title';
import { PAGE_INDEX } from './constants/constant';
import { ConnectionXtype, DatebaseXtype, MaintainXtype, ConnectionPoolXtype } from './pages';
import { AppModel, AppModelXtype } from './app.model';
import { Connection } from './pages/connection/connection';
import { AppModel } from './app.model';
import { Tab } from '@fui/core';
import { Datebase } from './pages/database/database';
import { Maintain } from './pages/maintain/maintain';
import { ConnectionPool } from './pages/connection_pool/connection_pool';
import './app.provider';
import '../less/index.less';
import { Tab } from '@fui/core';
export const AppXtype = 'dec.dcm.main';
@store(AppModelXtype)
@shortcut(AppXtype)
@shortcut()
@store(AppModel)
export class App extends BI.Widget {
static xtype = 'dec.dcm.main';
tab: Tab;
store: AppModel['store'];
@ -28,7 +32,7 @@ export class App extends BI.Widget {
items: [
{
el: {
type: TitleXtype,
type: Title.xtype,
cls: 'bi-border-bottom',
},
height: 40,
@ -50,19 +54,19 @@ export class App extends BI.Widget {
switch (index) {
case PAGE_INDEX.CONNECTION:
return {
type: ConnectionXtype,
type: Connection.xtype,
};
case PAGE_INDEX.DATEBASE:
return {
type: DatebaseXtype,
type: Datebase.xtype,
};
case PAGE_INDEX.MAINTAIN:
return {
type: MaintainXtype,
type: Maintain.xtype,
};
default:
return {
type: ConnectionPoolXtype,
type: ConnectionPool.xtype,
};
}
},

5
src/modules/components/collapse/collapse.model.ts

@ -1,8 +1,9 @@
import { model, Model } from '@core/core';
export const CollapseModelXtype = 'dec.dcm.model.components.collapse';
@model(CollapseModelXtype)
@model()
export class CollapseModel extends Model {
static xtype = 'dec.dcm.model.components.collapse';
state() {
return {
isCollapse: true,

9
src/modules/components/collapse/collapse.ts

@ -1,12 +1,13 @@
import { shortcut, store } from '@core/core';
import { CollapseModel, CollapseModelXtype } from './collapse.model';
import { CollapseModel } from './collapse.model';
import { IconLabel } from '@fui/core';
export const EVENT_CHANGE = 'EVENT_CHANGE';
export const CollapseXtype = 'dec.dcm.components.collapse';
@shortcut(CollapseXtype)
@store(CollapseModelXtype)
@shortcut()
@store(CollapseModel)
export class Collapse extends BI.BasicButton {
static xtype = 'dec.dcm.components.collapse';
props = {
name: '',
isCollapse: true,

5
src/modules/components/link_button/link.ts

@ -1,10 +1,11 @@
import { shortcut } from '@core/core';
import { Label } from '@fui/core';
export const LinkXtype = 'dec.dcm.components.link.button';
const DEFAULT_LINK = '/';
@shortcut(LinkXtype)
@shortcut()
export class LinkButton extends BI.BasicButton {
static xtype = 'dec.dcm.components.link.button';
props: {
text: string;
cls: string;

5
src/modules/components/test_status/test_status.model.ts

@ -1,8 +1,9 @@
import { model, Model } from '@core/core';
import { TEST_STATUS } from '@constants/constant';
export const TestStatusModelXtype = 'dec.dcm.model.components.test_status';
@model(TestStatusModelXtype)
@model()
export class TestStatusModel extends Model {
static xtype = 'dec.dcm.model.components.test_status';
state() {
return {
status: TEST_STATUS.LOADING,

35
src/modules/components/test_status/test_status.ts

@ -1,17 +1,16 @@
import { shortcut, store } from '@core/core';
import { TestStatusModelXtype, TestStatusModel } from './test_status.model';
import { TestStatusModel } from './test_status.model';
import { TEST_STATUS } from '@constants/constant';
import { TipIconXtype } from './tip_icon/tip_icon';
import { TipFailXtype, EVENT_CLOSE, EVENT_RELOAD, EVENT_DETAIL } from './tip_icon/tip_fail';
import { TipIcon } from './tip_icon/tip_icon';
import { TipFail } from './tip_icon/tip_fail';
import { FloatLeftLayout, Label, Tab, VerticalLayout } from '@fui/core';
export const TestStatusXtype = 'dec.dcm.components.test_status';
export {
EVENT_CLOSE,
EVENT_RELOAD,
};
@shortcut(TestStatusXtype)
@store(TestStatusModelXtype)
@shortcut()
@store(TestStatusModel)
export class TestStatus extends BI.Widget {
static xtype = 'dec.dcm.components.test_status';
static EVENT_CLOSE = 'EVENT_CLOSE';
static EVENT_RELOAD = 'EVENT_RELOAD';
props = {
loadingCls: '',
loadingText: '',
@ -61,32 +60,32 @@ export class TestStatus extends BI.Widget {
switch (index) {
case TEST_STATUS.SUCCESS:
return {
type: TipIconXtype,
type: TipIcon.xtype,
tipCls: successCls,
tipText: successText,
};
case TEST_STATUS.FAIL:
return {
type: TipFailXtype,
type: TipFail.xtype,
tipCls: failCls,
tipText: failText,
retryText,
listeners: [
{
eventName: EVENT_RELOAD,
eventName: TipFail.EVENT_RELOAD,
action: () => {
this.fireEvent(EVENT_RELOAD);
this.fireEvent(TestStatus.EVENT_RELOAD);
this.detail.setVisible(false);
},
},
{
eventName: EVENT_CLOSE,
eventName: TipFail.EVENT_CLOSE,
action: () => {
this.fireEvent(EVENT_CLOSE);
this.fireEvent(TestStatus.EVENT_CLOSE);
},
},
{
eventName: EVENT_DETAIL,
eventName: TipFail.EVENT_DETAIL,
action: (isCollapse: boolean) => {
this.tab.setHeight(isCollapse ? 250 : 200);
this.detail.setVisible(!isCollapse);
@ -96,7 +95,7 @@ export class TestStatus extends BI.Widget {
};
default:
return {
type: TipIconXtype,
type: TipIcon.xtype,
tipCls: loadingCls,
tipText: loadingText,
};

6
src/modules/components/test_status/tip_icon/tip_fail.model.ts

@ -1,7 +1,9 @@
import { model, Model } from '@core/core';
export const TipFailModelXtype = 'dec.dcm.model.components.test_status.tip_fail';
@model(TipFailModelXtype)
@model()
export class TipFailModel extends Model {
static xtype = 'dec.dcm.model.components.test_status.tip_fail';
context: ['isCollapse'];
state() {

23
src/modules/components/test_status/tip_icon/tip_fail.ts

@ -1,13 +1,16 @@
import { shortcut, store } from '@core/core';
import { Button } from '@fui/core';
import { TipFailModel, TipFailModelXtype } from './tip_fail.model';
export const TipFailXtype = 'dec.dcm.components.test_status.tip_fail';
export const EVENT_CLOSE = 'EVENT_CLOSE';
export const EVENT_RELOAD = 'EVENT_RELOAD';
export const EVENT_DETAIL = 'EVENT_DETAIL';
@shortcut(TipFailXtype)
@store(TipFailModelXtype)
import { TipFailModel } from './tip_fail.model';
@shortcut()
@store(TipFailModel)
export class TipFail extends BI.Widget {
static xtype = 'dec.dcm.components.test_status.tip_fail';
static EVENT_CLOSE = 'EVENT_CLOSE';
static EVENT_RELOAD = 'EVENT_RELOAD';
static EVENT_DETAIL = 'EVENT_DETAIL';
props = {
tipCls: '',
tipText: '',
@ -64,7 +67,7 @@ export class TipFail extends BI.Widget {
},
handler: () => {
this.store.setIsCollapse(!this.model.isCollapse);
this.fireEvent(EVENT_DETAIL, !this.model.isCollapse);
this.fireEvent(TipFail.EVENT_DETAIL, !this.model.isCollapse);
},
},
{
@ -72,14 +75,14 @@ export class TipFail extends BI.Widget {
text: BI.i18nText('Dec-Dcm_Back'),
level: 'ignore',
handler: () => {
this.fireEvent(EVENT_CLOSE);
this.fireEvent(TipFail.EVENT_CLOSE);
},
},
{
type: BI.Button.xtype,
text: retryText,
handler: () => {
this.fireEvent(EVENT_RELOAD);
this.fireEvent(TipFail.EVENT_RELOAD);
},
},
],

5
src/modules/components/test_status/tip_icon/tip_icon.ts

@ -1,7 +1,8 @@
import { shortcut } from '@core/core';
export const TipIconXtype = 'dec.dcm.components.test_status.tip_icon';
@shortcut(TipIconXtype)
@shortcut()
export class TipIcon extends BI.Widget {
static xtype = 'dec.dcm.components.test_status.tip_icon';
props = {
tipCls: '',
tipText: '',

6
src/modules/components/text_checker/text_checker.ts

@ -1,8 +1,10 @@
import { shortcut } from '@core/core';
import { Label, TextEditor } from '@fui/core';
export const TextCheckerXtype = 'dec.dcm.components.text_checker';
@shortcut(TextCheckerXtype)
@shortcut()
export class TextChecker extends BI.Widget {
static xtype = 'dec.dcm.components.text_checker';
props = {
width: 300,
allowBlank: true,

42
src/modules/core/core.ts

@ -1,43 +1,3 @@
type Constructor<T> = new(...args: any[]) => T;
export function shortcut(className: string) {
return function decorator<U>(Base: Constructor<U>): void {
BI.shortcut(className, Base);
};
}
export function store(modelName: string) {
return function decorator<U>(Base: Constructor<U>): void {
Base.prototype._store = () => BI.Models.getModel(modelName);
};
}
export function model(className: string) {
return function decorator<U>(Base: Constructor<U>): void {
BI.model(className, Base);
};
}
export class Model<U extends {context?: {[key: string]: any}} = {}> extends Fix.Model {
model: {[key in keyof U['context']]: U['context'][key]} & {[key in keyof ReturnType<this['state']>]: ReturnType<this['state']>[key]} & {[key in keyof this['computed']]: ReturnType<this['computed'][key]>} & {[key: string]: undefined};
store: this['actions'];
state(): {[key: string]: any} {
return {};
}
// context: Partial<keyof U['context']>;
context: string[];
actions:{[key: string]: (...args: any[]) => any};
// childContext: (keyof this['$$childContext'])[];
childContext: string[];
$$childContext: {[key in keyof this['computed']]: ReturnType<this['computed'][key]>} & {[key in keyof ReturnType<this['state']>]: ReturnType<this['state']>[key]};
computed: {[key: string]: () => any};
}
export const { shortcut, model, store, Model, provider } = BI.Decorators;

5
src/modules/pages/connection/components/form_item/form_item.ts

@ -1,7 +1,8 @@
import { shortcut } from '@core/core';
export const FormItemXtype = 'dec.dcm.connection_form_item';
@shortcut(FormItemXtype)
@shortcut()
export class FormItem extends BI.Widget {
static xtype = 'dec.dcm.connection_form_item';
props = {
name: '',
value: '',

22
src/modules/pages/connection/connection.model.ts

@ -2,18 +2,20 @@ import { model, Model } from '@core/core';
import { AppModel } from '../../app.model';
import { ApiFactory } from 'src/modules/crud/apiFactory';
const api = new ApiFactory().create();
export const ConnectionModelXtype = 'dec.dcm.model.connection';
@model(ConnectionModelXtype)
@model()
export class ConnectionModel extends Model<{
context : {
pageIndex: AppModel['$$childContext']['pageIndex'];
connections: AppModel['$$childContext']['connections'];
connectionSelected: AppModel['$$childContext']['connectionSelected'];
connectionSelectedOne: AppModel['$$childContext']['connectionSelectedOne'];
datebaseTypeSelected: AppModel['$$childContext']['datebaseTypeSelected'];
}
types : {
pageIndex: AppModel['TYPE']['pageIndex'];
connections: AppModel['TYPE']['connections'];
connectionSelected: AppModel['TYPE']['connectionSelected'];
connectionSelectedOne: AppModel['TYPE']['connectionSelectedOne'];
datebaseTypeSelected: AppModel['TYPE']['datebaseTypeSelected'];
},
context: ConnectionModel['context'];
}> {
context = ['pageIndex', 'connectionSelected', 'connectionSelectedOne', 'datebaseTypeSelected'];
static xtype = 'dec.dcm.model.connection';
context = <const>['pageIndex', 'connectionSelected', 'connectionSelectedOne', 'datebaseTypeSelected'];
actions = {
setPageIndex:(index: string) => {

25
src/modules/pages/connection/connection.ts

@ -1,19 +1,20 @@
import { shortcut, store } from '@core/core';
import { ConnectionModel, ConnectionModelXtype } from './connection.model';
import { ConnectionModel } from './connection.model';
import { PAGE_INDEX } from '@constants/constant';
import { ConnectionListXtype } from './list/list';
import { ConnectionJdbcXtype } from './connection_jdbc/connection_jdbc';
import { ConnectionJndiXtype } from './connection_jndi/connection_jndi';
import { ConnectionPluginXtype } from './connection_plugin/connection_plugin';
import { ConnectionList } from './list/list';
import { ConnectionJdbc } from './connection_jdbc/connection_jdbc';
import { ConnectionJndi } from './connection_jndi/connection_jndi';
import { ConnectionPlugin } from './connection_plugin/connection_plugin';
import { connectionType } from '@constants/env';
import { getAllDatabaseTypes, connectionCanEdit, getJdbcDatabaseType, getTextByDatabaseType } from '../../app.service';
import { ConnectionJDBC } from '../../crud/crud.typings';
import { Button, HTapeLayout, Label, ListView } from '@fui/core';
export const ConnectionXtype = 'dec.dcm.connection';
@shortcut(ConnectionXtype)
@store(ConnectionModelXtype)
@shortcut()
@store(ConnectionModel)
export class Connection extends BI.Widget {
static xtype = 'dec.dcm.connection';
store: ConnectionModel['store'];
model: ConnectionModel['model'];
@ -72,7 +73,7 @@ export class Connection extends BI.Widget {
height: 40,
},
{
type: ConnectionListXtype,
type: ConnectionList.xtype,
tgap: 10,
},
],
@ -143,15 +144,15 @@ export class Connection extends BI.Widget {
switch (this.model.connectionSelectedOne.connectionType) {
case connectionType.JDBC:
return [{
type: ConnectionJdbcXtype,
type: ConnectionJdbc.xtype,
}];
case connectionType.JNDI:
return [{
type: ConnectionJndiXtype,
type: ConnectionJndi.xtype,
}];
default:
return [{
type: ConnectionPluginXtype,
type: ConnectionPlugin.xtype,
}];
}
}

16
src/modules/pages/connection/connection_jdbc/connection_jdbc.model.ts

@ -1,11 +1,13 @@
import { model, Model } from '@core/core';
import { ConnectionModel } from '../connection.model';
export const ConnectionJdbcModelXtype = 'dec.dcm.model.connection_jdbc';
@model(ConnectionJdbcModelXtype)
import { AppModel } from '../../../app.model';
@model()
export class ConnectionJdecModel extends Model<{
context : {
connectionSelectedOne: ConnectionModel['$$childContext']['connectionSelectedOne'];
}
types : {
connectionSelectedOne: AppModel['TYPE']['connectionSelectedOne'];
},
context: ConnectionJdecModel['context'];
}> {
context = ['connectionSelectedOne'];
static xtype = 'dec.dcm.model.connection_jdbc';
context = <const>['connectionSelectedOne'];
}

60
src/modules/pages/connection/connection_jdbc/connection_jdbc.ts

@ -1,17 +1,17 @@
import { shortcut, store } from '@core/core';
import { FormItemXtype } from '../components/form_item/form_item';
import { CollapseXtype, EVENT_CHANGE } from 'src/modules/components/collapse/collapse';
import { ConnectionJdbcModelXtype, ConnectionJdecModel } from './connection_jdbc.model';
import { FormItem } from '../components/form_item/form_item';
import { Collapse, EVENT_CHANGE } from 'src/modules/components/collapse/collapse';
import { ConnectionJdecModel } from './connection_jdbc.model';
import { ConnectionJDBC } from 'src/modules/crud/crud.typings';
import { getAllDatabaseTypes, getJdbcDatabaseType, resolveUrlInfo } from '../../../app.service';
import { CONNECTION_LAYOUT } from '@constants/constant';
import { VerticalLayout } from '@fui/core';
export const ConnectionJdbcXtype = 'dec.dcm.connection_jdbc';
@shortcut(ConnectionJdbcXtype)
@store(ConnectionJdbcModelXtype)
@shortcut()
@store(ConnectionJdecModel)
export class ConnectionJdbc extends BI.Widget {
advancedSet: any;
static xtype = 'dec.dcm.connection_jdbc';
advancedSet: any;
model: ConnectionJdecModel['model'];
allDatabaseTypes = getAllDatabaseTypes();
@ -28,61 +28,61 @@ export class ConnectionJdbc extends BI.Widget {
vgap,
items: [
{
type: FormItemXtype,
type: FormItem.xtype,
name: BI.i18nText('Dec-Dcm_Connection_Form_Driver'),
value: driver,
},
{
type: FormItemXtype,
type: FormItem.xtype,
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Name'),
value: databaseName,
},
{
type: FormItemXtype,
type: FormItem.xtype,
name: BI.i18nText('Dec-Dcm_Connection_Form_Host'),
value: host,
},
{
type: FormItemXtype,
type: FormItem.xtype,
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Port'),
value: port,
},
authType ?
{
type: FormItemXtype,
type: FormItem.xtype,
name: BI.i18nText('Dec-Dcm_Connection_Form_AuthType'),
value: authType,
} : {
type: BI.Layout.xtype,
},
{
type: FormItemXtype,
type: FormItem.xtype,
name: authType ? BI.i18nText('Dec-Dcm_Connection_Form_Principal') : BI.i18nText('Dec-Dcm_Connection_Form_UserName'),
value: authType ? principal : user,
},
{
type: FormItemXtype,
type: FormItem.xtype,
name: authType ? BI.i18nText('Dec-Dcm_Connection_Form_KeyPath') : BI.i18nText('Dec-Dcm_Connection_Form_Password'),
value: '******',
},
{
type: FormItemXtype,
type: FormItem.xtype,
name: BI.i18nText('Dec-Dcm_Connection_Form_OriginalCharsetName'),
value: originalCharsetName ? originalCharsetName : BI.i18nText('Dec-Dcm_Connection_Form_Auto'),
},
{
type: FormItemXtype,
type: FormItem.xtype,
name: BI.i18nText('Dec-Dcm_Connection_Form_Pattern'),
value: schema,
invisible: !databaseType.hasSchema,
},
{
type: FormItemXtype,
type: FormItem.xtype,
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_URL'),
value: url,
},
{
type: CollapseXtype,
type: Collapse.xtype,
width: 70,
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Advanced_Setting'),
listeners: [
@ -104,64 +104,64 @@ export class ConnectionJdbc extends BI.Widget {
},
items: [
{
type: FormItemXtype,
type: FormItem.xtype,
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Initial_Size'),
value: connectionPoolAttr.initialSize,
},
{
type: FormItemXtype,
type: FormItem.xtype,
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Max_Active'),
value: connectionPoolAttr.maxActive,
},
{
type: FormItemXtype,
type: FormItem.xtype,
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Max_Idle'),
value: connectionPoolAttr.maxIdle,
},
{
type: FormItemXtype,
type: FormItem.xtype,
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Min_Idle'),
value: connectionPoolAttr.minIdle,
},
{
type: FormItemXtype,
type: FormItem.xtype,
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Max_Wait'),
value: connectionPoolAttr.maxWait,
unit: BI.i18nText('Dec-Dcm_Millisecond'),
},
{
type: FormItemXtype,
type: FormItem.xtype,
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Validation_Query'),
value: connectionPoolAttr.validationQuery,
},
{
type: FormItemXtype,
type: FormItem.xtype,
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Test_On_Borrow'),
value: connectionPoolAttr.testOnBorrow ? BI.i18nText('Dec-Dcm_Yes') : BI.i18nText('Dec-Dcm_No'),
},
{
type: FormItemXtype,
type: FormItem.xtype,
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Test_On_Return'),
value: connectionPoolAttr.testOnReturn ? BI.i18nText('Dec-Dcm_Yes') : BI.i18nText('Dec-Dcm_No'),
},
{
type: FormItemXtype,
type: FormItem.xtype,
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Test_While_Idle'),
value: connectionPoolAttr.testWhileIdle ? BI.i18nText('Dec-Dcm_Yes') : BI.i18nText('Dec-Dcm_No'),
},
{
type: FormItemXtype,
type: FormItem.xtype,
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Test_Between_Eviction_Millis'),
value: connectionPoolAttr.timeBetweenEvictionRunsMillis,
unit: BI.i18nText('Dec-Dcm_Millisecond'),
},
{
type: FormItemXtype,
type: FormItem.xtype,
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Tests_PerEviction_Run_Num'),
value: connectionPoolAttr.numTestsPerEvictionRun,
},
{
type: FormItemXtype,
type: FormItem.xtype,
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Min_Evictable_Idle_Time_Millis'),
value: connectionPoolAttr.minEvictableIdleTimeMillis,
unit: BI.i18nText('BI-Basic_Seconds'),

15
src/modules/pages/connection/connection_jndi/connection_jndi.model.ts

@ -1,11 +1,12 @@
import { AppModel } from 'src/modules/app.model';
import { model, Model } from '@core/core';
import { ConnectionModel } from '../connection.model';
export const ConnectionJndiModelXtype = 'dec.dcm.model.connection_jndi';
@model(ConnectionJndiModelXtype)
@model()
export class ConnectionJndiModel extends Model<{
context : {
connectionSelectedOne: ConnectionModel['$$childContext']['connectionSelectedOne'];
}
types : {
connectionSelectedOne: AppModel['TYPE']['connectionSelectedOne'];
},
context: ConnectionJndiModel['context'];
}> {
context = ['connectionSelectedOne'];
static xtype = 'dec.dcm.model.connection_jndi';
context = <const>['connectionSelectedOne'];
}

51
src/modules/pages/connection/connection_jndi/connection_jndi.ts

@ -1,15 +1,16 @@
import { shortcut, store } from '@core/core';
import { FormItemXtype } from '../components/form_item/form_item';
import { ConnectionJndiModelXtype, ConnectionJndiModel } from './connection_jndi.model';
import { FormItem } from '../components/form_item/form_item';
import { ConnectionJndiModel } from './connection_jndi.model';
import { ConnectionJNDI } from 'src/modules/crud/crud.typings';
import { CollapseXtype, EVENT_CHANGE } from 'src/modules/components/collapse/collapse';
import { Collapse, EVENT_CHANGE } from 'src/modules/components/collapse/collapse';
import { CONNECTION_LAYOUT } from '@constants/constant';
import { VerticalLayout } from '@fui/core';
export const ConnectionJndiXtype = 'dec.dcm.connection_jndi';
@shortcut(ConnectionJndiXtype)
@store(ConnectionJndiModelXtype)
export class ConnectionJdbc extends BI.Widget {
@shortcut()
@store(ConnectionJndiModel)
export class ConnectionJndi extends BI.Widget {
static xtype = 'dec.dcm.connection_jndi';
model: ConnectionJndiModel['model'];
advancedSet: VerticalLayout;
@ -26,7 +27,7 @@ export class ConnectionJdbc extends BI.Widget {
vgap,
items: [
{
type: FormItemXtype,
type: FormItem.xtype,
nameWidth: 200,
name: BI.i18nText('Dec-Dcm_Connection_JNDI_Form_ConnectionName'),
value: jndiName,
@ -55,28 +56,28 @@ export class ConnectionJdbc extends BI.Widget {
height: 115,
items: [
{
type: FormItemXtype,
type: FormItem.xtype,
name: 'INTIAL_CONTEXT_FACTORY',
nameWidth: 200,
isBold: false,
value: contextHashtable['java.naming.factory.initial'],
},
{
type: FormItemXtype,
type: FormItem.xtype,
name: 'PROVIDER_URL',
nameWidth: 200,
isBold: false,
value: contextHashtable['java.naming.provider.url'],
},
{
type: FormItemXtype,
type: FormItem.xtype,
name: 'SECURITY_PRINCIPAL',
nameWidth: 200,
isBold: false,
value: contextHashtable['java.naming.security.principal'],
},
{
type: FormItemXtype,
type: FormItem.xtype,
name: 'SECURITY_CREDENTIALS',
nameWidth: 200,
isBold: false,
@ -88,13 +89,13 @@ export class ConnectionJdbc extends BI.Widget {
],
},
{
type: FormItemXtype,
type: FormItem.xtype,
nameWidth: 200,
name: BI.i18nText('Dec-Dcm_Connection_Form_OriginalCharsetName'),
value: originalCharsetName ? originalCharsetName : BI.i18nText('Dec-Dcm_Connection_Form_Auto'),
},
{
type: CollapseXtype,
type: Collapse.xtype,
width: 70,
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Advanced_Setting'),
listeners: [
@ -116,67 +117,67 @@ export class ConnectionJdbc extends BI.Widget {
},
items: [
{
type: FormItemXtype,
type: FormItem.xtype,
nameWidth: 200,
name: 'OBJECT_FACTORIES',
value: contextHashtable['java.naming.factory.object'],
},
{
type: FormItemXtype,
type: FormItem.xtype,
nameWidth: 200,
name: 'STATE_FACTORIES',
value: contextHashtable['java.naming.factory.state'],
},
{
type: FormItemXtype,
type: FormItem.xtype,
nameWidth: 200,
name: 'URL_PKG_PREFIXES',
value: contextHashtable['java.naming.factory.url.pkgs'],
},
{
type: FormItemXtype,
type: FormItem.xtype,
nameWidth: 200,
name: 'DNS_URL',
value: contextHashtable['java.naming.dns.url'],
},
{
type: FormItemXtype,
type: FormItem.xtype,
nameWidth: 200,
name: 'AUTHORITATIVE',
value: contextHashtable['java.naming.authoritative'],
},
{
type: FormItemXtype,
type: FormItem.xtype,
nameWidth: 200,
name: 'BATCHSIZE',
value: contextHashtable['java.naming.batchsize'],
},
{
type: FormItemXtype,
type: FormItem.xtype,
nameWidth: 200,
name: 'REFERRAL',
value: contextHashtable['java.naming.referral'],
},
{
type: FormItemXtype,
type: FormItem.xtype,
nameWidth: 200,
name: 'SECURITY_PROTOCOL',
value: contextHashtable['java.naming.security.protocol'],
},
{
type: FormItemXtype,
type: FormItem.xtype,
nameWidth: 200,
name: 'SECURITY_AUTHENTICATION',
value: contextHashtable['java.naming.security.authentication'],
},
{
type: FormItemXtype,
type: FormItem.xtype,
nameWidth: 200,
name: 'LANGUAGE',
value: contextHashtable['java.naming.language'],
},
{
type: FormItemXtype,
type: FormItem.xtype,
nameWidth: 200,
name: 'APPLET',
value: contextHashtable['java.naming.applet'],

17
src/modules/pages/connection/connection_plugin/connection_plugin.model.ts

@ -1,11 +1,14 @@
import { AppModel } from '../../../app.model';
import { model, Model } from '@core/core';
import { ConnectionModel } from '../connection.model';
export const ConnectionPluginModelXtype = 'dec.dcm.model.connection_plugin';
@model(ConnectionPluginModelXtype)
@model()
export class ConnectionPluginModel extends Model<{
context : {
connectionSelectedOne: ConnectionModel['$$childContext']['connectionSelectedOne'];
}
types : {
connectionSelectedOne: AppModel['TYPE']['connectionSelectedOne'];
},
context: ConnectionPluginModel['context'];
}> {
context = ['connectionSelectedOne'];
static xtype = 'dec.dcm.model.connection_plugin';
context = <const>['connectionSelectedOne'];
}

9
src/modules/pages/connection/connection_plugin/connection_plugin.ts

@ -1,10 +1,11 @@
import { shortcut, store } from '@core/core';
import { ConnectionPluginModelXtype, ConnectionPluginModel } from './connection_plugin.model';
import { ConnectionPluginModel } from './connection_plugin.model';
import { getPluginWidgetShow } from 'src/modules/app.service';
export const ConnectionPluginXtype = 'dec.dcm.connection_plugin';
@shortcut(ConnectionPluginXtype)
@store(ConnectionPluginModelXtype)
@shortcut()
@store(ConnectionPluginModel)
export class ConnectionPlugin extends BI.Widget {
static xtype = 'dec.dcm.connection_plugin';
model: ConnectionPluginModel['model'];
render () {

16
src/modules/pages/connection/list/list.model.ts

@ -2,15 +2,17 @@ import { model, Model } from '@core/core';
import { ApiFactory } from '../../..//crud/apiFactory';
import { AppModel } from '../../../app.model';
const api = new ApiFactory().create();
export const ConnectionListModelXtype = 'dec.dcm.model.connection.list';
@model(ConnectionListModelXtype)
@model()
export class ConnectionListModel extends Model<{
context : {
connections: AppModel['$$childContext']['connections'];
connectionSelected: AppModel['$$childContext']['connectionSelected'];
}
types : {
connections: AppModel['TYPE']['connections'];
connectionSelected: AppModel['TYPE']['connectionSelected'];
},
context: ConnectionListModel['context'];
}> {
context = ['connections', 'connectionSelected'];
static xtype = 'dec.dcm.model.connection.list';
context = <const>['connections', 'connectionSelected'];
computed = {
shwoType: () => BI.size(this.model.connections) > 0 ? 'list' : 'none',

14
src/modules/pages/connection/list/list.ts

@ -1,12 +1,14 @@
import { shortcut, store } from '@core/core';
import { ListItemXtype } from './list_item/list_item';
import { ConnectionListModel, ConnectionListModelXtype } from './list.model';
import { ListItem } from './list_item/list_item';
import { ConnectionListModel } from './list.model';
import { getDatabaseType } from './list.service';
import { Tab } from '@fui/core';
export const ConnectionListXtype = 'dec.dcm.connection.list';
@shortcut(ConnectionListXtype)
@store(ConnectionListModelXtype)
@shortcut()
@store(ConnectionListModel)
export class ConnectionList extends BI.LoadingPane {
static xtype = 'dec.dcm.connection.list';
store: ConnectionListModel['store'];
model: ConnectionListModel['model'];
@ -83,7 +85,7 @@ export class ConnectionList extends BI.LoadingPane {
private renderList(start = 0, end = 0) {
return this.model.connections.slice(start, end).map((item, index) => {
return {
type: ListItemXtype,
type: ListItem.xtype,
name: item.connectionName,
value: item.connectionName,
creator: item.creator,

26
src/modules/pages/connection/list/list_item/list_item.model.ts

@ -6,20 +6,22 @@ import { getChartLength } from '../../../../app.service';
import { NAME_MAX_LENGTH } from '../../../../app.constant';
const api = new ApiFactory().create();
export const ListItemModelXtype = 'dec.dcm.model.connection.list_item';
@model(ListItemModelXtype)
@model()
export class ListItemModel extends Model<{
context : {
connectionSelected: AppModel['$$childContext']['connectionSelected'];
connectionSelectedOne: AppModel['$$childContext']['connectionSelectedOne'];
datebaseTypeSelectedOne: AppModel['$$childContext']['datebaseTypeSelectedOne'];
connections: AppModel['$$childContext']['connections'];
pageIndex: AppModel['$$childContext']['pageIndex'];
datebaseTypeSelected: AppModel['$$childContext']['datebaseTypeSelected'];
isCopy: AppModel['$$childContext']['isCopy']
}
types : {
connectionSelected: AppModel['TYPE']['connectionSelected'];
connectionSelectedOne: AppModel['TYPE']['connectionSelectedOne'];
datebaseTypeSelectedOne: AppModel['TYPE']['datebaseTypeSelectedOne'];
connections: AppModel['TYPE']['connections'];
pageIndex: AppModel['TYPE']['pageIndex'];
datebaseTypeSelected: AppModel['TYPE']['datebaseTypeSelected'];
isCopy: AppModel['TYPE']['isCopy']
},
context: ListItemModel['context'];
}> {
context = ['connectionSelected', 'connections', 'pageIndex', 'datebaseTypeSelectedOne', 'connectionSelectedOne', 'datebaseTypeSelected', 'isCopy'];
static xtype = 'dec.dcm.model.connection.list_item';
context = <const>['connectionSelected', 'connections', 'pageIndex', 'datebaseTypeSelectedOne', 'connectionSelectedOne', 'datebaseTypeSelected', 'isCopy'];
state() {
return {

9
src/modules/pages/connection/list/list_item/list_item.ts

@ -1,16 +1,17 @@
import { shortcut, store } from '@core/core';
import './list_item.less';
import { ListItemModel, ListItemModelXtype } from './list_item.model';
import { ListItemModel } from './list_item.model';
import { PAGE_INDEX } from '@constants/constant';
import { hasRegistered } from '../list.service';
import { connectionCanEdit, getTextByDatabaseType, getChartLength } from '../../../../app.service';
import { testConnection } from '../../../maintain/forms/form.server';
import { DownListCombo, Label, SignEditor } from '@fui/core';
export const ListItemXtype = 'dec.dcm.connection.list_item';
@shortcut(ListItemXtype)
@store(ListItemModelXtype)
@shortcut()
@store(ListItemModel)
export class ListItem extends BI.BasicButton {
static xtype = 'dec.dcm.connection.list_item';
props = {
name: '',
creator: '',

17
src/modules/pages/connection_pool/connection_pool.model.ts

@ -1,15 +1,18 @@
import { model, Model } from '@core/core';
import { AppModel } from '../../app.model';
import { connectionType } from '@constants/env';
export const ConnectionPoolModelXtype = 'dec.dcm.model.connection_pool';
@model(ConnectionPoolModelXtype)
@model()
export class ConnectionPoolModel extends Model<{
context : {
connections: AppModel['$$childContext']['connections'];
}
types : {
connections: AppModel['TYPE']['connections'];
},
context: ConnectionPoolModel['context'];
}> {
childContext = ['selected'];
context = ['connections'];
static xtype = 'dec.dcm.model.connection_pool';
childContext = <const>['selected'];
context = <const>['connections'];
state() {
return {

17
src/modules/pages/connection_pool/connection_pool.ts

@ -1,13 +1,14 @@
import { shortcut, store } from '@core/core';
import { ConnectionPoolModel, ConnectionPoolModelXtype } from './connection_pool.model';
import { ListItemXtype } from './list_item/list_item';
import { PoolXtype } from './pool/pool';
import { ConnectionPoolModel } from './connection_pool.model';
import { ListItem } from './list_item/list_item';
import { Pool } from './pool/pool';
import { PAGE_SIZE } from '@constants/constant';
import { Label } from '@fui/core';
export const ConnectionPoolXtype = 'dec.dcm.connection_pool';
@shortcut(ConnectionPoolXtype)
@store(ConnectionPoolModelXtype)
@shortcut()
@store(ConnectionPoolModel)
export class ConnectionPool extends BI.Widget {
static xtype = 'dec.dcm.connection_pool';
title: Label;
model: ConnectionPoolModel['model'];
@ -80,7 +81,7 @@ export class ConnectionPool extends BI.Widget {
height: 40,
},
{
type: PoolXtype,
type: Pool.xtype,
},
],
};
@ -118,7 +119,7 @@ export class ConnectionPool extends BI.Widget {
return this.model.connectionJDBC.slice(start, end).map(item => {
return {
type: ListItemXtype,
type: ListItem.xtype,
name: item.connectionName,
value: item.connectionName,
selected: item.connectionName === defaultSelected,

13
src/modules/pages/connection_pool/list_item/list_item.model.ts

@ -1,13 +1,14 @@
import { model, Model } from '@core/core';
import { ConnectionPoolModel } from '../connection_pool.model';
export const ListItemModelXtype = 'dec.dcm.model.connection_pool.list_item';
@model(ListItemModelXtype)
@model()
export class ListItemModel extends Model<{
context : {
selected: ConnectionPoolModel['$$childContext']['selected'];
}
types : {
selected: ConnectionPoolModel['TYPE']['selected'];
},
context: ListItemModel['context'];
}> {
context = ['selected'];
static xtype = 'dec.dcm.model.connection_pool.list_item';
context = <const>['selected'];
actions = {
setSelected: (selected: string) => {
this.model.selected = selected;

9
src/modules/pages/connection_pool/list_item/list_item.ts

@ -1,9 +1,10 @@
import { shortcut, store } from '@core/core';
import { ListItemModel, ListItemModelXtype } from './list_item.model';
export const ListItemXtype = 'dec.dcm.connection_pool.list_item';
@shortcut(ListItemXtype)
@store(ListItemModelXtype)
import { ListItemModel } from './list_item.model';
@shortcut()
@store(ListItemModel)
export class ListItem extends BI.BasicButton {
static xtype = 'dec.dcm.connection_pool.list_item';
props = {
name: '',
height: 25,

14
src/modules/pages/connection_pool/pool/pool.model.ts

@ -3,14 +3,16 @@ import { ConnectionPoolModel } from '../connection_pool.model';
import { ConnectionPoolType } from '../../../crud/crud.typings';
import { ApiFactory } from '../../../crud/apiFactory';
const api = new ApiFactory().create();
export const PoolModelXtype = 'dec.dcm.model.connection_pool.pool';
@model(PoolModelXtype)
@model()
export class PoolModel extends Model<{
context : {
selected: ConnectionPoolModel['$$childContext']['selected'];
}
types : {
selected: ConnectionPoolModel['TYPE']['selected'];
},
context: PoolModel['context'];
}> {
context = ['selected'];
static xtype = 'dec.dcm.model.connection_pool.poo';
context = <const>['selected'];
state () {
return {

9
src/modules/pages/connection_pool/pool/pool.ts

@ -1,13 +1,14 @@
import { shortcut, store } from '@core/core';
import { PoolModel, PoolModelXtype } from './pool.model';
import { PoolModel } from './pool.model';
import './pool.less';
import { ConnectionPoolType } from '../../../crud/crud.typings';
import { Label } from '@fui/core';
export const PoolXtype = 'dec.dcm.connection_pool.pool';
@shortcut(PoolXtype)
@store(PoolModelXtype)
@shortcut()
@store(PoolModel)
export class Pool extends BI.Widget {
static xtype = 'dec.dcm.connection_pool.pool';
props = {
baseCls: 'dec-dcm-connection-pool',
$testId: 'dec-dcm-connection-pool',

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

@ -3,15 +3,17 @@ import { AppModel } from 'src/modules/app.model';
import { getAllDatabaseTypes } from '../../app.service';
import { DatabaseType } from '../../app.typings';
export const DatebaseModelXtype = 'dec.dcm.model.datebase';
@model(DatebaseModelXtype)
@model()
export class DatebaseModel extends Model<{
context : {
filter: AppModel['$$childContext']['filter'];
datebaseTypeSelected: AppModel['$$childContext']['datebaseTypeSelected'];
}
types : {
filter: AppModel['TYPE']['filter'];
datebaseTypeSelected: AppModel['TYPE']['datebaseTypeSelected'];
},
context: DatebaseModel['context'];
}> {
context = ['filter', 'datebaseTypeSelected'];
static xtype = 'dec.dcm.model.datebase';
context = <const>['filter', 'datebaseTypeSelected'];
state() {
return {
search: '',

21
src/modules/pages/database/database.ts

@ -1,15 +1,16 @@
import { shortcut, store } from '@core/core';
import { FilterXtype } from './filter/filter';
import { DatebaseModel, DatebaseModelXtype } from './database.model';
import { Filter } from './filter/filter';
import { DatebaseModel } from './database.model';
import { DATEBASE_FILTER_TYPE, OTHER_JDBC } from '@constants/constant';
import { connectionType } from '@constants/env';
import { DatebaseTypeXtype } from './database_type/database_type';
import { DatebaseType } from './database_type/database_type';
import { getAllDatabaseTypes } from '../../app.service';
import { ButtonGroup, MultiSelectItem, SearchEditor } from '@fui/core';
export const DatebaseXtype = 'dec.dcm.datebase';
@shortcut(DatebaseXtype)
@store(DatebaseModelXtype)
@shortcut()
@store(DatebaseModel)
export class Datebase extends BI.Widget {
static xtype = 'dec.dcm.datebase';
filter: ButtonGroup;
search: SearchEditor;
datebaseType: ButtonGroup;
@ -117,18 +118,18 @@ export class Datebase extends BI.Widget {
},
items: [
{
type: FilterXtype,
type: Filter.xtype,
text: BI.i18nText('Dec-Dcm_Connection_Commonly'),
value: DATEBASE_FILTER_TYPE.COMMONLY,
selected: true,
},
{
type: FilterXtype,
type: Filter.xtype,
text: BI.i18nText('Dec-Dcm_Connection_All'),
value: DATEBASE_FILTER_TYPE.ALL,
},
{
type: FilterXtype,
type: Filter.xtype,
text: BI.i18nText('Dec-Dcm_Connection_Other'),
value: DATEBASE_FILTER_TYPE.OTHER,
},
@ -219,7 +220,7 @@ export class Datebase extends BI.Widget {
return this.model.datebaseTypes.map(item => {
return {
type: DatebaseTypeXtype,
type: DatebaseType.xtype,
text: item.text,
value: item.databaseType,
keyword: this.model.search,

12
src/modules/pages/database/database.typings.d.ts vendored

@ -1,12 +0,0 @@
export interface DatabaseType {
text: string;
databaseType: string;
driver?: string;
drivers?: string[];
url?: string;
commonly: boolean;
internal: boolean;
type: string;
hasSchema?: boolean;
kerberos?: boolean;
}

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

@ -1,15 +1,16 @@
import { model, Model } from '@core/core';
import { AppModel } from 'src/modules/app.model';
export const DatebaseTypeModelXtype = 'dec.dcm.model.datebase.type';
@model(DatebaseTypeModelXtype)
@model()
export class DatebaseTypeModel extends Model<
{
context: {
datebaseTypeSelected: AppModel['$$childContext']['datebaseTypeSelected'];
pageIndex: AppModel['$$childContext']['pageIndex'];
}
types: {
datebaseTypeSelected: AppModel['TYPE']['datebaseTypeSelected'];
pageIndex: AppModel['TYPE']['pageIndex'];
},
context: DatebaseTypeModel['context'];
}> {
context = ['datebaseTypeSelected', 'pageIndex'];
static xtype = 'dec.dcm.model.datebase.type';
context = <const>['datebaseTypeSelected', 'pageIndex'];
actions = {
setDatebaseTypeSelected: (datebaseTypeSelected: string) => {

9
src/modules/pages/database/database_type/database_type.ts

@ -1,14 +1,15 @@
import { shortcut, store } from '@core/core';
import { DatebaseTypeModel, DatebaseTypeModelXtype } from './database_type.model';
import { DatebaseTypeModel } from './database_type.model';
import { ImgPrefix, PluginImgPrefix } from '@constants/env';
import './database_type.less';
import { PAGE_INDEX } from '@constants/constant';
import { Img } from '@fui/core';
export const DatebaseTypeXtype = 'dec.dcm.datebase.type';
@shortcut(DatebaseTypeXtype)
@store(DatebaseTypeModelXtype)
@shortcut()
@store(DatebaseTypeModel)
export class DatebaseType extends BI.BasicButton {
static xtype = 'dec.dcm.datebase.type';
props = {
text: '',
url: '',

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

@ -1,14 +1,15 @@
import { Model, model } from '@core/core';
import { AppModel } from 'src/modules/app.model';
export const FilterModelXtype = 'dec.dcm.model.datebase.filter';
@model(FilterModelXtype)
@model()
export class FilterModel extends Model<{
context : {
filter: AppModel['$$childContext']['filter'];
}
types : {
filter: AppModel['TYPE']['filter'];
},
context: FilterModel['context'];
}> {
context = ['filter'];
static xtype = 'dec.dcm.model.datebase.filter';
context = <const>['filter'];
actions = {
setFilter:(filter: string) => {

8
src/modules/pages/database/filter/filter.ts

@ -1,10 +1,10 @@
import { shortcut, store } from '@core/core';
import { FilterModel, FilterModelXtype } from './filter.model';
import { FilterModel } from './filter.model';
export const FilterXtype = 'dec.dcm.datebase.filter';
@shortcut(FilterXtype)
@store(FilterModelXtype)
@shortcut()
@store(FilterModel)
export class Filter extends BI.BasicButton {
static xtype = 'dec.dcm.datebase.filter';
store: FilterModel['store']
props = {
text: '',

10
src/modules/pages/index.ts

@ -1,10 +0,0 @@
import { ConnectionXtype } from './connection/connection';
import { DatebaseXtype } from './database/database';
import { MaintainXtype } from './maintain/maintain';
import { ConnectionPoolXtype } from './connection_pool/connection_pool';
export {
ConnectionXtype,
DatebaseXtype,
MaintainXtype,
ConnectionPoolXtype,
};

6
src/modules/pages/maintain/components/form_item/form_item.ts

@ -1,8 +1,10 @@
import { shortcut } from '@core/core';
import { CONNECTION_LAYOUT } from '@constants/constant';
export const FormItemXtype = 'dec.dcm.Maintain_form_item';
@shortcut(FormItemXtype)
@shortcut()
export class FormItem extends BI.Widget {
static xtype = 'dec.dcm.Maintain_form_item';
props = {
name: '',
forms: '',

104
src/modules/pages/maintain/forms/components/form.jdbc.ts

@ -1,19 +1,19 @@
import { shortcut } from '@core/core';
import { CollapseXtype, EVENT_CHANGE } from 'src/modules/components/collapse/collapse';
import { FormItemXtype } from '../../components/form_item/form_item';
import { Collapse, EVENT_CHANGE } from 'src/modules/components/collapse/collapse';
import { FormItem } from '../../components/form_item/form_item';
import { Connection, ConnectionJDBC, ConnectionPoolJDBC } from 'src/modules/crud/crud.typings';
import { connectionType } from '@constants/env';
import { CONNECT_CHARSET, CONNECTION_LAYOUT, INT_MAX_VALUE, INT_MIN_VALUE } from '@constants/constant';
import { getAllDatabaseTypes, getJdbcDatabaseType, resolveUrlInfo, splitUrl } from '../../../../app.service';
import { TextCheckerXtype } from '../../../../components/text_checker/text_checker';
import { TextChecker } from '../../../../components/text_checker/text_checker';
import { ApiFactory } from 'src/modules/crud/apiFactory';
import { Editor, EditorIconCheckCombo, Label, TextAreaEditor, TextEditor, TextValueCombo, VerticalLayout } from '@fui/core';
import { FormItem } from '../../../connection/components/form_item/form_item';
const api = new ApiFactory().create();
export const FormJdbcXtype = 'dec.dcm.maintain.form.jdbc';
@shortcut(FormJdbcXtype)
@shortcut()
export class FormJdbc extends BI.Widget {
static xtype = 'dec.dcm.maintain.form.jdbc';
props = {
formData: {} as Connection,
}
@ -77,22 +77,22 @@ export class FormJdbc extends BI.Widget {
vgap,
items: [
{
type: FormItemXtype,
type: FormItem.xtype,
name: BI.i18nText('Dec-Dcm_Connection_Name'),
forms: [{
type: TextCheckerXtype,
type: TextChecker.xtype,
$value: 'connection-name',
width: 300,
value: connectionName,
allowBlank: true,
ref: (_ref: any) => {
ref: (_ref: TextChecker) => {
this.form.connectionName = _ref;
},
watermark: BI.i18nText('Dec-Dcm_Data_Connections'),
}],
},
{
type: FormItemXtype,
type: FormItem.xtype,
name: BI.i18nText('Dec-Dcm_Connection_Form_Driver'),
forms: [{
type: BI.EditorIconCheckCombo.xtype,
@ -121,7 +121,7 @@ export class FormJdbc extends BI.Widget {
}],
},
{
type: FormItemXtype,
type: FormItem.xtype,
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Name'),
forms: [{
type: BI.TextEditor.xtype,
@ -142,7 +142,7 @@ export class FormJdbc extends BI.Widget {
}],
},
{
type: FormItemXtype,
type: FormItem.xtype,
name: BI.i18nText('Dec-Dcm_Connection_Form_Host'),
forms: [{
type: BI.TextEditor.xtype,
@ -163,10 +163,10 @@ export class FormJdbc extends BI.Widget {
}],
},
{
type: FormItemXtype,
type: FormItem.xtype,
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Port'),
forms: [{
type: TextCheckerXtype,
type: TextChecker.xtype,
$value: 'database-port',
width: 300,
allowBlank: true,
@ -177,7 +177,7 @@ export class FormJdbc extends BI.Widget {
checker: (value: string) => this.checkInteger(value),
autoFix: true,
}, valueRangeConfig],
ref: (_ref: any) => {
ref: (_ref: TextChecker) => {
this.form.port = _ref;
},
listeners: [{
@ -189,7 +189,7 @@ export class FormJdbc extends BI.Widget {
}],
},
{
type: FormItemXtype,
type: FormItem.xtype,
name: BI.i18nText('Dec-Dcm_Connection_Form_AuthType'),
invisible: !databaseType.kerberos,
forms: [{
@ -226,7 +226,7 @@ export class FormJdbc extends BI.Widget {
}],
},
{
type: FormItemXtype,
type: FormItem.xtype,
name: BI.i18nText('Dec-Dcm_Connection_Form_UserName'),
invisible: !!authType,
ref: (_ref: FormItem) => {
@ -245,7 +245,7 @@ export class FormJdbc extends BI.Widget {
}],
},
{
type: FormItemXtype,
type: FormItem.xtype,
name: BI.i18nText('Dec-Dcm_Connection_Form_Password'),
invisible: !!authType,
ref: (_ref: FormItem) => {
@ -268,7 +268,7 @@ export class FormJdbc extends BI.Widget {
}],
},
{
type: FormItemXtype,
type: FormItem.xtype,
name: BI.i18nText('Dec-Dcm_Connection_Form_Principal'),
invisible: !authType,
ref: (_ref: FormItem) => {
@ -287,7 +287,7 @@ export class FormJdbc extends BI.Widget {
}],
},
{
type: FormItemXtype,
type: FormItem.xtype,
name: BI.i18nText('Dec-Dcm_Connection_Form_KeyPath'),
invisible: !authType,
ref: (_ref: FormItem) => {
@ -318,7 +318,7 @@ export class FormJdbc extends BI.Widget {
},
},
{
type: FormItemXtype,
type: FormItem.xtype,
name: BI.i18nText('Dec-Dcm_Connection_Form_OriginalCharsetName'),
forms: [{
type: BI.TextValueCombo.xtype,
@ -332,7 +332,7 @@ export class FormJdbc extends BI.Widget {
}],
},
{
type: FormItemXtype,
type: FormItem.xtype,
invisible: !databaseType.hasSchema,
height: 64,
name: BI.i18nText('Dec-Dcm_Connection_Form_Pattern'),
@ -373,7 +373,7 @@ export class FormJdbc extends BI.Widget {
bgap: 8,
},
{
type: FormItemXtype,
type: FormItem.xtype,
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_URL'),
forms: [{
type: BI.TextEditor.xtype,
@ -397,7 +397,7 @@ export class FormJdbc extends BI.Widget {
}],
},
{
type: CollapseXtype,
type: Collapse.xtype,
bgap: -15,
width: 70,
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Advanced_Setting'),
@ -420,11 +420,11 @@ export class FormJdbc extends BI.Widget {
},
items: [
{
type: FormItemXtype,
type: FormItem.xtype,
tgap: 15,
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Initial_Size'),
forms: [{
type: TextCheckerXtype,
type: TextChecker.xtype,
$value: 'initial-size',
width: 300,
allowBlank: false,
@ -435,16 +435,16 @@ export class FormJdbc extends BI.Widget {
autoFix: true,
}, valueRangeConfig],
watermark: BI.i18nText('Dec-Dcm_Connection_Form_Database_Initial_Size'),
ref: (_ref: any) => {
ref: (_ref: TextChecker) => {
this.form.initialSize = _ref;
},
}],
},
{
type: FormItemXtype,
type: FormItem.xtype,
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Max_Active'),
forms: [{
type: TextCheckerXtype,
type: TextChecker.xtype,
$value: 'max-active',
width: 300,
allowBlank: false,
@ -455,16 +455,16 @@ export class FormJdbc extends BI.Widget {
checker: (value: string) => this.checkInteger(value),
autoFix: true,
}, valueRangeConfig],
ref: (_ref: any) => {
ref: (_ref: TextChecker) => {
this.form.maxActive = _ref;
},
}],
},
{
type: FormItemXtype,
type: FormItem.xtype,
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Max_Idle'),
forms: [{
type: TextCheckerXtype,
type: TextChecker.xtype,
$value: 'max-idle',
width: 300,
allowBlank: false,
@ -475,16 +475,16 @@ export class FormJdbc extends BI.Widget {
checker: (value: string) => this.checkInteger(value),
autoFix: true,
}, valueRangeConfig],
ref: (_ref: any) => {
ref: (_ref: TextChecker) => {
this.form.maxIdle = _ref;
},
}],
},
{
type: FormItemXtype,
type: FormItem.xtype,
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Min_Idle'),
forms: [{
type: TextCheckerXtype,
type: TextChecker.xtype,
$value: 'min-idle',
width: 300,
allowBlank: false,
@ -495,17 +495,17 @@ export class FormJdbc extends BI.Widget {
checker: (value: string) => this.checkInteger(value),
autoFix: true,
}, valueRangeConfig],
ref: (_ref: any) => {
ref: (_ref: TextChecker) => {
this.form.minIdle = _ref;
},
}],
},
{
type: FormItemXtype,
type: FormItem.xtype,
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Max_Wait'),
forms: [
{
type: TextCheckerXtype,
type: TextChecker.xtype,
$value: 'max-wait',
width: 300,
allowBlank: false,
@ -516,7 +516,7 @@ export class FormJdbc extends BI.Widget {
checker: (value: string) => this.checkInteger(value),
autoFix: true,
}, valueRangeConfig],
ref: (_ref: any) => {
ref: (_ref: TextChecker) => {
this.form.maxWait = _ref;
},
},
@ -529,7 +529,7 @@ export class FormJdbc extends BI.Widget {
],
},
{
type: FormItemXtype,
type: FormItem.xtype,
name: BI.i18nText('Dec-Dcm_Connection_Form_SQL_Validation_Query'),
forms: [{
type: BI.TextAreaEditor.xtype,
@ -546,7 +546,7 @@ export class FormJdbc extends BI.Widget {
}],
},
{
type: FormItemXtype,
type: FormItem.xtype,
name: BI.i18nText('Dec-Dcm_Connection_Form_Connection-Check'),
forms: [{
type: BI.TextValueCombo.xtype,
@ -562,7 +562,7 @@ export class FormJdbc extends BI.Widget {
}],
},
{
type: FormItemXtype,
type: FormItem.xtype,
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Test_On_Return'),
forms: [{
type: BI.TextValueCombo.xtype,
@ -578,7 +578,7 @@ export class FormJdbc extends BI.Widget {
}],
},
{
type: FormItemXtype,
type: FormItem.xtype,
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Test_While_Idle'),
forms: [{
type: BI.TextValueCombo.xtype,
@ -594,11 +594,11 @@ export class FormJdbc extends BI.Widget {
}],
},
{
type: FormItemXtype,
type: FormItem.xtype,
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Test_Between_Eviction_Millis'),
forms: [
{
type: TextCheckerXtype,
type: TextChecker.xtype,
$value: 'test-between-evicition-millis',
width: 300,
allowBlank: false,
@ -609,7 +609,7 @@ export class FormJdbc extends BI.Widget {
checker: (value: string) => this.checkNumber(value),
autoFix: true,
}, valueRangeConfig],
ref: (_ref: any) => {
ref: (_ref: TextChecker) => {
this.form.timeBetweenEvictionRunsMillis = _ref;
},
},
@ -622,10 +622,10 @@ export class FormJdbc extends BI.Widget {
],
},
{
type: FormItemXtype,
type: FormItem.xtype,
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Tests_PerEviction_Run_Num'),
forms: [{
type: TextCheckerXtype,
type: TextChecker.xtype,
$value: 'test-pereviction-run-num',
width: 300,
allowBlank: false,
@ -636,17 +636,17 @@ export class FormJdbc extends BI.Widget {
checker: (value: string) => this.checkInteger(value),
autoFix: true,
}, valueRangeConfig],
ref: (_ref: any) => {
ref: (_ref: TextChecker) => {
this.form.numTestsPerEvictionRun = _ref;
},
}],
},
{
type: FormItemXtype,
type: FormItem.xtype,
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Min_Evictable_Idle_Time_Millis'),
forms: [
{
type: TextCheckerXtype,
type: TextChecker.xtype,
$value: 'min-evictable-idle-time-millis',
width: 300,
allowBlank: false,
@ -657,7 +657,7 @@ export class FormJdbc extends BI.Widget {
checker: (value: string) => this.checkInteger(value),
autoFix: true,
}, valueRangeConfig],
ref: (_ref: any) => {
ref: (_ref: TextChecker) => {
this.form.minEvictableIdleTimeMillis = _ref;
},
},

54
src/modules/pages/maintain/forms/components/form.jndi.ts

@ -1,14 +1,16 @@
import { shortcut } from '@core/core';
import { FormItemXtype } from '../../components/form_item/form_item';
import { FormItem } from '../../components/form_item/form_item';
import { ConnectionJNDI, Connection, ContextHashtable } from 'src/modules/crud/crud.typings';
import { CONNECT_CHARSET, CONNECTION_LAYOUT, JNDI_FACTORYS } from '@constants/constant';
import { CollapseXtype, EVENT_CHANGE } from 'src/modules/components/collapse/collapse';
import { Collapse, EVENT_CHANGE } from 'src/modules/components/collapse/collapse';
import { connectionType } from '@constants/env';
import { TextCheckerXtype } from '../../../../components/text_checker/text_checker';
import { TextChecker } from '../../../../components/text_checker/text_checker';
import { EditorIconCheckCombo, TextEditor, TextValueCombo, VerticalLayout } from '@fui/core';
export const FormJndiXtype = 'dec.dcm.maintain.form.jndi';
@shortcut(FormJndiXtype)
@shortcut()
export class FormJndi extends BI.Widget {
static xtype = 'dec.dcm.maintain.form.jndi';
props = {
formData: {} as Connection,
}
@ -45,21 +47,21 @@ export class FormJndi extends BI.Widget {
vgap,
items: [
{
type: FormItemXtype,
type: FormItem.xtype,
name: BI.i18nText('Dec-Dcm_Connection_Name'),
nameWidth: 200,
forms: [{
type: TextCheckerXtype,
type: TextChecker.xtype,
$value: 'connection-name',
width: 300,
value: connectionName,
ref: (_ref: any) => {
ref: (_ref: TextChecker) => {
this.form.connectionName = _ref;
},
}],
},
{
type: FormItemXtype,
type: FormItem.xtype,
name: BI.i18nText('Dec-Dcm_Connection_JNDI_Form_ConnectionName'),
nameWidth: 200,
forms: [{
@ -97,7 +99,7 @@ export class FormJndi extends BI.Widget {
height: 175,
items: [
{
type: FormItemXtype,
type: FormItem.xtype,
name: 'INTIAL_CONTEXT_FACTORY',
nameWidth: 200,
isBold: false,
@ -127,7 +129,7 @@ export class FormJndi extends BI.Widget {
}],
},
{
type: FormItemXtype,
type: FormItem.xtype,
name: 'PROVIDER_URL',
isBold: false,
nameWidth: 200,
@ -143,7 +145,7 @@ export class FormJndi extends BI.Widget {
}],
},
{
type: FormItemXtype,
type: FormItem.xtype,
name: 'SECURITY_PRINCIPAL',
isBold: false,
nameWidth: 200,
@ -159,7 +161,7 @@ export class FormJndi extends BI.Widget {
}],
},
{
type: FormItemXtype,
type: FormItem.xtype,
name: 'SECURITY_CREDENTIALS',
isBold: false,
nameWidth: 200,
@ -186,7 +188,7 @@ export class FormJndi extends BI.Widget {
],
},
{
type: FormItemXtype,
type: FormItem.xtype,
name: BI.i18nText('Dec-Dcm_Connection_Form_OriginalCharsetName'),
nameWidth: 200,
forms: [{
@ -201,7 +203,7 @@ export class FormJndi extends BI.Widget {
}],
},
{
type: CollapseXtype,
type: Collapse.xtype,
width: 70,
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Advanced_Setting'),
listeners: [
@ -223,7 +225,7 @@ export class FormJndi extends BI.Widget {
},
items: [
{
type: FormItemXtype,
type: FormItem.xtype,
name: 'OBJECT_FACTORIES',
nameWidth: 200,
forms: [{
@ -238,7 +240,7 @@ export class FormJndi extends BI.Widget {
}],
},
{
type: FormItemXtype,
type: FormItem.xtype,
name: 'STATE_FACTORIES',
nameWidth: 200,
forms: [{
@ -253,7 +255,7 @@ export class FormJndi extends BI.Widget {
}],
},
{
type: FormItemXtype,
type: FormItem.xtype,
name: 'URL_PKG_PREFIXES',
nameWidth: 200,
forms: [{
@ -268,7 +270,7 @@ export class FormJndi extends BI.Widget {
}],
},
{
type: FormItemXtype,
type: FormItem.xtype,
name: 'DNS_URL',
nameWidth: 200,
forms: [{
@ -283,7 +285,7 @@ export class FormJndi extends BI.Widget {
}],
},
{
type: FormItemXtype,
type: FormItem.xtype,
name: 'AUTHORITATIVE',
nameWidth: 200,
forms: [{
@ -298,7 +300,7 @@ export class FormJndi extends BI.Widget {
}],
},
{
type: FormItemXtype,
type: FormItem.xtype,
name: 'BATCHSIZE',
nameWidth: 200,
forms: [{
@ -313,7 +315,7 @@ export class FormJndi extends BI.Widget {
}],
},
{
type: FormItemXtype,
type: FormItem.xtype,
name: 'REFERRAL',
nameWidth: 200,
forms: [{
@ -328,7 +330,7 @@ export class FormJndi extends BI.Widget {
}],
},
{
type: FormItemXtype,
type: FormItem.xtype,
name: 'SECURITY_PROTOCOL',
nameWidth: 200,
forms: [{
@ -343,7 +345,7 @@ export class FormJndi extends BI.Widget {
}],
},
{
type: FormItemXtype,
type: FormItem.xtype,
name: 'SECURITY_AUTHENTICATION',
nameWidth: 200,
forms: [{
@ -358,7 +360,7 @@ export class FormJndi extends BI.Widget {
}],
},
{
type: FormItemXtype,
type: FormItem.xtype,
name: 'LANGUAGE',
nameWidth: 200,
forms: [{
@ -373,7 +375,7 @@ export class FormJndi extends BI.Widget {
}],
},
{
type: FormItemXtype,
type: FormItem.xtype,
name: 'APPLET',
nameWidth: 200,
forms: [{

4
src/modules/pages/maintain/forms/components/form.plugin.ts

@ -1,9 +1,9 @@
import { shortcut } from '@core/core';
import { Connection } from 'src/modules/crud/crud.typings';
import { getPluginWidgetEdit } from '../../../../app.service';
export const FormPluginXtype = 'dec.dcm.maintain_plugin';
@shortcut(FormPluginXtype)
@shortcut()
export class FormPlugin extends BI.Widget {
static xtype = 'dec.dcm.maintain_plugin';
props = {
formData: {} as Connection,
}

38
src/modules/pages/maintain/forms/form.model.ts

@ -5,21 +5,33 @@ import { ApiFactory } from 'src/modules/crud/apiFactory';
import { PAGE_INDEX } from '@constants/constant';
import { testConnection } from './form.server';
const api = new ApiFactory().create();
export const MaintainFormModelXtype = 'dec.dcm.model.maintain_form';
@model(MaintainFormModelXtype)
@model()
export class MaintainFormModel extends Model<{
context : {
datebaseTypeSelected: AppModel['$$childContext']['datebaseTypeSelected'];
datebaseTypeSelectedOne: AppModel['$$childContext']['datebaseTypeSelectedOne'];
connectionSelectedOne: AppModel['$$childContext']['connectionSelectedOne'];
saveEvent: AppModel['$$childContext']['saveEvent'];
testEvent: AppModel['$$childContext']['testEvent'];
pageIndex: AppModel['$$childContext']['pageIndex'];
connections: AppModel['$$childContext']['connections'];
isCopy: AppModel['$$childContext']['isCopy'];
}
types : {
datebaseTypeSelected: AppModel['TYPE']['datebaseTypeSelected'];
datebaseTypeSelectedOne: AppModel['TYPE']['datebaseTypeSelectedOne'];
connectionSelectedOne: AppModel['TYPE']['connectionSelectedOne'];
saveEvent: AppModel['TYPE']['saveEvent'];
testEvent: AppModel['TYPE']['testEvent'];
pageIndex: AppModel['TYPE']['pageIndex'];
connections: AppModel['TYPE']['connections'];
isCopy: AppModel['TYPE']['isCopy'];
},
context: MaintainFormModel['context'];
}> {
context = ['datebaseTypeSelected', 'datebaseTypeSelectedOne', 'connectionSelectedOne', 'saveEvent', 'pageIndex', 'testEvent', 'connections', 'isCopy'];
static xtype = 'dec.dcm.model.maintain_form';
context = <const>[
'datebaseTypeSelected',
'datebaseTypeSelectedOne',
'connectionSelectedOne',
'saveEvent',
'pageIndex',
'testEvent',
'connections',
'isCopy',
];
actions = {
addConnection: (data: Connection) => api.addConnection(data),

8
src/modules/pages/maintain/forms/form.server.ts

@ -1,7 +1,7 @@
import { Connection, ConnectionJDBC } from '../../../crud/crud.typings';
import { connectionType, errorCode } from '@constants/env';
import { DATA_BASE_DRIVER_LINK, JDBC_ODBC_DRIVER, JDBC_ODBC_DRIVER_HELP_LINK, DEFAULT_HELP_LINK } from '@constants/constant';
import { TestStatusXtype, EVENT_RELOAD, EVENT_CLOSE } from '../../../components/test_status/test_status';
import { TestStatus } from '../../../components/test_status/test_status';
import { getJdbcDatabaseType } from '../../../app.service';
import { ApiFactory } from '../../../crud/apiFactory';
const api = new ApiFactory().create();
@ -58,7 +58,7 @@ export function testConnection(value: Connection): Promise<string[]> {
};
BI.Maskers.create(id, null, {
render: {
type: TestStatusXtype,
type: TestStatus.xtype,
loadingText: BI.i18nText('Dec-Dcm_Connection_Testing'),
loadingCls: 'upload-loading-icon',
successText: BI.i18nText('Dec-Dcm_Connection_Test_Success'),
@ -71,14 +71,14 @@ export function testConnection(value: Connection): Promise<string[]> {
},
listeners: [
{
eventName: EVENT_RELOAD,
eventName: TestStatus.EVENT_RELOAD,
action: () => {
testStatus.setLoading();
testConnection();
},
},
{
eventName: EVENT_CLOSE,
eventName: TestStatus.EVENT_CLOSE,
action: () => {
BI.Maskers.remove(id);
},

24
src/modules/pages/maintain/forms/form.ts

@ -1,17 +1,19 @@
import { shortcut, store } from '@core/core';
import { MaintainFormModelXtype, MaintainFormModel } from './form.model';
import { FormJdbc, FormJdbcXtype } from './components/form.jdbc';
import { FormJndiXtype } from './components/form.jndi';
import { FormPluginXtype } from './components/form.plugin';
import { MaintainFormModel } from './form.model';
import { FormJdbc } from './components/form.jdbc';
import { FormJndi } from './components/form.jndi';
import { FormPlugin } from './components/form.plugin';
import { connectionType, errorCode } from '@constants/env';
import { ConnectionJDBC, Connection, ResultType } from 'src/modules/crud/crud.typings';
import { DEFAULT_JNDI_DATA, DEFAULT_JDBC_POOL, DATEBASE_FILTER_TYPE } from '@constants/constant';
import { getJdbcDatabaseType, getChartLength } from '../../../app.service';
import { NAME_MAX_LENGTH } from '../../../app.constant';
export const MaintainFormXtype = 'dec.dcm.maintain.form';
@shortcut(MaintainFormXtype)
@store(MaintainFormModelXtype)
@shortcut()
@store(MaintainFormModel)
export class MaintainForm extends BI.Widget {
static xtype = 'dec.dcm.maintain.form';
props = {
connectionType: '',
}
@ -86,13 +88,13 @@ export class MaintainForm extends BI.Widget {
private getFormType() {
switch (this.options.connectionType) {
case connectionType.JDBC:
return FormJdbcXtype;
return FormJdbc.xtype;
case connectionType.JNDI:
return FormJndiXtype;
return FormJndi.xtype;
case DATEBASE_FILTER_TYPE.OTHER:
return FormJdbcXtype;
return FormJdbc.xtype;
default:
return FormPluginXtype;
return FormPlugin.xtype;
}
}

23
src/modules/pages/maintain/maintain.model.ts

@ -1,18 +1,19 @@
import { model, Model } from '@core/core';
import { AppModel } from '../../app.model';
export const MaintainModelXtype = 'dec.dcm.model.maintain';
@model(MaintainModelXtype)
@model()
export class MaintainModel extends Model<{
context : {
pageIndex: AppModel['$$childContext']['pageIndex'];
connections: AppModel['$$childContext']['connections'];
datebaseTypeSelected: AppModel['$$childContext']['datebaseTypeSelected'];
datebaseTypeSelectedOne: AppModel['$$childContext']['datebaseTypeSelectedOne'];
connectionSelectedOne: AppModel['$$childContext']['connectionSelectedOne'];
isCopy: AppModel['$$childContext']['isCopy'];
}
types : {
pageIndex: AppModel['TYPE']['pageIndex'];
connections: AppModel['TYPE']['connections'];
datebaseTypeSelected: AppModel['TYPE']['datebaseTypeSelected'];
datebaseTypeSelectedOne: AppModel['TYPE']['datebaseTypeSelectedOne'];
connectionSelectedOne: AppModel['TYPE']['connectionSelectedOne'];
isCopy: AppModel['TYPE']['isCopy'];
},
context: MaintainModel['context'];
}> {
context = ['pageIndex', 'datebaseTypeSelected', 'datebaseTypeSelectedOne', 'connectionSelectedOne', 'isCopy'];
static xtype = 'dec.dcm.model.maintain';
context = <const>['pageIndex', 'datebaseTypeSelected', 'datebaseTypeSelectedOne', 'connectionSelectedOne', 'isCopy'];
actions = {
setPageIndex:(index: string) => {

17
src/modules/pages/maintain/maintain.ts

@ -1,7 +1,7 @@
import { shortcut, store } from '@core/core';
import { MaintainModel, MaintainModelXtype } from './maintain.model';
import { MaintainFormXtype } from './forms/form';
import { LinkXtype, LinkButton } from 'src/modules/components/link_button/link';
import { MaintainModel } from './maintain.model';
import { MaintainForm } from './forms/form';
import { LinkButton } from 'src/modules/components/link_button/link';
import { PAGE_INDEX } from '@constants/constant';
import { ApiFactory } from 'src/modules/crud/apiFactory';
const api = new ApiFactory().create();
@ -11,10 +11,11 @@ import { getJdbcDatabaseType, getTextByDatabaseType } from '../../app.service';
import { ConnectionJDBC } from 'src/modules/crud/crud.typings';
import { ListView } from '@fui/core';
export const MaintainXtype = 'dec.dcm.maintain';
@shortcut(MaintainXtype)
@store(MaintainModelXtype)
@shortcut()
@store(MaintainModel)
export class Maintain extends BI.Widget {
static xtype = 'dec.dcm.maintain';
model: MaintainModel['model'];
store: MaintainModel['store'];
@ -51,7 +52,7 @@ export class Maintain extends BI.Widget {
height: 15,
},
{
type: LinkXtype,
type: LinkButton.xtype,
invisible: true,
lgap: 10,
text: BI.i18nText('Dec-Dcm_Socket_Unable_Connect_Tip'),
@ -86,7 +87,7 @@ export class Maintain extends BI.Widget {
const { type } = this.getEditConnection();
return [{
type: MaintainFormXtype,
type: MaintainForm.xtype,
connectionType: type,
}];
}

16
src/modules/title/title.model.ts

@ -1,15 +1,17 @@
import { model, Model } from '@core/core';
import { AppModel } from '../app.model';
export const TitleModelXtype = 'dec.dcm.model.title';
@model(TitleModelXtype)
@model()
export class TitleModel extends Model<{
context : {
pageIndex: AppModel['$$childContext']['pageIndex'];
datebaseTypeSelected: AppModel['$$childContext']['datebaseTypeSelected'];
}
types: {
pageIndex: AppModel['TYPE']['pageIndex'];
datebaseTypeSelected: AppModel['TYPE']['datebaseTypeSelected'];
},
context: TitleModel['context'];
}> {
context = ['pageIndex', 'datebaseTypeSelected']
static xtype = 'dec.dcm.model.title';
context = <const>['pageIndex', 'datebaseTypeSelected']
actions = {
setPageIndex: (index: string) => {

13
src/modules/title/title.ts

@ -1,14 +1,15 @@
import { shortcut, store } from '@core/core';
import { TitleModel, TitleModelXtype } from './title.model';
import { TitleModel } from './title.model';
import { PAGE_INDEX } from '@constants/constant';
import { TitleDatabase } from './title_database/title_datebase';
import { TitleMaintain } from './title_maintain/title_maintain';
import { LinearSegment, Tab } from '@fui/core';
export const TitleXtype = 'dec.dcm.title';
@shortcut(TitleXtype)
@store(TitleModelXtype)
@shortcut()
@store(TitleModel)
export class Title extends BI.Widget {
static xtype = 'dec.dcm.title';
props = {
baseCls: 'bi-card',
}
@ -76,11 +77,11 @@ export class Title extends BI.Widget {
switch (index) {
case PAGE_INDEX.DATEBASE:
return {
type: TitleDatabase,
type: TitleDatabase.xtype,
};
case PAGE_INDEX.MAINTAIN:
return {
type: TitleMaintain,
type: TitleMaintain.xtype,
};
default:
return {

16
src/modules/title/title_database/title_datebase.model.ts

@ -1,15 +1,17 @@
import { model, Model } from '@core/core';
import { AppModel } from 'src/modules/app.model';
export const TitleDatebaseModelXtype = 'dec.dcm.model.title_datebase';
@model(TitleDatebaseModelXtype)
@model()
export class TitleDatebaseModel extends Model<{
context: {
pageIndex: AppModel['$$childContext']['pageIndex'];
datebaseTypeSelected: AppModel['$$childContext']['datebaseTypeSelected'];
}
types: {
pageIndex: AppModel['TYPE']['pageIndex'];
datebaseTypeSelected: AppModel['TYPE']['datebaseTypeSelected'];
},
context: TitleDatebaseModel['context'];
}> {
context = ['pageIndex', 'datebaseTypeSelected'];
static xtype = 'dec.dcm.model.title_datebase';
context = <const>['pageIndex', 'datebaseTypeSelected'];
actions = {
setPageIndex: (index: string) => {

10
src/modules/title/title_database/title_datebase.ts

@ -1,13 +1,13 @@
import { shortcut, store } from '@core/core';
import { TitleDatebaseModel, TitleDatebaseModelXtype } from './title_datebase.model';
import { TitleDatebaseModel } from './title_datebase.model';
import { PAGE_INDEX } from '@constants/constant';
import { Button } from '@fui/core';
export const TitleDatabase = 'dec.dcm.title.datebase';
@shortcut()
@store(TitleDatebaseModel)
export class TitleDatabase extends BI.Widget {
static xtype = 'dec.dcm.title.datebase';
@shortcut(TitleDatabase)
@store(TitleDatebaseModelXtype)
export class TitleDatabaseWidget extends BI.Widget {
store: TitleDatebaseModel['store'];
model: TitleDatebaseModel['model'];

23
src/modules/title/title_maintain/title_maintain.model.ts

@ -2,18 +2,21 @@ import { model, Model } from '@core/core';
import { AppModel } from 'src/modules/app.model';
import { ApiFactory } from 'src/modules/crud/apiFactory';
const api = new ApiFactory().create();
export const TitleMaintainModelXtype = 'dec.dcm.model.title_maintain';
@model(TitleMaintainModelXtype)
@model()
export class TitleMaintainModel extends Model<{
context : {
pageIndex: AppModel['$$childContext']['pageIndex'];
saveEvent: AppModel['$$childContext']['saveEvent'];
connectionSelected: AppModel['$$childContext']['connectionSelected'];
testEvent: AppModel['$$childContext']['testEvent'];
isCopy: AppModel['$$childContext']['isCopy'];
}
types : {
pageIndex: AppModel['TYPE']['pageIndex'];
saveEvent: AppModel['TYPE']['saveEvent'];
connectionSelected: AppModel['TYPE']['connectionSelected'];
testEvent: AppModel['TYPE']['testEvent'];
isCopy: AppModel['TYPE']['isCopy'];
},
context: TitleMaintainModel['context'];
}> {
context = ['pageIndex', 'saveEvent', 'testEvent', 'connectionSelected', 'isCopy'];
static xtype = 'dec.dcm.model.title_maintain';
context = <const>['pageIndex', 'saveEvent', 'testEvent', 'connectionSelected', 'isCopy'];
actions = {
setPageIndex: (index: string) => {

11
src/modules/title/title_maintain/title_maintain.ts

@ -1,11 +1,12 @@
import { shortcut, store } from '@core/core';
import { TitleMaintainModel, TitleMaintainModelXtype } from './title_maintain.model';
import { TitleMaintainModel } from './title_maintain.model';
import { PAGE_INDEX } from '@constants/constant';
export const TitleMaintain = 'dec.dcm.title.maintain';
@shortcut(TitleMaintain)
@store(TitleMaintainModelXtype)
export class TitleMaintainWidget extends BI.Widget {
@shortcut()
@store(TitleMaintainModel)
export class TitleMaintain extends BI.Widget {
static xtype = 'dec.dcm.title.maintain';
store: TitleMaintainModel['store'];
model: TitleMaintainModel['model'];
render() {

Loading…
Cancel
Save