diff --git a/tutorials/device-dashboard/mongoose_dashboard.c b/tutorials/device-dashboard/mongoose_dashboard.c index a715ece4..5fc8ab7b 100644 --- a/tutorials/device-dashboard/mongoose_dashboard.c +++ b/tutorials/device-dashboard/mongoose_dashboard.c @@ -45,9 +45,9 @@ static struct mg_field fields_metrics[] = { static void sync_metrics(bool is_write) { if (is_write) return; - s_ram = 25 + (rand() % 16); // Sumulate metric change - s_cpu = 7 + (rand() % 21); - s_temperature = 14.8 + ((double)rand() / RAND_MAX) * 20.0; + s_ram = 25 + (rand() % 16); // Sumulate metric change + s_cpu = 7 + (rand() % 21); + s_temperature = 14.8 + ((double) rand() / RAND_MAX) * 20.0; } // Read-write device settings @@ -108,7 +108,7 @@ void sync_chart1(bool is_write) { } static struct mg_field_set field_sets[] = { - {"control", fields_control, sync_control, 0, 0}, + {"controls", fields_control, sync_control, 0, 0}, {"metrics", fields_metrics, sync_metrics, 0, 0}, {"settings", fields_settings, sync_settings, 0, 0}, {"chart1", fields_chart1, sync_chart1, 0, 0}, diff --git a/tutorials/device-dashboard/web_root/index.html b/tutorials/device-dashboard/web_root/index.html index 3828f872..f23a1740 100644 --- a/tutorials/device-dashboard/web_root/index.html +++ b/tutorials/device-dashboard/web_root/index.html @@ -206,38 +206,37 @@ - + diff --git a/tutorials/device-dashboard/web_root/main.js b/tutorials/device-dashboard/web_root/main.js index 47aefc77..380e8a7d 100644 --- a/tutorials/device-dashboard/web_root/main.js +++ b/tutorials/device-dashboard/web_root/main.js @@ -86,4 +86,6 @@ document.addEventListener("DOMContentLoaded", () => { Dashboard.on('change', args => updateGraphPoints(args?.chart1?.data)); Dashboard.call('get', 'chart1').then(resp => updateGraphPoints(resp?.data)); + // Set iframe source in JS, to prevent Monolith killing it + document.getElementById("logs").src = "/logs/"; }); diff --git a/tutorials/device-dashboard/web_root/style.css b/tutorials/device-dashboard/web_root/style.css index 049ffcb4..d1b88248 100644 --- a/tutorials/device-dashboard/web_root/style.css +++ b/tutorials/device-dashboard/web_root/style.css @@ -34,10 +34,6 @@ body { } .header { - position: fixed; - top: 0; - left: 0; - right: 0; z-index: 50; } @@ -48,7 +44,7 @@ body { align-items: center; justify-content: space-between; gap: var(--spacing-4); - padding: var(--spacing-2) var(--spacing-4); + padding: var(--spacing-2) var(--spacing-6); } .header-left { @@ -136,7 +132,7 @@ body { .tab-stage { max-width: var(--max-width); margin: 0 auto; - padding: 5.5rem var(--spacing-4) var(--spacing-4); + padding: 0.5rem var(--spacing-6) var(--spacing-4); } .tab-panel { @@ -247,13 +243,6 @@ body { display: none; } -/* ── Panel ──────────────────────────────────────── */ - -.panel-layout { - padding-top: 1rem; - max-width: 22rem; -} - .panel-body { display: flex; flex-direction: column;