Dashboard: resize modules by mouse, overlays, link groups and colours in levels; read-only switch on phones
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
2ea9fa32bc
commit
b82a6b90c6
8 files changed
+183
-60
No files matched your search
@@ -158,10 +158,10 @@ def clean_dashboard(data) -> dict | None:
|
||||
src = m.get("cfg") if isinstance(m.get("cfg"), dict) else {}
|
||||
cfg = {"device": str(src.get("device") or "")[:64], "title": str(src.get("title") or "")[:40],
|
||||
"kind": "out" if src.get("kind") == "out" else "in", "idx": int(_num(src.get("idx"), 0, 15, 0)),
|
||||
"text": str(src.get("text") or "")[:2000]}
|
||||
w = int(_num(m.get("w"), 3, 12, 4))
|
||||
"text": str(src.get("text") or "")[:2000],
|
||||
"overlays": [str(o) for o in src.get("overlays") or [] if re.fullmatch(r"(in|out)\d{1,2}", str(o))][:16]}
|
||||
modules.append({"id": re.sub(r"[^\w-]", "", str(m.get("id") or ""))[:32] or uuid.uuid4().hex[:8], "type": m["type"],
|
||||
"w": w if w in (3, 4, 6, 8, 12) else 4, "cfg": cfg})
|
||||
"w": int(_num(m.get("w"), 2, 12, 4)), "h": int(_num(m.get("h"), 0, 20, 0)), "cfg": cfg})
|
||||
return {"modules": modules}
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user