mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Add version information to /settings
This commit is contained in:
parent
8b6c14b05d
commit
84a0e8ceff
@ -146,6 +146,7 @@ var RED = function() {
|
||||
function loadSettings() {
|
||||
$.get('settings', function(data) {
|
||||
RED.settings = data;
|
||||
console.log("Node-RED: "+data.version);
|
||||
loadNodes();
|
||||
});
|
||||
}
|
||||
|
18
red/red.js
18
red/red.js
@ -34,20 +34,20 @@ var RED = {
|
||||
|
||||
init: function(httpServer,userSettings) {
|
||||
settings = userSettings;
|
||||
|
||||
var p = require(path.join(process.env.NODE_RED_HOME,"package.json"));
|
||||
if (fs.existsSync(path.join(process.env.NODE_RED_HOME,".git"))) {
|
||||
settings.version = p.version+".git";
|
||||
} else {
|
||||
settings.version = p.version;
|
||||
}
|
||||
|
||||
|
||||
server.init(httpServer,settings);
|
||||
library.init();
|
||||
return server.app;
|
||||
},
|
||||
|
||||
version: function() {
|
||||
var p = require(path.join(process.env.NODE_RED_HOME,"package.json"));
|
||||
if (fs.existsSync(path.join(process.env.NODE_RED_HOME,".git"))) {
|
||||
return p.version+".git";
|
||||
} else {
|
||||
return p.version;
|
||||
}
|
||||
},
|
||||
|
||||
start: server.start,
|
||||
stop: server.stop,
|
||||
nodes: nodes,
|
||||
|
@ -67,7 +67,9 @@ function start() {
|
||||
|
||||
storage.init(settings).then(function() {
|
||||
console.log("\nWelcome to Node-RED\n===================\n");
|
||||
util.log("[red] Version: "+RED.version());
|
||||
if (settings.version) {
|
||||
util.log("[red] Version: "+settings.version);
|
||||
}
|
||||
util.log("[red] Loading palette nodes");
|
||||
redNodes.init(settings,storage);
|
||||
redNodes.load().then(function(nodeErrors) {
|
||||
|
Loading…
Reference in New Issue
Block a user