[pve-devel] [PATCH manager v2 1/2] ui: tasks: add actioncolumn to open task

Aaron Lauterer a.lauterer at proxmox.com
Mon Nov 11 16:50:42 CET 2024


Many (new) users don't realize that the task view can be used to open
the task details.
By adding a small action column we can have a button to open the task as
well, next to double clicking it.

Signed-off-by: Aaron Lauterer <a.lauterer at proxmox.com>
---
Since the record is fetched quite differently than in the regular
handler, and we don't necessarily have a selection on the right row at
this point, I opted to create the window right in the dedicated handler.

The other sensible approach would be to factor out the window opening
from `run_task_viewer` into a new function. But since that function
would just open the window I decided against it.

Not sure if we want the above explanation in the commit msg. If so, feel
free to put it there when applying the patch.

Regarding the icon: I went with the chevron-right as this is what we use
in the UI of the backup server. Alternatively the `fa-eye` might also be
fitting.

change since v1:
* use the `rec` parameter directly instead of fetching if from the grid
store

 www/manager6/dc/Tasks.js | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/www/manager6/dc/Tasks.js b/www/manager6/dc/Tasks.js
index 2001bf76..4b542762 100644
--- a/www/manager6/dc/Tasks.js
+++ b/www/manager6/dc/Tasks.js
@@ -127,6 +127,25 @@ Ext.define('PVE.dc.Tasks', {
 			return Proxmox.Utils.format_task_status(value);
 		    },
 		},
+		{
+		    xtype: 'actioncolumn',
+		    width: 30,
+		    align: 'center',
+		    tooltip: gettext('Actions'),
+		    items: [
+			{
+			    iconCls: 'fa fa-chevron-right',
+			    tooltip: gettext('Show Task'),
+			    handler: function(_grid, _rowIndex, _colIndex, _item, _e, rec) {
+				    Ext.create('Proxmox.window.TaskViewer', {
+					autoShow: true,
+					upid: rec.data.upid,
+					endtime: rec.data.endtime,
+				    });
+			    },
+			},
+		    ],
+		},
 	    ],
 	    listeners: {
 		itemdblclick: run_task_viewer,
-- 
2.39.5





More information about the pve-devel mailing list