Fix time and storage when workflow is running

Signed-off-by: Sanjula Ganepola <sanjulagane@gmail.com>
This commit is contained in:
Sanjula Ganepola
2024-10-17 22:53:07 -04:00
parent 9bd8a8af0c
commit 9c1fb63f62
2 changed files with 35 additions and 19 deletions

View File

@@ -11,9 +11,9 @@ export default class HistoryTreeItem extends TreeItem implements GithubLocalActi
this.history = history;
let totalDuration: string | undefined;
if (history.start) {
const start = new Date(history.start).getTime();
const end = history.end ? new Date(history.end).getTime() : new Date().getTime();
if (history.date) {
const start = new Date(history.date.start).getTime();
const end = new Date(history.date.end).getTime();
totalDuration = `${((end - start) / 1000).toFixed(0).toString()}s`;
this.description = totalDuration;
}
@@ -35,8 +35,8 @@ export default class HistoryTreeItem extends TreeItem implements GithubLocalActi
}
this.tooltip = `Name: ${history.name}\n` +
`Status: ${history.status}\n` +
`Started: ${history.start ? history.start : 'N/A'}\n` +
`Ended: ${history.end ? history.end : 'N/A'}\n` +
`Started: ${history.date ? history.date.start : 'N/A'}\n` +
`Ended: ${history.date ? history.date.end : 'N/A'}\n` +
(totalDuration ? `Total Duration: ${totalDuration}\n` : ``);
}