From 3576cb2992b8b637e5325a0fa36ee1954e0bef84 Mon Sep 17 00:00:00 2001 From: Autumn Date: Sat, 16 May 2026 09:17:15 +0100 Subject: [pages] added device toggling --- src/views/components/dashboard/device.pug | 4 +++- src/views/pages/dashboard/devices.pug | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'src/views') diff --git a/src/views/components/dashboard/device.pug b/src/views/components/dashboard/device.pug index 099a54b..739c275 100644 --- a/src/views/components/dashboard/device.pug +++ b/src/views/components/dashboard/device.pug @@ -6,7 +6,9 @@ article.device div if device.type == "light" - button Toggle + + - let deviceFunction = `toggleDevice('${device.id}')` + button(onclick=deviceFunction) Toggle - let location = `/devices/${device.id}` a(href=location) View diff --git a/src/views/pages/dashboard/devices.pug b/src/views/pages/dashboard/devices.pug index a7253f8..9953528 100644 --- a/src/views/pages/dashboard/devices.pug +++ b/src/views/pages/dashboard/devices.pug @@ -33,3 +33,5 @@ html include ../../components/dashboard/device.pug include ../../components/dashboard/sidebar.pug + + script(src="/public/js/devices.js") -- cgit v1.3