From 6b70251440bd6dc483abc2fba9aa7463b86148f8 Mon Sep 17 00:00:00 2001 From: Dominik Csapak Date: Fri, 23 Jun 2017 11:36:37 +0200 Subject: [PATCH] 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 (this is also the default in the wizard) Signed-off-by: Dominik Csapak --- www/manager6/lxc/DNS.js | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/www/manager6/lxc/DNS.js b/www/manager6/lxc/DNS.js index cf7d4609..2c087ae7 100644 --- a/www/manager6/lxc/DNS.js +++ b/www/manager6/lxc/DNS.js @@ -164,13 +164,23 @@ Ext.define('PVE.lxc.DNS', { xtype: 'pveWindowEdit', subject: gettext('Hostname'), items: { - xtype: 'textfield', - name: 'hostname', - vtype: 'DnsName', - value: '', - fieldLabel: gettext('Hostname'), - allowBlank: true, - emptyText: me.pveSelNode.data.name + xtype: 'inputpanel', + items:{ + fieldLabel: gettext('Hostname'), + xtype: 'textfield', + name: 'hostname', + vtype: 'DnsName', + 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 }, @@ -231,6 +241,7 @@ Ext.define('PVE.lxc.DNS', { url: '/api2/extjs/' + baseurl }, rowdef.editor); win = Ext.createWidget(rowdef.editor.xtype, config); + win.load(); } //win.load(); win.show();