Added first working stats to the dashboard
This commit is contained in:
parent
0df9a52043
commit
d13d6aa260
|
@ -1,10 +1,19 @@
|
|||
<script>
|
||||
import Apiclient from '$lib/Apiclient';
|
||||
import Statscard from '$lib/Statscard.svelte';
|
||||
|
||||
$: stats = {
|
||||
urls: 0,
|
||||
visits: 99
|
||||
};
|
||||
Apiclient.getStats().then((res) => {
|
||||
stats = res;
|
||||
});
|
||||
</script>
|
||||
|
||||
<h2 class="text-3xl font-bold text-gray-800 dark:text-gray-100 pb-6">Home</h2>
|
||||
<div class="grid gap-6 mb-8 md:grid-cols-2 xl:grid-cols-4">
|
||||
<Statscard title="Links created">
|
||||
<Statscard title="Links created" bind:count={stats.urls}>
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
class="h-6 w-6"
|
||||
|
@ -20,7 +29,7 @@
|
|||
/>
|
||||
</svg>
|
||||
</Statscard>
|
||||
<Statscard title="Visits">
|
||||
<Statscard title="Visits" bind:count={stats.visits}>
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
class="h-6 w-6"
|
||||
|
|
Loading…
Reference in New Issue