Files
geutebruck/geutebruck-api/start-services.ps1
Administrator c9e83e4277 feat: Add compact table views with advanced filtering and batch operations
- Enhanced Flutter web app management in PowerShell scripts
  - Added Flutter web server to start-services.ps1 as 4th service
  - Updated stop-services.ps1 to stop Flutter web server
  - Improved service orchestration and startup sequence

- Implemented server caching for improved resilience
  - Added ServerCacheService for browser localStorage caching
  - Server lists persist across service restarts
  - Automatic fallback to cached data when API unavailable
  - Action picker categories always visible regardless of server status

- Redesigned Action Mappings view with compact table layout
  - Replaced card-based ListView with DataTable for higher density
  - Added real-time search across name, input, output, description
  - Implemented multi-filter support (status: enabled/disabled)
  - Added column sorting (name, input, output, status, executions)
  - Batch operations: select all/multiple, batch delete
  - Reduced row height from ~120px to 56px for better overview

- Redesigned Servers Management view with compact table layout
  - Replaced card-based ListView with DataTable
  - Added search by alias, host, user
  - Multi-filter support (type: all/G-Core/GeViScope, status: all/enabled/disabled)
  - Column sorting (alias, host, user, type, status)
  - Batch operations: select all/multiple, batch delete
  - Color-coded type and status badges

- Improved action picker dialog for GSC/G-Core actions
  - GSC and G-Core categories always visible
  - Server validation with clear error messages
  - Fixed duplicate checkbox issue in table headers
  - Debug logging for troubleshooting server parameter issues

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-02 22:52:51 +01:00

148 lines
6.5 KiB
PowerShell

# Start Geutebruck API Services
# This script starts GeViServer, SDK Bridge, Python API, and Flutter Web App
$ErrorActionPreference = "Stop"
Write-Host "========================================" -ForegroundColor Cyan
Write-Host "Starting Geutebruck API Services" -ForegroundColor Cyan
Write-Host "========================================" -ForegroundColor Cyan
Write-Host ""
# Paths
$geviServerExe = "C:\GEVISOFT\GeViServer.exe"
$sdkBridgePath = "C:\DEV\COPILOT\geutebruck-api\src\sdk-bridge\GeViScopeBridge\bin\Release\net8.0"
$sdkBridgeExe = "$sdkBridgePath\GeViScopeBridge.exe"
$apiPath = "C:\DEV\COPILOT\geutebruck-api\src\api"
$venvPython = "C:\DEV\COPILOT\geutebruck-api\.venv\Scripts\python.exe"
$uvicorn = "C:\DEV\COPILOT\geutebruck-api\.venv\Scripts\uvicorn.exe"
$flutterWebPath = "C:\DEV\COPILOT\geutebruck_app\build\web"
# Function to wait for port to be listening
function Wait-ForPort {
param(
[int]$Port,
[int]$TimeoutSeconds = 60
)
$elapsed = 0
while ($elapsed -lt $TimeoutSeconds) {
$connection = Get-NetTCPConnection -LocalPort $Port -State Listen -ErrorAction SilentlyContinue
if ($connection) {
return $true
}
Start-Sleep -Seconds 2
$elapsed += 2
Write-Host "." -NoNewline -ForegroundColor Gray
}
return $false
}
# Check if already running
$geviServerRunning = Get-Process -Name "GeViServer" -ErrorAction SilentlyContinue
$sdkBridgeRunning = Get-Process -Name "GeViScopeBridge" -ErrorAction SilentlyContinue
$uvicornRunning = Get-Process -Name "uvicorn" -ErrorAction SilentlyContinue
$flutterRunning = Get-NetTCPConnection -LocalPort 8081 -State Listen -ErrorAction SilentlyContinue
# Start GeViServer
if ($geviServerRunning) {
Write-Host "[SKIP] GeViServer is already running (PID: $($geviServerRunning.Id))" -ForegroundColor Yellow
} else {
Write-Host "[1/4] Starting GeViServer..." -ForegroundColor Green
Start-Process -FilePath $geviServerExe -ArgumentList "console" -WorkingDirectory "C:\GEVISOFT" -WindowStyle Hidden
# Wait for GeViServer to start listening on port 7700
Write-Host " Waiting for GeViServer to initialize" -NoNewline -ForegroundColor Gray
if (Wait-ForPort -Port 7700 -TimeoutSeconds 60) {
Write-Host ""
$process = Get-Process -Name "GeViServer" -ErrorAction SilentlyContinue
Write-Host " [OK] GeViServer started (PID: $($process.Id))" -ForegroundColor Green
} else {
Write-Host ""
Write-Host " [ERROR] GeViServer failed to start listening on port 7700" -ForegroundColor Red
exit 1
}
}
# Start SDK Bridge
if ($sdkBridgeRunning) {
Write-Host "[SKIP] SDK Bridge is already running (PID: $($sdkBridgeRunning.Id))" -ForegroundColor Yellow
} else {
Write-Host "[2/4] Starting SDK Bridge..." -ForegroundColor Green
Start-Process -FilePath $sdkBridgeExe -WorkingDirectory $sdkBridgePath -WindowStyle Hidden
# Wait for SDK Bridge to start listening on port 50051
Write-Host " Waiting for SDK Bridge to connect" -NoNewline -ForegroundColor Gray
if (Wait-ForPort -Port 50051 -TimeoutSeconds 30) {
Write-Host ""
$process = Get-Process -Name "GeViScopeBridge" -ErrorAction SilentlyContinue
Write-Host " [OK] SDK Bridge started (PID: $($process.Id))" -ForegroundColor Green
} else {
Write-Host ""
Write-Host " [ERROR] SDK Bridge failed to start listening on port 50051" -ForegroundColor Red
exit 1
}
}
# Start Python API
if ($uvicornRunning) {
Write-Host "[SKIP] Python API is already running (PID: $($uvicornRunning.Id))" -ForegroundColor Yellow
} else {
Write-Host "[3/4] Starting Python API..." -ForegroundColor Green
Start-Process -FilePath $uvicorn `
-ArgumentList "main:app", "--host", "0.0.0.0", "--port", "8000", "--reload" `
-WorkingDirectory $apiPath `
-WindowStyle Hidden
# Wait for API to start listening on port 8000
Write-Host " Waiting for API to initialize" -NoNewline -ForegroundColor Gray
if (Wait-ForPort -Port 8000 -TimeoutSeconds 20) {
Write-Host ""
$process = Get-Process -Name "uvicorn" -ErrorAction SilentlyContinue
Write-Host " [OK] Python API started (PID: $($process.Id))" -ForegroundColor Green
} else {
Write-Host ""
Write-Host " [ERROR] Python API failed to start listening on port 8000" -ForegroundColor Red
exit 1
}
}
# Start Flutter Web Server
if ($flutterRunning) {
$flutterProcess = Get-NetTCPConnection -LocalPort 8081 -State Listen -ErrorAction SilentlyContinue |
Select-Object -First 1 -ExpandProperty OwningProcess
Write-Host "[SKIP] Flutter Web is already running (PID: $flutterProcess)" -ForegroundColor Yellow
} else {
Write-Host "[4/4] Starting Flutter Web Server..." -ForegroundColor Green
Start-Process -FilePath "python" `
-ArgumentList "-m", "http.server", "8081", "--bind", "0.0.0.0" `
-WorkingDirectory $flutterWebPath `
-WindowStyle Hidden
# Wait for Flutter Web to start listening on port 8081
Write-Host " Waiting for Flutter Web to initialize" -NoNewline -ForegroundColor Gray
if (Wait-ForPort -Port 8081 -TimeoutSeconds 10) {
Write-Host ""
$flutterProcess = Get-NetTCPConnection -LocalPort 8081 -State Listen -ErrorAction SilentlyContinue |
Select-Object -First 1 -ExpandProperty OwningProcess
Write-Host " [OK] Flutter Web started (PID: $flutterProcess)" -ForegroundColor Green
} else {
Write-Host ""
Write-Host " [ERROR] Flutter Web failed to start listening on port 8081" -ForegroundColor Red
exit 1
}
}
Write-Host ""
Write-Host "========================================" -ForegroundColor Green
Write-Host "Services Started Successfully!" -ForegroundColor Green
Write-Host "========================================" -ForegroundColor Green
Write-Host ""
Write-Host "GeViServer: Running on ports 7700-7703" -ForegroundColor Cyan
Write-Host "SDK Bridge: Running on port 50051 (gRPC)" -ForegroundColor Cyan
Write-Host "Python API: http://localhost:8000" -ForegroundColor Cyan
Write-Host "Swagger UI: http://localhost:8000/docs" -ForegroundColor Cyan
Write-Host "Flutter Web: http://localhost:8081" -ForegroundColor Cyan
Write-Host ""
Write-Host "To check status, run: .\status-services.ps1" -ForegroundColor Yellow
Write-Host "To stop services, run: .\stop-services.ps1" -ForegroundColor Yellow