46 lines
1.1 KiB
Text
46 lines
1.1 KiB
Text
|
|
/**
|
|
* main action, show server-stats
|
|
* perform start, stop, restart and flush-action
|
|
*
|
|
*/
|
|
|
|
|
|
if ( checkAddress()==false ) return;
|
|
|
|
if ( req.data.app!=null && req.data.app!="" && req.data.action!=null && req.data.action!="" ) {
|
|
|
|
var appObj = root.getApp(req.data.app);
|
|
// check access for application. md5-encoded uname/pwd can also be put in
|
|
// app.properties to limit access to a single app
|
|
if ( checkAuth(appObj)==false ) return;
|
|
|
|
if ( req.data.action=="start" ) {
|
|
this.startApplication(req.data.app);
|
|
res.redirect ( appObj.href("main") );
|
|
|
|
} else if ( req.data.action=="stop" ) {
|
|
if ( checkAuth()==false ) return;
|
|
this.stopApplication(req.data.app);
|
|
res.redirect ( root.href("main") );
|
|
|
|
} else if ( req.data.action=="restart" ) {
|
|
this.stopApplication(req.data.app);
|
|
this.startApplication(req.data.app);
|
|
res.redirect ( appObj.href("main") );
|
|
|
|
} else if ( req.data.action=="flush" ) {
|
|
appObj.clearAppCache();
|
|
res.redirect ( appObj.href("main") );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// output only to root
|
|
if ( checkAuth()==false ) return;
|
|
|
|
res.skin = "global";
|
|
res.title = "Helma Object Publisher - Serverinfo";
|
|
res.body = this.renderSkinAsString("main");
|
|
|