[pve-devel] [PATCH manager] correctly set 'nowritecache' on zfsplugin

Dominik Csapak d.csapak at proxmox.com
Wed Feb 22 14:42:28 CET 2017


the logic was reversed, checking writecache enabled 'nowritecache',
now the logic is correct, setting 'nowritecache' if 'writecache' is
unchecked

Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
changes from v1:
 reverse also the logic when using in an editwindow
 have to use strings because we get a string from the api
 www/manager6/storage/ZFSEdit.js | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/www/manager6/storage/ZFSEdit.js b/www/manager6/storage/ZFSEdit.js
index 12d6af1..b0d84ab 100644
--- a/www/manager6/storage/ZFSEdit.js
+++ b/www/manager6/storage/ZFSEdit.js
@@ -91,8 +91,9 @@ Ext.define('PVE.storage.ZFSInputPanel', {
 	    {
 		xtype: 'pvecheckbox',
 		name: 'nowritecache',
-		checked: true,
-		uncheckedValue: 0,
+		checked: false,
+		uncheckedValue: 1,
+		inputValue: 0,
 		fieldLabel: gettext('Write cache')
 	    },
 	    {
@@ -157,6 +158,8 @@ Ext.define('PVE.storage.ZFSEdit', {
                         values.nodes = values.nodes.split(',');
                     }
                     values.enable = values.disable ? 0 : 1;
+		    // reverse the logic for the checkbox
+		    values.nowritecache = values.nowritecache == '0'?'1':'0';
                     ipanel.setValues(values);
                 }
             });
-- 
2.1.4





More information about the pve-devel mailing list