aboutsummaryrefslogtreecommitdiffstats
path: root/templates/lib.html
diff options
context:
space:
mode:
authorficus <ficus@robocracy.org>2012-09-14 20:10:43 +0200
committerficus <ficus@robocracy.org>2012-09-14 20:10:43 +0200
commita304d7a56563b16ca98d9b45ebed521c52f6347c (patch)
treeda88f01977c08d9a149c3e767f1a7e62981500b9 /templates/lib.html
downloadtui-a304d7a56563b16ca98d9b45ebed521c52f6347c.tar.gz
tui-a304d7a56563b16ca98d9b45ebed521c52f6347c.zip
backup WIP
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 %}