# orca.ui.ops

> A module of morca's API.

The Ops pages: Control (`/ops/control`, the machine running the scheduler, the UI and Postgres; `orca.system`), the watchdog (`/watchdog`; `orca.watchdog`) and Prometheus' `/metrics`, with the fragments each refreshes from; Alerts (`/ops/alerts`, where `/ops` goes) is `orca.ui.alerts` and Pools (`/ops/pools`) is `orca.ui.pools`. Fleet and Workers' old paths redirect to Pools (`moved`, `to_pools`).

## Functions

### `system_page`

```mojo
def system_page(mut db: State, range: String) -> Page
```

The control instance's own health: CPU, memory, the disk Postgres is on and the network over `range`, and each container's memory.

### `metrics_page`

```mojo
def metrics_page(mut db: State) -> Page
```

`/metrics`: Prometheus' gauges for the control instance and the fleet's counts.

### `ops_home`

```mojo
def ops_home() -> Page
```

`/ops`: Alerts, the first of Ops' pages.

### `moved`

```mojo
def moved(url: String, path: String) -> Page
```

`/system`, the Ops page's old home: moved for good, the query kept.

### `to_pools`

```mojo
def to_pools(path: String, range: String, var json: String) -> Page
```

`/ops/fleet`, `/ops/workers`, their fragments and `/fleet`, `/fleet/hosts`, the pages Pools replaced: moved for good to Pools, filtered to the kind they showed (EC2, self-hosted), Fleet's `?range=` kept. `json` is the old page's JSON, which a script asking for JSON still gets, with no redirect (`orca.web.page.respond`).

### `control_live`

```mojo
def control_live(mut db: State, range: String) -> Page
```

`/ops/control/live`: Control's live part, as the fragment it refreshes from.

### `watchdog_page`

```mojo
def watchdog_page(mut db: State) -> Page
```

`/watchdog`: the watchdog's rules with their last values, limits and snoozes, and the trips with a pipeline still paused.

### `watchdog_live`

```mojo
def watchdog_live(mut db: State) -> Page
```

`/watchdog/live`: the watchdog's page, as the fragment it refreshes from.
