Files
Manuel Weiser 526b25ba1e Refactor upgrade, scale, and WiFi pages for improved UI and functionality
- Updated page titles and structure for clarity.
- Enhanced sidebar navigation and status indicators.
- Improved form styling and user feedback during updates.
- Added WebSocket handling for real-time status updates.
- Streamlined version fetching logic across pages.
2026-02-21 10:49:59 +01:00

105 lines
4.3 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>FilaMan - Filament Management</title>
<link rel="icon" type="image/png" href="/favicon.ico">
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="fm-page">
<aside class="fm-sidebar">
<div class="sidebar-brand">
<img src="/logo.png" alt="Logo" class="sidebar-logo">
<div class="brand-text">
<h1>FilaMan <span class="version"></span></h1>
</div>
</div>
<nav class="fm-nav">
<a href="/" class="active">Start</a>
<a href="/waage">Scale</a>
<a href="/setup">Setup</a>
<a href="/upgrade">Upgrade</a>
</nav>
<div class="sidebar-status">
<div class="status-item">
<span class="status-dot" id="filamanDot"></span>
<span>System Sync</span>
</div>
<div class="status-item">
<span id="ramStatus"></span>
</div>
</div>
</aside>
<main class="fm-main">
<header>
<h1>Welcome to FilaMan</h1>
<p>Your smart solution for <strong>Filament Management</strong> in 3D printing.</p>
</header>
<div class="fm-card" style="border-color: var(--accent-3); background: rgba(247, 200, 106, 0.05);">
<h3 style="color: var(--accent-3);">System Compatibility</h3>
<p>
Starting with <strong>Version 3.0.0</strong>, this scale is exclusively designed for use with the
<a href="https://github.com/Fire-Devils/filaman-system" target="_blank" style="color: var(--accent-2); text-decoration: underline;">FilaMan-System</a>.
</p>
</div>
<div class="fm-card">
<h2>About FilaMan</h2>
<p>
FilaMan is designed to simplify filament spool management. Identify and weigh your spools
automatically and keep your inventory synced with the FilaMan-System.
</p>
<a href="https://www.filaman.app" target="_blank" class="fm-btn fm-btn-outline">Visit Website</a>
</div>
<div class="features-grid">
<div class="fm-card fm-card-hover">
<h3>Spool Identification</h3>
<p>Easily identify filament spools using NFC tags for instant tracking.</p>
</div>
<div class="fm-card fm-card-hover">
<h3>Automatic Sync</h3>
<p>Seamlessly update spool data with the FilaMan API for accurate tracking.</p>
</div>
<div class="fm-card fm-card-hover">
<h3>Scale Integration</h3>
<p>Built-in scale support for precise remaining weight calculation.</p>
</div>
</div>
</main>
</div>
<script>
// Fetch Version
fetch('/api/version')
.then(response => response.json())
.then(data => {
const versionSpan = document.querySelector('.version');
if (versionSpan) versionSpan.textContent = 'v' + data.version;
})
.catch(error => console.error('Error fetching version:', error));
// WebSocket handling
let ws = null;
function connectWebSocket() {
ws = new WebSocket(`ws://${window.location.hostname}/ws`);
ws.onmessage = (event) => {
const data = JSON.parse(event.data);
if (data.type === 'heartbeat') {
const dot = document.getElementById('filamanDot');
dot.className = data.filaman_connected ? 'status-dot online' : 'status-dot offline';
document.getElementById('ramStatus').textContent = data.freeHeap + ' KB free';
}
};
ws.onclose = () => setTimeout(connectWebSocket, 2000);
}
connectWebSocket();
setInterval(() => { if(ws && ws.readyState === WebSocket.OPEN) ws.send(JSON.stringify({type:'heartbeat'})); }, 5000);
</script>
</body>
</html>