diff --git a/.kanbn/index.md b/.kanbn/index.md index 3de6f96..9582bdc 100644 --- a/.kanbn/index.md +++ b/.kanbn/index.md @@ -19,23 +19,24 @@ dateFormat: mm/dd ## In Progress -- [post-only-once](tasks/post-only-once.md) -- [publish](tasks/publish.md) -- [roll-out](tasks/roll-out.md) -- [self-signed-certificate](tasks/self-signed-certificate.md) +- [azure-pipeline](tasks/azure-pipeline.md) - [update-os](tasks/update-os.md) +- [self-signed-certificate](tasks/self-signed-certificate.md) +- [roll-out](tasks/roll-out.md) +- [publish](tasks/publish.md) +- [post-only-once](tasks/post-only-once.md) ## Done -- [configure-ufw](tasks/configure-ufw.md) -- [create-as-service](tasks/create-as-service.md) -- [install-net-7-0](tasks/install-net-7-0.md) -- [install-ubuntu-frame](tasks/install-ubuntu-frame.md) -- [install-vscode-extensions](tasks/install-vscode-extensions.md) -- [pull-repo](tasks/pull-repo.md) -- [run-secrets-task](tasks/run-secrets-task.md) -- [run-test-ports](tasks/run-test-ports.md) - [setup-nginx](tasks/setup-nginx.md) +- [run-test-ports](tasks/run-test-ports.md) +- [run-secrets-task](tasks/run-secrets-task.md) +- [pull-repo](tasks/pull-repo.md) +- [install-vscode-extensions](tasks/install-vscode-extensions.md) +- [install-ubuntu-frame](tasks/install-ubuntu-frame.md) +- [install-net-7-0](tasks/install-net-7-0.md) +- [create-as-service](tasks/create-as-service.md) +- [configure-ufw](tasks/configure-ufw.md) ## Archive diff --git a/.kanbn/tasks/apt-get-install.md b/.kanbn/tasks/apt-get-install.md index d2b20e1..af70fa5 100644 --- a/.kanbn/tasks/apt-get-install.md +++ b/.kanbn/tasks/apt-get-install.md @@ -1,4 +1,8 @@ --- +status: "1-Backlog" +created: "2023-06-23T22:41:35.812Z" +updated: "2023-07-27T18:05:52.706Z" +type: "kanbn" --- # apt-get-install diff --git a/.kanbn/tasks/azure-pipeline.md b/.kanbn/tasks/azure-pipeline.md new file mode 100644 index 0000000..5b4d09d --- /dev/null +++ b/.kanbn/tasks/azure-pipeline.md @@ -0,0 +1,55 @@ +--- +created: "2023-07-27T18:04:46.640Z" +updated: "2023-07-27T18:05:52.731Z" +assigned: "" +progress: 0 +started: "2023-07-27T18:04:48.076Z" +status: "3-In Progress" +type: "kanbn" +--- + +# Azure Pipeline + +```bash +pscp D:/Tmp/phares/ag/vsts-agent-linux-x64-2.210.1.tar.gz unity4@unity4:/home/unity4/vsts-agent-linux-x64-2.210.1.tar.gz +pscp D:/Tmp/phares/ag/vsts-agent-linux-x64-2.210.1.tar.gz unity5@unity5:/home/unity5/vsts-agent-linux-x64-2.210.1.tar.gz +``` + +```bash +mv vsts-agent-linux-x64-2.210.1.tar.gz vsts-agent-linux-x64-2.210.1-unity4 +cd vsts-agent-linux-x64-2.210.1-unity4 +tar xvzf vsts-agent-linux-x64-2.210.1.tar.gz +chown unity4 /home/unity4/vsts-agent-linux-x64-2.210.1-unity4 -R +chgrp unity4 /home/unity4/vsts-agent-linux-x64-2.210.1-unity4 -R +./config.sh --url https://tfs.intra.infineon.com/tfs/manufacturingit --pool Mesa-Linux --auth negotiate --userName infineon@phares +./config.sh --url https://tfs.intra.infineon.com/tfs/manufacturingit --pool Mesa-Linux --auth pat --token asdf +``` + +```bash +sudo -i +echo >/etc/systemd/system/vsts-agent-linux.service && nano /etc/systemd/system/vsts-agent-linux.service +``` + +```conf +[Unit] +Description=vsts-agent-linux +After=multi-user.target +[Service] +User=unity4 +WorkingDirectory= /home/unity4/vsts-agent-linux-x64-2.210.1-unity4 +ExecStart=/home/unity4/vsts-agent-linux-x64-2.210.1-unity4/run.sh +Restart=always +[Install] +WantedBy=multi-user.target +``` + +```bash +systemctl daemon-reload +systemctl enable vsts-agent-linux.service +systemctl start vsts-agent-linux.service +systemctl status vsts-agent-linux.service +systemctl stop vsts-agent-linux.service +journalctl -fu vsts-agent-linux.service +journalctl --rotate +journalctl --vacuum-time=1s +``` diff --git a/.kanbn/tasks/configure-ufw.md b/.kanbn/tasks/configure-ufw.md index 5d66850..bf8ec6e 100644 --- a/.kanbn/tasks/configure-ufw.md +++ b/.kanbn/tasks/configure-ufw.md @@ -1,4 +1,8 @@ --- +status: "4-Done" +created: "2023-07-25T17:31:10.375Z" +updated: "2023-07-27T18:05:52.733Z" +type: "kanbn" --- # configure-ufw @@ -36,6 +40,7 @@ ufw enable ufw status numbered ufw disable ``` + ```conf Status: active diff --git a/.kanbn/tasks/create-as-service.md b/.kanbn/tasks/create-as-service.md index 6fd6437..56e0798 100644 --- a/.kanbn/tasks/create-as-service.md +++ b/.kanbn/tasks/create-as-service.md @@ -1,4 +1,8 @@ --- +status: "4-Done" +created: "2023-06-06T02:52:34.344Z" +updated: "2023-07-27T18:05:52.738Z" +type: "kanbn" --- # Create as Service @@ -7,6 +11,7 @@ sudo -i echo >/etc/systemd/system/barcode-host.service && nano /etc/systemd/system/barcode-host.service ``` + ```conf [Unit] Description=Barcode Server @@ -22,6 +27,7 @@ Environment=ASPNETCORE_ENVIRONMENT=Production [Install] WantedBy=multi-user.target ``` + ```bash systemctl daemon-reload systemctl enable barcode-host.service diff --git a/.kanbn/tasks/epi-pro-scan.md b/.kanbn/tasks/epi-pro-scan.md index 2941d95..9674ceb 100644 --- a/.kanbn/tasks/epi-pro-scan.md +++ b/.kanbn/tasks/epi-pro-scan.md @@ -1,9 +1,14 @@ --- +status: "2-Todo" +created: "2023-07-25T17:33:20.243Z" +updated: "2023-07-27T18:05:52.708Z" +type: "kanbn" --- # epi-pro-scan ```bash + ``` ## Sub-tasks diff --git a/.kanbn/tasks/install-net-7-0.md b/.kanbn/tasks/install-net-7-0.md index 2046bcc..a5aee72 100644 --- a/.kanbn/tasks/install-net-7-0.md +++ b/.kanbn/tasks/install-net-7-0.md @@ -1,4 +1,8 @@ --- +status: "4-Done" +created: "2023-06-06T02:52:34.346Z" +updated: "2023-07-27T18:05:52.739Z" +type: "kanbn" --- # Install .net 7.0 diff --git a/.kanbn/tasks/install-ubuntu-frame.md b/.kanbn/tasks/install-ubuntu-frame.md index f925493..9b0d78a 100644 --- a/.kanbn/tasks/install-ubuntu-frame.md +++ b/.kanbn/tasks/install-ubuntu-frame.md @@ -1,4 +1,8 @@ --- +status: "4-Done" +created: "2023-06-06T02:52:34.347Z" +updated: "2023-07-27T18:05:52.740Z" +type: "kanbn" --- # install-ubuntu-frame diff --git a/.kanbn/tasks/install-vscode-extensions.md b/.kanbn/tasks/install-vscode-extensions.md index 6a11956..39ece4e 100644 --- a/.kanbn/tasks/install-vscode-extensions.md +++ b/.kanbn/tasks/install-vscode-extensions.md @@ -1,4 +1,8 @@ --- +status: "4-Done" +created: "2023-06-06T02:52:34.348Z" +updated: "2023-07-27T18:05:52.741Z" +type: "kanbn" --- # install-vscode-extensions diff --git a/.kanbn/tasks/netplan.md b/.kanbn/tasks/netplan.md index d2af17a..6f6fa02 100644 --- a/.kanbn/tasks/netplan.md +++ b/.kanbn/tasks/netplan.md @@ -1,4 +1,8 @@ --- +status: "1-Backlog" +created: "2023-06-23T22:41:35.814Z" +updated: "2023-07-27T18:05:52.707Z" +type: "kanbn" --- # netplan @@ -6,6 +10,7 @@ ```bash ip link ``` + ```echo 1: lo: mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 @@ -13,12 +18,14 @@ ip link link/ether 6c:0b:84:e3:94:11 brd ff:ff:ff:ff:ff:ff altname enp0s31f6 ``` + ```bash https://ubuntu.com/server/docs/network-configuration ip a ip address show eno1 echo >/etc/netplan/99_config.yaml && nano /etc/netplan/99_config.yaml ``` + ```bash network: version: 2 @@ -33,6 +40,7 @@ network: nameservers: addresses: [192.168.0.1, 8.8.8.8, 4.4.4.4] ``` + ```bash network: version: 2 @@ -47,11 +55,13 @@ network: nameservers: addresses: [192.168.0.1, 8.8.8.8, 4.4.4.4] ``` + ```bash netplan apply ip addr flush eno1 # soft reset ``` + ```bash network: version: 2 @@ -66,6 +76,7 @@ network: nameservers: addresses: [10.95.128.11, 10.64.152.171, 8.8.8.8, 4.4.4.4] ``` + ```bash network: version: 2 diff --git a/.kanbn/tasks/post-only-once.md b/.kanbn/tasks/post-only-once.md index b5a3f7e..6973123 100644 --- a/.kanbn/tasks/post-only-once.md +++ b/.kanbn/tasks/post-only-once.md @@ -1,4 +1,8 @@ --- +status: "3-In Progress" +created: "2023-07-25T17:33:20.245Z" +updated: "2023-07-27T18:05:52.709Z" +type: "kanbn" --- # post-only-once diff --git a/.kanbn/tasks/publish.md b/.kanbn/tasks/publish.md index 2bd2d29..f6a291a 100644 --- a/.kanbn/tasks/publish.md +++ b/.kanbn/tasks/publish.md @@ -1,4 +1,8 @@ --- +status: "3-In Progress" +created: "2023-07-25T17:31:10.379Z" +updated: "2023-07-27T18:05:52.711Z" +type: "kanbn" --- # publish diff --git a/.kanbn/tasks/pull-repo.md b/.kanbn/tasks/pull-repo.md index e7e092e..da42997 100644 --- a/.kanbn/tasks/pull-repo.md +++ b/.kanbn/tasks/pull-repo.md @@ -1,4 +1,8 @@ --- +status: "4-Done" +created: "2023-06-06T02:52:34.351Z" +updated: "2023-07-27T18:05:52.742Z" +type: "kanbn" --- # Pull Repo diff --git a/.kanbn/tasks/roll-out.md b/.kanbn/tasks/roll-out.md index dca3f20..14fed8e 100644 --- a/.kanbn/tasks/roll-out.md +++ b/.kanbn/tasks/roll-out.md @@ -1,4 +1,8 @@ --- +status: "3-In Progress" +created: "2023-06-08T20:40:12.526Z" +updated: "2023-07-27T18:05:52.712Z" +type: "kanbn" --- # roll-out diff --git a/.kanbn/tasks/run-secrets-task.md b/.kanbn/tasks/run-secrets-task.md index 7411052..4342437 100644 --- a/.kanbn/tasks/run-secrets-task.md +++ b/.kanbn/tasks/run-secrets-task.md @@ -1,4 +1,8 @@ --- +status: "4-Done" +created: "2023-07-25T18:25:05.485Z" +updated: "2023-07-27T18:05:52.743Z" +type: "kanbn" --- # run-secrets-task diff --git a/.kanbn/tasks/run-test-ports.md b/.kanbn/tasks/run-test-ports.md index 2f8df51..c8dd93b 100644 --- a/.kanbn/tasks/run-test-ports.md +++ b/.kanbn/tasks/run-test-ports.md @@ -1,4 +1,8 @@ --- +status: "4-Done" +created: "2023-06-06T02:52:34.353Z" +updated: "2023-07-27T18:05:52.744Z" +type: "kanbn" --- # run-test-ports @@ -6,9 +10,11 @@ ```bash ls -l /dev/ttyUSB* ``` + ```echo # crw-rw---- 1 root dialout 188, 0 Jun 3 14:54 /dev/ttyUSB0 ``` + ```bash sudo -i adduser unity4 dialout diff --git a/.kanbn/tasks/self-signed-certificate.md b/.kanbn/tasks/self-signed-certificate.md index 93e07d0..ae84887 100644 --- a/.kanbn/tasks/self-signed-certificate.md +++ b/.kanbn/tasks/self-signed-certificate.md @@ -1,4 +1,8 @@ --- +status: "3-In Progress" +created: "2023-07-25T17:31:10.382Z" +updated: "2023-07-27T18:05:52.713Z" +type: "kanbn" --- # self-signed-certificate @@ -7,6 +11,7 @@ sudo -i echo >/etc/hosts && nano /etc/hosts ``` + ```conf 127.0.0.1 localhost 127.0.1.1 unity4 @@ -17,6 +22,7 @@ echo >/etc/hosts && nano /etc/hosts 10.95.176.46 eaf-dev.mes.infineon.com 10.95.128.35 eaf-prod.mes.infineon.com 10.95.128.34 eaf-staging.mes.infineon.com +10.95.128.122 oi-prod-ec-api.mes.infineon.com 10.95.176.124 eaf-dev-reporting.mes.infineon.com 10.95.128.37 oi-metrology-viewer-prod.mes.infineon.com # The following lines are desirable for IPv6 capable hosts @@ -26,6 +32,7 @@ ff00::0 ip6-mcastprefix ff02::1 ip6-allnodes ff02::2 ip6-allrouters ``` + ```bash sudo -i apt-get install -y ca-certificates diff --git a/.kanbn/tasks/setup-nginx.md b/.kanbn/tasks/setup-nginx.md index 5c4eb1e..c63b1ae 100644 --- a/.kanbn/tasks/setup-nginx.md +++ b/.kanbn/tasks/setup-nginx.md @@ -1,4 +1,8 @@ --- +status: "4-Done" +created: "2023-06-08T20:40:12.528Z" +updated: "2023-07-27T18:05:52.745Z" +type: "kanbn" --- # setup-nginx @@ -6,6 +10,7 @@ ```bash echo >/etc/nginx/sites-available/default && nano /etc/nginx/sites-available/default ``` + ```conf server { listen 80 default_server; @@ -18,6 +23,7 @@ server { } } ``` + ```bash systemctl restart nginx lsof -i -P -n | grep LISTEN @@ -26,6 +32,7 @@ nginx -t nginx -s reload echo >/etc/nginx/sites-available/Barcode-Host-Server && nano /etc/nginx/sites-available/Barcode-Host-Server ``` + ```conf server { listen 80 default_server; @@ -38,9 +45,11 @@ server { } } ``` + ```bash echo >/home/unity4/localhost.conf && nano /home/unity4/localhost.conf ``` + ```conf [req] default_bits = 2048 @@ -75,11 +84,13 @@ DNS.1 = unity4 DNS.2 = localhost DNS.3 = 127.0.0.1 ``` + ```bash openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/nginx/localhost.key -out /etc/nginx/localhost.crt -config /home/unity4/localhost.conf ls /etc/nginx echo >/etc/nginx/sites-available/Barcode-Host-Server && nano /etc/nginx/sites-available/Barcode-Host-Server ``` + ```conf server { server_name _; @@ -99,6 +110,7 @@ server { } } ``` + ```bash ln -s /etc/nginx/sites-available/Barcode-Host-Server /etc/nginx/sites-enabled/Barcode-Host-Server nginx -t @@ -106,6 +118,7 @@ nginx -s reload links https://localhost/api/lastscan links https://unity4/api/lastscan ``` + ```conf # C:\Windows\System32\drivers\etc\hosts 192.168.0.204 unity4 diff --git a/.kanbn/tasks/signalr.md b/.kanbn/tasks/signalr.md index 2c881a1..5350536 100644 --- a/.kanbn/tasks/signalr.md +++ b/.kanbn/tasks/signalr.md @@ -1,4 +1,8 @@ --- +status: "5-Archive" +created: "2023-06-08T20:40:12.529Z" +updated: "2023-07-27T18:05:52.746Z" +type: "kanbn" --- # signalr diff --git a/.kanbn/tasks/update-os.md b/.kanbn/tasks/update-os.md index 5418067..88797c6 100644 --- a/.kanbn/tasks/update-os.md +++ b/.kanbn/tasks/update-os.md @@ -1,4 +1,8 @@ --- +status: "3-In Progress" +created: "2023-07-25T17:31:10.383Z" +updated: "2023-07-27T18:05:52.714Z" +type: "kanbn" --- # update-os diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..953fac5 --- /dev/null +++ b/.prettierignore @@ -0,0 +1,16 @@ +# to exclude Obsidian workspace settings (including plugin and hotkey configurations) +.obsidian/* +!.obsidian/hotkeys.json +!.obsidian/app.json +!.obsidian/community-plugins.json +!.obsidian/core-plugins.json +!.obsidian/graph.json +!.obsidian/appearance.json + +**/.vscode/* + +*.json + +*.zip + +Server/wwwroot/js/signalr/dist/browser/signalr.js \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json index def4683..5feb921 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,4 +1,8 @@ { + "files.eol": "\n", + "[markdown]": { + "editor.wordWrap": "off" + }, "cSpell.enabled": false, "thunder-client.saveToWorkspace": true, "thunder-client.workspaceRelativePath": ".vscode", @@ -7,6 +11,9 @@ "editor.wordWrap": "off" }, "files.exclude": { - "**/.git": false + "**/node_modules": true + }, + "files.watcherExclude": { + "**/node_modules": true } } \ No newline at end of file diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 05606b3..f8f4a21 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -165,6 +165,36 @@ "type": "shell", "command": "& Get-ChildItem . -include TestResults -Recurse | foreach ($_) { remove-item $_.fullname -Force -Recurse }", "problemMatcher": [] + }, + { + "label": "File-Folder-Helper AOT s Set metadata", + "type": "shell", + "command": "& L:/DevOps/Mesa_FI/File-Folder-Helper/bin/Release/net7.0/win-x64/publish/File-Folder-Helper.exe .kanbn", + "problemMatcher": [] + }, + { + "label": "File-Folder-Helper AOT s M tasks", + "type": "shell", + "command": "& L:/DevOps/Mesa_FI/File-Folder-Helper/bin/Release/net7.0/win-x64/publish/File-Folder-Helper.exe s M .kanbn/tasks", + "problemMatcher": [] + }, + { + "label": "Kanbn Console", + "type": "npm", + "script": "kanbn.board", + "problemMatcher": [] + }, + { + "label": "Kanbn Write Boad", + "type": "shell", + "command": "& kanbn board -j | L:/Git/kanbn2md/kanbn2md.exe >.kanbn/board.md", + "problemMatcher": [] + }, + { + "label": "Kanbn Write json", + "type": "npm", + "script": "kanbn.board.json", + "problemMatcher": [] } ] } \ No newline at end of file diff --git a/Barcode-Host.yml b/Barcode-Host.yml new file mode 100644 index 0000000..937f3ce --- /dev/null +++ b/Barcode-Host.yml @@ -0,0 +1,48 @@ +trigger: + branches: + include: + - master + paths: + include: + - "Server/*" + +pool: + name: Mesa-Linux + demands: Barcode-Host + +steps: + - script: | + echo $(Build.BuildId) + echo $(Build.Reason) + echo $(Build.Repository.Id) + echo $(Build.Repository.Name) + echo $(Build.SourceVersion) + displayName: "Echo Check" + + - script: "dotnet nuget locals all --clear" + displayName: "Nuget Clear" + enabled: false + + - script: | + dotnet user-secrets init + dotnet user-secrets set "BuildNumber" "$(Build.BuildId)" + dotnet user-secrets set "BuildSourceVersion" "$(Build.SourceVersion)" + dotnet user-secrets list + workingDirectory: Server + displayName: "Safe storage of app secrets - Server" + + - script: "dotnet build --configuration Release --source https://eaf-prod.mes.infineon.com/v3/index.json" + workingDirectory: Server + displayName: "Core Build - Server" + + - script: "systemctl stop barcode-host.service" + displayName: "stop barcode-host service" + enabled: false + + - script: "dotnet publish --configuration Release --output ~/Barcode-Host-$(Build.SourceVersion)-$(Build.BuildId)-Release --source https://eaf-prod.mes.infineon.com/v3/index.json" + workingDirectory: Server + displayName: "Core Publish - Server" + + - script: "systemctl start barcode-host.service" + displayName: "start barcode-host service" + enabled: false diff --git a/Server.Tests/UnitTestFileService.cs b/Server.Tests/UnitTestFileService.cs index ab9ae1d..cf0dec2 100644 --- a/Server.Tests/UnitTestFileService.cs +++ b/Server.Tests/UnitTestFileService.cs @@ -43,7 +43,7 @@ public class UnitTestFileService IServiceProvider serviceProvider = _WebApplicationFactory.Services.CreateScope().ServiceProvider; Server.Models.AppSettings appSettings = serviceProvider.GetRequiredService(); IFileService fileService = serviceProvider.GetRequiredService(); - Notification notification = new(KeyPressEvent: null, "Test"); + Notification notification = new(KeyPressEvent: null, "Test", null); fileService.Write(appSettings.EquipmentName, appSettings.FileShare, calendar: null, notification); _Logger.Information($"{_TestContext?.TestName} completed"); NonThrowTryCatch(); diff --git a/Server.Tests/UnitTestPostService.cs b/Server.Tests/UnitTestPostService.cs index 3b0e2c9..bab866e 100644 --- a/Server.Tests/UnitTestPostService.cs +++ b/Server.Tests/UnitTestPostService.cs @@ -44,7 +44,7 @@ public class UnitTestPostService IServiceProvider serviceProvider = _WebApplicationFactory.Services.CreateScope().ServiceProvider; Server.Models.AppSettings appSettings = serviceProvider.GetRequiredService(); IPostService postService = serviceProvider.GetRequiredService(); - Notification notification = new(KeyPressEvent: null, "Test"); + Notification notification = new(KeyPressEvent: null, "Test", null); _ = postService.Post(appSettings.PostTo, httpClient, notification); _Logger.Information($"{_TestContext?.TestName} completed"); NonThrowTryCatch(); diff --git a/Server/HostedService/TimedHostedService.cs b/Server/HostedService/TimedHostedService.cs index b0397ab..734aa8f 100644 --- a/Server/HostedService/TimedHostedService.cs +++ b/Server/HostedService/TimedHostedService.cs @@ -68,7 +68,7 @@ public class TimedHostedService : IHostedService, IAggregateInputReader, IDispos string? methodName = IMethodName.GetActualAsyncMethodName(); using (LogContext.PushProperty("MethodName", methodName)) { - _Logger.LogInformation($"Timed Hosted Service: {_AppSettings.GitCommitSeven}:{Environment.ProcessId} running."); + _Logger.LogInformation($"Timed Hosted Service: {_AppSettings.BuildSourceVersion}:{Environment.ProcessId} running."); if (!string.IsNullOrEmpty(_AppSettings.SerialPortName)) _SerialService.Open(); #if Linux @@ -98,7 +98,7 @@ public class TimedHostedService : IHostedService, IAggregateInputReader, IDispos string? methodName = IMethodName.GetActualAsyncMethodName(); using (LogContext.PushProperty("MethodName", methodName)) { - _Logger.LogInformation($"Timed Hosted Service: {_AppSettings.GitCommitSeven}:{Environment.ProcessId} is stopping."); + _Logger.LogInformation($"Timed Hosted Service: {_AppSettings.BuildSourceVersion}:{Environment.ProcessId} is stopping."); for (short i = 0; i < short.MaxValue; i++) { Thread.Sleep(500); diff --git a/Server/Models/AppSettings.cs b/Server/Models/AppSettings.cs index 94ee40a..8a2e808 100644 --- a/Server/Models/AppSettings.cs +++ b/Server/Models/AppSettings.cs @@ -3,6 +3,7 @@ using System.Text.Json; namespace Barcode.Host.Server.Models; public record AppSettings(string BuildNumber, + string BuildSourceVersion, int ClearLastScanServiceAfter, string Company, string DeviceNameEndsWith, @@ -10,7 +11,6 @@ public record AppSettings(string BuildNumber, int ExpectedScanLengthA, int ExpectedScanLengthB, string FileShare, - string GitCommitSeven, bool IsDevelopment, bool IsStaging, string LinuxDevicePath, diff --git a/Server/Models/Binder/AppSettings.cs b/Server/Models/Binder/AppSettings.cs index 3e29a00..86bafb8 100644 --- a/Server/Models/Binder/AppSettings.cs +++ b/Server/Models/Binder/AppSettings.cs @@ -9,6 +9,7 @@ public class AppSettings #nullable disable [Display(Name = "Build Number"), Required] public string BuildNumber { get; set; } + [Display(Name = "Build Source Version"), Required] public string BuildSourceVersion { get; set; } [Display(Name = "Last Scan Service Clear After"), Required] public int? ClearLastScanServiceAfter { get; set; } [Display(Name = "Company"), Required] public string Company { get; set; } [Display(Name = "Device Name Ends With"), Required] public string DeviceNameEndsWith { get; set; } @@ -16,7 +17,6 @@ public class AppSettings [Display(Name = "ExpectedScanLengthA"), Required] public int? ExpectedScanLengthA { get; set; } [Display(Name = "ExpectedScanLengthB"), Required] public int? ExpectedScanLengthB { get; set; } [Display(Name = "File Share"), Required] public string FileShare { get; set; } - [Display(Name = "Git Commit Seven"), Required] public string GitCommitSeven { get; set; } [Display(Name = "Is Development"), Required] public bool? IsDevelopment { get; set; } [Display(Name = "Is Staging"), Required] public bool? IsStaging { get; set; } [Display(Name = "Linux Device Path"), Required] public string LinuxDevicePath { get; set; } @@ -62,8 +62,8 @@ public class AppSettings throw new NullReferenceException(nameof(ExpectedScanLengthB)); if (appSettings.FileShare is null) throw new NullReferenceException(nameof(FileShare)); - if (appSettings.GitCommitSeven is null) - throw new NullReferenceException(nameof(GitCommitSeven)); + 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) @@ -96,6 +96,7 @@ public class AppSettings throw new NullReferenceException(nameof(WriteToSerialEvery)); result = new( appSettings.BuildNumber, + appSettings.BuildSourceVersion, appSettings.ClearLastScanServiceAfter.Value, appSettings.Company, appSettings.DeviceNameEndsWith, @@ -103,7 +104,6 @@ public class AppSettings appSettings.ExpectedScanLengthA.Value, appSettings.ExpectedScanLengthB.Value, appSettings.FileShare, - appSettings.GitCommitSeven, appSettings.IsDevelopment.Value, appSettings.IsStaging.Value, appSettings.LinuxDevicePath, diff --git a/Server/Pages/Notification.cshtml b/Server/Pages/Notification.cshtml index e17d036..ffa9fa3 100644 --- a/Server/Pages/Notification.cshtml +++ b/Server/Pages/Notification.cshtml @@ -1,20 +1,59 @@ @page + +@model NotificationModel +
+
+
+

+
+
+

 

+

 

+

 

Scan RDS barcode before starting BioRad

+

 

+

 

+

 

+

 

+

 

+

 

+
+
+

+
+
+

 

+

 

+

 

+
+
+

+
+
+

 

+

 

+

 

- - \ No newline at end of file + + + \ No newline at end of file diff --git a/Server/Pages/Notification.cshtml.cs b/Server/Pages/Notification.cshtml.cs index 611cb71..93bd69b 100644 --- a/Server/Pages/Notification.cshtml.cs +++ b/Server/Pages/Notification.cshtml.cs @@ -1,16 +1,22 @@ -using Microsoft.AspNetCore.Mvc.RazorPages; +using Barcode.Host.Server.Models; +using Microsoft.AspNetCore.Mvc.RazorPages; namespace Barcode.Host.Server.Pages; public class NotificationModel : PageModel { + + public AppSettings AppSettings { get; } private readonly ILogger _Logger; - public NotificationModel(ILogger logger) => + public NotificationModel(ILogger logger, AppSettings appSettings) + { _Logger = logger; + AppSettings = appSettings; + } public void OnGet() { - } + } diff --git a/Server/Pages/Shared/_Layout.cshtml.css b/Server/Pages/Shared/_Layout.cshtml.css index a72cbea..737d578 100644 --- a/Server/Pages/Shared/_Layout.cshtml.css +++ b/Server/Pages/Shared/_Layout.cshtml.css @@ -17,7 +17,8 @@ a { border-color: #1861ac; } -.nav-pills .nav-link.active, .nav-pills .show > .nav-link { +.nav-pills .nav-link.active, +.nav-pills .show > .nav-link { color: #fff; background-color: #1b6ec2; border-color: #1861ac; @@ -31,7 +32,7 @@ a { } .box-shadow { - box-shadow: 0 .25rem .75rem rgba(0, 0, 0, .05); + box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.05); } button.accept-policy { diff --git a/Server/wwwroot/css/site.css b/Server/wwwroot/css/site.css index f8d98fc..25ef143 100644 --- a/Server/wwwroot/css/site.css +++ b/Server/wwwroot/css/site.css @@ -8,8 +8,14 @@ html { } } -.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus { - box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb; +.btn:focus, +.btn:active:focus, +.btn-link.nav-link:focus, +.form-control:focus, +.form-check-input:focus { + box-shadow: + 0 0 0 0.1rem white, + 0 0 0 0.25rem #258cfb; } html { @@ -19,4 +25,4 @@ html { body { margin-bottom: 60px; -} \ No newline at end of file +} diff --git a/Server/wwwroot/js/notification.js b/Server/wwwroot/js/notification.js index 6ed5b43..3d0a085 100644 --- a/Server/wwwroot/js/notification.js +++ b/Server/wwwroot/js/notification.js @@ -1,19 +1,56 @@ "use strict"; -var connection = new signalR.HubConnectionBuilder().withUrl("/NotificationHub").build(); +var connection = new signalR.HubConnectionBuilder() + .withUrl("/NotificationHub") + .build(); connection.on("NotifyAll", function (data) { - if (data.keyPressEvent && data.lastScanServiceResultValue) { - var innerText = `${data.keyPressEvent.dateTime} - [${data.lastScanServiceResultValue}]`; - document.getElementById("lastScanServiceResultValue").innerText = innerText; + if (!data.keyPressEvent || !data.lastScanServiceResultValue) { + if (!data.httpContentBody) { + document.getElementById("lastScanServiceResultValue").innerText = ""; } - else if (data.httpContentBody) { - var innerText = `${data.httpContentBody}]`; //JSON.parse() // JSON.stringify() - document.getElementById("httpContentBody").innerText = innerText; + } else { + var innerText = `${data.keyPressEvent.dateTime} - [${data.lastScanServiceResultValue}]`; + document.getElementById("lastScanServiceResultValue").innerText = innerText; + } + if (!data.httpContentBody) { + if (!data.keyPressEvent || !data.lastScanServiceResultValue) { + document.getElementById("httpContentBody").innerText = data; + document.getElementById("mId").innerText = ""; + document.getElementById("recipe").innerText = ""; } + } else { + document.getElementById("httpContentBody").innerText = data.httpContentBody; + var postResult = JSON.parse(data.httpContentBody); + if (!postResult.MId) { + document.getElementById("mId").innerText = ""; + } else { + document.getElementById( + "mId", + ).innerText = `Use ${postResult.MId} for the wafer and input id`; + } + if (!postResult.Recipe) { + document.getElementById("recipe").innerText = ""; + } else { + 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, + function (data) { + document.getElementById("recipe").innerText = + data.rds.rdsLayers.length; + }, + ); + } + } + } }); -connection.start().then(function () { -}).catch(function (err) { +connection + .start() + .then(function () {}) + .catch(function (err) { return console.error(err.toString()); -}); \ No newline at end of file + }); diff --git a/Shared/Models/Stateless/IAppSettingsRepository.cs b/Shared/Models/Stateless/IAppSettingsRepository.cs index a1082c6..045c75c 100644 --- a/Shared/Models/Stateless/IAppSettingsRepository.cs +++ b/Shared/Models/Stateless/IAppSettingsRepository.cs @@ -4,7 +4,7 @@ public interface IAppSettingsRepository { T GetAppSettings(); - string GetBuildNumberAndGitCommitSeven(); + string GetBuildNumberAndBuildSourceVersion(); void VerifyConnectionStrings(); } \ No newline at end of file diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..fe72192 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,27 @@ +{ + "name": "Barcode-Host", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "devDependencies": { + "prettier": "^3.0.0" + } + }, + "node_modules/prettier": { + "version": "3.0.0", + "resolved": "http://localhost:4873/prettier/-/prettier-3.0.0.tgz", + "integrity": "sha512-zBf5eHpwHOGPC47h0zrPyNn+eAEIdEzfywMoYn2XPi0P44Zp0tSq64rq0xAREh4auw2cJZHo9QUob+NqCQky4g==", + "dev": true, + "bin": { + "prettier": "bin/prettier.cjs" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..388d0e2 --- /dev/null +++ b/package.json @@ -0,0 +1,12 @@ +{ + "scripts": { + "prettier.check": "prettier . --check", + "prettier.write": "prettier . --write", + "kanbn.board": "kanbn board", + "kanbn.board.json": "kanbn board -j > .kanbn/board.json", + "garbage-collect": "git gc" + }, + "devDependencies": { + "prettier": "^3.0.0" + } +}