Also provide branch info to UI/on socket

This commit is contained in:
Gina Häußge 2015-08-26 15:25:16 +02:00
parent c7fd4809fd
commit cc8dcef8a1
4 changed files with 6 additions and 2 deletions

View file

@ -66,6 +66,7 @@ class PrinterStateConnection(sockjs.tornado.SockJSConnection, octoprint.printer.
apikey=octoprint.server.UI_API_KEY,
version=octoprint.server.VERSION,
display_version=octoprint.server.DISPLAY_VERSION,
branch=octoprint.server.BRANCH,
plugin_hash=plugin_hash.hexdigest(),
config_hash=config_hash
))

View file

@ -13,7 +13,7 @@ from flask import request, g, url_for, make_response, render_template, send_from
import octoprint.plugin
from octoprint.server import app, userManager, pluginManager, gettext, \
debug, LOCALES, VERSION, DISPLAY_VERSION, UI_API_KEY
debug, LOCALES, VERSION, DISPLAY_VERSION, UI_API_KEY, BRANCH
from octoprint.settings import settings
from . import util
@ -311,6 +311,7 @@ def index():
debug=debug,
version=VERSION,
display_version=DISPLAY_VERSION,
branch=BRANCH,
gcodeMobileThreshold=settings().get(["gcodeViewer", "mobileSizeThreshold"]),
gcodeThreshold=settings().get(["gcodeViewer", "sizeThreshold"]),
uiApiKey=UI_API_KEY,

View file

@ -113,6 +113,7 @@ function DataUpdater(allViewModels) {
var oldVersion = VERSION;
VERSION = data["version"];
DISPLAY_VERSION = data["display_version"];
BRANCH = data["branch"];
$("span.version").text(DISPLAY_VERSION);
var oldPluginHash = self._pluginHash;

View file

@ -22,11 +22,12 @@
var SOCKJS_URI = "{{ url_for('index') }}" + "sockjs";
var SOCKJS_DEBUG = CONFIG_DEBUG;
// sockjs should define CLOSE_NORMAL for us, but they don't (from ws spec)
var SOCKJS_CLOSE_NORMAL = 1000
var SOCKJS_CLOSE_NORMAL = 1000;
var UI_API_KEY = "{{ uiApiKey }}";
var VERSION = "{{ version }}";
var DISPLAY_VERSION = "{{ display_version }}";
var BRANCH = "{{ branch }}";
var LOCALE = "{{ g.locale }}";
var AVAILABLE_LOCALES = {{ locales|tojson }};