From cbb76195521c93d65183fca50d2ff5a29fd50901 Mon Sep 17 00:00:00 2001 From: sirpiglr <49359077-sirpiglr@users.noreply.replit.com> Date: Tue, 9 Dec 2025 03:04:32 +0000 Subject: [PATCH] Add new admin pages and update XP configuration endpoint Introduces new API endpoints for XP configuration and quests, along with frontend updates in dashboard.html for styling and field name consistency. Replit-Commit-Author: Agent Replit-Commit-Session-Id: aed2e46d-25bb-4b73-81a1-bb9e8437c261 Replit-Commit-Checkpoint-Type: intermediate_checkpoint Replit-Commit-Event-Id: 4b20cda7-6144-4154-8c0b-880fe406cb59 Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/3bdfff67-975a-46ad-9845-fbb6b4a4c4b5/aed2e46d-25bb-4b73-81a1-bb9e8437c261/xfdSNeM Replit-Helium-Checkpoint-Created: true --- .replit | 4 + aethex-bot/public/dashboard.html | 1113 +++++++++++++++++++++++++++++- aethex-bot/server/webServer.js | 544 +++++++++++++++ 3 files changed, 1645 insertions(+), 16 deletions(-) diff --git a/.replit b/.replit index 791541a..e15a60d 100644 --- a/.replit +++ b/.replit @@ -21,6 +21,10 @@ externalPort = 80 localPort = 8080 externalPort = 8080 +[[ports]] +localPort = 36555 +externalPort = 3000 + [workflows] runButton = "Project" diff --git a/aethex-bot/public/dashboard.html b/aethex-bot/public/dashboard.html index d11ed13..8e6de43 100644 --- a/aethex-bot/public/dashboard.html +++ b/aethex-bot/public/dashboard.html @@ -25,10 +25,238 @@ --neon-purple: hsl(270, 100%, 70%); --success: hsl(142, 76%, 36%); --warning: hsl(38, 92%, 50%); + --danger: hsl(0, 72%, 51%); } * { margin: 0; padding: 0; box-sizing: border-box; } + .admin-form { margin-bottom: 2rem; } + + .form-grid { + display: grid; + grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); + gap: 1.5rem; + } + + .form-group { + display: flex; + flex-direction: column; + gap: 0.5rem; + } + + .form-group label { + font-size: 0.875rem; + font-weight: 500; + color: var(--foreground); + } + + .form-input { + padding: 0.75rem 1rem; + background: var(--secondary); + border: 1px solid var(--border); + border-radius: 8px; + color: var(--foreground); + font-family: inherit; + font-size: 0.875rem; + transition: border-color 0.2s, box-shadow 0.2s; + } + + .form-input:focus { + outline: none; + border-color: var(--aethex-500); + box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2); + } + + .form-input::placeholder { + color: var(--muted-foreground); + } + + .form-hint { + font-size: 0.75rem; + color: var(--muted-foreground); + } + + .form-toggle { + display: flex; + align-items: center; + gap: 0.75rem; + cursor: pointer; + user-select: none; + } + + .form-toggle input { + display: none; + } + + .toggle-slider { + width: 44px; + height: 24px; + background: var(--secondary); + border: 1px solid var(--border); + border-radius: 12px; + position: relative; + transition: all 0.2s; + } + + .toggle-slider::before { + content: ''; + position: absolute; + top: 2px; + left: 2px; + width: 18px; + height: 18px; + background: var(--muted-foreground); + border-radius: 50%; + transition: all 0.2s; + } + + .form-toggle input:checked + .toggle-slider { + background: var(--aethex-500); + border-color: var(--aethex-500); + } + + .form-toggle input:checked + .toggle-slider::before { + left: 22px; + background: white; + } + + .toggle-label { + font-size: 0.875rem; + } + + .form-actions { + display: flex; + gap: 1rem; + margin-top: 1.5rem; + justify-content: flex-end; + } + + .save-status { + margin-top: 1rem; + padding: 0.75rem 1rem; + border-radius: 8px; + font-size: 0.875rem; + } + + .save-status.success { + background: rgba(34, 197, 94, 0.1); + border: 1px solid var(--success); + color: var(--success); + } + + .save-status.error { + background: rgba(239, 68, 68, 0.1); + border: 1px solid var(--danger); + color: var(--danger); + } + + textarea.form-input { + min-height: 100px; + resize: vertical; + } + + .item-list { + display: flex; + flex-direction: column; + gap: 0.75rem; + } + + .item-row { + display: flex; + align-items: center; + gap: 1rem; + padding: 1rem; + background: var(--secondary); + border-radius: 10px; + transition: all 0.2s; + } + + .item-row:hover { + background: var(--card-hover); + } + + .item-info { + flex: 1; + min-width: 0; + } + + .item-name { + font-weight: 600; + margin-bottom: 0.25rem; + } + + .item-desc { + font-size: 0.875rem; + color: var(--muted-foreground); + } + + .item-actions { + display: flex; + gap: 0.5rem; + } + + .btn-icon { + padding: 0.5rem; + background: transparent; + border: 1px solid var(--border); + border-radius: 6px; + color: var(--muted-foreground); + cursor: pointer; + transition: all 0.2s; + } + + .btn-icon:hover { + background: var(--secondary); + color: var(--foreground); + } + + .btn-icon.danger:hover { + background: rgba(239, 68, 68, 0.1); + border-color: var(--danger); + color: var(--danger); + } + + .modal { + position: fixed; + inset: 0; + background: rgba(0, 0, 0, 0.8); + display: flex; + align-items: center; + justify-content: center; + z-index: 1000; + padding: 1rem; + } + + .modal-content { + background: var(--card); + border: 1px solid var(--border); + border-radius: 16px; + max-width: 600px; + width: 100%; + max-height: 90vh; + overflow-y: auto; + } + + .modal-header { + padding: 1.25rem 1.5rem; + border-bottom: 1px solid var(--border); + display: flex; + justify-content: space-between; + align-items: center; + } + + .modal-body { + padding: 1.5rem; + } + + .modal-footer { + padding: 1rem 1.5rem; + border-top: 1px solid var(--border); + display: flex; + justify-content: flex-end; + gap: 0.75rem; + } + body { font-family: 'Fira Code', 'Source Code Pro', monospace; background: var(--background); @@ -766,47 +994,412 @@

XP Settings

Configure XP earning for your server

-
-
-

Use /xp-settings in Discord to configure XP settings. Web-based configuration coming soon!

+ +
+
+
+

Message XP

+
+
+
+
+ + + Minimum XP earned per message +
+
+ + + Maximum XP earned per message +
+
+ + + Time between earning XP from messages +
+
+
-
+ +
+
+

Other XP Sources

+
+
+
+
+ + + XP earned when someone reacts to your message +
+
+ + + XP earned per minute in voice channels +
+
+ + + XP from daily claim command +
+
+
+
+ +
+
+

Level-Up Settings

+
+
+
+
+ + + Higher = slower leveling (formula: level = sqrt(xp/base)) +
+
+ + + Where to announce level-ups +
+
+ +
+
+ +
+
+
+
+ +
+
+

XP Multipliers

+
+
+
+
+ + + Multiplies all XP earned (1.0 = normal) +
+
+ + + Extra multiplier on weekends +
+
+
+
+ +
+ + +
+ + +