|
|
|
@ -1,5 +1,5 @@
|
|
|
|
|
import { shortcut, store } from '@core/core'; |
|
|
|
|
import { ButtonGroup, Htape, Vtape, Label, Vertical, Layout, CenterAdapt } from 'ui'; |
|
|
|
|
import { Htape, Vtape, Label, Layout, CenterAdapt, Loader } from 'ui'; |
|
|
|
|
import { ConnectionPoolModel, ConnectionPoolModelXtype } from './connection_pool.model'; |
|
|
|
|
import { ListItemXtype } from './list_item/list_item'; |
|
|
|
|
import { PoolXtype } from './pool/pool'; |
|
|
|
@ -7,7 +7,6 @@ export const ConnectionPoolXtype = 'dec.dcm.connection_pool';
|
|
|
|
|
@shortcut(ConnectionPoolXtype) |
|
|
|
|
@store(ConnectionPoolModelXtype) |
|
|
|
|
export class ConnectionPool extends BI.Widget { |
|
|
|
|
groupWidget: any; |
|
|
|
|
title: any; |
|
|
|
|
|
|
|
|
|
model: ConnectionPoolModel['model']; |
|
|
|
@ -44,14 +43,11 @@ export class ConnectionPool extends BI.Widget {
|
|
|
|
|
height: 40, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
type: ButtonGroup, |
|
|
|
|
layouts: [{ |
|
|
|
|
type: Vertical, |
|
|
|
|
}], |
|
|
|
|
items: this.renderList(), |
|
|
|
|
ref: (_ref: any) => { |
|
|
|
|
this.groupWidget = _ref; |
|
|
|
|
type: Loader, |
|
|
|
|
itemsCreator: (options: {times: number}, populate) => { |
|
|
|
|
populate(this.renderList((options.times - 1) * 50, options.times * 50)); |
|
|
|
|
}, |
|
|
|
|
hasNext: options => options.times * 50 < BI.size(this.model.connections), |
|
|
|
|
}, |
|
|
|
|
], |
|
|
|
|
}, |
|
|
|
@ -113,10 +109,10 @@ export class ConnectionPool extends BI.Widget {
|
|
|
|
|
}; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private renderList() { |
|
|
|
|
private renderList(start = 0, end = 0) { |
|
|
|
|
const defaultSelected = this.model.connectionJDBC.length > 0 ? this.model.connectionJDBC[0].connectionName : ''; |
|
|
|
|
|
|
|
|
|
return this.model.connectionJDBC.map(item => { |
|
|
|
|
return this.model.connectionJDBC.slice(start, end).map(item => { |
|
|
|
|
return { |
|
|
|
|
type: ListItemXtype, |
|
|
|
|
name: item.connectionName, |
|
|
|
|