aboutsummaryrefslogtreecommitdiff
path: root/src/views
diff options
context:
space:
mode:
authorAutumn <git@autumnfo.rest>2026-05-16 09:17:15 +0100
committerAutumn <git@autumnfo.rest>2026-05-16 09:17:15 +0100
commit3576cb2992b8b637e5325a0fa36ee1954e0bef84 (patch)
tree9cd3e71a963614d6648e78c79dd0449b1bea237e /src/views
parent14f77d413d7a1d1e7d087fdb2c201387f7c9c381 (diff)
[pages] added device toggling
Diffstat (limited to 'src/views')
-rw-r--r--src/views/components/dashboard/device.pug4
-rw-r--r--src/views/pages/dashboard/devices.pug2
2 files changed, 5 insertions, 1 deletions
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")