mojotrollz serverhandling mod for restart etc
This commit is contained in:
parent
078cb01492
commit
ca3f2b5a7a
5
mojotrollz/path/PSAI.php
Normal file
5
mojotrollz/path/PSAI.php
Normal file
@ -0,0 +1,5 @@
|
||||
<?php
|
||||
class PSAI extends \SYSTEM\PATH {
|
||||
public static function getPath(){
|
||||
return \SYSTEM\C_ROOT.'mojotrollz/sai/'.\SYSTEM\C_SUBPATH;}
|
||||
}
|
||||
@ -1,5 +1,7 @@
|
||||
<button id="realm_start" class="btn">(re)start realm</button>
|
||||
<button id="realm_stop" class="btn">stop realm</button>
|
||||
Status: <status_realm>${status_realm}</status_realm>
|
||||
</br></br>
|
||||
<button id="world_start" class="btn">(re)start world</button>
|
||||
<button id="world_stop" class="btn">stop world</button>
|
||||
Status: <status_world>${status_world}</status_world>
|
||||
@ -0,0 +1,55 @@
|
||||
function init_saimod_mojotrollz_server_handling(){
|
||||
$('#realm_start').click(function(){
|
||||
$.ajax({
|
||||
url: SAI_ENDPOINT,
|
||||
data: { sai_mod: 'saimod_mojotrollz_server_handling',
|
||||
action: 'realmstart'
|
||||
},
|
||||
type: 'POST',
|
||||
|
||||
});
|
||||
update_realmstatus();
|
||||
});
|
||||
$('#realm_stop').click(function(){
|
||||
$.ajax({
|
||||
url: SAI_ENDPOINT,
|
||||
data: { sai_mod: 'saimod_mojotrollz_server_handling',
|
||||
action: 'realmstop'
|
||||
},
|
||||
type: 'POST',
|
||||
|
||||
});
|
||||
update_realmstatus();
|
||||
});
|
||||
$('#world_start').click(function(){
|
||||
$.ajax({
|
||||
url: SAI_ENDPOINT,
|
||||
data: { sai_mod: 'saimod_mojotrollz_server_handling',
|
||||
action: 'worldstart'
|
||||
},
|
||||
type: 'POST',
|
||||
|
||||
});
|
||||
update_worldstatus();
|
||||
});
|
||||
$('#world_stop').click(function(){
|
||||
$.ajax({
|
||||
url: SAI_ENDPOINT,
|
||||
data: { sai_mod: 'saimod_mojotrollz_server_handling',
|
||||
action: 'worldstop'
|
||||
},
|
||||
type: 'POST',
|
||||
|
||||
});
|
||||
update_worldstatus();
|
||||
});
|
||||
}
|
||||
|
||||
function update_realmstatus(){
|
||||
$('status_realm').load(SAI_ENDPOINT+'sai_mod=saimod_mojotrollz_server_handling&action=realmstatus');
|
||||
}
|
||||
|
||||
function update_worldstatus(){
|
||||
$('status_world').load(SAI_ENDPOINT+'sai_mod=saimod_mojotrollz_server_handling&action=world status');
|
||||
}
|
||||
|
||||
@ -1,10 +1,30 @@
|
||||
<?php
|
||||
class saimod_mojotrollz_server_handling extends \SYSTEM\SAI\SaiModule {
|
||||
public static function sai_mod_saimod_mojotrollz_server_handling(){
|
||||
return \SYSTEM\PAGE\replace::replaceFile(dirname(__FILE__).'/main.tpl', array());}
|
||||
$vars = array();
|
||||
$vars['status_realm'] = self::sai_mod_saimod_mojotrollz_server_handling_action_realmstatus();
|
||||
$vars['status_world'] = self::sai_mod_saimod_mojotrollz_server_handling_action_worldstatus();
|
||||
return \SYSTEM\PAGE\replace::replaceFile(dirname(__FILE__).'/main.tpl', $vars);}
|
||||
public static function html_li_menu(){return '<li><a href="#" saimenu="saimod_mojotrollz_server_handling">server handling</a></li><li class="divider"></li>';}
|
||||
public static function right_public(){return false;}
|
||||
public static function right_right(){return \SYSTEM\SECURITY\Security::check(\SYSTEM\SECURITY\RIGHTS::SYS_SAI);}
|
||||
public static function sai_mod_saimod_mojotrollz_server_handling_flag_js(){return \SYSTEM\LOG\JsonResult::toString(array());}
|
||||
public static function sai_mod_saimod_mojotrollz_server_handling_flag_js(){return \SYSTEM\LOG\JsonResult::toString(array(
|
||||
\SYSTEM\WEBPATH(new PSAI(),'saimod_mojotrollz_server_handling/saimod_mojotrollz_server_handling.js')
|
||||
));}
|
||||
public static function sai_mod_saimod_mojotrollz_server_handling_flag_css(){}
|
||||
|
||||
public static function sai_mod_saimod_mojotrollz_server_handling_action_realmstart(){
|
||||
return shell_exec('/home/mojotrolls/mojo_zero/realm start 2>&1');}
|
||||
public static function sai_mod_saimod_mojotrollz_server_handling_action_realmstop(){
|
||||
return shell_exec('/home/mojotrolls/mojo_zero/realm stop 2>&1');}
|
||||
public static function sai_mod_saimod_mojotrollz_server_handling_action_realmstatus(){
|
||||
return shell_exec('/home/mojotrolls/mojo_zero/realm status 2>&1');}
|
||||
public static function sai_mod_saimod_mojotrollz_server_handling_action_worldstart(){
|
||||
return shell_exec('/home/mojotrolls/mojo_zero/world start 2>&1');}
|
||||
public static function sai_mod_saimod_mojotrollz_server_handling_action_worldstop(){
|
||||
return shell_exec('/home/mojotrolls/mojo_zero/world stop 2>&1');}
|
||||
public static function sai_mod_saimod_mojotrollz_server_handling_action_worldstatus(){
|
||||
return shell_exec('/home/mojotrolls/mojo_zero/world status 2>&1');}
|
||||
public static function sai_mod_saimod_mojotrollz_server_handling_action_compile(){
|
||||
return shell_exec('/home/mojotrolls/mojo_zero/compile 2>&1');}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user