Browse Source

fix: 设置常量

qufenxi
alan 5 years ago
parent
commit
04ee3eca45
  1. 2
      src/modules/constants/constant.ts
  2. 5
      src/modules/pages/connection_pool/connection_pool.ts

2
src/modules/constants/constant.ts

@ -704,3 +704,5 @@ export const JNDI_FACTORYS = [
url: 'http://localhost:8080/hello/burlap', url: 'http://localhost:8080/hello/burlap',
}, },
]; ];
export const PAGE_SIZE = 50;

5
src/modules/pages/connection_pool/connection_pool.ts

@ -3,6 +3,7 @@ import { Htape, Vtape, Label, Layout, CenterAdapt, Loader } from 'ui';
import { ConnectionPoolModel, ConnectionPoolModelXtype } from './connection_pool.model'; import { ConnectionPoolModel, ConnectionPoolModelXtype } from './connection_pool.model';
import { ListItemXtype } from './list_item/list_item'; import { ListItemXtype } from './list_item/list_item';
import { PoolXtype } from './pool/pool'; import { PoolXtype } from './pool/pool';
import { PAGE_SIZE } from '@constants/constant';
export const ConnectionPoolXtype = 'dec.dcm.connection_pool'; export const ConnectionPoolXtype = 'dec.dcm.connection_pool';
@shortcut(ConnectionPoolXtype) @shortcut(ConnectionPoolXtype)
@store(ConnectionPoolModelXtype) @store(ConnectionPoolModelXtype)
@ -49,9 +50,9 @@ export class ConnectionPool extends BI.Widget {
{ {
type: Loader, type: Loader,
itemsCreator: (options: {times: number}, populate) => { itemsCreator: (options: {times: number}, populate) => {
populate(this.renderList((options.times - 1) * 50, options.times * 50)); populate(this.renderList((options.times - 1) * PAGE_SIZE, options.times * PAGE_SIZE));
}, },
hasNext: options => options.times * 50 < BI.size(this.model.connectionJDBC), hasNext: options => options.times * PAGE_SIZE < BI.size(this.model.connectionJDBC),
}, },
], ],
}, },

Loading…
Cancel
Save