Spaces:
Sleeping
Sleeping
refactor: dynamically resolve dashboard base path for API endpoints and UI navigation links
Browse files477 unmodified lines47847948048148248348447 unmodified lines53253353453553653753853954083 unmodified lines62462562662762862963024 unmodified lines655656657658659660477 unmodified lines<span class="stat-label">Telegram</span><span id="tg-status">Loading...</span></div><a href="${DASHBOARD_APP_BASE}/" class="stat-btn">Open Control UI</a></div><div class="stat-card" style="width: 100%;">47 unmodified lines</div><script>async function updateStats() {try {const res = await fetch('${DASHBOARD_STATUS_PATH}');const data = await res.json();document.getElementById('model-id').textContent = data.model;83 unmodified linesresult.textContent = '';try {const res = await fetch('${DASHBOARD_UPTIMEROBOT_PATH}', {method: 'POST',headers: { 'Content-Type': 'application/json' },body: JSON.stringify({ apiKey })24 unmodified linesupdateStats();setInterval(updateStats, 10000);restoreMonitorUiState();document.getElementById('uptimerobot-btn').addEventListener('click', setupUptimeRobot);document.getElementById('uptimerobot-toggle').addEventListener('click', toggleMonitorSetup);</script>477 unmodified lines47847948048148248348447 unmodified lines53253353453553653753853954054154254354454583 unmodified lines62963063163263363463524 unmodified lines660661662663664665666477 unmodified lines<span class="stat-label">Telegram</span><span id="tg-status">Loading...</span></div><a href="#" id="control-ui-link" class="stat-btn">Open Control UI</a></div><div class="stat-card" style="width: 100%;">47 unmodified lines</div><script>function getDashboardBase() {const pathname = window.location.pathname || '${DASHBOARD_BASE}';return pathname.endsWith('/') ? pathname.slice(0, -1) : pathname;}async function updateStats() {try {const res = await fetch(getDashboardBase() + '/status');const data = await res.json();document.getElementById('model-id').textContent = data.model;83 unmodified linesresult.textContent = '';try {const res = await fetch(getDashboardBase() + '/uptimerobot/setup', {method: 'POST',headers: { 'Content-Type': 'application/json' },body: JSON.stringify({ apiKey })24 unmodified linesupdateStats();setInterval(updateStats, 10000);restoreMonitorUiState();document.getElementById('control-ui-link').setAttribute('href', getDashboardBase() + '/app/');document.getElementById('uptimerobot-btn').addEventListener('click', setupUptimeRobot);document.getElementById('uptimerobot-toggle').addEventListener('click', toggleMonitorSetup);</script>
health-server.js+9-3