plug pic :)

This commit is contained in:
karl0ss 2019-07-17 15:43:37 +01:00
parent c5dea64a14
commit 7dd4e46fcd
6 changed files with 19 additions and 3 deletions

3
.vscode/settings.json vendored Normal file
View File

@ -0,0 +1,3 @@
{
"docker.defaultRegistryPath": "karl0ss"
}

View File

@ -44,14 +44,14 @@ orvibo.on('plugDisconnectedWithError', ({uid, name }) => {
orvibo.startServer();
app.get('/', (req, res) => {
let sockets = orvibo.getConnectedSocket();
// let sockets = [{name: "Plug1", state: 1, uid: "222222"},{name: "Plug2", state: 0, uid: "111111"}]
// let sockets = orvibo.getConnectedSocket();
let sockets = [{name: "Plug1", state: 1, uid: "222222", modelId: "f8b11bed724647e98bd07a66dca6d5b6"},{name: "Plug2", state: 0, uid: "111111", modelId: "123"}]
if (req.query.uid != undefined) {
orvibo.toggleSocket(req.query.uid);
}
sockets = orvibo.getConnectedSocket();
// sockets = orvibo.getConnectedSocket();
utils.setState(sockets)

View File

@ -36,6 +36,12 @@ body {
margin-bottom: 5px;
}
.socket-image {
width: 100%;
height: 300px;
}
.button-off {
background-color:#fc0000;
-moz-border-radius:28px;

BIN
server/images/b25.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 73 KiB

BIN
server/images/b25UK.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

View File

@ -8,6 +8,13 @@ block content
else
each socket in sockets
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
| #{socket.name}
h2.socket-name