feat: sequences v2, bridges, and sim-controller
Rework sequences (engine, seqplay, envelope, API, web UI), add bridge support, add the host sim-controller and rig simulation tests, and update docs, presets and project tooling config. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
d664026ee5
commit
2543673bd8
68 files changed
+5761
-460
No files matched your search
@@ -81,6 +81,51 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||
}, 5000);
|
||||
};
|
||||
|
||||
const rebootButton = document.getElementById('reboot-btn');
|
||||
if (rebootButton) {
|
||||
rebootButton.addEventListener('click', async () => {
|
||||
if (!confirm('Reboot the controller now? The page will be unavailable for a few seconds.')) return;
|
||||
rebootButton.disabled = true;
|
||||
try {
|
||||
await fetch('/reboot', { method: 'POST' });
|
||||
rebootButton.textContent = 'Rebooting…';
|
||||
setTimeout(() => location.reload(), 8000);
|
||||
} catch (error) {
|
||||
rebootButton.disabled = false;
|
||||
console.error('Reboot failed:', error);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
async function loadNetworkStatus() {
|
||||
const box = document.getElementById('network-status');
|
||||
if (!box) return;
|
||||
const row = (label, value) => {
|
||||
const r = document.createElement('div');
|
||||
const b = document.createElement('strong');
|
||||
b.textContent = label + ': ';
|
||||
r.append(b, value);
|
||||
return r;
|
||||
};
|
||||
try {
|
||||
const st = await fetch('/status', { cache: 'no-store' }).then((r) => r.json());
|
||||
box.textContent = '';
|
||||
const eth = st.eth || { ip: st.ip };
|
||||
const up = eth.ip && eth.ip !== '0.0.0.0';
|
||||
box.append(row('Ethernet', up ? eth.ip + (eth.mask ? ' / ' + eth.mask : '') + (eth.gw && eth.gw !== '0.0.0.0' ? ', gateway ' + eth.gw : '') : 'no address'));
|
||||
if (st.ap) {
|
||||
box.append(row('Access point', st.ap_ip || '192.168.5.1'));
|
||||
const clients = Array.isArray(st.ap_clients) ? st.ap_clients : [];
|
||||
box.append(row('Wi-Fi clients', clients.length ? clients.map((c) => c.ip + ' (' + c.mac + ')').join(', ') : 'none'));
|
||||
} else {
|
||||
box.append(row('Access point', 'off'));
|
||||
}
|
||||
if (st.mac) box.append(row('MAC', st.mac));
|
||||
} catch (error) {
|
||||
box.textContent = 'Could not read network status.';
|
||||
}
|
||||
}
|
||||
|
||||
async function loadDeviceSettings() {
|
||||
try {
|
||||
const response = await fetch('/settings');
|
||||
@@ -101,6 +146,8 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||
setApToggle(data.ap_enabled !== false);
|
||||
const apPw = document.getElementById('ap-password-input');
|
||||
if (apPw) apPw.value = data.ap_password || '';
|
||||
const bridge = document.getElementById('bridge-input');
|
||||
if (bridge) bridge.value = data.bridge || '';
|
||||
staticIpsList.innerHTML = '';
|
||||
(Array.isArray(data.static_ips) ? data.static_ips : []).forEach(addStaticIpRow);
|
||||
}
|
||||
@@ -196,6 +243,7 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||
panel.classList.toggle('active', on);
|
||||
panel.hidden = !on;
|
||||
}
|
||||
if (tabId === 'network') loadNetworkStatus();
|
||||
settingsModal.classList.toggle('settings-modal--led-tool', tabId === 'led-tool');
|
||||
if (ledToolIframe) {
|
||||
// Loaded on demand, so the Controller tab costs no requests
|
||||
@@ -292,6 +340,7 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||
hostname,
|
||||
static_ips: staticIps,
|
||||
ap_password: apPassword,
|
||||
bridge: (document.getElementById('bridge-input') || { value: '' }).value.trim(),
|
||||
ap_enabled: !apToggle || apToggle.getAttribute('aria-pressed') === 'true',
|
||||
}),
|
||||
});
|
||||
|
||||
@@ -282,6 +282,8 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||
const presetNewColorInput = document.getElementById('preset-new-color');
|
||||
const presetBrightnessInput = document.getElementById('preset-brightness-input');
|
||||
const presetDelayInput = document.getElementById('preset-delay-input');
|
||||
const presetFadeInput = document.getElementById('preset-fade-input');
|
||||
const presetBeatTimeInput = document.getElementById('preset-beat-time-input');
|
||||
const presetDelayField = presetDelayInput ? presetDelayInput.closest('.preset-editor-field') : null;
|
||||
const presetBackgroundInput = document.getElementById('preset-background-input');
|
||||
const presetBackgroundButton = document.getElementById('preset-background-btn');
|
||||
@@ -747,6 +749,8 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||
renderPresetColors(colors, paletteRefs);
|
||||
presetBrightnessInput.value = preset.brightness || 0;
|
||||
presetDelayInput.value = preset.delay || 0;
|
||||
if (presetFadeInput) presetFadeInput.value = preset.fade || preset.f || 0;
|
||||
if (presetBeatTimeInput) presetBeatTimeInput.checked = !!(preset.beat_time || preset.tb);
|
||||
if (presetBackgroundInput) {
|
||||
const rawBgRef = preset.background_palette_ref ?? preset.backgroundPaletteRef;
|
||||
let bgRef = null;
|
||||
@@ -983,6 +987,8 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||
// Use canonical field names expected by the device / API
|
||||
brightness: presetBrightnessInput ? parseInt(presetBrightnessInput.value, 10) || 0 : 0,
|
||||
delay: presetDelayInput ? parseInt(presetDelayInput.value, 10) || 0 : 0,
|
||||
fade: presetFadeInput ? Math.max(0, Math.min(10000, parseInt(presetFadeInput.value, 10) || 0)) : 0,
|
||||
beat_time: !!(presetBeatTimeInput && presetBeatTimeInput.checked),
|
||||
background: presetBackgroundInput ? presetBackgroundInput.value : '#000000',
|
||||
background_palette_ref: currentBackgroundPaletteRef != null ? currentBackgroundPaletteRef : null,
|
||||
auto: presetManualModeInput ? !presetManualModeInput.checked : true,
|
||||
|
||||
+869
-81
File diff suppressed because it is too large.
Load diff
@@ -2583,3 +2583,240 @@ html.simulated-bpm-mode .seq-switch-toggle-wrap {
|
||||
.list-search-hidden {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
/* Sequence editor: targets, lane options, grid (sequences.js) */
|
||||
.seq-targets-panel {
|
||||
margin: 0 0 0.75rem 0;
|
||||
padding: 0.5rem;
|
||||
border: 1px solid #4a4a4a;
|
||||
border-radius: 6px;
|
||||
}
|
||||
|
||||
.seq-targets-panel > summary {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.seq-target-row {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
gap: 0.5rem;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.seq-target-row input[type="text"] {
|
||||
width: 10rem;
|
||||
}
|
||||
|
||||
.seq-target-row details {
|
||||
flex: 1 1 12rem;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.seq-target-row summary {
|
||||
cursor: pointer;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.seq-target-num {
|
||||
min-width: 1.5rem;
|
||||
opacity: 0.7;
|
||||
padding-top: 0.35rem;
|
||||
}
|
||||
|
||||
.seq-target-pick,
|
||||
.seq-target-chips {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 0.35rem 0.75rem;
|
||||
align-items: center;
|
||||
margin: 0.25rem 0;
|
||||
}
|
||||
|
||||
.seq-target-pick .muted-text {
|
||||
flex-basis: 100%;
|
||||
}
|
||||
|
||||
.seq-target-btns {
|
||||
display: flex;
|
||||
gap: 0.25rem;
|
||||
}
|
||||
|
||||
.seq-chip {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 0.25rem;
|
||||
font-size: 0.9em;
|
||||
}
|
||||
|
||||
.seq-lane-opts {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 0.35rem 0.75rem;
|
||||
align-items: center;
|
||||
margin-bottom: 0.5rem;
|
||||
}
|
||||
|
||||
.seq-lane-opts > .muted-text,
|
||||
.seq-lane-opts > .seq-target-chips,
|
||||
.seq-lane-chase {
|
||||
flex-basis: 100%;
|
||||
}
|
||||
|
||||
.seq-lane-opt {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 0.35rem;
|
||||
}
|
||||
|
||||
.seq-lane-chase,
|
||||
.seq-lane-chase-opts {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 0.5rem;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.seq-step-more > summary {
|
||||
cursor: pointer;
|
||||
font-size: 0.9em;
|
||||
opacity: 0.8;
|
||||
}
|
||||
|
||||
.seq-grid {
|
||||
margin: 0 0 0.75rem 0;
|
||||
overflow-x: auto;
|
||||
}
|
||||
|
||||
.seq-grid-row {
|
||||
display: flex;
|
||||
align-items: stretch;
|
||||
gap: 0.35rem;
|
||||
margin-bottom: 0.25rem;
|
||||
}
|
||||
|
||||
.seq-grid-lane {
|
||||
flex: 0 0 2rem;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-weight: bold;
|
||||
opacity: 0.8;
|
||||
}
|
||||
|
||||
.seq-grid-track {
|
||||
flex: 1 1 auto;
|
||||
display: flex;
|
||||
min-width: 18rem;
|
||||
}
|
||||
|
||||
.seq-grid-cell {
|
||||
--cell-color: #6a5acd;
|
||||
box-sizing: border-box;
|
||||
min-width: 1.25rem;
|
||||
height: 2.25rem;
|
||||
padding: 0 0.25rem;
|
||||
border: 1px solid #222;
|
||||
border-left: 4px solid var(--cell-color);
|
||||
background: #3a3a3a;
|
||||
color: white;
|
||||
font-size: 0.8em;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
cursor: pointer;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.seq-grid-cell:hover {
|
||||
background: #474747;
|
||||
}
|
||||
|
||||
.seq-grid-gap {
|
||||
background: repeating-linear-gradient(45deg, transparent 0 4px, rgba(255, 255, 255, 0.06) 4px 8px);
|
||||
border-left: 1px solid #222;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
.seq-grid-rest {
|
||||
background: #262626;
|
||||
color: #aaa;
|
||||
border-left-color: #555;
|
||||
}
|
||||
|
||||
.seq-grid-anim {
|
||||
border-left-color: #f5c542;
|
||||
}
|
||||
|
||||
.seq-grid-cell.playing {
|
||||
outline: 2px solid #f5f5f5;
|
||||
outline-offset: -2px;
|
||||
background: #55507a;
|
||||
}
|
||||
|
||||
.seq-grid-pick {
|
||||
height: 2.25rem;
|
||||
min-width: 6rem;
|
||||
}
|
||||
|
||||
.seq-grid-axis {
|
||||
margin-top: 0.25rem;
|
||||
font-size: 0.85em;
|
||||
}
|
||||
|
||||
/* Animation tiles: one shot, with progress while playing */
|
||||
.animation-tile-row .sequence-tile-main {
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
border-style: dashed;
|
||||
}
|
||||
|
||||
.animation-tile-progress {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
height: 3px;
|
||||
width: calc(var(--anim-progress, 0) * 100%);
|
||||
background: #f5c542;
|
||||
transition: width 0.2s linear;
|
||||
}
|
||||
|
||||
.animation-tile-row.firing .sequence-tile-main {
|
||||
border-color: #f5c542;
|
||||
}
|
||||
|
||||
/* The modal's block labels and full-width inputs don't suit the sequence editor's compact rows */
|
||||
#sequence-editor-modal .seq-chip,
|
||||
#sequence-editor-modal .seq-lane-opt,
|
||||
#sequence-editor-modal .seq-lane-chase label,
|
||||
#sequence-editor-modal .seq-step-more label {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 0.3rem;
|
||||
margin: 0;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
#sequence-editor-modal .seq-chip input[type="checkbox"],
|
||||
#sequence-editor-modal .seq-lane-chase input[type="checkbox"],
|
||||
#sequence-editor-modal .seq-step-more input[type="checkbox"] {
|
||||
width: auto;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
#sequence-editor-modal .seq-lane-opt input,
|
||||
#sequence-editor-modal .seq-lane-chase-opts input {
|
||||
width: 4.5rem;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
#sequence-editor-modal .seq-target-row input[type="text"] {
|
||||
width: 10rem;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
#sequence-editor-modal .seq-lane-opts > .muted-text {
|
||||
text-align: left;
|
||||
margin-top: 0.25rem;
|
||||
}
|
||||
Reference in new issue
Block a user