data: {
pveceph: true,
pvecephPossible: true,
+ namespacePresent: false,
},
});
disable: 'resetField',
enable: 'resetField',
},
+ 'textfield[name=namespace]': {
+ change: 'updateNamespaceHint',
+ },
},
resetField: function(field) {
field.reset();
},
+ updateNamespaceHint: function(field, newVal, oldVal) {
+ this.getViewModel().set('namespacePresent', newVal);
+ },
queryMonitors: function(field, newVal, oldVal) {
// we get called with two signatures, the above one for a field
// change event and the afterrender from the view, this check only
this.lookupReference('pvecephRef').setValue(false);
this.lookupReference('pvecephRef').resetOriginalValue();
}
+ if (values.namespace) {
+ this.getViewModel().set('namespacePresent', true);
+ }
this.callParent([values]);
},
fieldLabel: gettext('User name'),
allowBlank: true,
},
+ {
+ xtype: 'pmxDisplayEditField',
+ editable: me.isCreate,
+ name: 'namespace',
+ value: '',
+ fieldLabel: gettext('Namespace'),
+ allowBlank: true,
+ },
);
me.column2 = [
},
];
- me.columnB = [{
- xtype: 'proxmoxcheckbox',
- name: 'pveceph',
- reference: 'pvecephRef',
- bind: {
- disabled: '{!pvecephPossible}',
- value: '{pveceph}',
+ me.columnB = [
+ {
+ xtype: 'proxmoxcheckbox',
+ name: 'pveceph',
+ reference: 'pvecephRef',
+ bind: {
+ disabled: '{!pvecephPossible}',
+ value: '{pveceph}',
+ },
+ checked: true,
+ uncheckedValue: 0,
+ submitValue: false,
+ hidden: !me.isCreate,
+ boxLabel: gettext('Use Proxmox VE managed hyper-converged ceph pool'),
},
- checked: true,
- uncheckedValue: 0,
- submitValue: false,
- hidden: !me.isCreate,
- boxLabel: gettext('Use Proxmox VE managed hyper-converged ceph pool'),
- }];
+ {
+ xtype: 'displayfield',
+ name: 'namespace-hint',
+ userCls: 'pmx-hint',
+ value: gettext('RBD namespaces must be created manually!'),
+ bind: {
+ hidden: '{!namespacePresent}',
+ },
+ },
+ ];
me.callParent();
},