Client Hub Project

This commit is contained in:
2023-01-15 18:40:32 -07:00
parent f69a937b1f
commit 924c903b3b
865 changed files with 51668 additions and 1 deletions

View File

@ -0,0 +1,25 @@
@page "/AwaitingDisposition"
@using Microsoft.AspNetCore.Components.Web
@namespace OI.Metrology.ClientHub.Pages
<PageTitle>Awaiting Disposition</PageTitle>
<h4>Awaiting Disposition</h4>
<div style="height: 450px;">
<table id="grid"></table>
</div>
<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>
<script suppress-error="BL9992">
setInterval(function () { $("#RefreshButton").click(); }, 60000);
</script>

View File

@ -0,0 +1,22 @@
using Microsoft.AspNetCore.Components;
using Microsoft.JSInterop;
namespace OI.Metrology.ClientHub.Pages;
public partial class AwaitingDisposition
{
[Inject] protected IJSRuntime? JSRuntime { get; set; }
protected override Task OnAfterRenderAsync(bool firstRender)
{
if (firstRender)
{
if (JSRuntime is null)
throw new NullReferenceException(nameof(JSRuntime));
return JSRuntime.InvokeVoidAsync("initAwaitingDisposition").AsTask();
}
return Task.CompletedTask;
}
}

View File

@ -0,0 +1 @@


View File

@ -0,0 +1 @@


View File

@ -0,0 +1,13 @@
@page "/counter"
@using Microsoft.AspNetCore.Components.Web
@namespace OI.Metrology.ClientHub.Pages
<PageTitle>Counter</PageTitle>
<h1>Counter - Bye</h1>
<p role="status">Current count: @_CurrentCount</p>
<button class="btn btn-primary" @onclick="IncrementCount">Click me</button>

View File

@ -0,0 +1,20 @@
using Microsoft.AspNetCore.Components;
namespace OI.Metrology.ClientHub.Pages;
public partial class Counter
{
[Inject] protected ILogger<Counter>? Logger { get; set; }
private int _CurrentCount = 0;
private void IncrementCount()
{
if (Logger is null)
throw new NullReferenceException(nameof(Logger));
Logger.LogWarning("Someone has clicked me!");
_CurrentCount++;
}
}

View File

@ -0,0 +1,42 @@
@page
@model OI.Metrology.ClientHub.Pages.ErrorModel
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<title>Error</title>
<link href="~/css/bootstrap/bootstrap.min.css" rel="stylesheet" />
<link href="~/css/site.css" rel="stylesheet" asp-append-version="true" />
</head>
<body>
<div class="main">
<div class="content px-4">
<h1 class="text-danger">Error.</h1>
<h2 class="text-danger">An error occurred while processing your request.</h2>
@if (Model.ShowRequestId)
{
<p>
<strong>Request ID:</strong> <code>@Model.RequestId</code>
</p>
}
<h3>Development Mode</h3>
<p>
Swapping to the <strong>Development</strong> environment displays detailed information about the error that occurred.
</p>
<p>
<strong>The Development environment shouldn't be enabled for deployed applications.</strong>
It can result in displaying sensitive information from exceptions to end users.
For local debugging, enable the <strong>Development</strong> environment by setting the <strong>ASPNETCORE_ENVIRONMENT</strong> environment variable to <strong>Development</strong>
and restarting the app.
</p>
</div>
</div>
</body>
</html>

View File

@ -0,0 +1,22 @@
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
using System.Diagnostics;
namespace OI.Metrology.ClientHub.Pages;
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
[IgnoreAntiforgeryToken]
public class ErrorModel : PageModel
{
public string? RequestId { get; set; }
public bool ShowRequestId => !string.IsNullOrEmpty(RequestId);
#pragma warning disable IDE0052
private readonly ILogger<ErrorModel> _Logger;
#pragma warning restore IDE0052
public ErrorModel(ILogger<ErrorModel> logger) => _Logger = logger;
public void OnGet() => RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier;
}

View File

@ -0,0 +1,40 @@
@page "/Export/{Model?}"
@using Microsoft.AspNetCore.Components.Web
@namespace OI.Metrology.ClientHub.Pages
<PageTitle>Export Data</PageTitle>
<h3>Export Data</h3>
<hr />
<form asp-controller="Export" asp-action="ExportData" method="post" class="form-inline">
<div class="form-group">
<label for="ToolType">Tool Type</label>
<div class="form-control" id="ToolType" name="ToolType"></div>
@* @Microsoft.AspNetCore.Html.ValidationMessage("ToolType", new { @class = "text-danger" }) *@
</div>
<div class="form-group">
<label for="StartDate">Start Time</label>
<div class="form-control mb-2 mr-sm-2" id="StartDateControl"></div>
<div class="form-control mb-2 mr-sm-2" id="StartTimeControl"></div>
@* @Microsoft.AspNetCore.Html.ValidationMessage("StartDate", new { @class = "text-danger" }) *@
</div>
<div class="form-group">
<label for="EndDate">End Time</label>
<div class="form-control mb-2 mr-sm-2" id="EndDateControl"></div>
<div class="form-control mb-2 mr-sm-2" id="EndTimeControl"></div>
@* @Microsoft.AspNetCore.Html.ValidationMessage("EndDate", new { @class = "text-danger" }) *@
</div>
<div class="form-group">
<button type="submit" class="btn btn-primary">Export Data</button>
</div>
<div class="form-group">
@* @Microsoft.AspNetCore.Html.ValidationMessage("Exception", new { @class = "text-danger" }) *@
</div>
<div asp-validation-summary="ModelOnly" class="text-danger"></div>
</form>

View File

@ -0,0 +1,33 @@
using Microsoft.AspNetCore.Components;
using Microsoft.JSInterop;
namespace OI.Metrology.ClientHub.Pages;
public partial class Export
{
[Inject] protected IJSRuntime? JSRuntime { get; set; }
[Parameter] public Metrology.Shared.ViewModels.Export? Model { get; set; }
public Export()
{
Model ??= new()
{
ToolType = "",
StartTime = DateTime.Now.AddMonths(-1),
EndTime = DateTime.Now
};
}
protected override Task OnAfterRenderAsync(bool firstRender)
{
if (firstRender)
{
if (JSRuntime is null)
throw new NullReferenceException(nameof(JSRuntime));
return JSRuntime.InvokeVoidAsync("initExport", DateTime.Now.AddMonths(-1), DateTime.Now).AsTask();
}
return Task.CompletedTask;
}
}

View File

@ -0,0 +1,4 @@
td {
padding-bottom: 2em;
padding-right: 1em;
}

View File

@ -0,0 +1 @@


View File

@ -0,0 +1,41 @@
@page "/fetchdata"
@using OI.Metrology.ClientHub.Data
@using Microsoft.AspNetCore.Components.Web
@namespace OI.Metrology.ClientHub.Pages
<PageTitle>Weather forecast</PageTitle>
<h1>Weather forecast</h1>
<p>This component demonstrates fetching data from a service.</p>
@if (_WeatherForecasts is null)
{
<p><em>Loading...</em></p>
}
else
{
<table class="table">
<thead>
<tr>
<th>Date</th>
<th>Temp. (C)</th>
<th>Temp. (F)</th>
<th>Summary</th>
</tr>
</thead>
<tbody>
@foreach (WeatherForecast weatherForecast in _WeatherForecasts)
{
<tr>
<td>@weatherForecast.Date.ToShortDateString()</td>
<td>@weatherForecast.TemperatureC</td>
<td>@weatherForecast.TemperatureF</td>
<td>@weatherForecast.Summary</td>
</tr>
}
</tbody>
</table>
}

View File

@ -0,0 +1,17 @@
using Microsoft.AspNetCore.Components;
using OI.Metrology.ClientHub.Data;
namespace OI.Metrology.ClientHub.Pages;
public partial class FetchData
{
private WeatherForecast[]? _WeatherForecasts;
[Inject] protected WeatherForecastService? ForecastService { get; set; }
protected override async Task OnInitializedAsync()
{
if (ForecastService is null)
throw new NullReferenceException(nameof(ForecastService));
_WeatherForecasts = await ForecastService.GetForecastAsync(DateOnly.FromDateTime(DateTime.Now));
}
}

View File

@ -0,0 +1,7 @@
@page "/fetchServiceShoporders"
@using Microsoft.AspNetCore.Components.Web
@namespace OI.Metrology.ClientHub.Pages
<PageTitle>Service-Shop Orders</PageTitle>

View File

@ -0,0 +1,4 @@
namespace OI.Metrology.ClientHub.Pages;
public partial class FetchServiceShopOrders
{ }

View File

@ -0,0 +1,11 @@
@page "/"
@using Microsoft.AspNetCore.Components.Web
@namespace OI.Metrology.ClientHub.Pages
<PageTitle>Index</PageTitle>
<h4>Run Information</h4>
Welcome to your new app.

View File

@ -0,0 +1,4 @@
namespace OI.Metrology.ClientHub.Pages;
public partial class Index
{ }

View File

@ -0,0 +1,31 @@
@page "/RunHeaders"
@using Microsoft.AspNetCore.Components.Web
@namespace OI.Metrology.ClientHub.Pages
<PageTitle>Run Headers</PageTitle>
<h4>Run Headers</h4>
<table>
<tr>
<td>
<label for="ToolType">Tool Type:</label>
</td>
<td>
<div id="ToolType"></div>
</td>
</tr>
</table>
<table width="100%" height="80%">
<tr>
<td width="50%">
<table id="HeaderGrid"></table>
</td>
<td width="50%">
<table id="FieldsGrid"></table>
</td>
</tr>
</table>

View File

@ -0,0 +1,22 @@
using Microsoft.AspNetCore.Components;
using Microsoft.JSInterop;
namespace OI.Metrology.ClientHub.Pages;
public partial class RunHeaders
{
[Inject] protected IJSRuntime? JSRuntime { get; set; }
protected override Task OnAfterRenderAsync(bool firstRender)
{
if (firstRender)
{
if (JSRuntime is null)
throw new NullReferenceException(nameof(JSRuntime));
return JSRuntime.InvokeVoidAsync("initRunHeaders").AsTask();
}
return Task.CompletedTask;
}
}

View File

@ -0,0 +1,17 @@
html,
body {
height: 100%;
}
div.container-fluid {
height: 90%;
}
#HeaderGrid,
#FieldsGrid {
font-size: 12px;
}
.FieldTitle {
font-weight: bold;
}

View File

@ -0,0 +1 @@


View File

@ -0,0 +1,69 @@
@page "/RunInfo/{Model?}"
@using Microsoft.AspNetCore.Components.Web
@namespace OI.Metrology.ClientHub.Pages
<PageTitle>Run Info</PageTitle>
<h4>Run Information</h4>
<form class="form-inline mb-4">
<div class="form-group">
<label for="ToolType">Tool Type</label>
<div class="form-control" id="ToolType"></div>
</div>
<div class="form-group">
<label for="StartDate">Start Time</label>
<div class="form-control mb-2 mr-sm-2" id="StartDate"></div>
<div class="form-control mb-2 mr-sm-2" id="StartTime"></div>
</div>
<div class="form-group">
<label for="EndDate">End Time</label>
<div class="form-control mb-2 mr-sm-2" id="EndDate"></div>
<div class="form-control mb-2 mr-sm-2" id="EndTime"></div>
</div>&nbsp;&nbsp;
<div class="form-group">
<input class="btn btn-primary" type="button" value="Load Headers" id="LoadHeadersButton" />
</div>&nbsp;&nbsp;
<div class="form-group">
<label class="form-check-label" for="chkAutoRefresh">
Auto-Refresh
</label>
<input class="form-check-input" type="checkbox" id="chkAutoRefresh">
</div>
</form>
<div style="height: 300px;" id="HeaderGridDiv">
<span id="ToolTypeID" hidden></span>
<table id="HeaderGrid"></table>
</div>
<div class="row" style="margin-top: 10px; margin-bottom: 20px;">
<div class="col-xs-1">
<input type="button" class="btn" id="GetDataButton" value="Get Data" disabled />
</div>
<div class="col-xs-1">
<input type="button" class="btn" id="ReviewButton" value="Review" disabled />
</div>
</div>
<div id="DetailsDiv" hidden>
<span id="HeaderId" hidden></span>
<span id="HeaderAttachmentId" hidden></span>
<div style="padding-bottom: 20px;" id="DetailsGridDiv">
<table id="DetailsGrid"></table>
</div>
<div id="ExportDiv" style="margin-top: 10px;" hidden>
<input type="button" value="Send to OpenInsight" id="OIExportButton" />
<span id="OIExportResult" style="margin-left: 10px; font-weight: bold; color: #366b02;"></span>
</div>
<p style="text-align: center; margin-top: 20px;">
<iframe id="DataAttachmentFrame" style="height:900px; border-width:thin; margin-right: 10px;" hidden></iframe>
<iframe id="HeaderAttachmentFrame" style="height:900px; border-width:thin;" hidden></iframe>
</p>
</div>

View File

@ -0,0 +1,27 @@
using Microsoft.AspNetCore.Components;
using Microsoft.JSInterop;
namespace OI.Metrology.ClientHub.Pages;
public partial class RunInfo
{
[Parameter] public Metrology.Shared.ViewModels.RunInfo? Model { get; set; }
[Inject] protected IJSRuntime? JSRuntime { get; set; }
protected override Task OnAfterRenderAsync(bool firstRender)
{
if (firstRender)
{
if (JSRuntime is null)
throw new NullReferenceException(nameof(JSRuntime));
int initialToolTypeID = Model is not null ? Model.ToolTypeID : 0;
int initialHeaderId = Model is not null ? Model.HeaderID : 0;
string initialHeaderAttachmentId = Model is not null ? Model.HeaderAttachmentID.ToString() : string.Empty;
return JSRuntime.InvokeVoidAsync("initRunInfo", initialToolTypeID, initialHeaderId, initialHeaderAttachmentId).AsTask();
}
return Task.CompletedTask;
}
}

View File

@ -0,0 +1,8 @@
#HeaderGridDiv,
#DetailsGridDiv {
font-size: 12px;
}
p {
color: red;
background-color: aqua;
}

View File

@ -0,0 +1 @@


View File

@ -0,0 +1,111 @@
@page "/"
@model OI.Metrology.ClientHub.Pages.Host
@using OI.Metrology.ClientHub.Models
@using Microsoft.AspNetCore.Components.Web
@namespace OI.Metrology.ClientHub.Pages
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<base href="/" />
<!-- link href="css/bootstrap/bootstrap.min.css" rel="stylesheet" / -->
<link href="css/site.css" rel="stylesheet" />
<link href="OI.Metrology.ClientHub.styles.css" rel="stylesheet" />
<link href="manifest.json" rel="manifest" />
<link rel="icon" type="image/png" href="favicon.png" />
<link rel="apple-touch-icon" sizes="512x512" href="icon-512.png" />
<link rel="apple-touch-icon" sizes="192x192" href="icon-192.png" />
<component type="typeof(HeadOutlet)" render-mode="ServerPrerendered" />
<script src="js/modernizr-3.6.0-custom.js" type="text/javascript" asp-append-version="true"></script>
<link href="styles/bootstrap.min.css" rel="stylesheet" asp-append-version="true" />
<link href="igniteui/css/themes/bootstrap3/default/infragistics.theme.css" rel="stylesheet"
asp-append-version="true" />
<link href="igniteui/css/structure/infragistics.css" rel="stylesheet" asp-append-version="true" />
<link href="styles/site.css" rel="stylesheet" asp-append-version="true" />
<script src="js/jquery-3.6.0.min.js" type="text/javascript" asp-append-version="true"></script>
<script src="js/jquery-ui.min.js" type="text/javascript" asp-append-version="true"></script>
<script src="igniteui/js/infragistics.core.js" type="text/javascript" asp-append-version="true"></script>
<script src="igniteui/js/infragistics.lob.js" type="text/javascript" asp-append-version="true"></script>
<script src="igniteui/js/infragistics.dv.js" type="text/javascript" asp-append-version="true"></script>
<script src="js/common.js" type="text/javascript" asp-append-version="true"></script>
<script src="site.js"></script>
</head>
<body>
<div class="navbar navbar-fixed-top @(@Model.AppSettings.IsDevelopment ? "test-database" : "" )">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<div class="navbar-brand">
<a href="/"><img src="~/images/IFX_LOGO_RGB.png" height="20" /></a>
OI Metrology Viewer
</div>
</div>
@if (@Model.AppSettings.IsDevelopment)
{
<p class="navbar-text hidden-xs hidden-sm"><span class="test-database-text">TEST DATABASE</span></p>
}
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li><a href="AwaitingDisposition">Awaiting Disposition</a></li>
<li><a href="RunInfo">Run Information</a></li>
<li><a href="RunHeaders">Run Headers</a></li>
<li><a href="Export">Export</a></li>
<li><a href="https://oi-metrology-viewer-archive.mes.infineon.com/" target="_blank">Archive</a></li>
</ul>
<p class="navbar-text navbar-right">
@User.Identity?.Name
</p>
</div>
</div>
</div>
<div class="container-fluid body-content">
<component type="typeof(App)" render-mode="ServerPrerendered" />
<hr />
<footer>
<p>&copy; @DateTime.Now.Year - Infineon Technologies</p>
@if (@Model.AppSettings.IsDevelopment)
{
<p><strong>Request ID:</strong><code>@Model.RequestId</code></p>
}
</footer>
</div>
<div id="MessageModal"></div>
<div id="blazor-error-ui">
<environment include="Staging,Production">
An error has occurred. This application may no longer respond until reloaded.
</environment>
<environment include="Development">
An unhandled exception has occurred. See browser dev tools for details.
</environment>
<a href="" class="reload">Reload</a>
<a class="dismiss">🗙</a>
</div>
<script src="_framework/blazor.server.js"></script>
<script src="js/bootstrap.min.js" type="text/javascript" asp-append-version="true"></script>
<script src="js/respond.min.js" type="text/javascript" asp-append-version="true"></script>
</body>
</html>

View File

@ -0,0 +1,17 @@
using Microsoft.AspNetCore.Mvc.RazorPages;
using OI.Metrology.ClientHub.Models;
using System.Diagnostics;
namespace OI.Metrology.ClientHub.Pages;
public partial class Host : PageModel
{
public AppSettings AppSettings { get; }
public string? RequestId { get; private set; }
public Host(AppSettings appSettings) => AppSettings = appSettings;
public void OnGet() => RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier;
}