Files
Remote-Terminal-for-MeshCore/frontend/prebuilt/index.html
2026-03-15 15:47:09 -07:00

60 lines
2.7 KiB
HTML

<!DOCTYPE html>
<html lang="en" class="dark">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover" />
<meta name="mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
<meta name="apple-mobile-web-app-title" content="MCTerm" />
<meta name="theme-color" content="#111419" />
<meta name="description" content="Web interface for MeshCore mesh radio networks. Send and receive messages, manage contacts and channels, and configure your radio." />
<title>RemoteTerm for MeshCore</title>
<link rel="icon" type="image/png" href="/favicon-96x96.png" sizes="96x96" />
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
<link rel="shortcut icon" href="/favicon.ico" />
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png" />
<link rel="manifest" href="/site.webmanifest" />
<script>
// Start critical data fetches before React/Vite JS loads.
// Must be in <head> BEFORE the module script so the browser queues these
// fetches before it discovers and starts downloading the JS bundle.
// React hooks consume the promises via window.__prefetch.
var fetchJsonOrThrow = function(url) {
return fetch(url).then(function(response) {
if (response.ok) {
return response.json();
}
return response.text().then(function(rawError) {
var message = rawError || response.statusText || ('HTTP ' + response.status);
try {
var parsed = JSON.parse(rawError);
if (parsed && typeof parsed.detail === 'string' && parsed.detail.length > 0) {
message = parsed.detail;
}
} catch {
// Keep raw text fallback when body is not JSON.
}
throw new Error('Prefetch failed for ' + url + ': ' + message);
});
}).catch(function(err) {
console.error(err);
throw err;
});
};
window.__prefetch = {
config: fetchJsonOrThrow('/api/radio/config'),
settings: fetchJsonOrThrow('/api/settings'),
channels: fetchJsonOrThrow('/api/channels'),
contacts: fetchJsonOrThrow('/api/contacts?limit=1000&offset=0'),
unreads: fetchJsonOrThrow('/api/read-state/unreads'),
undecryptedCount: fetchJsonOrThrow('/api/packets/undecrypted/count'),
};
</script>
<script type="module" crossorigin src="/assets/index-D8to1fXL.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-Kkb-Bio9.css">
</head>
<body>
<div id="root"></div>
</body>
</html>