Commit a3aa27b4 authored by Dietmar Maurer's avatar Dietmar Maurer

use new PVE.lxc.NetworkInputPanel inside CreateWizard

parent b542888d
......@@ -43,12 +43,11 @@ Ext.define('PVE.lxc.CreateWizard', {
}
});
var bridgesel = Ext.create('PVE.form.BridgeSelector', {
name: 'bridge',
fieldLabel: gettext('Bridge'),
labelAlign: 'right',
autoSelect: true,
allowBlank: false
var networkpanel = Ext.create('PVE.lxc.NetworkInputPanel', {
title: gettext('Network'),
insideWizard: true,
dataCache: {},
create: true,
});
Ext.applyIf(me, {
......@@ -68,7 +67,7 @@ Ext.define('PVE.lxc.CreateWizard', {
change: function(f, value) {
tmplstoragesel.setNodename(value);
tmplsel.setStorage(undefined, value);
bridgesel.setNodename(value);
networkpanel.setNodename(value);
storagesel.setNodename(value);
}
}
......@@ -143,31 +142,7 @@ Ext.define('PVE.lxc.CreateWizard', {
title: gettext('Template'),
column1: [ tmplstoragesel, tmplsel]
},
// {
// xtype: 'pveLxcResourceInputPanel',
// title: gettext('Resources')
// },
{
xtype: 'inputpanel',
title: gettext('Network'),
column1: [
bridgesel,
{
xtype: 'pvecheckbox',
fieldLabel: gettext('Firewall'),
name: 'firewall',
checked: false,
disabled: true
}
],
onGetValues: function(values) {
var netif = PVE.Parser.printLxcNetwork({
link: values.bridge,
firewall: values.firewall
});
return { net0: netif };
}
},
networkpanel,
{
title: gettext('Confirm'),
layout: 'fit',
......
......@@ -4,6 +4,19 @@ Ext.define('PVE.lxc.NetworkInputPanel', {
insideWizard: false,
setNodename: function(nodename) {
var me = this;
if (!nodename || (me.nodename === nodename)) {
return;
}
me.nodename = nodename;
var bridgesel = me.query("[isFormField][name=link]")[0];
bridgesel.setNodename(nodename);
},
onGetValues: function(values) {
var me = this;
......@@ -15,7 +28,12 @@ Ext.define('PVE.lxc.NetworkInputPanel', {
id = me.ifname;
}
if (!id) {
return {};
}
var newdata = {};
newdata[id] = PVE.Parser.printLxcNetwork(values);
return newdata;
},
......@@ -27,12 +45,13 @@ Ext.define('PVE.lxc.NetworkInputPanel', {
throw "no dataCache specified";
}
if (!me.nodename) {
throw "no node name specified";
}
var cdata = {};
if (me.insideWizard) {
me.ifname = 'net0';
cdata.name = 'eth0';
}
if (!me.create) {
if (!me.ifname) {
throw "no interface name specified";
......@@ -58,6 +77,7 @@ Ext.define('PVE.lxc.NetworkInputPanel', {
xtype: 'combobox',
fieldLabel: gettext('ID'),
store: netliststore,
editable: false,
name: 'id',
value: me.ifname,
disabled: !me.create,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment