fix lxc hostname input window

we used a static emptytext at creation, which is wrong after editing
now copied from qemu/Options.js (the name), but instead of deleting the
hostname on the backend on an empty field, we set it to CT<VMID>
(this is also the default in the wizard)

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
Dominik Csapak 2017-06-23 11:36:37 +02:00 committed by Dietmar Maurer
parent d5a7996b13
commit 6b70251440

View File

@ -164,13 +164,23 @@ Ext.define('PVE.lxc.DNS', {
xtype: 'pveWindowEdit', xtype: 'pveWindowEdit',
subject: gettext('Hostname'), subject: gettext('Hostname'),
items: { items: {
xtype: 'textfield', xtype: 'inputpanel',
name: 'hostname', items:{
vtype: 'DnsName', fieldLabel: gettext('Hostname'),
value: '', xtype: 'textfield',
fieldLabel: gettext('Hostname'), name: 'hostname',
allowBlank: true, vtype: 'DnsName',
emptyText: me.pveSelNode.data.name allowBlank: true
},
onGetValues: function(values) {
var params = values;
if (values.hostname === undefined ||
values.hostname === null ||
values.hostname === '') {
params = { hostname: 'CT'+vmid.toString()};
}
return params;
}
} }
} : undefined } : undefined
}, },
@ -231,6 +241,7 @@ Ext.define('PVE.lxc.DNS', {
url: '/api2/extjs/' + baseurl url: '/api2/extjs/' + baseurl
}, rowdef.editor); }, rowdef.editor);
win = Ext.createWidget(rowdef.editor.xtype, config); win = Ext.createWidget(rowdef.editor.xtype, config);
win.load();
} }
//win.load(); //win.load();
win.show(); win.show();