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.
+ }
+});
}
me.type = 'rbd';
- var getBinds = function (activeIfPVECeph, hide) {
- var bind = {
- disabled: activeIfPVECeph ? '{!pveceph}' : '{pveceph}'
- };
-
- // displayfield has no submitValue and bind mixin cannot handle that
- if (me.isCreate) {
- bind.submitValue = activeIfPVECeph ? '{pveceph}' : '{!pveceph}';
- }
- if (hide) {
- bind.hidden = activeIfPVECeph ? '{!pveceph}' : '{pveceph}';
- }
-
- return bind;
- };
-
me.column1 = [
{
xtype: me.isCreate ? 'pveCephPoolSelector' : 'displayfield',
nodename: me.nodename,
name: 'pool',
- bind: getBinds(true, true),
+ bind: {
+ disabled: '{!pveceph}',
+ submitValue: '{pveceph}',
+ hidden: '{!pveceph}'
+ },
fieldLabel: gettext('Pool'),
allowBlank: false
},
xtype: me.isCreate ? 'textfield' : 'displayfield',
name: 'pool',
value: 'rbd',
- bind: getBinds(false, true),
+ bind: {
+ disabled: '{pveceph}',
+ submitValue: '{!pveceph}',
+ hidden: '{pveceph}'
+ },
fieldLabel: gettext('Pool'),
allowBlank: false
},
xtype: 'textfield',
name: 'monhost',
vtype: 'HostList',
- bind: getBinds(false, true),
+ bind: {
+ disabled: '{pveceph}',
+ submitValue: '{!pveceph}',
+ hidden: '{pveceph}'
+ },
value: '',
fieldLabel: 'Monitor(s)',
allowBlank: false
{
xtype: me.isCreate ? 'textfield' : 'displayfield',
name: 'username',
- bind: me.isCreate ? getBinds(false) : {},
+ bind: {
+ disabled: '{pveceph}',
+ submitValue: '{!pveceph}'
+ },
value: 'admin',
fieldLabel: gettext('User name'),
allowBlank: true