diff --git a/oonipipeline/src/oonipipeline/dashboard/package.json b/oonipipeline/src/oonipipeline/dashboard/package.json index a7feeb1b..39c68c4f 100644 --- a/oonipipeline/src/oonipipeline/dashboard/package.json +++ b/oonipipeline/src/oonipipeline/dashboard/package.json @@ -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": { diff --git a/oonipipeline/src/oonipipeline/dashboard/src/components/observationFailures.js b/oonipipeline/src/oonipipeline/dashboard/src/components/observationFailures.js index 36491611..c8d23bfc 100644 --- a/oonipipeline/src/oonipipeline/dashboard/src/components/observationFailures.js +++ b/oonipipeline/src/oonipipeline/dashboard/src/components/observationFailures.js @@ -23,6 +23,8 @@ const colorPalette = makeColorPalette( export async function getObservationData({ countryFilter, hostnameFilter, + sinceFilter, + untilFilter, breakDownByIP, }) { let group_by = ["timestamp", "failure"]; @@ -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", }) diff --git a/oonipipeline/src/oonipipeline/dashboard/src/index.md b/oonipipeline/src/oonipipeline/dashboard/src/index.md index 79131b7e..63e9ff4d 100644 --- a/oonipipeline/src/oonipipeline/dashboard/src/index.md +++ b/oonipipeline/src/oonipipeline/dashboard/src/index.md @@ -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})); ``` @@ -50,6 +53,8 @@ if (hostnameFilter && countryFilter) { data = await getObservationData({ countryFilter, hostnameFilter, + sinceFilter, + untilFilter, breakDownByIP, }) } diff --git a/oonipipeline/src/oonipipeline/dashboard/src/lib/observations.js b/oonipipeline/src/oonipipeline/dashboard/src/lib/observations.js index fcf56149..d3773169 100644 --- a/oonipipeline/src/oonipipeline/dashboard/src/lib/observations.js +++ b/oonipipeline/src/oonipipeline/dashboard/src/lib/observations.js @@ -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}`); }