43 lines
1.9 KiB
Plaintext
43 lines
1.9 KiB
Plaintext
@page "/Services"
|
|
@using Manager.App.Services.System
|
|
@using Manager.App.Components.Application.System
|
|
@implements IDisposable
|
|
|
|
@inject BackgroundServiceRegistry ServiceRegistry
|
|
|
|
<title>Services</title>
|
|
|
|
<MudDataGrid T="ExtendedBackgroundService" Items="@_backgroundServices" Filterable QuickFilter="@QuickFilter">
|
|
<ToolBarContent>
|
|
<MudText Typo="Typo.h6">Services</MudText>
|
|
<MudSpacer/>
|
|
<MudTextField T="string" @bind-Value="@_searchText" Immediate
|
|
Placeholder="Search" Adornment="Adornment.Start"
|
|
AdornmentIcon="@Icons.Material.Filled.Search" IconSize="Size.Medium"/>
|
|
</ToolBarContent>
|
|
<Columns>
|
|
<PropertyColumn Property="x => x.Name" Title="Service"/>
|
|
<PropertyColumn Property="x => x.Description" Title="Description"/>
|
|
<PropertyColumn Property="x => x.State" Title="Status"/>
|
|
<PropertyColumn Property="x => x.ExecuteInterval" Title="Execute interval"/>
|
|
<TemplateColumn>
|
|
<CellTemplate>
|
|
<MudStack Row Spacing="2">
|
|
<MudButton Disabled="@(context.Item?.State == ServiceState.Paused)"
|
|
OnClick="@(() => { context.Item?.Pause(); })" Variant="Variant.Outlined">Pause
|
|
</MudButton>
|
|
<MudButton Disabled="@(context.Item?.State == ServiceState.Running)"
|
|
OnClick="@(() => { context.Item?.Resume(); })" Variant="Variant.Outlined">Resume
|
|
</MudButton>
|
|
</MudStack>
|
|
</CellTemplate>
|
|
</TemplateColumn>
|
|
</Columns>
|
|
<PagerContent>
|
|
<MudDataGridPager T="ExtendedBackgroundService"/>
|
|
</PagerContent>
|
|
</MudDataGrid>
|
|
|
|
<EventConsole AsyncEnumerable="@GetEventAsyncEnumerable()" InitialEvents="@GetInitialEvents()"
|
|
Elevation="0" Class="mt-3" Style="flex: 1; display: flex; flex-direction: column; min-height: 0;"/>
|