[pve-devel] [PATCH proxmox-backup 5/5] ui: added possiblity to remove directories/mount-units in the WebUI

Hannes Laimer h.laimer at proxmox.com
Tue Aug 18 10:40:23 CEST 2020


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

diff --git a/www/DirectoryList.js b/www/DirectoryList.js
index 00531fd0..b4313e49 100644
--- a/www/DirectoryList.js
+++ b/www/DirectoryList.js
@@ -20,6 +20,21 @@ Ext.define('PBS.admin.Directorylist', {
 		},
 	    }).show();
 	},
+    removeDir: function () {
+        let me = this;
+        let view = me.getView();
+        let rec = view.getSelection();
+        Ext.create('Proxmox.window.SafeRemove', {
+            url: `/nodes/localhost/disks/directory/${rec[0].data.id}`,
+            item: {type: 'Dir', id: rec[0].data.id},
+            note: gettext('Data and partitions on the disk will be left untouched.'),
+            listeners: {
+                destroy: function () {
+                    me.reload();
+                },
+            },
+        }).show();
+    },
 
 	reload: function() {
 	    let me = this;
@@ -49,6 +64,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