From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id 20D921FF136 for ; Mon, 04 May 2026 09:04:55 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 1EC49142A6; Mon, 4 May 2026 09:04:54 +0200 (CEST) Message-ID: <20e6e6c7-c4fe-4b72-aa90-1f201941579c@proxmox.com> Date: Mon, 4 May 2026 09:04:47 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH proxmox-backup 2/2] ui: GC/prune: pass tasks last run endtime to task viewer To: Dominik Csapak , pbs-devel@lists.proxmox.com References: <20260430121015.528664-1-c.ebner@proxmox.com> <20260430121015.528664-3-c.ebner@proxmox.com> <60072553-b386-441b-9c0a-7c301b9ccfbb@proxmox.com> Content-Language: en-US, de-DE From: Christian Ebner In-Reply-To: <60072553-b386-441b-9c0a-7c301b9ccfbb@proxmox.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1777878183626 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.070 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 SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: 2TOY62QADPS2V7NBPZHJVZ6BEQR77BNB X-Message-ID-Hash: 2TOY62QADPS2V7NBPZHJVZ6BEQR77BNB X-MailFrom: c.ebner@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox Backup Server development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On 5/4/26 8:33 AM, Dominik Csapak wrote: > passing the endtime from the grids look good to me, but > one comment inline > > On 4/30/26 2:09 PM, Christian Ebner wrote: >> Same issue as tackled by commit e8552dae3 ("ui: sync/verify view: >> show correct duration in task log window"), pass the last run >> endtime to the task log window for correct calculation of the >> job duration for finished jobs, not using the current time. >> >> For correctly showing the verification task status in datastore >> contents, an additional API request is required first to get the >> endtime. Other call sites arelady have the required information. >> >> Fixes: https://forum.proxmox.com/threads/183157/ >> Signed-off-by: Christian Ebner >> --- >>   www/config/GCView.js     |  9 ++++++--- >>   www/config/PruneView.js  |  3 +++ >>   www/datastore/Content.js | 14 +++++++++++--- >>   www/tape/BackupJobs.js   |  3 +++ >>   4 files changed, 23 insertions(+), 6 deletions(-) >> >> diff --git a/www/config/GCView.js b/www/config/GCView.js >> index 9fcc22344..5f4e625fa 100644 >> --- a/www/config/GCView.js >> +++ b/www/config/GCView.js >> @@ -98,12 +98,15 @@ Ext.define('PBS.config.GCJobView', { >>           showTaskLog: function () { >>               let _me = this; >> -            let upid = this.getData().upid; >> -            if (!upid) { >> +            let data = this.getData(); >> +            if (!data.upid) { >>                   return; >>               } >> -            Ext.create('Proxmox.window.TaskViewer', { upid }).show(); >> +            Ext.create('Proxmox.window.TaskViewer', { >> +                upid: data.upid, >> +                endtime: data['last-run-endtime'], >> +            }).show(); >>           }, >>           startStore: function () { >> diff --git a/www/config/PruneView.js b/www/config/PruneView.js >> index f38724687..431a1ddcf 100644 >> --- a/www/config/PruneView.js >> +++ b/www/config/PruneView.js >> @@ -99,9 +99,12 @@ Ext.define('PBS.config.PruneJobView', { >>                   return; >>               } >> +            let endtime = selection[0].data['last-run-endtime']; >> + >>               Ext.create('Proxmox.window.TaskViewer', { >>                   autoShow: true, >>                   upid, >> +                endtime, >>               }); >>           }, >> diff --git a/www/datastore/Content.js b/www/datastore/Content.js >> index 1ec07505d..0d968b52e 100644 >> --- a/www/datastore/Content.js >> +++ b/www/datastore/Content.js >> @@ -1399,9 +1399,17 @@ Ext.define('PBS.DataStoreContent', { >>                   dblclick: function (view, el, row, col, ev, rec) { >>                       let verify = rec?.data?.verification; >>                       if (verify?.upid && rec.parentNode?.id !== >> 'root') { >> -                        Ext.create('Proxmox.window.TaskViewer', { >> -                            autoShow: true, >> -                            upid: verify.upid, >> +                        Proxmox.Utils.API2Request({ >> +                            url: `/nodes/localhost/tasks/ >> ${encodeURIComponent(verify.upid)}/status`, >> +                            failure: function (response) { >> +                                Ext.Msg.alert(gettext('Error'), >> response.htmlStatus); >> +                            }, >> +                            success: function (response, options) { >> + >> Ext.create('Proxmox.window.TaskViewer', { >> +                                    upid: response.result.data.upid, >> +                                    endtime: >> response.result.data.endtime, >> +                                }).show(); >> +                            }, >>                           }); > > instead of doing an extra api call here, I'd favor using the endtime > from the status api call directly in the taskviewer in proxmox-widget- > toolkit. That window does poll the status anyway. True, that is even better: It could fallback to getting the endtime from the response there if not explicitly given at creation time. Will incorporate that into a version 2 of the patches, thanks for review!