aboutsummaryrefslogtreecommitdiffstats
path: root/templates/lib.html
diff options
context:
space:
mode:
Diffstat (limited to 'templates/lib.html')
-rw-r--r--templates/lib.html41
1 files changed, 41 insertions, 0 deletions
diff --git a/templates/lib.html b/templates/lib.html
new file mode 100644
index 0000000..33534da
--- /dev/null
+++ b/templates/lib.html
@@ -0,0 +1,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 %}