Skip to content

Commit

Permalink
add version info to the layout
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinelliott committed Jul 12, 2024
1 parent aff85c1 commit 28b27e5
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
8 changes: 8 additions & 0 deletions config.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@ def load(cls):
random_uuid = str(uuid.uuid4())
config['broker']['client_id'] = config['broker']['client_id_prefix'] + '-' + random_uuid
config['server']['start_time'] = datetime.datetime.now(datetime.timezone.utc).astimezone()

try:
version_info = cls.load_from_file('version-info.json')
if version_info is not None:
config['server']['version_info'] = version_info
except FileNotFoundError:
pass

return config

@classmethod
Expand Down
7 changes: 6 additions & 1 deletion templates/static/layout-map.html.j2
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,12 @@

<div class="flex-grow"></div>
<div class="flex flex-col">
<h5 class="mb-2">Powered by MeshInfo</h5>
<h5 class="mb-2">
Powered by MeshInfo
{% if config.server.version_info %}
(<span class="text-xs text-gray-500">{{ config.server.version_info.ref_name }}</span>)
{% endif %}
</h5>
<a href="https://github.com/kevinelliott/meshinfo" class="text-xs text-gray-500">
<img src="https://img.shields.io/github/stars/kevinelliott/meshinfo?style=social" alt="GitHub Stars">
</a>
Expand Down
7 changes: 6 additions & 1 deletion templates/static/layout.html.j2
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,12 @@
<div class="flex-grow"></div>

<div class="flex flex-col">
<h5 class="mb-2">Powered by MeshInfo</h5>
<h5 class="mb-2">
Powered by MeshInfo
{% if config.server.version_info %}
(<span class="text-xs text-gray-500">{{ config.server.version_info.ref_name }}</span>)
{% endif %}
</h5>
<a href="https://github.com/kevinelliott/meshinfo" class="text-xs text-gray-500">
<img src="https://img.shields.io/github/stars/kevinelliott/meshinfo?style=social" alt="GitHub Stars">
</a>
Expand Down

0 comments on commit 28b27e5

Please sign in to comment.