This commit is contained in:
ChK
2026-04-04 18:31:31 +02:00
parent 1456f73682
commit bca05ba77c
6 changed files with 255 additions and 84 deletions

View File

@@ -797,3 +797,19 @@
2026-04-04T14:39:23.187Z ::ffff:172.21.0.5: G91 G1 Y-10 F100
2026-04-04T14:39:37.073Z ::ffff:172.21.0.5: G91 G1 Y-10 F100
2026-04-04T14:39:45.198Z ::ffff:172.21.0.5: G91 G1 X-10 F100
2026-04-04T16:30:15.281Z ::ffff:172.21.0.5: FShow
2026-04-04T16:30:17.533Z ::ffff:172.21.0.5: G28
2026-04-04T16:30:20.224Z ::ffff:172.21.0.5: M114
2026-04-04T16:30:22.006Z ::ffff:172.21.0.5: G91 G1 Y-10 F100
2026-04-04T16:30:22.182Z ::ffff:172.21.0.5: G91 G1 Y-10 F100
2026-04-04T16:30:22.350Z ::ffff:172.21.0.5: G91 G1 Y-10 F100
2026-04-04T16:30:22.520Z ::ffff:172.21.0.5: G91 G1 Y-10 F100
2026-04-04T16:30:22.689Z ::ffff:172.21.0.5: G91 G1 Y-10 F100
2026-04-04T16:30:22.994Z ::ffff:172.21.0.5: G91 G1 Y-10 F100
2026-04-04T16:30:23.218Z ::ffff:172.21.0.5: G91 G1 Y-10 F100
2026-04-04T16:30:23.443Z ::ffff:172.21.0.5: G91 G1 Y-10 F100
2026-04-04T16:30:27.758Z ::ffff:172.21.0.5: G91 G1 X-10 F100
2026-04-04T16:30:29.046Z ::ffff:172.21.0.5: G91 G1 X-10 F100
2026-04-04T16:30:32.486Z ::ffff:172.21.0.5: G91 G1 X10 F100
2026-04-04T16:30:32.702Z ::ffff:172.21.0.5: G91 G1 X10 F100
2026-04-04T16:30:36.979Z ::ffff:172.21.0.5: G91 G1 Y10 F100

View File

@@ -5148,3 +5148,16 @@
2026-04-04T14:52:18.636Z ::ffff:172.21.0.5: Ping
2026-04-04T14:53:00.261Z ::ffff:172.21.0.5: Ping
2026-04-04T14:53:00.826Z ::ffff:172.21.0.5: Ping
2026-04-04T16:30:20.226Z ::ffff:172.21.0.5: Ping
2026-04-04T16:30:25.163Z ::ffff:172.21.0.5: Ping
2026-04-04T16:30:30.176Z ::ffff:172.21.0.5: Ping
2026-04-04T16:30:35.176Z ::ffff:172.21.0.5: Ping
2026-04-04T16:30:40.166Z ::ffff:172.21.0.5: Ping
2026-04-04T16:30:45.178Z ::ffff:172.21.0.5: Ping
2026-04-04T16:30:50.243Z ::ffff:172.21.0.5: Ping
2026-04-04T16:30:55.167Z ::ffff:172.21.0.5: Ping
2026-04-04T16:31:00.248Z ::ffff:172.21.0.5: Ping
2026-04-04T16:31:05.242Z ::ffff:172.21.0.5: Ping
2026-04-04T16:31:10.198Z ::ffff:172.21.0.5: Ping
2026-04-04T16:31:15.228Z ::ffff:172.21.0.5: Ping
2026-04-04T16:31:20.170Z ::ffff:172.21.0.5: Ping

22
public/app.js Executable file → Normal file
View File

@@ -18,6 +18,7 @@ document.addEventListener('DOMContentLoaded', function() {
data.senders.forEach(sender => {
const li = document.createElement('li');
li.textContent = `${sender.name}: ${sender.status}`;
li.classList.add(sender.status.toLowerCase());
sendersUl.appendChild(li);
});
@@ -48,3 +49,24 @@ document.addEventListener('DOMContentLoaded', function() {
// Update every 5 seconds
setInterval(updateStatus, 5000);
});
document.querySelectorAll('.section').forEach(sec => {
const id = sec.dataset.id;
const saved = localStorage.getItem('section_' + id);
if (saved === 'collapsed') sec.classList.add('collapsed');
sec.querySelector('h2').addEventListener('click', () => {
sec.classList.toggle('collapsed');
localStorage.setItem(
'section_' + id,
sec.classList.contains('collapsed') ? 'collapsed' : 'open'
);
});
});
/* Initial-Zustand
['clients','pings'].forEach(id => {
if (!localStorage.getItem('section_' + id))
localStorage.setItem('section_' + id, 'collapsed');
});
*/

23
public/index.html Executable file → Normal file
View File

@@ -4,32 +4,33 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Robot Driver Info</title>
<style>
body { font-family: Arial, sans-serif; margin: 20px; }
h1 { color: #333; }
.section { margin-bottom: 20px; border: 1px solid #ccc; padding: 10px; }
ul { list-style-type: none; padding: 0; }
li { padding: 5px 0; }
</style>
<link rel="stylesheet" href="style.css">
</head>
<body>
<h1>Robot Driver Status</h1>
<div id="status" class="section">
<div class="sections">
<div id="status" class="section" data-id="clients">
<h2>Verbundene WebClients</h2>
<ul id="clients"></ul>
</div>
<div id="senders" class="section">
<div id="senders" class="section" data-id="senders">
<h2>Verbundene FluidNC-Controller</h2>
<ul id="senderList"></ul>
</div>
<div id="commands" class="section">
<div id="commands" class="section" data-id="commands">
<h2>Letzte Commands</h2>
<ul id="commandList"></ul>
</div>
<div id="pings" class="section">
<div id="pings" class="section" data-id="pings">
<h2>Letzte Ping Nachrichten</h2>
<ul id="pingList"></ul>
</div>
</div>
<script src="app.js"></script>
</body>
</html>

109
public/style.css Normal file
View File

@@ -0,0 +1,109 @@
:root {
--bg: #0b1c2d;
--panel: #132c44;
--border: #1e3b58;
--text: #e0e6ed;
--accent: #6fb3ff;
}
* {
box-sizing: border-box;
}
html, body {
min-height: 100%;
}
body {
font-family: Arial, sans-serif;
margin: 16px;
background: linear-gradient(
to bottom,
#ffffff -20%,
var(--bg) 110%
);
color: var(--text);
font-size: 14px;
}
h1 {
margin-bottom: 16px;
font-size: 20px;
color: var(--accent);
}
/* Grid: mind. 500px pro Spalte, beliebig viele */
.sections {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
gap: 10px;
}
/* Section Card */
.section {
background: var(--panel);
border: 1px solid var(--border);
border-radius: 8px;
padding: 22px 20px;
}
/* Header = Klickfläche */
.section h2 {
margin: 0;
font-size: 15px;
cursor: pointer;
display: flex;
justify-content: space-between;
align-items: center;
color: var(--accent);
}
/* Pfeil */
.section h2::after {
content: "▼";
font-size: 12px;
transition: transform 0.2s ease;
}
.section.collapsed h2::after {
transform: rotate(-90deg);
}
/* Inhalt */
.section ul {
margin: 10px 0 0;
padding: 0;
list-style: none;
}
.section.collapsed ul {
display: none;
}
.section li {
padding: 4px 0;
border-bottom: 1px solid rgba(255,255,255,0.05);
}
/* FluidNC Status Icons */
.section#senders li {
position: relative;
padding-left: 22px;
}
.section#senders li::before {
position: absolute;
left: 0;
top: 2px;
font-size: 14px;
}
/* ✅ CONNECTED */
.section#senders li.connected::before {
content: "🟢";
}
/* ❌ DISCONNECTED */
.section#senders li.disconnected::before {
content: "⛔";
}

View File

@@ -178,6 +178,16 @@ const infoServer = https.createServer(httpsOptions, (req, res) => {
res.end(data);
}
});
} else if (req.url === '/style.css') {
fs.readFile('./public/style.css', (err, data) => {
if (err) {
res.writeHead(404);
res.end('Not found');
} else {
res.writeHead(200, {'Content-Type': 'text/css'});
res.end(data);
}
});
} else if (req.url === '/api/status') {
const status = {
clients: connectedClients,