23 lines
935 B
TypeScript
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);
|
|
}
|
|
}
|