From f5a658b4f06afc5cecfce0323688a8b7596bfc97 Mon Sep 17 00:00:00 2001 From: "a.tolmachev" Date: Tue, 31 Mar 2026 22:07:12 +0300 Subject: [PATCH] feat: add clean public routes for alpine ui --- TASKS.md | 1 + apps/ui/html/agents.html | 26 +++++----- apps/ui/html/api-keys.html | 24 ++++----- apps/ui/html/logs.html | 24 ++++----- apps/ui/html/settings.html | 24 ++++----- apps/ui/html/usage.html | 24 ++++----- apps/ui/html/wizard/index.html | 24 ++++----- apps/ui/html/workspace-setup.html | 2 +- apps/ui/index.html | 26 +++++----- apps/ui/js/auth.js | 4 +- apps/ui/js/catalog.js | 5 +- apps/ui/js/config.js | 31 +++++------ apps/ui/js/nav.js | 4 +- apps/ui/js/wizard.js | 4 +- apps/ui/js/workspace-setup.js | 2 +- apps/ui/js/workspace.js | 2 +- apps/ui/nginx.conf | 86 +++++++++++++++++++++++++++++++ 17 files changed, 198 insertions(+), 115 deletions(-) diff --git a/TASKS.md b/TASKS.md index 62aeb5e..7188e4b 100644 --- a/TASKS.md +++ b/TASKS.md @@ -10,6 +10,7 @@ DoD: - Alpine UI pages have consistent feedback and shell state - Settings page exposes only honest live functionality and clearly marks deferred capabilities - Wizard live actions have stable loading and feedback behavior on real backend requests +- Public UI routes use clean canonical paths instead of exposing `/html/...` ## Next diff --git a/apps/ui/html/agents.html b/apps/ui/html/agents.html index bec89ed..277372e 100644 --- a/apps/ui/html/agents.html +++ b/apps/ui/html/agents.html @@ -23,7 +23,7 @@
- Operations - Agents - API Keys - Logs - Usage + Operations + Agents + API Keys + Logs + Usage
diff --git a/apps/ui/html/api-keys.html b/apps/ui/html/api-keys.html index 7d22507..9e61256 100644 --- a/apps/ui/html/api-keys.html +++ b/apps/ui/html/api-keys.html @@ -35,7 +35,7 @@
- Operations - Agents - API Keys - Logs - Usage + Operations + Agents + API Keys + Logs + Usage
diff --git a/apps/ui/html/logs.html b/apps/ui/html/logs.html index d881319..c80f73f 100644 --- a/apps/ui/html/logs.html +++ b/apps/ui/html/logs.html @@ -21,7 +21,7 @@
- Operations - Agents - API Keys - Logs - Usage + Operations + Agents + API Keys + Logs + Usage
diff --git a/apps/ui/html/settings.html b/apps/ui/html/settings.html index b2f1663..62d4ea9 100644 --- a/apps/ui/html/settings.html +++ b/apps/ui/html/settings.html @@ -21,7 +21,7 @@
diff --git a/apps/ui/html/usage.html b/apps/ui/html/usage.html index e00ea12..6dcf31e 100644 --- a/apps/ui/html/usage.html +++ b/apps/ui/html/usage.html @@ -21,7 +21,7 @@
diff --git a/apps/ui/html/wizard/index.html b/apps/ui/html/wizard/index.html index a67e11f..57d02dc 100644 --- a/apps/ui/html/wizard/index.html +++ b/apps/ui/html/wizard/index.html @@ -22,7 +22,7 @@ diff --git a/apps/ui/html/workspace-setup.html b/apps/ui/html/workspace-setup.html index dc53806..522dad8 100644 --- a/apps/ui/html/workspace-setup.html +++ b/apps/ui/html/workspace-setup.html @@ -23,7 +23,7 @@
-
'; }).join('') + '
' + - '' + + '' + '' + 'Workspace settings' + ''; diff --git a/apps/ui/nginx.conf b/apps/ui/nginx.conf index 14b118a..a14db78 100644 --- a/apps/ui/nginx.conf +++ b/apps/ui/nginx.conf @@ -1,10 +1,96 @@ server { listen 3000; server_name _; + absolute_redirect off; root /usr/share/nginx/html; index index.html; + location = / { + try_files /index.html =404; + } + + location = /index.html { + return 302 /; + } + + location = /login { + try_files /html/login.html =404; + } + + location = /agents { + try_files /html/agents.html =404; + } + + location = /api-keys { + try_files /html/api-keys.html =404; + } + + location = /logs { + try_files /html/logs.html =404; + } + + location = /usage { + try_files /html/usage.html =404; + } + + location = /settings { + try_files /html/settings.html =404; + } + + location = /workspace-setup { + try_files /html/workspace-setup.html =404; + } + + location = /wizard { + return 302 /wizard/; + } + + location = /wizard/ { + try_files /html/wizard/index.html =404; + } + + location ~ ^/wizard/(.+)$ { + rewrite ^/wizard/(.+)$ /html/wizard/$1 break; + try_files $uri =404; + } + + location = /html/login.html { + return 302 /login; + } + + location = /html/agents.html { + return 302 /agents; + } + + location = /html/api-keys.html { + return 302 /api-keys; + } + + location = /html/logs.html { + return 302 /logs; + } + + location = /html/usage.html { + return 302 /usage; + } + + location = /html/settings.html { + return 302 /settings; + } + + location = /html/workspace-setup.html { + return 302 /workspace-setup$is_args$args; + } + + location = /html/wizard/ { + return 302 /wizard/$is_args$args; + } + + location = /html/wizard/index.html { + return 302 /wizard/; + } + location / { try_files $uri $uri/ /index.html; }