vole
Clone
Read only, no credentials:
https://rodent.software/git/vole.git
Write over SSH with a registered key:
git clone ssh://git@0.0.0.0:2222/vole.git
A free and open-source forge that lives in your Git repo.
Summarize accounts, activity, and configuration on the Admin overview
0db980ee6b820127a0310be661b5d2c98fcdde92 · Keenan Nemetz · 4d ago · parent 43e681d8
Summarize accounts, activity, and configuration on the Admin overview The overview is the whole admin surface at a glance now, so it repeats the head of the other tabs: active people, bots, instance admins, and retired accounts from the roster; the newest audit records with their detail and a link into the log; and the configuration warnings, including a browser that cannot sign anyone in. Refs #198 (01M6MK0NNZ2XR1D5TQKNWYT4HN).
server/web/admin.go +41−1
| @@ -65,9 +65,49 @@ type adminPageView struct { | |||
| 65 | 65 | ||
| 66 | 66 | // Accounts. | |
| 67 | 67 | Users []adminUserRow | |
| 68 | // AccountSummary is the overview's counts, derived from the same roster the | ||
| 69 | // Accounts tab lists. | ||
| 70 | AccountSummary adminAccountSummary | ||
| 68 | 71 | ||
| 69 | 72 | // Audit log. | |
| 70 | Audit auditPageView | ||
| 73 | Audit auditPageView | ||
| 74 | RecentAudit adminAuditSummary | ||
| 75 | |||
| 76 | // Configuration attention: the warnings from the configuration tab, repeated | ||
| 77 | // on the overview so a development setting is visible without a click. | ||
| 78 | ConfigWarnings []statusSetting | ||
| 79 | } | ||
| 80 | |||
| 81 | // adminAccountSummary is the roster at a glance: who can act, and who has been | ||
| 82 | // retired. A retired account keeps its name, so it is counted separately rather | ||
| 83 | // than hidden. | ||
| 84 | type adminAccountSummary struct { | ||
| 85 | People int | ||
| 86 | Bots int | ||
| 87 | Admins int | ||
| 88 | Retired int | ||
| 89 | } | ||
| 90 | |||
| 91 | func (w *Web) accountSummary() adminAccountSummary { | ||
| 92 | var s adminAccountSummary | ||
| 93 | if w.Ident == nil { | ||
| 94 | return s | ||
| 95 | } | ||
| 96 | for _, a := range w.Ident.All() { | ||
| 97 | if !a.Active() { | ||
| 98 | s.Retired++ | ||
| 99 | continue | ||
| 100 | } | ||
| 101 | if a.Bot() { | ||
| 102 | s.Bots++ | ||
| 103 | } else { | ||
| 104 | s.People++ | ||
| 105 | } | ||
| 106 | if a.Admin { | ||
| 107 | s.Admins++ | ||
| 108 | } | ||
| 109 | } | ||
| 110 | return s | ||
| 71 | 111 | } | |
| 72 | 112 | ||
| 73 | 113 | // AdminPage is the instance-admin surface. The gate runs before anything is | |