OpenInsightApplicationProgrammingInterface
This commit is contained in:
@ -18,6 +18,7 @@ public record AppSettings(string BuildNumber,
|
||||
string MonAResource,
|
||||
string MonASite,
|
||||
int NotifyMinimum,
|
||||
string OpenInsightApplicationProgrammingInterface,
|
||||
string PostTo,
|
||||
int PostToEvery,
|
||||
string RootPassword,
|
||||
|
@ -24,6 +24,7 @@ public class AppSettings
|
||||
[Display(Name = "MonA Resource"), Required] public string MonAResource { get; set; }
|
||||
[Display(Name = "MonA Site"), Required] public string MonASite { get; set; }
|
||||
[Display(Name = "Notify Minimum"), Required] public int? NotifyMinimum { get; set; }
|
||||
[Display(Name = "OpenInsight Application Programming Interface"), Required] public string OpenInsightApplicationProgrammingInterface { get; set; }
|
||||
[Display(Name = "PostTo"), Required] public string PostTo { get; set; }
|
||||
[Display(Name = "Post to Every"), Required] public int? PostToEvery { get; set; }
|
||||
[Display(Name = "RootPassword"), Required] public string RootPassword { get; set; }
|
||||
@ -48,6 +49,8 @@ public class AppSettings
|
||||
throw new NullReferenceException(nameof(appSettings));
|
||||
if (appSettings.BuildNumber is null)
|
||||
throw new NullReferenceException(nameof(BuildNumber));
|
||||
if (appSettings.BuildSourceVersion is null)
|
||||
throw new NullReferenceException(nameof(BuildSourceVersion));
|
||||
if (appSettings.ClearLastScanServiceAfter is null)
|
||||
throw new NullReferenceException(nameof(ClearLastScanServiceAfter));
|
||||
if (appSettings.Company is null)
|
||||
@ -62,8 +65,6 @@ public class AppSettings
|
||||
throw new NullReferenceException(nameof(ExpectedScanLengthB));
|
||||
if (appSettings.FileShare is null)
|
||||
throw new NullReferenceException(nameof(FileShare));
|
||||
if (appSettings.BuildSourceVersion is null)
|
||||
throw new NullReferenceException(nameof(BuildSourceVersion));
|
||||
if (appSettings.IsDevelopment is null)
|
||||
throw new NullReferenceException(nameof(IsDevelopment));
|
||||
if (appSettings.IsStaging is null)
|
||||
@ -78,6 +79,8 @@ public class AppSettings
|
||||
throw new NullReferenceException(nameof(MonASite));
|
||||
if (appSettings.NotifyMinimum is null)
|
||||
throw new NullReferenceException(nameof(NotifyMinimum));
|
||||
if (appSettings.OpenInsightApplicationProgrammingInterface is null)
|
||||
throw new NullReferenceException(nameof(OpenInsightApplicationProgrammingInterface));
|
||||
if (appSettings.PostTo is null)
|
||||
throw new NullReferenceException(nameof(PostTo));
|
||||
if (appSettings.PostToEvery is null)
|
||||
@ -111,6 +114,7 @@ public class AppSettings
|
||||
appSettings.MonAResource,
|
||||
appSettings.MonASite,
|
||||
appSettings.NotifyMinimum.Value,
|
||||
appSettings.OpenInsightApplicationProgrammingInterface,
|
||||
appSettings.PostTo,
|
||||
appSettings.PostToEvery.Value,
|
||||
appSettings.RootPassword,
|
||||
|
@ -50,10 +50,9 @@
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
var appSettings = JSON.parse('@(System.Text.Json.JsonSerializer.Serialize(this.Model.AppSettings))');
|
||||
var appSettings = JSON.parse('@(Html.Raw(System.Text.Json.JsonSerializer.Serialize(this.Model.AppSettings)))');
|
||||
console.log(appSettings.BuildSourceVersion);
|
||||
console.log(appSettings.BuildNumber);
|
||||
console.log(appSettings);
|
||||
</script>
|
||||
<script src="~/js/signalr/dist/browser/signalr.js?dateTime=2023-07-26---12-08-00"></script>
|
||||
<script src="~/js/notification.js?dateTime=2023-07-26---12-08-00"></script>
|
@ -7,13 +7,9 @@ public class NotificationModel : PageModel
|
||||
{
|
||||
|
||||
public AppSettings AppSettings { get; }
|
||||
private readonly ILogger<NotificationModel> _Logger;
|
||||
|
||||
public NotificationModel(ILogger<NotificationModel> logger, AppSettings appSettings)
|
||||
{
|
||||
_Logger = logger;
|
||||
public NotificationModel(AppSettings appSettings) =>
|
||||
AppSettings = appSettings;
|
||||
}
|
||||
|
||||
public void OnGet()
|
||||
{
|
||||
|
@ -1,5 +1,6 @@
|
||||
{
|
||||
"BuildNumber": "1",
|
||||
"BuildSourceVersion": "1234567",
|
||||
"Company": "Infineon Technologies Americas Corp.",
|
||||
"ClearLastScanServiceAfter": 250,
|
||||
"DeviceNameEndsWith": "Symbol Bar Code Scanner",
|
||||
@ -8,7 +9,6 @@
|
||||
"ExpectedScanLengthB": 14,
|
||||
"ExpectedScanLengthBExample": "1TO172125.1.11",
|
||||
"FileShare": "",
|
||||
"GitCommitSeven": "1234567",
|
||||
"LinuxDevicePath": "/proc/bus/input/devices",
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
@ -24,6 +24,7 @@
|
||||
"MockRoot": "",
|
||||
"MonAResource": "OI_Metrology_Viewer_EC",
|
||||
"MonASite": "auc",
|
||||
"OpenInsightApplicationProgrammingInterface": "https://oi-prod-ec-api.mes.infineon.com/api/oiWizard",
|
||||
"PostTo": "",
|
||||
"PostToEvery": 1000,
|
||||
"SerialPortName": "/dev/ttyUSB0",
|
||||
|
@ -1,5 +1,7 @@
|
||||
"use strict";
|
||||
|
||||
console.log(appSettings.OpenInsightApplicationProgrammingInterface);
|
||||
|
||||
var connection = new signalR.HubConnectionBuilder()
|
||||
.withUrl("/NotificationHub")
|
||||
.build();
|
||||
@ -35,12 +37,9 @@ connection.on("NotifyAll", function (data) {
|
||||
if (postResult.Recipe != "Recipe") {
|
||||
document.getElementById("recipe").innerText = postResult.Recipe;
|
||||
} else {
|
||||
$.getJSON(
|
||||
"https://oi-prod-ec-api.mes.infineon.com/api/oiWizard/materials/rds/" +
|
||||
postResult.LotName,
|
||||
$.getJSON(appSettings.OpenInsightApplicationProgrammingInterface + "/materials/rds/" + postResult.LotName,
|
||||
function (data) {
|
||||
document.getElementById("recipe").innerText =
|
||||
data.rds.rdsLayers.length;
|
||||
document.getElementById("recipe").innerText = data.rds.rdsLayers.length;
|
||||
},
|
||||
);
|
||||
}
|
||||
@ -50,7 +49,7 @@ connection.on("NotifyAll", function (data) {
|
||||
|
||||
connection
|
||||
.start()
|
||||
.then(function () {})
|
||||
.then(function () { })
|
||||
.catch(function (err) {
|
||||
return console.error(err.toString());
|
||||
});
|
||||
|
Reference in New Issue
Block a user