All but DataTable Deserialize

This commit is contained in:
2023-01-09 19:26:00 -07:00
parent 6cbcad2a5d
commit 0468c8d42d
25 changed files with 374 additions and 89 deletions

View File

@ -0,0 +1,48 @@
@page "/AwaitingDisposition"
@using OI.Metrology.Shared.DataModels
<PageTitle>Awaiting Disposition</PageTitle>
<MudText Typo="Typo.h4" GutterBottom="true">Awaiting Disposition</MudText>
@if (_Records == null)
{
<MudProgressCircular Color="Color.Default" Indeterminate="true" />
}
else
{
<MudTable Items="_Records" Hover="true" SortLabel="Sort By" Elevation="0">
<HeaderContent>
<MudTh><MudTableSortLabel SortBy="new Func<OI.Metrology.Shared.DataModels.AwaitingDisposition, string?>(x=>x.ToolType)">ToolType</MudTableSortLabel></MudTh>
<MudTh><MudTableSortLabel SortBy="new Func<OI.Metrology.Shared.DataModels.AwaitingDisposition, string?>(x=>x.Tool)">Tool</MudTableSortLabel></MudTh>
<MudTh><MudTableSortLabel SortBy="new Func<OI.Metrology.Shared.DataModels.AwaitingDisposition, string?>(x=>x.Reactor)">Reactor</MudTableSortLabel></MudTh>
<MudTh><MudTableSortLabel SortBy="new Func<OI.Metrology.Shared.DataModels.AwaitingDisposition, string?>(x=>x.RDS)">RDS</MudTableSortLabel></MudTh>
<MudTh><MudTableSortLabel SortBy="new Func<OI.Metrology.Shared.DataModels.AwaitingDisposition, string?>(x=>x.PSN)">PSN</MudTableSortLabel></MudTh>
<MudTh><MudTableSortLabel SortBy="new Func<OI.Metrology.Shared.DataModels.AwaitingDisposition, string?>(x=>x.Layer)">Layer</MudTableSortLabel></MudTh>
<MudTh><MudTableSortLabel SortBy="new Func<OI.Metrology.Shared.DataModels.AwaitingDisposition, string?>(x=>x.Zone)">Zone</MudTableSortLabel></MudTh>
<MudTh><MudTableSortLabel SortBy="new Func<OI.Metrology.Shared.DataModels.AwaitingDisposition, object>(x=>x.InsertDate)">InsertDate</MudTableSortLabel></MudTh>
<MudTh><MudTableSortLabel SortBy="new Func<OI.Metrology.Shared.DataModels.AwaitingDisposition, object>(x=>x.Expiration)">Expiration</MudTableSortLabel></MudTh>
</HeaderContent>
<RowTemplate>
<MudTd DataLabel="ToolType">@context.ToolType</MudTd>
<MudTd DataLabel="Tool">@context.Tool</MudTd>
<MudTd DataLabel="Reactor">@context.Reactor</MudTd>
<MudTd DataLabel="RDS">@context.RDS</MudTd>
<MudTd DataLabel="PSN">@context.PSN</MudTd>
<MudTd DataLabel="Layer">@context.Layer</MudTd>
<MudTd DataLabel="Zone">@context.Zone</MudTd>
<MudTd DataLabel="InsertDate">@context.InsertDate</MudTd>
<MudTd DataLabel="Expiration">@context.Expiration</MudTd>
</RowTemplate>
<PagerContent>
<MudTablePager PageSizeOptions="new int[]{50, 100}" />
</PagerContent>
</MudTable>
<div class="row" style="margin-top: 10px; margin-bottom: 20px;">
<div class="col-xs-1">
<input type="button" id="OpenButton" value="Open" />
</div>
<div class="col-xs-1">
<input type="button" id="RefreshButton" value="Refresh" />
</div>
</div>
}

View File

@ -0,0 +1,30 @@
using OI.Metrology.Shared.Models.Stateless;
using Microsoft.AspNetCore.Components;
using System.Net.Http.Json;
namespace OI.Metrology.Client.Pages;
public partial class AwaitingDisposition
{
[Inject] protected HttpClient? HttpClient { get; set; }
[Inject] protected ILogger<AwaitingDisposition>? Logger { get; set; }
private Metrology.Shared.DataModels.AwaitingDisposition[]? _Records;
protected override async Task OnInitializedAsync()
{
if (Logger is null)
throw new NullReferenceException(nameof(Logger));
if (HttpClient is null)
throw new NullReferenceException(nameof(HttpClient));
string controllerName = IAwaitingDispoController<object>.GetRouteName();
try
{ _Records = await HttpClient.GetFromJsonAsync<Metrology.Shared.DataModels.AwaitingDisposition[]>($"api/{controllerName}"); }
catch (Exception)
{
string json = await HttpClient.GetStringAsync($"api/{controllerName}");
Logger.LogInformation(message: json);
}
}
}

View File

@ -0,0 +1,48 @@
@page "/RunHeaders"
@using OI.Metrology.Shared.DataModels
<PageTitle>Run Headers</PageTitle>
<MudText Typo="Typo.h4" GutterBottom="true">Run Headers</MudText>
@if (_ToolTypeNameIdCollection is null || !_ToolTypeNameIdCollection.Any())
{
<MudProgressCircular Color="Color.Default" Indeterminate="true" />
}
else
{
<MudSelect Margin="Margin.Dense" T="string" Label="Coffee" Variant="Variant.Outlined">
@foreach (ToolTypeNameId toolTypeNameId in _ToolTypeNameIdCollection)
{
<MudSelectItem Value="@toolTypeNameId.ID">@toolTypeNameId.ToolTypeName</MudSelectItem>
}
</MudSelect>
<MudTable Items="_Records" Hover="true" SortLabel="Sort By" Elevation="0">
<HeaderContent>
<MudTh>
<MudTableSortLabel
SortBy="new Func<OI.Metrology.Shared.DataModels.AwaitingDisposition, string?>(x=>x.ToolType)">ToolType
</MudTableSortLabel>
</MudTh>
<MudTh>
<MudTableSortLabel
SortBy="new Func<OI.Metrology.Shared.DataModels.AwaitingDisposition, object>(x=>x.Expiration)">
Expiration</MudTableSortLabel>
</MudTh>
</HeaderContent>
<RowTemplate>
<MudTd DataLabel="ToolType">@context.ToolType</MudTd>
<MudTd DataLabel="Expiration">@context.Expiration</MudTd>
</RowTemplate>
<PagerContent>
<MudTablePager PageSizeOptions="new int[]{50, 100}" />
</PagerContent>
</MudTable>
<div class="row" style="margin-top: 10px; margin-bottom: 20px;">
<div class="col-xs-1">
<input type="button" id="OpenButton" value="Open" />
</div>
<div class="col-xs-1">
<input type="button" id="RefreshButton" value="Refresh" />
</div>
</div>
}

View File

@ -0,0 +1,42 @@
using Microsoft.AspNetCore.Components;
using OI.Metrology.Shared.DataModels;
using OI.Metrology.Shared.Models.Stateless;
using System.Net.Http.Json;
namespace OI.Metrology.Client.Pages;
public partial class RunHeaders
{
[Inject] protected HttpClient? HttpClient { get; set; }
[Inject] protected ILogger<RunHeaders>? Logger { get; set; }
private List<ToolTypeNameId>? _ToolTypeNameIdCollection;
private Metrology.Shared.DataModels.AwaitingDisposition[]? _Records;
protected override async Task OnInitializedAsync()
{
if (Logger is null)
throw new NullReferenceException(nameof(Logger));
if (HttpClient is null)
throw new NullReferenceException(nameof(HttpClient));
_ToolTypeNameIdCollection = new();
string toolTypeController = IToolTypesController<object>.GetRouteName();
// string controllerName = IMetrologyRepository<object>.GetRouteName();
try
{
Result<ToolTypeNameId[]>? result = await HttpClient.GetFromJsonAsync<Result<ToolTypeNameId[]>>($"api/{toolTypeController}");
if (result?.Results is not null)
{
_ToolTypeNameIdCollection.AddRange(result.Results);
if (_ToolTypeNameIdCollection is not null && _ToolTypeNameIdCollection.Any())
_Records = await HttpClient.GetFromJsonAsync<Metrology.Shared.DataModels.AwaitingDisposition[]>($"api/controllerName");
}
}
catch (Exception)
{
string json = await HttpClient.GetStringAsync($"api/{toolTypeController}");
Logger.LogInformation(message: json);
}
}
}

View File

@ -1,5 +1,10 @@
<MudNavMenu>
<MudNavLink Href="" Match="NavLinkMatch.All" Icon="@Icons.Material.Filled.Home">Home</MudNavLink>
<MudNavLink Href="counter" Match="NavLinkMatch.Prefix" Icon="@Icons.Material.Filled.Add">Counter</MudNavLink>
<MudNavLink Href="fetchserviceshoporders" Match="NavLinkMatch.Prefix" Icon="@Icons.Material.Filled.List">Fetch Service Shop Orders</MudNavLink>
<MudNavLink Href="fetchserviceshoporders" Match="NavLinkMatch.Prefix" Icon="@Icons.Material.Filled.CollectionsBookmark">Fetch Service Shop Orders</MudNavLink>
<MudNavLink Href="AwaitingDisposition" Match="NavLinkMatch.Prefix" Icon="@Icons.Material.Filled.QueuePlayNext">Awaiting Disposition</MudNavLink>
<MudNavLink Href="AwaitingDisposition" Match="NavLinkMatch.Prefix" Icon="@Icons.Material.Filled.Info">Run Information</MudNavLink>
<MudNavLink Href="AwaitingDisposition" Match="NavLinkMatch.Prefix" Icon="@Icons.Material.Filled.ViewHeadline">Run Headers</MudNavLink>
<MudNavLink Href="AwaitingDisposition" Match="NavLinkMatch.Prefix" Icon="@Icons.Material.Filled.ImportExport">Export</MudNavLink>
<MudNavLink Href="AwaitingDisposition" Match="NavLinkMatch.Prefix" Icon="@Icons.Material.Filled.Archive">Archive</MudNavLink>
</MudNavMenu>

View File

@ -4,7 +4,7 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<title>Expose-MyIT</title>
<title>OI Metrology Viewer</title>
<base href="/" />
<link href="css/bootstrap/bootstrap.min.css" rel="stylesheet" />
<link href="css/app.css" rel="stylesheet" />

View File

@ -1,6 +1,6 @@
{
"name": "Expose-MyIT",
"short_name": "Expose-MyIT",
"name": "OI-Metrology-Viewer",
"short_name": "OI-Metrology-Viewer",
"start_url": "./",
"display": "standalone",
"background_color": "#ffffff",