]> git.proxmox.com Git - pve-manager.git/blobdiff - www/manager6/lxc/FeaturesEdit.js
ui: eslint: fix trailing comma and comma related whitespaces errors
[pve-manager.git] / www / manager6 / lxc / FeaturesEdit.js
index 02ce0a1d3e0c5ff20bfaa2db756a94fa943b2010..042d32a6c7d2f12bdc44c90150476a15f0d275ae 100644 (file)
@@ -7,27 +7,65 @@ Ext.define('PVE.lxc.FeaturesInputPanel', {
 
     fstypes: ['nfs', 'cifs'],
 
+    viewModel: {
+       parent: null,
+       data: {
+           unprivileged: false,
+       },
+       formulas: {
+           privilegedOnly: function(get) {
+               return (get('unprivileged') ? gettext('privileged only') : '');
+           },
+           unprivilegedOnly: function(get) {
+               return (!get('unprivileged') ? gettext('unprivileged only') : '');
+           },
+       },
+    },
+
     items: [
        {
            xtype: 'proxmoxcheckbox',
            fieldLabel: gettext('keyctl'),
-           name: 'keyctl'
+           name: 'keyctl',
+           bind: {
+               disabled: '{!unprivileged}',
+               boxLabel: '{unprivilegedOnly}',
+           },
        },
        {
            xtype: 'proxmoxcheckbox',
            fieldLabel: gettext('Nesting'),
-           name: 'nesting'
+           name: 'nesting',
        },
        {
            xtype: 'proxmoxcheckbox',
            name: 'nfs',
-           fieldLabel: 'NFS'
+           fieldLabel: 'NFS',
+           bind: {
+               disabled: '{unprivileged}',
+               boxLabel: '{privilegedOnly}',
+           },
        },
        {
            xtype: 'proxmoxcheckbox',
            name: 'cifs',
-           fieldLabel: 'CIFS'
-       }
+           fieldLabel: 'CIFS',
+           bind: {
+               disabled: '{unprivileged}',
+               boxLabel: '{privilegedOnly}',
+           },
+       },
+       {
+           xtype: 'proxmoxcheckbox',
+           name: 'fuse',
+           fieldLabel: 'FUSE',
+       },
+       {
+           xtype: 'proxmoxcheckbox',
+           name: 'mknod',
+           fieldLabel: gettext('Create Device Nodes'),
+           boxLabel: gettext('Experimental'),
+       },
     ],
 
     onGetValues: function(values) {
@@ -54,7 +92,7 @@ Ext.define('PVE.lxc.FeaturesInputPanel', {
     setValues: function(values) {
        var me = this;
 
-       me.down('field[name=keyctl]').setDisabled(!values.unprivileged);
+       me.viewModel.set('unprivileged', values.unprivileged);
 
        if (values.features) {
            var res = PVE.Parser.parsePropertyString(values.features);
@@ -70,7 +108,13 @@ Ext.define('PVE.lxc.FeaturesInputPanel', {
            }
            this.callParent([res]);
        }
-    }
+    },
+
+    initComponent: function() {
+       let me = this;
+       me.mounts = []; // reset state
+       me.callParent();
+    },
 });
 
 Ext.define('PVE.lxc.FeaturesEdit', {
@@ -78,16 +122,10 @@ Ext.define('PVE.lxc.FeaturesEdit', {
     xtype: 'pveLxcFeaturesEdit',
 
     subject: gettext('Features'),
+    autoLoad: true,
+    width: 350,
 
     items: [{
-       xtype: 'pveLxcFeaturesInputPanel'
+       xtype: 'pveLxcFeaturesInputPanel',
     }],
-
-    initComponent : function() {
-       var me = this;
-
-       me.callParent();
-
-       me.load();
-    }
 });