proxmox-backup/www/tape/window/MediaRemoveWindow.js
Dominik Csapak 3657fa1ff3 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>
2024-01-12 10:26:55 +01:00

67 lines
1.2 KiB
JavaScript

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',
},
],
},
],
},
],
});