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.
This commit is contained in:
1 parent
4a7d3318a2
commit
526b25ba1e
7 files changed
+595
-1432
No files matched your search
+53
-36
@@ -3,58 +3,75 @@
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>FilaMan - Filament Management Tool</title>
|
||||
<title>FilaMan - WiFi Info</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="/">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>WiFi Configuration</h1>
|
||||
<p>Connection status and network management.</p>
|
||||
</header>
|
||||
|
||||
<div class="fm-card">
|
||||
<h2>Connected</h2>
|
||||
<p>Your device is currently connected to WiFi and operating normally.</p>
|
||||
<p>
|
||||
To change network settings or connect to a different access point,
|
||||
please use the hardware reset button (if available) or the WiFi manager portal.
|
||||
</p>
|
||||
<div style="margin-top: 1.5rem;">
|
||||
<span class="status-pill">Connected via Station Mode</span>
|
||||
</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;
|
||||
}
|
||||
if (versionSpan) versionSpan.textContent = 'v' + data.version;
|
||||
})
|
||||
.catch(error => console.error('Error fetching version:', error));
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div class="navbar">
|
||||
<div style="display: flex; align-items: center; gap: 2rem;">
|
||||
<img src="/logo.png" alt="FilaMan Logo" class="logo">
|
||||
<div class="logo-text">
|
||||
<h1>FilaMan<span class="version"></span></h1>
|
||||
<h4>Filament Management Tool</h4>
|
||||
</div>
|
||||
</div>
|
||||
<nav style="display: flex; gap: 1rem;">
|
||||
<a href="/">Start</a>
|
||||
<a href="/waage">Scale</a>
|
||||
<a href="/setup">Setup</a>
|
||||
<a href="/upgrade">Upgrade</a>
|
||||
</nav>
|
||||
<div class="status-container">
|
||||
<div class="status-item">
|
||||
<span class="status-dot" id="filamanDot"></span>F
|
||||
</div>
|
||||
<div class="ram-status" id="ramStatus"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="content">
|
||||
<h1>WiFi Configuration</h1>
|
||||
<p>Your device is connected to WiFi.</p>
|
||||
<p>To change WiFi settings, you can reset the WiFi configuration by holding the hardware button (if available) or using the WiFi manager portal.</p>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
// 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') {
|
||||
document.getElementById('filamanDot').style.backgroundColor = data.filaman_connected ? '#4caf50' : '#f44336';
|
||||
const dot = document.getElementById('filamanDot');
|
||||
dot.className = data.filaman_connected ? 'status-dot online' : 'status-dot offline';
|
||||
document.getElementById('ramStatus').textContent = data.freeHeap + ' KB free';
|
||||
}
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user