+
{#if adminMode}
diff --git a/client/src/routes/api/reports/counts/+server.js b/client/src/routes/api/reports/counts/+server.js
new file mode 100644
index 0000000..e7848aa
--- /dev/null
+++ b/client/src/routes/api/reports/counts/+server.js
@@ -0,0 +1,22 @@
+import { db } from "$lib/server/db";
+import { reportCounts } from "$lib/server/db/schema";
+import { getPath, getSettings } from "$lib/server/settings"
+import { error, json } from "@sveltejs/kit";
+
+export const GET = async () => {
+ const s = getSettings();
+ if (s.remote_server) {
+ const connStr = getPath(s);
+ try {
+ const res = await fetch(`${connStr}/api/reports/counts`, {headers: {'TAM-KEY': s.remote_key}});
+ if (!res.ok) throw error(res.status);
+ const data = await res.json();
+ return json(data);
+ } catch {
+ return json([])
+ }
+ } else {
+ const data = await db.select().from(reportCounts);
+ return json(data);
+ }
+}
diff --git a/client/src/routes/reports/counts/+page.server.js b/client/src/routes/reports/counts/+page.server.js
new file mode 100644
index 0000000..3b544e2
--- /dev/null
+++ b/client/src/routes/reports/counts/+page.server.js
@@ -0,0 +1,5 @@
+export const load = async ({ fetch }) => {
+ const res = await fetch('/api/prefixes');
+ const prefixes = await res.json();
+ return { prefixes };
+}
diff --git a/client/src/routes/reports/counts/+page.svelte b/client/src/routes/reports/counts/+page.svelte
new file mode 100644
index 0000000..e0b5680
--- /dev/null
+++ b/client/src/routes/reports/counts/+page.svelte
@@ -0,0 +1,73 @@
+
+
+
+ {pageTitle}
+
+
+
+
+
+
{pageTitle}
+
+
+
+ | Prefix |
+ Unique Buyers |
+ Total Buys |
+
+
+
+ {#each tableData as line (line.prefix)}
+
+ | {line.prefix} |
+ {line.unique_buyers || 0} |
+ {line.total_buys || 0} |
+
+ {/each}
+
+
+
+
+
+
Last refreshed: {lastRefreshed}
+
+
diff --git a/client/src/routes/settings/+page.svelte b/client/src/routes/settings/+page.svelte
index aa67826..cf438e0 100644
--- a/client/src/routes/settings/+page.svelte
+++ b/client/src/routes/settings/+page.svelte
@@ -22,15 +22,14 @@
{pageTitle}
-
- Settings Sections:
- {#if data.settings.remote_server}
- Auth Keys
- {/if}
- Prefixes
-
-
+
+ Settings Sections:
+ {#if data.settings.remote_server}
+ Auth Keys
+ {/if}
+ Prefixes
+
{pageTitle}
Remote Mode:
@@ -84,6 +83,7 @@
settings = { ...resData };
status.message = 'Settings saved successfully!';
status.color = 'green';
+ setTimeout(() => window.location.reload(), 3000);
}
}}>Save
diff --git a/client/src/routes/settings/auth-keys/+page.svelte b/client/src/routes/settings/auth-keys/+page.svelte
index 6936e1d..d8a90ed 100644
--- a/client/src/routes/settings/auth-keys/+page.svelte
+++ b/client/src/routes/settings/auth-keys/+page.svelte
@@ -20,13 +20,12 @@
{pageTitle}
-
- Back to Settings
- Other Settings:
- Prefixes
-
-