=== modified file 'lava_server/context_processors.py'
@@ -16,6 +16,7 @@
# You should have received a copy of the GNU Affero General Public License
# along with LAVA Server. If not, see <http://www.gnu.org/licenses/>.
+import os
import versiontools
import lava_server
@@ -39,10 +40,20 @@
]),
Menu("Documentation", "http://lava.rtfd.org/"),
])
+
+ try:
+ instance_name = os.environ["LAVA_INSTANCE"]
+ except KeyError:
+ try:
+ instance_name = os.path.basename(os.environ["VIRTUAL_ENV"])
+ except KeyError:
+ instance_name = None
+
return {
'lava': {
'menu_list': menu_list,
'extension_list': loader.extensions,
+ 'instance_name': instance_name,
'version': versiontools.format_version(
lava_server.__version__, hint=lava_server)}}
=== modified file 'lava_server/htdocs/css/default.css'
@@ -219,6 +219,14 @@
vertical-align: middle;
}
+/* Instance name indicator */
+
+#lava-instance-name-indicator {
+ text-align: center;
+ padding-right: 20px;
+ vertical-align: middle;
+}
+
/* Logo */
#lava-logo {
=== modified file 'lava_server/templates/layouts/content.html'
@@ -58,6 +58,13 @@
</script>
<!-- !ajax indicator -->
+
+ <!-- instance name indicator -->
+ {% if lava.instance_name %}
+ <div class="lava-indicator lava-panel-element" id="lava-instance-name-indicator">Instance: {{ lava.instance_name }}</div>
+ {% endif %}
+ <!-- !instance name indicator -->
+
<!-- user indicator -->
<div class="lava-indicator lava-panel-element {% if user.is_authenticated %}has-menu{% endif %}" id="lava-user-indicator">
<div class="lava-panel-menu-text">