From c8b7c1d90972b365e8ce7a0e341c49ea5937724c Mon Sep 17 00:00:00 2001 From: JustTemmie <47639983+JustTemmie@users.noreply.github.com> Date: Fri, 4 Jul 2025 13:05:09 +0200 Subject: [PATCH 1/6] feat: add links, build time, and git hash to settings menu --- app.config.ts | 5 +++++ pages/settings.vue | 34 ++++++++++++++++++++++++++++++---- 2 files changed, 35 insertions(+), 4 deletions(-) create mode 100644 app.config.ts diff --git a/app.config.ts b/app.config.ts new file mode 100644 index 0000000..b547927 --- /dev/null +++ b/app.config.ts @@ -0,0 +1,5 @@ +export default defineAppConfig({ + title: "Gorb", + buildTimeString: new Date().toISOString(), + gitHash: process.env.COMMIT_REF || "N/A" +}) diff --git a/pages/settings.vue b/pages/settings.vue index 991d046..b078aa1 100644 --- a/pages/settings.vue +++ b/pages/settings.vue @@ -2,8 +2,8 @@
@@ -29,6 +44,8 @@ import Button from '~/components/Button.vue'; const { logout } = useAuth() +const appConfig = useAppConfig() + interface Page { displayName: string; pageData: any; // is actually Component but TS is yelling at me :( @@ -49,6 +66,7 @@ import Appearance from '~/components/Settings/AppSettings/Appearance.vue'; import Notifications from '~/components/Settings/AppSettings/Notifications.vue'; import Keybinds from '~/components/Settings/AppSettings/Keybinds.vue'; import Language from '~/components/Settings/AppSettings/Language.vue'; +import { WINDOW } from 'cropperjs'; const settingsCategories = { userSettings: { @@ -103,7 +121,7 @@ function selectCategory(page: Page) { background-color: var(--sidebar-background-color); color: var(--text-color); padding: 1dvh 1dvw; - margin-left: auto; + margin-left: 0; overflow-y: auto; height: 100vh; @@ -128,6 +146,10 @@ function selectCategory(page: Page) { transition: background-color 0.3s; } +#sidebar p { + margin: 2dvh 0.8dvw; +} + .sidebar-focus { background-color: var(--sidebar-highlighted-background-color); } @@ -147,11 +169,15 @@ function selectCategory(page: Page) { height: 100vh; } +#links-and-socials * { + margin-right: 0.2em; +} + .spacer { height: 0.2dvh; display: block; margin: 0.8dvh 1dvw; - background-color: var(--spacing-color); + background-color: var(--padding-color); } /* applies to child pages too */ From 0f11e4e54536c9730acb13eba7fbe16c80109d64 Mon Sep 17 00:00:00 2001 From: SauceyRed Date: Sat, 5 Jul 2025 01:10:36 +0200 Subject: [PATCH 2/6] feat: update message sending to use JSON to match backend change --- components/MessageArea.vue | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/components/MessageArea.vue b/components/MessageArea.vue index 7612243..18b9ac5 100644 --- a/components/MessageArea.vue +++ b/components/MessageArea.vue @@ -158,10 +158,12 @@ if (accessToken && apiBase) { function sendMessage(e: Event) { e.preventDefault(); - const text = messageInput.value; - console.log("text:", text); - if (text) { - ws.send(text); + const message = { + message: messageInput.value + } + console.log("message:", message); + if (message.message) { + ws.send(JSON.stringify(message)); messageInput.value = ""; console.log("MESSAGE SENT!!!"); } From 059282706b6c395339c568fc18d72a4329bf4b0a Mon Sep 17 00:00:00 2001 From: JustTemmie <47639983+JustTemmie@users.noreply.github.com> Date: Sat, 5 Jul 2025 01:27:04 +0200 Subject: [PATCH 3/6] fix: remove random accidental import, fix build system --- app.config.ts | 2 +- pages/settings.vue | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/app.config.ts b/app.config.ts index b547927..11f7f7c 100644 --- a/app.config.ts +++ b/app.config.ts @@ -1,5 +1,5 @@ export default defineAppConfig({ title: "Gorb", buildTimeString: new Date().toISOString(), - gitHash: process.env.COMMIT_REF || "N/A" + gitHash: process.env.GIT_SHORT_REV || "N/A" }) diff --git a/pages/settings.vue b/pages/settings.vue index b078aa1..cc694a9 100644 --- a/pages/settings.vue +++ b/pages/settings.vue @@ -66,7 +66,6 @@ import Appearance from '~/components/Settings/AppSettings/Appearance.vue'; import Notifications from '~/components/Settings/AppSettings/Notifications.vue'; import Keybinds from '~/components/Settings/AppSettings/Keybinds.vue'; import Language from '~/components/Settings/AppSettings/Language.vue'; -import { WINDOW } from 'cropperjs'; const settingsCategories = { userSettings: { From aa335b086a74536403642baebce7c060360fe1b0 Mon Sep 17 00:00:00 2001 From: SauceyRed Date: Sat, 5 Jul 2025 02:38:23 +0200 Subject: [PATCH 4/6] feat: use logout endpoint for logout and move old logic to revoke in auth --- composables/auth.ts | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/composables/auth.ts b/composables/auth.ts index 0ac2e8b..b23a67b 100644 --- a/composables/auth.ts +++ b/composables/auth.ts @@ -37,13 +37,19 @@ export const useAuth = () => { //await fetchUser(); } - async function logout(password: string) { - console.log("password:", password); + async function logout() { console.log("access:", accessToken.value); - const hashedPass = await hashPassword(password); - console.log("hashed"); - const res = await fetchWithApi("/auth/revoke", { + await fetchWithApi("/auth/logout", { method: "GET", credentials: "include" }); + clearAuth(); + + return await navigateTo("/login"); + } + + async function revoke(password: string) { + const hashedPass = await hashPassword(password); + + await fetchWithApi("/auth/revoke", { method: "POST", body: { @@ -54,10 +60,6 @@ export const useAuth = () => { clearAuth(); } - async function revoke() { - clearAuth(); - } - async function refresh() { console.log("refreshing"); const res = await fetchWithApi("/auth/refresh", { From c1021b11922a423bb233fef5e18ed38a8e5d100f Mon Sep 17 00:00:00 2001 From: JustTemmie <47639983+JustTemmie@users.noreply.github.com> Date: Sat, 5 Jul 2025 15:24:09 +0200 Subject: [PATCH 5/6] fix: fix build time and version hash being evaluated at runtime --- app.config.ts | 5 ----- nuxt.config.ts | 4 +++- pages/settings.vue | 6 +++--- 3 files changed, 6 insertions(+), 9 deletions(-) delete mode 100644 app.config.ts diff --git a/app.config.ts b/app.config.ts deleted file mode 100644 index 11f7f7c..0000000 --- a/app.config.ts +++ /dev/null @@ -1,5 +0,0 @@ -export default defineAppConfig({ - title: "Gorb", - buildTimeString: new Date().toISOString(), - gitHash: process.env.GIT_SHORT_REV || "N/A" -}) diff --git a/nuxt.config.ts b/nuxt.config.ts index 63d9372..05a40fa 100644 --- a/nuxt.config.ts +++ b/nuxt.config.ts @@ -27,7 +27,9 @@ export default defineNuxtConfig({ runtimeConfig: { public: { apiVersion: 1, - messageGroupingMaxDifference: 300000 + messageGroupingMaxDifference: 300000, + buildTimeString: new Date().toISOString(), + gitHash: process.env.GIT_SHORT_REV || "N/A", } }, /* nitro: { diff --git a/pages/settings.vue b/pages/settings.vue index cc694a9..bd1a484 100644 --- a/pages/settings.vue +++ b/pages/settings.vue @@ -24,9 +24,9 @@

- Version Hash: {{ appConfig.gitHash }} + Version Hash: {{ appConfig.public.gitHash }}
- Build Time: {{ appConfig.buildTimeString }} + Build Time: {{ appConfig.public.buildTimeString }}

@@ -44,7 +44,7 @@ import Button from '~/components/Button.vue'; const { logout } = useAuth() -const appConfig = useAppConfig() +const appConfig = useRuntimeConfig() interface Page { displayName: string; From 9f1232a6685f766b799effd45ef272bbe5dda9f2 Mon Sep 17 00:00:00 2001 From: JustTemmie <47639983+JustTemmie@users.noreply.github.com> Date: Sat, 5 Jul 2025 15:38:00 +0200 Subject: [PATCH 6/6] fix: ensure memberlist isn't taller than the screen i'm not sure why you need to set a max height, this isn't really a great soulution to the problem either, but we need *something* right now --- pages/servers/[serverId]/channels/[channelId].vue | 1 + 1 file changed, 1 insertion(+) diff --git a/pages/servers/[serverId]/channels/[channelId].vue b/pages/servers/[serverId]/channels/[channelId].vue index 699b9a3..01e89f0 100644 --- a/pages/servers/[serverId]/channels/[channelId].vue +++ b/pages/servers/[serverId]/channels/[channelId].vue @@ -100,6 +100,7 @@ function handleMemberClick(member: GuildMemberResponse) { display: flex; flex-direction: column; overflow-y: scroll; + max-height: 92dvh; padding-left: 1dvw; padding-right: 1dvw; margin-top: 1dvh;