Files
Papo/public/ts/components/modules/logging.ts
Pascal Prießnitz 22caa79b54
All checks were successful
Deploy Discord Bot / deploy (push) Successful in 37s
[deploy]
2025-12-04 16:43:38 +01:00

23 lines
935 B
TypeScript

import { api } from '../../services/api.js';
import { showToast } from '../../ui/toast.js';
export async function renderLoggingModule(guildId: string) {
const container = document.getElementById('module-logging');
if (!container) return;
container.innerHTML = '<p class="muted">Lade Logging...</p>';
try {
const data: any = await api.settings(guildId);
const cfg = data?.settings?.loggingConfig || data?.loggingConfig || {};
container.innerHTML = `
<h3 class="label">Logging</h3>
<p class="muted">Channel: ${cfg.logChannelId || '-'}</p>
<p class="muted">Join/Leave: ${cfg.categories?.joinLeave ? 'an' : 'aus'}</p>
<p class="muted">System: ${cfg.categories?.system ? 'an' : 'aus'}</p>
`;
} catch (err) {
console.error(err);
container.innerHTML = '<div class="empty-state">Logging konnte nicht geladen werden.</div>';
showToast('Fehler beim Laden von Logging', true);
}
}