[pbs-devel] [PATCH v4 proxmox-backup 10/10] ui: add remove-button for directories/mount-units

Hannes Laimer h.laimer at proxmox.com
Tue Sep 15 11:54:20 CEST 2020


Signed-off-by: Hannes Laimer <h.laimer at proxmox.com>
---
 www/DirectoryList.js | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/www/DirectoryList.js b/www/DirectoryList.js
index 00531fd0..e605a685 100644
--- a/www/DirectoryList.js
+++ b/www/DirectoryList.js
@@ -21,6 +21,24 @@ Ext.define('PBS.admin.Directorylist', {
 	    }).show();
 	},
 
+	removeDirectory: 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: 'removeDirectory',
+	    disabled: true,
+	    iconCls: 'fa fa-trash-o',
+	},
     ],
 
     columns: [
-- 
2.20.1






More information about the pbs-devel mailing list