* [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
1 sibling, 0 replies; 3+ 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] 3+ 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
1 sibling, 0 replies; 3+ 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] 3+ messages in thread