Build out the admin panel
- Overview: users, organizations, workspaces, spaces, pages, files and storage (org admins see their organization), plus pages open right now, the search index size, and version, uptime and database health. - Users: invite people by email (with resend, revoke and a copyable link when mail fails) and send a password-reset email. - Authentication: sign-up on or off, the email-domain allow-list, and sign-in links by email. - Branding: instance name, accent colour and logo. The web app shows them on the sign-in pages and applies the accent colour everywhere. - Email and Storage: SMTP and S3 settings with test buttons. - Maintenance: create, download and delete database backups, and a view of the background jobs with their last run, duration and errors. On the server, a small jobs registry records each search-indexing pass, and "search.rebuild" replaces the separate reindex endpoint. A new instance package serves the dashboard numbers, health and backups. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
92cd81fd96
commit
ffc6cc4fbc
31 files changed
+2326
-134
No files matched your search
@@ -73,6 +73,29 @@ func (h *Hub) Close(ctx context.Context) error {
|
||||
}
|
||||
}
|
||||
|
||||
// Stats counts the open pages and their connected editors.
|
||||
type Stats struct {
|
||||
Rooms int `json:"rooms"`
|
||||
Peers int `json:"peers"`
|
||||
}
|
||||
|
||||
// Stats reports what is open right now (for the admin dashboard).
|
||||
func (h *Hub) Stats() Stats {
|
||||
h.mu.Lock()
|
||||
rooms := make([]*room, 0, len(h.rooms))
|
||||
for _, r := range h.rooms {
|
||||
rooms = append(rooms, r)
|
||||
}
|
||||
h.mu.Unlock()
|
||||
st := Stats{Rooms: len(rooms)}
|
||||
for _, r := range rooms {
|
||||
r.mu.Lock()
|
||||
st.Peers += len(r.sessions)
|
||||
r.mu.Unlock()
|
||||
}
|
||||
return st
|
||||
}
|
||||
|
||||
// Peer is the sending side of one connection. Send must not block; it returns
|
||||
// false when the peer cannot keep up and is being disconnected.
|
||||
type Peer interface {
|
||||
|
||||
Reference in new issue
Block a user