mirror of
https://github.com/karl0ss/orvibo-b25-server-kex.git
synced 2025-04-29 12:53:40 +01:00
plug pic :)
This commit is contained in:
parent
c5dea64a14
commit
7dd4e46fcd
3
.vscode/settings.json
vendored
Normal file
3
.vscode/settings.json
vendored
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"docker.defaultRegistryPath": "karl0ss"
|
||||||
|
}
|
6
index.js
6
index.js
@ -44,14 +44,14 @@ 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"}]
|
let sockets = [{name: "Plug1", state: 1, uid: "222222", modelId: "f8b11bed724647e98bd07a66dca6d5b6"},{name: "Plug2", state: 0, uid: "111111", modelId: "123"}]
|
||||||
|
|
||||||
if (req.query.uid != undefined) {
|
if (req.query.uid != undefined) {
|
||||||
orvibo.toggleSocket(req.query.uid);
|
orvibo.toggleSocket(req.query.uid);
|
||||||
}
|
}
|
||||||
|
|
||||||
sockets = orvibo.getConnectedSocket();
|
// sockets = orvibo.getConnectedSocket();
|
||||||
|
|
||||||
utils.setState(sockets)
|
utils.setState(sockets)
|
||||||
|
|
||||||
|
@ -36,6 +36,12 @@ body {
|
|||||||
margin-bottom: 5px;
|
margin-bottom: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.socket-image {
|
||||||
|
width: 100%;
|
||||||
|
height: 300px;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
.button-off {
|
.button-off {
|
||||||
background-color:#fc0000;
|
background-color:#fc0000;
|
||||||
-moz-border-radius:28px;
|
-moz-border-radius:28px;
|
||||||
|
BIN
server/images/b25.jpg
Normal file
BIN
server/images/b25.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 73 KiB |
BIN
server/images/b25UK.jpg
Normal file
BIN
server/images/b25UK.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 31 KiB |
@ -8,6 +8,13 @@ block content
|
|||||||
else
|
else
|
||||||
each socket in sockets
|
each socket in sockets
|
||||||
div.socket
|
div.socket
|
||||||
|
case socket.modelId
|
||||||
|
when 'f8b11bed724647e98bd07a66dca6d5b6'
|
||||||
|
div.socket-image(style=`background: url('/images/b25UK.jpg') top center
|
||||||
|
no-repeat; background-size: cover;`)
|
||||||
|
when '123'
|
||||||
|
div.socket-image(style=`background: url('/images/b25.jpg') top center
|
||||||
|
no-repeat; background-size: cover;`)
|
||||||
h2.socket-name
|
h2.socket-name
|
||||||
| #{socket.name}
|
| #{socket.name}
|
||||||
h2.socket-name
|
h2.socket-name
|
||||||
|
Loading…
x
Reference in New Issue
Block a user