unassigned-sensors.html 1.81 KB
Newer Older
1 2 3 4 5 6 7
{% extends "bmsapp/base.html" %}

{% block pagetitle %}Unassigned Sensors{% endblock %}

{% block title %}Sensors not Assigned to a Building{% endblock %}

{% block content %}
8

9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
<script>
    $(function () {
        $(".bmon-sensor-id")
            .attr("data-toggle","tooltip")
            .attr("data-original-title", "Click to copy Sensor ID to Clipboard")
            .css("cursor","pointer")
            .tooltip()
            .click(function(){
                var target = this;
                navigator.clipboard.writeText(target.innerText).then(function() {
                    $(target)
                        .attr("data-original-title", "Copied Sensor ID to Clipboard!")
                        .tooltip('show')
                });
            })
            .on('hidden.bs.tooltip', function () {
                $(this).attr("data-original-title", "Click to copy Sensor ID to Clipboard")
            })
            
    });
</script>

31 32 33 34 35 36 37
<p>This is a list of sensors that are either:</p>

<ul>
    <li>Not entered into the Admin Sensor list, or</li>
    <li>They are entered in the list of Sensors but they are not assigned to a building.</li>
</ul>

38 39 40 41 42 43 44 45
<table class="table table-sm table-striped table-responsive mt-1">
    <thead><tr>
        <th class="text-center">Sensor ID</th>
        <th class="text-center">Last Reading</th>
        <th class="text-center">When</th>
        <th class="text-center">Sensor Name, if available</th>
    </tr></thead>
    <tbody style="background-color: white">
46
    {% for sensor in sensor_list %}
47
        <tr>
48
            <td class="bmon-sensor-id">{{ sensor.id }}</td>
49
            <td class="text-right px-4">{{ sensor.cur_value }}</td>
50 51 52 53 54 55 56 57
            <td>{{ sensor.minutes_ago }} minutes ago</td>
            <td>{{ sensor.title }}</td>
        </tr>
    {% endfor %}
    </tbody>
</table>

{% endblock %}