[pve-devel] [PATCH v2 proxmox-backup 6/6] ui: add remove-button for directories/mount-units

Hannes Laimer h.laimer at proxmox.com
Wed Aug 19 11:52:47 CEST 2020


Signed-off-by: Hannes Laimer <h.laimer at proxmox.com>
---
I could not find any, already existing, langstring to use here.

"Can I re-add the same one after wards?" No, since the disk contains partitions and data. It
has to be cleared before it may be re-"created" again.

 www/DirectoryList.js | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/www/DirectoryList.js b/www/DirectoryList.js
index 00531fd0..a82791db 100644
--- a/www/DirectoryList.js
+++ b/www/DirectoryList.js
@@ -21,6 +21,24 @@ Ext.define('PBS.admin.Directorylist', {
 	    }).show();
 	},
 
+	removeDir: function() {
+	    let me = this;
+	    const view = me.getView();
+	    const rec = view.getSelection()[0];
+	    const id = rec.data.id;
+		Ext.create('Proxmox.window.SafeDestroy', {
+	        url: `/nodes/localhost/disks/directory/${id}`,
+	        item: {
+	            id: id,
+			},
+	        note: gettext('Data and partitions on the disk will be left untouched.'),
+			taskName: 'dirremove',
+			listeners: {
+			    destroy: () => me.reload(),
+	        },
+	  }).show();
+	},
+
 	reload: function() {
 	    let me = this;
 	    let store = me.getView().getStore();
@@ -49,6 +67,13 @@ Ext.define('PBS.admin.Directorylist', {
 	    text: gettext('Create') + ': Directory',
 	    handler: 'createDirectory',
 	},
+	{
+	    xtype: 'proxmoxButton',
+	    text: gettext('Remove'),
+	    handler: 'removeDir',
+	    disabled: true,
+	    iconCls: 'fa fa-trash-o',
+	},
     ],
 
     columns: [
-- 
2.20.1






More information about the pve-devel mailing list