Added a process component to visualize processes

This commit is contained in:
Thorsten Sommer 2024-08-04 12:46:57 +02:00
parent 397b4e48de
commit a78a2ea1fe
Signed by: tsommer
GPG Key ID: 371BBA77A02C0108
3 changed files with 28 additions and 6 deletions

View File

@ -0,0 +1,11 @@
@typeparam T
@if (this.ShowProgressAnimation)
{
<div class="pa-1">
<MudProgressLinear Color="Color.Primary" Indeterminate="true"/>
</div>
}
<div class="pa-6">
<MudSlider T="int" Disabled="@true" Value="@this.StepValue" Min="@this.process.Min" Max="@this.process.Max" TickMarks="@true" Size="Size.Large" Variant="Variant.Filled" TickMarkLabels="@this.process.Labels" Class="mb-12"/>
</div>

View File

@ -0,0 +1,16 @@
using AIStudio.Tools;
using Microsoft.AspNetCore.Components;
namespace AIStudio.Components.Blocks;
public partial class ProcessComponent<T> : ComponentBase where T : struct, Enum
{
[Parameter]
public bool ShowProgressAnimation { get; set; }
[Parameter]
public ProcessStepValue StepValue { get; set; }
private readonly Process<T> process = Process<T>.INSTANCE;
}

View File

@ -11,12 +11,7 @@
</MudStack> </MudStack>
@if (this.AgentIsRunning) @if (this.AgentIsRunning)
{ {
<div class="pa-1"> <ProcessComponent T="ReadWebContentSteps" StepValue="@this.processStep" ShowProgressAnimation="@true"/>
<MudProgressLinear Color="Color.Primary" Indeterminate="true" Class=""/>
</div>
<div class="pa-6">
<MudSlider T="int" Disabled="@true" Value="@this.processStep" Min="@this.process.Min" Max="@this.process.Max" TickMarks="@true" Size="Size.Large" Variant="Variant.Filled" TickMarkLabels="@this.process.Labels" Class="mb-12"/>
</div>
} }
} }
</MudPaper> </MudPaper>