Phase 10, part 8: the audit log, and who made what
Sign-ins and failed ones, everything admins do to users, connections, posting accounts, each post published and email sent, pull requests and deletions go in an audit log (schema 36), kept two years; admins read it under Settings → Activity. Drafts, published posts and outreach emails show who made them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
{{define "content"}}{{template "settings-start" .}}{{with .Data}}{{$d := .}}
|
||||
<h2>Activity</h2>
|
||||
<p class="lede">Who did what: sign-ins (and failed ones), invitations and access, connections, everything sent or published, and deletions. Kept for two years.</p>
|
||||
<form class="card filters row wrap" method="get" action="/settings/activity">
|
||||
<label>Person <select name="user"><option value="">Everyone</option>{{range .People}}<option value="{{.ID}}" {{if eq .ID $d.Filter.UserID}}selected{{end}}>{{if .Name}}{{.Name}}{{else}}{{.Email}}{{end}}</option>{{end}}</select></label>
|
||||
<label>What <select name="action">
|
||||
<option value="">Everything</option>
|
||||
{{range $v, $l := dict "signin" "Sign-ins" "signin-failed" "Failed sign-ins" "invited" "Invitations" "access-changed" "Access changes" "connected" "Connections" "published" "Published" "sent-email" "Emails sent" "deleted" "Deletions"}}<option value="{{$v}}" {{if eq $v $d.Filter.Action}}selected{{end}}>{{$l}}</option>{{end}}
|
||||
</select></label>
|
||||
<label>Containing <input name="q" value="{{.Filter.Text}}" placeholder="an address, an account…"></label>
|
||||
<button type="submit" class="secondary">Show</button>
|
||||
</form>
|
||||
<section class="card">
|
||||
{{if .Entries}}
|
||||
<table class="list activity">
|
||||
<thead><tr><th>When</th><th>Who</th><th>What</th><th>From</th></tr></thead>
|
||||
<tbody>
|
||||
{{range .Entries}}<tr>
|
||||
<td title="{{.At.Local.Format "2 Jan 2006 15:04:05"}}">{{ago .At}}</td>
|
||||
<td>{{if .UserName}}{{.UserName}}{{else if eq .Kind "system"}}Supermarket{{else}}<span class="muted">someone</span>{{end}}{{if eq .Kind "system"}} <span class="muted small">(on its own)</span>{{else if eq .Kind "agent"}} <span class="pill">agent</span>{{end}}</td>
|
||||
<td>{{actionLabel .Action}}{{with .Target}} <strong>{{.}}</strong>{{end}}{{with .Detail}}<br><span class="muted small">{{truncate 200 .}}</span>{{end}}</td>
|
||||
<td class="muted small">{{.IP}}</td>
|
||||
</tr>{{end}}
|
||||
</tbody>
|
||||
</table>
|
||||
{{with .More}}<p><a href="/settings/activity?before={{.}}{{with $d.Filter.UserID}}&user={{.}}{{end}}{{with $d.Filter.Action}}&action={{.}}{{end}}{{with $d.Filter.Text}}&q={{.}}{{end}}">Older →</a></p>{{end}}
|
||||
{{else}}<p class="muted">Nothing recorded{{if or .Filter.UserID .Filter.Action .Filter.Text}} that matches{{end}}.</p>{{end}}
|
||||
</section>
|
||||
{{end}}{{template "settings-end"}}{{end}}
|
||||
Reference in New Issue
Block a user