Commit f98c8032 authored by Dietmar Maurer's avatar Dietmar Maurer

StorageSelector: alow to use new target option

Useful for clone API to restrict storage list.
parent 1fd63606
......@@ -2,26 +2,53 @@ Ext.define('PVE.form.StorageSelector', {
extend: 'PVE.form.ComboGrid',
alias: ['widget.PVE.form.StorageSelector'],
setNodename: function(nodename) {
reloadStorageList: function() {
var me = this;
if (!nodename || (me.nodename === nodename)) {
if (!me.nodename) {
return;
}
me.nodename = nodename;
var params = {};
var url = '/api2/json/nodes/' + me.nodename + '/storage';
if (me.storageContent) {
url += '?content=' + me.storageContent;
params.content = me.storageContent;
}
if (me.targetNode) {
params.target = me.targetNode;
params.enabled = 1; // skip disabled storages
}
me.store.setProxy({
type: 'pve',
url: url
url: url,
extraParams: params
});
me.store.load();
},
setTargetNode: function(targetNode) {
var me = this;
if (!targetNode || (me.targetNode === targetNode)) {
return;
}
me.targetNode = targetNode;
me.reloadStorageList();
},
setNodename: function(nodename) {
var me = this;
if (!nodename || (me.nodename === nodename)) {
return;
}
me.nodename = nodename;
me.reloadStorageList();
},
initComponent: function() {
......
......@@ -204,6 +204,10 @@ Ext.define('PVE.window.Clone', {
});
me.targetSel.on('change', function(f, value) {
me.hdstoragesel.setTargetNode(value);
});
me.formatsel = Ext.create('PVE.form.DiskFormatSelector', {
name: 'diskformat',
fieldLabel: gettext('Format'),
......
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