Jacob Schmidt 55f60dc71f feat: Revamp admin panel, store, and arsenal systems
This commit introduces significant changes to the admin panel, store, and arsenal systems, focusing on improved functionality, UI enhancements, and code optimization.

**Admin Panel:**
- Migrated to a web-based UI for improved user experience and maintainability.
- Implemented dynamic player listing with filtering and search capabilities.
- Added functionality for managing player paygrades, sending messages, and transferring funds.
- Integrated server-side events for handling admin actions.

**Store:**
- Added `handleDelivery` event handler.
- Streamlined product selection and purchase processes.
- Improved handling of organization funds and player balances.
- Refactored code for better readability and maintainability.

**Arsenal:**
- Enhanced initialization process with improved data validation.
- Optimized item unlocking logic.

These changes aim to provide a more robust, user-friendly, and efficient experience for both administrators and players.
2025-05-03 19:33:10 -05:00

163 lines
6.6 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<!--
Dynamic Resource Loading
The following script loads CSS and JavaScript files dynamically using the A3API
This approach is used instead of static HTML imports to work with Arma 3's file system
-->
<script>
Promise.all([
// Load CSS file
A3API.RequestFile("z\\forge_client\\addons\\admin\\ui\\_site\\styles.css"),
// Load JavaScript file
A3API.RequestFile("z\\forge_client\\addons\\admin\\ui\\_site\\script.js")
]).then(([css, js]) => {
// Apply CSS
const style = document.createElement('style');
style.textContent = css;
document.head.appendChild(style);
// Load and execute JavaScript
const script = document.createElement('script');
script.text = js;
document.head.appendChild(script);
// Initialize the admin interface
initializeAdmin();
});
</script>
</head>
<body>
<!--
Header Section
Contains the main title and server statistics
-->
<header>
<div class="header-content">
<h1>Admin Panel</h1>
<!-- Server Statistics Display -->
<div class="admin-stats">
<div class="stat-item">
<div class="stat-info">
<span class="stat-label">Online Players</span>
<span class="stat-value" id="playerCount">0</span>
</div>
</div>
<div class="stat-divider"></div>
<div class="stat-item">
<div class="stat-info">
<span class="stat-label">Staff Online</span>
<span class="stat-value" id="staffCount">0</span>
</div>
</div>
</div>
</div>
</header>
<!--
Main Content Area
Contains all admin functionality sections
-->
<main class="container">
<div class="sections-grid">
<!--
Admin Action Sections
Left column with various global admin actions
-->
<div class="action-sections">
<!-- Global Payday Action -->
<div class="admin-section">
<h2>Global Actions</h2>
<div class="form-group">
<label for="paydayAmount">Payday</label>
<p class="payday-description">Players will receive money based on their rank</p>
</div>
<button class="submit-btn" onclick="Payday()">Payday</button>
</div>
<!-- Give All Money Action -->
<div class="admin-section">
<h2>Give All Money</h2>
<div class="form-group">
<label for="giveAllAmount">Amount to Give</label>
<input type="number" id="giveAllAmount" min="0" placeholder="Enter amount to give to all players...">
</div>
<button class="submit-btn" onclick="giveAllMoney()">Give to All</button>
</div>
<!-- Broadcast Message System -->
<div class="admin-section">
<h2>Broadcast Message</h2>
<div class="form-group">
<label for="broadcastMessage">Message</label>
<input type="text" id="broadcastMessage" placeholder="Enter message to broadcast...">
</div>
<button class="submit-btn" onclick="broadcastMessage()">Send to All</button>
</div>
</div>
<!--
Player List Section
Right column showing all players with filtering options
-->
<div class="admin-section player-list-section">
<!-- Search and Filter Controls -->
<div class="search-bar">
<input type="text" id="playerSearch" class="search-input" placeholder="Search players...">
<div class="filter-bar">
<button class="filter-btn active" data-filter="all">All</button>
<button class="filter-btn" data-filter="staff">Staff</button>
<button class="filter-btn" data-filter="blufor">BLUFOR</button>
<button class="filter-btn" data-filter="opfor">OPFOR</button>
<button class="filter-btn" data-filter="independent">Independent</button>
<button class="filter-btn" data-filter="civilian">Civilian</button>
</div>
</div>
<!-- Dynamic Player List Container -->
<div class="player-list" id="playerList">
<!-- Players will be populated dynamically via JavaScript -->
</div>
</div>
</div>
</main>
<!--
Modal Dialogs
Hidden by default, shown when specific actions are triggered
-->
<!-- Message Modal - For sending messages to individual players -->
<div id="messageModal" class="modal">
<div class="modal-content">
<div class="modal-header">
<h2>Send Message</h2>
<button class="close-modal" onclick="closeMessageModal()">&times;</button>
</div>
<div class="form-group">
<label for="messageInput">Message to <span id="messagePlayerName"></span></label>
<input type="text" id="messageInput" placeholder="Enter your message...">
</div>
<button class="submit-btn" onclick="sendPlayerMessage()">Send Message</button>
</div>
</div>
<!-- Money Modal - For modifying player funds -->
<div id="moneyModal" class="modal">
<div class="modal-content">
<div class="modal-header">
<h2>Modify Money</h2>
<button class="close-modal" onclick="closeMoneyModal()">&times;</button>
</div>
<div class="form-group">
<label for="moneyAmount">Amount</label>
<input type="number" id="moneyAmount" placeholder="Enter amount...">
</div>
<div class="player-actions">
<button class="action-btn promote-btn" onclick="giveMoney()">Give Money</button>
<button class="action-btn demote-btn" onclick="takeMoney()">Take Money</button>
</div>
</div>
</div>
</body>
</html>