|
|
|
@ -1,5 +1,5 @@
|
|
|
|
|
import { shortcut, store } from '@core/core'; |
|
|
|
|
import { CenterAdapt, Label, Layout, Vtape, Loader } from 'ui'; |
|
|
|
|
import { CenterAdapt, Label, Layout, Vtape, Loader, Tab } from 'ui'; |
|
|
|
|
import { ListItemXtype } from './list_item/list_item'; |
|
|
|
|
import { ConnectionListModel, ConnectionListModelXtype } from './list.model'; |
|
|
|
|
import { getCreator, getDatabaseType } from './list.service'; |
|
|
|
@ -11,6 +11,7 @@ export class ConnectionList extends BI.LoadingPane {
|
|
|
|
|
model: ConnectionListModel['model']; |
|
|
|
|
|
|
|
|
|
groupWidget: any; |
|
|
|
|
tab: any; |
|
|
|
|
|
|
|
|
|
beforeInit(cb: Function) { |
|
|
|
|
this.store.setConnections().then(() => { |
|
|
|
@ -24,44 +25,57 @@ export class ConnectionList extends BI.LoadingPane {
|
|
|
|
|
this.groupWidget.populate(this.renderList(0, this.groupWidget.times * 50)); |
|
|
|
|
this.groupWidget.times = times; |
|
|
|
|
}, |
|
|
|
|
shwoType: (type: 'list' | 'none') => { |
|
|
|
|
this.tab.setSelect(type); |
|
|
|
|
}, |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
render() { |
|
|
|
|
if (BI.size(this.model.connections) === 0) { |
|
|
|
|
return { |
|
|
|
|
type: CenterAdapt, |
|
|
|
|
items: [ |
|
|
|
|
{ |
|
|
|
|
type: Vtape, |
|
|
|
|
width: 260, |
|
|
|
|
height: 150, |
|
|
|
|
return { |
|
|
|
|
type: Tab, |
|
|
|
|
single: true, |
|
|
|
|
showIndex: this.model.shwoType, |
|
|
|
|
ref: (_ref: any) => { |
|
|
|
|
this.tab = _ref; |
|
|
|
|
}, |
|
|
|
|
cardCreator: (index: 'list' | 'none') => { |
|
|
|
|
if (index === 'none') { |
|
|
|
|
return { |
|
|
|
|
type: CenterAdapt, |
|
|
|
|
items: [ |
|
|
|
|
{ |
|
|
|
|
el: { |
|
|
|
|
type: Layout, |
|
|
|
|
cls: 'data-connection-background', |
|
|
|
|
}, |
|
|
|
|
height: 130, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
type: Label, |
|
|
|
|
cls: 'bi-tips', |
|
|
|
|
text: BI.i18nText('Dec-Dcm_Connection_None'), |
|
|
|
|
type: Vtape, |
|
|
|
|
width: 260, |
|
|
|
|
height: 150, |
|
|
|
|
items: [ |
|
|
|
|
{ |
|
|
|
|
el: { |
|
|
|
|
type: Layout, |
|
|
|
|
cls: 'data-connection-background', |
|
|
|
|
}, |
|
|
|
|
height: 130, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
type: Label, |
|
|
|
|
cls: 'bi-tips', |
|
|
|
|
text: BI.i18nText('Dec-Dcm_Connection_None'), |
|
|
|
|
}, |
|
|
|
|
], |
|
|
|
|
}, |
|
|
|
|
], |
|
|
|
|
}, |
|
|
|
|
], |
|
|
|
|
}; |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return { |
|
|
|
|
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), |
|
|
|
|
ref: (_ref: any) => { |
|
|
|
|
this.groupWidget = _ref; |
|
|
|
|
return { |
|
|
|
|
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), |
|
|
|
|
ref: (_ref: any) => { |
|
|
|
|
this.groupWidget = _ref; |
|
|
|
|
}, |
|
|
|
|
}; |
|
|
|
|
}, |
|
|
|
|
}; |
|
|
|
|
} |
|
|
|
|