Config page for adding tokens and settings
This commit is contained in:
99
templates/config.html
Normal file
99
templates/config.html
Normal file
@@ -0,0 +1,99 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<title>Configuration - War Dashboard</title>
|
||||
<link rel="stylesheet" href="/static/styles.css" />
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<!-- Navigation Bar -->
|
||||
<div class="top-bar">
|
||||
<h1>Configuration</h1>
|
||||
<div class="top-controls">
|
||||
<a href="/" class="nav-link">Back to Dashboard</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Config Sections -->
|
||||
<div class="config-container">
|
||||
<!-- API Keys Section -->
|
||||
<div class="faction-card small config-section">
|
||||
<h2>API Keys & Tokens</h2>
|
||||
<div class="config-group">
|
||||
<label for="torn-api-key">Torn API Key</label>
|
||||
<p class="config-description">Your Torn API key for fetching faction member data</p>
|
||||
<input type="password" id="torn-api-key" class="config-input" />
|
||||
<button class="config-save-btn" data-key="TORN_API_KEY">Save</button>
|
||||
</div>
|
||||
|
||||
<div class="config-group">
|
||||
<label for="ffscouter-key">FFScouter API Key</label>
|
||||
<p class="config-description">FFScouter API key for enhanced stat estimates</p>
|
||||
<input type="password" id="ffscouter-key" class="config-input" />
|
||||
<button class="config-save-btn" data-key="FFSCOUTER_KEY">Save</button>
|
||||
</div>
|
||||
|
||||
<div class="config-group">
|
||||
<label for="discord-token">Discord Bot Token</label>
|
||||
<p class="config-description">Discord bot token for sending DM notifications</p>
|
||||
<input type="password" id="discord-token" class="config-input" />
|
||||
<button class="config-save-btn" data-key="DISCORD_TOKEN">Save</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Discord Settings Section -->
|
||||
<div class="faction-card small config-section">
|
||||
<h2>Discord Settings</h2>
|
||||
<div class="config-group">
|
||||
<label for="allowed-channel-id">Allowed Channel ID</label>
|
||||
<p class="config-description">Discord channel ID where bot commands are allowed</p>
|
||||
<input type="number" id="allowed-channel-id" class="config-input" />
|
||||
<button class="config-save-btn" data-key="ALLOWED_CHANNEL_ID">Save</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Timing Settings Section -->
|
||||
<div class="faction-card small config-section">
|
||||
<h2>Timing Settings</h2>
|
||||
<div class="config-group">
|
||||
<label for="assignment-timeout">Assignment Timeout (seconds)</label>
|
||||
<p class="config-description">Seconds before reassigning a target to another player</p>
|
||||
<input type="number" id="assignment-timeout" class="config-input" />
|
||||
<button class="config-save-btn" data-key="ASSIGNMENT_TIMEOUT">Save</button>
|
||||
</div>
|
||||
|
||||
<div class="config-group">
|
||||
<label for="assignment-reminder">Assignment Reminder (seconds)</label>
|
||||
<p class="config-description">Seconds before sending a reminder message</p>
|
||||
<input type="number" id="assignment-reminder" class="config-input" />
|
||||
<button class="config-save-btn" data-key="ASSIGNMENT_REMINDER">Save</button>
|
||||
</div>
|
||||
|
||||
<div class="config-group">
|
||||
<label for="poll-interval">Poll Interval (seconds)</label>
|
||||
<p class="config-description">General polling interval for data refresh</p>
|
||||
<input type="number" id="poll-interval" class="config-input" />
|
||||
<button class="config-save-btn" data-key="POLL_INTERVAL">Save</button>
|
||||
</div>
|
||||
|
||||
<div class="config-group">
|
||||
<label for="hit-check-interval">Hit Check Interval (seconds)</label>
|
||||
<p class="config-description">Interval for checking hit completion</p>
|
||||
<input type="number" id="hit-check-interval" class="config-input" />
|
||||
<button class="config-save-btn" data-key="HIT_CHECK_INTERVAL">Save</button>
|
||||
</div>
|
||||
|
||||
<div class="config-group">
|
||||
<label for="reassign-delay">Reassign Delay (seconds)</label>
|
||||
<p class="config-description">Delay before reassigning failed targets</p>
|
||||
<input type="number" id="reassign-delay" class="config-input" />
|
||||
<button class="config-save-btn" data-key="REASSIGN_DELAY">Save</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="/static/config.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -8,18 +8,14 @@
|
||||
<body>
|
||||
<div class="container">
|
||||
|
||||
<!-- Top bar: Title + interval + Reset button -->
|
||||
<!-- Top bar: Title + Reset button -->
|
||||
<div class="top-bar">
|
||||
<h1>War Dashboard</h1>
|
||||
|
||||
<div class="top-controls">
|
||||
<a href="/config" class="nav-link">Settings</a>
|
||||
<button id="bot-control-btn" class="bot-btn" data-running="false">Start Bot</button>
|
||||
<button id="reset-groups-btn" class="reset-btn">Reset Groups</button>
|
||||
|
||||
<div class="interval-box">
|
||||
<label for="refresh-interval">Refresh Interval (seconds)</label>
|
||||
<input type="number" id="refresh-interval" value="10" min="1" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -31,10 +27,16 @@
|
||||
<!-- FRIENDLY -->
|
||||
<div class="faction-card small">
|
||||
<h2>Friendly Faction</h2>
|
||||
<div class="controls">
|
||||
<input type="number" id="friendly-id" placeholder="Faction ID" />
|
||||
<button id="friendly-populate-btn">Populate</button>
|
||||
<button id="friendly-status-btn">Start Refresh</button>
|
||||
<div class="controls-row">
|
||||
<div class="controls">
|
||||
<input type="number" id="friendly-id" placeholder="Faction ID" />
|
||||
<button id="friendly-populate-btn">Populate</button>
|
||||
</div>
|
||||
<div class="status-controls">
|
||||
<label for="friendly-refresh-interval">Status Refresh (seconds):</label>
|
||||
<input type="number" id="friendly-refresh-interval" value="10" min="1" />
|
||||
<button id="friendly-status-btn" class="status-btn" data-running="false">Start</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="friendly-container"
|
||||
@@ -45,10 +47,16 @@
|
||||
<!-- ENEMY -->
|
||||
<div class="faction-card small">
|
||||
<h2>Enemy Faction</h2>
|
||||
<div class="controls">
|
||||
<input type="number" id="enemy-id" placeholder="Faction ID" />
|
||||
<button id="enemy-populate-btn">Populate</button>
|
||||
<button id="enemy-status-btn">Start Refresh</button>
|
||||
<div class="controls-row">
|
||||
<div class="controls">
|
||||
<input type="number" id="enemy-id" placeholder="Faction ID" />
|
||||
<button id="enemy-populate-btn">Populate</button>
|
||||
</div>
|
||||
<div class="status-controls">
|
||||
<label for="enemy-refresh-interval">Status Refresh (seconds):</label>
|
||||
<input type="number" id="enemy-refresh-interval" value="10" min="1" />
|
||||
<button id="enemy-status-btn" class="status-btn" data-running="false">Start</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="enemy-container"
|
||||
|
||||
Reference in New Issue
Block a user