Added a process component to visualize processes

This commit is contained in:
tsommer committed 2024-08-04 12:46:57 +02:00
1 parent 397b4e48de
commit a78a2ea1fe
3 files changed
+28 -6

No files matched your search

@@ -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>
@@ -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;
}
@@ -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>