From bbd39276c837c3f23486200a560b60f57a645d53 Mon Sep 17 00:00:00 2001 From: Ulf Gebhardt Date: Thu, 17 Dec 2015 21:50:16 +0100 Subject: [PATCH] Serverhandling saimod fully functional --- .../js/saimod_mojotrollz_server_handling.js | 310 +++++++++++++++++- .../saimod_mojotrollz_server_handling.php | 51 ++- .../tpl/main.tpl | 161 ++++----- 3 files changed, 432 insertions(+), 90 deletions(-) diff --git a/mojotrollz/sai/saimod_mojotrollz_server_handling/js/saimod_mojotrollz_server_handling.js b/mojotrollz/sai/saimod_mojotrollz_server_handling/js/saimod_mojotrollz_server_handling.js index f3b17c6..5acad9c 100644 --- a/mojotrollz/sai/saimod_mojotrollz_server_handling/js/saimod_mojotrollz_server_handling.js +++ b/mojotrollz/sai/saimod_mojotrollz_server_handling/js/saimod_mojotrollz_server_handling.js @@ -39,8 +39,240 @@ function init_saimod_mojotrollz_server(){ }); }); } - { + + $('#btn_clear').click(function(){ + $('#output_log').html(''); + $('#table_changes').html(''); + }); + + register_classic(); + register_tbc(); +} +function register_classic(){ + { + $('#btn_classic_realm_start').click(function(){ + growl_start('Doing ... please wait') + $.ajax({ type :'GET', + url : './sai.php', + data : { sai_mod: '.SAI.saimod_mojotrollz_server_handling', + action: 'run_classic_realm_start'}, + success : function(data) { + $('#output_log').append(data); + growl_end_success("Updated successfully!"); + } + + }); + }); + $('#btn_classic_realm_stop').click(function(){ + growl_start('Doing ... please wait') + $.ajax({ type :'GET', + url : './sai.php', + data : { sai_mod: '.SAI.saimod_mojotrollz_server_handling', + action: 'run_classic_realm_stop'}, + success : function(data) { + $('#output_log').append(data); + growl_end_success("Updated successfully!"); + } + + }); + }); + $('#btn_classic_realm_status').click(function(){ + growl_start('Doing ... please wait') + $.ajax({ type :'GET', + url : './sai.php', + data : { sai_mod: '.SAI.saimod_mojotrollz_server_handling', + action: 'run_classic_realm_status'}, + success : function(data) { + $('#output_log').append(data); + growl_end_success("Updated successfully!"); + } + + }); + }); + } + { + $('#btn_classic_world_start').click(function(){ + growl_start('Doing ... please wait') + $.ajax({ type :'GET', + url : './sai.php', + data : { sai_mod: '.SAI.saimod_mojotrollz_server_handling', + action: 'run_classic_world_start'}, + success : function(data) { + $('#output_log').append(data); + growl_end_success("Updated successfully!"); + } + + }); + }); + $('#btn_classic_world_stop').click(function(){ + growl_start('Doing ... please wait') + $.ajax({ type :'GET', + url : './sai.php', + data : { sai_mod: '.SAI.saimod_mojotrollz_server_handling', + action: 'run_classic_world_stop'}, + success : function(data) { + $('#output_log').append(data); + growl_end_success("Updated successfully!"); + } + + }); + }); + $('#btn_classic_world_status').click(function(){ + growl_start('Doing ... please wait') + $.ajax({ type :'GET', + url : './sai.php', + data : { sai_mod: '.SAI.saimod_mojotrollz_server_handling', + action: 'run_classic_world_status'}, + success : function(data) { + $('#output_log').append(data); + growl_end_success("Updated successfully!"); + } + + }); + }); + } + { + $('#btn_classic_world_test_start').click(function(){ + growl_start('Doing ... please wait') + $.ajax({ type :'GET', + url : './sai.php', + data : { sai_mod: '.SAI.saimod_mojotrollz_server_handling', + action: 'run_classic_world_test_start'}, + success : function(data) { + $('#output_log').append(data); + growl_end_success("Updated successfully!"); + } + + }); + }); + $('#btn_classic_world_test_stop').click(function(){ + growl_start('Doing ... please wait') + $.ajax({ type :'GET', + url : './sai.php', + data : { sai_mod: '.SAI.saimod_mojotrollz_server_handling', + action: 'run_classic_world_test_stop'}, + success : function(data) { + $('#output_log').append(data); + growl_end_success("Updated successfully!"); + } + + }); + }); + $('#btn_classic_world_test_status').click(function(){ + growl_start('Doing ... please wait') + $.ajax({ type :'GET', + url : './sai.php', + data : { sai_mod: '.SAI.saimod_mojotrollz_server_handling', + action: 'run_classic_world_test_status'}, + success : function(data) { + $('#output_log').append(data); + growl_end_success("Updated successfully!"); + } + + }); + }); + } + { + $('#btn_compile_classic_live').click(function(){ + growl_start('Doing ... please wait') + $.ajax({ type :'GET', + url : './sai.php', + data : { sai_mod: '.SAI.saimod_mojotrollz_server_handling', + action: 'compile_classic_live'}, + success : function(data) { + $('#output_log').append(data); + growl_end_success("Updated successfully!"); + } + + }); + }); + $('#btn_compile_classic_test').click(function(){ + growl_start('Doing ... please wait') + $.ajax({ type :'GET', + url : './sai.php', + data : { sai_mod: '.SAI.saimod_mojotrollz_server_handling', + action: 'compile_classic_test'}, + success : function(data) { + $('#output_log').append(data); + growl_end_success("Updated successfully!"); + } + + }); + }); + } + { + $('#btn_db_classic_realm_live').click(function(){ + growl_start('Doing ... please wait') + $.ajax({ type :'GET', + url : './sai.php', + data : { sai_mod: '.SAI.saimod_mojotrollz_server_handling', + action: 'db_classic_realm_live'}, + success : function(data) { + $('#output_log').append(data); + growl_end_success("Updated successfully!"); + } + + }); + }); + $('#btn_db_classic_chars_live').click(function(){ + growl_start('Doing ... please wait') + $.ajax({ type :'GET', + url : './sai.php', + data : { sai_mod: '.SAI.saimod_mojotrollz_server_handling', + action: 'db_classic_chars_live'}, + success : function(data) { + $('#output_log').append(data); + growl_end_success("Updated successfully!"); + } + + }); + }); + $('#btn_db_classic_chars_test').click(function(){ + growl_start('Doing ... please wait') + $.ajax({ type :'GET', + url : './sai.php', + data : { sai_mod: '.SAI.saimod_mojotrollz_server_handling', + action: 'db_classic_chars_test'}, + success : function(data) { + $('#output_log').append(data); + growl_end_success("Updated successfully!"); + } + + }); + }); + $('#btn_db_classic_world_live').click(function(){ + growl_start('Doing ... please wait') + $.ajax({ type :'GET', + url : './sai.php', + data : { sai_mod: '.SAI.saimod_mojotrollz_server_handling', + action: 'db_classic_world_live'}, + success : function(data) { + $('#output_log').append(data); + growl_end_success("Updated successfully!"); + } + + }); + }); + $('#btn_db_classic_world_test').click(function(){ + growl_start('Doing ... please wait') + $.ajax({ type :'GET', + url : './sai.php', + data : { sai_mod: '.SAI.saimod_mojotrollz_server_handling', + action: 'db_classic_world_test'}, + success : function(data) { + $('#output_log').append(data); + growl_end_success("Updated successfully!"); + } + + }); + }); + + } +} + +function register_tbc(){ + { $('#btn_tbc_realm_start').click(function(){ growl_start('Doing ... please wait') $.ajax({ type :'GET', @@ -191,14 +423,74 @@ function init_saimod_mojotrollz_server(){ }); }); } - - - - - $('#btn_clear').click(function(){ - $('#output_log').html(''); - $('#table_changes').html(''); - }); + { + $('#btn_db_tbc_realm_live').click(function(){ + growl_start('Doing ... please wait') + $.ajax({ type :'GET', + url : './sai.php', + data : { sai_mod: '.SAI.saimod_mojotrollz_server_handling', + action: 'db_tbc_realm_live'}, + success : function(data) { + $('#output_log').append(data); + growl_end_success("Updated successfully!"); + } + + }); + }); + $('#btn_db_tbc_chars_live').click(function(){ + growl_start('Doing ... please wait') + $.ajax({ type :'GET', + url : './sai.php', + data : { sai_mod: '.SAI.saimod_mojotrollz_server_handling', + action: 'db_tbc_chars_live'}, + success : function(data) { + $('#output_log').append(data); + growl_end_success("Updated successfully!"); + } + + }); + }); + $('#btn_db_tbc_chars_test').click(function(){ + growl_start('Doing ... please wait') + $.ajax({ type :'GET', + url : './sai.php', + data : { sai_mod: '.SAI.saimod_mojotrollz_server_handling', + action: 'db_tbc_chars_test'}, + success : function(data) { + $('#output_log').append(data); + growl_end_success("Updated successfully!"); + } + + }); + }); + $('#btn_db_tbc_world_live').click(function(){ + growl_start('Doing ... please wait') + $.ajax({ type :'GET', + url : './sai.php', + data : { sai_mod: '.SAI.saimod_mojotrollz_server_handling', + action: 'db_tbc_world_live'}, + success : function(data) { + $('#output_log').append(data); + growl_end_success("Updated successfully!"); + } + + }); + }); + $('#btn_db_tbc_world_test').click(function(){ + growl_start('Doing ... please wait') + $.ajax({ type :'GET', + url : './sai.php', + data : { sai_mod: '.SAI.saimod_mojotrollz_server_handling', + action: 'db_tbc_world_test'}, + success : function(data) { + $('#output_log').append(data); + growl_end_success("Updated successfully!"); + } + + }); + }); + + } } function revert_file(path,submodule){ diff --git a/mojotrollz/sai/saimod_mojotrollz_server_handling/saimod_mojotrollz_server_handling.php b/mojotrollz/sai/saimod_mojotrollz_server_handling/saimod_mojotrollz_server_handling.php index b7f5aea..5ab212c 100644 --- a/mojotrollz/sai/saimod_mojotrollz_server_handling/saimod_mojotrollz_server_handling.php +++ b/mojotrollz/sai/saimod_mojotrollz_server_handling/saimod_mojotrollz_server_handling.php @@ -2,7 +2,10 @@ namespace SAI; class saimod_mojotrollz_server_handling extends \SYSTEM\SAI\SaiModule { public static function sai_mod__SAI_saimod_mojotrollz_server_handling(){ - $vars = \SYSTEM\PAGE\text::tag('basic'); + $vars = array(); + $vars['classic_realm_status'] = self::sai_mod__SAI_saimod_mojotrollz_server_handling_action_run_classic_realm_status(); + $vars['classic_world_status'] = self::sai_mod__SAI_saimod_mojotrollz_server_handling_action_run_classic_world_status(); + $vars['classic_world_test_status'] = self::sai_mod__SAI_saimod_mojotrollz_server_handling_action_run_classic_world_test_status(); $vars['tbc_realm_status'] = self::sai_mod__SAI_saimod_mojotrollz_server_handling_action_run_tbc_realm_status(); $vars['tbc_world_status'] = self::sai_mod__SAI_saimod_mojotrollz_server_handling_action_run_tbc_world_status(); $vars['tbc_world_test_status'] = self::sai_mod__SAI_saimod_mojotrollz_server_handling_action_run_tbc_world_test_status(); @@ -129,11 +132,57 @@ class saimod_mojotrollz_server_handling extends \SYSTEM\SAI\SaiModule { private static function shell_compile($ver,$cmd){ return str_replace("\n","\r\n",shell_exec('/home/mojotrolls/mojo/compile '.$ver.' '.$cmd.' 2>&1'));} + public static function sai_mod__SAI_saimod_mojotrollz_server_handling_action_compile_classic_live(){ + return htmlentities(self::shell_compile('classic', 'live'));} + public static function sai_mod__SAI_saimod_mojotrollz_server_handling_action_compile_classic_test(){ + return htmlentities(self::shell_compile('classic', 'test'));} + + public static function sai_mod__SAI_saimod_mojotrollz_server_handling_action_db_classic_realm_live(){ + return htmlentities(self::shell_db('classic', 'realm', 'live'));} + public static function sai_mod__SAI_saimod_mojotrollz_server_handling_action_db_classic_chars_live(){ + return htmlentities(self::shell_db('classic', 'chars', 'live'));} + public static function sai_mod__SAI_saimod_mojotrollz_server_handling_action_db_classic_chars_test(){ + return htmlentities(self::shell_db('classic', 'chars', 'test'));} + public static function sai_mod__SAI_saimod_mojotrollz_server_handling_action_db_classic_world_live(){ + return htmlentities(self::shell_db('classic', 'world', 'live'));} + public static function sai_mod__SAI_saimod_mojotrollz_server_handling_action_db_classic_world_test(){ + return htmlentities(self::shell_db('classic', 'world', 'test'));} + + public static function sai_mod__SAI_saimod_mojotrollz_server_handling_action_run_classic_realm_start(){ + return self::shell_run('classic', 'realm','start');} + public static function sai_mod__SAI_saimod_mojotrollz_server_handling_action_run_classic_world_start(){ + return self::shell_run('classic', 'world','start');} + public static function sai_mod__SAI_saimod_mojotrollz_server_handling_action_run_classic_world_test_start(){ + return self::shell_run('classic', 'world_test','start');} + public static function sai_mod__SAI_saimod_mojotrollz_server_handling_action_run_classic_realm_stop(){ + return self::shell_run('classic', 'realm','stop');} + public static function sai_mod__SAI_saimod_mojotrollz_server_handling_action_run_classic_world_stop(){ + return self::shell_run('classic', 'world','stop');} + public static function sai_mod__SAI_saimod_mojotrollz_server_handling_action_run_classic_world_test_stop(){ + return self::shell_run('classic', 'world_test','stop');} + public static function sai_mod__SAI_saimod_mojotrollz_server_handling_action_run_classic_realm_status(){ + return self::shell_run('classic', 'realm','status');} + public static function sai_mod__SAI_saimod_mojotrollz_server_handling_action_run_classic_world_status(){ + return self::shell_run('classic', 'world','status');} + public static function sai_mod__SAI_saimod_mojotrollz_server_handling_action_run_classic_world_test_status(){ + return self::shell_run('classic', 'world_test','status');} + public static function sai_mod__SAI_saimod_mojotrollz_server_handling_action_compile_tbc_live(){ return htmlentities(self::shell_compile('tbc', 'live'));} public static function sai_mod__SAI_saimod_mojotrollz_server_handling_action_compile_tbc_test(){ return htmlentities(self::shell_compile('tbc', 'test'));} + public static function sai_mod__SAI_saimod_mojotrollz_server_handling_action_db_tbc_realm_live(){ + return htmlentities(self::shell_db('tbc', 'realm', 'live'));} + public static function sai_mod__SAI_saimod_mojotrollz_server_handling_action_db_tbc_chars_live(){ + return htmlentities(self::shell_db('tbc', 'chars', 'live'));} + public static function sai_mod__SAI_saimod_mojotrollz_server_handling_action_db_tbc_chars_test(){ + return htmlentities(self::shell_db('tbc', 'chars', 'test'));} + public static function sai_mod__SAI_saimod_mojotrollz_server_handling_action_db_tbc_world_live(){ + return htmlentities(self::shell_db('tbc', 'world', 'live'));} + public static function sai_mod__SAI_saimod_mojotrollz_server_handling_action_db_tbc_world_test(){ + return htmlentities(self::shell_db('tbc', 'world', 'test'));} + public static function sai_mod__SAI_saimod_mojotrollz_server_handling_action_run_tbc_realm_start(){ return self::shell_run('tbc', 'realm','start');} public static function sai_mod__SAI_saimod_mojotrollz_server_handling_action_run_tbc_world_start(){ diff --git a/mojotrollz/sai/saimod_mojotrollz_server_handling/tpl/main.tpl b/mojotrollz/sai/saimod_mojotrollz_server_handling/tpl/main.tpl index b3550cf..8240236 100644 --- a/mojotrollz/sai/saimod_mojotrollz_server_handling/tpl/main.tpl +++ b/mojotrollz/sai/saimod_mojotrollz_server_handling/tpl/main.tpl @@ -1,97 +1,98 @@

Mojotrollz Server

- - + +
-

Classic

+

Classic - Status

- + - + - + -
realmstatus${classic_realm_status}
worldstatus${classic_world_status}
world_teststatus${classic_world_test_status}
+
-

compile

+

Classic - Run

- - - - - - - - -
livecompile
testcompile
-
-
-
-

db

-
- - - - - - - + + + + + + + + + + + + + + + + +
worlddeploy livedeploy test
realmdeploy live
world
world_test
+
+
+
+

Classic - Database Stop the Server first!

+
+ + + + - - + + + + + + +
realm
charsdeploy livedeploy test
world
-

run

+

Classic - Compile Stop the Server first!

- - - - + + - - - - - - - - - - + +
worldstartstopstatuslive
realmstartstopstatus
world_teststartstopstatustest
+
-

TBC

+

TBC - Status

@@ -110,63 +111,63 @@
-

compile

+

TBC - Run

- - + + + + - - + + + + + + + + + +
liverealm
testworld
world_test
-

db

+

TBC - Database Stop the Server first!

- - - - - - + - - + + + + + + +
worlddeploy livedeploy test
realmdeploy live
charsdeploy livedeploy test
world
-

run

+

TBC - Compile Stop the Server first!

- - - - + + - - - - - - - - - - + +
realmlive
world
world_testtest
@@ -179,15 +180,15 @@ - - - + + +
${table_path}${table_submodule}${table_action}PathSubmoduleAction
- +
\ No newline at end of file