mirror of
https://git.proxmox.com/git/proxmox-backup
synced 2025-08-09 03:09:03 +00:00
ui: tape: add remove media button
this only removes media from the inventory, it does not touch the data Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
parent
ee347f69ae
commit
3657fa1ff3
@ -21,6 +21,7 @@ TAPE_UI_FILES= \
|
|||||||
tape/window/Erase.js \
|
tape/window/Erase.js \
|
||||||
tape/window/EncryptionEdit.js \
|
tape/window/EncryptionEdit.js \
|
||||||
tape/window/LabelMedia.js \
|
tape/window/LabelMedia.js \
|
||||||
|
tape/window/MediaRemoveWindow.js \
|
||||||
tape/window/PoolEdit.js \
|
tape/window/PoolEdit.js \
|
||||||
tape/window/TapeBackup.js \
|
tape/window/TapeBackup.js \
|
||||||
tape/window/TapeBackupJob.js \
|
tape/window/TapeBackupJob.js \
|
||||||
|
@ -60,6 +60,27 @@ Ext.define('PBS.TapeManagement.TapeInventory', {
|
|||||||
}).show();
|
}).show();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
remove: function() {
|
||||||
|
let me = this;
|
||||||
|
let view = me.getView();
|
||||||
|
let selection = view.getSelection();
|
||||||
|
if (!selection || selection.length < 1) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
let uuid = selection[0].data.uuid;
|
||||||
|
let label = selection[0].data['label-text'];
|
||||||
|
Ext.create('PBS.TapeManagement.MediaRemoveWindow', {
|
||||||
|
uuid,
|
||||||
|
label,
|
||||||
|
autoShow: true,
|
||||||
|
listeners: {
|
||||||
|
destroy: function() {
|
||||||
|
me.reload();
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
moveToVault: function() {
|
moveToVault: function() {
|
||||||
let me = this;
|
let me = this;
|
||||||
let view = me.getView();
|
let view = me.getView();
|
||||||
@ -206,6 +227,12 @@ Ext.define('PBS.TapeManagement.TapeInventory', {
|
|||||||
disabled: true,
|
disabled: true,
|
||||||
handler: 'format',
|
handler: 'format',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
xtype: 'proxmoxButton',
|
||||||
|
text: gettext('Remove'),
|
||||||
|
disabled: true,
|
||||||
|
handler: 'remove',
|
||||||
|
},
|
||||||
],
|
],
|
||||||
|
|
||||||
features: [
|
features: [
|
||||||
|
66
www/tape/window/MediaRemoveWindow.js
Normal file
66
www/tape/window/MediaRemoveWindow.js
Normal file
@ -0,0 +1,66 @@
|
|||||||
|
Ext.define('PBS.TapeManagement.MediaRemoveWindow', {
|
||||||
|
extend: 'Proxmox.window.Edit',
|
||||||
|
mixins: ['Proxmox.Mixin.CBind'],
|
||||||
|
|
||||||
|
uuid: undefined,
|
||||||
|
label: undefined,
|
||||||
|
|
||||||
|
cbindData: function(config) {
|
||||||
|
let me = this;
|
||||||
|
return {
|
||||||
|
uuid: me.uuid,
|
||||||
|
warning: Ext.String.format(gettext("Are you sure you want to remove tape '{0}' ?"), me.label),
|
||||||
|
};
|
||||||
|
},
|
||||||
|
|
||||||
|
title: gettext('Remove Media'),
|
||||||
|
url: `/api2/extjs/tape/media/destroy`,
|
||||||
|
|
||||||
|
layout: 'hbox',
|
||||||
|
width: 400,
|
||||||
|
method: 'GET',
|
||||||
|
isCreate: true,
|
||||||
|
submitText: gettext('Ok'),
|
||||||
|
items: [
|
||||||
|
{
|
||||||
|
xtype: 'container',
|
||||||
|
padding: 0,
|
||||||
|
layout: {
|
||||||
|
type: 'hbox',
|
||||||
|
align: 'stretch',
|
||||||
|
},
|
||||||
|
items: [
|
||||||
|
{
|
||||||
|
xtype: 'component',
|
||||||
|
cls: [Ext.baseCSSPrefix + 'message-box-icon',
|
||||||
|
Ext.baseCSSPrefix + 'message-box-warning',
|
||||||
|
Ext.baseCSSPrefix + 'dlg-icon'],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
xtype: 'container',
|
||||||
|
flex: 1,
|
||||||
|
items: [
|
||||||
|
{
|
||||||
|
xtype: 'displayfield',
|
||||||
|
cbind: {
|
||||||
|
value: '{warning}',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
xtype: 'hidden',
|
||||||
|
name: 'uuid',
|
||||||
|
cbind: {
|
||||||
|
value: '{uuid}',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
xtype: 'proxmoxcheckbox',
|
||||||
|
fieldLabel: gettext('Force'),
|
||||||
|
name: 'force',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
});
|
Loading…
Reference in New Issue
Block a user