246 lines
8.1 KiB
HTML
246 lines
8.1 KiB
HTML
{{define "audit.html"}}
|
|
<!doctype html>
|
|
<html lang="{{.Language}}">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta name="viewport" content="width=device-width,initial-scale=1">
|
|
<title>
|
|
{{.Title}}
|
|
· DoGaMa
|
|
</title>
|
|
<link rel="stylesheet" href="/static/app.v2.css">
|
|
<link rel="stylesheet" href="/static/theme.v2.css">
|
|
</head>
|
|
<body class="app-body">
|
|
{{template "sidebar" .}}
|
|
<main class="app-main">
|
|
<header class="page-heading audit-header">
|
|
<div>
|
|
<p class="eyebrow">
|
|
{{.Msg "audit.eyebrow"}}
|
|
</p>
|
|
<h1>
|
|
{{.Msg "audit.title"}}
|
|
</h1>
|
|
<p>
|
|
{{.AuditEventCount}}
|
|
{{.Msg "audit.events"}}
|
|
·
|
|
{{.Msg "audit.timezone"}}
|
|
{{.AuditFilter.Timezone}}
|
|
</p>
|
|
</div>
|
|
</header>
|
|
<section class="panel audit-panel">
|
|
<div class="section-heading">
|
|
<div>
|
|
<p class="eyebrow">
|
|
{{.Msg "audit.filters"}}
|
|
</p>
|
|
<h2>
|
|
{{.Msg "audit.filter"}}
|
|
</h2>
|
|
</div>
|
|
<a class="button-secondary link-button" href="/audit">
|
|
{{.Msg "audit.reset"}}
|
|
</a>
|
|
</div>
|
|
<form class="audit-filter-grid" method="get" action="/audit">
|
|
<label>
|
|
{{.Msg "audit.period"}}
|
|
<select name="period">
|
|
<option value="">
|
|
{{.Msg "audit.any"}}
|
|
</option>
|
|
<option value="today" {{if eq .AuditFilter.Period "today"}}selected{{end}}>
|
|
{{.Msg "audit.today"}}
|
|
</option>
|
|
<option value="7d" {{if eq .AuditFilter.Period "7d"}}selected{{end}}>
|
|
{{.Msg "audit.last_7_days"}}
|
|
</option>
|
|
<option value="30d" {{if eq .AuditFilter.Period "30d"}}selected{{end}}>
|
|
{{.Msg "audit.last_30_days"}}
|
|
</option>
|
|
<option value="custom" {{if eq .AuditFilter.Period "custom"}}selected{{end}}>
|
|
{{.Msg "audit.custom"}}
|
|
</option>
|
|
</select>
|
|
</label>
|
|
<label>
|
|
{{.Msg "audit.from"}}
|
|
<input name="from" type="date" value="{{.AuditFilter.From}}">
|
|
</label>
|
|
<label>
|
|
{{.Msg "audit.to"}}
|
|
<input name="to" type="date" value="{{.AuditFilter.To}}">
|
|
</label>
|
|
<label>
|
|
{{.Msg "audit.actor"}}
|
|
<select name="actor_id">
|
|
<option value="">
|
|
{{.Msg "audit.any"}}
|
|
</option>
|
|
{{range .AuditActors}}
|
|
<option value="{{.ID}}" {{if eq $.AuditFilter.ActorID .ID}}selected{{end}}>
|
|
{{.Label}}
|
|
</option>
|
|
{{end}}
|
|
</select>
|
|
</label>
|
|
<label>
|
|
{{.Msg "audit.instance"}}
|
|
<select name="instance_id">
|
|
<option value="">
|
|
{{.Msg "audit.any"}}
|
|
</option>
|
|
{{range .Instances}}
|
|
<option value="{{.ID}}" {{if eq $.AuditFilter.InstanceID .ID}}selected{{end}}>
|
|
{{.Preview.DisplayName}}
|
|
</option>
|
|
{{end}}
|
|
</select>
|
|
</label>
|
|
<label>
|
|
{{.Msg "audit.action"}}
|
|
<select name="action">
|
|
<option value="">
|
|
{{.Msg "audit.any"}}
|
|
</option>
|
|
{{range .AuditActions}}
|
|
<option value="{{.}}" {{if eq $.AuditFilter.Action .}}selected{{end}}>
|
|
{{.}}
|
|
</option>
|
|
{{end}}
|
|
</select>
|
|
</label>
|
|
<label>
|
|
{{.Msg "audit.outcome"}}
|
|
<select name="outcome">
|
|
<option value="">
|
|
{{.Msg "audit.any"}}
|
|
</option>
|
|
<option value="allowed" {{if eq .AuditFilter.Outcome "allowed"}}selected{{end}}>
|
|
{{.Msg "audit.allowed"}}
|
|
</option>
|
|
<option value="denied" {{if eq .AuditFilter.Outcome "denied"}}selected{{end}}>
|
|
{{.Msg "audit.failed"}}
|
|
</option>
|
|
<option value="failed" {{if eq .AuditFilter.Outcome "failed"}}selected{{end}}>
|
|
{{.Msg "audit.failed"}}
|
|
</option>
|
|
</select>
|
|
</label>
|
|
<label>
|
|
{{.Msg "audit.search"}}
|
|
<input name="q" type="search" value="{{.AuditFilter.Query}}" maxlength="100">
|
|
</label>
|
|
<button type="submit">
|
|
{{.Msg "audit.filter"}}
|
|
</button>
|
|
</form>
|
|
</section>
|
|
<section class="panel audit-results">
|
|
<div class="section-heading">
|
|
<div>
|
|
<p class="eyebrow">
|
|
{{.Msg "audit.results"}}
|
|
</p>
|
|
<h2>
|
|
{{.AuditEventCount}}
|
|
{{.Msg "audit.events"}}
|
|
</h2>
|
|
</div>
|
|
<p class="muted">
|
|
{{.Msg "audit.timezone"}}
|
|
{{.AuditFilter.Timezone}}
|
|
</p>
|
|
</div>
|
|
{{if .AuditEvents}}
|
|
<div class="audit-list">
|
|
{{range .AuditEvents}}
|
|
<article class="audit-event">
|
|
<time datetime="{{.UTC}}" title="{{.UTC}}">
|
|
{{.Time}}
|
|
</time>
|
|
<div>
|
|
<strong>
|
|
{{.ActionLabel}}
|
|
</strong>
|
|
<small>
|
|
<code>
|
|
{{.Action}}
|
|
</code>
|
|
·
|
|
{{.OutcomeLabel}}
|
|
</small>
|
|
</div>
|
|
<div>
|
|
<strong>
|
|
{{if .Actor}}
|
|
{{.Actor}}
|
|
{{else}}
|
|
—
|
|
{{end}}
|
|
</strong>
|
|
<small>
|
|
{{if .Instance}}
|
|
{{.Instance}}
|
|
{{else}}
|
|
—
|
|
{{end}}
|
|
</small>
|
|
</div>
|
|
{{if .Details}}
|
|
<details>
|
|
<summary>
|
|
{{$.Msg "audit.details"}}
|
|
</summary>
|
|
<p>
|
|
{{.Details}}
|
|
</p>
|
|
</details>
|
|
{{end}}
|
|
</article>
|
|
{{end}}
|
|
</div>
|
|
{{else}}
|
|
<div class="empty-state">
|
|
<span class="empty-icon">
|
|
◈
|
|
</span>
|
|
<h2>
|
|
{{if .AuditQuery}}
|
|
{{.Msg "audit.empty_filtered"}}
|
|
{{else}}
|
|
{{.Msg "audit.empty"}}
|
|
{{end}}
|
|
</h2>
|
|
</div>
|
|
{{end}}
|
|
{{if gt .AuditPages 1}}
|
|
<nav class="audit-pagination" aria-label="{{.Msg "audit.pagination"}}">
|
|
{{if gt .AuditPage 1}}
|
|
<a class="button-secondary link-button" href="/audit?{{.AuditQuery}}&page={{minus .AuditPage 1}}">
|
|
{{.Msg "audit.previous"}}
|
|
</a>
|
|
{{end}}
|
|
<span>
|
|
{{.AuditPage}}
|
|
/
|
|
{{.AuditPages}}
|
|
</span>
|
|
{{if lt .AuditPage .AuditPages}}
|
|
<a class="button-secondary link-button" href="/audit?{{.AuditQuery}}&page={{plus .AuditPage 1}}">
|
|
{{.Msg "audit.next"}}
|
|
</a>
|
|
{{end}}
|
|
</nav>
|
|
{{end}}
|
|
</section>
|
|
</main>
|
|
<script src="/static/app.v2.js">
|
|
</script>
|
|
</body>
|
|
</html>
|
|
{{end}}
|