[pve-devel] [PATCH v3 proxmox-backup 9/9] ui: add remove-button for directories/mount-units
Hannes Laimer
h.laimer at proxmox.com
Fri Aug 28 10:46:58 CEST 2020
Signed-off-by: Hannes Laimer <h.laimer at proxmox.com>
---
add remove button to ui, all previous patches are needed for this one
www/DirectoryList.js | 25 +++++++++++++++++++++++++
1 file changed, 25 insertions(+)
diff --git a/www/DirectoryList.js b/www/DirectoryList.js
index 00531fd0..51b30c78 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: 'removeDir',
+ disabled: true,
+ iconCls: 'fa fa-trash-o',
+ },
],
columns: [
--
2.20.1
More information about the pve-devel
mailing list