diff --git a/.rad/db.ts b/.rad/db.ts index 66a11f3..0a88a44 100644 --- a/.rad/db.ts +++ b/.rad/db.ts @@ -11,7 +11,7 @@ export const tasks: Tasks = { db: { fn: async ({ sh }) => { await sh(`docker-compose ${composeDevArgs} down freshdb -f`).catch( - () => {} + () => {}, ); await sh(`docker-compose ${composeDevArgs} up freshdb`).catch(() => {}); }, @@ -19,7 +19,7 @@ export const tasks: Tasks = { grafana: { fn: async ({ sh }) => { await sh(`docker-compose ${composeDevArgs} down grafana -f`).catch( - () => {} + () => {}, ); await sh(`docker-compose ${composeDevArgs} up grafana`).catch(() => {}); }, @@ -28,7 +28,7 @@ export const tasks: Tasks = { fn: async ({ sh }) => { const copyQ = "-c '\\copy sensor_stats from STDIN with(format csv)'"; await sh( - `rad db:emitseeddata | docker exec -i ${containerName} psql -U ${dbname} ${dbuser} ${copyQ}` + `rad db:emitseeddata | docker exec -i ${containerName} psql -U ${dbname} ${dbuser} ${copyQ}`, ); }, }, diff --git a/.rad/deploy.ts b/.rad/deploy.ts index 44c808c..3c87bd2 100644 --- a/.rad/deploy.ts +++ b/.rad/deploy.ts @@ -16,7 +16,7 @@ export const deploy: Task = { `--exclude-from=".rsyncignore"`, `${Deno.cwd()}/`, `${sshUser}@${ip}:${destDir}/`, - ].join(" ") + ].join(" "), ); const cmd = [ `cd ${destDir}`, diff --git a/.rad/format.ts b/.rad/format.ts index 9a9abdb..13c6e3a 100644 --- a/.rad/format.ts +++ b/.rad/format.ts @@ -4,7 +4,7 @@ export const format: Task = { async fn({ sh }) { const cmds = [ `deno fmt rad.ts ui/src .rad`, - `opam exec -- dune build @fmt --auto-promote`, + `cargo fmt --all`, ]; await Promise.all(cmds.map((cmd) => sh(cmd))); }, diff --git a/grafana/provisioning/dashboards/freshawair.json b/grafana/provisioning/dashboards/freshawair.json index 59f3b13..f9a9716 100644 --- a/grafana/provisioning/dashboards/freshawair.json +++ b/grafana/provisioning/dashboards/freshawair.json @@ -91,7 +91,9 @@ "id": 8, "options": { "legend": { - "calcs": ["mean"], + "calcs": [ + "mean" + ], "displayMode": "list", "placement": "bottom" }, @@ -104,7 +106,10 @@ "format": "time_series", "group": [ { - "params": ["$__interval", "none"], + "params": [ + "$__interval", + "none" + ], "type": "time" } ], @@ -116,15 +121,21 @@ "select": [ [ { - "params": ["score"], + "params": [ + "score" + ], "type": "column" }, { - "params": ["avg"], + "params": [ + "avg" + ], "type": "aggregate" }, { - "params": ["Grant"], + "params": [ + "Grant" + ], "type": "alias" } ] @@ -141,7 +152,11 @@ { "datatype": "int2", "name": "", - "params": ["sensor_index", "=", "'0'"], + "params": [ + "sensor_index", + "=", + "'0'" + ], "type": "expression" } ] @@ -150,7 +165,10 @@ "format": "time_series", "group": [ { - "params": ["$__interval", "none"], + "params": [ + "$__interval", + "none" + ], "type": "time" } ], @@ -162,15 +180,21 @@ "select": [ [ { - "params": ["score"], + "params": [ + "score" + ], "type": "column" }, { - "params": ["avg"], + "params": [ + "avg" + ], "type": "aggregate" }, { - "params": ["Malcom"], + "params": [ + "Malcom" + ], "type": "alias" } ] @@ -187,7 +211,11 @@ { "datatype": "int2", "name": "", - "params": ["sensor_index", "=", "'1'"], + "params": [ + "sensor_index", + "=", + "'1'" + ], "type": "expression" } ] @@ -258,7 +286,9 @@ "id": 2, "options": { "legend": { - "calcs": ["mean"], + "calcs": [ + "mean" + ], "displayMode": "list", "placement": "bottom" }, @@ -271,7 +301,10 @@ "format": "time_series", "group": [ { - "params": ["$__interval", "none"], + "params": [ + "$__interval", + "none" + ], "type": "time" } ], @@ -283,15 +316,21 @@ "select": [ [ { - "params": ["co2"], + "params": [ + "co2" + ], "type": "column" }, { - "params": ["avg"], + "params": [ + "avg" + ], "type": "aggregate" }, { - "params": ["Grant"], + "params": [ + "Grant" + ], "type": "alias" } ] @@ -308,7 +347,11 @@ { "datatype": "int2", "name": "", - "params": ["sensor_index", "=", "'0'"], + "params": [ + "sensor_index", + "=", + "'0'" + ], "type": "expression" } ] @@ -317,7 +360,10 @@ "format": "time_series", "group": [ { - "params": ["$__interval", "none"], + "params": [ + "$__interval", + "none" + ], "type": "time" } ], @@ -329,15 +375,21 @@ "select": [ [ { - "params": ["co2"], + "params": [ + "co2" + ], "type": "column" }, { - "params": ["avg"], + "params": [ + "avg" + ], "type": "aggregate" }, { - "params": ["Malcom"], + "params": [ + "Malcom" + ], "type": "alias" } ] @@ -354,7 +406,11 @@ { "datatype": "int2", "name": "", - "params": ["sensor_index", "=", "'1'"], + "params": [ + "sensor_index", + "=", + "'1'" + ], "type": "expression" } ] @@ -420,7 +476,9 @@ "id": "byNames", "options": { "mode": "exclude", - "names": ["pm25"], + "names": [ + "pm25" + ], "prefix": "All except:", "readOnly": true } @@ -466,15 +524,22 @@ "select": [ [ { - "params": ["pm25"], + "params": [ + "pm25" + ], "type": "column" }, { - "params": ["avg", "5"], + "params": [ + "avg", + "5" + ], "type": "moving_window" }, { - "params": ["pm25"], + "params": [ + "pm25" + ], "type": "alias" } ] @@ -501,15 +566,22 @@ "select": [ [ { - "params": ["pm25"], + "params": [ + "pm25" + ], "type": "column" }, { - "params": ["avg", "5"], + "params": [ + "avg", + "5" + ], "type": "moving_window" }, { - "params": ["pm25"], + "params": [ + "pm25" + ], "type": "alias" } ] @@ -540,8 +612,6 @@ "custom": { "axisLabel": "", "axisPlacement": "auto", - "axisSoftMax": 100, - "axisSoftMin": 20, "barAlignment": 0, "drawStyle": "line", "fillOpacity": 0, @@ -613,11 +683,15 @@ "select": [ [ { - "params": ["temp"], + "params": [ + "temp" + ], "type": "column" }, { - "params": ["temperature"], + "params": [ + "temperature" + ], "type": "alias" } ] @@ -644,11 +718,15 @@ "select": [ [ { - "params": ["temp"], + "params": [ + "temp" + ], "type": "column" }, { - "params": ["temperature"], + "params": [ + "temperature" + ], "type": "alias" } ] diff --git a/rad.ts b/rad.ts index 354b512..07bf771 100644 --- a/rad.ts +++ b/rad.ts @@ -16,7 +16,7 @@ const startAgent: Task = [ // run `rad --list` to see all tasks export const tasks: Tasks = { - ...{ b: build, build, }, + ...{ b: build, build }, ...{ startAgent, sa: startAgent }, ...{ format, f: format }, ...dbTasks,