Refactor and remove sqlite and replace with MySQL
This commit is contained in:
49
web/templates/admin/dashboard.html
Normal file
49
web/templates/admin/dashboard.html
Normal file
@@ -0,0 +1,49 @@
|
||||
{{ define "content" }}
|
||||
<h2>📊 Admin Dashboard</h2>
|
||||
<p class="text-sm text-gray-600">Welcome back, admin.</p>
|
||||
|
||||
<div class="grid grid-cols-1 md:grid-cols-3 gap-4 my-6">
|
||||
<div class="bg-white rounded-xl p-4 shadow">
|
||||
<h3 class="text-sm text-gray-500">Total Tickets</h3>
|
||||
<p class="text-2xl font-bold">{{ .Stats.TotalTickets }}</p>
|
||||
</div>
|
||||
<div class="bg-white rounded-xl p-4 shadow">
|
||||
<h3 class="text-sm text-gray-500">Total Winners</h3>
|
||||
<p class="text-2xl font-bold text-green-600">{{ .Stats.TotalWinners }}</p>
|
||||
</div>
|
||||
<div class="bg-white rounded-xl p-4 shadow">
|
||||
<h3 class="text-sm text-gray-500">Prize Fund Awarded</h3>
|
||||
<p class="text-2xl font-bold text-blue-600">£{{ printf "%.2f" .Stats.TotalPrizeAmount }}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="my-6">
|
||||
<h3 class="text-lg font-semibold mb-2">Recent Ticket Matches</h3>
|
||||
<table class="w-full text-sm border">
|
||||
<thead>
|
||||
<tr class="bg-gray-100">
|
||||
<th class="px-2 py-1">Draw Date</th>
|
||||
<th class="px-2 py-1">Triggered By</th>
|
||||
<th class="px-2 py-1">Matched</th>
|
||||
<th class="px-2 py-1">Winners</th>
|
||||
<th class="px-2 py-1">Notes</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{{ range .MatchLogs }}
|
||||
<tr class="border-t">
|
||||
<td class="px-2 py-1">{{ .RunAt }}</td>
|
||||
<td class="px-2 py-1">{{ .TriggeredBy }}</td>
|
||||
<td class="px-2 py-1">{{ .TicketsMatched }}</td>
|
||||
<td class="px-2 py-1">{{ .WinnersFound }}</td>
|
||||
<td class="px-2 py-1 text-xs text-gray-500">{{ .Notes }}</td>
|
||||
</tr>
|
||||
{{ else }}
|
||||
<tr>
|
||||
<td colspan="5" class="text-center py-2 italic text-gray-400">No match history found</td>
|
||||
</tr>
|
||||
{{ end }}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{{ end }}
|
||||
Reference in New Issue
Block a user