32 lines
893 B
Plaintext
32 lines
893 B
Plaintext
@using ECM.JobRunner.Common.JobRunnerReference;
|
|
|
|
<div class="progress" style="height: 30px;">
|
|
<div class="progress-bar"
|
|
role="progressbar"
|
|
style="width: @getCompletedPercent(jobStatus)%"
|
|
aria-label="Job Status in %"
|
|
aria-valuenow="@getCompletedPercent(jobStatus)"
|
|
aria-valuemin="0"
|
|
aria-valuemax="100"
|
|
>@jobStatus.ProgressCurrent/@jobStatus.ProgressTotal</div>
|
|
</div>
|
|
|
|
@code {
|
|
[Parameter]
|
|
public StatusItem? jobStatus { get; set; }
|
|
|
|
protected int getCompletedPercent(StatusItem? entry)
|
|
{
|
|
if (entry != null && entry.ProgressCurrent > 0 && entry.ProgressTotal > 0)
|
|
{
|
|
float fraction = (float)entry.ProgressCurrent / entry.ProgressTotal;
|
|
float percent = fraction * 100;
|
|
return (int)percent;
|
|
}
|
|
else
|
|
{
|
|
return 0;
|
|
}
|
|
}
|
|
}
|