mirror of
https://github.com/NecroticBamboo/DeepTrace.git
synced 2025-12-21 11:21:51 +00:00
DEEP-14 Minor UI changes
This commit is contained in:
parent
18d8f969e4
commit
b494f80ee9
2
.gitignore
vendored
2
.gitignore
vendored
@ -364,3 +364,5 @@ FodyWeavers.xsd
|
||||
|
||||
TrainData
|
||||
prometheus-2.45.0-rc.0.windows-amd64
|
||||
mongodb-windows-x86_64-6.0.6
|
||||
*.patch
|
||||
|
||||
@ -12,6 +12,7 @@ public class DataSourceQuery
|
||||
public string Query { get; set; }
|
||||
public string Color { get; set; }
|
||||
|
||||
public override string ToString() => Query;
|
||||
}
|
||||
|
||||
public class DataSourceDefinition
|
||||
@ -26,4 +27,6 @@ public class DataSourceDefinition
|
||||
public string Name { get; set; }
|
||||
public List<DataSourceQuery> Queries { get; set; } = new();
|
||||
public string Description { get; set; } = string.Empty;
|
||||
|
||||
public override string ToString() => Name;
|
||||
}
|
||||
|
||||
@ -30,7 +30,7 @@
|
||||
|
||||
<MudCard Class="mb-3">
|
||||
<MudCardActions>
|
||||
<MudSelect T="DataSourceStorage" Label="Query name" AnchorOrigin="Origin.BottomCenter" @bind-Value="_queryForm.Source">
|
||||
<MudSelect T="DataSourceStorage" Label="Source name" AnchorOrigin="Origin.BottomCenter" @bind-Value="_queryForm.Source" >
|
||||
@foreach (var source in _dataSources)
|
||||
{
|
||||
<MudSelectItem Value="@source">@source.Name</MudSelectItem>
|
||||
@ -44,8 +44,8 @@
|
||||
</MudCardActions>
|
||||
</MudCard>
|
||||
|
||||
<MudCard>
|
||||
<EditForm Model="@_queryForm" OnSubmit="@HandleSubmit" class="form-group" Context="editContext">
|
||||
<EditForm Model="@_queryForm" OnSubmit="@HandleSubmit" class="form-group" Context="editContext">
|
||||
<MudCard Class="mb-3">
|
||||
<DataAnnotationsValidator />
|
||||
<ValidationSummary />
|
||||
<MudCardContent>
|
||||
@ -53,27 +53,32 @@
|
||||
<MudTextField Label="Name" @bind-Value="_queryForm.Source.Name" Variant="Variant.Text" InputType="InputType.Search" />
|
||||
|
||||
<MudGrid>
|
||||
@for ( var i = 0; i < _queryForm.Source.Queries.Count; i++ )
|
||||
@for (var i = 0; i < _queryForm.Source.Queries.Count; i++)
|
||||
{
|
||||
int pos = i;
|
||||
var def = _queryForm.Source.Queries[pos];
|
||||
|
||||
<MudItem xs="10">
|
||||
<MudTextField Label="Query" @bind-Value="def.Query" Variant="Variant.Text" InputType="InputType.Search" Lines="2" />
|
||||
<MudTextField Label="Query" @bind-Value="_queryForm.Source.Queries[pos].Query" Variant="Variant.Text" InputType="InputType.Search" Lines="2" />
|
||||
</MudItem>
|
||||
<MudItem xs="1">
|
||||
<MudIconButton Icon="@Icons.Material.Outlined.Add" Variant="Variant.Outlined" aria-label="add" OnClick="@(() => AddQuery(pos))"/>
|
||||
<MudIconButton Icon="@Icons.Material.Outlined.Add" Variant="Variant.Outlined" aria-label="add" OnClick="@(() => AddQuery(pos))" />
|
||||
@if (_queryForm.Source.Queries.Count > 1)
|
||||
{
|
||||
<MudIconButton Icon="@Icons.Material.Outlined.Delete" Variant="Variant.Outlined" aria-label="delete" OnClick="@(() => DeleteQuery(pos))"/>
|
||||
<MudIconButton Icon="@Icons.Material.Outlined.Delete" Variant="Variant.Outlined" aria-label="delete" OnClick="@(() => DeleteQuery(pos))" />
|
||||
}
|
||||
</MudItem>
|
||||
<MudItem xs="12">
|
||||
<MudColorPicker DisableToolbar="false" Label="Color" @bind-Text="def.Color" Style="@($"color: {def.Color};")" PickerVariant="PickerVariant.Inline" DisableAlpha=true />
|
||||
<MudColorPicker DisableToolbar="false" Label="Color" @bind-Text="_queryForm.Source.Queries[pos].Color" Style="@($"color: {_queryForm.Source.Queries[pos].Color};")" PickerVariant="PickerVariant.Inline" DisableAlpha=true />
|
||||
</MudItem>
|
||||
}
|
||||
</MudGrid>
|
||||
|
||||
</MudCardContent>
|
||||
<MudCardActions>
|
||||
<MudButton ButtonType="ButtonType.Submit" Variant="Variant.Filled" Color="MudBlazor.Color.Primary" Class="ml-auto">Submit</MudButton>
|
||||
</MudCardActions>
|
||||
</MudCard>
|
||||
<MudCard Class="mb-3">
|
||||
<MudCardContent>
|
||||
<MudDateRangePicker @ref="_picker" Label="Date range" @bind-DateRange="_queryForm.Dates" AutoClose="true">
|
||||
<PickerActions>
|
||||
<MudButton Class="mr-auto align-self-start" OnClick="@(() => _picker!.Clear())">Clear</MudButton>
|
||||
@ -88,11 +93,11 @@
|
||||
<MudTextField Label="Description" @bind-Value="_queryForm.Source.Description" Variant="Variant.Text" InputType="InputType.Search" Lines="3" />
|
||||
</MudCardContent>
|
||||
<MudCardActions>
|
||||
<p>Remove thus button!</p>
|
||||
<MudButton ButtonType="ButtonType.Submit" Variant="Variant.Filled" Color="MudBlazor.Color.Primary" Class="ml-auto" OnClick="@HandleTrain">Train</MudButton>
|
||||
<MudButton ButtonType="ButtonType.Submit" Variant="Variant.Filled" Color="MudBlazor.Color.Primary" Class="ml-auto">Submit</MudButton>
|
||||
</MudCardActions>
|
||||
</EditForm>
|
||||
</MudCard>
|
||||
</MudCard>
|
||||
</EditForm>
|
||||
</MudItem>
|
||||
<MudItem xs="12" sm="6" md="6" lg="9">
|
||||
<MudCard>
|
||||
|
||||
@ -38,7 +38,14 @@
|
||||
if (firstRender)
|
||||
{
|
||||
IsDarkMode = await _mudThemeProvider!.GetSystemPreference();
|
||||
await _mudThemeProvider.WatchSystemPreference(OnSystemPreferenceChanged);
|
||||
StateHasChanged();
|
||||
}
|
||||
}
|
||||
|
||||
private async Task OnSystemPreferenceChanged(bool newValue)
|
||||
{
|
||||
IsDarkMode = newValue;
|
||||
await InvokeAsync(StateHasChanged);
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user