Simplify Steam Workshop UX and wire panel docs links
Agent-Logs-Url: https://github.com/GameServerPanel/GSP/sessions/1575c81b-f8a7-433a-8f3b-e068c0992c18 Co-authored-by: iaretechnician <2749183+iaretechnician@users.noreply.github.com>
This commit is contained in:
parent
5fc301e632
commit
01ad93a11a
13 changed files with 566 additions and 528 deletions
|
|
@ -125,15 +125,12 @@ function sw_admin_save_profile($db)
|
|||
);
|
||||
|
||||
// Per-profile default behavior fields
|
||||
$valid_update_modes = array('manual', 'on_restart', 'before_start', 'scheduled');
|
||||
$valid_restart_behaviors = array('none', 'if_empty', 'immediate', 'next_restart');
|
||||
$valid_hot_load = array('disabled', 'attempt');
|
||||
$valid_update_modes = array('manual', 'on_restart', 'before_start');
|
||||
$valid_restart_behaviors = array('none', 'if_stopped');
|
||||
$posted_um = $_POST['default_update_mode'] ?? 'manual';
|
||||
$posted_rb = $_POST['default_restart_behavior'] ?? 'none';
|
||||
$posted_hl = $_POST['default_hot_load'] ?? 'disabled';
|
||||
$fields['default_update_mode'] = in_array($posted_um, $valid_update_modes, true) ? $posted_um : 'manual';
|
||||
$fields['default_restart_behavior'] = in_array($posted_rb, $valid_restart_behaviors, true) ? $posted_rb : 'none';
|
||||
$fields['default_hot_load'] = in_array($posted_hl, $valid_hot_load, true) ? $posted_hl : 'disabled';
|
||||
|
||||
$setParts = array();
|
||||
foreach ($fields as $col => $val) {
|
||||
|
|
@ -307,7 +304,7 @@ function sw_admin_edit_form(array $profile, array $detected = array(), $showDete
|
|||
<p class="sw-muted">
|
||||
These defaults are applied when a user enables Workshop on a server that has no saved behavior settings yet.
|
||||
Users can always override them on their own server pages.
|
||||
All defaults are intentionally set to the safest option (manual / no auto-restart / hot-load off).
|
||||
All defaults are intentionally set to the safest option (manual / no automatic restart).
|
||||
</p>
|
||||
<div class="sw-grid">
|
||||
<label>
|
||||
|
|
@ -316,23 +313,13 @@ function sw_admin_edit_form(array $profile, array $detected = array(), $showDete
|
|||
<option value="manual" <?= (($profile['default_update_mode'] ?? 'manual') === 'manual') ? 'selected' : '' ?>>Manual only (safe default)</option>
|
||||
<option value="on_restart" <?= (($profile['default_update_mode'] ?? 'manual') === 'on_restart') ? 'selected' : '' ?>>On next restart</option>
|
||||
<option value="before_start" <?= (($profile['default_update_mode'] ?? 'manual') === 'before_start') ? 'selected' : '' ?>>Before every server start</option>
|
||||
<option value="scheduled" <?= (($profile['default_update_mode'] ?? 'manual') === 'scheduled') ? 'selected' : '' ?>>Scheduled update check</option>
|
||||
</select>
|
||||
</label>
|
||||
<label>
|
||||
<span>Default Restart Behavior</span>
|
||||
<select name="default_restart_behavior">
|
||||
<option value="none" <?= (($profile['default_restart_behavior'] ?? 'none') === 'none') ? 'selected' : '' ?>>Do not restart automatically (safe default)</option>
|
||||
<option value="if_empty" <?= (($profile['default_restart_behavior'] ?? 'none') === 'if_empty') ? 'selected' : '' ?>>Restart if empty</option>
|
||||
<option value="immediate" <?= (($profile['default_restart_behavior'] ?? 'none') === 'immediate') ? 'selected' : '' ?>>Restart after warning</option>
|
||||
<option value="next_restart" <?= (($profile['default_restart_behavior'] ?? 'none') === 'next_restart') ? 'selected' : '' ?>>Install on next manual restart only</option>
|
||||
</select>
|
||||
</label>
|
||||
<label>
|
||||
<span>Default Hot-Load</span>
|
||||
<select name="default_hot_load">
|
||||
<option value="disabled" <?= (($profile['default_hot_load'] ?? 'disabled') === 'disabled') ? 'selected' : '' ?>>Disabled (safe default)</option>
|
||||
<option value="attempt" <?= (($profile['default_hot_load'] ?? 'disabled') === 'attempt') ? 'selected' : '' ?>>Attempt hot-load if game supports it</option>
|
||||
<option value="if_stopped" <?= (($profile['default_restart_behavior'] ?? 'none') === 'if_stopped') ? 'selected' : '' ?>>Restart only if server is stopped</option>
|
||||
</select>
|
||||
</label>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue