This commit is contained in:
139
mock-server/debug_server/index.html
Normal file
139
mock-server/debug_server/index.html
Normal file
@@ -0,0 +1,139 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="de">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>AquaMaster Debug Server</title>
|
||||
<link rel="stylesheet" href="debug.css">
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<header>
|
||||
<h1>AquaMaster Debug Server</h1>
|
||||
<div class="status-bar">
|
||||
<span id="mqtt-status" class="status-indicator">MQTT: Disconnected</span>
|
||||
<span id="ws-status" class="status-indicator">WebSocket: Disconnected</span>
|
||||
<span id="api-status" class="status-indicator">API: Ready</span>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<nav class="tabs">
|
||||
<button class="tab-button active" data-tab="api">API Testing</button>
|
||||
<button class="tab-button" data-tab="mqtt">MQTT Testing</button>
|
||||
<button class="tab-button" data-tab="debug">Debug Endpoints</button>
|
||||
</nav>
|
||||
|
||||
<!-- API Testing Tab -->
|
||||
<div id="api-tab" class="tab-content active">
|
||||
<div class="section">
|
||||
<h2>API Endpoint Testing</h2>
|
||||
<div class="form-group">
|
||||
<label for="api-endpoint">Endpoint:</label>
|
||||
<select id="api-endpoint">
|
||||
<option value="GET /api/data">GET /api/data</option>
|
||||
<option value="POST /api/reset-best">POST /api/reset-best</option>
|
||||
<option value="POST /api/unlearn-button">POST /api/unlearn-button</option>
|
||||
<option value="POST /api/set-max-time">POST /api/set-max-time</option>
|
||||
<option value="GET /api/get-settings">GET /api/get-settings</option>
|
||||
<option value="POST /api/start-learning">POST /api/start-learning</option>
|
||||
<option value="POST /api/stop-learning">POST /api/stop-learning</option>
|
||||
<option value="GET /api/learn/status">GET /api/learn/status</option>
|
||||
<option value="GET /api/buttons/status">GET /api/buttons/status</option>
|
||||
<option value="GET /api/info">GET /api/info</option>
|
||||
<option value="POST /api/set-wifi">POST /api/set-wifi</option>
|
||||
<option value="GET /api/get-wifi">GET /api/get-wifi</option>
|
||||
<option value="POST /api/set-location">POST /api/set-location</option>
|
||||
<option value="GET /api/get-location">GET /api/get-location</option>
|
||||
<option value="GET /api/updateButtons">GET /api/updateButtons</option>
|
||||
<option value="POST /api/set-mode">POST /api/set-mode</option>
|
||||
<option value="GET /api/get-mode">GET /api/get-mode</option>
|
||||
<option value="POST /api/set-lane-config">POST /api/set-lane-config</option>
|
||||
<option value="GET /api/get-lane-config">GET /api/get-lane-config</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="api-params">Parameters (JSON or form data):</label>
|
||||
<textarea id="api-params" rows="4" placeholder='{"maxTime": 300, "maxTimeDisplay": 20}'></textarea>
|
||||
</div>
|
||||
<button id="api-send-btn" class="btn btn-primary">Send Request</button>
|
||||
<div class="response-section">
|
||||
<h3>Response:</h3>
|
||||
<pre id="api-response"></pre>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- MQTT Testing Tab -->
|
||||
<div id="mqtt-tab" class="tab-content">
|
||||
<div class="section">
|
||||
<h2>MQTT Publish</h2>
|
||||
<div class="form-group">
|
||||
<label for="mqtt-topic">Topic:</label>
|
||||
<input type="text" id="mqtt-topic" placeholder="aquacross/button/00:00:00:00:00:01" value="aquacross/button/00:00:00:00:00:01">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="mqtt-payload">Payload (JSON or text):</label>
|
||||
<textarea id="mqtt-payload" rows="4" placeholder='{"type": 2, "timestamp": 1234567890}'></textarea>
|
||||
</div>
|
||||
<button id="mqtt-publish-btn" class="btn btn-primary">Publish</button>
|
||||
|
||||
<div class="quick-actions">
|
||||
<h3>Quick Actions:</h3>
|
||||
<div class="button-group">
|
||||
<button class="btn btn-secondary" data-action="button-start1">Simulate Start1 Button</button>
|
||||
<button class="btn btn-secondary" data-action="button-stop1">Simulate Stop1 Button</button>
|
||||
<button class="btn btn-secondary" data-action="button-start2">Simulate Start2 Button</button>
|
||||
<button class="btn btn-secondary" data-action="button-stop2">Simulate Stop2 Button</button>
|
||||
<button class="btn btn-secondary" data-action="rfid-read">Simulate RFID Read</button>
|
||||
<button class="btn btn-secondary" data-action="battery-update">Simulate Battery Update</button>
|
||||
<button class="btn btn-secondary" data-action="heartbeat">Simulate Heartbeat</button>
|
||||
<button class="btn btn-secondary" data-action="button-available">Button Available (Wake)</button>
|
||||
<button class="btn btn-secondary" data-action="button-sleep">Button Sleep Mode</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="section">
|
||||
<h2>MQTT Subscribe</h2>
|
||||
<div class="form-group">
|
||||
<label for="mqtt-subscribe-topic">Topic Pattern:</label>
|
||||
<input type="text" id="mqtt-subscribe-topic" placeholder="# or aquacross/button/#" value="#">
|
||||
</div>
|
||||
<button id="mqtt-subscribe-btn" class="btn btn-primary">Subscribe</button>
|
||||
<button id="mqtt-unsubscribe-btn" class="btn btn-secondary">Unsubscribe All</button>
|
||||
|
||||
<div class="messages-section">
|
||||
<h3>Received Messages:</h3>
|
||||
<div class="messages-controls">
|
||||
<button id="clear-messages-btn" class="btn btn-small">Clear</button>
|
||||
<label><input type="checkbox" id="auto-scroll" checked> Auto-scroll</label>
|
||||
</div>
|
||||
<div id="mqtt-messages" class="messages-container"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Debug Endpoints Tab -->
|
||||
<div id="debug-tab" class="tab-content">
|
||||
<div class="section">
|
||||
<h2>Debug Endpoints</h2>
|
||||
<p>Direct access to debug endpoints for timer control:</p>
|
||||
<div class="button-group">
|
||||
<button class="btn btn-primary" data-debug="start1">Start Lane 1</button>
|
||||
<button class="btn btn-primary" data-debug="stop1">Stop Lane 1</button>
|
||||
<button class="btn btn-primary" data-debug="start2">Start Lane 2</button>
|
||||
<button class="btn btn-primary" data-debug="stop2">Stop Lane 2</button>
|
||||
</div>
|
||||
<div class="response-section">
|
||||
<h3>Last Response:</h3>
|
||||
<pre id="debug-response"></pre>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="https://cdn.jsdelivr.net/npm/mqtt@5/dist/mqtt.min.js"></script>
|
||||
<script src="https://cdn.socket.io/4.6.1/socket.io.min.js"></script>
|
||||
<script src="debug.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user