Config-Suche findet einzelne Einstellungen
Die Seitenleisten-Suche kannte nur Bereiche: „starboard" führte zu Community, aber nicht zum Schwellwert-Feld. Bei rund 60 Einstellungen heißt das raten, in welchem Bereich etwas liegt. setting-index.js hält jetzt fest, wo jede Einstellung wohnt, mit Suchwörtern und Synonymen. Die Suche zeigt Treffer als eigene Gruppe unter den Bereichen; ein Klick wechselt den Bereich, scrollt zum Feld und hebt es kurz hervor. Enter nimmt den ersten Treffer, wobei Einstellungen Vorrang vor Bereichen haben — wer „schwellwert" tippt, will das Feld. Die Felder tragen dafür data-setting="<schlüssel>"; das Attribut wurde skriptgesteuert ergänzt, ohne die Struktur anzufassen. Fünf Einstellungen teilen sich ein Feld mit einer anderen (etwa die beiden Markenfarben) — die zeigen über `target` auf den Nachbarn. Textfelder werden beim Sprung fokussiert, Kanal-Auswahlen bewusst nicht: deren Fokus klappt die Liste auf und verdeckt alles darunter. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,103 @@
|
||||
// Register aller Einstellungen für die Suche in der Config-Seitenleiste.
|
||||
//
|
||||
// Die Seitenleisten-Suche fand bisher nur Bereiche: „starboard" führte zu
|
||||
// Community, aber nicht zum Schwellwert-Feld. Hier steht, wo jede Einstellung
|
||||
// wohnt — daraus wird ein Sprung direkt aufs Feld.
|
||||
//
|
||||
// `id` — Schlüssel wie im Formular; im JSX steht dazu data-setting="<id>"
|
||||
// `target` — nur nötig, wenn sich zwei Einstellungen ein Feld teilen (etwa die
|
||||
// beiden Markenfarben): dann wird das Feld des Nachbarn angesprungen
|
||||
// `tab` — Bereich, in dem das Feld liegt
|
||||
// `label` — was in der Trefferliste steht
|
||||
// `find` — zusätzliche Suchwörter (Synonyme, Fachbegriffe, alte Namen)
|
||||
//
|
||||
// Werte und Textvorlagen haben eigene Bereiche mit eigener Struktur; sie sind
|
||||
// hier mit ihrem Bereich vertreten, nicht Feld für Feld.
|
||||
|
||||
export const SETTING_INDEX = [
|
||||
/* ── Kanäle ─────────────────────────────────────── */
|
||||
{ id: 'devlog_channel_id', tab: 'feeds', label: 'Devlog-Kanal', find: 'devlog posten kanal' },
|
||||
{ id: 'commit_channel_id', tab: 'feeds', label: 'Commit-Kanal', find: 'gitea push commits' },
|
||||
{ id: 'release_channel_id', tab: 'feeds', label: 'Release-Kanal', find: 'ankündigung version changelog' },
|
||||
{ id: 'starboard_channel_id', tab: 'community', label: 'Starboard-Kanal', find: 'stern best-of highlights' },
|
||||
{ id: 'screenshot_channel_id', tab: 'community', label: 'Screenshot-Kanal', find: 'galerie bilder' },
|
||||
{ id: 'voting_channel_id', tab: 'community', label: 'Voting-Kanal', find: 'wunsch abstimmen ideen' },
|
||||
{ id: 'birthday_channel_id', tab: 'community', label: 'Geburtstags-Kanal', find: 'geburtstag gratulation' },
|
||||
{ id: 'modmail_channel_id', tab: 'support', label: 'Modmail-Kanal', find: 'direktnachricht dm staff' },
|
||||
{ id: 'ticket_channel_id', tab: 'support', label: 'Ticket-Kanal', find: 'support anfrage thread' },
|
||||
{ id: 'welcome_channel_id', tab: 'support', label: 'Willkommens-Kanal', find: 'begrüßung neue member' },
|
||||
{ id: 'modlog_channel_id', tab: 'support', label: 'Protokoll-Kanal', find: 'modlog logging gelöscht' },
|
||||
{ id: 'events_announce_channel_id', tab: 'system', label: 'Event-Kanal', find: 'events ankündigung' },
|
||||
{ id: 'social_announce_channel_id', tab: 'system', label: 'Social-Kanal', find: 'twitch youtube live stream' },
|
||||
{ id: 'tempvoice_channel_id', tab: 'system', label: 'Sprachkanal-Hub', find: 'temp voice join to create' },
|
||||
{ id: 'backup_channel_id', tab: 'system', label: 'Backup-Kanal', find: 'sicherung upload' },
|
||||
{ id: 'status_channel_id', tab: 'server', label: 'Server-Status-Kanal', find: 'monitor game embed' },
|
||||
{ id: 'server_alert_channel_id', target: 'status_channel_id', tab: 'server', label: 'Alarm-Kanal', find: 'down ausfall alert' },
|
||||
|
||||
/* ── Rollen ─────────────────────────────────────── */
|
||||
{ id: 'devlog_ping_role_id', tab: 'feeds', label: 'Devlog-Ping-Rolle', find: 'benachrichtigung abo erwähnen' },
|
||||
{ id: 'playtester_role_id', tab: 'community', label: 'Playtester-Rolle', find: 'alpha tester' },
|
||||
{ id: 'birthday_role_id', tab: 'community', label: 'Geburtstags-Rolle', find: 'tagesrolle' },
|
||||
{ id: 'autorole_id', tab: 'community', label: 'Auto-Rolle', find: 'startrolle beitritt automatisch' },
|
||||
|
||||
/* ── Schalter & Werte in den Bereichen ──────────── */
|
||||
{ id: 'commit_feed_enabled', tab: 'feeds', label: 'Push-Embeds posten', find: 'commit feed an aus' },
|
||||
{ id: 'commit_branch_filter', tab: 'feeds', label: 'Branch-Filter', find: 'main release zweig' },
|
||||
{ id: 'ignored_repos', tab: 'feeds', label: 'Ignorierte Repos', find: 'ausschließen repository' },
|
||||
{ id: 'weekly_recap_enabled', tab: 'feeds', label: 'Wochen-Rückblick', find: 'sonntag zusammenfassung' },
|
||||
{ id: 'devlog_threads_enabled', tab: 'feeds', label: 'Devlog-Threads', find: 'diskussion kommentare' },
|
||||
{ id: 'starboard_threshold', target: 'starboard_channel_id', tab: 'community', label: 'Starboard-Schwellwert', find: 'sterne anzahl schwelle' },
|
||||
{ id: 'levels_enabled', tab: 'community', label: 'Level-System', find: 'xp rang erfahrung' },
|
||||
{ id: 'levels_announce', tab: 'community', label: 'Level-Up ankündigen', find: 'aufstieg nachricht' },
|
||||
{ id: 'level_rewards', tab: 'community', label: 'Level-Belohnungen', find: 'rollen ab level' },
|
||||
{ id: 'sticky_roles_enabled', tab: 'community', label: 'Rollen merken', find: 'sticky rejoin wiederherstellen' },
|
||||
|
||||
/* ── Willkommens-Karte ──────────────────────────── */
|
||||
{ id: 'welcome_card_enabled', tab: 'support', label: 'Willkommens-Karte rendern', find: 'bild karte begrüßung' },
|
||||
{ id: 'welcome_card_kicker', tab: 'support', label: 'Willkommens-Karte: kleine Zeile', find: 'überschrift text karte' },
|
||||
{ id: 'welcome_card_sub', tab: 'support', label: 'Willkommens-Karte: Zeile darunter', find: 'member nummer text' },
|
||||
{ id: 'welcome_card_image', tab: 'support', label: 'Willkommens-Karte: Hintergrundbild', find: 'grafik bild hintergrund' },
|
||||
{ id: 'welcome_card_watermark', tab: 'support', label: 'Willkommens-Karte: Markenname', find: 'wasserzeichen hintergrund' },
|
||||
|
||||
/* ── Marke ──────────────────────────────────────── */
|
||||
{ id: 'brand_name', tab: 'brand', label: 'Markenname', find: 'footer embed name' },
|
||||
{ id: 'brand_color', tab: 'brand', label: 'Primärfarbe', find: 'farbe embed hex' },
|
||||
{ id: 'brand_color2', target: 'brand_color', tab: 'brand', label: 'Sekundärfarbe', find: 'farbe zweite hex' },
|
||||
{ id: 'bot_name', tab: 'brand', label: 'Bot-Name', find: 'umbenennen username' },
|
||||
{ id: 'bot_presence_status', tab: 'brand', label: 'Bot-Status', find: 'online abwesend nicht stören' },
|
||||
{ id: 'bot_status_text', tab: 'brand', label: 'Bot-Aktivität', find: 'spielt schaut status text' },
|
||||
|
||||
/* ── Technik & Zugang ───────────────────────────── */
|
||||
{ id: 'bug_report_repo', tab: 'system', label: 'Repo für Fehlermeldungen', find: 'bug issue gitea' },
|
||||
{ id: 'roadmap_repo', tab: 'system', label: 'Repo für die Roadmap', find: 'milestones meilensteine' },
|
||||
{ id: 'watchdog_urls', tab: 'system', label: 'Zu prüfende Adressen', find: 'watchdog erreichbarkeit uptime' },
|
||||
{ id: 'twitch_channel', target: 'youtube_channel_id', tab: 'system', label: 'Twitch-Kanal', find: 'stream live' },
|
||||
{ id: 'youtube_channel_id', tab: 'system', label: 'YouTube-Kanal', find: 'video rss' },
|
||||
{ id: 'backup_enabled', tab: 'system', label: 'Datenbank-Sicherung', find: 'backup nächtlich' },
|
||||
{ id: 'repo_backup_enabled', tab: 'system', label: 'Repository-Sicherung', find: 'gitea bundle backup' },
|
||||
{ id: 'member_gate_enabled', tab: 'system', label: 'Login nur für Mitglieder', find: 'gate zugang sperren' },
|
||||
{ id: 'discord_invite_url', tab: 'system', label: 'Einladungs-Link', find: 'invite discord' },
|
||||
{ id: 'public_url', tab: 'system', label: 'Öffentliche Adresse', find: 'url domain' },
|
||||
{ id: 'hub_url', tab: 'system', label: 'Hub-Adresse', find: 'domain zwei seiten community' },
|
||||
{ id: 'bot_url', tab: 'system', label: 'Bot-Adresse', find: 'domain zwei seiten produktseite' },
|
||||
{ id: 'cookie_domain', tab: 'system', label: 'Cookie-Domain', find: 'login beide domains' },
|
||||
{ id: 'gitea_url', tab: 'system', label: 'Gitea-Adresse', find: 'git server url' },
|
||||
{ id: 'discord_guild_id', tab: 'brand', label: 'Server-ID', find: 'guild id discord' },
|
||||
{ id: 'legal_name', tab: 'system', label: 'Impressum: Name', find: 'betreiber rechtstext' },
|
||||
{ id: 'legal_address', tab: 'system', label: 'Impressum: Anschrift', find: 'adresse rechtstext' },
|
||||
{ id: 'legal_email', tab: 'system', label: 'Impressum: E-Mail', find: 'kontakt rechtstext' },
|
||||
];
|
||||
|
||||
/**
|
||||
* Einstellungen zu einer Sucheingabe.
|
||||
* @param {string} query
|
||||
* @param {(tab: string) => boolean} allowed — Rechte-Prüfung je Bereich
|
||||
*/
|
||||
export function findSettings(query, allowed) {
|
||||
const q = query.trim().toLowerCase();
|
||||
if (q.length < 2) return [];
|
||||
return SETTING_INDEX
|
||||
.filter((s) => allowed(s.tab))
|
||||
.filter((s) => `${s.label} ${s.find} ${s.id}`.toLowerCase().includes(q))
|
||||
.slice(0, 8);
|
||||
}
|
||||
Reference in New Issue
Block a user