Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RUN-2032: Percentage in number showing in progress bar instead of undefined% #8974

Merged
merged 4 commits into from
Mar 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@
>
<progress-bar
v-if="exec.status === 'scheduled'"
:value="100"
:modelValue="100"
striped
type="default"
label
Expand All @@ -302,15 +302,15 @@
></progress-bar>
<progress-bar
v-else-if="exec.status === 'queued'"
:value="100"
:modelValue="100"
striped
type="default"
label
:label-text="$t('job.execution.queued')"
></progress-bar>
<progress-bar
v-else-if="exec.job && exec.job.averageDuration"
:value="jobDurationPercentage(exec)"
:modelValue="jobDurationPercentage(exec)"
striped
active
type="info"
Expand All @@ -319,15 +319,14 @@
></progress-bar>
<progress-bar
v-else-if="exec.dateStarted.date"
:value="100"
:modelValue="100"
striped
active
type="info"
label
:label-text="$t('running')"
></progress-bar>
</td>

<td class="user text-right" style="white-space: nowrap">
<em>{{ $t("by") }}</em>
{{ exec.user }}
Expand Down Expand Up @@ -797,10 +796,14 @@ export default defineComponent({
exec.dateStarted.date
) {
const diff = moment().diff(moment(exec.dateStarted.date));
return Math.floor(100 * (diff / exec.job.averageDuration));
return Math.min(
Math.floor((diff / exec.job.averageDuration) * 100),
100,
);
}
return 0;
},

runningStartedDisplay(date: string) {
if (!date) {
return "";
Expand Down