Skip to content

Commit

Permalink
chore: fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
cdaringe committed Aug 7, 2024
1 parent 702f3ff commit 74f3c9b
Show file tree
Hide file tree
Showing 5 changed files with 119 additions and 41 deletions.
6 changes: 3 additions & 3 deletions .rad/db.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ 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(() => {});
},
},
grafana: {
fn: async ({ sh }) => {
await sh(`docker-compose ${composeDevArgs} down grafana -f`).catch(
() => {}
() => {},
);
await sh(`docker-compose ${composeDevArgs} up grafana`).catch(() => {});
},
Expand All @@ -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}`,
);
},
},
Expand Down
2 changes: 1 addition & 1 deletion .rad/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export const deploy: Task = {
`--exclude-from=".rsyncignore"`,
`${Deno.cwd()}/`,
`${sshUser}@${ip}:${destDir}/`,
].join(" ")
].join(" "),
);
const cmd = [
`cd ${destDir}`,
Expand Down
2 changes: 1 addition & 1 deletion .rad/format.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)));
},
Expand Down
148 changes: 113 additions & 35 deletions grafana/provisioning/dashboards/freshawair.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,9 @@
"id": 8,
"options": {
"legend": {
"calcs": ["mean"],
"calcs": [
"mean"
],
"displayMode": "list",
"placement": "bottom"
},
Expand All @@ -104,7 +106,10 @@
"format": "time_series",
"group": [
{
"params": ["$__interval", "none"],
"params": [
"$__interval",
"none"
],
"type": "time"
}
],
Expand All @@ -116,15 +121,21 @@
"select": [
[
{
"params": ["score"],
"params": [
"score"
],
"type": "column"
},
{
"params": ["avg"],
"params": [
"avg"
],
"type": "aggregate"
},
{
"params": ["Grant"],
"params": [
"Grant"
],
"type": "alias"
}
]
Expand All @@ -141,7 +152,11 @@
{
"datatype": "int2",
"name": "",
"params": ["sensor_index", "=", "'0'"],
"params": [
"sensor_index",
"=",
"'0'"
],
"type": "expression"
}
]
Expand All @@ -150,7 +165,10 @@
"format": "time_series",
"group": [
{
"params": ["$__interval", "none"],
"params": [
"$__interval",
"none"
],
"type": "time"
}
],
Expand All @@ -162,15 +180,21 @@
"select": [
[
{
"params": ["score"],
"params": [
"score"
],
"type": "column"
},
{
"params": ["avg"],
"params": [
"avg"
],
"type": "aggregate"
},
{
"params": ["Malcom"],
"params": [
"Malcom"
],
"type": "alias"
}
]
Expand All @@ -187,7 +211,11 @@
{
"datatype": "int2",
"name": "",
"params": ["sensor_index", "=", "'1'"],
"params": [
"sensor_index",
"=",
"'1'"
],
"type": "expression"
}
]
Expand Down Expand Up @@ -258,7 +286,9 @@
"id": 2,
"options": {
"legend": {
"calcs": ["mean"],
"calcs": [
"mean"
],
"displayMode": "list",
"placement": "bottom"
},
Expand All @@ -271,7 +301,10 @@
"format": "time_series",
"group": [
{
"params": ["$__interval", "none"],
"params": [
"$__interval",
"none"
],
"type": "time"
}
],
Expand All @@ -283,15 +316,21 @@
"select": [
[
{
"params": ["co2"],
"params": [
"co2"
],
"type": "column"
},
{
"params": ["avg"],
"params": [
"avg"
],
"type": "aggregate"
},
{
"params": ["Grant"],
"params": [
"Grant"
],
"type": "alias"
}
]
Expand All @@ -308,7 +347,11 @@
{
"datatype": "int2",
"name": "",
"params": ["sensor_index", "=", "'0'"],
"params": [
"sensor_index",
"=",
"'0'"
],
"type": "expression"
}
]
Expand All @@ -317,7 +360,10 @@
"format": "time_series",
"group": [
{
"params": ["$__interval", "none"],
"params": [
"$__interval",
"none"
],
"type": "time"
}
],
Expand All @@ -329,15 +375,21 @@
"select": [
[
{
"params": ["co2"],
"params": [
"co2"
],
"type": "column"
},
{
"params": ["avg"],
"params": [
"avg"
],
"type": "aggregate"
},
{
"params": ["Malcom"],
"params": [
"Malcom"
],
"type": "alias"
}
]
Expand All @@ -354,7 +406,11 @@
{
"datatype": "int2",
"name": "",
"params": ["sensor_index", "=", "'1'"],
"params": [
"sensor_index",
"=",
"'1'"
],
"type": "expression"
}
]
Expand Down Expand Up @@ -420,7 +476,9 @@
"id": "byNames",
"options": {
"mode": "exclude",
"names": ["pm25"],
"names": [
"pm25"
],
"prefix": "All except:",
"readOnly": true
}
Expand Down Expand Up @@ -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"
}
]
Expand All @@ -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"
}
]
Expand Down Expand Up @@ -540,8 +612,6 @@
"custom": {
"axisLabel": "",
"axisPlacement": "auto",
"axisSoftMax": 100,
"axisSoftMin": 20,
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 0,
Expand Down Expand Up @@ -613,11 +683,15 @@
"select": [
[
{
"params": ["temp"],
"params": [
"temp"
],
"type": "column"
},
{
"params": ["temperature"],
"params": [
"temperature"
],
"type": "alias"
}
]
Expand All @@ -644,11 +718,15 @@
"select": [
[
{
"params": ["temp"],
"params": [
"temp"
],
"type": "column"
},
{
"params": ["temperature"],
"params": [
"temperature"
],
"type": "alias"
}
]
Expand Down
2 changes: 1 addition & 1 deletion rad.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 74f3c9b

Please sign in to comment.