Commit 83c9f382 authored by Dietmar Maurer's avatar Dietmar Maurer

add nice ha group selector

parent 38d1f88d
...@@ -166,6 +166,7 @@ JSSRC= \ ...@@ -166,6 +166,7 @@ JSSRC= \
storage/ZFSEdit.js \ storage/ZFSEdit.js \
storage/ZFSPoolEdit.js \ storage/ZFSPoolEdit.js \
ha/StatusView.js \ ha/StatusView.js \
ha/GroupSelector.js \
ha/ResourceEdit.js \ ha/ResourceEdit.js \
ha/Resources.js \ ha/Resources.js \
ha/GroupEdit.js \ ha/GroupEdit.js \
......
Ext.define('PVE.ha.GroupSelector', {
extend: 'PVE.form.ComboGrid',
alias: ['widget.pveHAGroupSelector'],
initComponent: function() {
var me = this;
var store = new Ext.data.Store({
model: 'pve-ha-groups',
sorters: {
property: 'group',
order: 'DESC'
}
});
Ext.apply(me, {
store: store,
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'
}
]
}
});
me.callParent();
store.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'
});
});
...@@ -7,10 +7,6 @@ Ext.define('PVE.ha.GroupsView', { ...@@ -7,10 +7,6 @@ Ext.define('PVE.ha.GroupsView', {
var store = new Ext.data.Store({ var store = new Ext.data.Store({
model: 'pve-ha-groups', model: 'pve-ha-groups',
proxy: {
type: 'pve',
url: "/api2/json/cluster/ha/groups"
},
sorters: { sorters: {
property: 'group', property: 'group',
order: 'DESC' order: 'DESC'
...@@ -120,15 +116,4 @@ Ext.define('PVE.ha.GroupsView', { ...@@ -120,15 +116,4 @@ Ext.define('PVE.ha.GroupsView', {
me.callParent(); me.callParent();
} }
}, function() {
Ext.define('pve-ha-groups', {
extend: 'Ext.data.Model',
fields: [
'group', 'type', 'restricted', 'digest', 'nofailback',
'nodes', 'comment'
],
idProperty: 'group'
});
}); });
...@@ -11,7 +11,13 @@ Ext.define('PVE.ha.VMResourceInputPanel', { ...@@ -11,7 +11,13 @@ Ext.define('PVE.ha.VMResourceInputPanel', {
if (me.create) { if (me.create) {
values.type = 'vm'; values.type = 'vm';
values.sid = values.vmid; values.sid = values.vmid;
delete values['delete']; // ignore }
if (values.group === '') {
if (!me.create) {
values['delete'] = values['delete'] ? ',group' : 'group';
}
delete values.group;
} }
delete values.vmid; delete values.vmid;
...@@ -42,10 +48,9 @@ Ext.define('PVE.ha.VMResourceInputPanel', { ...@@ -42,10 +48,9 @@ Ext.define('PVE.ha.VMResourceInputPanel', {
me.column2 = [ me.column2 = [
{ {
xtype: 'pvetextfield', // fixme: group selector xtype: 'pveHAGroupSelector',
name: 'group', name: 'group',
value: '', value: '',
deleteEmpty: true,
fieldLabel: gettext('Group') fieldLabel: gettext('Group')
}, },
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment