diff --git a/anoying_promt b/anoying_promt index 6b0a342..765fe2c 100644 --- a/anoying_promt +++ b/anoying_promt @@ -44,3 +44,7 @@ Filtering, by account timetamp, alphabetily filtered, unverified/etc... ---(NEW) BUGS WITH SETTINGS: glossian blur its diffent at each settings section opened: need to unify it padding for buttons into admin center at pagination is so tigh. fix it + + +--- USERLIST: +pouvoir diff --git a/docs/OPERATIONS.md b/docs/OPERATIONS.md index 0af7294..e9155c2 100644 --- a/docs/OPERATIONS.md +++ b/docs/OPERATIONS.md @@ -63,7 +63,11 @@ catalog), **Access** (access-request wishlist triage, see below), working **Register** button — anyone can create an account (key shown once) via `POST /api/auth/register`. When off, the button is greyed with the tooltip *"Registration currently disabled on this platform"* and the - endpoint answers 403. Flipped live, no restart. + endpoint answers 403. Flipped live, no restart. Turning it on retires the + access-request wishlist automatically. +- `registration_request_enabled` (default on): shows **Request access** on the + login page (wishlist). Only switchable on while public registration is off — + the two are mutually exclusive (API answers 409 otherwise). - `tools_ocr_enabled` (default on): admin kill-switch for the OCR tool. - Flags live in the `settings` SQLite table, edited via `GET/PATCH /api/admin/settings` (admin Bearer only). diff --git a/frontend/src/components/AdminCenter.tsx b/frontend/src/components/AdminCenter.tsx index 3da096b..9568ed8 100644 --- a/frontend/src/components/AdminCenter.tsx +++ b/frontend/src/components/AdminCenter.tsx @@ -25,7 +25,7 @@ const TABS: { id: Tab; label: string; icon: typeof Users }[] = [ export function AdminCenter() { const [allowed, setAllowed] = useState(null); const [tab, setTab] = useState("accounts"); - const [settings, setSettings] = useState<{ registrationEnabled: boolean; ocrEnabled: boolean } | null>(null); + const [settings, setSettings] = useState<{ registrationEnabled: boolean; accessRequestEnabled: boolean; ocrEnabled: boolean } | null>(null); const [mail, setMail] = useState<{ recovery: boolean; from?: string } | null>(null); const [error, setError] = useState(""); const [saving, setSaving] = useState(false); @@ -45,7 +45,7 @@ export function AdminCenter() { .catch(() => setAllowed(false)); }, []); - async function toggle(patch: { registrationEnabled?: boolean; ocrEnabled?: boolean }) { + async function toggle(patch: { registrationEnabled?: boolean; accessRequestEnabled?: boolean; ocrEnabled?: boolean }) { setSaving(true); setError(""); try { @@ -129,10 +129,29 @@ export function AdminCenter() {

Public registration

-

Show the Register button on the login page. Off = admin-created accounts only.

+

Show the Register button on the login page. Off = admin-created accounts only. Turning it on retires the wishlist below.

toggle({ registrationEnabled: v })} />
+
+
+

Access requests (wishlist)

+

+ {settings?.registrationEnabled + ? "Unavailable while public registration is on — it replaces the wishlist." + : "Show Request access on the login page. Visitors reserve a username and plead their case; you triage them in the Access tab."} +

+
+ toggle({ accessRequestEnabled: v })} + /> +

OCR tool

diff --git a/frontend/src/components/AdminPanel.tsx b/frontend/src/components/AdminPanel.tsx index e30d720..f3338cf 100644 --- a/frontend/src/components/AdminPanel.tsx +++ b/frontend/src/components/AdminPanel.tsx @@ -301,7 +301,7 @@ export function AdminPanel({ open, onClose, bare }: { open: boolean; onClose: () )} {!showCreate ? ( -
+
diff --git a/frontend/src/components/Chat.tsx b/frontend/src/components/Chat.tsx index a374dd7..97c151c 100644 --- a/frontend/src/components/Chat.tsx +++ b/frontend/src/components/Chat.tsx @@ -153,7 +153,7 @@ export function Chat({
{messages.length === 0 && !streaming && (
- +

How can I help, {user.displayName.split(" ")[0]}?

Pick a model, then type below. Markdown is supported.

diff --git a/frontend/src/components/Login.tsx b/frontend/src/components/Login.tsx index adf8f49..ba32444 100644 --- a/frontend/src/components/Login.tsx +++ b/frontend/src/components/Login.tsx @@ -22,12 +22,14 @@ export function Login({ onLogin }: { onLogin: (user: UserType) => void }) { const [registerOpen, setRegisterOpen] = useState(false); const [registrationOn, setRegistrationOn] = useState(false); const [requestOpen, setRequestOpen] = useState(false); + const [requestOn, setRequestOn] = useState(false); useEffect(() => { api.methods().then((m) => { setRecoveryOn(m.recovery); setRecoveryFrom(m.from); setRegistrationOn(m.registration); + setRequestOn(m.accessRequest); }).catch(() => {}); }, []); @@ -115,9 +117,9 @@ export function Login({ onLogin }: { onLogin: (user: UserType) => void }) { onClose={() => setRegisterOpen(false)} onDone={(u, k) => { setUsername(u); setKey(k); }} /> - {/* Wishlist path: when open registration is off, visitors can still - reserve a username and plead their case; an admin triages it. */} - {!registrationOn && ( + {/* Wishlist path: only when open registration is off AND the admin + enabled access requests. They are mutually exclusive server-side. */} + {!registrationOn && requestOn && (