}
});
- 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, {
change: function(f, value) {
tmplstoragesel.setNodename(value);
tmplsel.setStorage(undefined, value);
- bridgesel.setNodename(value);
+ networkpanel.setNodename(value);
storagesel.setNodename(value);
}
}
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',
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;
id = me.ifname;
}
+ if (!id) {
+ return {};
+ }
+
var newdata = {};
+
newdata[id] = PVE.Parser.printLxcNetwork(values);
return newdata;
},
if (!me.dataCache) {
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";
xtype: 'combobox',
fieldLabel: gettext('ID'),
store: netliststore,
+ editable: false,
name: 'id',
value: me.ifname,
disabled: !me.create,