From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <pve-devel-bounces@lists.proxmox.com>
Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9])
	by lore.proxmox.com (Postfix) with ESMTPS id 40D6E1FF173
	for <inbox@lore.proxmox.com>; Mon, 11 Nov 2024 16:12:41 +0100 (CET)
Received: from firstgate.proxmox.com (localhost [127.0.0.1])
	by firstgate.proxmox.com (Proxmox) with ESMTP id 6E000EFED;
	Mon, 11 Nov 2024 16:12:38 +0100 (CET)
Message-ID: <0d5bcd66-b2fb-4c99-8701-9e940d4d331e@proxmox.com>
Date: Mon, 11 Nov 2024 16:12:34 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird Beta
To: Proxmox VE development discussion <pve-devel@lists.proxmox.com>,
 Aaron Lauterer <a.lauterer@proxmox.com>
References: <20241111144529.322168-1-a.lauterer@proxmox.com>
 <20241111144529.322168-2-a.lauterer@proxmox.com>
Content-Language: en-US
From: Dominik Csapak <d.csapak@proxmox.com>
In-Reply-To: <20241111144529.322168-2-a.lauterer@proxmox.com>
X-SPAM-LEVEL: Spam detection results:  0
 AWL 0.016 Adjusted score from AWL reputation of From: address
 BAYES_00                 -1.9 Bayes spam probability is 0 to 1%
 DMARC_MISSING             0.1 Missing DMARC policy
 KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment
 RCVD_IN_VALIDITY_CERTIFIED_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to
 Validity was blocked. See
 https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more
 information.
 RCVD_IN_VALIDITY_RPBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to
 Validity was blocked. See
 https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more
 information.
 RCVD_IN_VALIDITY_SAFE_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to
 Validity was blocked. See
 https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more
 information.
 SPF_HELO_NONE           0.001 SPF: HELO does not publish an SPF Record
 SPF_PASS               -0.001 SPF: sender matches SPF record
Subject: Re: [pve-devel] [PATCH manager 1/2] ui: tasks: add actioncolumn to
 open task
X-BeenThere: pve-devel@lists.proxmox.com
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Proxmox VE development discussion <pve-devel.lists.proxmox.com>
List-Unsubscribe: <https://lists.proxmox.com/cgi-bin/mailman/options/pve-devel>, 
 <mailto:pve-devel-request@lists.proxmox.com?subject=unsubscribe>
List-Archive: <http://lists.proxmox.com/pipermail/pve-devel/>
List-Post: <mailto:pve-devel@lists.proxmox.com>
List-Help: <mailto:pve-devel-request@lists.proxmox.com?subject=help>
List-Subscribe: <https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel>, 
 <mailto:pve-devel-request@lists.proxmox.com?subject=subscribe>
Reply-To: Proxmox VE development discussion <pve-devel@lists.proxmox.com>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Errors-To: pve-devel-bounces@lists.proxmox.com
Sender: "pve-devel" <pve-devel-bounces@lists.proxmox.com>

one comment inline:

On 11/11/24 15:45, Aaron Lauterer wrote:
> 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@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.
> 
>   www/manager6/dc/Tasks.js | 20 ++++++++++++++++++++
>   1 file changed, 20 insertions(+)
> 
> diff --git a/www/manager6/dc/Tasks.js b/www/manager6/dc/Tasks.js
> index 2001bf76..43d0dace 100644
> --- a/www/manager6/dc/Tasks.js
> +++ b/www/manager6/dc/Tasks.js
> @@ -127,6 +127,26 @@ 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) {
> +				    let rec = grid.getStore().getAt(rowIndex);
> +				    Ext.create('Proxmox.window.TaskViewer', {
> +					autoShow: true,
> +					upid: rec.data.upid,
> +					endtime: rec.data.endtime,
> +				    });

we should probably use the record that is given as (6th) parameter
(see https://docs.sencha.com/extjs/7.0.0/classic/Ext.grid.column.Action.html#cfg-handler)

since i'm not sure if filtering/sorting messes with the rowIndex vs store index,
also it's one line less code

> +			    },
> +			},
> +		    ],
> +		},
>   	    ],
>   	    listeners: {
>   		itemdblclick: run_task_viewer,



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel