aboutsummaryrefslogtreecommitdiffstats
path: root/templates/lib.html
diff options
context:
space:
mode:
Diffstat (limited to 'templates/lib.html')
-rw-r--r--templates/lib.html65
1 files changed, 54 insertions, 11 deletions
diff --git a/templates/lib.html b/templates/lib.html
index 33534da..6ac5e12 100644
--- a/templates/lib.html
+++ b/templates/lib.html
@@ -1,41 +1,84 @@
+
{% macro ifstatus(ifstatus) -%}
-<table class="table table-condensed">
+{% if not ifstatus %}
+<span class="text-error">
+Network hardware not detected at all!
+</span>
+{% else %}
+<table class="table table-condensed {% if ifstatus.state in ["DOWN", "DISCONNECTED"] %}muted{% endif %}">
<tr>
<th>Interface Name
- <td><code>{{ ifstatus.ifname }}</code>
+ <td><span style="font-family:monospace;">{{ ifstatus.ifname }}</span>
<tr>
<th>Status
- <td><span style="font-weight: bold; color:
- {% if ifstatus.state == 'UP' %}green{% else %}red{% endif %};">
+ <td><span style="font-weight: bold;" class="label
+ {% if ifstatus.state == 'RUNNING' %}label-success{% elif ifstatus.state == 'up' %}label-info{% else %}label-important{% endif %}">
{{ ifstatus.state }}
</span>
<tr>
<th>MAC Address
- <td><code>{{ ifstatus.mac }}</code>
+ <td><span style="font-family:monospace;">{{ ifstatus.mac }}</span>
<tr>
<th>IPv4 Addresses
- <td><code>
+ <td><span style="font-family:monospace;">
{% for addr in ifstatus.ipv4addrs %}
{{ addr.addr }}/{{ addr.prefix}} ({{ addr.scope }})<br>
- {% endfor %}</code>
+ {% endfor %}</span>
<tr>
<th>IPv6 Addresses
- <td><code>
+ <td><span style="font-family:monospace;">
{% for addr in ifstatus.ipv6addrs %}
{{ addr.addr }}/{{ addr.prefix}} ({{ addr.scope }})<br>
- {% endfor %}</code>
+ {% endfor %}</span>
+ {% if ifstatus.radio_state %}
+ <tr>
+ <th>Radio State
+ <td><span style="font-family:monospace;">{{ ifstatus.radio_state }}</span>
+ <tr>
+ <th>SSID
+ <td><span style="font-family:monospace;">{{ ifstatus.ssid }}</span>
+ <tr>
+ <th>Frequency
+ <td><span style="font-family:monospace;">{{ ifstatus.freq }}</span>
+ <tr>
+ <th>Signal Strength
+ <td><span style="font-family:monospace;">{{ ifstatus.signal_dbm }}</span>
+ {% endif %}
</table>
+{% endif %}
{%- 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;">
+<div style="height: 18em; width: 60em;">
+<pre style="height: 18em; width 60em; overflow: auto;">
{{ contents }}
</pre>
+</div>
{% endif%}
{%- endmacro %}
+
+
+{% macro forminput(form, formerr, name, title, placeholder) -%}
+<div class="control-group {% if formerr[name] %}error{% endif %}">
+ <label class="control-label" for="{{name}}">{{ title }}</label>
+ <div class="controls">
+ <input type="text" name="{{name}}" placeholder="{{placeholder}}" {% if form[name] %}value="{{ form[name] }}"{% endif %}>
+ {% if formerr[name] %}
+ <span class="help-inline">{{ formerr[name] }}</span>
+ {% endif %}
+ </div>
+</div>
+{%- endmacro %}
+
+{% macro formcheckbox(form, formerr, name, title, value) -%}
+ <label class="checkbox">
+ <input type="checkbox" name="{{name}}" id="{{name}}" value="{{value}}" {% if form[name] == value %}checked{% endif %}>
+ <h4>{{title}}</h4>
+ </label>
+{% endmacro %}