27 lines
1017 B
JavaScript
27 lines
1017 B
JavaScript
"use strict";
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
exports.renderSettingsSection = renderSettingsSection;
|
|
const api_js_1 = require("../services/api.js");
|
|
const toast_js_1 = require("../ui/toast.js");
|
|
async function renderSettingsSection(guildId) {
|
|
const section = document.getElementById('section-settings');
|
|
if (!section)
|
|
return;
|
|
section.innerHTML = '<p class="muted">Lade Einstellungen...</p>';
|
|
try {
|
|
const data = await api_js_1.api.settings(guildId);
|
|
const settings = data?.settings || {};
|
|
section.innerHTML = `
|
|
<h2 class="section-title">Einstellungen</h2>
|
|
<div class="card">
|
|
<pre style="white-space:pre-wrap;">${JSON.stringify(settings, null, 2)}</pre>
|
|
</div>
|
|
`;
|
|
}
|
|
catch (err) {
|
|
console.error(err);
|
|
section.innerHTML = '<div class="empty-state">Einstellungen konnten nicht geladen werden.</div>';
|
|
(0, toast_js_1.showToast)('Fehler beim Laden der Einstellungen', true);
|
|
}
|
|
}
|