diff options
author | John McLear <john@mclear.co.uk> | 2015-04-10 23:48:52 +0100 |
---|---|---|
committer | John McLear <john@mclear.co.uk> | 2015-04-10 23:48:52 +0100 |
commit | 8f8303415d388b7ba5f2c0dee087bef51ad56b8b (patch) | |
tree | 6ce9df76bf6c4a38b8bbbe6bb1db029a71896008 | |
parent | fc60ddded18704242ece2a35ee5c2e3b7b49bf08 (diff) | |
parent | db5bdc87194cc8a790dd9d7cd656b72d42c5f285 (diff) | |
download | etherpad-lite-8f8303415d388b7ba5f2c0dee087bef51ad56b8b.zip |
Merge pull request #2589 from Gared/add_version_number
Add version number to plugins-info page
-rw-r--r-- | src/node/hooks/express.js | 2 | ||||
-rw-r--r-- | src/node/hooks/express/adminplugins.js | 8 | ||||
-rw-r--r-- | src/node/utils/Settings.js | 6 | ||||
-rw-r--r-- | src/templates/admin/plugins-info.html | 5 |
4 files changed, 17 insertions, 4 deletions
diff --git a/src/node/hooks/express.js b/src/node/hooks/express.js index 3275bd3f..bf849419 100644 --- a/src/node/hooks/express.js +++ b/src/node/hooks/express.js @@ -13,6 +13,8 @@ exports.createServer = function () { console.log("Report bugs at https://github.com/ether/etherpad-lite/issues") serverName = "Etherpad " + settings.getGitCommit() + " (http://etherpad.org)"; + + console.log("Your Etherpad version is " + settings.getEpVersion() + " (" + settings.getGitCommit() + ")"); exports.restartServer(); diff --git a/src/node/hooks/express/adminplugins.js b/src/node/hooks/express/adminplugins.js index 5015cc5a..1ae8d7b5 100644 --- a/src/node/hooks/express/adminplugins.js +++ b/src/node/hooks/express/adminplugins.js @@ -17,7 +17,13 @@ exports.expressCreateServer = function (hook_name, args, cb) { }); args.app.get('/admin/plugins/info', function(req, res) { var gitCommit = settings.getGitCommit(); - res.send( eejs.require("ep_etherpad-lite/templates/admin/plugins-info.html", {gitCommit:gitCommit}) ); + var epVersion = settings.getEpVersion(); + res.send( eejs.require("ep_etherpad-lite/templates/admin/plugins-info.html", + { + gitCommit: gitCommit, + epVersion: epVersion + }) + ); }); } diff --git a/src/node/utils/Settings.js b/src/node/utils/Settings.js index 536c088b..7e0e6c5a 100644 --- a/src/node/utils/Settings.js +++ b/src/node/utils/Settings.js @@ -199,7 +199,6 @@ exports.getGitCommit = function() { var refPath = rootPath + "/.git/" + ref.substring(5, ref.indexOf("\n")); version = fs.readFileSync(refPath, "utf-8"); version = version.substring(0, 7); - console.log("Your Etherpad git version is " + version); } catch(e) { @@ -208,6 +207,11 @@ exports.getGitCommit = function() { return version; } +// Return etherpad version from package.json +exports.getEpVersion = function() { + return require('ep_etherpad-lite/package.json').version; +} + exports.reloadSettings = function reloadSettings() { // Discover where the settings file lives var settingsFilename = argv.settings || "settings.json"; diff --git a/src/templates/admin/plugins-info.html b/src/templates/admin/plugins-info.html index 1b328a89..5d39c388 100644 --- a/src/templates/admin/plugins-info.html +++ b/src/templates/admin/plugins-info.html @@ -22,8 +22,9 @@ </div> <div class="innerwrapper"> - <h2>Etherpad Git Commit</h2> - <p><a href='https://github.com/ether/etherpad-lite/commit/<%= gitCommit %>'><%= gitCommit %></a></p> + <h2>Etherpad version</h2> + <p>Version number: <%= epVersion %></p> + <p>Git sha: <a href='https://github.com/ether/etherpad-lite/commit/<%= gitCommit %>'><%= gitCommit %></a></p> <h2>Installed plugins</h2> <pre><%- plugins.formatPlugins().replace(", ","\n") %></pre> |