Redesign web server to avoid lengthy system stats retrieval
This commit is contained in:
@@ -0,0 +1,132 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>CrossPoint Reader</title>
|
||||
<style>
|
||||
:root {
|
||||
--font-color: #333;
|
||||
--bg: #f5f5f5;
|
||||
--card-bg: #fff;
|
||||
--accent-color: rgb(110, 154, 130);
|
||||
--accent-color-dark: #5a8c73;
|
||||
--subtitle-color: #7f8c8d;
|
||||
}
|
||||
|
||||
@media (prefers-color-scheme: dark) {
|
||||
:root {
|
||||
--font-color: #f5f5f5;
|
||||
--bg: #222;
|
||||
--card-bg: #333;
|
||||
--accent-color: #6fae83;
|
||||
--accent-color-dark: #5a8c73;
|
||||
--subtitle-color: #b0bfc7;
|
||||
}
|
||||
}
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
min-height: 100vh;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
|
||||
background: radial-gradient(circle at top, rgba(110, 154, 130, 0.15), transparent 35%), var(--bg);
|
||||
color: var(--font-color);
|
||||
}
|
||||
|
||||
.card {
|
||||
width: min(100%, 420px);
|
||||
background: var(--card-bg);
|
||||
border-radius: 20px;
|
||||
box-shadow: 0 18px 50px rgba(0, 0, 0, 0.09);
|
||||
padding: 36px 28px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.logo {
|
||||
font-size: 4rem;
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
h1 {
|
||||
margin: 0;
|
||||
letter-spacing: -0.04em;
|
||||
font-size: 2rem;
|
||||
}
|
||||
|
||||
.subtitle {
|
||||
margin: 10px 0 24px;
|
||||
color: var(--subtitle-color);
|
||||
font-size: 1rem;
|
||||
}
|
||||
|
||||
.version {
|
||||
margin: 14px 0 24px;
|
||||
font-size: 0.95rem;
|
||||
color: var(--accent-color-dark);
|
||||
}
|
||||
|
||||
.nav-links {
|
||||
display: grid;
|
||||
gap: 12px;
|
||||
margin-top: 24px;
|
||||
}
|
||||
|
||||
.nav-links a {
|
||||
display: block;
|
||||
padding: 14px 18px;
|
||||
border-radius: 12px;
|
||||
background: var(--accent-color);
|
||||
color: white;
|
||||
text-decoration: none;
|
||||
font-weight: 600;
|
||||
transition: background-color 0.15s ease;
|
||||
}
|
||||
|
||||
.nav-links a:hover {
|
||||
background: var(--accent-color-dark);
|
||||
}
|
||||
|
||||
.footer {
|
||||
margin-top: 28px;
|
||||
color: var(--subtitle-color);
|
||||
font-size: 0.9rem;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="card">
|
||||
<div class="logo">📚</div>
|
||||
<h1>CrossPoint Reader</h1>
|
||||
<div class="subtitle">Welcome to your reader</div>
|
||||
<div class="version">Version <span id="version">Loading...</span></div>
|
||||
<div class="nav-links">
|
||||
<a href="/files">Open File Manager</a>
|
||||
<a href="/settings">Settings</a>
|
||||
<a href="/systeminfo">System Info</a>
|
||||
</div>
|
||||
<div class="footer">Fast start page designed for weak connections</div>
|
||||
</div>
|
||||
<script>
|
||||
async function loadVersion() {
|
||||
try {
|
||||
const response = await fetch('/api/status/fast');
|
||||
if (!response.ok) {
|
||||
throw new Error('Failed to fetch version');
|
||||
}
|
||||
const data = await response.json();
|
||||
document.getElementById('version').textContent = data.version || 'N/A';
|
||||
} catch (error) {
|
||||
document.getElementById('version').textContent = 'Unavailable';
|
||||
}
|
||||
}
|
||||
|
||||
document.addEventListener('DOMContentLoaded', loadVersion);
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
Reference in New Issue
Block a user