public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [PATCH proxmox-backup 0/2] additional task endtime fixes
@ 2026-04-30 12:10 Christian Ebner
  2026-04-30 12:10 ` [PATCH proxmox-backup 1/2] api: node: return optional endtime in tasks status Christian Ebner
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Christian Ebner @ 2026-04-30 12:10 UTC (permalink / raw)
  To: pbs-devel

Extends the recent fixes [0] for correctly showing the task log end
time by other ocurences, as reported in the community forum [1].

Since the endtime is not accessible in all contexts where the task
viewer is instantiated, also extend the API endpoint returning the
task log status by the endtime, as parsed via the TaskState.

[0] https://lore.proxmox.com/all/20260427120543.2692503-1-d.csapak@proxmox.com/
[1] https://forum.proxmox.com/threads/183157/

Christian Ebner (2):
  api: node: return optional endtime in tasks status
  ui: GC/prune: pass tasks last run endtime to task viewer

 src/api2/node/tasks.rs   |  6 ++++++
 www/config/GCView.js     |  9 ++++++---
 www/config/PruneView.js  |  3 +++
 www/datastore/Content.js | 14 +++++++++++---
 www/tape/BackupJobs.js   |  3 +++
 5 files changed, 29 insertions(+), 6 deletions(-)

-- 
2.47.3





^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH proxmox-backup 1/2] api: node: return optional endtime in tasks status
  2026-04-30 12:10 [PATCH proxmox-backup 0/2] additional task endtime fixes Christian Ebner
@ 2026-04-30 12:10 ` Christian Ebner
  2026-04-30 12:10 ` [PATCH proxmox-backup 2/2] ui: GC/prune: pass tasks last run endtime to task viewer Christian Ebner
  2026-05-04 15:45 ` superseded: [PATCH proxmox-backup 0/2] additional task endtime fixes Christian Ebner
  2 siblings, 0 replies; 8+ messages in thread
From: Christian Ebner @ 2026-04-30 12:10 UTC (permalink / raw)
  To: pbs-devel

With the intention to correctly show the task end time without
relying on further API calls or workarounds to gather it.

Whenever the task is considered finished, return the endtime
according to the parsed TaskState.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
---
 src/api2/node/tasks.rs | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/api2/node/tasks.rs b/src/api2/node/tasks.rs
index fe619a08e..838f874d0 100644
--- a/src/api2/node/tasks.rs
+++ b/src/api2/node/tasks.rs
@@ -255,6 +255,11 @@ fn into_task_list_item(info: proxmox_rest_server::TaskListInfo) -> pbs_api_types
                 optional: true,
                 description: "'OK', 'Error: <msg>', or 'unknown'.",
             },
+            endtime: {
+                type: i64,
+                description: "The task end time (Epoch)",
+                optional: true,
+            },
         },
     },
     access: {
@@ -292,6 +297,7 @@ async fn get_task_status(param: Value, rpcenv: &mut dyn RpcEnvironment) -> Resul
         let exitstatus = upid_read_status(&upid).unwrap_or(TaskState::Unknown { endtime: 0 });
         result["status"] = Value::from("stopped");
         result["exitstatus"] = Value::from(exitstatus.to_string());
+        result["endtime"] = Value::from(exitstatus.endtime());
     };
 
     Ok(result)
-- 
2.47.3





^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH proxmox-backup 2/2] ui: GC/prune: pass tasks last run endtime to task viewer
  2026-04-30 12:10 [PATCH proxmox-backup 0/2] additional task endtime fixes Christian Ebner
  2026-04-30 12:10 ` [PATCH proxmox-backup 1/2] api: node: return optional endtime in tasks status Christian Ebner
@ 2026-04-30 12:10 ` Christian Ebner
  2026-05-04  6:34   ` Dominik Csapak
  2026-05-04  8:02   ` Thomas Lamprecht
  2026-05-04 15:45 ` superseded: [PATCH proxmox-backup 0/2] additional task endtime fixes Christian Ebner
  2 siblings, 2 replies; 8+ messages in thread
From: Christian Ebner @ 2026-04-30 12:10 UTC (permalink / raw)
  To: pbs-devel

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 <c.ebner@proxmox.com>
---
 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();
+                            },
                         });
                     }
                 },
diff --git a/www/tape/BackupJobs.js b/www/tape/BackupJobs.js
index 68d808af5..eb3fff82b 100644
--- a/www/tape/BackupJobs.js
+++ b/www/tape/BackupJobs.js
@@ -92,8 +92,11 @@ Ext.define('PBS.config.TapeBackupJobView', {
                 return;
             }
 
+            let endtime = selection[0].data['last-run-endtime'];
+
             Ext.create('Proxmox.window.TaskViewer', {
                 upid,
+                endtime,
             }).show();
         },
 
-- 
2.47.3





^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH proxmox-backup 2/2] ui: GC/prune: pass tasks last run endtime to task viewer
  2026-04-30 12:10 ` [PATCH proxmox-backup 2/2] ui: GC/prune: pass tasks last run endtime to task viewer Christian Ebner
@ 2026-05-04  6:34   ` Dominik Csapak
  2026-05-04  7:04     ` Christian Ebner
  2026-05-04  8:02   ` Thomas Lamprecht
  1 sibling, 1 reply; 8+ messages in thread
From: Dominik Csapak @ 2026-05-04  6:34 UTC (permalink / raw)
  To: Christian Ebner, pbs-devel

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 <c.ebner@proxmox.com>
> ---
>   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.


>                       }
>                   },
> diff --git a/www/tape/BackupJobs.js b/www/tape/BackupJobs.js
> index 68d808af5..eb3fff82b 100644
> --- a/www/tape/BackupJobs.js
> +++ b/www/tape/BackupJobs.js
> @@ -92,8 +92,11 @@ Ext.define('PBS.config.TapeBackupJobView', {
>                   return;
>               }
>   
> +            let endtime = selection[0].data['last-run-endtime'];
> +
>               Ext.create('Proxmox.window.TaskViewer', {
>                   upid,
> +                endtime,
>               }).show();
>           },
>   





^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH proxmox-backup 2/2] ui: GC/prune: pass tasks last run endtime to task viewer
  2026-05-04  6:34   ` Dominik Csapak
@ 2026-05-04  7:04     ` Christian Ebner
  0 siblings, 0 replies; 8+ messages in thread
From: Christian Ebner @ 2026-05-04  7:04 UTC (permalink / raw)
  To: Dominik Csapak, pbs-devel

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 <c.ebner@proxmox.com>
>> ---
>>   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!




^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH proxmox-backup 2/2] ui: GC/prune: pass tasks last run endtime to task viewer
  2026-04-30 12:10 ` [PATCH proxmox-backup 2/2] ui: GC/prune: pass tasks last run endtime to task viewer Christian Ebner
  2026-05-04  6:34   ` Dominik Csapak
@ 2026-05-04  8:02   ` Thomas Lamprecht
  2026-05-04  8:11     ` Christian Ebner
  1 sibling, 1 reply; 8+ messages in thread
From: Thomas Lamprecht @ 2026-05-04  8:02 UTC (permalink / raw)
  To: Christian Ebner, pbs-devel

Am 30.04.26 um 14:09 schrieb Christian Ebner:
> 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 <c.ebner@proxmox.com>

AFAICT this can be handled in widget-toolkit without extra (blocking)
calls here on api task open, as it shouldn't hurt I pushed out already
a proposed change here:

https://git.proxmox.com/?p=proxmox-widget-toolkit.git;a=commitdiff;h=7431c0766f0439481ae17ef54f49ee8edc210069






^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH proxmox-backup 2/2] ui: GC/prune: pass tasks last run endtime to task viewer
  2026-05-04  8:02   ` Thomas Lamprecht
@ 2026-05-04  8:11     ` Christian Ebner
  0 siblings, 0 replies; 8+ messages in thread
From: Christian Ebner @ 2026-05-04  8:11 UTC (permalink / raw)
  To: Thomas Lamprecht, pbs-devel

On 5/4/26 10:01 AM, Thomas Lamprecht wrote:
> Am 30.04.26 um 14:09 schrieb Christian Ebner:
>> 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 <c.ebner@proxmox.com>
> 
> AFAICT this can be handled in widget-toolkit without extra (blocking)
> calls here on api task open, as it shouldn't hurt I pushed out already
> a proposed change here:
> 
> https://git.proxmox.com/?p=proxmox-widget-toolkit.git;a=commitdiff;h=7431c0766f0439481ae17ef54f49ee8edc210069

Nice, thanks for the heads up! Will double check the behavior after 
these changes.




^ permalink raw reply	[flat|nested] 8+ messages in thread

* superseded: [PATCH proxmox-backup 0/2] additional task endtime fixes
  2026-04-30 12:10 [PATCH proxmox-backup 0/2] additional task endtime fixes Christian Ebner
  2026-04-30 12:10 ` [PATCH proxmox-backup 1/2] api: node: return optional endtime in tasks status Christian Ebner
  2026-04-30 12:10 ` [PATCH proxmox-backup 2/2] ui: GC/prune: pass tasks last run endtime to task viewer Christian Ebner
@ 2026-05-04 15:45 ` Christian Ebner
  2 siblings, 0 replies; 8+ messages in thread
From: Christian Ebner @ 2026-05-04 15:45 UTC (permalink / raw)
  To: pbs-devel

superseded-by version 2:
https://lore.proxmox.com/pbs-devel/20260504154346.901478-1-c.ebner@proxmox.com/T/




^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2026-05-04 15:45 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-30 12:10 [PATCH proxmox-backup 0/2] additional task endtime fixes Christian Ebner
2026-04-30 12:10 ` [PATCH proxmox-backup 1/2] api: node: return optional endtime in tasks status Christian Ebner
2026-04-30 12:10 ` [PATCH proxmox-backup 2/2] ui: GC/prune: pass tasks last run endtime to task viewer Christian Ebner
2026-05-04  6:34   ` Dominik Csapak
2026-05-04  7:04     ` Christian Ebner
2026-05-04  8:02   ` Thomas Lamprecht
2026-05-04  8:11     ` Christian Ebner
2026-05-04 15:45 ` superseded: [PATCH proxmox-backup 0/2] additional task endtime fixes Christian Ebner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal