Add transient preview WS endpoint and test button in CSS editor modal

- Add /color-strip-sources/preview/ws endpoint for ad-hoc source preview
  without saving (accepts full config JSON, streams RGB frames)
- Add test preview button (flask icon) to CSS editor modal footer
- For self-contained types (static, gradient, color_cycle, effect, daylight,
  candlelight), always previews current form values via transient WS
- For non-previewable types, falls back to saved source test endpoint
- Fix route ordering: preview/ws registered before {source_id}/ws
- Fix css-test-led-control label alignment (display: inline globally)
- Add gradient onChange callback for future live-update support
- Add i18n keys for preview (en/ru/zh)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-15 14:49:22 +03:00
parent 6c7b7ea7d7
commit 014b4175b9
9 changed files with 281 additions and 3 deletions

View File

@@ -1030,6 +1030,11 @@
"color_strip.test.fps": "FPS:",
"color_strip.test.apply": "Apply",
"color_strip.test.composite": "Composite",
"color_strip.preview.title": "Live Preview",
"color_strip.preview.not_connected": "Not connected",
"color_strip.preview.connecting": "Connecting...",
"color_strip.preview.connected": "Connected",
"color_strip.preview.unsupported": "Preview not available for this source type",
"color_strip.type.daylight": "Daylight Cycle",
"color_strip.type.daylight.desc": "Simulates natural daylight over 24 hours",
"color_strip.type.daylight.hint": "Simulates the sun's color temperature throughout a 24-hour day/night cycle — from warm sunrise to cool daylight to warm sunset and dim night.",