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();
|
orvibo.startServer();
|
||||||
|
|
||||||
app.get('/', (req, res) => {
|
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 => {
|
sockets.forEach(socket => {
|
||||||
switch(socket.state) {
|
switch(socket.state) {
|
||||||
case 1:
|
case 1:
|
||||||
socket.status = 'off'
|
socket.state = 'off'
|
||||||
break;
|
break;
|
||||||
case 0:
|
case 0:
|
||||||
socket.status = 'on'
|
socket.state = 'on'
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
}
|
}
|
||||||
|
@ -36,7 +36,7 @@ body {
|
|||||||
margin-bottom: 5px;
|
margin-bottom: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.button {
|
.button-off {
|
||||||
height: 50px;
|
height: 50px;
|
||||||
line-height: 50px;
|
line-height: 50px;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
@ -44,4 +44,16 @@ body {
|
|||||||
text-align: center;
|
text-align: center;
|
||||||
font-size: 20px;
|
font-size: 20px;
|
||||||
box-shadow: 1px 1px black;
|
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
|
h2.socket-name
|
||||||
| #{socket.uid}
|
| #{socket.uid}
|
||||||
h2.socket-name
|
h2.socket-name
|
||||||
| #{socket.status}
|
if socket.state === 1
|
||||||
a.button(href=`/?uid=${socket.uid}`)
|
a.button-on(href=`/?uid=${socket.uid}`)
|
||||||
| Toggle
|
| #{socket.state}
|
||||||
|
else
|
||||||
|
a.button-off(href=`/?uid=${socket.uid}`)
|
||||||
|
| #{socket.state}
|
Loading…
x
Reference in New Issue
Block a user