pnpdevice/templates/relay-create.template.html
Eli Ribble 82c741033d Show existing relays on relay creation page.
This both shows the relays that we already have assigned and removes
existing pins from the list to choose from. It also alphabetizes for
easy reading by the human.
2023-05-26 09:52:01 -07:00

21 lines
596 B
HTML

<html>
<h1>Relay Creation</h1>
<h2>Existing relays</h2>
<table>
<thead><th>Relay</th><th>Pin</th></thead>
<tbody>
{% for relay in relays %}
<tr><td>{{ relay.name }}</td><td>{{ relay.pin.name }}</td></tr>
{% endfor %}
</table>
<form method="POST" action="/relay/create">
<input type="text" name="name" placeholder="Pool Pump 1"></input>
<select name="pin_id">:
{% for pin in pins %}
<option value="{{ pin.chip.number }}-{{ pin.chip.name }}-{{ pin.line_number }}">{{ pin.name }}</option>
{% endfor %}
</select>
<button type="submit">Create</button>
</form>
</html>