[pbs-devel] [PATCH proxmox-widget-toolkit 3/5] ui: added possibility to show a small note in SafeRemove dialog

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


Signed-off-by: Hannes Laimer <h.laimer at proxmox.com>
---
 src/window/SafeRemove.js | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/src/window/SafeRemove.js b/src/window/SafeRemove.js
index c541272..c3fc7dd 100644
--- a/src/window/SafeRemove.js
+++ b/src/window/SafeRemove.js
@@ -21,6 +21,7 @@ Ext.define('Proxmox.window.SafeRemove', {
             type: undefined
         },
         url: undefined,
+        note: undefined,
         params: {}
     },
 
@@ -137,6 +138,22 @@ Ext.define('Proxmox.window.SafeRemove', {
                         'data-qtip': gettext('Wipe disk after the removal of mountpoint')
                     }
                 },
+                {
+                    xtype: 'container',
+                    reference: 'noteContainer',
+                    flex: 1,
+                    layout: {
+                        type: 'vbox',
+                        align: 'middle'
+                    },
+                    height: 25,
+                    items: [
+                        {
+                            xtype: 'component',
+                            reference: 'noteCmp'
+                        },
+                    ]
+                },
             ]
         }
     ],
@@ -163,8 +180,17 @@ Ext.define('Proxmox.window.SafeRemove', {
         }
 
         const messageCmp = me.lookupReference('messageCmp');
+        const noteCmp = me.lookupReference('noteCmp');
         let msg;
 
+        if (me.getNote() !== undefined) {
+            noteCmp.setHtml(`<small>${me.getNote()}</small>`);
+        } else {
+            const noteContainer = me.lookupReference('noteContainer');
+            noteContainer.setDisabled(true);
+            noteContainer.setHidden(true);
+        }
+
         if (item.type === 'VM') {
             msg = Proxmox.Utils.format_task_description('qmdestroy', item.id);
         } else if (item.type === 'CT') {
@@ -173,6 +199,8 @@ Ext.define('Proxmox.window.SafeRemove', {
             msg = Proxmox.Utils.format_task_description('cephdestroypool', item.id);
         } else if (item.type === 'Image') {
             msg = Proxmox.Utils.format_task_description('unknownimgdel', item.id);
+        } else if (item.type === 'Dir') {
+            msg = `${gettext('Directory')} ${item.id} - ${gettext('Remove')}`
         } else {
             throw "unknown item type specified";
         }
-- 
2.20.1






More information about the pbs-devel mailing list