Add version number to plugins-info page

This commit is contained in:
Stefan 2015-04-10 23:52:17 +02:00
parent fc60ddded1
commit 8e4c961207
3 changed files with 10 additions and 4 deletions

View File

@ -4,6 +4,7 @@ var installer = require('ep_etherpad-lite/static/js/pluginfw/installer');
var plugins = require('ep_etherpad-lite/static/js/pluginfw/plugins');
var _ = require('underscore');
var semver = require('semver');
var epVersion = require('ep_etherpad-lite/package.json').version;
exports.expressCreateServer = function (hook_name, args, cb) {
args.app.get('/admin/plugins', function(req, res) {
@ -17,7 +18,12 @@ 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}) );
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)
{

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>