1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

Add version number of sidebar footer

This commit is contained in:
Nick O'Leary 2016-01-07 16:42:10 +00:00
parent dbaacc411a
commit 0b4c652ce7
3 changed files with 12 additions and 6 deletions

View File

@ -16,9 +16,9 @@
RED.settings = (function () { RED.settings = (function () {
var loadedSettings = {}; var loadedSettings = {};
var hasLocalStorage = function () { var hasLocalStorage = function () {
try { try {
return 'localStorage' in window && window['localStorage'] !== null; return 'localStorage' in window && window['localStorage'] !== null;
@ -74,7 +74,7 @@ RED.settings = (function () {
RED.settings.set("auth-tokens",{access_token: accessToken}); RED.settings.set("auth-tokens",{access_token: accessToken});
window.location.search = ""; window.location.search = "";
} }
$.ajaxSetup({ $.ajaxSetup({
beforeSend: function(jqXHR,settings) { beforeSend: function(jqXHR,settings) {
// Only attach auth header for requests to relative paths // Only attach auth header for requests to relative paths
@ -89,7 +89,7 @@ RED.settings = (function () {
load(done); load(done);
} }
var load = function(done) { var load = function(done) {
$.ajax({ $.ajax({
headers: { headers: {
@ -104,6 +104,7 @@ RED.settings = (function () {
RED.settings.remove("auth-tokens"); RED.settings.remove("auth-tokens");
} }
console.log("Node-RED: " + data.version); console.log("Node-RED: " + data.version);
$('#node-red-version').text("v"+data.version);
done(); done();
}, },
error: function(jqXHR,textStatus,errorThrown) { error: function(jqXHR,textStatus,errorThrown) {
@ -141,7 +142,7 @@ RED.settings = (function () {
set: set, set: set,
get: get, get: get,
remove: remove, remove: remove,
theme: theme theme: theme
} }
}) })

View File

@ -111,3 +111,8 @@ pre code {
background-color: transparent; background-color: transparent;
border: 0; border: 0;
} }
#node-red-version {
font-size: 0.8em;
color: #ddd;
}

View File

@ -68,7 +68,7 @@
<div id="sidebar"> <div id="sidebar">
<ul id="sidebar-tabs"></ul> <ul id="sidebar-tabs"></ul>
<div id="sidebar-content"></div> <div id="sidebar-content"></div>
<div id="sidebar-footer"></div> <div id="sidebar-footer"><span id="node-red-version"></span></div>
</div> </div>
<div id="sidebar-separator"></div> <div id="sidebar-separator"></div>