diff --git a/ClientHub/OI.Metrology.ClientHub.csproj b/ClientHub/OI.Metrology.ClientHub.csproj index 8eba767..1ff7cc5 100644 --- a/ClientHub/OI.Metrology.ClientHub.csproj +++ b/ClientHub/OI.Metrology.ClientHub.csproj @@ -6,7 +6,7 @@ win-x64 - + diff --git a/ClientHub/Pages/AwaitingDisposition.razor b/ClientHub/Pages/AwaitingDisposition.razor index 50524df..e0eba7e 100644 --- a/ClientHub/Pages/AwaitingDisposition.razor +++ b/ClientHub/Pages/AwaitingDisposition.razor @@ -2,7 +2,6 @@ @page "/AwaitingDisposition" @using Microsoft.AspNetCore.Components.Web -@using MudBlazor @namespace OI.Metrology.ClientHub.Pages @@ -15,57 +14,13 @@
- Open +
- Refresh -
-
- View +
-@if (_Records == null) -{ - -} -else if (_Records.Any()) -{ - - - - - - - - - - - - ToolType - Tool - Reactor - RDS - PSN - Layer - Zone - InsertDate - Expiration - - - @context.ToolType - @context.Tool - @context.Reactor - @context.RDS - @context.PSN - @context.Layer - @context.Zone - @context.InsertDate - @context.Expiration - - -} - \ No newline at end of file diff --git a/ClientHub/Pages/AwaitingDisposition.razor.cs b/ClientHub/Pages/AwaitingDisposition.razor.cs index b74e18d..1637833 100644 --- a/ClientHub/Pages/AwaitingDisposition.razor.cs +++ b/ClientHub/Pages/AwaitingDisposition.razor.cs @@ -1,7 +1,6 @@ using Microsoft.AspNetCore.Components; using Microsoft.JSInterop; using OI.Metrology.ClientHub.Models; -using OI.Metrology.Shared.Models.Stateless; namespace OI.Metrology.ClientHub.Pages; @@ -13,17 +12,6 @@ public partial class AwaitingDisposition [Inject] protected AppSettings? AppSettings { get; set; } [Inject] protected ILogger? Logger { get; set; } - private string? _ToolTypeFilter; - private string? _ToolFilter; - private string? _ReactorFilter; - private string? _RdsFilter; - private string? _PSNFilter; - private string? _LayerFilter; - private string? _ZoneFilter; - private readonly List _Records; - - public AwaitingDisposition() => _Records = new(); - protected override Task OnAfterRenderAsync(bool firstRender) { if (firstRender) @@ -37,46 +25,4 @@ public partial class AwaitingDisposition return Task.CompletedTask; } - private bool FilterRecords(Metrology.Shared.DataModels.AwaitingDisposition? record) - { - bool? result = _ToolTypeFilter is not null ? record?.ToolType?.Contains(_ToolTypeFilter, StringComparison.CurrentCultureIgnoreCase) : null; - if (result is null || result.Value) - result = _ToolFilter is not null ? record?.Tool?.Contains(_ToolFilter, StringComparison.CurrentCultureIgnoreCase) : null; - if (result is null || result.Value) - result = _ReactorFilter is not null ? record?.Reactor?.Contains(_ReactorFilter, StringComparison.CurrentCultureIgnoreCase) : null; - if (result is null || result.Value) - result = _RdsFilter is not null ? record?.RDS?.Contains(_RdsFilter, StringComparison.CurrentCultureIgnoreCase) : null; - if (result is null || result.Value) - result = _PSNFilter is not null ? record?.PSN?.Contains(_PSNFilter, StringComparison.CurrentCultureIgnoreCase) : null; - if (result is null || result.Value) - result = _LayerFilter is not null ? record?.Layer?.Contains(_LayerFilter, StringComparison.CurrentCultureIgnoreCase) : null; - if (result is null || result.Value) - result = _ZoneFilter is not null ? record?.Zone?.Contains(_ZoneFilter, StringComparison.CurrentCultureIgnoreCase) : null; - result ??= true; - return result.Value; - } - - private void RefreshClick() => _Records.Clear(); - - private async Task LoadClickAsync() - { - if (Logger is null) - throw new NullReferenceException(nameof(Logger)); - if (HttpClient is null) - throw new NullReferenceException(nameof(HttpClient)); - _Records.Clear(); - string controllerName = IAwaitingDispoController.GetRouteName(); - try - { - Metrology.Shared.DataModels.AwaitingDisposition[]? collection = await HttpClient.GetFromJsonAsync($"api/{controllerName}"); - if (collection is not null) - _Records.AddRange(collection); - } - catch (Exception) - { - string json = await HttpClient.GetStringAsync($"api/{controllerName}"); - Logger.LogInformation(message: json); - } - } - } \ No newline at end of file diff --git a/ClientHub/Pages/Export.razor b/ClientHub/Pages/Export.razor index 2e01744..4898f47 100644 --- a/ClientHub/Pages/Export.razor +++ b/ClientHub/Pages/Export.razor @@ -1,7 +1,7 @@ @page "/Export" +@using IgniteUI.Blazor.Controls @using Microsoft.AspNetCore.Components.Web -@using MudBlazor @using OI.Metrology.Shared.DataModels @namespace OI.Metrology.ClientHub.Pages @@ -12,6 +12,11 @@
+ + + Refresh + + @if (_TimeSpan is null || _DateRange is null || _ToolTypeNameId is null || _ToolTypeNameIdCollection is null) {

Loading...

diff --git a/ClientHub/Pages/Export.razor.cs b/ClientHub/Pages/Export.razor.cs index 4ac3f38..68fbf4e 100644 --- a/ClientHub/Pages/Export.razor.cs +++ b/ClientHub/Pages/Export.razor.cs @@ -1,6 +1,6 @@ -using Microsoft.AspNetCore.Components; +using IgniteUI.Blazor.Controls; +using Microsoft.AspNetCore.Components; using Microsoft.JSInterop; -using MudBlazor; using OI.Metrology.Shared.DataModels; using OI.Metrology.Shared.Models.Stateless; using System.Net; @@ -11,10 +11,11 @@ public partial class Export { protected TimeSpan? _TimeSpan; - protected DateRange? _DateRange; + protected TimeSpan? _DateRange; protected ToolTypeNameId? _ToolTypeNameId; protected ToolTypeNameId[]? _ToolTypeNameIdCollection; + protected IgbIcon? IconRef { get; set; } [Inject] protected HttpClient? HttpClient { get; set; } [Inject] protected IJSRuntime? JSRuntime { get; set; } [Inject] protected Models.AppSettings? AppSettings { get; set; } @@ -24,6 +25,15 @@ public partial class Export protected override Task OnAfterRenderAsync(bool firstRender) { + if (firstRender && IconRef is not null) + { + // _ = IconRef.EnsureReady().ContinueWith(new Action((e) => + // IconRef.RegisterIconAsync("build", "https://unpkg.com/material-design-icons@3.0.1/action/svg/production/ic_build_24px.svg", "material"))); + const string buildIcon = ""; + // const string review = "Code Review IconA picture showing encircled angle brackets with a dot between them."; + _ = IconRef.EnsureReady().ContinueWith(new Action((e) => + IconRef.RegisterIconFromTextAsync("build", buildIcon, "material"))); + } if (firstRender) { if (JSRuntime is null) @@ -39,7 +49,7 @@ public partial class Export { _ToolTypeNameId ??= new(); _TimeSpan ??= new TimeSpan(DateTime.Now.Hour, DateTime.Now.Minute, 00); - _DateRange ??= new DateRange(DateTime.Now.AddMonths(-1).Date, DateTime.Now.Date); + _DateRange ??= new TimeSpan(DateTime.Now.Date.Ticks - DateTime.Now.AddMonths(-1).Date.Ticks); if (Logger is null) throw new NullReferenceException(nameof(Logger)); if (HttpClient is null) @@ -64,11 +74,12 @@ public partial class Export throw new NullReferenceException(nameof(JSRuntime)); if (HttpClient is null) throw new NullReferenceException(nameof(HttpClient)); - if (_TimeSpan is null || _DateRange is null || _ToolTypeNameId is null || _ToolTypeNameIdCollection is null || _ToolTypeNameId.ToolTypeName is null || _DateRange.Start is null || _DateRange.End is null) + if (_TimeSpan is null || _DateRange is null || _ToolTypeNameId is null || _ToolTypeNameIdCollection is null || _ToolTypeNameId.ToolTypeName is null || _DateRange is null) return; + TimeSpan timeSpan = new(_TimeSpan.Value.Ticks); string controllerName = IToolTypesController.GetRouteName(); - string endTime = _DateRange.End.Value.AddTicks(_TimeSpan.Value.Ticks).ToString(); - string startTime = _DateRange.Start.Value.AddTicks(_TimeSpan.Value.Ticks).ToString(); + string endTime = _DateRange.Value.Add(timeSpan).ToString(); + string startTime = _DateRange.Value.Add(new TimeSpan(_TimeSpan.Value.Ticks)).ToString(); string fileName = $"Export_{_ToolTypeNameId.ToolTypeName}_{startTime:yyyyMMddHHmm}_to_{endTime:yyyyMMddHHmm}.csv"; string query = $"datebegin={startTime:MM/dd/yyyy hh:mm tt}&dateend={endTime:MM/dd/yyyy hh:mm tt}&filename={WebUtility.UrlEncode(fileName)}"; await JSRuntime.InvokeVoidAsync("triggerFileDownload", fileName, $"{HttpClient.BaseAddress}api/{controllerName}/{_ToolTypeNameId.ID}/csv?{query}"); diff --git a/ClientHub/Pages/RunHeaders.razor b/ClientHub/Pages/RunHeaders.razor index 103d3a6..e78d41d 100644 --- a/ClientHub/Pages/RunHeaders.razor +++ b/ClientHub/Pages/RunHeaders.razor @@ -1,7 +1,6 @@ @page "/RunHeaders" @using Microsoft.AspNetCore.Components.Web -@using MudBlazor @namespace OI.Metrology.ClientHub.Pages @@ -33,9 +32,9 @@
- Open +
- Refresh +
\ No newline at end of file diff --git a/ClientHub/Pages/RunInfo.razor b/ClientHub/Pages/RunInfo.razor index 6d6d0eb..a5a0dfa 100644 --- a/ClientHub/Pages/RunInfo.razor +++ b/ClientHub/Pages/RunInfo.razor @@ -1,7 +1,6 @@ @page "/RunInfo/{ToolTypeId:int?}/{HeaderId:int?}" @using Microsoft.AspNetCore.Components.Web -@using MudBlazor @namespace OI.Metrology.ClientHub.Pages @@ -25,7 +24,7 @@
  
- Load Headers +
  
diff --git a/ClientHub/Pages/_Host.cshtml b/ClientHub/Pages/_Host.cshtml index d2ebf58..182a336 100644 --- a/ClientHub/Pages/_Host.cshtml +++ b/ClientHub/Pages/_Host.cshtml @@ -24,7 +24,7 @@ - + @@ -61,7 +61,7 @@ - + diff --git a/ClientHub/Program.cs b/ClientHub/Program.cs index e3b7caf..0a34631 100644 --- a/ClientHub/Program.cs +++ b/ClientHub/Program.cs @@ -1,4 +1,4 @@ -using MudBlazor.Services; +using IgniteUI.Blazor.Controls; using OI.Metrology.ClientHub.Data; using OI.Metrology.ClientHub.Models; using Serilog; @@ -24,7 +24,7 @@ internal class Program AppSettings appSettings = Models.Binder.AppSettings.Get(builder.Configuration); // Add services to the container. _ = builder.Services.AddRazorPages(); - _ = builder.Services.AddMudServices(); + _ = builder.Services.AddIgniteUIBlazor(typeof(IgbIconModule)); _ = builder.Services.AddServerSideBlazor(); _ = builder.Services.AddHttpContextAccessor(); diff --git a/ClientHub/Shared/MainLayout.razor b/ClientHub/Shared/MainLayout.razor index 308004e..8656248 100644 --- a/ClientHub/Shared/MainLayout.razor +++ b/ClientHub/Shared/MainLayout.razor @@ -1,55 +1,44 @@ @inherits LayoutComponentBase @namespace OI.Metrology.ClientHub.Shared -@using MudBlazor - - - - - - -