Skip to content

Commit

Permalink
Update endpoints to point to data.ooni.org
Browse files Browse the repository at this point in the history
  • Loading branch information
hellais committed Sep 2, 2024
1 parent 1f356e0 commit 3fb37b1
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions oonipipeline/src/oonipipeline/dashboard/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"build": "rimraf dist && observable build",
"dev": "observable preview",
"deploy": "observable deploy",
"scp": "npm run build && scp -r dist/* data.ooni.org:/var/www/dashboard/",
"observable": "observable"
},
"dependencies": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ const colorPalette = makeColorPalette(
export async function getObservationData({
countryFilter,
hostnameFilter,
sinceFilter,
untilFilter,
breakDownByIP,
}) {
let group_by = ["timestamp", "failure"];
Expand All @@ -33,6 +35,8 @@ export async function getObservationData({
await getObservationsAggregate({
group_by: group_by,
probe_cc: countryFilter,
since: sinceFilter,
until: untilFilter,
hostname: hostnameFilter,
test_name: "web_connectivity",
})
Expand Down
5 changes: 5 additions & 0 deletions oonipipeline/src/oonipipeline/dashboard/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,12 @@ const form = view(
);
```


```js
const hostnameFilter = form.hostname
const countryFilter = form.country
const sinceFilter = form.since.toISOString().slice(0, 10)
const untilFilter = form.until.toISOString().slice(0, 10)
const breakDownByIP = view(Inputs.toggle({label: "By IP", value: false}));
```

Expand All @@ -50,6 +53,8 @@ if (hostnameFilter && countryFilter) {
data = await getObservationData({
countryFilter,
hostnameFilter,
sinceFilter,
untilFilter,
breakDownByIP,
})
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ export async function getObservationsAggregate(params) {
})
.join("&");
console.log(`running query ${query}`);
return json(`http://localhost:8000/api/v2/observations-aggregate?${query}`);
return json(`https://data.ooni.org/api/v2/observations-aggregate?${query}`);
}

0 comments on commit 3fb37b1

Please sign in to comment.