forked from marcelklehr/ep_ether-o-meter
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
24 lines (20 loc) · 1.04 KB
/
index.js
File metadata and controls
24 lines (20 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
var eejs = require('ep_etherpad-lite/node/eejs')
, express = require('ep_etherpad-lite/node_modules/express')
exports.expressServer = function(hook, args, cb) {
args.app.get('/admin/metrics', function(req, res) {
var render_args = {
errors: []
};
res.send(eejs.require("ep_metrics_admin/templates/admin/metrics.html", render_args))
})
args.app.use('/admin/metrics/static', express.static(__dirname + '/static'))
}
exports.eejsBlock_adminMenu = function (hook_name, args, cb) {
var hasAdminUrlPrefix = (args.content.indexOf('<a href="admin/') != -1)
, hasOneDirDown = (args.content.indexOf('<a href="../') != -1)
, hasTwoDirDown = (args.content.indexOf('<a href="../../') != -1)
, urlPrefix = hasAdminUrlPrefix ? "admin/" : hasTwoDirDown ? "../../" : hasOneDirDown ? "../" : ""
;
args.content = args.content + '<li><a href="'+ urlPrefix +'metrics">Metrics informations</a> </li>';
return cb();
};