fehlersuche controll seite und app.js
This commit is contained in:
parent
9b3d3c5c8f
commit
c427dec849
@ -1,6 +1,9 @@
|
|||||||
// static/js/app.js – MK Control Frontend
|
// static/js/app.js – MK Control Frontend
|
||||||
|
|
||||||
document.addEventListener('DOMContentLoaded', () => {
|
document.addEventListener('DOMContentLoaded', () => {
|
||||||
|
|
||||||
|
const config = window.mkConfig || {};
|
||||||
|
console.log("app.js verwendet config:", config);
|
||||||
console.log('MK Control Frontend geladen');
|
console.log('MK Control Frontend geladen');
|
||||||
|
|
||||||
// ── Elemente ───────────────────────────────────────────────────────────────
|
// ── Elemente ───────────────────────────────────────────────────────────────
|
||||||
@ -18,7 +21,7 @@ document.addEventListener('DOMContentLoaded', () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ── Config aus Template (von Flask eingebettet) ───────────────────────────
|
// ── Config aus Template (von Flask eingebettet) ───────────────────────────
|
||||||
const config = window.config || {}; // Sicherstellen, dass config existiert
|
//const config = window.config || {}; // Sicherstellen, dass config existiert
|
||||||
|
|
||||||
// ── Connect-Button ────────────────────────────────────────────────────────
|
// ── Connect-Button ────────────────────────────────────────────────────────
|
||||||
connectBtn.addEventListener('click', async () => {
|
connectBtn.addEventListener('click', async () => {
|
||||||
|
|||||||
@ -72,8 +72,10 @@
|
|||||||
|
|
||||||
{% block scripts %}
|
{% block scripts %}
|
||||||
<script>
|
<script>
|
||||||
const config = {{ config | tojson | safe }};
|
// config global verfügbar machen
|
||||||
console.log("Config im JS:", config);
|
window.mkConfig = {{ config | tojson | safe }};
|
||||||
console.log("Channels:", config?.channels || "KEINE CHANNELS");
|
|
||||||
|
console.log("window.mkConfig gesetzt:", window.mkConfig);
|
||||||
|
console.log("Channels:", window.mkConfig?.channels);
|
||||||
</script>
|
</script>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
Loading…
x
Reference in New Issue
Block a user