Add server-source selector (same-origin default) and drop SIMTRACE_EMBEDDED

- Settings: 'Server' selector — 'Same origin' (default) vs 'Custom URL'
  (URL input revealed only in custom mode, placeholder 127.0.0.1:8081)
- serverUrl defaults to '' (same-origin); persisted per choice
- remove SIMTRACE_EMBEDDED frontend check and the server's _EMBEDDED_MARKER
  index.html injection (no longer needed)
- i18n: Server / Same origin / Custom URL (EN/RU)
This commit is contained in:
catarrh committed 2026-08-15 00:24:58 +03:00
1 parent 24d0decd51
commit 9362bef869
2 files changed
+38 -10

No files matched your search

-5
View File
@@ -30,7 +30,6 @@ _STATIC_MIME = {
'.map': 'application/json',
'.wasm': 'application/wasm',
}
_EMBEDDED_MARKER = "<script>window.SIMTRACE_EMBEDDED='1'</script>"
def _content_disposition(filename):
@@ -106,10 +105,6 @@ class RequestHandler(BaseHTTPRequestHandler):
return
with open(fs_path, 'rb') as f:
data = f.read()
if rel == 'index.html':
# Tell the frontend it is served by this server (same origin), so
# it can default to a relative API base instead of 127.0.0.1:8081.
data = data.replace(b'</head>', _EMBEDDED_MARKER.encode() + b'</head>', 1)
content_type = _STATIC_MIME.get(os.path.splitext(rel)[1].lower(), 'application/octet-stream')
self.send_response(200)
self.send_header('Content-Type', content_type)