|
|
|
import { shortcut } from '@core/core';
|
|
|
|
import { POOL_CONFIG } from '@constants/constant';
|
|
|
|
import { FormItem } from '../form_item/form_item';
|
|
|
|
@shortcut()
|
|
|
|
export class PoolConfig extends BI.Widget {
|
|
|
|
static xtype = 'dec.dcm.connection.plugin.redis.components.pool'
|
|
|
|
|
|
|
|
props = {
|
|
|
|
poolConfig : {
|
|
|
|
...POOL_CONFIG,
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
render() {
|
|
|
|
const { maxTotal, maxWait, maxIdle, blockWhenExhausted, lifo, timeout } = this.options.poolConfig;
|
|
|
|
|
|
|
|
return {
|
|
|
|
type: BI.VerticalLayout.xtype,
|
|
|
|
hgap: 15,
|
|
|
|
vgap: 10,
|
|
|
|
items: [
|
|
|
|
{
|
|
|
|
type: FormItem.xtype,
|
|
|
|
name: BI.i18nText('Plugin-Redis_Pool_Max_Total'),
|
|
|
|
forms: [{
|
|
|
|
type: BI.Label.xtype,
|
|
|
|
text: maxTotal,
|
|
|
|
}],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
type: FormItem.xtype,
|
|
|
|
name: BI.i18nText('Plugin-Redis_Pool_Max_Wait'),
|
|
|
|
forms: [{
|
|
|
|
type: BI.Label.xtype,
|
|
|
|
text: maxWait,
|
|
|
|
}],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
type: FormItem.xtype,
|
|
|
|
name: BI.i18nText('Plugin-Redis_Pool_Max_Idle'),
|
|
|
|
forms: [{
|
|
|
|
type: BI.Label.xtype,
|
|
|
|
text: maxIdle,
|
|
|
|
}],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
type: FormItem.xtype,
|
|
|
|
name: BI.i18nText('Plugin-Redis_Pool_Block_When_Exhausted'),
|
|
|
|
forms: [{
|
|
|
|
type: BI.MultiSelectItem.xtype,
|
|
|
|
selected: blockWhenExhausted,
|
|
|
|
}],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
type: FormItem.xtype,
|
|
|
|
name: BI.i18nText('Plugin-Redis_Pool_Lifo'),
|
|
|
|
forms: [{
|
|
|
|
type: BI.MultiSelectItem.xtype,
|
|
|
|
selected: lifo,
|
|
|
|
}],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
type: FormItem.xtype,
|
|
|
|
name: BI.i18nText('Plugin-Redis_Pool_Timeout'),
|
|
|
|
forms: [{
|
|
|
|
type: BI.Label.xtype,
|
|
|
|
text: timeout,
|
|
|
|
}],
|
|
|
|
},
|
|
|
|
],
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|