aboutsummaryrefslogtreecommitdiffstats
path: root/templates/lib.html
blob: 33534da4ce9e57e30dd6bded8ff52729b630f28d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41

{% macro ifstatus(ifstatus) -%}
<table class="table table-condensed">
 <tr>
  <th>Interface Name
  <td><code>{{ ifstatus.ifname }}</code>
 <tr>
  <th>Status
  <td><span style="font-weight: bold; color:
      {% if ifstatus.state == 'UP' %}green{% else %}red{% endif %};">
      {{ ifstatus.state }}
      </span>
 <tr>
  <th>MAC Address
  <td><code>{{ ifstatus.mac }}</code>
 <tr>
  <th>IPv4 Addresses
  <td><code>
  {% for addr in ifstatus.ipv4addrs %}
    {{ addr.addr }}/{{ addr.prefix}} ({{ addr.scope }})<br>
  {% endfor %}</code>
 <tr>
  <th>IPv6 Addresses
  <td><code>
  {% for addr in ifstatus.ipv6addrs %}
    {{ addr.addr }}/{{ addr.prefix}} ({{ addr.scope }})<br>
  {% endfor %}</code>
</table>
{%- endmacro %}

{% macro logbox(name, contents) -%}
<h3>{{name}}</h3>
{% if contents == None %}
<span class="text-error">Access to {{name}} was denied, or file did not exist.</span>
{% else %}

<pre style="height: 18em; width 40em; overflow: auto;">
{{ contents }}
</pre>
{% endif%}
{%- endmacro %}