changeset 15:f8d51aaac8bc

Display sessionID in about page as well as various versions
author Benoît Allard <benoit.allard@greenbone.net>
date Tue, 30 Sep 2014 14:45:03 +0200
parents a52995b50ecc
children eedf9606ab33
files farol/main.py farol/templates/about.j2
diffstat 2 files changed, 12 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/farol/main.py	Tue Sep 30 14:25:53 2014 +0200
+++ b/farol/main.py	Tue Sep 30 14:45:03 2014 +0200
@@ -26,16 +26,18 @@
 import logging
 from logging import FileHandler
 
+import farolluz
 from farolluz.cvrf import CVRF, ValidationError
 from farolluz.parsers.cvrf import parse
 from farolluz.py2 import urlopen
 from farolluz.renderer import render as render_cvrf
 from farolluz.utils import utcnow
 
+import flask
 from flask import Flask, request, render_template, redirect, url_for, flash
 from werkzeug import secure_filename
 
-from . import cache
+from . import __version__, cache
 from .document import document
 from .session import get_current, set_current, has_current, document_required
 from .vulnerability import vulnerability
@@ -131,5 +133,6 @@
 
 @app.route('/about')
 def about():
-    return render_template('about.j2', instance_dir=app.instance_path)
+    versions = (('farol', __version__), ('farolluz', farolluz.__version__), ('flask', flask.__version__))
+    return render_template('about.j2', instance_dir=app.instance_path, versions=versions)
 
--- a/farol/templates/about.j2	Tue Sep 30 14:25:53 2014 +0200
+++ b/farol/templates/about.j2	Tue Sep 30 14:45:03 2014 +0200
@@ -54,6 +54,13 @@
     <p>Each session have a <strong>private cache</strong>, sessions are bound to a browser <em>session</em>. They are usually reset when the browser is restarted.</p>
   {% endif %}
   <hr>
+  <h5>Versions:</h5>
+  <ul class="list-inline">
+  {% for product, version in versions %}
+    <li>{{ product }}: <tt><small>{{ version }}</small></tt></li>
+  {% endfor %}
+  </ul>
   <p><strong>Farol</strong> is published under GPLv2+, and is Copyright &copy; Greenbone Networks GmbH.</p>
+  <p class="text-muted text-right"><small>SessionID: {{ session.get('id', '') }}</small></p>
 </div>
 {% endblock %}

http://farol.wald.intevation.org