diff --git a/config.py b/config.py index 0260fda..cddbcde 100644 --- a/config.py +++ b/config.py @@ -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 diff --git a/templates/static/layout-map.html.j2 b/templates/static/layout-map.html.j2 index f91cb9a..50b1e49 100644 --- a/templates/static/layout-map.html.j2 +++ b/templates/static/layout-map.html.j2 @@ -124,7 +124,12 @@
-
Powered by MeshInfo
+
+ Powered by MeshInfo + {% if config.server.version_info %} + ({{ config.server.version_info.ref_name }}) + {% endif %} +
GitHub Stars diff --git a/templates/static/layout.html.j2 b/templates/static/layout.html.j2 index 8840e98..fb64f9f 100644 --- a/templates/static/layout.html.j2 +++ b/templates/static/layout.html.j2 @@ -132,7 +132,12 @@
-
Powered by MeshInfo
+
+ Powered by MeshInfo + {% if config.server.version_info %} + ({{ config.server.version_info.ref_name }}) + {% endif %} +
GitHub Stars