mirror of
https://github.com/karl0ss/orvibo-b25-server-kex.git
synced 2025-04-29 12:53:40 +01:00
work day updates
This commit is contained in:
parent
57ff3dbf6a
commit
50ff77fba6
1069
package-lock.json
generated
1069
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -55,15 +55,16 @@ orvibo.on('plugDisconnectedWithError', ({uid, name }) => {
|
||||
orvibo.startServer();
|
||||
|
||||
app.get('/', (req, res) => {
|
||||
let sockets = orvibo.getConnectedSocket();
|
||||
// let sockets = orvibo.getConnectedSocket();
|
||||
let sockets = [{name: "Plug1", state: 1, uid: "222222"},{name: "Plug2", state: 0, uid: "111111"}]
|
||||
|
||||
sockets.forEach(socket => {
|
||||
switch(socket.state) {
|
||||
case 1:
|
||||
socket.status = 'off'
|
||||
socket.state = 'off'
|
||||
break;
|
||||
case 0:
|
||||
socket.status = 'on'
|
||||
socket.state = 'on'
|
||||
break;
|
||||
default:
|
||||
}
|
||||
|
@ -36,7 +36,7 @@ body {
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
.button {
|
||||
.button-off {
|
||||
height: 50px;
|
||||
line-height: 50px;
|
||||
width: 100%;
|
||||
@ -44,4 +44,16 @@ body {
|
||||
text-align: center;
|
||||
font-size: 20px;
|
||||
box-shadow: 1px 1px black;
|
||||
color: red
|
||||
}
|
||||
|
||||
.button-on {
|
||||
height: 50px;
|
||||
line-height: 50px;
|
||||
width: 100%;
|
||||
text-decoration: none;
|
||||
text-align: center;
|
||||
font-size: 20px;
|
||||
box-shadow: 1px 1px black;
|
||||
color: green;
|
||||
}
|
||||
|
@ -9,6 +9,9 @@ block content
|
||||
h2.socket-name
|
||||
| #{socket.uid}
|
||||
h2.socket-name
|
||||
| #{socket.status}
|
||||
a.button(href=`/?uid=${socket.uid}`)
|
||||
| Toggle
|
||||
if socket.state === 1
|
||||
a.button-on(href=`/?uid=${socket.uid}`)
|
||||
| #{socket.state}
|
||||
else
|
||||
a.button-off(href=`/?uid=${socket.uid}`)
|
||||
| #{socket.state}
|
Loading…
x
Reference in New Issue
Block a user