-/*jslint confusion: true*/
/* hidden: boolean and string
* bind: function and object
* disabled: boolean and string
var me = this;
var confid = me.confid || "mp"+values.mpid;
- values.file = me.down('field[name=file]').getValue();
- if (values.mountoptions) {
- values.mountoptions = values.mountoptions.join(';');
- }
+ me.mp.file = me.down('field[name=file]').getValue();
if (me.unused) {
confid = "mp"+values.mpid;
} else if (me.isCreate) {
- values.file = values.hdstorage + ':' + values.disksize;
+ me.mp.file = values.hdstorage + ':' + values.disksize;
}
// delete unnecessary fields
delete values.disksize;
delete values.diskformat;
+ let mountopts = (values.mountoptions || []).join(';');
+ PVE.Utils.propertyStringSet(me.mp, values.mp, 'mp');
+ PVE.Utils.propertyStringSet(me.mp, values.mountoptions, 'mountoptions', mountopts);
+ PVE.Utils.propertyStringSet(me.mp, values.backup, 'backup');
+ PVE.Utils.propertyStringSet(me.mp, values.quota, 'quota');
+ PVE.Utils.propertyStringSet(me.mp, values.ro, 'ro');
+ PVE.Utils.propertyStringSet(me.mp, values.acl, 'acl');
+ PVE.Utils.propertyStringSet(me.mp, values.replicate, 'replicate');
+
var res = {};
- res[confid] = PVE.Parser.printLxcMountPoint(values);
+ res[confid] = PVE.Parser.printLxcMountPoint(me.mp);
return res;
},
if (mp.mountoptions) {
mp.mountoptions = mp.mountoptions.split(';');
}
+ me.mp = mp;
+
+ if (this.confid === 'rootfs') {
+ var field = me.down('field[name=mountoptions]');
+ var forbidden = ['nodev', 'noexec'];
+ var filtered = field.comboItems.filter(e => !forbidden.includes(e[0]));
+ field.setComboItems(filtered);
+ }
+
me.setValues(mp);
},
var vm = me.getViewModel();
me.vmconfig = vmconfig;
vm.set('unpriv', vmconfig.unprivileged);
- vm.notify();
PVE.Utils.forEachMP(function(bus, i) {
var name = "mp" + i.toString();
var me = this;
var vm = me.getViewModel();
vm.set('node', nodename);
- vm.notify();
me.down('#diskstorage').setNodename(nodename);
},
var vm = me.getViewModel();
vm.set('type', rec.data.type);
- vm.notify();
}
}
},
init: function(view) {
var me = this;
var vm = this.getViewModel();
+ view.mp = {};
vm.set('confid', view.confid);
vm.set('unused', view.unused);
vm.set('node', view.nodename);
vm.set('unpriv', view.unprivileged);
vm.set('hideStorSelector', view.unused || !view.isCreate);
- vm.notify();
+
+ // can be array if created from unused disk
+ if (view.isCreate) {
+ vm.set('isIncludedInBackup', true);
+ }
}
},
if (Ext.isDefined(me.vmconfig["mp"+value])) {
return "Mount point is already in use.";
}
- /*jslint confusion: true*/
/* returns a string above */
return true;
}
xtype: 'proxmoxcheckbox',
name: 'backup',
fieldLabel: gettext('Backup'),
+ autoEl: {
+ tag: 'div',
+ 'data-qtip': gettext('Include volume in backup job'),
+ },
bind: {
hidden: '{isRoot}',
- disabled: '{isBindOrRoot}'
+ disabled: '{isBindOrRoot}',
+ value: '{isIncludedInBackup}'
}
}
],
success: function(response, options) {
ipanel.setVMConfig(response.result.data);
if (me.confid) {
- /*jslint confusion: true*/
/*data is defined as array above*/
var value = response.result.data[me.confid];
- /*jslint confusion: false*/
var mp = PVE.Parser.parseLxcMountPoint(value);
if (!mp) {