diff --git a/octoprint/events.py b/octoprint/events.py index 9769355..37db50c 100644 --- a/octoprint/events.py +++ b/octoprint/events.py @@ -185,7 +185,7 @@ class CommandTrigger(GenericEventListener): The following substitutions are currently supported: - - %(currentZ)s : current Z position of the print head + - %(currentZ)s : current Z position of the print head, or -1 if not available - %(filename)s : current selected filename, or "NO FILE" if no file is selected - %(progress)s : current print progress in percent, 0 if no print is in progress - %(data)s : the string representation of the event's payload diff --git a/octoprint/server.py b/octoprint/server.py index 3c8d38f..48ffbb4 100644 --- a/octoprint/server.py +++ b/octoprint/server.py @@ -130,6 +130,13 @@ class PrinterStateConnection(tornadio2.SocketConnection): @app.route("/") def index(): + branch = None + commit = None + try: + branch, commit = util.getGitInfo() + except: + pass + return render_template( "index.jinja2", ajaxBaseUrl=BASEURL, @@ -138,7 +145,9 @@ def index(): enableGCodeVisualizer=settings().get(["feature", "gCodeVisualizer"]), enableSystemMenu=settings().get(["system"]) is not None and settings().get(["system", "actions"]) is not None and len(settings().get(["system", "actions"])) > 0, enableAccessControl=userManager is not None, - enableSdSupport=settings().get(["feature", "sdSupport"]) + enableSdSupport=settings().get(["feature", "sdSupport"]), + gitBranch=branch, + gitCommit=commit ) #~~ Printer control diff --git a/octoprint/static/css/octoprint.less b/octoprint/static/css/octoprint.less index d2de9d8..37165c3 100644 --- a/octoprint/static/css/octoprint.less +++ b/octoprint/static/css/octoprint.less @@ -441,15 +441,22 @@ ul.dropdown-menu li a { /** Footer */ .footer { - text-align: right; + ul { + margin: 0; - ul li { - display: inline; - margin-left: 1em; - font-size: 85%; - a { - color: #555; + li { + &:first-child { + margin-left: 0; + } + + display: inline; + margin-left: 1em; + font-size: 85%; + a { + color: #555; + } } + } } diff --git a/octoprint/templates/index.jinja2 b/octoprint/templates/index.jinja2 index eef6c31..c0ea7be 100644 --- a/octoprint/templates/index.jinja2 +++ b/octoprint/templates/index.jinja2 @@ -568,7 +568,12 @@