unify single user and multi user behaviour

This commit is contained in:
Davide Scaini
2026-04-09 08:58:35 +02:00
parent 2007f53580
commit 98c42dc443
25 changed files with 678 additions and 232 deletions
+16 -6
View File
@@ -1,8 +1,18 @@
---
import Base from '../../layouts/Base.astro';
import StatsView from '../../components/StatsView.svelte';
/**
* Legacy route — redirects to /u/{handle}/stats/
* In multi-user mode the user-widget script in the nav handles the correct link.
*/
import { readShardHandles } from '../../lib/manifest';
const base = import.meta.env.BASE_URL;
const shards = readShardHandles();
const handle = shards[0]?.handle ?? null;
---
<Base title="Stats — BincioActivity">
<h1 class="text-2xl font-bold text-white mb-6">Stats</h1>
<StatsView client:load />
</Base>
{handle ? (
<meta http-equiv="refresh" content={`0;url=${base}u/${handle}/stats/`} />
<script define:vars={{ base, handle }}>
window.location.replace(base + 'u/' + handle + '/stats/');
</script>
) : (
<p>No data found. Run <code>bincio extract</code> first.</p>
)}