diff options
| author | jwansek <eddie.atten.ea29@gmail.com> | 2023-10-15 21:07:46 +0100 | 
|---|---|---|
| committer | jwansek <eddie.atten.ea29@gmail.com> | 2023-10-15 21:07:46 +0100 | 
| commit | 247a962c39e4ade2d9fb0b280d400d82fd8db56d (patch) | |
| tree | 9b9c771a7e7e29fdf44165f0a24b493c60f7b732 /templates | |
| parent | bbeeebb51fc9eb84cb976cb49ab2935f332f94ed (diff) | |
| download | power.eda.gay-247a962c39e4ade2d9fb0b280d400d82fd8db56d.tar.gz power.eda.gay-247a962c39e4ade2d9fb0b280d400d82fd8db56d.zip | |
Added plug usage table to web UI, with HTTP requests
Diffstat (limited to 'templates')
| -rw-r--r-- | templates/index.html.j2 | 29 | 
1 files changed, 29 insertions, 0 deletions
| diff --git a/templates/index.html.j2 b/templates/index.html.j2 index 534b1ce..69fcd31 100644 --- a/templates/index.html.j2 +++ b/templates/index.html.j2 @@ -52,8 +52,37 @@                  </li>              </ul>          </div> + +        <table id="power_table"> +            <tr id="header_row"> +                <td>Plug local hostname</td> +                <td>Plug description</td> +                <td>Current power usage (W)</td> +                <td>Power usage yesterday (kWh)</td> +            </tr> +            {% for host, description_md in tasmota_devices %} +                <tr id="tr_{{ host }}"> +                    <td><a href="http://{{ host }}" target="_blank">{{ host }}</a></td> +                    <td>{{ description_md|safe }}</td> +                    <td id="{{ host }}_watts_now"></td> +                    <td id="{{ host }}_watts_yesterday"></td> +                </tr> +            {% endfor %} +            <tr id="sum_row"> +                <td></td> +                <td></td> +                <td id="sum_watts_now"></td> +                <td id="sum_watts_yesterday"></td> +            </tr> +        </table>      </div> +    <ul id="last_updated_ul"> +        <li id="watts_last_updated">Current power usage never updated</li> +        <li id="kwh_last_updated">Yesterday's power usage never updated</li> +        <li id="switch_last_updated">Switch power usage never updated</li> +    </ul> +      <footer>          <p><a href="https://github.com/jwansek/power.eda.gay">Source code released under GPLv3</a></p>          <p><a href="https://www.fsf.org/campaigns/freejs">Read the Free Software Foundations statements about JavaScript</a></p> | 
