feat(led-tool): embed settings editor in main UI
Serve led-tool static editor at /led-tool/editor, filter host serial ports, and load the modal via iframe instead of the legacy form. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -765,79 +765,14 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- LED Tool Modal -->
|
||||
<!-- LED Tool Modal (led-tool/static settings editor) -->
|
||||
<div id="led-tool-modal" class="modal">
|
||||
<div class="modal-content">
|
||||
<h2>LED Tool (USB)</h2>
|
||||
<p class="muted-text" style="margin-top: 0;">Configure a driver connected over USB using <code>led-tool</code>.</p>
|
||||
<div id="led-tool-message" class="message" style="margin-bottom: 0.75rem;"></div>
|
||||
<form id="led-tool-form">
|
||||
<div class="form-group">
|
||||
<label for="led-tool-port">Serial port</label>
|
||||
<div class="profiles-actions" style="gap: 0.5rem;">
|
||||
<select id="led-tool-port" required style="flex:1;">
|
||||
<option value="">Select a serial port</option>
|
||||
</select>
|
||||
<button type="button" class="btn btn-secondary" id="led-tool-refresh-ports-btn">Refresh</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="led-tool-name">Name</label>
|
||||
<input type="text" id="led-tool-name" placeholder="led-abcdef123456">
|
||||
</div>
|
||||
<div class="profiles-actions">
|
||||
<div class="preset-editor-field">
|
||||
<label for="led-tool-num-leds">Num LEDs</label>
|
||||
<input type="number" id="led-tool-num-leds" min="1" max="5000" placeholder="60">
|
||||
</div>
|
||||
<div class="preset-editor-field">
|
||||
<label for="led-tool-led-pin">LED pin</label>
|
||||
<input type="number" id="led-tool-led-pin" min="0" max="48" placeholder="4">
|
||||
</div>
|
||||
</div>
|
||||
<div class="profiles-actions">
|
||||
<div class="preset-editor-field">
|
||||
<label for="led-tool-brightness">Brightness</label>
|
||||
<input type="number" id="led-tool-brightness" min="0" max="255" placeholder="255">
|
||||
</div>
|
||||
<div class="preset-editor-field">
|
||||
<label for="led-tool-wifi-channel">WiFi channel</label>
|
||||
<input type="number" id="led-tool-wifi-channel" min="1" max="11" placeholder="6">
|
||||
</div>
|
||||
</div>
|
||||
<div class="profiles-actions">
|
||||
<div class="preset-editor-field">
|
||||
<label for="led-tool-transport">Transport</label>
|
||||
<select id="led-tool-transport">
|
||||
<option value="">(no change)</option>
|
||||
<option value="espnow">espnow</option>
|
||||
<option value="wifi">wifi</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="preset-editor-field">
|
||||
<label for="led-tool-default">Default preset</label>
|
||||
<input type="text" id="led-tool-default" placeholder="on">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="led-tool-ssid">SSID</label>
|
||||
<input type="text" id="led-tool-ssid" placeholder="Your WiFi SSID">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="led-tool-password">WiFi password</label>
|
||||
<input type="password" id="led-tool-password" placeholder="WiFi password">
|
||||
</div>
|
||||
|
||||
<div class="modal-actions">
|
||||
<button type="button" class="btn btn-secondary" id="led-tool-read-btn">Read</button>
|
||||
<button type="button" class="btn btn-secondary" id="led-tool-reset-btn">Reset</button>
|
||||
<button type="submit" class="btn btn-primary">Apply via USB</button>
|
||||
<button type="button" class="btn btn-secondary" id="led-tool-close-btn">Close</button>
|
||||
</div>
|
||||
</form>
|
||||
<label for="led-tool-output" style="margin-top:0.5rem; display:block;">Command output</label>
|
||||
<textarea id="led-tool-output" rows="12" readonly style="width:100%; font-family:monospace; resize:vertical;"></textarea>
|
||||
<div class="modal-content" style="max-width: 960px; width: 95vw;">
|
||||
<div class="modal-actions" style="margin-bottom: 0.5rem;">
|
||||
<h2 style="margin: 0; flex: 1;">LED Tool — device settings</h2>
|
||||
<button type="button" class="btn btn-secondary" id="led-tool-close-btn">Close</button>
|
||||
</div>
|
||||
<iframe id="led-tool-iframe" title="LED device settings editor" src="about:blank" allow="serial" style="width:100%;height:min(75vh,720px);border:1px solid #4a4a4a;border-radius:4px;background:#0b1020;"></iframe>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user