You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
66 lines
1.8 KiB
66 lines
1.8 KiB
6 years ago
|
import {WidgetType, Vertical, Left, Label} from '@ui/index';
|
||
|
import Model from './right.model';
|
||
6 years ago
|
import {info} from '@shared/crud/crud.request';
|
||
6 years ago
|
import RightCard from './right_card';
|
||
6 years ago
|
import {InfoType} from './right.typings';
|
||
6 years ago
|
import {LinkType} from '@ui/type';
|
||
|
import pluginListConstant from '../../app.constant';
|
||
|
|
||
6 years ago
|
const className = 'fr.component.linkStatus.right';
|
||
|
let Title: any = null;
|
||
6 years ago
|
let Group: any = null;
|
||
6 years ago
|
|
||
|
const Widget: WidgetType = {
|
||
|
_store() {
|
||
|
return BI.Models.getModel(Model);
|
||
|
},
|
||
6 years ago
|
watch: {
|
||
6 years ago
|
statusSelected(title: string) {
|
||
6 years ago
|
const link = BI.find(this.model.linkList, (index: number, item: LinkType) => item.connectionName === title);
|
||
|
const plugins: string[] = BI.Constants.getConstant(pluginListConstant);
|
||
|
const isPlugin = link.text && BI.some(plugins, (index: number, item: string) => item === link.text);
|
||
|
const Pool = isPlugin ? BI.Constants.getConstant(`dec.constant.database.conf.connect.form.${link.text.toLowerCase()}.pool`) : RightCard;
|
||
6 years ago
|
info(name, (res: InfoType) => {
|
||
|
Group.populate(BI.createItems([{
|
||
6 years ago
|
type: Pool,
|
||
6 years ago
|
...res,
|
||
|
}]));
|
||
|
});
|
||
6 years ago
|
Title.setText(`${BI.i18nText('Dec-Dcm_Data_Connections')}(${title})`);
|
||
6 years ago
|
},
|
||
|
},
|
||
|
render() {
|
||
|
return {
|
||
6 years ago
|
type: Vertical,
|
||
|
cls: 'database-right',
|
||
|
items: [
|
||
6 years ago
|
{
|
||
|
type: Left,
|
||
|
height: 40,
|
||
|
cls: 'right-status-title',
|
||
6 years ago
|
items: [
|
||
6 years ago
|
{
|
||
|
type: Label,
|
||
6 years ago
|
text: BI.i18nText('Dec-Dcm_Data_Connections'),
|
||
6 years ago
|
},
|
||
|
],
|
||
|
ref(ref: any) {
|
||
|
Title = ref;
|
||
|
},
|
||
|
}, {
|
||
|
type: Vertical,
|
||
|
cls: 'right-status-body',
|
||
6 years ago
|
ref(ref: any) {
|
||
|
Group = ref;
|
||
|
},
|
||
6 years ago
|
},
|
||
|
],
|
||
|
};
|
||
|
},
|
||
6 years ago
|
mounted() {
|
||
|
|
||
|
},
|
||
6 years ago
|
};
|
||
|
BI.shortcut(className, BI.inherit(BI.Widget, Widget));
|
||
|
export default className;
|