Merge pull request #2589 from Gared/add_version_number

Add version number to plugins-info page
This commit is contained in:
John McLear 2015-04-10 23:48:52 +01:00
commit 8f8303415d
4 changed files with 17 additions and 4 deletions

View File

@ -14,6 +14,8 @@ exports.createServer = function () {
serverName = "Etherpad " + settings.getGitCommit() + " (http://etherpad.org)";
console.log("Your Etherpad version is " + settings.getEpVersion() + " (" + settings.getGitCommit() + ")");
exports.restartServer();
console.log("You can access your Etherpad instance at http://" + settings.ip + ":" + settings.port + "/");

View File

@ -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
})
);
});
}

View File

@ -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";

View File

@ -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>