This commit is contained in:
26
public/ts-build/components/modules/logging.js
Normal file
26
public/ts-build/components/modules/logging.js
Normal file
@@ -0,0 +1,26 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.renderLoggingModule = renderLoggingModule;
|
||||
const api_js_1 = require("../../services/api.js");
|
||||
const toast_js_1 = require("../../ui/toast.js");
|
||||
async function renderLoggingModule(guildId) {
|
||||
const container = document.getElementById('module-logging');
|
||||
if (!container)
|
||||
return;
|
||||
container.innerHTML = '<p class="muted">Lade Logging...</p>';
|
||||
try {
|
||||
const data = await api_js_1.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>';
|
||||
(0, toast_js_1.showToast)('Fehler beim Laden von Logging', true);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user