Compare commits
No commits in common. "b2eeb8cb3f3b51c62fdeeb71172a3196deac3bb9" and "7ce770404c911b40a94bbb0d67fd4d8cce93ba9d" have entirely different histories.
b2eeb8cb3f
...
7ce770404c
|
|
@ -1,66 +0,0 @@
|
||||||
# Build artifacts
|
|
||||||
**/bin/
|
|
||||||
**/obj/
|
|
||||||
**/out/
|
|
||||||
|
|
||||||
# Visual Studio files
|
|
||||||
**/.vs/
|
|
||||||
**/.vscode/
|
|
||||||
**/*.user
|
|
||||||
**/*.suo
|
|
||||||
**/*.userosscache
|
|
||||||
**/*.sln.docstates
|
|
||||||
|
|
||||||
# User-specific files
|
|
||||||
**/.user
|
|
||||||
**/.suo
|
|
||||||
**/.userosscache
|
|
||||||
|
|
||||||
# Build results
|
|
||||||
[Dd]ebug/
|
|
||||||
[Dd]ebugPublic/
|
|
||||||
[Rr]elease/
|
|
||||||
[Rr]eleases/
|
|
||||||
x64/
|
|
||||||
x86/
|
|
||||||
[Aa][Rr][Mm]/
|
|
||||||
[Aa][Rr][Mm]64/
|
|
||||||
bld/
|
|
||||||
[Bb]in/
|
|
||||||
[Oo]bj/
|
|
||||||
[Ll]og/
|
|
||||||
[Ll]ogs/
|
|
||||||
|
|
||||||
# NuGet packages
|
|
||||||
**/packages/
|
|
||||||
**/*.nupkg
|
|
||||||
**/*.snupkg
|
|
||||||
|
|
||||||
# Test results
|
|
||||||
**/[Tt]est[Rr]esult*/
|
|
||||||
**/[Bb]uild[Ll]og.*
|
|
||||||
|
|
||||||
# Docker files
|
|
||||||
Dockerfile*
|
|
||||||
docker-compose*
|
|
||||||
.dockerignore
|
|
||||||
|
|
||||||
# Git
|
|
||||||
.git/
|
|
||||||
.gitignore
|
|
||||||
.gitattributes
|
|
||||||
|
|
||||||
# IDE
|
|
||||||
.idea/
|
|
||||||
*.swp
|
|
||||||
*.swo
|
|
||||||
*~
|
|
||||||
|
|
||||||
# OS
|
|
||||||
.DS_Store
|
|
||||||
Thumbs.db
|
|
||||||
|
|
||||||
# Data and logs (will be mounted as volumes)
|
|
||||||
data/
|
|
||||||
logs/
|
|
||||||
|
|
||||||
57
Dockerfile
57
Dockerfile
|
|
@ -1,57 +0,0 @@
|
||||||
# Stage 1: Build
|
|
||||||
# Note: Project files specify net10.0, but using .NET 9.0 based on package versions (9.0.9)
|
|
||||||
# Adjust version if needed: 8.0 (LTS), 9.0 (current), or future 10.0
|
|
||||||
FROM mcr.microsoft.com/dotnet/aspnet:10.0 AS base
|
|
||||||
WORKDIR /app
|
|
||||||
|
|
||||||
FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build
|
|
||||||
WORKDIR /src
|
|
||||||
|
|
||||||
# Copy solution file
|
|
||||||
COPY RobotApp.sln .
|
|
||||||
|
|
||||||
# Copy project files
|
|
||||||
COPY RobotApp/RobotApp.csproj RobotApp/
|
|
||||||
COPY RobotApp.Client/RobotApp.Client.csproj RobotApp.Client/
|
|
||||||
COPY RobotApp.Common.Shares/RobotApp.Common.Shares.csproj RobotApp.Common.Shares/
|
|
||||||
COPY RobotApp.VDA5050/RobotApp.VDA5050.csproj RobotApp.VDA5050/
|
|
||||||
|
|
||||||
# Restore dependencies
|
|
||||||
RUN dotnet restore RobotApp.sln
|
|
||||||
|
|
||||||
# Copy all source files
|
|
||||||
COPY RobotApp/ RobotApp/
|
|
||||||
COPY RobotApp.Client/ RobotApp.Client/
|
|
||||||
COPY RobotApp.Common.Shares/ RobotApp.Common.Shares/
|
|
||||||
COPY RobotApp.VDA5050/ RobotApp.VDA5050/
|
|
||||||
|
|
||||||
RUN rm -rf ./RobotApp/RobotApp/bin
|
|
||||||
RUN rm -rf ./RobotApp/RobotApp/obj
|
|
||||||
RUN rm -rf ./RobotApp.Client/RobotApp.Client/bin
|
|
||||||
RUN rm -rf ./RobotApp.Client/RobotApp.Client/obj
|
|
||||||
RUN rm -rf ./RobotApp.Common.Shares/RobotApp.Common.Shares/bin
|
|
||||||
RUN rm -rf ./RobotApp.Common.Shares/RobotApp.Common.Shares/obj
|
|
||||||
RUN rm -rf ./RobotApp.VDA5050/RobotApp.VDA5050/bin
|
|
||||||
RUN rm -rf ./RobotApp.VDA5050/RobotApp.VDA5050/obj
|
|
||||||
|
|
||||||
# Build the solution
|
|
||||||
WORKDIR /src/RobotApp
|
|
||||||
RUN dotnet build -c Release -o /app/build
|
|
||||||
|
|
||||||
# Stage 2: Publish
|
|
||||||
FROM build AS publish
|
|
||||||
WORKDIR /src/RobotApp
|
|
||||||
RUN dotnet publish -c Release -o /app/publish /p:UseAppHost=false
|
|
||||||
|
|
||||||
# Copy published files
|
|
||||||
FROM base AS final
|
|
||||||
WORKDIR /app
|
|
||||||
COPY --from=publish /app/publish ./
|
|
||||||
|
|
||||||
# Set environment variables
|
|
||||||
#ENV ASPNETCORE_URLS=http://+:8080
|
|
||||||
ENV ASPNETCORE_ENVIRONMENT=Production
|
|
||||||
|
|
||||||
# Run the application
|
|
||||||
ENTRYPOINT ["dotnet", "RobotApp.dll"]
|
|
||||||
|
|
||||||
|
|
@ -69,7 +69,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
public NavModel[] Navs = [
|
public NavModel[] Navs = [
|
||||||
new(){Icon = "mdi-view-dashboard", Path="/dashboard", Label = "Dashboard", Match = NavLinkMatch.All},
|
new(){Icon = "mdi-view-dashboard", Path="/", Label = "Dashboard", Match = NavLinkMatch.All},
|
||||||
// new(){Icon = "mdi-map-legend", Path="/maps-manager", Label = "Mapping", Match = NavLinkMatch.All},
|
// new(){Icon = "mdi-map-legend", Path="/maps-manager", Label = "Mapping", Match = NavLinkMatch.All},
|
||||||
new(){Icon = "mdi-monitor", Path="/robot-monitor", Label = "Robot Monitor", Match = NavLinkMatch.All},
|
new(){Icon = "mdi-monitor", Path="/robot-monitor", Label = "Robot Monitor", Match = NavLinkMatch.All},
|
||||||
new(){Icon = "mdi-state-machine", Path="/robot-order", Label = "order", Match = NavLinkMatch.All},
|
new(){Icon = "mdi-state-machine", Path="/robot-order", Label = "order", Match = NavLinkMatch.All},
|
||||||
|
|
|
||||||
|
|
@ -5,11 +5,12 @@
|
||||||
@using MudBlazor
|
@using MudBlazor
|
||||||
|
|
||||||
@implements IDisposable
|
@implements IDisposable
|
||||||
|
@attribute [Authorize]
|
||||||
|
|
||||||
@inject RobotStateClient RobotStateClient
|
@inject RobotStateClient RobotStateClient
|
||||||
@rendermode InteractiveWebAssemblyNoPrerender
|
@rendermode InteractiveWebAssemblyNoPrerender
|
||||||
|
|
||||||
<MudContainer MaxWidth="MaxWidth.False" Class="pa-4" Style="overflow-y:auto">
|
<MudContainer MaxWidth="MaxWidth.False" Class="pa-4">
|
||||||
<!-- Header Dashboard -->
|
<!-- Header Dashboard -->
|
||||||
<MudPaper Class="pa-6 mb-4 d-flex align-center justify-space-between" Elevation="3">
|
<MudPaper Class="pa-6 mb-4 d-flex align-center justify-space-between" Elevation="3">
|
||||||
<div>
|
<div>
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
@page "/logs"
|
@page "/logs"
|
||||||
@rendermode InteractiveWebAssemblyNoPrerender
|
@rendermode InteractiveWebAssemblyNoPrerender
|
||||||
|
@attribute [Authorize]
|
||||||
|
|
||||||
@using Microsoft.AspNetCore.Components.WebAssembly.Authentication
|
@using Microsoft.AspNetCore.Components.WebAssembly.Authentication
|
||||||
@using RobotApp.Client.Models
|
@using RobotApp.Client.Models
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,8 @@
|
||||||
|
|
||||||
@rendermode InteractiveWebAssemblyNoPrerender
|
@rendermode InteractiveWebAssemblyNoPrerender
|
||||||
|
|
||||||
|
@attribute [Authorize]
|
||||||
|
|
||||||
<PageTitle>Map Manager</PageTitle>
|
<PageTitle>Map Manager</PageTitle>
|
||||||
|
|
||||||
<div class="d-flex w-100 h-100 p-2 overflow-hidden flex-row">
|
<div class="d-flex w-100 h-100 p-2 overflow-hidden flex-row">
|
||||||
|
|
|
||||||
|
|
@ -47,10 +47,8 @@
|
||||||
|
|
||||||
<div class="flex-grow-1">
|
<div class="flex-grow-1">
|
||||||
<MudTextField Value="@OrderJson"
|
<MudTextField Value="@OrderJson"
|
||||||
T="string"
|
ReadOnly
|
||||||
ValueChanged="OrderJsonChange"
|
|
||||||
Variant="Variant.Filled"
|
Variant="Variant.Filled"
|
||||||
Immediate=true
|
|
||||||
Lines="50"
|
Lines="50"
|
||||||
Style="font-family: 'Roboto Mono', Consolas, monospace;
|
Style="font-family: 'Roboto Mono', Consolas, monospace;
|
||||||
font-size: 0.85rem;
|
font-size: 0.85rem;
|
||||||
|
|
@ -66,8 +64,6 @@
|
||||||
[Parameter] public bool DisableCancel { get; set; }
|
[Parameter] public bool DisableCancel { get; set; }
|
||||||
[Parameter] public bool? CancelSuccess { get; set; }
|
[Parameter] public bool? CancelSuccess { get; set; }
|
||||||
|
|
||||||
[Parameter] public EventCallback<string> OrderJsonChanged { get; set; }
|
|
||||||
|
|
||||||
[Parameter] public EventCallback OnCopy { get; set; }
|
[Parameter] public EventCallback OnCopy { get; set; }
|
||||||
[Parameter] public EventCallback OnSend { get; set; }
|
[Parameter] public EventCallback OnSend { get; set; }
|
||||||
[Parameter] public EventCallback OnImport { get; set; }
|
[Parameter] public EventCallback OnImport { get; set; }
|
||||||
|
|
@ -121,11 +117,4 @@
|
||||||
_ => Icons.Material.Filled.Cancel
|
_ => Icons.Material.Filled.Cancel
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
private void OrderJsonChange(string value)
|
|
||||||
{
|
|
||||||
OrderJson = value;
|
|
||||||
OrderJsonChanged.InvokeAsync(OrderJson);
|
|
||||||
StateHasChanged();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
@page "/robot-order"
|
@page "/robot-order"
|
||||||
|
|
||||||
|
@attribute [Authorize]
|
||||||
@rendermode InteractiveWebAssemblyNoPrerender
|
@rendermode InteractiveWebAssemblyNoPrerender
|
||||||
|
|
||||||
@using System.Text.Json
|
@using System.Text.Json
|
||||||
|
|
@ -45,7 +46,7 @@
|
||||||
|
|
||||||
<!-- ================= RIGHT ================= -->
|
<!-- ================= RIGHT ================= -->
|
||||||
<MudItem xs="12" md="5" Class="h-100">
|
<MudItem xs="12" md="5" Class="h-100">
|
||||||
<JsonOutputPanel @bind-OrderJson="@OrderJson"
|
<JsonOutputPanel OrderJson="@OrderJson"
|
||||||
Copied="@copied"
|
Copied="@copied"
|
||||||
SendSuccess="@sendSuccess"
|
SendSuccess="@sendSuccess"
|
||||||
CancelSuccess="@cancelSuccess"
|
CancelSuccess="@cancelSuccess"
|
||||||
|
|
@ -227,7 +228,7 @@
|
||||||
sendSuccess = response.IsSuccessStatusCode;
|
sendSuccess = response.IsSuccessStatusCode;
|
||||||
|
|
||||||
}
|
}
|
||||||
catch
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
sendSuccess = false;
|
sendSuccess = false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
@page "/robot-config"
|
@page "/robot-config"
|
||||||
@rendermode InteractiveWebAssemblyNoPrerender
|
@rendermode InteractiveWebAssemblyNoPrerender
|
||||||
|
@attribute [Authorize]
|
||||||
|
|
||||||
@inject HttpClient Http
|
@inject HttpClient Http
|
||||||
@inject ISnackbar Snackbar
|
@inject ISnackbar Snackbar
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
@page "/robot-monitor"
|
@page "/robot-monitor"
|
||||||
@rendermode InteractiveWebAssemblyNoPrerender
|
@rendermode InteractiveWebAssemblyNoPrerender
|
||||||
|
@attribute [Authorize]
|
||||||
@inject RobotApp.Client.Services.RobotMonitorService MonitorService
|
@inject RobotApp.Client.Services.RobotMonitorService MonitorService
|
||||||
@implements IAsyncDisposable
|
@implements IAsyncDisposable
|
||||||
|
|
||||||
|
|
@ -38,6 +39,3 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -58,5 +58,3 @@ window.robotMonitor = {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,8 @@
|
||||||
|
|
||||||
@rendermode InteractiveServer
|
@rendermode InteractiveServer
|
||||||
|
|
||||||
|
@attribute [Authorize]
|
||||||
|
|
||||||
@inject NavigationManager Nav
|
@inject NavigationManager Nav
|
||||||
|
|
||||||
@code
|
@code
|
||||||
|
|
|
||||||
|
|
@ -6,8 +6,7 @@ namespace RobotApp.Controllers;
|
||||||
|
|
||||||
[Route("api/[controller]")]
|
[Route("api/[controller]")]
|
||||||
[ApiController]
|
[ApiController]
|
||||||
//[Authorize]
|
[Authorize]
|
||||||
[AllowAnonymous]
|
|
||||||
public class FileController(Services.Logger<FileController> Logger) : ControllerBase
|
public class FileController(Services.Logger<FileController> Logger) : ControllerBase
|
||||||
{
|
{
|
||||||
private readonly string certificatesPath = "MqttCertificates";
|
private readonly string certificatesPath = "MqttCertificates";
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,6 @@ namespace RobotApp.Controllers;
|
||||||
|
|
||||||
[Route("api/[controller]")]
|
[Route("api/[controller]")]
|
||||||
[ApiController]
|
[ApiController]
|
||||||
//[Authorize]
|
|
||||||
[AllowAnonymous]
|
[AllowAnonymous]
|
||||||
public class ImagesController(Services.Logger<ImagesController> Logger) : ControllerBase
|
public class ImagesController(Services.Logger<ImagesController> Logger) : ControllerBase
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -5,8 +5,7 @@ namespace RobotApp.Controllers;
|
||||||
|
|
||||||
[Route("api/[controller]")]
|
[Route("api/[controller]")]
|
||||||
[ApiController]
|
[ApiController]
|
||||||
//[Authorize]
|
[Authorize]
|
||||||
[AllowAnonymous]
|
|
||||||
public class LogsManagerController(Services.Logger<LogsManagerController> Logger) : ControllerBase
|
public class LogsManagerController(Services.Logger<LogsManagerController> Logger) : ControllerBase
|
||||||
{
|
{
|
||||||
private readonly string LoggerDirectory = "logs";
|
private readonly string LoggerDirectory = "logs";
|
||||||
|
|
|
||||||
|
|
@ -1,21 +1,18 @@
|
||||||
using Microsoft.AspNetCore.Authorization;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
|
||||||
using RobotApp.Interfaces;
|
using RobotApp.Interfaces;
|
||||||
using RobotApp.VDA5050.Order;
|
using RobotApp.VDA5050.Order;
|
||||||
using System.Text.Json;
|
|
||||||
|
|
||||||
namespace RobotApp.Controllers;
|
namespace RobotApp.Controllers;
|
||||||
|
|
||||||
[ApiController]
|
[ApiController]
|
||||||
[Route("api/order")]
|
[Route("api/order")]
|
||||||
//[Authorize]
|
public class OrderController( IOrder robotOrderController, IInstantActions instantActions) : ControllerBase
|
||||||
[AllowAnonymous]
|
|
||||||
public class OrderController(IOrder robotOrderController, IInstantActions instantActions) : ControllerBase
|
|
||||||
{
|
{
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
public IActionResult SendOrder([FromBody] OrderMsg order)
|
public IActionResult SendOrder([FromBody] OrderMsg order)
|
||||||
{
|
{
|
||||||
robotOrderController.UpdateOrder(order);
|
robotOrderController.UpdateOrder(order);
|
||||||
|
|
||||||
return Ok(new
|
return Ok(new
|
||||||
{
|
{
|
||||||
success = true,
|
success = true,
|
||||||
|
|
|
||||||
|
|
@ -10,8 +10,7 @@ namespace RobotApp.Controllers;
|
||||||
|
|
||||||
[Route("api/[controller]")]
|
[Route("api/[controller]")]
|
||||||
[ApiController]
|
[ApiController]
|
||||||
//[Authorize]
|
[Authorize]
|
||||||
[AllowAnonymous]
|
|
||||||
public class RobotConfigsController(Services.Logger<RobotConfigsController> Logger, ApplicationDbContext AppDb, RobotConfiguration RobotConfiguration) : ControllerBase
|
public class RobotConfigsController(Services.Logger<RobotConfigsController> Logger, ApplicationDbContext AppDb, RobotConfiguration RobotConfiguration) : ControllerBase
|
||||||
{
|
{
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
|
|
|
||||||
|
|
@ -125,7 +125,7 @@ public static class ApplicationDbExtensions
|
||||||
{
|
{
|
||||||
ConfigName = "Default",
|
ConfigName = "Default",
|
||||||
Description = "Default robot simulation configuration",
|
Description = "Default robot simulation configuration",
|
||||||
EnableSimulation = true,
|
EnableSimulation = false,
|
||||||
SimulationMaxVelocity = 1.5,
|
SimulationMaxVelocity = 1.5,
|
||||||
SimulationMaxAngularVelocity = 0.5,
|
SimulationMaxAngularVelocity = 0.5,
|
||||||
SimulationAcceleration = 2,
|
SimulationAcceleration = 2,
|
||||||
|
|
@ -155,7 +155,6 @@ public static class ApplicationDbExtensions
|
||||||
VDA5050EnableTls = false,
|
VDA5050EnableTls = false,
|
||||||
VDA5050UserName = "robotics",
|
VDA5050UserName = "robotics",
|
||||||
VDA5050Password = "robotics",
|
VDA5050Password = "robotics",
|
||||||
VDA5050TopicPrefix = "uagv/v2",
|
|
||||||
IsActive = true,
|
IsActive = true,
|
||||||
CreatedAt = DateTime.Now,
|
CreatedAt = DateTime.Now,
|
||||||
UpdatedAt = DateTime.Now,
|
UpdatedAt = DateTime.Now,
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ using RobotApp.Data;
|
||||||
namespace RobotApp.Data.Migrations
|
namespace RobotApp.Data.Migrations
|
||||||
{
|
{
|
||||||
[DbContext(typeof(ApplicationDbContext))]
|
[DbContext(typeof(ApplicationDbContext))]
|
||||||
[Migration("20251222091852_InitApplicationDb")]
|
[Migration("20251222025151_InitApplicationDb")]
|
||||||
partial class InitApplicationDb
|
partial class InitApplicationDb
|
||||||
{
|
{
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
|
|
@ -10,5 +10,3 @@ public class RobotMonitorHub : Hub
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,22 +6,22 @@
|
||||||
"dotnetRunMessages": true,
|
"dotnetRunMessages": true,
|
||||||
"launchBrowser": true,
|
"launchBrowser": true,
|
||||||
"workingDirectory": "$(TargetDir)",
|
"workingDirectory": "$(TargetDir)",
|
||||||
//"inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}",
|
"inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}",
|
||||||
"applicationUrl": "http://localhost:5229",
|
"applicationUrl": "http://localhost:5229",
|
||||||
"environmentVariables": {
|
"environmentVariables": {
|
||||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"https": {
|
||||||
|
"commandName": "Project",
|
||||||
|
"dotnetRunMessages": true,
|
||||||
|
"launchBrowser": true,
|
||||||
|
"workingDirectory": "$(TargetDir)",
|
||||||
|
//"inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}",
|
||||||
|
"applicationUrl": "https://0.0.0.0:7150;http://localhost:5229",
|
||||||
|
"environmentVariables": {
|
||||||
|
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
//"https": {
|
|
||||||
// "commandName": "Project",
|
|
||||||
// "dotnetRunMessages": true,
|
|
||||||
// "launchBrowser": true,
|
|
||||||
// "workingDirectory": "$(TargetDir)",
|
|
||||||
// //"inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}",
|
|
||||||
// "applicationUrl": "https://0.0.0.0:7150;http://localhost:5229",
|
|
||||||
// "environmentVariables": {
|
|
||||||
// "ASPNETCORE_ENVIRONMENT": "Development"
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -195,6 +195,17 @@ public class MQTTClient : IAsyncDisposable
|
||||||
arg.Chain.ChainPolicy.VerificationFlags = X509VerificationFlags.AllowUnknownCertificateAuthority;
|
arg.Chain.ChainPolicy.VerificationFlags = X509VerificationFlags.AllowUnknownCertificateAuthority;
|
||||||
|
|
||||||
var isValid = arg.Chain.Build((X509Certificate2)arg.Certificate);
|
var isValid = arg.Chain.Build((X509Certificate2)arg.Certificate);
|
||||||
|
|
||||||
|
if (isValid)
|
||||||
|
{
|
||||||
|
Console.WriteLine("Broker CERTIFICATE VALID");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Console.WriteLine("Broker CERTIFICATE INVALID");
|
||||||
|
foreach (var status in arg.Chain.ChainStatus)
|
||||||
|
Console.WriteLine($" -> Chain error: {status.Status} - {status.StatusInformation}");
|
||||||
|
}
|
||||||
return isValid;
|
return isValid;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -27,6 +27,7 @@ public class MQTTClientCertificatesProvider(string? CerFile, string? KeyFile) :
|
||||||
var cert = X509Certificate2.CreateFromPem(File.ReadAllText(certLocal), File.ReadAllText(keyLocal));
|
var cert = X509Certificate2.CreateFromPem(File.ReadAllText(certLocal), File.ReadAllText(keyLocal));
|
||||||
var pfxBytes = cert.Export(X509ContentType.Pfx);
|
var pfxBytes = cert.Export(X509ContentType.Pfx);
|
||||||
var pfxCert = X509CertificateLoader.LoadPkcs12(pfxBytes, "", X509KeyStorageFlags.Exportable | X509KeyStorageFlags.PersistKeySet);
|
var pfxCert = X509CertificateLoader.LoadPkcs12(pfxBytes, "", X509KeyStorageFlags.Exportable | X509KeyStorageFlags.PersistKeySet);
|
||||||
|
Console.WriteLine($"Client cert loaded: {pfxCert.Subject}, HasPrivateKey: {pfxCert.HasPrivateKey}, PrivateKey Type: {pfxCert.GetRSAPrivateKey()?.GetType()}");
|
||||||
return [pfxCert];
|
return [pfxCert];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -96,6 +96,7 @@ public abstract class RobotAction(IServiceProvider serviceProvider) : IDisposabl
|
||||||
|
|
||||||
protected virtual Task StopAction()
|
protected virtual Task StopAction()
|
||||||
{
|
{
|
||||||
|
Console.WriteLine($"StopAction {Type}");
|
||||||
Status = ActionStatus.FAILED;
|
Status = ActionStatus.FAILED;
|
||||||
ResultDescription = "Action bị hủy bỏ.";
|
ResultDescription = "Action bị hủy bỏ.";
|
||||||
return Task.CompletedTask;
|
return Task.CompletedTask;
|
||||||
|
|
|
||||||
|
|
@ -169,10 +169,15 @@ public class RobotStatePublisher : BackgroundService
|
||||||
isConnected, // payload only bool
|
isConnected, // payload only bool
|
||||||
stoppingToken
|
stoppingToken
|
||||||
);
|
);
|
||||||
|
|
||||||
|
Console.WriteLine(
|
||||||
|
$"[RobotStatePublisher] Robot connection changed → {(isConnected ? "ONLINE" : "OFFLINE")}"
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
Console.WriteLine(ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -158,12 +158,14 @@ public class SimulationNavigation : INavigation, IDisposable
|
||||||
|
|
||||||
public void Pause()
|
public void Pause()
|
||||||
{
|
{
|
||||||
|
Console.WriteLine($"Nav Pause");
|
||||||
ResumeState = State;
|
ResumeState = State;
|
||||||
NavState = NavigationState.Paused;
|
NavState = NavigationState.Paused;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Resume()
|
public void Resume()
|
||||||
{
|
{
|
||||||
|
Console.WriteLine($"Nav Resume");
|
||||||
NavState = ResumeState;
|
NavState = ResumeState;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,35 +0,0 @@
|
||||||
version: '3.8'
|
|
||||||
|
|
||||||
services:
|
|
||||||
robotapp:
|
|
||||||
build:
|
|
||||||
context: .
|
|
||||||
dockerfile: Dockerfile
|
|
||||||
container_name: robotapp
|
|
||||||
restart: unless-stopped
|
|
||||||
ports:
|
|
||||||
- "8080:8080"
|
|
||||||
environment:
|
|
||||||
- ASPNETCORE_ENVIRONMENT=Production
|
|
||||||
- ASPNETCORE_URLS=http://+:8080
|
|
||||||
- ConnectionStrings__DefaultConnection=Data Source=/app/data/robot.db
|
|
||||||
volumes:
|
|
||||||
# Persist database
|
|
||||||
- ./data:/app/data
|
|
||||||
# Persist maps
|
|
||||||
- ./maps:/app/maps
|
|
||||||
# Persist logs (if needed)
|
|
||||||
- ./logs:/app/logs
|
|
||||||
networks:
|
|
||||||
- robotapp-network
|
|
||||||
healthcheck:
|
|
||||||
test: ["CMD-SHELL", "wget --no-verbose --tries=1 --spider http://localhost:8080 || exit 1"]
|
|
||||||
interval: 30s
|
|
||||||
timeout: 10s
|
|
||||||
retries: 3
|
|
||||||
start_period: 40s
|
|
||||||
|
|
||||||
networks:
|
|
||||||
robotapp-network:
|
|
||||||
driver: bridge
|
|
||||||
|
|
||||||
Loading…
Reference in New Issue
Block a user