chore: address review feedback for provisioning and payment status UI
Agent-Logs-Url: https://github.com/GameServerPanel/GSP/sessions/020b5f73-a6ca-4a45-a4cb-eeef59cb26a8 Co-authored-by: iaretechnician <2749183+iaretechnician@users.noreply.github.com>
This commit is contained in:
parent
83f97dda20
commit
05d7bfba78
2 changed files with 12 additions and 4 deletions
|
|
@ -3,6 +3,10 @@ require_once __DIR__ . '/../../includes/lib_remote.php';
|
||||||
require_once __DIR__ . '/../config_games/server_config_parser.php';
|
require_once __DIR__ . '/../config_games/server_config_parser.php';
|
||||||
require_once __DIR__ . '/../gamemanager/update_actions.php';
|
require_once __DIR__ . '/../gamemanager/update_actions.php';
|
||||||
|
|
||||||
|
if (!defined('BILLING_INSTALL_MECHANISM')) {
|
||||||
|
define('BILLING_INSTALL_MECHANISM', 'gamemanager_trigger_update_install');
|
||||||
|
}
|
||||||
|
|
||||||
if (!function_exists('billing_generate_provision_password')) {
|
if (!function_exists('billing_generate_provision_password')) {
|
||||||
function billing_generate_provision_password(int $bytes = 12)
|
function billing_generate_provision_password(int $bytes = 12)
|
||||||
{
|
{
|
||||||
|
|
@ -185,10 +189,13 @@ if (!function_exists('billing_write_provision_log')) {
|
||||||
{
|
{
|
||||||
$logDir = __DIR__ . '/logs';
|
$logDir = __DIR__ . '/logs';
|
||||||
if (!is_dir($logDir)) {
|
if (!is_dir($logDir)) {
|
||||||
@mkdir($logDir, 0755, true);
|
mkdir($logDir, 0755, true);
|
||||||
}
|
}
|
||||||
$line = '[' . date('Y-m-d H:i:s') . '] ' . json_encode($context, JSON_UNESCAPED_SLASHES) . PHP_EOL;
|
$line = '[' . date('Y-m-d H:i:s') . '] ' . json_encode($context, JSON_UNESCAPED_SLASHES) . PHP_EOL;
|
||||||
@file_put_contents($logDir . '/provisioning.log', $line, FILE_APPEND | LOCK_EX);
|
$result = file_put_contents($logDir . '/provisioning.log', $line, FILE_APPEND | LOCK_EX);
|
||||||
|
if ($result === false) {
|
||||||
|
error_log('billing_write_provision_log: failed to append provisioning.log');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -280,7 +287,7 @@ function exec_ogp_module()
|
||||||
$selected_port = 0;
|
$selected_port = 0;
|
||||||
$selected_mod_id = 0;
|
$selected_mod_id = 0;
|
||||||
$resolved_mod_cfg_id = 0;
|
$resolved_mod_cfg_id = 0;
|
||||||
$install_mechanism = 'gamemanager_trigger_update_install';
|
$install_mechanism = BILLING_INSTALL_MECHANISM;
|
||||||
$install_result = 'pending';
|
$install_result = 'pending';
|
||||||
$install_message = '';
|
$install_message = '';
|
||||||
$install_attempted = false;
|
$install_attempted = false;
|
||||||
|
|
@ -535,6 +542,7 @@ function exec_ogp_module()
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Retry install for orders that already have home_id but never triggered installation.
|
||||||
if (!$order_failed && !$extended && !$install_attempted && intval($home_id) > 0) {
|
if (!$order_failed && !$extended && !$install_attempted && intval($home_id) > 0) {
|
||||||
if ($selected_ip_id <= 0 || $selected_port <= 0) {
|
if ($selected_ip_id <= 0 || $selected_port <= 0) {
|
||||||
$existingIpPort = billing_get_home_ip_port($db, $db_prefix, intval($home_id));
|
$existingIpPort = billing_get_home_ip_port($db, $db_prefix, intval($home_id));
|
||||||
|
|
|
||||||
|
|
@ -222,7 +222,7 @@ if ($db && $user_id > 0) {
|
||||||
<th>Game</th>
|
<th>Game</th>
|
||||||
<th>Duration</th>
|
<th>Duration</th>
|
||||||
<th>Status</th>
|
<th>Status</th>
|
||||||
<th>Provisioning</th>
|
<th title="Server Setup Status" aria-label="Server Setup Status">Provisioning</th>
|
||||||
<th style="text-align: right;">Price</th>
|
<th style="text-align: right;">Price</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue