fehlersuche controll seite und app.js

This commit is contained in:
oberon 2026-02-11 22:06:55 +01:00
parent 9b3d3c5c8f
commit c427dec849
2 changed files with 9 additions and 4 deletions

View File

@ -1,6 +1,9 @@
// static/js/app.js MK Control Frontend
document.addEventListener('DOMContentLoaded', () => {
const config = window.mkConfig || {};
console.log("app.js verwendet config:", config);
console.log('MK Control Frontend geladen');
// ── Elemente ───────────────────────────────────────────────────────────────
@ -18,7 +21,7 @@ document.addEventListener('DOMContentLoaded', () => {
}
// ── Config aus Template (von Flask eingebettet) ───────────────────────────
const config = window.config || {}; // Sicherstellen, dass config existiert
//const config = window.config || {}; // Sicherstellen, dass config existiert
// ── Connect-Button ────────────────────────────────────────────────────────
connectBtn.addEventListener('click', async () => {

View File

@ -72,8 +72,10 @@
{% block scripts %}
<script>
const config = {{ config | tojson | safe }};
console.log("Config im JS:", config);
console.log("Channels:", config?.channels || "KEINE CHANNELS");
// config global verfügbar machen
window.mkConfig = {{ config | tojson | safe }};
console.log("window.mkConfig gesetzt:", window.mkConfig);
console.log("Channels:", window.mkConfig?.channels);
</script>
{% endblock %}