diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2022-08-09 05:02:13 +0200 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2022-08-09 05:02:13 +0200 |
commit | 7f9cd0eb580b22a2e4597c48aec65002c6f19840 (patch) | |
tree | a3432feec0164bdfa25e9b91c147302a5458ff3a /pyenc/templates | |
parent | Rename some database stuff. (diff) | |
download | puppet-classifier-7f9cd0eb580b22a2e4597c48aec65002c6f19840.tar.gz puppet-classifier-7f9cd0eb580b22a2e4597c48aec65002c6f19840.tar.xz |
Rewrite static frontend.
Diffstat (limited to 'pyenc/templates')
-rw-r--r-- | pyenc/templates/base.html | 17 | ||||
-rw-r--r-- | pyenc/templates/class.html | 42 | ||||
-rw-r--r-- | pyenc/templates/environment.html | 28 | ||||
-rw-r--r-- | pyenc/templates/file.html | 6 | ||||
-rw-r--r-- | pyenc/templates/host.html | 17 | ||||
-rw-r--r-- | pyenc/templates/index.html | 6 | ||||
-rw-r--r-- | pyenc/templates/list.html | 10 |
7 files changed, 124 insertions, 2 deletions
diff --git a/pyenc/templates/base.html b/pyenc/templates/base.html index 9256734..64e35d6 100644 --- a/pyenc/templates/base.html +++ b/pyenc/templates/base.html @@ -4,9 +4,10 @@ <meta charset="UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=edge"/> <meta name="viewport" content="width=device-width, intial-scale=1"/> + <link rel="icon" href="{{ url_for('static', filename='icon.svg') }}"/> <link href="{{ url_for('static', filename='css/style.css') }}" rel="stylesheet"/> - <script type="module" src="{{ url_for('static', filename='js/script.js') }}"></script> - <title>Puppet Node Classifier</title> + <!-- <script type="module" src="{{ url_for('static', filename='js/script.js') }}"></script> --> + <title>Puppet Classifier</title> </head> <body> <div id="flash"> @@ -20,6 +21,18 @@ {% endif %} {% endwith %} </div> + <nav> + <img src="{{ url_for('static', filename='icon.svg') }}"/> + <ul> + <li><a href="/host">Hosts</a> + <li><a href="/environment">Environments</a> + <li><a href="/class">Classes</a> + </ul> + <hr/> + <ul> + <li><a href="#">Source</a> + </ul> + </nav> <main> {% block content %} {% endblock %} diff --git a/pyenc/templates/class.html b/pyenc/templates/class.html new file mode 100644 index 0000000..bfae1b2 --- /dev/null +++ b/pyenc/templates/class.html @@ -0,0 +1,42 @@ +{% extends "base.html" %} +{% block content %} +<h1>Class ‘{{ title }}’</h1> +<a href="/environment/{{ env }}">{{ env }}</a> +<dl> + <dt>Environments</dt> + <dd> + <ul> + {% for env in cls.environments %} + <li><a href="/environment/{{env.name}}">{{ env.name }}</a></li> + {% endfor %} + </ul> + </dd> + <dt>Files</dt> + <dd> + <table> + <thead> + <th>Environment</th> + <th>Path</th> + <th>Checksum</th> + </thead> + <tbody> + {% for file in cls.files %} + <tr> + <td>{{ file.environment.name }}</td> + <td><a href="/file?environment={{ file.environment.name }}&path={{ file.path }}">{{ file.path }}</a></td> + <td><code>{{ file.checksum }}</code></td> + </tr> + {% endfor %} + </tbody> + </table> + <dt>Hosts</dt> + <dd> + <ul> + {% for host in cls.hosts %} + <li><a href="/host/{{ host.fqdn }}">{{ host.fqdn }}</a></li> + {% endfor %} + </ul> + </dd> +</dl> +{% endblock %} +{# ft:jinja #} diff --git a/pyenc/templates/environment.html b/pyenc/templates/environment.html new file mode 100644 index 0000000..b0995d6 --- /dev/null +++ b/pyenc/templates/environment.html @@ -0,0 +1,28 @@ +{% extends "base.html" %} +{% block content %} +<h1>Environment ‘{{ title }}’</h1> +<dl> + <dt>Hosts</dt> + <dd> + <ul> + {% for host in env.hosts %} + <li><a href="/host/{{ host.fqdn }}">{{ host.fqdn }}</a></li> + {% endfor %} + </ul> + </dd> + <dt>Classes</dt> + <dd> + <ul> + {% for cls in env.classes %} + <li><a href="/class/{{ cls.name }}">{{ cls.name }}</a></li> + {% endfor %} + </ul> + </dd> + <dt>Files</dt> + <dd> + <ul> + </ul> + </dd> +</dl> +{% endblock %} +{# ft:jinja #} diff --git a/pyenc/templates/file.html b/pyenc/templates/file.html new file mode 100644 index 0000000..19bc811 --- /dev/null +++ b/pyenc/templates/file.html @@ -0,0 +1,6 @@ +{% extends "base.html" %} +{% block content %} +<h1>File ‘{{ title }}’</h1> +<pre>{{ content }}</pre> +{% endblock %} +{# ft:jinja #} diff --git a/pyenc/templates/host.html b/pyenc/templates/host.html new file mode 100644 index 0000000..a44eb82 --- /dev/null +++ b/pyenc/templates/host.html @@ -0,0 +1,17 @@ +{% extends "base.html" %} +{% block content %} +<h1>Host ‘{{ title }}’</h1> +<dl> + <dt>Environment</dt> + <dd><a href="/environment/{{ env }}">{{ env }}</a></dd> + <dt>Direct Classes</dt> + <dd> + <ul> + {% for cls in classes %} + <li>{{ cls|safe }}</li> + {% endfor %} + </ul> + </dd> +</dl> +{% endblock %} +{# ft:jinja #} diff --git a/pyenc/templates/index.html b/pyenc/templates/index.html new file mode 100644 index 0000000..c10449b --- /dev/null +++ b/pyenc/templates/index.html @@ -0,0 +1,6 @@ +{% extends "base.html" %} +{% block content %} +<h1>Puppet Classifier</h1> +<p>Something might show up here if you click the sidebar...</p> +{% endblock %} +{# ft:jinja #} diff --git a/pyenc/templates/list.html b/pyenc/templates/list.html new file mode 100644 index 0000000..dd267c5 --- /dev/null +++ b/pyenc/templates/list.html @@ -0,0 +1,10 @@ +{% extends "base.html" %} +{% block content %} +<h1>{{ title }}</h1> +<ul> + {% for item in items %} + <li>{{ item|safe }}</li> + {% endfor %} +</ul> +{% endblock %} +{# ft:jinja #} |