From 1c3427e63fe90e1ef8ba34aaf238a58839d3b903 Mon Sep 17 00:00:00 2001 From: Nathan Date: Fri, 16 May 2025 00:23:09 -0700 Subject: [PATCH] groundwork for helpdesk stuff --- routes/auth.js | 2 +- routes/helpdesk.js | 11 +++ .../helpdesk/forms/ecls_deleteaccount.json | 14 +++ website/helpdesk/kbas/example.html | 11 +++ website/helpdesk/templates/landing.html | 96 +++++++++++++++++++ website/static/helpdesk.css | 78 +++++++++++++++ website/static/icons/arrow-right.svg | 3 + 7 files changed, 214 insertions(+), 1 deletion(-) create mode 100644 routes/helpdesk.js create mode 100644 website/helpdesk/forms/ecls_deleteaccount.json create mode 100644 website/helpdesk/kbas/example.html create mode 100644 website/helpdesk/templates/landing.html create mode 100644 website/static/helpdesk.css create mode 100644 website/static/icons/arrow-right.svg diff --git a/routes/auth.js b/routes/auth.js index 7178d09..ef7cdfb 100644 --- a/routes/auth.js +++ b/routes/auth.js @@ -5,7 +5,7 @@ import { randomStringBase62, getHumanReadableUserAgent } from "../liberals/misc. app.get("/api/auth/whoami", (rreq,rres) => { if (!rreq.cookies["APIToken"] && !rreq.get("Authorization")) { - rres.status(400).send({ "loggedIn": false, "username": "", "scopes": "" }) + rres.send({ "loggedIn": false, "username": "", "scopes": "" }) } else { db`select s.scopes, u.username from sessions s join users u on s.owner = u.id where s.token = ${rreq.cookies["APIToken"] ?? rreq.get("Authorization")}`.then(dbRes => { if (dbRes.length > 0 && dbRes.length < 2) { diff --git a/routes/helpdesk.js b/routes/helpdesk.js new file mode 100644 index 0000000..1c37c4d --- /dev/null +++ b/routes/helpdesk.js @@ -0,0 +1,11 @@ +import { app } from "../index.js" + +app.get("/helpdesk", (rreq, rres) => { + rres.sendFile(process.cwd()+"/website/helpdesk/templates/landing.html") +}) + +app.get("/helpdesk/articles/*", (rreq, rres) => { + rres.sendFile(process.cwd()+"/website/helpdesk/kbas/"+rreq.url.replace("/helpdesk/articles/","")) +}) + +export { app } \ No newline at end of file diff --git a/website/helpdesk/forms/ecls_deleteaccount.json b/website/helpdesk/forms/ecls_deleteaccount.json new file mode 100644 index 0000000..255b9fc --- /dev/null +++ b/website/helpdesk/forms/ecls_deleteaccount.json @@ -0,0 +1,14 @@ +{ + "title": "ECLS: Delete Account", + "form": { + "description": { + "type": "span", + "content": "" + }, + "confirmation": { + "type": "checkbox", + "content": "I have read all of the above and understand this action is irreverisble", + "required": true + } + } +} \ No newline at end of file diff --git a/website/helpdesk/kbas/example.html b/website/helpdesk/kbas/example.html new file mode 100644 index 0000000..cb8bc22 --- /dev/null +++ b/website/helpdesk/kbas/example.html @@ -0,0 +1,11 @@ + + + + + + Document + + +

example article

+ + \ No newline at end of file diff --git a/website/helpdesk/templates/landing.html b/website/helpdesk/templates/landing.html new file mode 100644 index 0000000..266e752 --- /dev/null +++ b/website/helpdesk/templates/landing.html @@ -0,0 +1,96 @@ + + + + + + Enstrayed Helpdesk + + + + + +
+

Enstrayed Helpdesk

+ Open Ticket + Knowledgebase + +
+ +
+
+
+
+
+

How can I help you?

+
+
+ I'm filing a legal request, such as a DMCA takedown or other legal matter
+ Click here to start a Legal Request +
+
+ I'm responsibly disclosing a problem, such a security vulnerability
+ Click here to start a Responsible Disclosure +
+ +
+ I have another question or need to get in contact
+ Click here to start a General Inquiry +
+
+
+
+

Popular Articles

+
+
+ How do I use Security Keys in ECLS?
+ Important ECLS FIDO2/Webauthn/Passkey Information +
+
+ How do I login to Jellyfin?
+ Logging into Jellyfin +
+
+ How do I change my ECLS password?
+ Change ECLS Password +
+
+ How do I use federation features in Enstrayed Cloud?
+ Enstrayed Cloud Federation Features +
+
+
+
+
+ +

Warning

+

This is a warning

+ +
+ + \ No newline at end of file diff --git a/website/static/helpdesk.css b/website/static/helpdesk.css new file mode 100644 index 0000000..19426fd --- /dev/null +++ b/website/static/helpdesk.css @@ -0,0 +1,78 @@ +html { + font-family: 'Segoe UI Variable', sans-serif; + + background-color: #282828; +} + +body { + margin: 0; + display: grid; + grid-template-rows: auto 1fr; + grid-template-columns: 1fr; + height: 100vh; +} + +.headerbar { + background-color: #fff; + padding: 0 2em 0 2em; + display: flex; + flex-direction: row; + gap: 2em; + align-items: center; +} + + +.headerbarright { + margin-left: auto; +} + +.maincontent { + display: grid; + place-items: center; +} + +.cardrow { + display: flex; + flex-direction: row; + gap: 2em; +} + +.cardrow > div { + background-color: #fff; + padding: 2em; +} + +.cardrow > div > h1 { + margin: 0 0 0.5em 0; +} + +.linkColumn { + display: flex; + flex-direction: column; + gap: 0.5em; +} + +a, a:link { + color: #366FFF; +} + +a > img { + margin-right: 0.2em; +} + +dialog { + padding: 2em; + border: none; +} + +dialog > h2 { + margin: 0 0 0.5em 0; +} + +dialog > button { + float: right; +} + +dialog::backdrop { + background-color: rgba(0, 0, 0, 0.5); +} \ No newline at end of file diff --git a/website/static/icons/arrow-right.svg b/website/static/icons/arrow-right.svg new file mode 100644 index 0000000..1094594 --- /dev/null +++ b/website/static/icons/arrow-right.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file