mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-23 08:56:17 -04:00
Show installed plugins and search new ones
This commit is contained in:
parent
dbdc53307e
commit
51cae02e9d
4 changed files with 167 additions and 2 deletions
34
src/node/hooks/express/adminplugins.js
Normal file
34
src/node/hooks/express/adminplugins.js
Normal file
|
@ -0,0 +1,34 @@
|
|||
var path = require('path');
|
||||
var eejs = require('ep_etherpad-lite/node/eejs');
|
||||
var installer = require('ep_etherpad-lite/static/js/pluginfw/installer');
|
||||
|
||||
exports.expressCreateServer = function (hook_name, args, cb) {
|
||||
args.app.get('/admin/plugins', function(req, res) {
|
||||
var plugins = require("ep_etherpad-lite/static/js/pluginfw/plugins");
|
||||
var render_args = {
|
||||
plugins: plugins.plugins,
|
||||
query: req.query,
|
||||
search_results: {},
|
||||
errors: [],
|
||||
};
|
||||
|
||||
var render = function () {
|
||||
res.send(eejs.require(
|
||||
"ep_etherpad-lite/templates/admin/plugins.html",
|
||||
render_args), {});
|
||||
};
|
||||
|
||||
if (req.query.search && req.query.search != "") {
|
||||
installer.search(req.query.search, function (er, data) {
|
||||
if (er) {
|
||||
render_args.errors.push(er);
|
||||
return render();
|
||||
}
|
||||
render_args.search_results = data;
|
||||
render();
|
||||
});
|
||||
} else {
|
||||
render();
|
||||
}
|
||||
});
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue