diff --git a/www/manager6/ha/ResourceEdit.js b/www/manager6/ha/ResourceEdit.js index e3ba286d0..83db64748 100644 --- a/www/manager6/ha/ResourceEdit.js +++ b/www/manager6/ha/ResourceEdit.js @@ -25,7 +25,20 @@ Ext.define('PVE.ha.VMResourceInputPanel', { values.state = 'disabled'; } delete values.enable; - + + if (values.max_restart == '1') { + if (!me.create) { + values['delete'] = values['delete'] ? values['delete'] + ',max_restart' : 'max_restart'; + } + delete values.max_restart; + } + if (values.max_relocate == '1') { + if (!me.create) { + values['delete'] = values['delete'] ? values['delete'] + ',max_relocate' : 'max_relocate'; + } + delete values.max_relocate; + } + return values; }, @@ -48,6 +61,24 @@ Ext.define('PVE.ha.VMResourceInputPanel', { value: me.vmid, loadNextFreeVMID: false, validateExists: true + }, + { + xtype: 'numberfield', + name: 'max_restart', + fieldLabel: gettext('Max. Restart'), + value: 1, + minValue: 0, + maxValue: 10, + allowBlank: false + }, + { + xtype: 'numberfield', + name: 'max_relocate', + fieldLabel: gettext('Max. Relocate'), + value: 1, + minValue: 0, + maxValue: 10, + allowBlank: false } ]; diff --git a/www/manager6/ha/Resources.js b/www/manager6/ha/Resources.js index b40c99ba4..af9775dd8 100644 --- a/www/manager6/ha/Resources.js +++ b/www/manager6/ha/Resources.js @@ -123,6 +123,24 @@ Ext.define('PVE.ha.ResourcesView', { }, dataIndex: 'state' }, + { + header: gettext('Max. Restart'), + width: 100, + sortable: true, + renderer: function(v) { + return v || '1'; + }, + dataIndex: 'max_restart' + }, + { + header: gettext('Max. Relocate'), + width: 100, + sortable: true, + renderer: function(v) { + return v || '1'; + }, + dataIndex: 'max_relocate' + }, { header: gettext('Group'), width: 200, @@ -157,7 +175,8 @@ Ext.define('PVE.ha.ResourcesView', { Ext.define('pve-ha-resources', { extend: 'Ext.data.Model', fields: [ - 'sid', 'state', 'digest', 'errors', 'group', 'comment' + 'sid', 'state', 'digest', 'errors', 'group', 'comment', + 'max_restart', 'max_relocate', ], idProperty: 'sid' });