Skip to content

Commit 730dc20

Browse files
committed
Merge branch 'main' of github.com:UW-Macrostrat/rockd-website
2 parents 23c0b19 + ca55835 commit 730dc20

File tree

2 files changed

+18
-3
lines changed

2 files changed

+18
-3
lines changed

pages/heatmap/+Page.client.ts

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {
55
MapView,
66
buildInspectorStyle
77
} from "@macrostrat/map-interface";
8-
import { mapboxAccessToken, matomoToken, matomoApiURL, tileserverDomain } from "~/settings";
8+
import { mapboxAccessToken, postgrestPrefix, tileserverDomain } from "~/settings";
99
import { Footer } from "~/components";
1010
import { Divider, Spinner, Tabs, Tab } from "@blueprintjs/core";
1111
import { useEffect, useState } from "react";
@@ -24,12 +24,22 @@ export function Page() {
2424
}
2525

2626
function PageHeader() {
27+
const stats = useAPIResult(`${postgrestPrefix}/rockd_stats`)?.[0];
28+
if (stats == null) return null;
29+
const { rows_last_24_hours, total_rows } = stats;
30+
2731
return h('div.page-header', [
2832
h('h1', 'Heatmap'),
2933
h(Divider),
3034
h('p', 'This is a heatmap of all the locations where Rockd has been accessed.'),
31-
h('p', 'The blue markers indicate today\'s accesses, while the grey markers indicate accesses from other days.'),
32-
]);
35+
h('p', [
36+
"The blue markers indicate today's ",
37+
h('strong', rows_last_24_hours.toLocaleString()),
38+
" accesses, while the grey markers indicate the total ",
39+
h('strong', total_rows.toLocaleString()),
40+
" accesses from all days."
41+
])
42+
]);
3343
}
3444

3545
function todayStyle() {

src/settings/index.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ export const matomoApiURL = getRuntimeConfig("MATOMO_API_URL");
3131

3232
export const matomoToken = getRuntimeConfig("MATOMO_API_TOKEN");
3333

34+
export const postgrestPrefix = getRuntimeConfig(
35+
"MACROSTRAT_POSTGREST_PREFIX",
36+
apiDomain + "/api/pg"
37+
);
38+
3439
/** Legacy settings object */
3540
export const SETTINGS = {
3641
rockdApiURL,

0 commit comments

Comments
 (0)