Juice/templates/index.html

66 lines
3.1 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<title>Juice</title>
<link rel="stylesheet" type="text/css" href="/static/juice.css">
<script>
const init_state = {{ init_state|tojson|safe }};
const ws_uri = "{{ url('ws') }}";
</script>
<script type="text/javascript" src="/static/juice.js"></script>
<script>window.onload = load;</script>
<meta name="viewport" content="width=device-width, initial-scale=0.8">
<meta name="description" content="An IOT hub.">
<meta name="theme-color" content="lightblue">
<link rel="manifest" href="/static/juice-manifest.webmanifest">
<link rel="icon" href="/static/orange-juice.svg">
<link rel="icon" href="/static/orange-juice-144p.png">
</head>
<body>
<header>
<div id="logo-line">
<object id="logo" aria-label="Juice: An IOT hub" data="/static/orange-juice.svg"></object>
<h1>Juice</h1>
<h3>An IOT hub</h3>
</div>
<nav>
<span class="font-awesome" title="Home"><a href="./">&#xe806;</a></span>
<span class="font-awesome" title="Add new device" onclick="new_device()">&#xe802;</span>
</nav>
</header>
<main>
<div id="devices">
{% for device in network %}
{% if device.type == 'RelayDevice' %}
{% include 'RelayDevice.html' %}
{% elif device.type == 'LightStrip' %}
{% include 'LightStrip.html' %}
{% elif device.type == 'LixieClock' %}
{% include 'LixieClock.html' %}
{% endif %}
{% 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)">&#xe800;</span><span class="delete font-awesome" onclick="delete_device(this.parentElement.parentElement)">&#xe804;</span><span class="lock font-awesome" onclick="lock_device(this.parentElement.parentElement)">&#xe803;</span></div>
<div class="description editable"><span class="field_value"></span><span class="edit font-awesome" onclick="edit_field(this.parentElement)">&#xe800;</span></div>
<div class="location editable"><span class="field_value"></span><span class="edit font-awesome" onclick="edit_field(this.parentElement)">&#xe800;</span></div>
<div class="ip_address editable"><span class="field_value"></span><span class="edit font-awesome" onclick="edit_field(this.parentElement)">&#xe800;</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)">&#xe800;</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)">&#xe800;</span></div>
</div>
</div>
</div>
</template>
</body>
</html>