diff --git a/Webserver/src/routes/admin/+page.svelte b/Webserver/src/routes/admin/+page.svelte
index cfb22e8..3352d1c 100644
--- a/Webserver/src/routes/admin/+page.svelte
+++ b/Webserver/src/routes/admin/+page.svelte
@@ -1,34 +1,47 @@
+
Matrix Control Panel
+
+
+
{#each matrix as row}
@@ -475,6 +569,7 @@
{/each}
+
{
+ // Get endpoint on main API from searchparams
const params = url.searchParams;
const endpoint = params.get('endpoint');
+ // Return if param not found
if (endpoint === null) return json({ success: false } as APIResponse);
+ // Call API and respond with new data
const api_call = await fetch(`http://localhost:8080/${endpoint}`);
const data = await api_call.json() as APIResponse;
return json(data);
};
+// POST Endpoint for redirection API
export const POST: RequestHandler = async ({ request }) => {
+ // Get data from form
const formData = await request.formData();
const endpoint = formData.get('endpoint');
+ // Return if endpoint not found
if (endpoint === null) return json({ success: false } as APIResponse);
+ // Remove endpoint to save on datatransfer
formData.delete('endpoint');
+ // Call API and respond with new data
const api_call = await fetch(`http://localhost:8080/${endpoint}`, {
method: 'POST',
mode: 'cors',