v0.12.0 codes for FCM and rebranded jama to RosterChirp

This commit is contained in:
2026-03-22 20:15:57 -04:00
parent 21dc788cd3
commit 819d60d693
40 changed files with 426 additions and 363 deletions

View File

@@ -1,7 +1,7 @@
/**
* HostPanel.jsx — JAMA-HOST Control Panel
* HostPanel.jsx — RosterChirp-Host Control Panel
*
* Renders inside the main JAMA right-panel area (not a separate page/route).
* Renders inside the main RosterChirp right-panel area (not a separate page/route).
* Protected by:
* 1. Only shown when is_host_domain === true (server-computed from HOST_DOMAIN)
* 2. Only accessible to admin role users
@@ -15,9 +15,9 @@ import UserFooter from './UserFooter.jsx';
// ── Constants ─────────────────────────────────────────────────────────────────
const PLANS = [
{ value: 'chat', label: 'JAMA-Chat', desc: 'Chat only' },
{ value: 'brand', label: 'JAMA-Brand', desc: 'Chat + Branding' },
{ value: 'team', label: 'JAMA-Team', desc: 'Chat + Branding + Groups + Schedule' },
{ value: 'chat', label: 'RosterChirp-Chat', desc: 'Chat only' },
{ value: 'brand', label: 'RosterChirp-Brand', desc: 'Chat + Branding' },
{ value: 'team', label: 'RosterChirp-Team', desc: 'Chat + Branding + Groups + Schedule' },
];
const PLAN_COLOURS = {
@@ -307,7 +307,7 @@ function KeyEntry({ onSubmit }) {
setChecking(true); setError('');
try {
const res = await fetch('/api/host/status', { headers: { 'X-Host-Admin-Key': key.trim() } });
if (res.ok) { sessionStorage.setItem('jama-host-key', key.trim()); onSubmit(key.trim()); }
if (res.ok) { sessionStorage.setItem('rosterchirp-host-key', key.trim()); onSubmit(key.trim()); }
else setError('Invalid admin key');
} catch { setError('Connection error'); }
finally { setChecking(false); }
@@ -336,7 +336,7 @@ function KeyEntry({ onSubmit }) {
export default function HostPanel({ onProfile, onHelp, onAbout }) {
const { user } = useAuth();
const [adminKey, setAdminKey] = useState(() => sessionStorage.getItem('jama-host-key') || '');
const [adminKey, setAdminKey] = useState(() => sessionStorage.getItem('rosterchirp-host-key') || '');
const [status, setStatus] = useState(null);
const [tenants, setTenants] = useState([]);
const [loading, setLoading] = useState(false);
@@ -363,7 +363,7 @@ export default function HostPanel({ onProfile, onHelp, onAbout }) {
toast(e.message, 'error');
// Key is invalid — clear it so the prompt shows again
if (e.message.includes('401') || e.message.includes('Invalid') || e.message.includes('401')) {
sessionStorage.removeItem('jama-host-key');
sessionStorage.removeItem('rosterchirp-host-key');
setAdminKey('');
}
} finally { setLoading(false); }