# iOS Home Screen Widget — Ops Console

A live widget showing container counts, CPU, memory, disk, and per-host status. No App Store account needed — uses the free **Scriptable** app.

## 1. Install Scriptable
Get it on the iPhone: https://apps.apple.com/app/scriptable/id1405459188 (free).

## 2. Add the script
1. Open Scriptable → **+** (top right) to create a new script.
2. Tap the title and rename it `Ops Console`.
3. On your Mac/PC visit: <https://dashboard-shannonjlove-cloud.lovable.app/ops-widget.js> and copy the whole file (or open that URL on the iPhone and copy-paste into Scriptable).
4. Edit the top of the script:
   - `ENDPOINT` — already set to your dashboard. Leave as-is.
   - `TOKEN` — paste your `SHORTCUT_TOKEN` (same one used for the restart shortcut).
5. Tap ▶ to test. You should see a populated medium-size preview.

## 3. Add the widget to the Home Screen
1. Long-press the Home Screen → **+** (top left) → search **Scriptable**.
2. Pick a size (Small / Medium / Large) → **Add Widget**.
3. Tap the widget once it's placed → **Edit Widget**:
   - **Script**: `Ops Console`
   - **When Interacting**: Open URL (opens the dashboard)
   - **Parameter** (optional): `small`, `medium`, or `large` to force a layout.

## 4. Refresh cadence
The widget refreshes roughly every 5 minutes (iOS decides the exact moment). To force a refresh, long-press it → **Edit Widget** → close, or run the script manually in Scriptable.

## Data shown
- **Small**: running/total containers, CPU%, MEM%, restarting count.
- **Medium**: above + CPU/MEM/DISK bars + Tailscale IP + uptime.
- **Large**: above + per-host status rows (Hostinger / Oracle / GCP / AWS).

## Security
The widget calls `GET /api/public/widget?token=…` on the dashboard. The endpoint validates the token against the server-side `SHORTCUT_TOKEN` secret. Treat the token like a password — anyone with it can read your stack snapshot. Rotate via Project Settings → Secrets if it leaks.
