feat(datastore): add Moritz Health light-mode PWA dashboard generator and hook

This commit is contained in:
Moritz Graf
2026-10-11 20:37:18 +02:00
parent 3abfa18182
commit 1babaab1e2
2 changed files with 1126 additions and 4 deletions
+9 -4
View File
@@ -281,11 +281,16 @@ class DatastoreEngine:
logger.warning(f"Error loading garmin record from {file_path}: {e}") logger.warning(f"Error loading garmin record from {file_path}: {e}")
def _trigger_website_update(self, subject: str): def _trigger_website_update(self, subject: str):
"""Triggers update_website.py automatically for Mila changes.""" """Triggers website updates automatically (Mila -> update_website.py, Moritz -> update_moritz_website.py)."""
if subject != "mila": if subject == "mila":
script_name = "update_website.py"
elif subject == "moritz":
script_name = "update_moritz_website.py"
else:
return return
try: try:
update_script = Path(__file__).resolve().parent / "update_website.py" update_script = Path(__file__).resolve().parent / script_name
if update_script.exists(): if update_script.exists():
import subprocess, shutil import subprocess, shutil
uv_bin = shutil.which("uv") or "/home/node/.openclaw/bin/uv" uv_bin = shutil.which("uv") or "/home/node/.openclaw/bin/uv"
@@ -299,7 +304,7 @@ class DatastoreEngine:
stderr=subprocess.DEVNULL, stderr=subprocess.DEVNULL,
) )
except Exception as e: except Exception as e:
logger.warning(f"Could not trigger update_website.py: {e}") logger.warning(f"Could not trigger {script_name}: {e}")
def _load_jsonl_file(self, file_path: Path, table_name: str): def _load_jsonl_file(self, file_path: Path, table_name: str):
"""Reads lines from JSONL and inserts into target table.""" """Reads lines from JSONL and inserts into target table."""
File diff suppressed because it is too large Load Diff