Merge remote-tracking branch 'manage/master' into subtree
this merges master branch of https://github.com/helma-org/apps-manage-mirror into helma
This commit is contained in:
commit
ca2b08a5df
58 changed files with 2678 additions and 0 deletions
67
apps/manage/Application/actions.js
Normal file
67
apps/manage/Application/actions.js
Normal file
|
@ -0,0 +1,67 @@
|
|||
/**
|
||||
* renders AppManager
|
||||
*/
|
||||
function main_action() {
|
||||
if (checkAddress() == false)
|
||||
return;
|
||||
if (checkAuth(this) == false)
|
||||
return;
|
||||
|
||||
res.data.body = this.renderSkinAsString("main");
|
||||
renderSkin("global");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* prints session- and thread-stats for mrtg-tool
|
||||
* doesn't check username or password, so that we don't have
|
||||
* to write them cleartext in a mrtg-configfile but checks the
|
||||
* remote address.
|
||||
*/
|
||||
function mrtg_action() {
|
||||
if (checkAddress() == false)
|
||||
return;
|
||||
|
||||
if (this.isActive() == false) {
|
||||
res.write("0\n0\n0\n0\n");
|
||||
return;
|
||||
}
|
||||
|
||||
if (req.data.action == "sessions") {
|
||||
|
||||
res.write(this.sessions.size());
|
||||
res.write("\n0\n0\n0\n");
|
||||
|
||||
} else if (req.data.action == "threads") {
|
||||
|
||||
res.write(this.countActiveEvaluators() + "\n");
|
||||
res.write(this.countEvaluators() + "\n");
|
||||
res.write("0\n0\n");
|
||||
|
||||
} else if (req.data.action == "cache") {
|
||||
|
||||
res.write(this.getCacheUsage() + "\n");
|
||||
res.write(this.getProperty("cachesize", "1000") + "\n");
|
||||
res.write("0\n0\n");
|
||||
|
||||
} else if (req.data.action == "requests") {
|
||||
|
||||
// res.write (
|
||||
|
||||
} else {
|
||||
res.write("0\n0\n0\n0\n");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* performs a redirect to the public site
|
||||
* (workaround, we can't access application object from docapplication for some reason)
|
||||
* @see application.url_macro
|
||||
*/
|
||||
function redirectpublic_action() {
|
||||
if (checkAddress() == false) return;
|
||||
if (checkAuth(this) == false) return;
|
||||
|
||||
res.redirect(this.url_macro());
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue