[pve-devel] [PATCH pve-manager] fix 'state' default value in resource edit dialog

Thomas Lamprecht t.lamprecht at proxmox.com
Thu Sep 10 09:10:52 CEST 2015


as we assume the default to 'enabled' when state isn't explicitly
set, use this default when editing a resource.

Signed-off-by: Thomas Lamprecht <t.lamprecht at proxmox.com>
---

Should be the final version of this bugfix, hopefully.

 www/manager/ha/ResourceEdit.js | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/www/manager/ha/ResourceEdit.js b/www/manager/ha/ResourceEdit.js
index bc48c70..f4a762f 100644
--- a/www/manager/ha/ResourceEdit.js
+++ b/www/manager/ha/ResourceEdit.js
@@ -108,9 +108,9 @@ Ext.define('PVE.ha.VMResourceEdit', {
 		success:  function(response, options) {
 		    var values = response.result.data;
 
-		    values.enable = false;
-		    if (values.state === 'enabled') {
-			values.enable = true;
+		    values.enable = true;
+		    if (values.state === 'disabled') {
+			values.enable = false;
 		    }
 
 		    var regex =  /^(\S+):(\S+)$/;
-- 
2.1.4




More information about the pve-devel mailing list