From af8cb52c910234bae76131494c5d856a786a2fd8 Mon Sep 17 00:00:00 2001 From: whatacotton Date: Thu, 31 Jul 2025 21:44:40 +0900 Subject: [PATCH 1/3] separate frontend from backend --- aspnetapp/.dockerignore | 67 +++++++++++++++++++++++++ aspnetapp/Dockerfile | 9 +--- aspnetapp/WINGS/ClientApp/.dockerignore | 57 +++++++++++++++++++++ aspnetapp/WINGS/ClientApp/Dockerfile | 35 +++++++++++++ aspnetapp/WINGS/ClientApp/nginx.conf | 32 ++++++++++++ aspnetapp/WINGS/ClientApp/package.json | 10 ++-- aspnetapp/WINGS/Startup.cs | 62 ++++++++++++----------- aspnetapp/WINGS/WINGS.csproj | 31 +----------- docker-compose.yml | 55 ++++++++++++++++---- 9 files changed, 277 insertions(+), 81 deletions(-) create mode 100644 aspnetapp/.dockerignore create mode 100644 aspnetapp/WINGS/ClientApp/.dockerignore create mode 100644 aspnetapp/WINGS/ClientApp/Dockerfile create mode 100644 aspnetapp/WINGS/ClientApp/nginx.conf diff --git a/aspnetapp/.dockerignore b/aspnetapp/.dockerignore new file mode 100644 index 00000000..0091031e --- /dev/null +++ b/aspnetapp/.dockerignore @@ -0,0 +1,67 @@ +# Node.js +node_modules/ +npm-debug.log +yarn-error.log +.npm +.yarn + +# .NET +bin/ +obj/ +.vs/ +.vscode/ +*.user +*.userprefs + +# Git +.git/ +.gitignore +.gitattributes + +# Docker +Dockerfile* +docker-compose* +.dockerignore + +# IDE +.idea/ +*.swp +*.swo + +# Logs +*.log +Logs/ +logs/ + +# OS +.DS_Store +Thumbs.db + +# Build outputs +dist/ +build/ +out/ + +# Dependencies +**/node_modules/ +**/bin/ +**/obj/ + +# Test coverage +coverage/ + +# Environment files +.env +.env.local +.env.development.local +.env.test.local +.env.production.local + +# Database +*.db +*.sqlite +data/ + +# Temporary files +*.tmp +*.temp diff --git a/aspnetapp/Dockerfile b/aspnetapp/Dockerfile index e3a29f30..7ddb7580 100644 --- a/aspnetapp/Dockerfile +++ b/aspnetapp/Dockerfile @@ -1,16 +1,11 @@ FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base WORKDIR /app -EXPOSE 5001 -RUN curl -sL https://deb.nodesource.com/setup_20.x | bash - -RUN apt-get update -RUN apt-get install -y nodejs +EXPOSE 5000 ENV TZ=Asia/Tokyo FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build WORKDIR /src -RUN curl -sL https://deb.nodesource.com/setup_20.x | bash - -RUN apt-get update -RUN apt-get install -y nodejs + COPY ["WINGS/WINGS.csproj", "WINGS/"] RUN dotnet restore "WINGS/WINGS.csproj" COPY . . diff --git a/aspnetapp/WINGS/ClientApp/.dockerignore b/aspnetapp/WINGS/ClientApp/.dockerignore new file mode 100644 index 00000000..da37b7f8 --- /dev/null +++ b/aspnetapp/WINGS/ClientApp/.dockerignore @@ -0,0 +1,57 @@ +# Dependencies +node_modules/ +.npm +.yarn + +# Production build +build/ +dist/ + +# Development +.env.local +.env.development.local +.env.test.local +.env.production.local + +# IDE +.vscode/ +.idea/ +*.swp +*.swo + +# OS +.DS_Store +Thumbs.db + +# Logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* + +# Git +.git/ +.gitignore + +# Docker +Dockerfile* +docker-compose* +.dockerignore + +# Coverage +coverage/ + +# ESLint cache +.eslintcache + +# TypeScript build info +*.tsbuildinfo + +# Optional npm cache directory +.npm + +# Microbundle cache +.rpt2_cache/ +.rts2_cache_cjs/ +.rts2_cache_es/ +.rts2_cache_umd/ diff --git a/aspnetapp/WINGS/ClientApp/Dockerfile b/aspnetapp/WINGS/ClientApp/Dockerfile new file mode 100644 index 00000000..3a7de34d --- /dev/null +++ b/aspnetapp/WINGS/ClientApp/Dockerfile @@ -0,0 +1,35 @@ +# マルチステージビルド: ビルド段階 +FROM node:18-alpine AS build + +WORKDIR /app + +# package.json と package-lock.json をコピー(依存関係のキャッシュ効率化) +COPY package*.json ./ + +# ビルドに必要なすべての依存関係をインストール(devDependenciesも含む) +RUN npm ci + +# ソースコードをコピー(.dockerignoreで不要ファイルを除外) +COPY . . + +# 環境変数設定 +ENV REACT_APP_API_BASE_URL=http://backend:5000/api +ENV GENERATE_SOURCEMAP=false +ENV ESLINT_NO_DEV_ERRORS=true +ENV TSC_COMPILE_ON_ERROR=true + +# プロダクションビルド +RUN npm run build + +# マルチステージビルド: 本番段階 +FROM nginx:alpine + +# ビルド済みファイルをNginxの配信ディレクトリにコピー +COPY --from=build /app/build /usr/share/nginx/html + +# Nginx設定ファイル +COPY nginx.conf /etc/nginx/nginx.conf + +EXPOSE 80 + +CMD ["nginx", "-g", "daemon off;"] diff --git a/aspnetapp/WINGS/ClientApp/nginx.conf b/aspnetapp/WINGS/ClientApp/nginx.conf new file mode 100644 index 00000000..c5620b78 --- /dev/null +++ b/aspnetapp/WINGS/ClientApp/nginx.conf @@ -0,0 +1,32 @@ +events { + worker_connections 1024; +} + +http { + include /etc/nginx/mime.types; + default_type application/octet-stream; + + server { + listen 80; + server_name localhost; + root /usr/share/nginx/html; + index index.html; + + location / { + try_files $uri $uri/ /index.html; + } + + location /api/ { + proxy_pass http://backend:5000/api/; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + } + + location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ { + expires 1y; + add_header Cache-Control "public, immutable"; + } + } +} diff --git a/aspnetapp/WINGS/ClientApp/package.json b/aspnetapp/WINGS/ClientApp/package.json index 4817be3b..ac7cf795 100644 --- a/aspnetapp/WINGS/ClientApp/package.json +++ b/aspnetapp/WINGS/ClientApp/package.json @@ -62,8 +62,7 @@ "eslintConfig": { "extends": [ "react-app", - "plugin:@typescript-eslint/recommended", - "plugin:@typescript-eslint/recommended-requiring-type-checking" + "plugin:@typescript-eslint/recommended" ], "parser": "@typescript-eslint/parser", "parserOptions": { @@ -71,7 +70,12 @@ }, "plugins": [ "@typescript-eslint" - ] + ], + "rules": { + "@typescript-eslint/no-unsafe-assignment": "warn", + "@typescript-eslint/no-unsafe-member-access": "warn", + "@typescript-eslint/no-unsafe-call": "warn" + } }, "scripts": { "start": "rimraf ./build && react-scripts start", diff --git a/aspnetapp/WINGS/Startup.cs b/aspnetapp/WINGS/Startup.cs index 03f50b47..b0a97aac 100644 --- a/aspnetapp/WINGS/Startup.cs +++ b/aspnetapp/WINGS/Startup.cs @@ -1,7 +1,9 @@ using System.Text.Json.Serialization; +using System; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; -using Microsoft.AspNetCore.SpaServices.ReactDevelopmentServer; +// SPA統合のusingを削除 +// using Microsoft.AspNetCore.SpaServices.ReactDevelopmentServer; using Microsoft.EntityFrameworkCore; using WINGS.Data; using WINGS.Models; @@ -27,11 +29,28 @@ public void ConfigureServices(IServiceCollection services) { services.AddDbContext(options => options.UseMySql( - Configuration.GetConnectionString("DefaultConnection"),ServerVersion.Parse("8.0"))); - - services.AddControllersWithViews() + Configuration.GetConnectionString("DefaultConnection"), + ServerVersion.Parse("8.0"), + mysqlOptions => mysqlOptions.EnableRetryOnFailure( + maxRetryCount: 5, + maxRetryDelay: TimeSpan.FromSeconds(30), + errorNumbersToAdd: null))); + + services.AddControllers() .AddJsonOptions(options => options.JsonSerializerOptions.Converters.Add(new JsonStringEnumConverter())); - services.AddRazorPages(); + // RazorPagesは不要(SPA分離のため) + // services.AddRazorPages(); + + services.AddCors(options => + { + options.AddPolicy("AllowFrontend", policy => + { + policy.WithOrigins("http://localhost:3000", "http://frontend:80") + .AllowAnyHeader() + .AllowAnyMethod() + .AllowCredentials(); + }); + }); services.AddGrpc(); @@ -60,13 +79,7 @@ public void ConfigureServices(IServiceCollection services) services.AddScoped(); services.AddScoped(); - ConfigureUserDefinedServices(services); - - // In production, the React files will be served from this directory - services.AddSpaStaticFiles(configuration => - { - configuration.RootPath = "ClientApp/build"; - }); + ConfigureUserDefinedServices(services); } private void ConfigureUserDefinedServices(IServiceCollection services) @@ -93,33 +106,22 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env) } else { - app.UseExceptionHandler("/Error"); + app.UseExceptionHandler("/api/error"); app.UseHsts(); } - app.UseHttpsRedirection(); - app.UseStaticFiles(); - app.UseSpaStaticFiles(); + + // If you are configuring HTTPS redirection, ensure that your environment is set up correctly. + // app.UseHttpsRedirection(); + + app.UseCors("AllowFrontend"); app.UseRouting(); app.UseEndpoints(endpoints => { endpoints.MapGrpcService(); - endpoints.MapControllerRoute( - name: "default", - pattern: "{controller}/{action=Index}/{id?}"); - endpoints.MapRazorPages(); - }); - - app.UseSpa(spa => - { - spa.Options.SourcePath = "ClientApp"; - - if (env.IsDevelopment()) - { - spa.UseReactDevelopmentServer(npmScript: "start"); - } + endpoints.MapControllers(); }); } } diff --git a/aspnetapp/WINGS/WINGS.csproj b/aspnetapp/WINGS/WINGS.csproj index d7c0b77d..2d2ddc14 100644 --- a/aspnetapp/WINGS/WINGS.csproj +++ b/aspnetapp/WINGS/WINGS.csproj @@ -1,11 +1,7 @@ net8.0 - true - Latest false - ClientApp\ - $(DefaultItemExcludes);$(SpaRoot)node_modules\** @@ -16,7 +12,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + @@ -30,35 +26,10 @@ - - - - - - - - - - - - - - - - - - - - %(DistFiles.Identity) - PreserveNewest - true - - - \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index 62c29a5b..0cb5125a 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,22 +1,43 @@ -version: "3" services: - aspnetapp: - image: wings-aspnetapp-img - build: ./aspnetapp - container_name: wings-aspnetapp-ctr + backend: + image: wings-backend-img + build: + context: ./aspnetapp + dockerfile: Dockerfile + container_name: wings-backend-ctr volumes: - "./aspnetapp/WINGS/TlmCmd:/app/TlmCmd" - "./aspnetapp/WINGS/Logs:/app/Logs" environment: ConnectionStrings__DefaultConnection: "server=mysql; uid=root; pwd=P@ssw0rd!; database=wings;" - ASPNETCORE_URLS: "https://+;http://+" - ASPNETCORE_HTTPS_PORT: 5001 - ASPNETCORE_Kestrel__Certificates__Default__Password: "P@ssw0rd!" - ASPNETCORE_Kestrel__Certificates__Default__Path: "/app/certificate.pfx" + ASPNETCORE_URLS: "http://+:5000" + ASPNETCORE_ENVIRONMENT: "Development" + HTTP_PORTS: "5000" + HTTPS_PORTS: "" + ASPNETCORE_HTTPS_PORT: "" ports: - - "5001:5001" + - "5000:5000" depends_on: - - mysql + mysql: + condition: service_healthy + networks: + - wings-network + + frontend: + image: wings-frontend-img + build: + context: ./aspnetapp/WINGS/ClientApp + dockerfile: Dockerfile + container_name: wings-frontend-ctr + environment: + - REACT_APP_API_BASE_URL=http://backend:5000/api + ports: + - "3000:80" + depends_on: + - backend + networks: + - wings-network + mysql: image: wings-mysql-img build: ./mysql @@ -29,3 +50,15 @@ services: environment: - MYSQL_DATABASE=wings - MYSQL_ROOT_PASSWORD=P@ssw0rd! + healthcheck: + test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-u", "root", "-pP@ssw0rd!"] + timeout: 20s + retries: 10 + interval: 5s + start_period: 30s + networks: + - wings-network + +networks: + wings-network: + driver: bridge From 9cd79d0bbae1c8d32ac5d1dcda6e8692744dae20 Mon Sep 17 00:00:00 2001 From: whatacotton Date: Thu, 31 Jul 2025 22:05:36 +0900 Subject: [PATCH 2/3] move clientapp dir --- .../WINGS/ClientApp => ClientApp}/.dockerignore | 0 {aspnetapp/WINGS/ClientApp => ClientApp}/.gitignore | 0 {aspnetapp/WINGS/ClientApp => ClientApp}/Dockerfile | 0 {aspnetapp/WINGS/ClientApp => ClientApp}/README.md | 0 {aspnetapp/WINGS/ClientApp => ClientApp}/nginx.conf | 0 .../WINGS/ClientApp => ClientApp}/package-lock.json | 0 .../WINGS/ClientApp => ClientApp}/package.json | 0 .../ClientApp => ClientApp}/public/favicon.ico | Bin .../WINGS/ClientApp => ClientApp}/public/index.html | 0 .../ClientApp => ClientApp}/public/manifest.json | 0 .../WINGS/ClientApp => ClientApp}/src/App.tsx | 0 .../WINGS/ClientApp => ClientApp}/src/Router.tsx | 0 .../ClientApp => ClientApp}/src/assets/img/logo.png | Bin .../ClientApp => ClientApp}/src/assets/style.css | 0 .../ClientApp => ClientApp}/src/assets/theme.ts | 0 .../src/assets/tlm/telemetryColor.json | 0 .../src/components/command/CommandLog.tsx | 0 .../src/components/command/CommandSender.tsx | 0 .../command/log_display/CmdLogDisplayArea.tsx | 0 .../command/log_display/CmdLogTabPanel.tsx | 0 .../command/log_display/CmdLogTableRow.tsx | 0 .../command/plan_display/OpenPlanDialog.tsx | 0 .../command/plan_display/PlanDisplayArea.tsx | 0 .../command/plan_display/PlanTabPanel.tsx | 0 .../command/plan_display/RequestTableRow.tsx | 0 .../command/plan_edit/CommandSelectArea.tsx | 0 .../components/command/plan_edit/SetParamTable.tsx | 0 .../src/components/common/CheckBox.tsx | 0 .../src/components/common/ConfirmationDialog.tsx | 0 .../components/common/EditableInputTableCell.tsx | 0 .../components/common/EditableSelectTableCell.tsx | 0 .../src/components/common/ErrorDialog.tsx | 0 .../src/components/common/FileTreeMultiView.tsx | 0 .../src/components/common/FileTreeView.tsx | 0 .../src/components/common/IconButtonInTabs.tsx | 0 .../src/components/common/LoadingBackDrop.tsx | 0 .../src/components/common/RadioBox.tsx | 0 .../src/components/common/SelectBox.tsx | 0 .../src/components/common/TransferList.tsx | 0 .../src/components/compo/ComponentList.tsx | 0 .../src/components/compo/ComponentManage.tsx | 0 .../src/components/header/DrawerMenus.tsx | 0 .../src/components/header/Header.tsx | 0 .../src/components/header/HeaderMenus.tsx | 0 .../src/components/history/HistoryDetail.tsx | 0 .../src/components/history/LogExportArea.tsx | 0 .../src/components/history/OperationHistory.tsx | 0 .../src/components/home/Home.tsx | 0 .../src/components/home/OperationList.tsx | 0 .../src/components/home/StartOperationArea.tsx | 0 .../src/components/telemetry/TelemetryViewer.tsx | 0 .../telemetry/view_display/GraphTabPanel.tsx | 0 .../telemetry/view_display/OpenGraphTabDialog.tsx | 0 .../telemetry/view_display/OpenLayoutDialog.tsx | 0 .../telemetry/view_display/OpenPacketTabDialog.tsx | 0 .../telemetry/view_display/OpenViewDialog.tsx | 0 .../telemetry/view_display/PacketTabPanel.tsx | 0 .../telemetry/view_display/ViewDisplayBlock.tsx | 0 .../telemetry/view_display/ViewTabPanel.tsx | 0 .../ClientApp => ClientApp}/src/constants/index.ts | 0 .../WINGS/ClientApp => ClientApp}/src/index.tsx | 0 .../ClientApp => ClientApp}/src/models/Command.ts | 0 .../src/models/CommandPlan.ts | 0 .../ClientApp => ClientApp}/src/models/Component.ts | 0 .../src/models/ErrorDialogState.ts | 0 .../ClientApp => ClientApp}/src/models/FileIndex.ts | 0 .../src/models/LocationState.ts | 0 .../ClientApp => ClientApp}/src/models/Operation.ts | 0 .../src/models/PaginationMeta.ts | 0 .../ClientApp => ClientApp}/src/models/Telemetry.ts | 0 .../src/models/TelemetryView.ts | 0 .../ClientApp => ClientApp}/src/models/UIState.ts | 0 .../ClientApp => ClientApp}/src/models/index.ts | 0 .../ClientApp => ClientApp}/src/react-app-env.d.ts | 0 .../src/redux/commands/actions.ts | 0 .../src/redux/commands/reducers.ts | 0 .../src/redux/commands/selectors.ts | 0 .../src/redux/operations/actions.ts | 0 .../src/redux/operations/operations.ts | 0 .../src/redux/operations/reducers.ts | 0 .../src/redux/operations/selectors.ts | 0 .../src/redux/plans/actions.ts | 0 .../src/redux/plans/operations.ts | 0 .../src/redux/plans/reducers.ts | 0 .../src/redux/plans/selectors.ts | 0 .../src/redux/store/RootState.ts | 0 .../src/redux/store/initialState.ts | 0 .../src/redux/store/store.ts | 0 .../src/redux/telemetries/actions.ts | 0 .../src/redux/telemetries/reducers.ts | 0 .../src/redux/telemetries/selectors.ts | 0 .../ClientApp => ClientApp}/src/redux/ui/actions.ts | 0 .../src/redux/ui/reducers.ts | 0 .../src/redux/ui/selectors.ts | 0 .../src/redux/views/actions.ts | 0 .../src/redux/views/reducers.ts | 0 .../src/redux/views/selectors.ts | 0 .../ClientApp => ClientApp}/tsconfig.eslint.json | 0 .../WINGS/ClientApp => ClientApp}/tsconfig.json | 0 docker-compose.yml | 2 +- 100 files changed, 1 insertion(+), 1 deletion(-) rename {aspnetapp/WINGS/ClientApp => ClientApp}/.dockerignore (100%) rename {aspnetapp/WINGS/ClientApp => ClientApp}/.gitignore (100%) rename {aspnetapp/WINGS/ClientApp => ClientApp}/Dockerfile (100%) rename {aspnetapp/WINGS/ClientApp => ClientApp}/README.md (100%) rename {aspnetapp/WINGS/ClientApp => ClientApp}/nginx.conf (100%) rename {aspnetapp/WINGS/ClientApp => ClientApp}/package-lock.json (100%) rename {aspnetapp/WINGS/ClientApp => ClientApp}/package.json (100%) rename {aspnetapp/WINGS/ClientApp => ClientApp}/public/favicon.ico (100%) rename {aspnetapp/WINGS/ClientApp => ClientApp}/public/index.html (100%) rename {aspnetapp/WINGS/ClientApp => ClientApp}/public/manifest.json (100%) rename {aspnetapp/WINGS/ClientApp => ClientApp}/src/App.tsx (100%) rename {aspnetapp/WINGS/ClientApp => ClientApp}/src/Router.tsx (100%) rename {aspnetapp/WINGS/ClientApp => ClientApp}/src/assets/img/logo.png (100%) rename {aspnetapp/WINGS/ClientApp => ClientApp}/src/assets/style.css (100%) rename {aspnetapp/WINGS/ClientApp => ClientApp}/src/assets/theme.ts (100%) rename {aspnetapp/WINGS/ClientApp => ClientApp}/src/assets/tlm/telemetryColor.json (100%) rename {aspnetapp/WINGS/ClientApp => ClientApp}/src/components/command/CommandLog.tsx (100%) rename {aspnetapp/WINGS/ClientApp => ClientApp}/src/components/command/CommandSender.tsx (100%) rename {aspnetapp/WINGS/ClientApp => ClientApp}/src/components/command/log_display/CmdLogDisplayArea.tsx (100%) rename {aspnetapp/WINGS/ClientApp => ClientApp}/src/components/command/log_display/CmdLogTabPanel.tsx (100%) rename {aspnetapp/WINGS/ClientApp => ClientApp}/src/components/command/log_display/CmdLogTableRow.tsx (100%) rename {aspnetapp/WINGS/ClientApp => ClientApp}/src/components/command/plan_display/OpenPlanDialog.tsx (100%) rename {aspnetapp/WINGS/ClientApp => ClientApp}/src/components/command/plan_display/PlanDisplayArea.tsx (100%) rename {aspnetapp/WINGS/ClientApp => ClientApp}/src/components/command/plan_display/PlanTabPanel.tsx (100%) rename {aspnetapp/WINGS/ClientApp => ClientApp}/src/components/command/plan_display/RequestTableRow.tsx (100%) rename {aspnetapp/WINGS/ClientApp => ClientApp}/src/components/command/plan_edit/CommandSelectArea.tsx (100%) rename {aspnetapp/WINGS/ClientApp => ClientApp}/src/components/command/plan_edit/SetParamTable.tsx (100%) rename {aspnetapp/WINGS/ClientApp => ClientApp}/src/components/common/CheckBox.tsx (100%) rename {aspnetapp/WINGS/ClientApp => ClientApp}/src/components/common/ConfirmationDialog.tsx (100%) rename {aspnetapp/WINGS/ClientApp => ClientApp}/src/components/common/EditableInputTableCell.tsx (100%) rename {aspnetapp/WINGS/ClientApp => ClientApp}/src/components/common/EditableSelectTableCell.tsx (100%) rename {aspnetapp/WINGS/ClientApp => ClientApp}/src/components/common/ErrorDialog.tsx (100%) rename {aspnetapp/WINGS/ClientApp => ClientApp}/src/components/common/FileTreeMultiView.tsx (100%) rename {aspnetapp/WINGS/ClientApp => ClientApp}/src/components/common/FileTreeView.tsx (100%) rename {aspnetapp/WINGS/ClientApp => ClientApp}/src/components/common/IconButtonInTabs.tsx (100%) rename {aspnetapp/WINGS/ClientApp => ClientApp}/src/components/common/LoadingBackDrop.tsx (100%) rename {aspnetapp/WINGS/ClientApp => ClientApp}/src/components/common/RadioBox.tsx (100%) rename {aspnetapp/WINGS/ClientApp => ClientApp}/src/components/common/SelectBox.tsx (100%) rename {aspnetapp/WINGS/ClientApp => ClientApp}/src/components/common/TransferList.tsx (100%) rename {aspnetapp/WINGS/ClientApp => ClientApp}/src/components/compo/ComponentList.tsx (100%) rename {aspnetapp/WINGS/ClientApp => ClientApp}/src/components/compo/ComponentManage.tsx (100%) rename {aspnetapp/WINGS/ClientApp => ClientApp}/src/components/header/DrawerMenus.tsx (100%) rename {aspnetapp/WINGS/ClientApp => ClientApp}/src/components/header/Header.tsx (100%) rename {aspnetapp/WINGS/ClientApp => ClientApp}/src/components/header/HeaderMenus.tsx (100%) rename {aspnetapp/WINGS/ClientApp => ClientApp}/src/components/history/HistoryDetail.tsx (100%) rename {aspnetapp/WINGS/ClientApp => ClientApp}/src/components/history/LogExportArea.tsx (100%) rename {aspnetapp/WINGS/ClientApp => ClientApp}/src/components/history/OperationHistory.tsx (100%) rename {aspnetapp/WINGS/ClientApp => ClientApp}/src/components/home/Home.tsx (100%) rename {aspnetapp/WINGS/ClientApp => ClientApp}/src/components/home/OperationList.tsx (100%) rename {aspnetapp/WINGS/ClientApp => ClientApp}/src/components/home/StartOperationArea.tsx (100%) rename {aspnetapp/WINGS/ClientApp => ClientApp}/src/components/telemetry/TelemetryViewer.tsx (100%) rename {aspnetapp/WINGS/ClientApp => ClientApp}/src/components/telemetry/view_display/GraphTabPanel.tsx (100%) rename {aspnetapp/WINGS/ClientApp => ClientApp}/src/components/telemetry/view_display/OpenGraphTabDialog.tsx (100%) rename {aspnetapp/WINGS/ClientApp => ClientApp}/src/components/telemetry/view_display/OpenLayoutDialog.tsx (100%) rename {aspnetapp/WINGS/ClientApp => ClientApp}/src/components/telemetry/view_display/OpenPacketTabDialog.tsx (100%) rename {aspnetapp/WINGS/ClientApp => ClientApp}/src/components/telemetry/view_display/OpenViewDialog.tsx (100%) rename {aspnetapp/WINGS/ClientApp => ClientApp}/src/components/telemetry/view_display/PacketTabPanel.tsx (100%) rename {aspnetapp/WINGS/ClientApp => ClientApp}/src/components/telemetry/view_display/ViewDisplayBlock.tsx (100%) rename {aspnetapp/WINGS/ClientApp => ClientApp}/src/components/telemetry/view_display/ViewTabPanel.tsx (100%) rename {aspnetapp/WINGS/ClientApp => ClientApp}/src/constants/index.ts (100%) rename {aspnetapp/WINGS/ClientApp => ClientApp}/src/index.tsx (100%) rename {aspnetapp/WINGS/ClientApp => ClientApp}/src/models/Command.ts (100%) rename {aspnetapp/WINGS/ClientApp => ClientApp}/src/models/CommandPlan.ts (100%) rename {aspnetapp/WINGS/ClientApp => ClientApp}/src/models/Component.ts (100%) rename {aspnetapp/WINGS/ClientApp => ClientApp}/src/models/ErrorDialogState.ts (100%) rename {aspnetapp/WINGS/ClientApp => ClientApp}/src/models/FileIndex.ts (100%) rename {aspnetapp/WINGS/ClientApp => ClientApp}/src/models/LocationState.ts (100%) rename {aspnetapp/WINGS/ClientApp => ClientApp}/src/models/Operation.ts (100%) rename {aspnetapp/WINGS/ClientApp => ClientApp}/src/models/PaginationMeta.ts (100%) rename {aspnetapp/WINGS/ClientApp => ClientApp}/src/models/Telemetry.ts (100%) rename {aspnetapp/WINGS/ClientApp => ClientApp}/src/models/TelemetryView.ts (100%) rename {aspnetapp/WINGS/ClientApp => ClientApp}/src/models/UIState.ts (100%) rename {aspnetapp/WINGS/ClientApp => ClientApp}/src/models/index.ts (100%) rename {aspnetapp/WINGS/ClientApp => ClientApp}/src/react-app-env.d.ts (100%) rename {aspnetapp/WINGS/ClientApp => ClientApp}/src/redux/commands/actions.ts (100%) rename {aspnetapp/WINGS/ClientApp => ClientApp}/src/redux/commands/reducers.ts (100%) rename {aspnetapp/WINGS/ClientApp => ClientApp}/src/redux/commands/selectors.ts (100%) rename {aspnetapp/WINGS/ClientApp => ClientApp}/src/redux/operations/actions.ts (100%) rename {aspnetapp/WINGS/ClientApp => ClientApp}/src/redux/operations/operations.ts (100%) rename {aspnetapp/WINGS/ClientApp => ClientApp}/src/redux/operations/reducers.ts (100%) rename {aspnetapp/WINGS/ClientApp => ClientApp}/src/redux/operations/selectors.ts (100%) rename {aspnetapp/WINGS/ClientApp => ClientApp}/src/redux/plans/actions.ts (100%) rename {aspnetapp/WINGS/ClientApp => ClientApp}/src/redux/plans/operations.ts (100%) rename {aspnetapp/WINGS/ClientApp => ClientApp}/src/redux/plans/reducers.ts (100%) rename {aspnetapp/WINGS/ClientApp => ClientApp}/src/redux/plans/selectors.ts (100%) rename {aspnetapp/WINGS/ClientApp => ClientApp}/src/redux/store/RootState.ts (100%) rename {aspnetapp/WINGS/ClientApp => ClientApp}/src/redux/store/initialState.ts (100%) rename {aspnetapp/WINGS/ClientApp => ClientApp}/src/redux/store/store.ts (100%) rename {aspnetapp/WINGS/ClientApp => ClientApp}/src/redux/telemetries/actions.ts (100%) rename {aspnetapp/WINGS/ClientApp => ClientApp}/src/redux/telemetries/reducers.ts (100%) rename {aspnetapp/WINGS/ClientApp => ClientApp}/src/redux/telemetries/selectors.ts (100%) rename {aspnetapp/WINGS/ClientApp => ClientApp}/src/redux/ui/actions.ts (100%) rename {aspnetapp/WINGS/ClientApp => ClientApp}/src/redux/ui/reducers.ts (100%) rename {aspnetapp/WINGS/ClientApp => ClientApp}/src/redux/ui/selectors.ts (100%) rename {aspnetapp/WINGS/ClientApp => ClientApp}/src/redux/views/actions.ts (100%) rename {aspnetapp/WINGS/ClientApp => ClientApp}/src/redux/views/reducers.ts (100%) rename {aspnetapp/WINGS/ClientApp => ClientApp}/src/redux/views/selectors.ts (100%) rename {aspnetapp/WINGS/ClientApp => ClientApp}/tsconfig.eslint.json (100%) rename {aspnetapp/WINGS/ClientApp => ClientApp}/tsconfig.json (100%) diff --git a/aspnetapp/WINGS/ClientApp/.dockerignore b/ClientApp/.dockerignore similarity index 100% rename from aspnetapp/WINGS/ClientApp/.dockerignore rename to ClientApp/.dockerignore diff --git a/aspnetapp/WINGS/ClientApp/.gitignore b/ClientApp/.gitignore similarity index 100% rename from aspnetapp/WINGS/ClientApp/.gitignore rename to ClientApp/.gitignore diff --git a/aspnetapp/WINGS/ClientApp/Dockerfile b/ClientApp/Dockerfile similarity index 100% rename from aspnetapp/WINGS/ClientApp/Dockerfile rename to ClientApp/Dockerfile diff --git a/aspnetapp/WINGS/ClientApp/README.md b/ClientApp/README.md similarity index 100% rename from aspnetapp/WINGS/ClientApp/README.md rename to ClientApp/README.md diff --git a/aspnetapp/WINGS/ClientApp/nginx.conf b/ClientApp/nginx.conf similarity index 100% rename from aspnetapp/WINGS/ClientApp/nginx.conf rename to ClientApp/nginx.conf diff --git a/aspnetapp/WINGS/ClientApp/package-lock.json b/ClientApp/package-lock.json similarity index 100% rename from aspnetapp/WINGS/ClientApp/package-lock.json rename to ClientApp/package-lock.json diff --git a/aspnetapp/WINGS/ClientApp/package.json b/ClientApp/package.json similarity index 100% rename from aspnetapp/WINGS/ClientApp/package.json rename to ClientApp/package.json diff --git a/aspnetapp/WINGS/ClientApp/public/favicon.ico b/ClientApp/public/favicon.ico similarity index 100% rename from aspnetapp/WINGS/ClientApp/public/favicon.ico rename to ClientApp/public/favicon.ico diff --git a/aspnetapp/WINGS/ClientApp/public/index.html b/ClientApp/public/index.html similarity index 100% rename from aspnetapp/WINGS/ClientApp/public/index.html rename to ClientApp/public/index.html diff --git a/aspnetapp/WINGS/ClientApp/public/manifest.json b/ClientApp/public/manifest.json similarity index 100% rename from aspnetapp/WINGS/ClientApp/public/manifest.json rename to ClientApp/public/manifest.json diff --git a/aspnetapp/WINGS/ClientApp/src/App.tsx b/ClientApp/src/App.tsx similarity index 100% rename from aspnetapp/WINGS/ClientApp/src/App.tsx rename to ClientApp/src/App.tsx diff --git a/aspnetapp/WINGS/ClientApp/src/Router.tsx b/ClientApp/src/Router.tsx similarity index 100% rename from aspnetapp/WINGS/ClientApp/src/Router.tsx rename to ClientApp/src/Router.tsx diff --git a/aspnetapp/WINGS/ClientApp/src/assets/img/logo.png b/ClientApp/src/assets/img/logo.png similarity index 100% rename from aspnetapp/WINGS/ClientApp/src/assets/img/logo.png rename to ClientApp/src/assets/img/logo.png diff --git a/aspnetapp/WINGS/ClientApp/src/assets/style.css b/ClientApp/src/assets/style.css similarity index 100% rename from aspnetapp/WINGS/ClientApp/src/assets/style.css rename to ClientApp/src/assets/style.css diff --git a/aspnetapp/WINGS/ClientApp/src/assets/theme.ts b/ClientApp/src/assets/theme.ts similarity index 100% rename from aspnetapp/WINGS/ClientApp/src/assets/theme.ts rename to ClientApp/src/assets/theme.ts diff --git a/aspnetapp/WINGS/ClientApp/src/assets/tlm/telemetryColor.json b/ClientApp/src/assets/tlm/telemetryColor.json similarity index 100% rename from aspnetapp/WINGS/ClientApp/src/assets/tlm/telemetryColor.json rename to ClientApp/src/assets/tlm/telemetryColor.json diff --git a/aspnetapp/WINGS/ClientApp/src/components/command/CommandLog.tsx b/ClientApp/src/components/command/CommandLog.tsx similarity index 100% rename from aspnetapp/WINGS/ClientApp/src/components/command/CommandLog.tsx rename to ClientApp/src/components/command/CommandLog.tsx diff --git a/aspnetapp/WINGS/ClientApp/src/components/command/CommandSender.tsx b/ClientApp/src/components/command/CommandSender.tsx similarity index 100% rename from aspnetapp/WINGS/ClientApp/src/components/command/CommandSender.tsx rename to ClientApp/src/components/command/CommandSender.tsx diff --git a/aspnetapp/WINGS/ClientApp/src/components/command/log_display/CmdLogDisplayArea.tsx b/ClientApp/src/components/command/log_display/CmdLogDisplayArea.tsx similarity index 100% rename from aspnetapp/WINGS/ClientApp/src/components/command/log_display/CmdLogDisplayArea.tsx rename to ClientApp/src/components/command/log_display/CmdLogDisplayArea.tsx diff --git a/aspnetapp/WINGS/ClientApp/src/components/command/log_display/CmdLogTabPanel.tsx b/ClientApp/src/components/command/log_display/CmdLogTabPanel.tsx similarity index 100% rename from aspnetapp/WINGS/ClientApp/src/components/command/log_display/CmdLogTabPanel.tsx rename to ClientApp/src/components/command/log_display/CmdLogTabPanel.tsx diff --git a/aspnetapp/WINGS/ClientApp/src/components/command/log_display/CmdLogTableRow.tsx b/ClientApp/src/components/command/log_display/CmdLogTableRow.tsx similarity index 100% rename from aspnetapp/WINGS/ClientApp/src/components/command/log_display/CmdLogTableRow.tsx rename to ClientApp/src/components/command/log_display/CmdLogTableRow.tsx diff --git a/aspnetapp/WINGS/ClientApp/src/components/command/plan_display/OpenPlanDialog.tsx b/ClientApp/src/components/command/plan_display/OpenPlanDialog.tsx similarity index 100% rename from aspnetapp/WINGS/ClientApp/src/components/command/plan_display/OpenPlanDialog.tsx rename to ClientApp/src/components/command/plan_display/OpenPlanDialog.tsx diff --git a/aspnetapp/WINGS/ClientApp/src/components/command/plan_display/PlanDisplayArea.tsx b/ClientApp/src/components/command/plan_display/PlanDisplayArea.tsx similarity index 100% rename from aspnetapp/WINGS/ClientApp/src/components/command/plan_display/PlanDisplayArea.tsx rename to ClientApp/src/components/command/plan_display/PlanDisplayArea.tsx diff --git a/aspnetapp/WINGS/ClientApp/src/components/command/plan_display/PlanTabPanel.tsx b/ClientApp/src/components/command/plan_display/PlanTabPanel.tsx similarity index 100% rename from aspnetapp/WINGS/ClientApp/src/components/command/plan_display/PlanTabPanel.tsx rename to ClientApp/src/components/command/plan_display/PlanTabPanel.tsx diff --git a/aspnetapp/WINGS/ClientApp/src/components/command/plan_display/RequestTableRow.tsx b/ClientApp/src/components/command/plan_display/RequestTableRow.tsx similarity index 100% rename from aspnetapp/WINGS/ClientApp/src/components/command/plan_display/RequestTableRow.tsx rename to ClientApp/src/components/command/plan_display/RequestTableRow.tsx diff --git a/aspnetapp/WINGS/ClientApp/src/components/command/plan_edit/CommandSelectArea.tsx b/ClientApp/src/components/command/plan_edit/CommandSelectArea.tsx similarity index 100% rename from aspnetapp/WINGS/ClientApp/src/components/command/plan_edit/CommandSelectArea.tsx rename to ClientApp/src/components/command/plan_edit/CommandSelectArea.tsx diff --git a/aspnetapp/WINGS/ClientApp/src/components/command/plan_edit/SetParamTable.tsx b/ClientApp/src/components/command/plan_edit/SetParamTable.tsx similarity index 100% rename from aspnetapp/WINGS/ClientApp/src/components/command/plan_edit/SetParamTable.tsx rename to ClientApp/src/components/command/plan_edit/SetParamTable.tsx diff --git a/aspnetapp/WINGS/ClientApp/src/components/common/CheckBox.tsx b/ClientApp/src/components/common/CheckBox.tsx similarity index 100% rename from aspnetapp/WINGS/ClientApp/src/components/common/CheckBox.tsx rename to ClientApp/src/components/common/CheckBox.tsx diff --git a/aspnetapp/WINGS/ClientApp/src/components/common/ConfirmationDialog.tsx b/ClientApp/src/components/common/ConfirmationDialog.tsx similarity index 100% rename from aspnetapp/WINGS/ClientApp/src/components/common/ConfirmationDialog.tsx rename to ClientApp/src/components/common/ConfirmationDialog.tsx diff --git a/aspnetapp/WINGS/ClientApp/src/components/common/EditableInputTableCell.tsx b/ClientApp/src/components/common/EditableInputTableCell.tsx similarity index 100% rename from aspnetapp/WINGS/ClientApp/src/components/common/EditableInputTableCell.tsx rename to ClientApp/src/components/common/EditableInputTableCell.tsx diff --git a/aspnetapp/WINGS/ClientApp/src/components/common/EditableSelectTableCell.tsx b/ClientApp/src/components/common/EditableSelectTableCell.tsx similarity index 100% rename from aspnetapp/WINGS/ClientApp/src/components/common/EditableSelectTableCell.tsx rename to ClientApp/src/components/common/EditableSelectTableCell.tsx diff --git a/aspnetapp/WINGS/ClientApp/src/components/common/ErrorDialog.tsx b/ClientApp/src/components/common/ErrorDialog.tsx similarity index 100% rename from aspnetapp/WINGS/ClientApp/src/components/common/ErrorDialog.tsx rename to ClientApp/src/components/common/ErrorDialog.tsx diff --git a/aspnetapp/WINGS/ClientApp/src/components/common/FileTreeMultiView.tsx b/ClientApp/src/components/common/FileTreeMultiView.tsx similarity index 100% rename from aspnetapp/WINGS/ClientApp/src/components/common/FileTreeMultiView.tsx rename to ClientApp/src/components/common/FileTreeMultiView.tsx diff --git a/aspnetapp/WINGS/ClientApp/src/components/common/FileTreeView.tsx b/ClientApp/src/components/common/FileTreeView.tsx similarity index 100% rename from aspnetapp/WINGS/ClientApp/src/components/common/FileTreeView.tsx rename to ClientApp/src/components/common/FileTreeView.tsx diff --git a/aspnetapp/WINGS/ClientApp/src/components/common/IconButtonInTabs.tsx b/ClientApp/src/components/common/IconButtonInTabs.tsx similarity index 100% rename from aspnetapp/WINGS/ClientApp/src/components/common/IconButtonInTabs.tsx rename to ClientApp/src/components/common/IconButtonInTabs.tsx diff --git a/aspnetapp/WINGS/ClientApp/src/components/common/LoadingBackDrop.tsx b/ClientApp/src/components/common/LoadingBackDrop.tsx similarity index 100% rename from aspnetapp/WINGS/ClientApp/src/components/common/LoadingBackDrop.tsx rename to ClientApp/src/components/common/LoadingBackDrop.tsx diff --git a/aspnetapp/WINGS/ClientApp/src/components/common/RadioBox.tsx b/ClientApp/src/components/common/RadioBox.tsx similarity index 100% rename from aspnetapp/WINGS/ClientApp/src/components/common/RadioBox.tsx rename to ClientApp/src/components/common/RadioBox.tsx diff --git a/aspnetapp/WINGS/ClientApp/src/components/common/SelectBox.tsx b/ClientApp/src/components/common/SelectBox.tsx similarity index 100% rename from aspnetapp/WINGS/ClientApp/src/components/common/SelectBox.tsx rename to ClientApp/src/components/common/SelectBox.tsx diff --git a/aspnetapp/WINGS/ClientApp/src/components/common/TransferList.tsx b/ClientApp/src/components/common/TransferList.tsx similarity index 100% rename from aspnetapp/WINGS/ClientApp/src/components/common/TransferList.tsx rename to ClientApp/src/components/common/TransferList.tsx diff --git a/aspnetapp/WINGS/ClientApp/src/components/compo/ComponentList.tsx b/ClientApp/src/components/compo/ComponentList.tsx similarity index 100% rename from aspnetapp/WINGS/ClientApp/src/components/compo/ComponentList.tsx rename to ClientApp/src/components/compo/ComponentList.tsx diff --git a/aspnetapp/WINGS/ClientApp/src/components/compo/ComponentManage.tsx b/ClientApp/src/components/compo/ComponentManage.tsx similarity index 100% rename from aspnetapp/WINGS/ClientApp/src/components/compo/ComponentManage.tsx rename to ClientApp/src/components/compo/ComponentManage.tsx diff --git a/aspnetapp/WINGS/ClientApp/src/components/header/DrawerMenus.tsx b/ClientApp/src/components/header/DrawerMenus.tsx similarity index 100% rename from aspnetapp/WINGS/ClientApp/src/components/header/DrawerMenus.tsx rename to ClientApp/src/components/header/DrawerMenus.tsx diff --git a/aspnetapp/WINGS/ClientApp/src/components/header/Header.tsx b/ClientApp/src/components/header/Header.tsx similarity index 100% rename from aspnetapp/WINGS/ClientApp/src/components/header/Header.tsx rename to ClientApp/src/components/header/Header.tsx diff --git a/aspnetapp/WINGS/ClientApp/src/components/header/HeaderMenus.tsx b/ClientApp/src/components/header/HeaderMenus.tsx similarity index 100% rename from aspnetapp/WINGS/ClientApp/src/components/header/HeaderMenus.tsx rename to ClientApp/src/components/header/HeaderMenus.tsx diff --git a/aspnetapp/WINGS/ClientApp/src/components/history/HistoryDetail.tsx b/ClientApp/src/components/history/HistoryDetail.tsx similarity index 100% rename from aspnetapp/WINGS/ClientApp/src/components/history/HistoryDetail.tsx rename to ClientApp/src/components/history/HistoryDetail.tsx diff --git a/aspnetapp/WINGS/ClientApp/src/components/history/LogExportArea.tsx b/ClientApp/src/components/history/LogExportArea.tsx similarity index 100% rename from aspnetapp/WINGS/ClientApp/src/components/history/LogExportArea.tsx rename to ClientApp/src/components/history/LogExportArea.tsx diff --git a/aspnetapp/WINGS/ClientApp/src/components/history/OperationHistory.tsx b/ClientApp/src/components/history/OperationHistory.tsx similarity index 100% rename from aspnetapp/WINGS/ClientApp/src/components/history/OperationHistory.tsx rename to ClientApp/src/components/history/OperationHistory.tsx diff --git a/aspnetapp/WINGS/ClientApp/src/components/home/Home.tsx b/ClientApp/src/components/home/Home.tsx similarity index 100% rename from aspnetapp/WINGS/ClientApp/src/components/home/Home.tsx rename to ClientApp/src/components/home/Home.tsx diff --git a/aspnetapp/WINGS/ClientApp/src/components/home/OperationList.tsx b/ClientApp/src/components/home/OperationList.tsx similarity index 100% rename from aspnetapp/WINGS/ClientApp/src/components/home/OperationList.tsx rename to ClientApp/src/components/home/OperationList.tsx diff --git a/aspnetapp/WINGS/ClientApp/src/components/home/StartOperationArea.tsx b/ClientApp/src/components/home/StartOperationArea.tsx similarity index 100% rename from aspnetapp/WINGS/ClientApp/src/components/home/StartOperationArea.tsx rename to ClientApp/src/components/home/StartOperationArea.tsx diff --git a/aspnetapp/WINGS/ClientApp/src/components/telemetry/TelemetryViewer.tsx b/ClientApp/src/components/telemetry/TelemetryViewer.tsx similarity index 100% rename from aspnetapp/WINGS/ClientApp/src/components/telemetry/TelemetryViewer.tsx rename to ClientApp/src/components/telemetry/TelemetryViewer.tsx diff --git a/aspnetapp/WINGS/ClientApp/src/components/telemetry/view_display/GraphTabPanel.tsx b/ClientApp/src/components/telemetry/view_display/GraphTabPanel.tsx similarity index 100% rename from aspnetapp/WINGS/ClientApp/src/components/telemetry/view_display/GraphTabPanel.tsx rename to ClientApp/src/components/telemetry/view_display/GraphTabPanel.tsx diff --git a/aspnetapp/WINGS/ClientApp/src/components/telemetry/view_display/OpenGraphTabDialog.tsx b/ClientApp/src/components/telemetry/view_display/OpenGraphTabDialog.tsx similarity index 100% rename from aspnetapp/WINGS/ClientApp/src/components/telemetry/view_display/OpenGraphTabDialog.tsx rename to ClientApp/src/components/telemetry/view_display/OpenGraphTabDialog.tsx diff --git a/aspnetapp/WINGS/ClientApp/src/components/telemetry/view_display/OpenLayoutDialog.tsx b/ClientApp/src/components/telemetry/view_display/OpenLayoutDialog.tsx similarity index 100% rename from aspnetapp/WINGS/ClientApp/src/components/telemetry/view_display/OpenLayoutDialog.tsx rename to ClientApp/src/components/telemetry/view_display/OpenLayoutDialog.tsx diff --git a/aspnetapp/WINGS/ClientApp/src/components/telemetry/view_display/OpenPacketTabDialog.tsx b/ClientApp/src/components/telemetry/view_display/OpenPacketTabDialog.tsx similarity index 100% rename from aspnetapp/WINGS/ClientApp/src/components/telemetry/view_display/OpenPacketTabDialog.tsx rename to ClientApp/src/components/telemetry/view_display/OpenPacketTabDialog.tsx diff --git a/aspnetapp/WINGS/ClientApp/src/components/telemetry/view_display/OpenViewDialog.tsx b/ClientApp/src/components/telemetry/view_display/OpenViewDialog.tsx similarity index 100% rename from aspnetapp/WINGS/ClientApp/src/components/telemetry/view_display/OpenViewDialog.tsx rename to ClientApp/src/components/telemetry/view_display/OpenViewDialog.tsx diff --git a/aspnetapp/WINGS/ClientApp/src/components/telemetry/view_display/PacketTabPanel.tsx b/ClientApp/src/components/telemetry/view_display/PacketTabPanel.tsx similarity index 100% rename from aspnetapp/WINGS/ClientApp/src/components/telemetry/view_display/PacketTabPanel.tsx rename to ClientApp/src/components/telemetry/view_display/PacketTabPanel.tsx diff --git a/aspnetapp/WINGS/ClientApp/src/components/telemetry/view_display/ViewDisplayBlock.tsx b/ClientApp/src/components/telemetry/view_display/ViewDisplayBlock.tsx similarity index 100% rename from aspnetapp/WINGS/ClientApp/src/components/telemetry/view_display/ViewDisplayBlock.tsx rename to ClientApp/src/components/telemetry/view_display/ViewDisplayBlock.tsx diff --git a/aspnetapp/WINGS/ClientApp/src/components/telemetry/view_display/ViewTabPanel.tsx b/ClientApp/src/components/telemetry/view_display/ViewTabPanel.tsx similarity index 100% rename from aspnetapp/WINGS/ClientApp/src/components/telemetry/view_display/ViewTabPanel.tsx rename to ClientApp/src/components/telemetry/view_display/ViewTabPanel.tsx diff --git a/aspnetapp/WINGS/ClientApp/src/constants/index.ts b/ClientApp/src/constants/index.ts similarity index 100% rename from aspnetapp/WINGS/ClientApp/src/constants/index.ts rename to ClientApp/src/constants/index.ts diff --git a/aspnetapp/WINGS/ClientApp/src/index.tsx b/ClientApp/src/index.tsx similarity index 100% rename from aspnetapp/WINGS/ClientApp/src/index.tsx rename to ClientApp/src/index.tsx diff --git a/aspnetapp/WINGS/ClientApp/src/models/Command.ts b/ClientApp/src/models/Command.ts similarity index 100% rename from aspnetapp/WINGS/ClientApp/src/models/Command.ts rename to ClientApp/src/models/Command.ts diff --git a/aspnetapp/WINGS/ClientApp/src/models/CommandPlan.ts b/ClientApp/src/models/CommandPlan.ts similarity index 100% rename from aspnetapp/WINGS/ClientApp/src/models/CommandPlan.ts rename to ClientApp/src/models/CommandPlan.ts diff --git a/aspnetapp/WINGS/ClientApp/src/models/Component.ts b/ClientApp/src/models/Component.ts similarity index 100% rename from aspnetapp/WINGS/ClientApp/src/models/Component.ts rename to ClientApp/src/models/Component.ts diff --git a/aspnetapp/WINGS/ClientApp/src/models/ErrorDialogState.ts b/ClientApp/src/models/ErrorDialogState.ts similarity index 100% rename from aspnetapp/WINGS/ClientApp/src/models/ErrorDialogState.ts rename to ClientApp/src/models/ErrorDialogState.ts diff --git a/aspnetapp/WINGS/ClientApp/src/models/FileIndex.ts b/ClientApp/src/models/FileIndex.ts similarity index 100% rename from aspnetapp/WINGS/ClientApp/src/models/FileIndex.ts rename to ClientApp/src/models/FileIndex.ts diff --git a/aspnetapp/WINGS/ClientApp/src/models/LocationState.ts b/ClientApp/src/models/LocationState.ts similarity index 100% rename from aspnetapp/WINGS/ClientApp/src/models/LocationState.ts rename to ClientApp/src/models/LocationState.ts diff --git a/aspnetapp/WINGS/ClientApp/src/models/Operation.ts b/ClientApp/src/models/Operation.ts similarity index 100% rename from aspnetapp/WINGS/ClientApp/src/models/Operation.ts rename to ClientApp/src/models/Operation.ts diff --git a/aspnetapp/WINGS/ClientApp/src/models/PaginationMeta.ts b/ClientApp/src/models/PaginationMeta.ts similarity index 100% rename from aspnetapp/WINGS/ClientApp/src/models/PaginationMeta.ts rename to ClientApp/src/models/PaginationMeta.ts diff --git a/aspnetapp/WINGS/ClientApp/src/models/Telemetry.ts b/ClientApp/src/models/Telemetry.ts similarity index 100% rename from aspnetapp/WINGS/ClientApp/src/models/Telemetry.ts rename to ClientApp/src/models/Telemetry.ts diff --git a/aspnetapp/WINGS/ClientApp/src/models/TelemetryView.ts b/ClientApp/src/models/TelemetryView.ts similarity index 100% rename from aspnetapp/WINGS/ClientApp/src/models/TelemetryView.ts rename to ClientApp/src/models/TelemetryView.ts diff --git a/aspnetapp/WINGS/ClientApp/src/models/UIState.ts b/ClientApp/src/models/UIState.ts similarity index 100% rename from aspnetapp/WINGS/ClientApp/src/models/UIState.ts rename to ClientApp/src/models/UIState.ts diff --git a/aspnetapp/WINGS/ClientApp/src/models/index.ts b/ClientApp/src/models/index.ts similarity index 100% rename from aspnetapp/WINGS/ClientApp/src/models/index.ts rename to ClientApp/src/models/index.ts diff --git a/aspnetapp/WINGS/ClientApp/src/react-app-env.d.ts b/ClientApp/src/react-app-env.d.ts similarity index 100% rename from aspnetapp/WINGS/ClientApp/src/react-app-env.d.ts rename to ClientApp/src/react-app-env.d.ts diff --git a/aspnetapp/WINGS/ClientApp/src/redux/commands/actions.ts b/ClientApp/src/redux/commands/actions.ts similarity index 100% rename from aspnetapp/WINGS/ClientApp/src/redux/commands/actions.ts rename to ClientApp/src/redux/commands/actions.ts diff --git a/aspnetapp/WINGS/ClientApp/src/redux/commands/reducers.ts b/ClientApp/src/redux/commands/reducers.ts similarity index 100% rename from aspnetapp/WINGS/ClientApp/src/redux/commands/reducers.ts rename to ClientApp/src/redux/commands/reducers.ts diff --git a/aspnetapp/WINGS/ClientApp/src/redux/commands/selectors.ts b/ClientApp/src/redux/commands/selectors.ts similarity index 100% rename from aspnetapp/WINGS/ClientApp/src/redux/commands/selectors.ts rename to ClientApp/src/redux/commands/selectors.ts diff --git a/aspnetapp/WINGS/ClientApp/src/redux/operations/actions.ts b/ClientApp/src/redux/operations/actions.ts similarity index 100% rename from aspnetapp/WINGS/ClientApp/src/redux/operations/actions.ts rename to ClientApp/src/redux/operations/actions.ts diff --git a/aspnetapp/WINGS/ClientApp/src/redux/operations/operations.ts b/ClientApp/src/redux/operations/operations.ts similarity index 100% rename from aspnetapp/WINGS/ClientApp/src/redux/operations/operations.ts rename to ClientApp/src/redux/operations/operations.ts diff --git a/aspnetapp/WINGS/ClientApp/src/redux/operations/reducers.ts b/ClientApp/src/redux/operations/reducers.ts similarity index 100% rename from aspnetapp/WINGS/ClientApp/src/redux/operations/reducers.ts rename to ClientApp/src/redux/operations/reducers.ts diff --git a/aspnetapp/WINGS/ClientApp/src/redux/operations/selectors.ts b/ClientApp/src/redux/operations/selectors.ts similarity index 100% rename from aspnetapp/WINGS/ClientApp/src/redux/operations/selectors.ts rename to ClientApp/src/redux/operations/selectors.ts diff --git a/aspnetapp/WINGS/ClientApp/src/redux/plans/actions.ts b/ClientApp/src/redux/plans/actions.ts similarity index 100% rename from aspnetapp/WINGS/ClientApp/src/redux/plans/actions.ts rename to ClientApp/src/redux/plans/actions.ts diff --git a/aspnetapp/WINGS/ClientApp/src/redux/plans/operations.ts b/ClientApp/src/redux/plans/operations.ts similarity index 100% rename from aspnetapp/WINGS/ClientApp/src/redux/plans/operations.ts rename to ClientApp/src/redux/plans/operations.ts diff --git a/aspnetapp/WINGS/ClientApp/src/redux/plans/reducers.ts b/ClientApp/src/redux/plans/reducers.ts similarity index 100% rename from aspnetapp/WINGS/ClientApp/src/redux/plans/reducers.ts rename to ClientApp/src/redux/plans/reducers.ts diff --git a/aspnetapp/WINGS/ClientApp/src/redux/plans/selectors.ts b/ClientApp/src/redux/plans/selectors.ts similarity index 100% rename from aspnetapp/WINGS/ClientApp/src/redux/plans/selectors.ts rename to ClientApp/src/redux/plans/selectors.ts diff --git a/aspnetapp/WINGS/ClientApp/src/redux/store/RootState.ts b/ClientApp/src/redux/store/RootState.ts similarity index 100% rename from aspnetapp/WINGS/ClientApp/src/redux/store/RootState.ts rename to ClientApp/src/redux/store/RootState.ts diff --git a/aspnetapp/WINGS/ClientApp/src/redux/store/initialState.ts b/ClientApp/src/redux/store/initialState.ts similarity index 100% rename from aspnetapp/WINGS/ClientApp/src/redux/store/initialState.ts rename to ClientApp/src/redux/store/initialState.ts diff --git a/aspnetapp/WINGS/ClientApp/src/redux/store/store.ts b/ClientApp/src/redux/store/store.ts similarity index 100% rename from aspnetapp/WINGS/ClientApp/src/redux/store/store.ts rename to ClientApp/src/redux/store/store.ts diff --git a/aspnetapp/WINGS/ClientApp/src/redux/telemetries/actions.ts b/ClientApp/src/redux/telemetries/actions.ts similarity index 100% rename from aspnetapp/WINGS/ClientApp/src/redux/telemetries/actions.ts rename to ClientApp/src/redux/telemetries/actions.ts diff --git a/aspnetapp/WINGS/ClientApp/src/redux/telemetries/reducers.ts b/ClientApp/src/redux/telemetries/reducers.ts similarity index 100% rename from aspnetapp/WINGS/ClientApp/src/redux/telemetries/reducers.ts rename to ClientApp/src/redux/telemetries/reducers.ts diff --git a/aspnetapp/WINGS/ClientApp/src/redux/telemetries/selectors.ts b/ClientApp/src/redux/telemetries/selectors.ts similarity index 100% rename from aspnetapp/WINGS/ClientApp/src/redux/telemetries/selectors.ts rename to ClientApp/src/redux/telemetries/selectors.ts diff --git a/aspnetapp/WINGS/ClientApp/src/redux/ui/actions.ts b/ClientApp/src/redux/ui/actions.ts similarity index 100% rename from aspnetapp/WINGS/ClientApp/src/redux/ui/actions.ts rename to ClientApp/src/redux/ui/actions.ts diff --git a/aspnetapp/WINGS/ClientApp/src/redux/ui/reducers.ts b/ClientApp/src/redux/ui/reducers.ts similarity index 100% rename from aspnetapp/WINGS/ClientApp/src/redux/ui/reducers.ts rename to ClientApp/src/redux/ui/reducers.ts diff --git a/aspnetapp/WINGS/ClientApp/src/redux/ui/selectors.ts b/ClientApp/src/redux/ui/selectors.ts similarity index 100% rename from aspnetapp/WINGS/ClientApp/src/redux/ui/selectors.ts rename to ClientApp/src/redux/ui/selectors.ts diff --git a/aspnetapp/WINGS/ClientApp/src/redux/views/actions.ts b/ClientApp/src/redux/views/actions.ts similarity index 100% rename from aspnetapp/WINGS/ClientApp/src/redux/views/actions.ts rename to ClientApp/src/redux/views/actions.ts diff --git a/aspnetapp/WINGS/ClientApp/src/redux/views/reducers.ts b/ClientApp/src/redux/views/reducers.ts similarity index 100% rename from aspnetapp/WINGS/ClientApp/src/redux/views/reducers.ts rename to ClientApp/src/redux/views/reducers.ts diff --git a/aspnetapp/WINGS/ClientApp/src/redux/views/selectors.ts b/ClientApp/src/redux/views/selectors.ts similarity index 100% rename from aspnetapp/WINGS/ClientApp/src/redux/views/selectors.ts rename to ClientApp/src/redux/views/selectors.ts diff --git a/aspnetapp/WINGS/ClientApp/tsconfig.eslint.json b/ClientApp/tsconfig.eslint.json similarity index 100% rename from aspnetapp/WINGS/ClientApp/tsconfig.eslint.json rename to ClientApp/tsconfig.eslint.json diff --git a/aspnetapp/WINGS/ClientApp/tsconfig.json b/ClientApp/tsconfig.json similarity index 100% rename from aspnetapp/WINGS/ClientApp/tsconfig.json rename to ClientApp/tsconfig.json diff --git a/docker-compose.yml b/docker-compose.yml index 0cb5125a..229200b7 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -26,7 +26,7 @@ services: frontend: image: wings-frontend-img build: - context: ./aspnetapp/WINGS/ClientApp + context: ./ClientApp dockerfile: Dockerfile container_name: wings-frontend-ctr environment: From 6f3c0578c11d63b8fd9b1f053c35d6f3415a7b8e Mon Sep 17 00:00:00 2001 From: whatacotton Date: Thu, 31 Jul 2025 23:56:43 +0900 Subject: [PATCH 3/3] fix fetch settings for baseurl --- ClientApp/Dockerfile | 32 +++++------------ ClientApp/nginx.conf | 32 ----------------- ClientApp/package-lock.json | 35 +++++++++++++------ ClientApp/package.json | 2 ++ ClientApp/src/App.tsx | 3 +- .../command/log_display/CmdLogDisplayArea.tsx | 3 +- .../src/components/compo/ComponentList.tsx | 7 ++-- .../src/components/compo/ComponentManage.tsx | 3 +- .../components/history/OperationHistory.tsx | 5 +-- ClientApp/src/components/home/Home.tsx | 3 +- .../src/components/home/OperationList.tsx | 3 +- .../components/home/StartOperationArea.tsx | 5 +-- ClientApp/src/lib/fetch.ts | 23 ++++++++++++ aspnetapp/WINGS/Startup.cs | 2 +- docker-compose.yml | 8 +++-- 15 files changed, 83 insertions(+), 83 deletions(-) delete mode 100644 ClientApp/nginx.conf create mode 100644 ClientApp/src/lib/fetch.ts diff --git a/ClientApp/Dockerfile b/ClientApp/Dockerfile index 3a7de34d..bdfb8594 100644 --- a/ClientApp/Dockerfile +++ b/ClientApp/Dockerfile @@ -1,35 +1,19 @@ -# マルチステージビルド: ビルド段階 -FROM node:18-alpine AS build +FROM node:18-alpine WORKDIR /app -# package.json と package-lock.json をコピー(依存関係のキャッシュ効率化) +# package.json と package-lock.json をコピー COPY package*.json ./ -# ビルドに必要なすべての依存関係をインストール(devDependenciesも含む) +# 依存関係をインストール RUN npm ci -# ソースコードをコピー(.dockerignoreで不要ファイルを除外) +# ソースコードをコピー COPY . . -# 環境変数設定 -ENV REACT_APP_API_BASE_URL=http://backend:5000/api -ENV GENERATE_SOURCEMAP=false -ENV ESLINT_NO_DEV_ERRORS=true -ENV TSC_COMPILE_ON_ERROR=true -# プロダクションビルド -RUN npm run build +# ポート3000を公開 +EXPOSE 3000 -# マルチステージビルド: 本番段階 -FROM nginx:alpine - -# ビルド済みファイルをNginxの配信ディレクトリにコピー -COPY --from=build /app/build /usr/share/nginx/html - -# Nginx設定ファイル -COPY nginx.conf /etc/nginx/nginx.conf - -EXPOSE 80 - -CMD ["nginx", "-g", "daemon off;"] +# React開発サーバーを起動 +CMD ["npm", "run", "start"] diff --git a/ClientApp/nginx.conf b/ClientApp/nginx.conf deleted file mode 100644 index c5620b78..00000000 --- a/ClientApp/nginx.conf +++ /dev/null @@ -1,32 +0,0 @@ -events { - worker_connections 1024; -} - -http { - include /etc/nginx/mime.types; - default_type application/octet-stream; - - server { - listen 80; - server_name localhost; - root /usr/share/nginx/html; - index index.html; - - location / { - try_files $uri $uri/ /index.html; - } - - location /api/ { - proxy_pass http://backend:5000/api/; - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Proto $scheme; - } - - location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ { - expires 1y; - add_header Cache-Control "public, immutable"; - } - } -} diff --git a/ClientApp/package-lock.json b/ClientApp/package-lock.json index 4272be48..e137de34 100644 --- a/ClientApp/package-lock.json +++ b/ClientApp/package-lock.json @@ -21,6 +21,7 @@ "@rollup/plugin-terser": "^0.4.4", "browserslist": "^4.16.6", "chart.js": "^4.4.3", + "dotenv": "^17.2.1", "file-saver": "^2.0.5", "font-awesome": "^4.7.0", "glob": "^10.4.2", @@ -47,6 +48,7 @@ "devDependencies": { "@redux-devtools/app": "^6.1.0", "@types/file-saver": "^2.0.1", + "@types/node": "^24.1.0", "@types/react-dom": "^18.3.0", "@types/react-redux": "^7.1.33", "@types/react-router": "^5.1.20", @@ -5716,11 +5718,11 @@ "integrity": "sha512-/pyBZWSLD2n0dcHE3hq8s8ZvcETHtEuF+3E7XVt0Ig2nvsVQXdghHVcEkIWjy9A0wKfTn97a/PSDYohKIlnP/w==" }, "node_modules/@types/node": { - "version": "20.14.9", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.14.9.tgz", - "integrity": "sha512-06OCtnTXtWOZBJlRApleWndH4JsRVs1pDCc8dLSQp+7PpUpX3ePdHyeNSFTeSe7FtKyQkrlPvHwJOW3SLd8Oyg==", + "version": "24.1.0", + "resolved": "https://registry.npmjs.org/@types/node/-/node-24.1.0.tgz", + "integrity": "sha512-ut5FthK5moxFKH2T1CUOC6ctR67rQRvvHdFLCD2Ql6KXmMuCrjsSsRI9UsLCm9M18BMwClv4pn327UvB7eeO1w==", "dependencies": { - "undici-types": "~5.26.4" + "undici-types": "~7.8.0" } }, "node_modules/@types/node-forge": { @@ -9371,11 +9373,14 @@ } }, "node_modules/dotenv": { - "version": "10.0.0", - "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-10.0.0.tgz", - "integrity": "sha512-rlBi9d8jpv9Sf1klPjNfFAuWDjKLwTIJJ/VxtoTwIR6hnZxcEOQCZg2oIL3MWBYw5GpUDKOEnND7LXTbIpQ03Q==", + "version": "17.2.1", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-17.2.1.tgz", + "integrity": "sha512-kQhDYKZecqnM0fCnzI5eIv5L4cAe/iRI+HqMbO/hbRdTAeXDG+M9FjipUxNfbARuEg4iHIbhnhs78BCHNbSxEQ==", "engines": { - "node": ">=10" + "node": ">=12" + }, + "funding": { + "url": "https://dotenvx.com" } }, "node_modules/dotenv-expand": { @@ -18026,6 +18031,14 @@ } } }, + "node_modules/react-scripts/node_modules/dotenv": { + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-10.0.0.tgz", + "integrity": "sha512-rlBi9d8jpv9Sf1klPjNfFAuWDjKLwTIJJ/VxtoTwIR6hnZxcEOQCZg2oIL3MWBYw5GpUDKOEnND7LXTbIpQ03Q==", + "engines": { + "node": ">=10" + } + }, "node_modules/react-scripts/node_modules/semver": { "version": "7.6.2", "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.2.tgz", @@ -20470,9 +20483,9 @@ "integrity": "sha512-hEQt0+ZLDVUMhebKxL4x1BTtDY7bavVofhZ9KZ4aI26X9SRaE+Y3m83XUL1UP2jn8ynjndwCCpEHdUG+9pP1Tw==" }, "node_modules/undici-types": { - "version": "5.26.5", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", - "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==" + "version": "7.8.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.8.0.tgz", + "integrity": "sha512-9UJ2xGDvQ43tYyVMpuHlsgApydB8ZKfVYTsLDhXkFL/6gfkp+U8xTGdh8pMJv1SpZna0zxG1DwsKZsreLbXBxw==" }, "node_modules/unicode-canonical-property-names-ecmascript": { "version": "2.0.0", diff --git a/ClientApp/package.json b/ClientApp/package.json index ac7cf795..6597b38d 100644 --- a/ClientApp/package.json +++ b/ClientApp/package.json @@ -16,6 +16,7 @@ "@rollup/plugin-terser": "^0.4.4", "browserslist": "^4.16.6", "chart.js": "^4.4.3", + "dotenv": "^17.2.1", "file-saver": "^2.0.5", "font-awesome": "^4.7.0", "glob": "^10.4.2", @@ -42,6 +43,7 @@ "devDependencies": { "@redux-devtools/app": "^6.1.0", "@types/file-saver": "^2.0.1", + "@types/node": "^24.1.0", "@types/react-dom": "^18.3.0", "@types/react-redux": "^7.1.33", "@types/react-router": "^5.1.20", diff --git a/ClientApp/src/App.tsx b/ClientApp/src/App.tsx index 1da3ca9b..5df256e6 100644 --- a/ClientApp/src/App.tsx +++ b/ClientApp/src/App.tsx @@ -9,6 +9,7 @@ import { RootState } from './redux/store/RootState'; import { updateLatestTelemetriesAction, addTelemetryHistoriesAction } from './redux/telemetries/actions'; import "./assets/style.css"; import { TelemetryPacketJson } from './models'; +import { apiFetch } from './lib/fetch'; export function useValueRef(val: T) { const ref = React.useRef(val); @@ -27,7 +28,7 @@ const App = () => { const fetchTelemetry = async () => { if (opid === "") return; - const res = await fetch(`/api/operations/${opid}/tlm?refTlmTime=${refTime.current}`, { + const res = await apiFetch(`/api/operations/${opid}/tlm?refTlmTime=${refTime.current}`, { method: 'GET' }); if (res.status == 200) { diff --git a/ClientApp/src/components/command/log_display/CmdLogDisplayArea.tsx b/ClientApp/src/components/command/log_display/CmdLogDisplayArea.tsx index c270dd3b..063f1594 100644 --- a/ClientApp/src/components/command/log_display/CmdLogDisplayArea.tsx +++ b/ClientApp/src/components/command/log_display/CmdLogDisplayArea.tsx @@ -7,6 +7,7 @@ import Button from '@mui/material/Button'; import { getOpid } from '../../../redux/operations/selectors'; import { updateCommandLogAction } from '../../../redux/commands/actions'; import { CommandLogsJson } from '../../../models'; +import { apiFetch } from '../../../lib/fetch'; const CmdLogDisplayArea = () => { const dispatch = useDispatch(); @@ -16,7 +17,7 @@ const CmdLogDisplayArea = () => { const handleOk = async () => { if (opid === "") return; - const res = await fetch(`/api/operations/${opid}/cmd_fileline/log`, { + const res = await apiFetch(`/api/operations/${opid}/cmd_fileline/log`, { method: 'GET' }); const json = await res.json() as CommandLogsJson; diff --git a/ClientApp/src/components/compo/ComponentList.tsx b/ClientApp/src/components/compo/ComponentList.tsx index bf2e966e..59c92c54 100644 --- a/ClientApp/src/components/compo/ComponentList.tsx +++ b/ClientApp/src/components/compo/ComponentList.tsx @@ -19,6 +19,7 @@ import { openErrorDialogAction } from '../../redux/ui/actions'; import ConfirmationDialog from '../common/ConfirmationDialog'; import EditableInputTableCell from '../common/EditableInputTableCell'; import EditableSelectTableCell from '../common/EditableSelectTableCell'; +import { apiFetch } from '../../lib/fetch'; const initialValues = { name: "", @@ -53,7 +54,7 @@ const ComponentList = (props: ComponentListProps) => { const handleOkClick = async () => { if (deleteCompo === null) return; try { - await fetch(`/api/components/${deleteCompo.id}`, { + await apiFetch(`/api/components/${deleteCompo.id}`, { method: 'DELETE' }); updateState(); @@ -93,7 +94,7 @@ const ComponentList = (props: ComponentListProps) => { const updateComponent = async (i: number) => { try { const compo = compos[i]; - const res = await fetch(`/api/components/${compo.id}`, { + const res = await apiFetch(`/api/components/${compo.id}`, { method: 'PUT', headers: { 'Content-Type': 'application/json', @@ -128,7 +129,7 @@ const ComponentList = (props: ComponentListProps) => { const createComponent = async () => { try { - const res = await fetch(`/api/components`, { + const res = await apiFetch(`/api/components`, { method: 'POST', headers: { 'Content-Type': 'application/json', diff --git a/ClientApp/src/components/compo/ComponentManage.tsx b/ClientApp/src/components/compo/ComponentManage.tsx index ce5c548e..0f3cda11 100644 --- a/ClientApp/src/components/compo/ComponentManage.tsx +++ b/ClientApp/src/components/compo/ComponentManage.tsx @@ -1,13 +1,14 @@ import React, { useEffect, useState } from 'react'; import { Component, ComponentJson } from '../../models'; import ComponentList from './ComponentList'; +import { apiFetch } from '../../lib/fetch'; const ComponentManage = () => { const [compos, setCompos] = useState([]); const fetchData = async () => { try { - const response_compo = await fetch('/api/components', { + const response_compo = await apiFetch('/api/components', { method: 'GET' }); if (response_compo.status === 200) { diff --git a/ClientApp/src/components/history/OperationHistory.tsx b/ClientApp/src/components/history/OperationHistory.tsx index 2a21542c..804cf06a 100644 --- a/ClientApp/src/components/history/OperationHistory.tsx +++ b/ClientApp/src/components/history/OperationHistory.tsx @@ -16,6 +16,7 @@ import DeleteIcon from '@mui/icons-material/Delete'; import SearchIcon from '@mui/icons-material/Search'; import { Operation, PaginationMeta } from '../../models'; import ConfirmationDialog from '../common/ConfirmationDialog'; +import { apiFetch } from '../../lib/fetch'; const sizePerPage = 12; @@ -34,7 +35,7 @@ const OperationHistory = () => { const fetchOperations = async () => { try { - const response = await fetch(`/api/operations/history?page=${page}&size=${sizePerPage}&search=${search}`, { + const response = await apiFetch(`/api/operations/history?page=${page}&size=${sizePerPage}&search=${search}`, { method: 'GET' }); if (response.status == 200) { @@ -80,7 +81,7 @@ const OperationHistory = () => { const handleOkClick = async () => { if (deleteOperation === null) return; try { - const response = await fetch(`/api/operations/${deleteOperation.id}/history`, { + const response = await apiFetch(`/api/operations/${deleteOperation.id}/history`, { method: 'DELETE' }); if (response.ok) { diff --git a/ClientApp/src/components/home/Home.tsx b/ClientApp/src/components/home/Home.tsx index f9e75339..aeea7bc7 100644 --- a/ClientApp/src/components/home/Home.tsx +++ b/ClientApp/src/components/home/Home.tsx @@ -6,6 +6,7 @@ import { Operation } from '../../models'; import { RootState } from '../../redux/store/RootState'; import { getOpid } from '../../redux/operations/selectors'; import { leaveOperationAction } from '../../redux/operations/actions'; +import { apiFetch } from '../../lib/fetch'; const Home = () => { const dispatch = useDispatch(); @@ -16,7 +17,7 @@ const Home = () => { const fetchOperations = async () => { try { - const res = await fetch('/api/operations', { + const res = await apiFetch('/api/operations', { method: 'GET' }); if (res.status === 200) { diff --git a/ClientApp/src/components/home/OperationList.tsx b/ClientApp/src/components/home/OperationList.tsx index 3358a98d..c7055f87 100644 --- a/ClientApp/src/components/home/OperationList.tsx +++ b/ClientApp/src/components/home/OperationList.tsx @@ -21,6 +21,7 @@ import { cyan } from "@mui/material/colors"; import ConfirmationDialog from '../common/ConfirmationDialog'; import { openErrorDialogAction } from '../../redux/ui/actions'; import { AppDispatch } from '../../redux/store/store'; +import { apiFetch } from '../../lib/fetch'; export interface OperationListProps { operations: Operation[], @@ -48,7 +49,7 @@ const OperationList = (props: OperationListProps) => { const handleOk = async () => { if (stopOperation === null) return; - const res = await fetch(`/api/operations/${stopOperation.id}`, { + const res = await apiFetch(`/api/operations/${stopOperation.id}`, { method: 'DELETE' }) if (res.status === 204) { diff --git a/ClientApp/src/components/home/StartOperationArea.tsx b/ClientApp/src/components/home/StartOperationArea.tsx index a8b368e6..cb560d8c 100644 --- a/ClientApp/src/components/home/StartOperationArea.tsx +++ b/ClientApp/src/components/home/StartOperationArea.tsx @@ -5,6 +5,7 @@ import RadioBox from '../common/RadioBox'; import { Component, ComponentJson } from '../../models'; import { useDispatch } from 'react-redux'; import { openErrorDialogAction, startLoadingAction, endLoadingAction } from '../../redux/ui/actions'; +import { apiFetch } from '../../lib/fetch'; const getDefaultPathNumber = () => { const dt = new Date(); @@ -48,7 +49,7 @@ const StartOperationArea = (props: StartOperationAreaProps) => { const fetchComponents = async () => { try { - const res = await fetch('/api/components', { + const res = await apiFetch('/api/components', { method: 'GET' }); if (res.status === 200) { @@ -72,7 +73,7 @@ const StartOperationArea = (props: StartOperationAreaProps) => { const startOperation = async () => { dispatch(startLoadingAction()); - const res = await fetch(`/api/operations`, { + const res = await apiFetch(`/api/operations`, { method: 'POST', headers: { 'Content-Type': 'application/json' diff --git a/ClientApp/src/lib/fetch.ts b/ClientApp/src/lib/fetch.ts new file mode 100644 index 00000000..003d39b8 --- /dev/null +++ b/ClientApp/src/lib/fetch.ts @@ -0,0 +1,23 @@ +// API設定 +export const API_CONFIG = { + baseURL: 'http://localhost:5000', +}; + +/** + * APIのURLを構築する関数 + * @param path APIのパス + * @returns 完全なAPIのURL + */ +export const buildApiUrl = (path: string): string => { + return `${API_CONFIG.baseURL}${path.startsWith('/') ? path : `/${path}`}`; +}; + +/** + * fetchのラッパー関数 + * @param path APIのパス + * @param options fetchのオプション + * @returns fetchのPromise + */ +export const apiFetch = (path: string, options?: RequestInit): Promise => { + return fetch(buildApiUrl(path), options); +}; \ No newline at end of file diff --git a/aspnetapp/WINGS/Startup.cs b/aspnetapp/WINGS/Startup.cs index b0a97aac..424360e5 100644 --- a/aspnetapp/WINGS/Startup.cs +++ b/aspnetapp/WINGS/Startup.cs @@ -45,7 +45,7 @@ public void ConfigureServices(IServiceCollection services) { options.AddPolicy("AllowFrontend", policy => { - policy.WithOrigins("http://localhost:3000", "http://frontend:80") + policy.WithOrigins("http://localhost:3000", "http://frontend:3000") .AllowAnyHeader() .AllowAnyMethod() .AllowCredentials(); diff --git a/docker-compose.yml b/docker-compose.yml index 229200b7..dab8fb9f 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -24,15 +24,17 @@ services: - wings-network frontend: - image: wings-frontend-img + image: wings-frontend-dev-img build: context: ./ClientApp - dockerfile: Dockerfile container_name: wings-frontend-ctr + volumes: + - "./ClientApp:/app" + - "/app/node_modules" environment: - REACT_APP_API_BASE_URL=http://backend:5000/api ports: - - "3000:80" + - "3000:3000" depends_on: - backend networks: