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.
This commit is contained in:
Eli Ribble 2023-05-26 09:52:01 -07:00
parent 0fee05acf7
commit 82c741033d
2 changed files with 14 additions and 2 deletions

View file

@ -1,5 +1,14 @@
<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">: