Add last startup command display feature

Co-authored-by: iaretechnician <2749183+iaretechnician@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot] 2025-09-05 22:00:17 +00:00
parent 5e41da1247
commit 662582823d
5 changed files with 47 additions and 3 deletions

View file

@ -582,6 +582,8 @@ elseif($server_home['home_id'] == $_POST['home_id'])
}
//Save the param used to the database
$db->changeLastParam($server_home['home_id'],json_encode($save_param));
//Save the startup command to the database
$db->changeLastStartupCmd($server_home['home_id'], $start_cmd);
echo "<table class='server-starting'>";
echo "<tr><td class='right'>". get_lang("ogp_agent_ip") .

View file

@ -24,8 +24,8 @@
// Module general information
$module_title = "Game manager";
$module_version = "1.33";
$db_version = 9;
$module_version = "1.34";
$db_version = 10;
$module_required = TRUE;
$module_menus = array( array( 'subpage' => 'game_monitor', 'name'=>'Game Monitor', 'group'=>'user' ) );
$module_access_rights = array('u' => 'allow_updates', 'p' => 'allow_parameter_usage', 'e' => 'allow_extra_params', 'c' => 'allow_custom_fields');
@ -117,4 +117,8 @@ $install_queries[9] = array(
"ALTER TABLE `".OGP_DB_PREFIX."server_homes` MODIFY COLUMN `home_name` VARCHAR(500);",
"ALTER TABLE `".OGP_DB_PREFIX."server_homes` MODIFY COLUMN `control_password` VARCHAR(128);",
"ALTER TABLE `".OGP_DB_PREFIX."server_homes` MODIFY COLUMN `ftp_password` VARCHAR(128);");
// Add field to store last startup command
$install_queries[10] = array(
"ALTER TABLE `".OGP_DB_PREFIX."server_homes` ADD `last_startup_cmd` LONGTEXT NULL;");
?>

View file

@ -436,6 +436,13 @@ echo "<table id='servermonitor' class='tablesorter' data-sortlist='[[0,0],[3,1]]
$btns = get_monitor_buttons($server_home, $server_xml);
// Get last startup command for display
$last_startup_cmd = $db->getLastStartupCmd($server_home['home_id']);
$startup_cmd_display = "";
if ($last_startup_cmd) {
$startup_cmd_display = "<br><b>". get_lang("last_startup_command") .":</b><br><span style='font-family:monospace; font-size:10px; color:#666; word-wrap: break-word;'>" . htmlentities($last_startup_cmd) . "</span>";
}
//End
$remote = new OGPRemoteLibrary($server_home['agent_ip'], $server_home['agent_port'], $server_home['encryption_key'], $server_home['timeout']);
@ -555,7 +562,7 @@ echo "<table id='servermonitor' class='tablesorter' data-sortlist='[[0,0],[3,1]]
$first .= "</tr>";
$second = "<tr class='expand-child'>";
@$second .= "<td colspan='4'>" . $refresh->getdiv($pos,"width:100%;") . "$offlineT</td>";
@$second .= "<td colspan='4'>" . $refresh->getdiv($pos,"width:100%;") . "$offlineT" . $startup_cmd_display . "</td>";
$second .= "<td class='owner' >$other_owners$groupsus</td>";
if( $server_xml->protocol != "teamspeak3" OR ($startup_file_exists and $server_xml->protocol == "teamspeak3") OR ($status == "offline" and $server_xml->protocol == "teamspeak3") )