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
|
TrainData
|
||||||
prometheus-2.45.0-rc.0.windows-amd64
|
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 Query { get; set; }
|
||||||
public string Color { get; set; }
|
public string Color { get; set; }
|
||||||
|
|
||||||
|
public override string ToString() => Query;
|
||||||
}
|
}
|
||||||
|
|
||||||
public class DataSourceDefinition
|
public class DataSourceDefinition
|
||||||
@ -26,4 +27,6 @@ public class DataSourceDefinition
|
|||||||
public string Name { get; set; }
|
public string Name { get; set; }
|
||||||
public List<DataSourceQuery> Queries { get; set; } = new();
|
public List<DataSourceQuery> Queries { get; set; } = new();
|
||||||
public string Description { get; set; } = string.Empty;
|
public string Description { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
public override string ToString() => Name;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -30,7 +30,7 @@
|
|||||||
|
|
||||||
<MudCard Class="mb-3">
|
<MudCard Class="mb-3">
|
||||||
<MudCardActions>
|
<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)
|
@foreach (var source in _dataSources)
|
||||||
{
|
{
|
||||||
<MudSelectItem Value="@source">@source.Name</MudSelectItem>
|
<MudSelectItem Value="@source">@source.Name</MudSelectItem>
|
||||||
@ -44,8 +44,8 @@
|
|||||||
</MudCardActions>
|
</MudCardActions>
|
||||||
</MudCard>
|
</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 />
|
<DataAnnotationsValidator />
|
||||||
<ValidationSummary />
|
<ValidationSummary />
|
||||||
<MudCardContent>
|
<MudCardContent>
|
||||||
@ -56,10 +56,9 @@
|
|||||||
@for (var i = 0; i < _queryForm.Source.Queries.Count; i++)
|
@for (var i = 0; i < _queryForm.Source.Queries.Count; i++)
|
||||||
{
|
{
|
||||||
int pos = i;
|
int pos = i;
|
||||||
var def = _queryForm.Source.Queries[pos];
|
|
||||||
|
|
||||||
<MudItem xs="10">
|
<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>
|
||||||
<MudItem xs="1">
|
<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))" />
|
||||||
@ -69,11 +68,17 @@
|
|||||||
}
|
}
|
||||||
</MudItem>
|
</MudItem>
|
||||||
<MudItem xs="12">
|
<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>
|
</MudItem>
|
||||||
}
|
}
|
||||||
</MudGrid>
|
</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">
|
<MudDateRangePicker @ref="_picker" Label="Date range" @bind-DateRange="_queryForm.Dates" AutoClose="true">
|
||||||
<PickerActions>
|
<PickerActions>
|
||||||
<MudButton Class="mr-auto align-self-start" OnClick="@(() => _picker!.Clear())">Clear</MudButton>
|
<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" />
|
<MudTextField Label="Description" @bind-Value="_queryForm.Source.Description" Variant="Variant.Text" InputType="InputType.Search" Lines="3" />
|
||||||
</MudCardContent>
|
</MudCardContent>
|
||||||
<MudCardActions>
|
<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" OnClick="@HandleTrain">Train</MudButton>
|
||||||
<MudButton ButtonType="ButtonType.Submit" Variant="Variant.Filled" Color="MudBlazor.Color.Primary" Class="ml-auto">Submit</MudButton>
|
|
||||||
</MudCardActions>
|
</MudCardActions>
|
||||||
</EditForm>
|
|
||||||
</MudCard>
|
</MudCard>
|
||||||
|
</EditForm>
|
||||||
</MudItem>
|
</MudItem>
|
||||||
<MudItem xs="12" sm="6" md="6" lg="9">
|
<MudItem xs="12" sm="6" md="6" lg="9">
|
||||||
<MudCard>
|
<MudCard>
|
||||||
|
|||||||
@ -38,7 +38,14 @@
|
|||||||
if (firstRender)
|
if (firstRender)
|
||||||
{
|
{
|
||||||
IsDarkMode = await _mudThemeProvider!.GetSystemPreference();
|
IsDarkMode = await _mudThemeProvider!.GetSystemPreference();
|
||||||
|
await _mudThemeProvider.WatchSystemPreference(OnSystemPreferenceChanged);
|
||||||
StateHasChanged();
|
StateHasChanged();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private async Task OnSystemPreferenceChanged(bool newValue)
|
||||||
|
{
|
||||||
|
IsDarkMode = newValue;
|
||||||
|
await InvokeAsync(StateHasChanged);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user