[PRISM] Strict vendor room: один вендор, без смешивания аксессуаров; профили веток
lint / hygiene (push) Failing after 29s
standard / check (push) Successful in 8s

This commit is contained in:
root committed 2026-11-18 16:59:28 +03:00
1 parent 6b690d717b
commit e1c0f31f22
5 files changed
+316 -211

No files matched your search

+202 -202
View File
@@ -2951,7 +2951,7 @@ devices:
model: HiBoard-IT65S3-C_RU
aliases:
- HiBoard-IT65S3-C_RU
domain: unknown
domain: vcs
line: vcs.other
group: E_other
role: unknown
@@ -3627,7 +3627,7 @@ devices:
model: Hitrolink-2.4G Antenna
aliases:
- Hitrolink-2.4G Antenna
domain: unknown
domain: vcs
line: vcs.other
group: E_other
role: unknown
@@ -5030,8 +5030,8 @@ devices:
line: vcs.terminals
group: A_integration_terminals
role: pc
form_factor: pc
native_vcs: false
form_factor: terminal
native_vcs: true
protocols: []
protocols_status: unknown
source:
@@ -5057,8 +5057,8 @@ devices:
line: vcs.terminals
group: A_integration_terminals
role: pc
form_factor: pc
native_vcs: false
form_factor: terminal
native_vcs: true
protocols: []
protocols_status: unknown
source:
@@ -5080,7 +5080,7 @@ devices:
vendor: poly
model: HP Poly Studio V72
aliases: []
domain: unknown
domain: vcs
line: vcs.other
group: E_other
role: unknown
@@ -5102,7 +5102,7 @@ devices:
vendor: poly
model: HP Poly Studio X72
aliases: []
domain: unknown
domain: vcs
line: vcs.other
group: E_other
role: unknown
@@ -5124,7 +5124,7 @@ devices:
vendor: poly
model: HP Poly Studio V12
aliases: []
domain: unknown
domain: vcs
line: vcs.other
group: E_other
role: unknown
@@ -5146,10 +5146,10 @@ devices:
vendor: poly
model: HP USB-C Dock G5
aliases: []
domain: unknown
domain: vcs
line: vcs.other
group: E_other
role: unknown
role: accessory
form_factor: accessory
native_vcs: false
protocols: []
@@ -5168,11 +5168,11 @@ devices:
vendor: poly
model: Poly Studio E60
aliases: []
domain: unknown
line: vcs.other
group: E_other
role: unknown
form_factor: accessory
domain: vcs
line: vcs.usb_byod
group: D_usb_byod
role: camera
form_factor: camera
native_vcs: false
protocols: []
protocols_status: unknown
@@ -5180,8 +5180,8 @@ devices:
kind: research-seed
verified: false
version: '2026-11-18'
solution_class: vcs.accessory
analog_group: vcs.accessory
solution_class: vcs.camera.usb
analog_group: vcs.camera.usb
sales_scope: alternative
sip_context: none
name: Poly Studio E60
@@ -5190,7 +5190,7 @@ devices:
vendor: poly
model: Poly Studio E60 Smart Camera
aliases: []
domain: unknown
domain: vcs
line: vcs.other
group: E_other
role: unknown
@@ -5212,7 +5212,7 @@ devices:
vendor: poly
model: Poly Studio G62 Video Conferencing System
aliases: []
domain: unknown
domain: vcs
line: vcs.other
group: E_other
role: unknown
@@ -5234,20 +5234,20 @@ devices:
vendor: poly
model: Poly Studio P15
aliases: []
domain: unknown
line: vcs.other
group: E_other
role: unknown
form_factor: accessory
native_vcs: false
domain: vcs
line: vcs.bar
group: B_video_bars
role: codec
form_factor: bar
native_vcs: true
protocols: []
protocols_status: unknown
source:
kind: research-seed
verified: false
version: '2026-11-18'
solution_class: vcs.accessory
analog_group: vcs.accessory
solution_class: vcs.bar.room
analog_group: vcs.bar.room
sales_scope: alternative
sip_context: none
name: Poly Studio P15
@@ -5256,20 +5256,20 @@ devices:
vendor: poly
model: Poly Studio V12
aliases: []
domain: unknown
line: vcs.other
group: E_other
role: unknown
form_factor: accessory
native_vcs: false
domain: vcs
line: vcs.bar
group: B_video_bars
role: codec
form_factor: bar
native_vcs: true
protocols: []
protocols_status: unknown
source:
kind: research-seed
verified: false
version: '2026-11-18'
solution_class: vcs.accessory
analog_group: vcs.accessory
solution_class: vcs.bar.room
analog_group: vcs.bar.room
sales_scope: alternative
sip_context: none
name: Poly Studio V12
@@ -5278,20 +5278,20 @@ devices:
vendor: poly
model: Poly Studio V52
aliases: []
domain: unknown
line: vcs.other
group: E_other
role: unknown
form_factor: accessory
native_vcs: false
domain: vcs
line: vcs.bar
group: B_video_bars
role: codec
form_factor: bar
native_vcs: true
protocols: []
protocols_status: unknown
source:
kind: research-seed
verified: false
version: '2026-11-18'
solution_class: vcs.accessory
analog_group: vcs.accessory
solution_class: vcs.bar.room
analog_group: vcs.bar.room
sales_scope: alternative
sip_context: none
name: Poly Studio V52
@@ -5300,20 +5300,20 @@ devices:
vendor: poly
model: Poly Studio V72
aliases: []
domain: unknown
line: vcs.other
group: E_other
role: unknown
form_factor: accessory
native_vcs: false
domain: vcs
line: vcs.bar
group: B_video_bars
role: codec
form_factor: bar
native_vcs: true
protocols: []
protocols_status: unknown
source:
kind: research-seed
verified: false
version: '2026-11-18'
solution_class: vcs.accessory
analog_group: vcs.accessory
solution_class: vcs.bar.room
analog_group: vcs.bar.room
sales_scope: alternative
sip_context: none
name: Poly Studio V72
@@ -5322,20 +5322,20 @@ devices:
vendor: poly
model: Poly Studio X70
aliases: []
domain: unknown
line: vcs.other
group: E_other
role: unknown
form_factor: accessory
native_vcs: false
domain: vcs
line: vcs.bar
group: B_video_bars
role: codec
form_factor: bar
native_vcs: true
protocols: []
protocols_status: unknown
source:
kind: research-seed
verified: false
version: '2026-11-18'
solution_class: vcs.accessory
analog_group: vcs.accessory
solution_class: vcs.bar.room
analog_group: vcs.bar.room
sales_scope: alternative
sip_context: none
name: Poly Studio X70
@@ -5344,20 +5344,20 @@ devices:
vendor: logitech
model: Rally Bar Mini
aliases: []
domain: unknown
line: vcs.other
group: E_other
role: unknown
form_factor: accessory
native_vcs: false
domain: vcs
line: vcs.bar
group: B_video_bars
role: codec
form_factor: bar
native_vcs: true
protocols: []
protocols_status: unknown
source:
kind: research-seed
verified: false
version: '2026-11-18'
solution_class: vcs.accessory
analog_group: vcs.accessory
solution_class: vcs.bar.room
analog_group: vcs.bar.room
sales_scope: alternative
sip_context: none
name: Rally Bar Mini
@@ -5366,11 +5366,11 @@ devices:
vendor: logitech
model: PTZ Pro 2
aliases: []
domain: unknown
line: vcs.other
group: E_other
role: unknown
form_factor: accessory
domain: vcs
line: vcs.usb_byod
group: D_usb_byod
role: camera
form_factor: camera
native_vcs: false
protocols: []
protocols_status: unknown
@@ -5378,8 +5378,8 @@ devices:
kind: research-seed
verified: false
version: '2026-11-18'
solution_class: vcs.accessory
analog_group: vcs.accessory
solution_class: vcs.camera.usb
analog_group: vcs.camera.usb
sales_scope: alternative
sip_context: none
name: PTZ Pro 2
@@ -5388,11 +5388,11 @@ devices:
vendor: logitech
model: PTZ Pro Camera
aliases: []
domain: unknown
line: vcs.other
group: E_other
role: unknown
form_factor: accessory
domain: vcs
line: vcs.usb_byod
group: D_usb_byod
role: camera
form_factor: camera
native_vcs: false
protocols: []
protocols_status: unknown
@@ -5400,8 +5400,8 @@ devices:
kind: research-seed
verified: false
version: '2026-11-18'
solution_class: vcs.accessory
analog_group: vcs.accessory
solution_class: vcs.camera.usb
analog_group: vcs.camera.usb
sales_scope: alternative
sip_context: none
name: PTZ Pro Camera
@@ -5410,20 +5410,20 @@ devices:
vendor: logitech
model: BCC950 ConferenceCam
aliases: []
domain: unknown
line: vcs.other
group: E_other
role: unknown
form_factor: accessory
native_vcs: false
domain: vcs
line: vcs.bar
group: B_video_bars
role: codec
form_factor: bar
native_vcs: true
protocols: []
protocols_status: unknown
source:
kind: research-seed
verified: false
version: '2026-11-18'
solution_class: vcs.accessory
analog_group: vcs.accessory
solution_class: vcs.bar.room
analog_group: vcs.bar.room
sales_scope: alternative
sip_context: none
name: BCC950 ConferenceCam
@@ -5432,20 +5432,20 @@ devices:
vendor: logitech
model: ConferenceCam CC3000e
aliases: []
domain: unknown
line: vcs.other
group: E_other
role: unknown
form_factor: accessory
native_vcs: false
domain: vcs
line: vcs.terminals
group: A_integration_terminals
role: codec
form_factor: terminal
native_vcs: true
protocols: []
protocols_status: unknown
source:
kind: research-seed
verified: false
version: '2026-11-18'
solution_class: vcs.accessory
analog_group: vcs.accessory
solution_class: vcs.terminal.room
analog_group: vcs.terminal.room
sales_scope: alternative
sip_context: none
name: ConferenceCam CC3000e
@@ -5454,20 +5454,20 @@ devices:
vendor: logitech
model: ConferenceCam Connect
aliases: []
domain: unknown
line: vcs.other
group: E_other
role: unknown
form_factor: accessory
native_vcs: false
domain: vcs
line: vcs.bar
group: B_video_bars
role: codec
form_factor: bar
native_vcs: true
protocols: []
protocols_status: unknown
source:
kind: research-seed
verified: false
version: '2026-11-18'
solution_class: vcs.accessory
analog_group: vcs.accessory
solution_class: vcs.bar.room
analog_group: vcs.bar.room
sales_scope: alternative
sip_context: none
name: ConferenceCam Connect
@@ -5476,11 +5476,11 @@ devices:
vendor: logitech
model: Sight
aliases: []
domain: unknown
line: vcs.other
group: E_other
role: unknown
form_factor: accessory
domain: vcs
line: vcs.usb_byod
group: D_usb_byod
role: camera
form_factor: camera
native_vcs: false
protocols: []
protocols_status: unknown
@@ -5488,8 +5488,8 @@ devices:
kind: research-seed
verified: false
version: '2026-11-18'
solution_class: vcs.accessory
analog_group: vcs.accessory
solution_class: vcs.camera.usb
analog_group: vcs.camera.usb
sales_scope: alternative
sip_context: none
name: Sight
@@ -5498,11 +5498,11 @@ devices:
vendor: logitech
model: Tap
aliases: []
domain: unknown
line: vcs.other
group: E_other
role: unknown
form_factor: accessory
domain: vcs
line: vcs.panels
group: E_control
role: touch
form_factor: touch
native_vcs: false
protocols: []
protocols_status: unknown
@@ -5510,8 +5510,8 @@ devices:
kind: research-seed
verified: false
version: '2026-11-18'
solution_class: vcs.accessory
analog_group: vcs.accessory
solution_class: vcs.control.touch
analog_group: vcs.control.touch
sales_scope: alternative
sip_context: none
name: Tap
@@ -5520,10 +5520,10 @@ devices:
vendor: logitech
model: Swytch
aliases: []
domain: unknown
line: vcs.other
group: E_other
role: unknown
domain: vcs
line: vcs.usb_byod
group: D_usb_byod
role: sharing_hub
form_factor: accessory
native_vcs: false
protocols: []
@@ -5532,8 +5532,8 @@ devices:
kind: research-seed
verified: false
version: '2026-11-18'
solution_class: vcs.accessory
analog_group: vcs.accessory
solution_class: vcs.sharing
analog_group: vcs.sharing
sales_scope: alternative
sip_context: none
name: Swytch
@@ -5542,7 +5542,7 @@ devices:
vendor: vinteo
model: Сервер видеоконференций VINTEO
aliases: []
domain: unknown
domain: vcs
line: vcs.other
group: E_other
role: unknown
@@ -5564,7 +5564,7 @@ devices:
vendor: vinteo
model: USB-микрофон VINTEO
aliases: []
domain: unknown
domain: vcs
line: vcs.other
group: E_other
role: unknown
@@ -5586,20 +5586,20 @@ devices:
vendor: iva
model: IVA Advanced
aliases: []
domain: unknown
line: vcs.other
group: E_other
role: unknown
form_factor: accessory
native_vcs: false
domain: vcs
line: vcs.terminals
group: A_integration_terminals
role: codec
form_factor: terminal
native_vcs: true
protocols: []
protocols_status: unknown
source:
kind: research-seed
verified: false
version: '2026-11-18'
solution_class: vcs.accessory
analog_group: vcs.accessory
solution_class: vcs.terminal.room
analog_group: vcs.terminal.room
sales_scope: alternative
sip_context: none
name: IVA Advanced
@@ -5608,11 +5608,11 @@ devices:
vendor: hitrolink
model: HiBoard-IA86C
aliases: []
domain: unknown
line: vcs.other
group: E_other
role: unknown
form_factor: accessory
domain: vcs
line: passive.display
group: E_display
role: display
form_factor: display
native_vcs: false
protocols: []
protocols_status: unknown
@@ -5620,8 +5620,8 @@ devices:
kind: research-seed
verified: false
version: '2026-11-18'
solution_class: vcs.accessory
analog_group: vcs.accessory
solution_class: passive.display
analog_group: passive.display
sales_scope: alternative
sip_context: none
name: HiBoard-IA86C
@@ -5630,11 +5630,11 @@ devices:
vendor: hitrolink
model: HTI-XC800
aliases: []
domain: unknown
line: vcs.other
group: E_other
role: unknown
form_factor: accessory
domain: vcs
line: vcs.usb_byod
group: D_usb_byod
role: camera
form_factor: camera
native_vcs: false
protocols: []
protocols_status: unknown
@@ -5642,8 +5642,8 @@ devices:
kind: research-seed
verified: false
version: '2026-11-18'
solution_class: vcs.accessory
analog_group: vcs.accessory
solution_class: vcs.camera.usb
analog_group: vcs.camera.usb
sales_scope: alternative
sip_context: none
name: HTI-XC800
@@ -5652,11 +5652,11 @@ devices:
vendor: hitrolink
model: HTI-XC800-NDI
aliases: []
domain: unknown
line: vcs.other
group: E_other
role: unknown
form_factor: accessory
domain: vcs
line: vcs.usb_byod
group: D_usb_byod
role: camera
form_factor: camera
native_vcs: false
protocols: []
protocols_status: unknown
@@ -5664,8 +5664,8 @@ devices:
kind: research-seed
verified: false
version: '2026-11-18'
solution_class: vcs.accessory
analog_group: vcs.accessory
solution_class: vcs.camera.usb
analog_group: vcs.camera.usb
sales_scope: alternative
sip_context: none
name: HTI-XC800-NDI
@@ -5674,11 +5674,11 @@ devices:
vendor: hitrolink
model: HTI-UC300
aliases: []
domain: unknown
line: vcs.other
group: E_other
role: unknown
form_factor: accessory
domain: vcs
line: vcs.usb_byod
group: D_usb_byod
role: camera
form_factor: camera
native_vcs: false
protocols: []
protocols_status: unknown
@@ -5686,8 +5686,8 @@ devices:
kind: research-seed
verified: false
version: '2026-11-18'
solution_class: vcs.accessory
analog_group: vcs.accessory
solution_class: vcs.camera.usb
analog_group: vcs.camera.usb
sales_scope: alternative
sip_context: none
name: HTI-UC300
@@ -5696,11 +5696,11 @@ devices:
vendor: hitrolink
model: HTI-UC325
aliases: []
domain: unknown
line: vcs.other
group: E_other
role: unknown
form_factor: accessory
domain: vcs
line: vcs.usb_byod
group: D_usb_byod
role: camera
form_factor: camera
native_vcs: false
protocols: []
protocols_status: unknown
@@ -5708,8 +5708,8 @@ devices:
kind: research-seed
verified: false
version: '2026-11-18'
solution_class: vcs.accessory
analog_group: vcs.accessory
solution_class: vcs.camera.usb
analog_group: vcs.camera.usb
sales_scope: alternative
sip_context: none
name: HTI-UC325
@@ -5718,11 +5718,11 @@ devices:
vendor: hitrolink
model: HTI-UC340
aliases: []
domain: unknown
line: vcs.other
group: E_other
role: unknown
form_factor: accessory
domain: vcs
line: vcs.usb_byod
group: D_usb_byod
role: camera
form_factor: camera
native_vcs: false
protocols: []
protocols_status: unknown
@@ -5730,8 +5730,8 @@ devices:
kind: research-seed
verified: false
version: '2026-11-18'
solution_class: vcs.accessory
analog_group: vcs.accessory
solution_class: vcs.camera.usb
analog_group: vcs.camera.usb
sales_scope: alternative
sip_context: none
name: HTI-UC340
@@ -5740,11 +5740,11 @@ devices:
vendor: hitrolink
model: HTI-UC390
aliases: []
domain: unknown
line: vcs.other
group: E_other
role: unknown
form_factor: accessory
domain: vcs
line: vcs.usb_byod
group: D_usb_byod
role: camera
form_factor: camera
native_vcs: false
protocols: []
protocols_status: unknown
@@ -5752,8 +5752,8 @@ devices:
kind: research-seed
verified: false
version: '2026-11-18'
solution_class: vcs.accessory
analog_group: vcs.accessory
solution_class: vcs.camera.usb
analog_group: vcs.camera.usb
sales_scope: alternative
sip_context: none
name: HTI-UC390
@@ -5762,11 +5762,11 @@ devices:
vendor: hitrolink
model: HTI-UC400
aliases: []
domain: unknown
line: vcs.other
group: E_other
role: unknown
form_factor: accessory
domain: vcs
line: vcs.usb_byod
group: D_usb_byod
role: camera
form_factor: camera
native_vcs: false
protocols: []
protocols_status: unknown
@@ -5774,8 +5774,8 @@ devices:
kind: research-seed
verified: false
version: '2026-11-18'
solution_class: vcs.accessory
analog_group: vcs.accessory
solution_class: vcs.camera.usb
analog_group: vcs.camera.usb
sales_scope: alternative
sip_context: none
name: HTI-UC400
@@ -5784,11 +5784,11 @@ devices:
vendor: hitrolink
model: HTI-UC500
aliases: []
domain: unknown
line: vcs.other
group: E_other
role: unknown
form_factor: accessory
domain: vcs
line: vcs.usb_byod
group: D_usb_byod
role: camera
form_factor: camera
native_vcs: false
protocols: []
protocols_status: unknown
@@ -5796,8 +5796,8 @@ devices:
kind: research-seed
verified: false
version: '2026-11-18'
solution_class: vcs.accessory
analog_group: vcs.accessory
solution_class: vcs.camera.usb
analog_group: vcs.camera.usb
sales_scope: alternative
sip_context: none
name: HTI-UC500
@@ -5806,7 +5806,7 @@ devices:
vendor: hitrolink
model: Hitrolink 2K Minibar
aliases: []
domain: unknown
domain: vcs
line: vcs.other
group: E_other
role: unknown
@@ -5828,7 +5828,7 @@ devices:
vendor: hitrolink
model: Hitrolink 4K 2 Lens Sound bar
aliases: []
domain: unknown
domain: vcs
line: vcs.other
group: E_other
role: unknown
@@ -5850,7 +5850,7 @@ devices:
vendor: hitrolink
model: Hitrolink HT-OM400
aliases: []
domain: unknown
domain: vcs
line: vcs.other
group: E_other
role: unknown
+46
View File
@@ -0,0 +1,46 @@
#!/usr/bin/env python3
"""Применить курированные профили других вендоров к веткам и stage."""
import glob
import os
import shutil
import time
import yaml
PROFILES = "/root/buryan-infra/ops/combine/vendors-other-models-2026-11-18.yaml"
prof = yaml.safe_load(open(PROFILES, encoding="utf-8"))
pmap = {(x["vendor"], x["model"]): x for x in prof.get("devices") or []}
paths = [os.path.join("/opt/work-hub/compat", "catalog.yaml")] + \
sorted(glob.glob("/opt/work-hub/compat/catalog-*.yaml")) + \
["/root/buryan-infra/ops/combine/catalog-p0-2026-11-18.yaml"]
for p in paths:
if not os.path.exists(p):
continue
d = yaml.safe_load(open(p, encoding="utf-8"))
n = 0
for x in d.get("devices") or []:
q = pmap.get((x.get("vendor"), x.get("model")))
if not q:
continue
for k in ("role", "group", "line", "solution_class", "form_factor",
"native_vcs", "deployment", "components", "sales_scope"):
if k in q:
x[k] = q[k]
if not q.get("solution_class"):
role = q.get("role") or x.get("role")
grp = q.get("group") or x.get("group")
cls = {"camera": "vcs.camera.usb", "pc": "vcs.terminal.pc",
"audio": "vcs.audio", "speaker": "vcs.audio",
"touch": "vcs.control.touch", "display": "passive.display",
"mount": "passive.mount", "codec": "vcs.terminal.room",
"kit": "vcs.byod.kit", "sharing_hub": "vcs.sharing"}.get(role)
if role == "codec" and grp == "B_video_bars":
cls = "vcs.bar.room"
if cls:
x["solution_class"] = cls
x["domain"] = "vcs"
x["analog_group"] = x.get("solution_class")
n += 1
if n:
shutil.copy2(p, p + ".bak-prof-" + time.strftime("%Y%m%d-%H%M%S"))
yaml.safe_dump(d, open(p, "w", encoding="utf-8"), allow_unicode=True, sort_keys=False)
print(os.path.basename(p), "profiles", n)
+27
View File
@@ -0,0 +1,27 @@
#!/usr/bin/env python3
"""Нормализовать domain=vcs у не-Yealink веток (кроме телефонии)."""
import glob
import os
import shutil
import time
import yaml
BASE = "/opt/work-hub/compat"
paths = [os.path.join(BASE, "catalog.yaml")] + sorted(glob.glob(os.path.join(BASE, "catalog-*.yaml")))
paths.append("/root/buryan-infra/ops/combine/catalog-p0-2026-11-18.yaml")
for p in paths:
if not os.path.exists(p):
continue
d = yaml.safe_load(open(p, encoding="utf-8"))
devs = d.get("devices") or []
n = 0
for x in devs:
if x.get("vendor") == "yealink":
continue
if x.get("domain") in ("", "unknown", None) and x.get("role") not in ("phone", "headset"):
x["domain"] = "vcs"
n += 1
if n:
shutil.copy2(p, p + ".bak-domain-" + time.strftime("%Y%m%d-%H%M%S"))
yaml.safe_dump(d, open(p, "w", encoding="utf-8"), allow_unicode=True, sort_keys=False)
print(os.path.basename(p), "fixed", n)
+17 -2
View File
@@ -1153,6 +1153,9 @@ def room_roles():
def compose_room(payload):
seats = int(payload.get("seats") or 8)
roles = payload.get("roles") or {}
vendor = (payload.get("vendor") or "").strip().lower()
if vendor == "all":
vendor = ""
expected = {"terminal": ("codec", "pc", "kit"), "camera": ("camera",),
"audio": ("audio", "speaker"), "touch": ("touch",),
"display": ("display",), "mount": ("mount",)}
@@ -1178,14 +1181,26 @@ def compose_room(payload):
terminal = next((x for x in items if x["role"] == "terminal"), None)
if not terminal:
warnings.append({"level": "blocker", "text": "нет терминала/ПК"})
if not vendor and terminal:
vendor = terminal.get("vendor") or ""
vendors = sorted({x.get("vendor") for x in items if x.get("vendor")})
if vendor:
bad = [x for x in items if x.get("vendor") != vendor]
if bad:
warnings.append({"level": "blocker",
"text": "Вендор комнаты — %s. Нельзя смешивать: %s" % (
vendor, ", ".join("%s (%s)" % (x["name"], x["vendor"]) for x in bad))})
elif len(vendors) > 1:
warnings.append({"level": "blocker",
"text": "Разные вендоры в одной комнате: " + ", ".join(vendors)})
deployment = "native_vcs"
if terminal:
d = find_device(terminal["key"])
if d and (d.get("role") == "pc" or d.get("solution_class") == "vcs.byod.kit" or d.get("deployment") == "byod"):
deployment = "byod"
return {"seats": seats, "deployment": deployment, "items": items,
return {"seats": seats, "vendor": vendor, "deployment": deployment, "items": items,
"warnings": warnings, "ready": not any(w["level"] == "blocker" for w in warnings),
"note": "Это компоновка и проверка ролей; совместимость портов проверяется в классическом конструкторе."}
"note": "Вендор — жёсткая граница: аксессуары и компоненты только этого вендора. Порты — в классическом конструкторе."}
def _ensure_dir():
+24 -7
View File
@@ -68,8 +68,8 @@ main{max-width:1500px;margin:0 auto;padding:18px 22px 60px}.view{display:none}.v
<section id="v-room" class="view">
<div class="card">
<h3>Сборка комнаты</h3>
<div class="muted">Роли, а не SKU. Выберите терминал/ПК и периферию; проверка домена и ролей.</div>
<div class="bar" style="margin-top:10px"><label class="tiny">Мест <input id="seats" type="number" value="8" min="2" max="40" style="width:80px"></label><button class="btn" onclick="runRoom()">Проверить и BOM</button></div>
<div class="muted">Роли, а не SKU. Вендор — жёсткая граница: аксессуары другого вендора не подходят.</div>
<div class="bar" style="margin-top:10px"><label class="tiny">Вендор <select id="roomVendor" onchange="setRoomVendor(this.value)"></select></label><label class="tiny">Мест <input id="seats" type="number" value="8" min="2" max="40" style="width:80px"></label><button class="btn" onclick="runRoom()">Проверить и BOM</button></div>
<div class="roomgrid" id="roomgrid"></div>
<div class="hint">BYOD: ПК + камера. Native: кодеки/бары с интегрированным терминалом. Порты проверяются в классическом конструкторе.</div>
</div>
@@ -81,7 +81,7 @@ main{max-width:1500px;margin:0 auto;padding:18px 22px 60px}.view{display:none}.v
</section>
</main>
<script>
const S = {q:'', vendor:'all', domain:'all', cls:'', protocol:'', feature:false, data:null, product:null, roomOpts:{}, room:{} };
const S = {q:'', vendor:'all', domain:'all', cls:'', protocol:'', feature:false, data:null, product:null, roomOpts:{}, room:{}, roomVendor:'' };
const $ = s => document.querySelector(s);
const esc = s => String(s ?? '').replace(/[<>&"]/g, c => ({'<':'&lt;','>':'&gt;','&':'&amp;','"':'&quot;'}[c]));
const api = async p => { const r = await fetch(p); return r.json(); };
@@ -161,16 +161,32 @@ function showAnalogs(){
}
function addToRoom(){
if(!S.product) return;
const p=S.product; let role='terminal';
const p=S.product;
if(S.roomVendor && S.roomVendor!==p.vendor){
alert('В комнате выбран вендор '+S.roomVendor+'. '+p.vendor+' не подойдёт: аксессуары другого вендора несовместимы.');
return;
}
if(!S.roomVendor) S.roomVendor=p.vendor;
let role='terminal';
if(p.role==='camera') role='camera'; else if(['audio','speaker'].includes(p.role)) role='audio'; else if(p.role==='touch') role='touch'; else if(p.role==='display') role='display'; else if(p.role==='mount') role='mount';
S.room[role]=p.name; setView('room'); loadRoomOptions();
}
function setRoomVendor(v){ S.roomVendor=v; S.room={}; loadRoomOptions(); }
async function loadRoomOptions(){
const vs = await api('/api/vendors');
$('#roomVendor').innerHTML = '<option value="">— выберите вендора —</option>'+ (vs||[]).filter(v=>v.id!=='cisco').map(v=>`<option value="${v.id}" ${S.roomVendor===v.id?'selected':''}>${esc(v.name)}</option>`).join('');
if(!S.roomVendor){
$('#roomgrid').innerHTML='<div class="card muted">Сначала выберите вендора — иначе можно случайно смешать несовместимые аксессуары.</div>';
return;
}
const r = await api('/api/room-roles'); const roles=r.roles||[];
const cache={};
for(const role of roles){
let arr=[];
for(const rr of role.roles){ const d=await api('/api/search?'+new URLSearchParams({domain:'vcs',role:rr})); arr=arr.concat(d.items||[]); }
for(const rr of role.roles){
const p=new URLSearchParams({domain:'vcs',role:rr,vendor:S.roomVendor});
const d=await api('/api/search?'+p.toString()); arr=arr.concat(d.items||[]);
}
const seen=new Set(); arr=arr.filter(x=>{if(seen.has(x.key))return false;seen.add(x.key);return true});
cache[role.id]=arr;
}
@@ -178,10 +194,11 @@ async function loadRoomOptions(){
$('#roomgrid').innerHTML = roles.map(role=>`<div><label>${esc(role.name)}</label><select id="room-${role.id}" onchange="S.room['${role.id}']=this.value"><option value="">— не выбрано —</option>${(cache[role.id]||[]).map(x=>`<option value="${esc(x.name)}" ${S.room[role.id]===x.name?'selected':''}>${esc(x.vendor)} · ${esc(x.name)}</option>`).join('')}</select></div>`).join('');
}
async function runRoom(){
if(!S.roomVendor){alert('Выберите вендора комнаты');return;}
const roles={}; for(const k of ['terminal','camera','audio','touch','display','mount']){const el=$('#room-'+k); if(el&&el.value)roles[k]=el.value;}
const r = await post('/api/room',{seats:+$('#seats').value,roles});
const r = await post('/api/room',{seats:+$('#seats').value,vendor:S.roomVendor,roles});
const bom=(r.items||[]).map(x=>`<tr><td>${esc(x.role)}</td><td><b>${esc(x.name)}</b></td><td>${esc(x.vendor)}</td><td>${esc(x.solution_class)}</td></tr>`).join('');
$('#roomout').innerHTML = `<div class="card"><h3>${r.ready?'✅ Готово':'⚠ Требует внимания'} · ${esc(r.deployment)}</h3>
$('#roomout').innerHTML = `<div class="card"><h3>${r.ready?'✅ Готово':'⚠ Требует внимания'} · ${esc(r.deployment)} · ${esc(r.vendor||'')}</h3>
${(r.warnings||[]).map(w=>`<div class="warn ${w.level==='blocker'?'bad':''}">${esc(w.text)}</div>`).join('')}
<table class="bom"><thead><tr><th>Роль</th><th>Модель</th><th>Вендор</th><th>Класс</th></tr></thead><tbody>${bom||'<tr><td colspan=4 class="muted">пусто</td></tr>'}</tbody></table>
<div class="hint">${esc(r.note||'')}</div></div>`;