summaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
authoryves <steve.harrison@gmx.net>2013-05-21 23:48:56 +0200
committeryves <steve.harrison@gmx.net>2013-05-21 23:49:19 +0200
commitc83af31a999f4f29532db0dc22638a142a91171e (patch)
treefe3ab3752fd7b576064f1ce675d7a79cee5622a8 /templates
parent469b56ed8f9885b7bc7a18723b14f4690c8d5df4 (diff)
downloadwww-c83af31a999f4f29532db0dc22638a142a91171e.tar.gz
www-c83af31a999f4f29532db0dc22638a142a91171e.tar.bz2
www-c83af31a999f4f29532db0dc22638a142a91171e.zip
rewrite as static site generator
Diffstat (limited to 'templates')
-rw-r--r--templates/host.html149
-rw-r--r--templates/index.html52
2 files changed, 130 insertions, 71 deletions
diff --git a/templates/host.html b/templates/host.html
index 79559b2..feed11b 100644
--- a/templates/host.html
+++ b/templates/host.html
@@ -1,61 +1,90 @@
-<script id="hostinfo" type="text/html">
-<h1>{{name}}</h1>
-
-<ul class="nav nav-tabs">
- <li class="active"><a href="#info" data-toggle="tab">Info</a></li>
- <li><a href="#ports" data-toggle="tab">Ports</a></li>
- <li><a href="#interfaces" data-toggle="tab">Interfaces</a></li>
- <li class="pull-right"><a id="index" href="">back to index</a></li>
-</ul>
-
-<div class="tab-content">
- <div class="tab-pane active" id="info">
- <dl class="dl-horizontal">
- <dt>hostname</dt><dd>{{hostname}}</dd>
- <dt>os</dt><dd>{{os}}</dd>
- <dt>arch</dt><dd>{{arch}}</dd>
- <dt>vserver</dt><dd>{{vserver}}</dd>
- {{#vserver-host}}
- <dt>vserver-host</dt><dd>{{vserver-host}}</dd>
- {{/vserver-host}}
- </dl>
- </div>
-
- <div class="tab-pane row" id="interfaces">
- {{#interfaces}}
- <div class="span6">
- <h3>{{device}}</h3>
- <ul>
- {{#.}}
- <li>{{address}}/{{netmask}}</li>
- {{/.}}
- </ul>
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset=utf-8 />
+ <title>Hostinfo: Overview</title>
+
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <link rel="stylesheet" type="text/css" media="screen" href="css/bootstrap.min.css" />
+ <link rel="stylesheet" type="text/css" media="screen" href="css/bootstrap-responsive.min.css" />
+ <link rel="stylesheet" type="text/css" media="screen" href="css/custom.css" />
+
+ <script src="js/jquery-2.0.0.min.js"></script>
+ <script src="js/bootstrap.min.js"></script>
+
+ </head>
+
+ <body>
+ <div class="container">
+ <div class="row">
+
+ <div class="span12" id="content">
+
+ <h1>{{hostname}}</h1>
+
+ <ul class="nav nav-tabs">
+ <li class="active"><a href="#info" data-toggle="tab">Info</a></li>
+ <li><a href="#ports" data-toggle="tab">Ports</a></li>
+ <li><a href="#interfaces" data-toggle="tab">Interfaces</a></li>
+ <li class="pull-right"><a id="index" href="index.html">back to index</a></li>
+ </ul>
+
+ <div class="tab-content">
+ <div class="tab-pane active" id="info">
+ <dl class="dl-horizontal">
+ <dt>hostname</dt><dd>{{hostname}}</dd>
+ <dt>os</dt><dd>{{os}}</dd>
+ <dt>arch</dt><dd>{{arch}}</dd>
+ <dt>vserver</dt><dd>{{vserver}}</dd>
+ {% if vserver_host is defined %}
+ <dt>vserver_host</dt><dd>{{vserver_host}}</dd>
+ {% endif %}
+ </dl>
+ </div>
+
+ <div class="tab-pane row" id="interfaces">
+ {% for group in addresses | groupby('interface') %}
+ <div class="span6">
+ <h3>{{ group.grouper }}</h3>
+ <ul>
+ {% for address in group.list %}
+ <li>{{address['address']}} /{{address['netmask']}}</li>
+ {% else %}
+ <li>no address</li>
+ {% endfor %}
+ </ul>
+ </div>
+ {% else %}
+ <p class="centering">no network interfaces</p>
+ {% endfor %}
+ </div>
+
+ <div class="tab-pane" id="ports">
+ <table class="table table-stripped table-hover">
+ <thead>
+ <tr>
+ <th>Port</th><th>IP</th><th>Process</th><th>Protocol</th>
+ </tr>
+ </thead>
+ <tbody>
+ {% for port in ports %}
+ <tr>
+ <td>{{port['port']}}</td>
+ <td>{{port['ip']}}</td>
+ <td>{{port['process']}}</td>
+ <td>{{port['proto']}}</td>
+ </tr>
+ {% else%}
+ <tr><td class="centering" colspan="4">no ports open</td></tr>
+ {% endfor %}
+ </tbody>
+ </table>
+ </div>
+ </div>
+
+ </div>
</div>
- {{/interfaces}}
- {{^interfaces}}<p class="centering">no network interfaces</p>{{/interfaces}}
- </ul>
- </div>
-
- <div class="tab-pane" id="ports">
- <table class="table table-stripped table-hover">
- <thead>
- <tr>
- <th>Port</th><th>IP</th><th>Process</th><th>Protocol</th>
- </tr>
- </thead>
- <tbody>
- {{#ports}}
- <tr>
- <td>{{port}}</td>
- <td>{{ip}}</td>
- <td>{{process}}</td>
- <td>{{proto}}</td>
- </tr>
- {{/ports}}
- {{^ports}}<tr><td class="centering" colspan="4">no ports open</td></tr>{{/ports}}
- </tbody>
- </table>
- </div>
-</div>
-
-</script>
+ </div>
+
+ </body>
+</html>
diff --git a/templates/index.html b/templates/index.html
index 3873911..bace5c7 100644
--- a/templates/index.html
+++ b/templates/index.html
@@ -1,11 +1,41 @@
-<script id="hosts" type="text/html">
-<h1>Hostinfo</h1>
-
-<ul id="hosts" class="row">
-{{#hosts}}
- <li class="span2">
- <a data-uri="{{uri}}" class="thumbnail">{{name}}</a>
- </li>
-{{/hosts}}
-</ul>
-</script>
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset=utf-8 />
+ <title>Hostinfo: Overview</title>
+
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <link rel="stylesheet" type="text/css" media="screen" href="css/bootstrap.min.css" />
+ <link rel="stylesheet" type="text/css" media="screen" href="css/bootstrap-responsive.min.css" />
+ <link rel="stylesheet" type="text/css" media="screen" href="css/custom.css" />
+
+ <script src="js/jquery-2.0.0.min.js"></script>
+ <script src="js/bootstrap.min.js"></script>
+
+ </head>
+
+
+ <body>
+ <div class="container">
+ <div class="row">
+
+ <div class="span12" id="content">
+
+ <h1>Hostinfo</h1>
+
+ <ul id="hosts" class="row">
+ {% for host in hosts %}
+ <li class="span2">
+ <a href={{host['url']}} class="thumbnail">
+ {{host['hostname'] | replace(".spline.inf.fu-berlin.de","")}}
+ </a>
+ </li>
+
+
+ {% endfor %}
+ </ul>
+ </div>
+ </div>
+ </div>
+ </body>
+</html>