Juice/templates/index.html

60 lines
3.0 KiB
HTML

<!DOCTYPE html>
<html>
<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>
</head>
<body>
<header>
<nav>
<span onclick="new_device()" title="Add new device"><span class="font-awesome">&#xe802;</span></span>
<span title="Register a new authenticator">Register</span>
</nav>
</header>
<main>
<div id="devices">
{% for device in network %}
<div class="device {{ device.type }}" id="{{ device.id }}">
<div class="id">{{ device.id }}</div>
<div class="description"><span class="field_value">{{ device.description }}</span> <span class="edit font-awesome" onclick="edit_field(this.parentElement)">&#xe800;</span></div>
<div class="location"><span class="field_value">{{ device.location }}</span> <span class="edit font-awesome" onclick="edit_field(this.parentElement)">&#xe800;</span></div>
<div class="ip_address"><span class="field_value"><i>{{ device.ip_address }}</i></span> <span class="edit font-awesome" onclick="edit_field(this.parentElement)">&#xe800;</span></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="id">{{ sub_dev.id }}</div>
<object class="outlet_image" data="/static/outlet.svg"></object>
<div class="description"><span class="field_value">{{ sub_dev.description }}</span> <span class="edit font-awesome" onclick="edit_field(this.parentElement)">&#xe800;</span></div>
</div>
{% endfor %}
</div>
</div>
{% endfor %}
</div>
</main>
<template id="RelayDevice_template">
<div class="device RelayDevice" id="">
<div class="id"></div>
<div class="description"><span class="field_value"></span> <span class="edit font-awesome" onclick="edit_field(this.parentElement)">&#xe800;</span></div>
<div class="location"><span class="field_value"></span> <span class="edit font-awesome" onclick="edit_field(this.parentElement)">&#xe800;</span></div>
<div class="ip_address"><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" id="OUT0">
<div class="id">OUT0</div>
<object class="outlet_image" data="/static/outlet.svg"></object>
<div class="description"><span class="field_value"></span> <span class="edit font-awesome" onclick="edit_field(this.parentElement)">&#xe800;</span></div>
</div>
<div class="sub_device RelayOutlet" id="OUT2">
<div class="id">OUT2</div>
<object class="outlet_image" data="/static/outlet.svg"></object>
<div class="description"><span class="field_value"></span> <span class="edit font-awesome" onclick="edit_field(this.parentElement)">&#xe800;</span></div>
</div>
</div>
</div>
</template>
</body>
</html>