mirror of
https://git.proxmox.com/git/pve-manager
synced 2025-08-14 22:53:21 +00:00
add upload button conditionally
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
This commit is contained in:
parent
dbeddeb322
commit
8798c35bcd
@ -80,6 +80,7 @@ Ext.define('PVE.storage.Browser', {
|
||||
content: 'iso',
|
||||
stateful: true,
|
||||
stateId: 'grid-storage-content-iso',
|
||||
useUploadButton: true,
|
||||
});
|
||||
}
|
||||
if (contents.includes('rootdir')) {
|
||||
@ -113,6 +114,7 @@ Ext.define('PVE.storage.Browser', {
|
||||
content: 'vztmpl',
|
||||
stateful: true,
|
||||
stateId: 'grid-storage-content-vztmpl',
|
||||
useUploadButton: true,
|
||||
});
|
||||
}
|
||||
me.insertNodes(items);
|
||||
|
@ -440,24 +440,17 @@ Ext.define('PVE.storage.ContentView', {
|
||||
}
|
||||
|
||||
var uploadButton = Ext.create('Proxmox.button.Button', {
|
||||
contents : ['iso','vztmpl'],
|
||||
text: gettext('Upload'),
|
||||
handler: function() {
|
||||
var me = this;
|
||||
var win = Ext.create('PVE.storage.Upload', {
|
||||
nodename: nodename,
|
||||
storage: storage,
|
||||
contents: me.contents
|
||||
contents: [content],
|
||||
});
|
||||
win.show();
|
||||
win.on('destroy', reload);
|
||||
}
|
||||
});
|
||||
if (content === 'iso' || content === 'vztmpl') {
|
||||
uploadButton.contents = [content];
|
||||
} else {
|
||||
uploadButton.setDisabled(true);
|
||||
}
|
||||
|
||||
var imageRemoveButton;
|
||||
var removeButton = Ext.create('Proxmox.button.StdRemoveButton',{
|
||||
@ -530,6 +523,9 @@ Ext.define('PVE.storage.ContentView', {
|
||||
if (!me.tbar) {
|
||||
me.tbar = [];
|
||||
}
|
||||
if (me.useUploadButton) {
|
||||
me.tbar.push(uploadButton);
|
||||
}
|
||||
me.tbar.push(
|
||||
{
|
||||
xtype: 'proxmoxButton',
|
||||
@ -562,7 +558,6 @@ Ext.define('PVE.storage.ContentView', {
|
||||
removeButton,
|
||||
imageRemoveButton,
|
||||
templateButton,
|
||||
uploadButton,
|
||||
{
|
||||
xtype: 'proxmoxButton',
|
||||
text: gettext('Show Configuration'),
|
||||
|
Loading…
Reference in New Issue
Block a user