From ee70e9d54610771834cd783cf98b0a2b95bf2113 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Thu, 2 Apr 2020 18:03:53 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=B8=20Include=20Python=20version=20in?= =?UTF-8?q?=20footer?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit As suggested in https://community.octoprint.org/t/17819 --- src/octoprint/plugins/pi_support/static/js/pi_support.js | 8 +++----- src/octoprint/server/views.py | 3 +++ src/octoprint/templates/index.jinja2 | 1 + 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/octoprint/plugins/pi_support/static/js/pi_support.js b/src/octoprint/plugins/pi_support/static/js/pi_support.js index e6b0aaef1..4f3a8a13d 100644 --- a/src/octoprint/plugins/pi_support/static/js/pi_support.js +++ b/src/octoprint/plugins/pi_support/static/js/pi_support.js @@ -29,13 +29,11 @@ $(function() { self.fromThrottleState(response.throttle_state); // OctoPi version - $("#octopi_support_footer").remove(); + $("#pi_support_footer").remove(); if (!response.octopi_version) return; - var octoPrintVersion = $(".footer span.version"); - var octoPiVersion = $(" " + gettext("running on") + " " + gettext("OctoPi") - + " " + response.octopi_version + ""); - $(octoPiVersion).insertAfter(octoPrintVersion); + var octoPiVersion = $(""); + $("#footer_version").append(octoPiVersion); }) }; diff --git a/src/octoprint/server/views.py b/src/octoprint/server/views.py index 60aa35401..aed9eaa5e 100644 --- a/src/octoprint/server/views.py +++ b/src/octoprint/server/views.py @@ -23,6 +23,7 @@ from octoprint.access.permissions import Permissions from octoprint.settings import settings from octoprint.filemanager import full_extension_tree, get_all_extensions from octoprint.util import to_unicode, to_bytes, sv +from octoprint.util.version import get_python_version_string import re import base64 @@ -317,6 +318,7 @@ def index(): def hash_update(value): hash.update(to_bytes(value, encoding="utf-8", errors="replace")) hash_update(octoprint.__version__) + hash_update(get_python_version_string()) hash_update(",".join(sorted(files))) if lastmodified: hash_update(lastmodified) @@ -476,6 +478,7 @@ def _get_render_kwargs(templates, plugin_names, plugin_vars, now): debug=debug, firstRun=first_run, version=dict(number=VERSION, display=DISPLAY_VERSION, branch=BRANCH), + python_version=get_python_version_string(), templates=templates, pluginNames=plugin_names, locales=locales, diff --git a/src/octoprint/templates/index.jinja2 b/src/octoprint/templates/index.jinja2 index 41e216b70..ffb36d8b5 100644 --- a/src/octoprint/templates/index.jinja2 +++ b/src/octoprint/templates/index.jinja2 @@ -153,6 +153,7 @@