[pve-devel] [PATCH v4 proxmox-widget-toolkit 5/10] safe-destroy: add possibility to show a small note

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


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

diff --git a/src/window/SafeDestroy.js b/src/window/SafeDestroy.js
index 39706b9..87f81b7 100644
--- a/src/window/SafeDestroy.js
+++ b/src/window/SafeDestroy.js
@@ -21,6 +21,7 @@ Ext.define('Proxmox.window.SafeDestroy', {
 	    purgeable: false,
 	},
 	url: undefined,
+	note: undefined,
 	taskName: undefined,
 	params: {},
     },
@@ -138,6 +139,25 @@ Ext.define('Proxmox.window.SafeDestroy', {
 			'data-qtip': gettext('Remove from replication and backup jobs'),
 		    },
 		},
+		{
+		    xtype: 'container',
+		    reference: 'noteContainer',
+		    flex: 1,
+		    hidden: true,
+		    layout: {
+			type: 'vbox',
+			align: 'middle',
+		    },
+		    height: 25,
+		    items: [
+			{
+			    xtype: 'component',
+			    reference: 'noteCmp',
+			    width: '300px',
+			    style: 'font-size: smaller; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;',
+			},
+		    ],
+		},
 	    ],
 	},
     ],
@@ -161,8 +181,16 @@ Ext.define('Proxmox.window.SafeDestroy', {
 	}
 
 	const messageCmp = me.lookupReference('messageCmp');
+	const noteCmp = me.lookupReference('noteCmp');
 	let msg;
 
+	if (Ext.isDefined(me.getNote())) {
+	    noteCmp.setHtml(`<span title="${me.getNote()}">${me.getNote()}</span>`);
+	    const noteContainer = me.lookupReference('noteContainer');
+	    noteContainer.setHidden(false);
+	    noteContainer.setDisabled(false);
+	}
+
 	if (Ext.isDefined(me.getTaskName())) {
 	    msg = Proxmox.Utils.format_task_description(me.getTaskName(), item.id);
 	    messageCmp.setHtml(msg);
-- 
2.20.1





More information about the pve-devel mailing list