automc ui: relative api paths so /infra/mc-router/ proxying works
Same fix as svc-proxy: absolute /api/* hit the server-manager origin when the UI is reverse-proxied at /infra/mc-router/. Switch to ./api/* so the requests stay under the proxied prefix. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -92,7 +92,7 @@
|
|||||||
<script>
|
<script>
|
||||||
async function refreshRoutes() {
|
async function refreshRoutes() {
|
||||||
try {
|
try {
|
||||||
const r = await fetch('/api/routes');
|
const r = await fetch('./api/routes');
|
||||||
const j = await r.json();
|
const j = await r.json();
|
||||||
const rows = document.getElementById('route-rows');
|
const rows = document.getElementById('route-rows');
|
||||||
const empty = document.getElementById('route-empty');
|
const empty = document.getElementById('route-empty');
|
||||||
@@ -121,7 +121,7 @@ refreshRoutes();
|
|||||||
function startLogStream() {
|
function startLogStream() {
|
||||||
const status = document.getElementById('status');
|
const status = document.getElementById('status');
|
||||||
const box = document.getElementById('logbox');
|
const box = document.getElementById('logbox');
|
||||||
const es = new EventSource('/api/logs');
|
const es = new EventSource('./api/logs');
|
||||||
es.onopen = () => { status.textContent = 'log stream: live'; status.className = 'status ok'; };
|
es.onopen = () => { status.textContent = 'log stream: live'; status.className = 'status ok'; };
|
||||||
es.onerror = () => { status.textContent = 'log stream: reconnecting'; status.className = 'status err'; };
|
es.onerror = () => { status.textContent = 'log stream: reconnecting'; status.className = 'status err'; };
|
||||||
es.onmessage = ev => {
|
es.onmessage = ev => {
|
||||||
|
|||||||
Reference in New Issue
Block a user