07-12-2022

This commit is contained in:
Jonathan Jenne
2022-12-07 16:45:31 +01:00
parent 248be23804
commit 7b7147eeee
28 changed files with 781 additions and 385 deletions

View File

@@ -49,7 +49,8 @@ else
</div>
<div class="btn-group mt-3" role="group" aria-label="Basic example">
<a class="btn btn-secondary" href="jobs/@job.Id">
<a class="btn btn-secondary" href="@GetBackUrl()">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-arrow-left" viewBox="0 0 16 16">
<path fill-rule="evenodd" d="M15 8a.5.5 0 0 0-.5-.5H2.707l3.147-3.146a.5.5 0 1 0-.708-.708l-4 4a.5.5 0 0 0 0 .708l4 4a.5.5 0 0 0 .708-.708L2.707 8.5H14.5A.5.5 0 0 0 15 8z" />
</svg> Back
@@ -73,6 +74,11 @@ else
private JobDefinition? job = new();
private List<JobType>? types;
protected string GetBackUrl()
{
return JobId == Constants.ENTITY_ID_NEW ? "jobs" : $"jobs/{JobId}";
}
protected override async Task OnInitializedAsync()
{
types = await Jobs.GetJobTypes();

View File

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