Skip to content

Commit

Permalink
improved presenting duration of job steps
Browse files Browse the repository at this point in the history
  • Loading branch information
godfryd committed Nov 19, 2023
1 parent b5ab81b commit 453b058
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 5 additions & 1 deletion server/kraken/server/models.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2020-2022 The Kraken Authors
# Copyright 2020-2023 The Kraken Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -13,6 +13,7 @@
# limitations under the License.

import logging
import datetime

from flask_sqlalchemy import SQLAlchemy
from sqlalchemy import Column, Boolean, DateTime, ForeignKey, Integer, Unicode, UnicodeText, String
Expand Down Expand Up @@ -569,6 +570,9 @@ class Step(db.Model, DatesMixin):
# services

def get_json(self, with_fields=True, mask_secrets=False):
if self.result and 'duration' in self.result:
d = datetime.timedelta(seconds=self.result['duration'])
self.result['duration'] = duration_to_txt(d)
data = dict(id=self.id,
index=self.index,
tool=self.tool.name,
Expand Down
4 changes: 2 additions & 2 deletions ui/src/app/logs-panel/logs-panel.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
<span class="text-600">Status:</span> {{ getStepStatus(step) }}
</span>
<ng-container *ngIf="step.result">
<span *ngIf="step.result.duration >= 0" class="mr-4">
<span class="text-600">Duration:</span> {{ step.result.duration }}s
<span *ngIf="step.result.duration" class="mr-4">
<span class="text-600">Duration:</span> {{ step.result.duration }}
</span>
<ng-container *ngIf="step.result['reason']">
<span class="mr-4">
Expand Down

0 comments on commit 453b058

Please sign in to comment.