]> git.proxmox.com Git - pve-manager.git/commitdiff
fix #1518: ui: qemu: add HA manage menu item to panel
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 17 Oct 2017 09:48:04 +0000 (11:48 +0200)
committerWolfgang Bumiller <w.bumiller@proxmox.com>
Thu, 19 Oct 2017 07:24:46 +0000 (09:24 +0200)
Allows to add an unmanaged VM to HA or to edit the HA settings of a
managed one.

Fixes: #1518
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Acked-by: Dominik Csapak <d.csapak@proxmox.com>
www/manager6/ha/ResourceEdit.js
www/manager6/qemu/Config.js

index dd3d645ae4c92e90e29478cc829fc9c4c013f1ce..d21d6bd01849698927cef476a1bc857b6a46d05b 100644 (file)
@@ -6,11 +6,9 @@ Ext.define('PVE.ha.VMResourceInputPanel', {
     onGetValues: function(values) {
        var me = this;
 
-       if (me.isCreate) {
+       if (values.vmid) {
            values.sid = values.vmid;
        }
-       
-
        delete values.vmid;
 
        PVE.Utils.delete_if_default(values, 'group', '', me.isCreate);
@@ -161,11 +159,14 @@ Ext.define('PVE.ha.VMResourceEdit', {
 
     vmid: undefined,
     guestType: undefined,
+    isCreate: undefined,
 
     initComponent : function() {
        var me = this;
  
-       me.isCreate = !me.vmid;
+       if (me.isCreate === undefined) {
+           me.isCreate = !me.vmid;
+       }
 
        if (me.isCreate) {
             me.url = '/api2/extjs/cluster/ha/resources';
index 421e062d421087e2e5d94d7979f3b49f2ce587c3..f36ba690b1ff8724c3c1d1eb73e2ecaffe73e4fa 100644 (file)
@@ -104,6 +104,18 @@ Ext.define('PVE.qemu.Config', {
                        });
                    }
                },
+               {
+                   iconCls: 'fa fa-heartbeat ',
+                   hidden: !caps.nodes['Sys.Console'],
+                   text: gettext('Manage HA'),
+                   handler: function() {
+                       var ha = me.pveSelNode.data.hastate;
+                       Ext.create('PVE.ha.VMResourceEdit', {
+                           vmid: vmid,
+                           isCreate: (!ha || ha === 'unmanaged')
+                       }).show();
+                   }
+               },
                {
                    text: gettext('Remove'),
                    itemId: 'removeBtn',