From 0ef0b82765ae1b9b2d552e0c2f691cba342919c6 Mon Sep 17 00:00:00 2001 From: Enstrayed <48845980+Enstrayed@users.noreply.github.com> Date: Mon, 26 May 2025 01:26:35 -0700 Subject: [PATCH] this codebase is kindof a mess now --- routes/auth.js | 6 +-- routes/helpdesk.js | 8 ++++ website/helpdesk/forms/manifest.json | 10 ++++ website/helpdesk/templates/landing.html | 32 ++----------- website/helpdesk/templates/newticket.html | 56 ++++++++++++++++++++++ website/static/{ => helpdesk}/helpdesk.css | 9 +++- website/static/helpdesk/login.js | 54 +++++++++++++++++++++ 7 files changed, 143 insertions(+), 32 deletions(-) create mode 100644 website/helpdesk/forms/manifest.json create mode 100644 website/helpdesk/templates/newticket.html rename website/static/{ => helpdesk}/helpdesk.css (86%) create mode 100644 website/static/helpdesk/login.js diff --git a/routes/auth.js b/routes/auth.js index ef7cdfb..98ae8c1 100644 --- a/routes/auth.js +++ b/routes/auth.js @@ -43,14 +43,14 @@ app.get("/api/auth/logout", (rreq,rres) => { if (dbRes.count > 0) { rres.send("Success") } else { - rres.status(400).send("Error: Token does not exist.") + rres.status(400).send("Token does not exist.") } }).catch(dbErr => { logRequest(rres,rreq,500,dbErr) - rres.status(500).send("Error: Exception occured while invalidating token, details: "+dbErr) + rres.status(500).send("Exception occured while invalidating token, details: "+dbErr) }) } else { - rres.status(400).send("Error: Missing token or authorization header, you may not be logged in.") + rres.status(400).send("Missing token or authorization header, you may not be logged in.") } }) diff --git a/routes/helpdesk.js b/routes/helpdesk.js index 1c37c4d..d456bb5 100644 --- a/routes/helpdesk.js +++ b/routes/helpdesk.js @@ -8,4 +8,12 @@ app.get("/helpdesk/articles/*", (rreq, rres) => { rres.sendFile(process.cwd()+"/website/helpdesk/kbas/"+rreq.url.replace("/helpdesk/articles/","")) }) +app.get("/helpdesk/ticket/new", (rreq,rres) => { + rres.sendFile(process.cwd()+"/website/helpdesk/templates/newticket.html") +}) + +app.get("/api/helpdesk/forms/*", (rreq, rres) => { + rres.sendFile(process.cwd()+"/website/helpdesk/forms/"+rreq.url.replace("/api/helpdesk/forms/","")) +}) + export { app } \ No newline at end of file diff --git a/website/helpdesk/forms/manifest.json b/website/helpdesk/forms/manifest.json new file mode 100644 index 0000000..9807937 --- /dev/null +++ b/website/helpdesk/forms/manifest.json @@ -0,0 +1,10 @@ +{ + "general_inquiry": "General Inquiry", + "legalrequest": "Legal Request", + "responsibledisclosure": "Responsible Disclosure", + "general_techsupport": "General Technical Support", + "ecls_deleteaccount": "ECLS: Delete Account", + "ecls_passwordreset": "ECLS: Password Reset", + "ecls_personalinfochange": "ECLS: Personal Information Change", + "enstrayedcloud_quotachange": "Enstrayed Cloud: Quota Change" +} \ No newline at end of file diff --git a/website/helpdesk/templates/landing.html b/website/helpdesk/templates/landing.html index 266e752..16ba4b7 100644 --- a/website/helpdesk/templates/landing.html +++ b/website/helpdesk/templates/landing.html @@ -4,30 +4,8 @@