63 lines
4.3 KiB
HTML
63 lines
4.3 KiB
HTML
<!DOCTYPE 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>
|
|
<h1>Juice</h1>
|
|
<nav>
|
|
<span title="Add new device" onclick="new_device()"><span class="font-awesome"></span></span>
|
|
<span title="Manage security keys and tokens"><a href="./manage">Manage</a></span>
|
|
</nav>
|
|
</header>
|
|
<main>
|
|
<div id="devices">
|
|
{% for device in network %}
|
|
<div class="device {{ device.type }}" id="{{ device.id }}">
|
|
<div class="id editable"><span class="field_value">{{ device.id }}</span>{% if not device.locked %}<span class="edit font-awesome" onclick="edit_field(this.parentElement)"></span><span class="delete font-awesome" onclick="delete_device(this.parentElement.parentElement)"></span><span class="lock font-awesome" onclick="lock_device(this.parentElement.parentElement)"></span>{% else %}<span class="unlock font-awesome" onclick="unlock_device(this.parentElement.parentElement)"></span>{% endif %}</div>
|
|
<div class="description editable"><span class="field_value">{{ device.description }}</span>{% if not device.locked %}<span class="edit font-awesome" onclick="edit_field(this.parentElement)"></span>{% endif %}</div>
|
|
<div class="location editable"><span class="field_value">{{ device.location }}</span>{% if not device.locked %}<span class="edit font-awesome" onclick="edit_field(this.parentElement)"></span>{% endif %}</div>
|
|
<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 }} {{ sub_dev.id }}">
|
|
<div class="id">{{ sub_dev.id }}</div>
|
|
<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 %}
|
|
</div>
|
|
</div>
|
|
{% endfor %}
|
|
</div>
|
|
</main>
|
|
<template id="RelayDevice_template">
|
|
<div class="device RelayDevice" id="">
|
|
<div class="id editable"><span class="field_value"></span><span class="edit font-awesome" onclick="edit_field(this.parentElement)"></span><span class="delete font-awesome" onclick="delete_device(this.parentElement.parentElement)"></span><span class="lock font-awesome" onclick="lock_device(this.parentElement.parentElement)"></span></div>
|
|
<div class="description editable"><span class="field_value"></span><span class="edit font-awesome" onclick="edit_field(this.parentElement)"></span></div>
|
|
<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 OUT0">
|
|
<div class="id">OUT0</div>
|
|
<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 OUT2">
|
|
<div class="id">OUT2</div>
|
|
<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>
|
|
</div>
|
|
</template>
|
|
</body>
|
|
</html>
|