From 7e55c120b109d9f643ccb0b5a7a53320855e418d Mon Sep 17 00:00:00 2001 From: Logan Cusano Date: Mon, 26 May 2025 01:21:37 -0400 Subject: [PATCH] Improved UI for clients and ensured function of all current APIs --- src/components/BotsManagement.tsx | 8 +- src/components/IndividualClientPage.tsx | 138 ++++++++++++++++++++++-- 2 files changed, 135 insertions(+), 11 deletions(-) diff --git a/src/components/BotsManagement.tsx b/src/components/BotsManagement.tsx index 5e0b10f..ad7cf55 100644 --- a/src/components/BotsManagement.tsx +++ b/src/components/BotsManagement.tsx @@ -113,7 +113,7 @@ const BotsManagement: React.FC = ({ token }) => { guild_ids: newIdData.guild_ids.split(',').map(id => id.trim()).filter(id => id), }; const method = editingId ? 'PUT' : 'POST'; - const url = editingId ? `${API_BASE_URL}/discord_ids/${editingId._id}` : `${API_BASE_URL}/discord_ids/`; + const url = editingId ? `${API_BASE_URL}/bots/token/${editingId._id}` : `${API_BASE_URL}/bots/token`; const response = await fetch(url, { method, @@ -147,7 +147,7 @@ const BotsManagement: React.FC = ({ token }) => { if (!window.confirm('Are you sure you want to delete this Discord ID?')) return; setError(''); try { - const response = await fetch(`${API_BASE_URL}/discord_ids/${id}`, { + const response = await fetch(`${API_BASE_URL}/bots/token/${id}`, { method: 'DELETE', headers: { Authorization: `Bearer ${token}` }, }); @@ -274,7 +274,7 @@ const BotsManagement: React.FC = ({ token }) => { {dId.discord_id} {dId.token ? dId.token.substring(0, 8) + '...' : 'N/A'} {dId.active ? 'Yes' : 'No'} - {dId.guild_ids.join(', ')} + {dId.guild_ids?.join(', ')}

Current OP25 Status: {currentClientOp25Status}

@@ -214,6 +270,74 @@ const IndividualClientPage: React.FC = ({ clientId, t + + {/* Join Discord Dialog */} + + + + Join Discord Server + +
+
+ + setDiscordServerId(e.target.value)} + className="col-span-3" + placeholder="Enter Discord Server ID" + /> +
+
+ + setDiscordChannelId(e.target.value)} + className="col-span-3" + placeholder="Enter Discord Channel ID" + /> +
+
+ + + + +
+
+ + {/* Leave Discord Dialog */} + + + + Leave Discord Server + +
+
+ + setLeaveGuildId(e.target.value)} + className="col-span-3" + placeholder="Enter Discord Guild ID to Leave" + /> +
+
+ + + + +
+
); };