pve-manager/www/manager6/ha/GroupSelector.js
Emmanuel Kasper 7fc52dff20 fix HA Group Selector display
displayField must now be set in class body, take opportunity to move out
other config properties from initComponent()
2016-02-26 07:39:53 +01:00

58 lines
1000 B
JavaScript

Ext.define('PVE.ha.GroupSelector', {
extend: 'PVE.form.ComboGrid',
alias: ['widget.pveHAGroupSelector'],
autoSelect: false,
valueField: 'group',
displayField: 'group',
listConfig: {
columns: [
{
header: gettext('Group'),
width: 100,
sortable: true,
dataIndex: 'group'
},
{
header: gettext('Nodes'),
width: 100,
sortable: false,
dataIndex: 'nodes'
},
{
header: gettext('Comment'),
flex: 1,
dataIndex: 'comment'
}
]
},
store: {
model: 'pve-ha-groups',
sorters: {
property: 'group',
order: 'DESC'
}
},
initComponent: function() {
var me = this;
me.callParent();
me.getStore().load();
}
}, function() {
Ext.define('pve-ha-groups', {
extend: 'Ext.data.Model',
fields: [
'group', 'type', 'restricted', 'digest', 'nofailback',
'nodes', 'comment'
],
proxy: {
type: 'pve',
url: "/api2/json/cluster/ha/groups"
},
idProperty: 'group'
});
});