lighthouse score
This commit is contained in:
parent
50d8e1863e
commit
e680c55fae
|
@ -54,7 +54,7 @@ nav span:hover {
|
|||
.ip_address {
|
||||
font-size: 0.8em;
|
||||
font-style: italic;
|
||||
color: darkgray;
|
||||
color: dimgray;
|
||||
margin: 0.2em;
|
||||
}
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@ function load() {
|
|||
Object.entries(init_state).forEach(([device_id, sub_devs]) => {
|
||||
let device = document.querySelector('#' + device_id);
|
||||
Object.entries(sub_devs).forEach(([sub_dev_id, state]) => {
|
||||
let sub_dev = device.querySelector('#' + sub_dev_id);
|
||||
let sub_dev = device.querySelector('.' + sub_dev_id);
|
||||
let svg = sub_dev.querySelector('object').getSVGDocument().firstElementChild;
|
||||
if (state) {
|
||||
svg.classList.remove('off');
|
||||
|
@ -26,7 +26,7 @@ function toggle_outlet(svg) {
|
|||
let sub_dev = get_object_from_svg(svg).parentElement;
|
||||
let params = {
|
||||
device_id: sub_dev.parentElement.parentElement.id,
|
||||
sub_dev_id: sub_dev.id
|
||||
sub_dev_id: sub_dev.querySelector('.id').innerText,
|
||||
};
|
||||
let query = Object.keys(params)
|
||||
.map(k => encodeURIComponent(k) + '=' + encodeURIComponent(params[k]))
|
||||
|
@ -37,7 +37,7 @@ function toggle_outlet(svg) {
|
|||
})
|
||||
.then(function(json) {
|
||||
if (!json.ok) { throw new Error('HTTP error, status = ' + json.status + ', message = ' + json.message); }
|
||||
if (json[sub_dev.id]) {
|
||||
if (json[sub_dev.querySelector('.id').innerText]) {
|
||||
svg.classList.remove('off');
|
||||
svg.classList.add('on');
|
||||
} else {
|
||||
|
|
|
@ -1,11 +1,13 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>Juice</title>
|
||||
<link rel="stylesheet" type="text/css" href="/static/juice.css">
|
||||
<script type="text/javascript" src="/static/juice.js"></script>
|
||||
<script>var init_state = {{ init_state|tojson|safe }};</script>
|
||||
<script>window.onload = load;</script>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta name="description" content="An IOT hub.">
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
|
@ -25,9 +27,9 @@
|
|||
<div class="ip_address editable"><span class="field_value">{{ device.ip_address }}</span>{% if not device.locked %}<span class="edit font-awesome" onclick="edit_field(this.parentElement)"></span>{% endif %}</div>
|
||||
<div class="sub_devices">
|
||||
{% for sub_dev in device.sub_devices %}
|
||||
<div class="sub_device {{ sub_dev.type }}" id="{{ sub_dev.id }}">
|
||||
<div class="sub_device {{ sub_dev.type }} {{ sub_dev.id }}">
|
||||
<div class="id">{{ sub_dev.id }}</div>
|
||||
<object class="outlet_image" data="/static/outlet.svg"></object>
|
||||
<object class="outlet_image" aria-label="Outlet Image" data="/static/outlet.svg"></object>
|
||||
<div class="description editable"><span class="field_value">{{ sub_dev.description }}</span>{% if not device.locked %}<span class="edit font-awesome" onclick="edit_field(this.parentElement)"></span>{% endif %}</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
|
@ -43,14 +45,14 @@
|
|||
<div class="location editable"><span class="field_value"></span><span class="edit font-awesome" onclick="edit_field(this.parentElement)"></span></div>
|
||||
<div class="ip_address editable"><span class="field_value"></span><span class="edit font-awesome" onclick="edit_field(this.parentElement)"></span></div>
|
||||
<div class="sub_devices">
|
||||
<div class="sub_device RelayOutlet" id="OUT0">
|
||||
<div class="sub_device RelayOutlet OUT0">
|
||||
<div class="id">OUT0</div>
|
||||
<object class="outlet_image" data="/static/outlet.svg"></object>
|
||||
<object class="outlet_image" alt="Outlet Image" data="/static/outlet.svg"></object>
|
||||
<div class="description editable"><span class="field_value"></span><span class="edit font-awesome" onclick="edit_field(this.parentElement)"></span></div>
|
||||
</div>
|
||||
<div class="sub_device RelayOutlet" id="OUT2">
|
||||
<div class="sub_device RelayOutlet OUT2">
|
||||
<div class="id">OUT2</div>
|
||||
<object class="outlet_image" data="/static/outlet.svg"></object>
|
||||
<object class="outlet_image" alt="Outlet Image" data="/static/outlet.svg"></object>
|
||||
<div class="description editable"><span class="field_value"></span><span class="edit font-awesome" onclick="edit_field(this.parentElement)"></span></div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -1,11 +1,13 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>Juice - Login</title>
|
||||
<link rel="stylesheet" type="text/css" href="/static/juice.css">
|
||||
<script type="text/javascript" src="/static/cbor.js"></script>
|
||||
<script type="text/javascript" src="/static/juice-auth.js"></script>
|
||||
<script>url_prefix = '{{ url_prefix }}';</script>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta name="description" content="An IOT hub.">
|
||||
</head>
|
||||
<body>
|
||||
<main>
|
||||
|
|
|
@ -1,10 +1,12 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>Juice - Manage</title>
|
||||
<link rel="stylesheet" type="text/css" href="/static/juice.css">
|
||||
<script type="text/javascript" src="/static/juice.js"></script>
|
||||
<script>url_prefix = '{{ url_prefix }}';</script>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta name="description" content="An IOT hub.">
|
||||
</head>
|
||||
<body>
|
||||
<main>
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>Juice - Register</title>
|
||||
<link rel="stylesheet" type="text/css" href="/static/juice.css">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta name="description" content="An IOT hub.">
|
||||
</head>
|
||||
<body>
|
||||
<main>
|
||||
|
|
|
@ -1,11 +1,13 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>Juice - Register Security Key</title>
|
||||
<link rel="stylesheet" type="text/css" href="/static/juice.css">
|
||||
<script type="text/javascript" src="/static/cbor.js"></script>
|
||||
<script type="text/javascript" src="/static/juice-auth.js"></script>
|
||||
<script>url_prefix = '{{ url_prefix }}';</script>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta name="description" content="An IOT hub.">
|
||||
</head>
|
||||
<body>
|
||||
<main>
|
||||
|
|
Loading…
Reference in New Issue
Block a user