Iomatex_OS/stage_dashboards
Andrei Smaliak fce014a283 Dashboard_local 2026-04-21 08:29:46 +04:00
..
dashboard_core Dashboard_local 2026-04-21 08:29:46 +04:00
README.md Dashboard_local 2026-04-21 08:29:46 +04:00
dashboard_installer.sh Dashboard_local 2026-04-21 08:29:46 +04:00

README.md

Edge Dashboards

This stage deploys standalone dashboards on dedicated ports without touching the existing admin UI.

Model

  • dashboard_id = port
  • current runtime source directory: /var/lib/itscreen/Downloads/it-screen/
  • component source file for auto-generated editors: /var/lib/itscreen/data/it-screen/it-screen/items.json
  • deployed runtime lives in /opt/iomatex-dashboards/
  • one systemd instance serves one dashboard: iomatex-dashboard@<port>.service
  • one sync service auto-creates component dashboard instances from items.json: iomatex-component-dashboards.service
  • one path watcher reacts to items.json changes: iomatex-component-dashboards.path
  • current HTML selection mode: newest .html file by modification time
  • dashboard server proxies bridge API:
    • /api/bridge/event -> http://127.0.0.1:8787/api/event
    • /api/bridge/component -> http://127.0.0.1:8787/api/component
    • /api/bridge/health -> http://127.0.0.1:8787/api/health

Modes

  • static
    • existing behavior
    • one HTML dashboard on a fixed port
    • / serves the selected .html from /var/lib/itscreen/Downloads/it-screen/
  • component_index
    • common entry page on the main dashboard port
    • reads elements[] from items.json
    • shows a select with all available ids
    • opens the selected dashboard on http://localhost:<id>
  • component
    • one lightweight page per elements[].id
    • service port equals the element id, for example 5771 -> http://localhost:5771
    • / serves a built-in minimal component page
    • GET /api/component reads the current component from items.json

Current main step

  • the main dashboard instance is configured in component_index mode
  • the entry page lists all elements[].id
  • each dedicated dashboard page currently shows only:
    • id
    • title
    • duration

Component dashboard behavior

  • installer deploys the runtime and starts iomatex-component-dashboards.service
  • installer also enables iomatex-component-dashboards.path
  • the sync service reads /var/lib/itscreen/data/it-screen/it-screen/items.json
  • ids are taken from elements[].id
  • for every id it writes /etc/iomatex/dashboards.d/<id>.env with DASHBOARD_MODE=component
  • then it enables iomatex-dashboard@<id>.service
  • the entry page is served by the main dashboard port in component_index mode
  • each component page reads the component by id and shows only id, title, duration
  • items.json changes are handled by systemd.path, not by polling loops
  • sync uses a short debounce window before reading the file
  • existing :<id> dashboards are kept running when only component content changes, because pages read fresh data directly from items.json
  • dashboards are created for new ids and removed for stale ids

Install

sudo bash stage_dashboards/dashboard_installer.sh

Verify

ls -lah /var/lib/itscreen/Downloads/it-screen/
curl -I http://127.0.0.1:5678/
curl http://127.0.0.1:5678/
curl http://127.0.0.1:5678/api/components-index
systemctl status iomatex-dashboard@5678.service --no-pager -n 40
journalctl -u iomatex-dashboard@5678.service --no-pager -n 50
systemctl status iomatex-component-dashboards.service --no-pager -n 50
systemctl status iomatex-component-dashboards.path --no-pager -n 50
curl http://127.0.0.1:5771/api/component

Example check for component 5771

systemctl status iomatex-dashboard@5771.service --no-pager -n 40
curl -I http://127.0.0.1:5771/
curl http://127.0.0.1:5771/api/component | jq '.component | {id, title, duration}'