Implement dashboard and audit log templates, add paginated audit log support
- Added `web/templates/{dashboard,audit,base,accounts,account_detail}.html` for a consistent UI.
- Implemented new audit log endpoint (`GET /v1/audit`) with filtering and pagination via `ListAuditEventsPaged`.
- Extended `AuditQueryParams`, added `AuditEventView` for joined actor/target usernames.
- Updated configuration (`goimports` preference), linting rules, and E2E tests.
- No logic changes to existing APIs.
This commit is contained in:
36
web/templates/dashboard.html
Normal file
36
web/templates/dashboard.html
Normal file
@@ -0,0 +1,36 @@
|
||||
{{define "dashboard"}}{{template "base" .}}{{end}}
|
||||
{{define "title"}}Dashboard — MCIAS{{end}}
|
||||
{{define "content"}}
|
||||
<div class="page-header">
|
||||
<h1>Dashboard</h1>
|
||||
</div>
|
||||
<div style="display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:1rem;margin-bottom:1.5rem">
|
||||
<div class="card" style="text-align:center">
|
||||
<div style="font-size:2rem;font-weight:700;color:#2563eb">{{.TotalAccounts}}</div>
|
||||
<div class="text-muted text-small">Total Accounts</div>
|
||||
</div>
|
||||
<div class="card" style="text-align:center">
|
||||
<div style="font-size:2rem;font-weight:700;color:#16a34a">{{.ActiveAccounts}}</div>
|
||||
<div class="text-muted text-small">Active Accounts</div>
|
||||
</div>
|
||||
</div>
|
||||
{{if .RecentEvents}}
|
||||
<div class="card">
|
||||
<h2 style="font-size:1rem;font-weight:600;margin-bottom:1rem">Recent Audit Events</h2>
|
||||
<div class="table-wrapper">
|
||||
<table>
|
||||
<thead><tr><th>Time</th><th>Event</th><th>Actor</th></tr></thead>
|
||||
<tbody>
|
||||
{{range .RecentEvents}}
|
||||
<tr>
|
||||
<td class="text-small text-muted">{{formatTime .EventTime}}</td>
|
||||
<td><code style="font-size:.8rem">{{.EventType}}</code></td>
|
||||
<td class="text-small text-muted">{{.ActorUsername}}</td>
|
||||
</tr>
|
||||
{{end}}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
{{end}}
|
||||
Reference in New Issue
Block a user