mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #1202] [CLOSED] dashboard: Serve the web page under an optional dashboard path #3307
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#3307
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Niko1221/Strata/pull/1202
Author: @gener-vscode
Created: 10/6/2026
Status: ❌ Closed
Base:
main← Head:feat/dashboard-baseurl📝 Commits (4)
a28bcd8feat(serve): serve the web page under an optional "dashboard" path54422defix(serve): / redirects to the dashboard path instead of answering 4040e6fe0dfeat(serve): open the page on the tab the config names8937332feat(serve): tell the page its tab, and give Chat its own address📊 Changes
18 files changed (+265 additions, -42 deletions)
View changed files
📝
README.de.md(+2 -2)📝
README.es.md(+2 -2)📝
README.fr.md(+2 -2)📝
README.ja.md(+2 -2)📝
README.md(+2 -2)📝
README.pt-BR.md(+2 -2)📝
README.zh-CN.md(+2 -2)📝
docs/AI_SETUP.md(+2 -2)📝
docs/DETAILS.md(+25 -1)📝
docs/INSTALL.md(+2 -2)📝
serve/server.py(+128 -8)📝
serve/test_monitor.py(+1 -1)📝
serve/test_server.py(+70 -1)📝
serve/web/app.js(+6 -3)📝
serve/web/monitor.html(+2 -2)📝
serve/web/monitor.js(+3 -3)📝
setup.py(+1 -1)📝
sycl/serve/server_intel.py(+11 -4)📄 Description
What
The web page answered only at
/, so nothing else could hold that address on the same port. A run-config key"dashboard"(orserve/server.py --dashboard /ui) now serves the page under a path of the user's choosing, together with the files the page loads for itself:"dashboard": "/ui"/ui//ui/web/app.js,/ui/web/app.css,/ui/web/sprite.svg,/ui/fonts/*/and/ui, asked with GET301to/ui/, keeping a?q=that came with it (/?q=hito/ui/?q=hi)/v1/chat/completions,/v1/messages,/v1/responses,/health,/metrics,/status,/slots,/props,/models,/mcp,/load,/unload/as they always were; the same paths answer under/ui/too, which is what the page produces when it asks by relative URL (#82)/, or one of the page files asked for at its old address404, naming where they movedWith nothing set - or
"/"- every path means what it always meant.Why it matters
A page of the user's own or a reverse proxy can hold the root, and the API of Strata needs no change: no client changes its base URL, and the dashboard - which already asks for its files and for the API by relative URL (#82) - reaches both spellings.
/uiwithout the trailing slash moves with a 301 because a browser would otherwise resolve those relative URLs against/; a bookmark or an old link to/lands on the page the same way, which is what/answered until now. A POST to/is not moved: it is aimed at the API, and a 301 would turn it into a GET of the page.The path is checked before the model loads: names of letters, digits,
-or_between slashes, at most 60 characters, and never one of the paths this server answers itself (/web,/v1,/fonts,/api,/metrics,/health,/api-monitor, ...). A wrong value stops the start with a message naming the flag and the key.Tests
WebApp.test_the_whole_app_can_move_to_another_pathcovers both halves: at the default every path is unchanged; with/uithe page and its files answer under it,/and/uianswer301- read over a plain connection, since urllib follows a redirect by itself - the API answers at either spelling for GET and POST, and a POST at the root stays an error.Measured on Linux with Python 3.12, mock engine, no GPU and no download:
python -m unittest serve.test_server serve.test_monitor serve.test_security-> 238 tests OKpython -m unittest serve.test_runconfig-> 9 OK;python tools/test_setup_choices.py-> 35 OK--dashboard /ui:GET /->HTTP/1.0 301withLocation: /ui/;GET /?q=hi->301to/ui/?q=hi;curl -L /->200athttp://127.0.0.1:8097/ui/;POST /-> 404;GET /web/app.js-> 404;/ui/and/v1/models-> 200. The same server without the flag:/-> 200, as before.Docs and the rest
docs/DETAILS.mddocuments the key and what each path answers.serve/web/monitor.htmlandmonitor.jsmove from absolute to relative paths so the monitor page works under the new path too, andsycl/serve/server_intel.pyreuses the same routing, so the Arc wrapper follows the same rules. The READMEs,docs/INSTALL.md,docs/AI_SETUP.mdandsetup.pyonly spell the default address with its trailing slash.Commits
a28bcd8feat(serve): serve the web page under an optional "dashboard" path54422defix(serve): / redirects to the dashboard path instead of answering 404🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.