pve-manager/www/manager6/Toolkit.js
Thomas Lamprecht 8c93faf917 ui: rbd: storage: obsolete strange getBinds binding assembly
this was added for our (also in other places used):
> xtype: me.isCreate ? 'pveCephPoolSelector' : 'displayfield',
construct. But as displayfield does not has a submitValue setter we
cannot bind it generally.

So add such a setter with a small override and declare the bindings
direct when declaring the items, less side effects and all the
configurations for an item stays in the same place.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-11-19 10:40:49 +01:00

39 lines
988 B
JavaScript

// ExtJS related things
Proxmox.Utils.toolkit = 'extjs';
// custom PVE specific VTypes
Ext.apply(Ext.form.field.VTypes, {
QemuStartDate: function(v) {
return (/^(now|\d{4}-\d{1,2}-\d{1,2}(T\d{1,2}:\d{1,2}:\d{1,2})?)$/).test(v);
},
QemuStartDateText: gettext('Format') + ': "now" or "2006-06-17T16:01:21" or "2006-06-17"',
IP64AddressList: function(v) {
var list = v.split(/[\ \,\;]+/);
var i;
for (i = 0; i < list.length; i++) {
if (list[i] == '') {
continue;
}
if (!Proxmox.Utils.IP64_match.test(list[i])) {
return false;
}
}
return true;
},
IP64AddressListText: gettext('Example') + ': 192.168.1.1,192.168.1.2',
IP64AddressListMask: /[A-Fa-f0-9\,\:\.\;\ ]/
});
Ext.define('PVE.form.field.Display', {
override: 'Ext.form.field.Display',
setSubmitValue: function(value) {
// do nothing, this is only to allow generalized bindings for the:
// `me.isCreate ? 'textfield' : 'displayfield'` cases we have.
}
});