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:
tajniak81andClaude Opus 5.5 committed 2026-10-31 17:34:48 +01:00
1 parent 92cd81fd96
commit ffc6cc4fbc
31 files changed
+2326 -134

No files matched your search

+20
View File
@@ -3,6 +3,7 @@
import type { Organization, Role, User, UserList } from "@docwell/api-client";
import { DwBadge, DwButton, DwCallout } from "@docwell/ui";
import { computed, onMounted, reactive, ref, watch } from "vue";
import InvitesPanel from "../components/InvitesPanel.vue";
import { api, currentUser, errorMessage, isSuperadmin } from "../session";
// Mirrors the server's rules so the form only offers what will be accepted:
@@ -107,6 +108,21 @@ async function save() {
}
}
const notice = ref("");
async function sendReset(u: User) {
busy.value = true;
error.value = "";
notice.value = "";
try {
await api.users.sendPasswordReset(u.id);
notice.value = `A password reset link is on its way to ${u.email}.`;
} catch (e) {
error.value = errorMessage(e);
} finally {
busy.value = false;
}
}
async function remove(u: User) {
if (!confirm(`Delete ${u.email}? This cannot be undone.`)) return;
busy.value = true;
@@ -148,7 +164,10 @@ async function remove(u: User) {
</select>
</div>
<InvitesPanel :orgs="orgs" @accepted="load" />
<DwCallout v-if="error" tone="danger" size="ui" class="mt-4">{{ error }}</DwCallout>
<DwCallout v-if="notice" tone="success" size="ui" class="mt-4">{{ notice }}</DwCallout>
<form v-if="editing" class="mt-4 grid gap-3 dw-card !p-4 sm:grid-cols-2" @submit.prevent="save">
<h2 class="text-ui-lg sm:col-span-2">{{ editing === "new" ? "New user" : `Edit ${editing.email}` }}</h2>
@@ -228,6 +247,7 @@ async function remove(u: User) {
<td class="px-4 py-2 text-right whitespace-nowrap">
<template v-if="canEdit(u)">
<DwButton variant="ghost" size="sm" @click="startEdit(u)">Edit</DwButton>
<DwButton variant="ghost" size="sm" :disabled="busy" @click="sendReset(u)">Reset password</DwButton>
<DwButton
v-if="u.id !== currentUser?.id"
variant="ghost"