tape: implement format/erase
This commit is contained in:
		@ -374,7 +374,7 @@ Ext.define('PBS.Utils', {
 | 
			
		||||
	    dircreate: [gettext('Directory Storage'), gettext('Create')],
 | 
			
		||||
	    dirremove: [gettext('Directory'), gettext('Remove')],
 | 
			
		||||
	    'eject-media': [gettext('Drive'), gettext('Eject Media')],
 | 
			
		||||
	    'erase-media': [gettext('Drive'), gettext('Erase Media')],
 | 
			
		||||
	    "format-media": [gettext('Drive'), gettext('Format media')],
 | 
			
		||||
	    garbage_collection: ['Datastore', gettext('Garbage Collect')],
 | 
			
		||||
	    'inventory-update': [gettext('Drive'), gettext('Inventory Update')],
 | 
			
		||||
	    'label-media': [gettext('Drive'), gettext('Label Media')],
 | 
			
		||||
 | 
			
		||||
@ -84,11 +84,11 @@ Ext.define('PBS.TapeManagement.DriveStatus', {
 | 
			
		||||
	    }).show();
 | 
			
		||||
	},
 | 
			
		||||
 | 
			
		||||
	erase: function() {
 | 
			
		||||
	format: function() {
 | 
			
		||||
	    let me = this;
 | 
			
		||||
	    let view = me.getView();
 | 
			
		||||
	    let driveid = view.drive;
 | 
			
		||||
	    PBS.Utils.driveCommand(driveid, 'erase-media', {
 | 
			
		||||
	    PBS.Utils.driveCommand(driveid, 'format-media', {
 | 
			
		||||
		waitMsgTarget: view,
 | 
			
		||||
		method: 'POST',
 | 
			
		||||
		success: function(response) {
 | 
			
		||||
@ -212,9 +212,9 @@ Ext.define('PBS.TapeManagement.DriveStatus', {
 | 
			
		||||
	    },
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
	    text: gettext('Erase'),
 | 
			
		||||
	    text: gettext('Format'),
 | 
			
		||||
	    xtype: 'proxmoxButton',
 | 
			
		||||
	    handler: 'erase',
 | 
			
		||||
	    handler: 'format',
 | 
			
		||||
	    iconCls: 'fa fa-trash-o',
 | 
			
		||||
	    dangerous: true,
 | 
			
		||||
	    confirmMsg: gettext('Are you sure you want to erase the inserted tape?'),
 | 
			
		||||
 | 
			
		||||
@ -11,13 +11,13 @@ Ext.define('PBS.TapeManagement.EraseWindow', {
 | 
			
		||||
	return {};
 | 
			
		||||
    },
 | 
			
		||||
 | 
			
		||||
    title: gettext('Erase'),
 | 
			
		||||
    title: gettext('Format/Erase'),
 | 
			
		||||
    url: `/api2/extjs/tape/drive`,
 | 
			
		||||
    showProgress: true,
 | 
			
		||||
    submitUrl: function(url, values) {
 | 
			
		||||
	let drive = values.drive;
 | 
			
		||||
	delete values.drive;
 | 
			
		||||
	return `${url}/${drive}/erase-media`;
 | 
			
		||||
	return `${url}/${drive}/format-media`;
 | 
			
		||||
    },
 | 
			
		||||
 | 
			
		||||
    method: 'POST',
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user