diff --git a/docs/images/logo.png b/docs/images/logo.png new file mode 100644 index 0000000..99bdaec Binary files /dev/null and b/docs/images/logo.png differ diff --git a/package.json b/package.json index 39c9962..7f064d6 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,8 @@ "scripts": { "dev": "vite", "build": "tsc && vite build", - "preview": "vite preview" + "preview": "vite preview", + "screenshots": "python3 scripts/capture-screenshots.py" }, "dependencies": { "react": "^18.3.1", diff --git a/public/logo.png b/public/logo.png new file mode 100644 index 0000000..99bdaec Binary files /dev/null and b/public/logo.png differ diff --git a/public/screenshots/app-store.png b/public/screenshots/app-store.png index 8f9ac61..edbf637 100644 Binary files a/public/screenshots/app-store.png and b/public/screenshots/app-store.png differ diff --git a/public/screenshots/dashboard-overview.png b/public/screenshots/dashboard-overview.png index cb0c6fa..e86d6ea 100644 Binary files a/public/screenshots/dashboard-overview.png and b/public/screenshots/dashboard-overview.png differ diff --git a/public/screenshots/gitops-sync.png b/public/screenshots/gitops-sync.png index 13ab350..853b3fe 100644 Binary files a/public/screenshots/gitops-sync.png and b/public/screenshots/gitops-sync.png differ diff --git a/public/screenshots/migration-wizard.png b/public/screenshots/migration-wizard.png index da43874..f092372 100644 Binary files a/public/screenshots/migration-wizard.png and b/public/screenshots/migration-wizard.png differ diff --git a/public/screenshots/perses-analytics.png b/public/screenshots/perses-analytics.png index 5fe3edd..26b3e6f 100644 Binary files a/public/screenshots/perses-analytics.png and b/public/screenshots/perses-analytics.png differ diff --git a/public/screenshots/shares-management.png b/public/screenshots/shares-management.png index 496e0cd..3b17f0e 100644 Binary files a/public/screenshots/shares-management.png and b/public/screenshots/shares-management.png differ diff --git a/public/screenshots/storage-management.png b/public/screenshots/storage-management.png index d5b5f97..e8c39cc 100644 Binary files a/public/screenshots/storage-management.png and b/public/screenshots/storage-management.png differ diff --git a/public/screenshots/system-logs.png b/public/screenshots/system-logs.png index 9a8f568..3d7da1e 100644 Binary files a/public/screenshots/system-logs.png and b/public/screenshots/system-logs.png differ diff --git a/public/screenshots/system-telemetry.png b/public/screenshots/system-telemetry.png index 5eadf70..26b3e6f 100644 Binary files a/public/screenshots/system-telemetry.png and b/public/screenshots/system-telemetry.png differ diff --git a/scripts/capture-screenshots.py b/scripts/capture-screenshots.py new file mode 100755 index 0000000..16cf4bc --- /dev/null +++ b/scripts/capture-screenshots.py @@ -0,0 +1,106 @@ +#!/usr/bin/env python3 +""" +NaxOS Dashboard Automated Screenshot Utility +Builds the UI and launches headless Chrome to capture crisp, authentic application screenshots. +""" +import subprocess +import time +import os +import shutil +import sys + +SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__)) +UI_DIR = os.path.abspath(os.path.join(SCRIPT_DIR, "..")) +DIST_DIR = os.path.join(UI_DIR, "dist") +SCREENSHOTS_DIR = os.path.join(UI_DIR, "public", "screenshots") +PORT = 4199 + +# Detect Chrome binary +CHROME_CANDIDATES = [ + "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome", + "/usr/bin/google-chrome", + "/usr/bin/chromium-browser", + "/usr/bin/chromium", +] +CHROME_BIN = None +for candidate in CHROME_CANDIDATES: + if os.path.exists(candidate): + CHROME_BIN = candidate + break + +if not CHROME_BIN: + print("Error: Google Chrome / Chromium not found. Please install Chrome to use automated screenshot capture.", file=sys.stderr) + sys.exit(1) + +os.makedirs(SCREENSHOTS_DIR, exist_ok=True) + +# 1. Build UI dist +print("==> [1/3] Building NaxOS UI production bundle...") +subprocess.run(["npm", "run", "build"], cwd=UI_DIR, check=True) + +# 2. Start HTTP server +print(f"==> [2/3] Serving UI dist at http://localhost:{PORT}...") +server_proc = subprocess.Popen( + [sys.executable, "-m", "http.server", str(PORT), "--directory", DIST_DIR], + stdout=subprocess.DEVNULL, + stderr=subprocess.DEVNULL +) + +VIEWS = [ + ("dashboard-overview.png", "#overview", 1440, 960), + ("system-telemetry.png", "#overview", 1440, 1280), + ("storage-management.png", "#storage", 1440, 1000), + ("app-store.png", "#apps", 1440, 1000), + ("migration-wizard.png", "#wizard", 1440, 960), + ("shares-management.png", "#shares", 1440, 960), + ("gitops-sync.png", "#gitops", 1440, 960), + ("system-logs.png", "#logs", 1440, 960), +] + +try: + time.sleep(1.5) + print("==> [3/3] Capturing authentic application screenshots via headless Chrome...") + for filename, hash_route, width, height in VIEWS: + target_file = os.path.join(SCREENSHOTS_DIR, filename) + url = f"http://localhost:{PORT}/{hash_route}" + print(f" Capturing {hash_route:<10} ({width}x{height}) -> {filename}...") + cmd = [ + CHROME_BIN, + "--headless=new", + "--disable-gpu", + f"--window-size={width},{height}", + "--virtual-time-budget=3000", + f"--screenshot={target_file}", + url + ] + res = subprocess.run(cmd, capture_output=True, text=True) + if os.path.exists(target_file): + size = os.path.getsize(target_file) + print(f" [OK] {filename} ({size // 1024} KB)") + else: + print(f" [FAILED] {filename}: {res.stderr}", file=sys.stderr) + + # Legacy alias + telemetry_src = os.path.join(SCREENSHOTS_DIR, "system-telemetry.png") + perses_dst = os.path.join(SCREENSHOTS_DIR, "perses-analytics.png") + if os.path.exists(telemetry_src): + shutil.copyfile(telemetry_src, perses_dst) + + # Copy to sister documentation repositories if present + repo_root = os.path.abspath(os.path.join(UI_DIR, "..")) + for repo in ["naxos-os", "naxos-api", "naxos-docs"]: + doc_img_dir = os.path.join(repo_root, repo, "docs", "images") + if os.path.exists(doc_img_dir): + for filename, _, _, _ in VIEWS: + src_path = os.path.join(SCREENSHOTS_DIR, filename) + if os.path.exists(src_path): + shutil.copyfile(src_path, os.path.join(doc_img_dir, filename)) + if os.path.exists(perses_dst): + shutil.copyfile(perses_dst, os.path.join(doc_img_dir, "perses-analytics.png")) + print(f" Synced screenshots to {repo}/docs/images/") + +finally: + server_proc.terminate() + server_proc.wait() + +print("\nAll NaxOS UI screenshots successfully captured and distributed!")