Commit c0ef5e6a authored by Dietmar Maurer's avatar Dietmar Maurer

fix bug 44: allow to use templates from NFS

parent 1bdfb50d
...@@ -36,6 +36,19 @@ Ext.define('PVE.openvz.CreateWizard', { ...@@ -36,6 +36,19 @@ Ext.define('PVE.openvz.CreateWizard', {
allowBlank: false allowBlank: false
}); });
var tmplstoragesel = Ext.create('PVE.form.StorageSelector', {
name: 'tmplstorage',
fieldLabel: 'Storage',
storageContent: 'vztmpl',
autoSelect: true,
allowBlank: false,
listeners: {
change: function(f, value) {
tmplsel.setStorage(value);
}
}
});
var bridgesel = Ext.create('PVE.form.BridgeSelector', { var bridgesel = Ext.create('PVE.form.BridgeSelector', {
name: 'bridge', name: 'bridge',
fieldLabel: 'Bridge', fieldLabel: 'Bridge',
...@@ -60,7 +73,8 @@ Ext.define('PVE.openvz.CreateWizard', { ...@@ -60,7 +73,8 @@ Ext.define('PVE.openvz.CreateWizard', {
onlineValidator: true, onlineValidator: true,
listeners: { listeners: {
change: function(f, value) { change: function(f, value) {
tmplsel.setStorage('local', value); tmplstoragesel.setNodename(value);
tmplsel.setStorage(undefined, value);
bridgesel.setNodename(value); bridgesel.setNodename(value);
storagesel.setNodename(value); storagesel.setNodename(value);
} }
...@@ -122,7 +136,7 @@ Ext.define('PVE.openvz.CreateWizard', { ...@@ -122,7 +136,7 @@ Ext.define('PVE.openvz.CreateWizard', {
{ {
xtype: 'inputpanel', xtype: 'inputpanel',
title: 'Template', title: 'Template',
items: tmplsel column1: [ tmplstoragesel, tmplsel]
}, },
{ {
xtype: 'pveOpenVZResourceInputPanel', xtype: 'pveOpenVZResourceInputPanel',
...@@ -250,7 +264,7 @@ Ext.define('PVE.openvz.CreateWizard', { ...@@ -250,7 +264,7 @@ Ext.define('PVE.openvz.CreateWizard', {
var kv = me.getValues(); var kv = me.getValues();
var data = []; var data = [];
Ext.Object.each(kv, function(key, value) { Ext.Object.each(kv, function(key, value) {
if (key === 'delete') { // ignore if (key === 'delete' || key === 'tmplstorage') { // ignore
return; return;
} }
if (key === 'password') { // don't show pw if (key === 'password') { // don't show pw
...@@ -273,6 +287,7 @@ Ext.define('PVE.openvz.CreateWizard', { ...@@ -273,6 +287,7 @@ Ext.define('PVE.openvz.CreateWizard', {
var nodename = kv.nodename; var nodename = kv.nodename;
delete kv.nodename; delete kv.nodename;
delete kv.tmplstorage;
PVE.Utils.API2Request({ PVE.Utils.API2Request({
url: '/nodes/' + nodename + '/openvz', url: '/nodes/' + nodename + '/openvz',
......
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