From a304d7a56563b16ca98d9b45ebed521c52f6347c Mon Sep 17 00:00:00 2001 From: ficus Date: Fri, 14 Sep 2012 20:10:43 +0200 Subject: backup WIP --- templates/base.html | 77 ++++++++++++++++++++++++++++++++++++++++++++++++ templates/home.html | 39 ++++++++++++++++++++++++ templates/lib.html | 41 ++++++++++++++++++++++++++ templates/logs.html | 9 ++++++ templates/processes.html | 28 ++++++++++++++++++ templates/reboot.html | 22 ++++++++++++++ templates/wan.html | 0 7 files changed, 216 insertions(+) create mode 100644 templates/base.html create mode 100644 templates/home.html create mode 100644 templates/lib.html create mode 100644 templates/logs.html create mode 100644 templates/processes.html create mode 100644 templates/reboot.html create mode 100644 templates/wan.html (limited to 'templates') diff --git a/templates/base.html b/templates/base.html new file mode 100644 index 0000000..a2c1407 --- /dev/null +++ b/templates/base.html @@ -0,0 +1,77 @@ + + + + torouter configuration interface + + + + + + + +
+
+
+ +
+
+ {% with messages = get_flashed_messages(with_categories=true) %} + {% if messages %} + {% for category, message in messages %} +
+ + {% if category == "warning" %}Warning:{% endif %} + {% if category == "error" %}Error:{% endif %} + {% if category == "info" %}Note:{% endif %} + {{ message }} +
+ {% endfor %} + {% endif %} + {% endwith %} +{% block body %}{% endblock %} +
+
+
+
+

© torouter, copyleft 2012

+
+
+ + + diff --git a/templates/home.html b/templates/home.html new file mode 100644 index 0000000..30c328e --- /dev/null +++ b/templates/home.html @@ -0,0 +1,39 @@ +{% import "lib.html" as lib %} +{% extends "base.html" %} +{% block body %} +

System

+ + + + + +
Host Name + {{ status.system.hostname }} +
Current Time + {{ status.system.current_time }} +
System Uptime + {{ status.system.uptime }} +
+ +

WAN

+{% if not status.wan %} +Upstream ethernet interface hardware not detected at all! +{% else %} +{{ lib.ifstatus(status.wan) }} +{% endif %} + +

LAN

+{% if not status.lan %} +Local network ethernet interface hardware not detected at all! +{% else %} +{{ lib.ifstatus(status.lan) }} +{% endif %} + +

Wireless

+{% if not status.wireless %} +Wireless interface hardware not detected at all! +{% else %} +{{ lib.ifstatus(status.wireless) }} +{% endif %} + +{% endblock %} 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) -%} + + + + + + +
Interface Name + {{ ifstatus.ifname }} +
Status + + {{ ifstatus.state }} + +
MAC Address + {{ ifstatus.mac }} +
IPv4 Addresses + + {% for addr in ifstatus.ipv4addrs %} + {{ addr.addr }}/{{ addr.prefix}} ({{ addr.scope }})
+ {% endfor %}
+
IPv6 Addresses + + {% for addr in ifstatus.ipv6addrs %} + {{ addr.addr }}/{{ addr.prefix}} ({{ addr.scope }})
+ {% endfor %}
+
+{%- endmacro %} + +{% macro logbox(name, contents) -%} +

{{name}}

+{% if contents == None %} +Access to {{name}} was denied, or file did not exist. +{% else %} + +
+{{ contents }}
+
+{% endif%} +{%- endmacro %} diff --git a/templates/logs.html b/templates/logs.html new file mode 100644 index 0000000..c5ea52a --- /dev/null +++ b/templates/logs.html @@ -0,0 +1,9 @@ +{% import "lib.html" as lib %} +{% extends "base.html" %} +{% block body %} + +{{ lib.logbox("dmesg", logs.dmesg) }} +{{ lib.logbox("auth.log", logs.authlog) }} +{{ lib.logbox("syslog", logs.syslog) }} + +{% endblock %} diff --git a/templates/processes.html b/templates/processes.html new file mode 100644 index 0000000..c911b0a --- /dev/null +++ b/templates/processes.html @@ -0,0 +1,28 @@ +{% import "lib.html" as lib %} +{% extends "base.html" %} +{% block body %} +

System Running Process List

+ + + +
User + PID + %CPU + %MEM + Status Code + Started + Time + Command +{% for proc in process_list %} +
{{ proc.user }} + {{ proc.pid}} + {{ proc.perc_cpu }} + {{ proc.perc_mem }} + {{ proc.status_code }} + {{ proc.started }} + {{ proc.time }} + {{ proc.command }} +{% endfor %} +
+ +{% endblock %} diff --git a/templates/reboot.html b/templates/reboot.html new file mode 100644 index 0000000..b9f0c54 --- /dev/null +++ b/templates/reboot.html @@ -0,0 +1,22 @@ +{% extends "base.html" %} +{% block body %} +

System Reboot

+ +{% if status == 'rebooting' %} + +Rebooting! This interface will stop working in a few seconds, check back in a +minute or two... + +{% else %} +
+Are you sure you'd like to restart? This could have reprecussions! +
+ + +
+{% endif %} + +{% endblock %} diff --git a/templates/wan.html b/templates/wan.html new file mode 100644 index 0000000..e69de29 -- cgit v1.2.3