-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdashboard.html
More file actions
205 lines (202 loc) · 7.94 KB
/
dashboard.html
File metadata and controls
205 lines (202 loc) · 7.94 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description" content="Tinyauth analytics dashboard" />
<link rel="icon" type="image/x-icon" href="/favicon.ico" />
<title>Dashboard</title>
<script src="https://cdn.jsdelivr.net/npm/@tailwindcss/browser@4"></script>
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<style type="text/tailwindcss">
@theme {
--color-fd-background: #121212;
--color-fd-foreground: #ebebeb;
--color-fd-muted: #212121;
--color-fd-muted-foreground: #b3b3b3cc;
--color-fd-popover: #1e1e1e;
--color-fd-popover-foreground: #dedede;
--color-fd-card: #191919;
--color-fd-card-foreground: #fafafa;
--color-fd-border: #6663;
--color-fd-primary: #fafafa;
--color-fd-primary-foreground: #171717;
--color-fd-secondary: #212121;
--color-fd-secondary-foreground: #ebebeb;
--color-fd-accent: #6868684d;
--color-fd-accent-foreground: #e6e6e6;
--color-fd-ring: #8c8c8c;
--color-fd-blue: #3b82f6;
--color-fd-blue-soft: #3b82f633;
}
</style>
<style>
:root {
color-scheme: dark;
}
.stat-card {
transition:
border-color 0.2s ease,
transform 0.2s ease,
background-color 0.2s ease;
}
.stat-card:hover {
border-color: var(--color-fd-blue);
transform: translateY(-2px);
}
.stat-value {
transition: color 0.2s ease;
}
.chart-wrapper {
position: relative;
width: 100%;
min-height: 0;
flex: 1 1 auto;
}
</style>
</head>
<body
class="flex flex-col font-sans bg-fd-background text-fd-foreground h-screen overflow-hidden"
>
<header class="border-b border-fd-border shrink-0">
<div class="flex flex-row justify-between items-center px-4 h-14">
<div class="flex flex-row gap-1.5 items-center">
<img
src="https://github.com/steveiliop56/tinyauth/blob/main/assets/logo.png?raw=true"
alt="Tinyauth Logo"
class="size-5"
/>
<a
href="https://tinyauth.app"
target="_blank"
rel="noreferrer"
class="font-semibold"
>Tinyauth</a
>
</div>
<div class="flex flex-row gap-1.5 items-center">
<a
href="https://github.com/tinyauthapp/analytics"
target="_blank"
rel="noreferrer"
aria-label="GitHub Repository"
class="rounded-full border p-1 hover:opacity-80 transition-colors border-fd-border hover:cursor-pointer hover:border-fd-blue"
>
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
class="fill-fd-muted-foreground"
>
<path
d="M12 2A10 10 0 0 0 2 12c0 4.42 2.87 8.17 6.84 9.5c.5.08.66-.23.66-.5v-1.69c-2.77.6-3.36-1.34-3.36-1.34c-.46-1.16-1.11-1.47-1.11-1.47c-.91-.62.07-.6.07-.6c1 .07 1.53 1.03 1.53 1.03c.87 1.52 2.34 1.07 2.91.83c.09-.65.35-1.09.63-1.34c-2.22-.25-4.55-1.11-4.55-4.92c0-1.11.38-2 1.03-2.71c-.1-.25-.45-1.29.1-2.64c0 0 .84-.27 2.75 1.02c.79-.22 1.65-.33 2.5-.33s1.71.11 2.5.33c1.91-1.29 2.75-1.02 2.75-1.02c.55 1.35.2 2.39.1 2.64c.65.71 1.03 1.6 1.03 2.71c0 3.82-2.34 4.66-4.57 4.91c.36.31.69.92.69 1.85V21c0 .27.16.59.67.5C19.14 20.16 22 16.42 22 12A10 10 0 0 0 12 2"
/>
</svg>
</a>
</div>
</div>
</header>
<main class="flex flex-col flex-1 p-4 gap-4 min-h-0">
<div class="grid grid-cols-2 gap-4 shrink-0">
<div
class="stat-card flex flex-col gap-2 p-4 border border-fd-border rounded-md items-center justify-center"
>
<div class="font-bold text-xl md:text-2xl text-center">
Total instances
</div>
<div
class="stat-value text-2xl md:text-3xl font-black text-fd-accent-foreground"
>
{{.Total}}
</div>
</div>
<div
class="stat-card flex flex-col gap-2 p-4 border border-fd-border rounded-md items-center justify-center"
>
<div class="font-bold text-xl md:text-2xl text-center">
Most used version
</div>
<div
class="stat-value text-2xl md:text-3xl font-black text-fd-accent-foreground"
>
{{.MostUsed}}
</div>
</div>
</div>
<div
class="chart-wrapper stat-card border border-fd-border rounded-md p-4"
>
<canvas id="versionChart"></canvas>
</div>
</main>
<footer
class="w-full border-t border-fd-border bg-fd-card items-center justify-center p-4 shrink-0"
>
<p class="text-sm font-medium text-center">
Copyright © 2026 Tinyauth
</p>
</footer>
</body>
<script>
const ctx = document.getElementById('versionChart');
const blue = '#3b82f6';
const blueSoft = 'rgba(59, 130, 246, 0.25)';
new Chart(ctx, {
type: 'bar',
data: {
labels: {{.VersionLabels}},
datasets: [{
label: 'Instances',
data: {{.VersionValues}},
backgroundColor: blueSoft,
borderColor: blue,
borderWidth: 1,
borderRadius: 4,
hoverBackgroundColor: blue,
hoverBorderColor: blue
}]
},
options: {
responsive: true,
maintainAspectRatio: false,
animation: {
duration: 700,
easing: 'easeOutQuart'
},
interaction: {
mode: 'nearest',
intersect: true
},
plugins: {
legend: {
labels: { color: '#ebebeb' }
},
tooltip: {
backgroundColor: '#1e1e1e',
titleColor: '#fafafa',
bodyColor: '#dedede',
borderColor: blue,
borderWidth: 1,
padding: 10,
displayColors: false,
callbacks: {
label: (ctx) => `${ctx.parsed.y} instance${ctx.parsed.y === 1 ? '' : 's'}`
}
}
},
scales: {
x: {
ticks: { color: '#b3b3b3' },
grid: { color: 'rgba(102,102,102,0.15)' }
},
y: {
beginAtZero: true,
ticks: { color: '#b3b3b3' },
grid: { color: 'rgba(102,102,102,0.15)' }
}
},
}
});
</script>
</html>