- module.php: bump db_version to 2; full v2 schema in install_queries[0]; ALTER TABLE migration in install_queries[2] adding 11 new profile columns plus server_workshop_settings table
- WorkshopRepository: expand saveProfile() with all new fields (steam_app_id, steamcmd_login_mode, steamcmd_path, mod_separator, copy_keys, key paths, pre/post scripts, validation_notes); add nullOrStr helper; add server settings CRUD (getServerSettings, saveServerSettings, recordUpdateResult, setUpdateQueued, listQueuedUpdateHomes); update insertOrUpdateMod with custom_folder; update listAllEnabledMods to select new columns
- WorkshopProfileController: full extractProfileData() with all new fields; validateProfileData with folder template check
- views/admin/profile_form.php: full rewrite – all required fields (steam_app_id, workshop_app_id, login mode, SteamCMD path, OS, cache path, install path, folder naming dropdown, launch params, mod separator, copy method, copy keys with JS show/hide, key paths, pre/per-mod/post bash scripts with DayZ example, validation notes, config file template)
- views/admin/profiles.php: updated list view columns (App IDs, Login, Method)
- WorkshopInstaller.php: full rewrite with %var% template support (+ legacy {var} compat); buildTemplateVars() resolves all 14 variables; pre/post script execution; triggerSteamCmdDownload uses new profile fields; copyKeys helper
- WorkshopModController: add save_settings and queue_update POST actions; handleModsPage loads serverSettings + allProfiles
- views/user_workshop_mods.php: full rewrite – server settings form (enable, profile selector, update mode, restart behavior), update status grid (status/error/time/success time), queue update button, mod table with custom_folder column and toggle/order auto-submit
- lang/en_US.php: ~80 new string keys for all v2 fields
- steam_workshop.css: new v2 styles (3-col grid, script textarea, status grid, server settings card, badges)"
Agent-Logs-Url: https://github.com/GameServerPanel/GSP/sessions/e7f0d80d-f775-4794-adbd-cf48b55bc9c1
Co-authored-by: iaretechnician <2749183+iaretechnician@users.noreply.github.com>
74 lines
5.1 KiB
PHP
74 lines
5.1 KiB
PHP
<?php
|
|
declare(strict_types=1);
|
|
/** @var array $lang */
|
|
/** @var array[] $profiles */
|
|
?>
|
|
<div class="sw-admin sw-profiles">
|
|
<div class="sw-admin__intro">
|
|
<h3><?php echo htmlspecialchars($lang['config_heading_list'] ?? 'Workshop Game Configurations'); ?></h3>
|
|
<p><?php echo htmlspecialchars($lang['config_intro'] ?? 'One configuration per supported game. Each configuration controls how SteamCMD downloads and installs Workshop mods for servers of that game type.'); ?></p>
|
|
<a class="btn primary" href="?m=steam_workshop&p=workshop_admin&sw_action=config_form">
|
|
<?php echo htmlspecialchars($lang['config_btn_create'] ?? 'Add Game Configuration'); ?>
|
|
</a>
|
|
</div>
|
|
|
|
<?php if (empty($profiles)): ?>
|
|
<p class="sw-empty"><?php echo htmlspecialchars($lang['config_list_empty'] ?? 'No Workshop configurations defined yet. Add one for each game that supports Steam Workshop mods.'); ?></p>
|
|
<?php else: ?>
|
|
<table class="table sw-profiles__table">
|
|
<thead>
|
|
<tr>
|
|
<th><?php echo htmlspecialchars($lang['profile_col_game'] ?? 'Game'); ?></th>
|
|
<th><?php echo htmlspecialchars($lang['profile_col_key'] ?? 'Game Key'); ?></th>
|
|
<th><?php echo htmlspecialchars($lang['profile_col_app_ids'] ?? 'App IDs'); ?></th>
|
|
<th><?php echo htmlspecialchars($lang['profile_col_login'] ?? 'Login'); ?></th>
|
|
<th><?php echo htmlspecialchars($lang['profile_col_method'] ?? 'Install Method'); ?></th>
|
|
<th><?php echo htmlspecialchars($lang['profile_col_restart'] ?? 'Restart?'); ?></th>
|
|
<th><?php echo htmlspecialchars($lang['profile_col_status'] ?? 'Status'); ?></th>
|
|
<th><?php echo htmlspecialchars($lang['admin_col_actions'] ?? 'Actions'); ?></th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<?php foreach ((array)$profiles as $profile): ?>
|
|
<tr>
|
|
<td><?php echo htmlspecialchars($profile['game_name']); ?></td>
|
|
<td><code><?php echo htmlspecialchars($profile['game_key']); ?></code></td>
|
|
<td>
|
|
<small><?php echo htmlspecialchars($lang['profile_col_steam'] ?? 'Steam'); ?>:</small> <?php echo htmlspecialchars($profile['steam_app_id'] !== '' ? $profile['steam_app_id'] : '—'); ?><br>
|
|
<small><?php echo htmlspecialchars($lang['profile_col_workshop'] ?? 'Workshop'); ?>:</small> <?php echo htmlspecialchars($profile['workshop_app_id']); ?>
|
|
</td>
|
|
<td>
|
|
<?php echo htmlspecialchars($profile['steamcmd_login_mode'] ?? 'anonymous'); ?>
|
|
<?php if (!empty($profile['steam_login_required'])): ?>
|
|
<span class="sw-badge sw-badge--warning"><?php echo htmlspecialchars($lang['profile_badge_login_required'] ?? 'Login req.'); ?></span>
|
|
<?php endif; ?>
|
|
</td>
|
|
<td><?php echo htmlspecialchars($profile['copy_method']); ?></td>
|
|
<td><?php echo $profile['requires_restart'] ? '✔' : '✘'; ?></td>
|
|
<td>
|
|
<?php if ($profile['enabled']): ?>
|
|
<span class="sw-badge sw-badge--enabled"><?php echo htmlspecialchars($lang['status_enabled'] ?? 'Enabled'); ?></span>
|
|
<?php else: ?>
|
|
<span class="sw-badge sw-badge--disabled"><?php echo htmlspecialchars($lang['status_disabled'] ?? 'Disabled'); ?></span>
|
|
<?php endif; ?>
|
|
</td>
|
|
<td class="sw-actions">
|
|
<a class="btn secondary"
|
|
href="?m=steam_workshop&p=workshop_admin&sw_action=config_form&profile_id=<?php echo (int)$profile['id']; ?>">
|
|
<?php echo htmlspecialchars($lang['button_edit'] ?? 'Edit'); ?>
|
|
</a>
|
|
<form method="post" action="?m=steam_workshop&p=workshop_admin" class="sw-inline-delete">
|
|
<input type="hidden" name="sw_action" value="profile_delete">
|
|
<input type="hidden" name="profile_id" value="<?php echo (int)$profile['id']; ?>">
|
|
<button type="submit" class="btn danger"
|
|
onclick="return confirm('<?php echo htmlspecialchars($lang['config_confirm_delete'] ?? 'Delete this Workshop configuration? Servers using it will no longer have Workshop mod support.'); ?>')">
|
|
<?php echo htmlspecialchars($lang['button_delete'] ?? 'Delete'); ?>
|
|
</button>
|
|
</form>
|
|
</td>
|
|
</tr>
|
|
<?php endforeach; ?>
|
|
</tbody>
|
|
</table>
|
|
<?php endif; ?>
|
|
</div>
|