Skip to content

Commit

Permalink
add lights update http page
Browse files Browse the repository at this point in the history
  • Loading branch information
mariusmotea authored Mar 6, 2019
1 parent 6163aff commit 6705690
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions BridgeEmulator/functions/html.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,3 +202,39 @@ def webformDeconz(bridge_config):
</body>
</html>"""
return content


def lightsHttp():
return """<!DOCTYPE html>
<html style="height: 100%">
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="https://diyhue.org/cdn/bootstrap.min.css">
<script src="https://diyhue.org/cdn/jquery-3.3.1.min.js"></script>
</head>
<body>
<table class="table">
<thead>
<tr>
<th scope="col">#</th>
<th scope="col">Name</th>
<th scope="col">Current Version</th>
<th scope="col">Last Vesion</th>
<th scope="col"></th>
</tr>
</thead>
<tbody>
</tbody>
</table>
<script>
jQuery.getJSON("/lights.json", function(data) {
for (var key in data) {
$('.table').append('<tr><th scope="row">#' + key +'</th><td>' + data[key]["name"] +'</td><td>' + data[key]["currentVersion"] +'</td><td>' + data[key]["lastVersion"] +'</td><td>' + ((data[key]["currentVersion"] < data[key]["lastVersion"]) ? '<a href="/lights?light=' + key + '&filename=' + data[key]["firmware"] +'">update</a>' : 'up to date') + '</td></tr>');
var value = data[key];
}
});
</script>
</body>
</html>"""

0 comments on commit 6705690

Please sign in to comment.