Compare commits

..

No commits in common. "825cf2ba52dbe8c30d5337bf95314e5838497fed" and "e9717b137eb92a504da05f70e942f2c9c44aa72e" have entirely different histories.

7 changed files with 29 additions and 57 deletions

View file

@ -1,14 +1,15 @@
<template> <template>
<div id="fullscreen-container"> <div id="fullscreen-container">
<div id="crop-preview"> <div id="crop-preview">
<img ref="image" :src="imageSrc" style="min-height: 35dvh;"> <img ref="image" :src="imageSrc" style="min-height: 500px;">
<Button text="Crop" :callback="cropImage"></Button> <Button class="button" text="Crop" :callback="cropImage"></Button>
<Button text="Cancel" :callback="closePopup"></Button> <Button class="button" text="Cancel" :callback="closePopup"></Button>
</div> </div>
</div> </div>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { ref, watch } from 'vue';
import Cropper from 'cropperjs'; import Cropper from 'cropperjs';
const props = defineProps({ const props = defineProps({
@ -81,7 +82,7 @@ function closePopup() {
width: 100%; width: 100%;
height: 100%; height: 100%;
z-index: 10; z-index: 10;
background: rgba(0, 0, 0, 0.5); background: rgba(0,0,0,0.5);
} }
#crop-preview { #crop-preview {

View file

@ -158,12 +158,10 @@ if (accessToken && apiBase) {
function sendMessage(e: Event) { function sendMessage(e: Event) {
e.preventDefault(); e.preventDefault();
const message = { const text = messageInput.value;
message: messageInput.value console.log("text:", text);
} if (text) {
console.log("message:", message); ws.send(text);
if (message.message) {
ws.send(JSON.stringify(message));
messageInput.value = ""; messageInput.value = "";
console.log("MESSAGE SENT!!!"); console.log("MESSAGE SENT!!!");
} }

View file

@ -33,19 +33,22 @@
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import Button from '~/components/Button.vue';
import CropPopup from '~/components/CropPopup.vue';
import type { UserResponse } from '~/types/interfaces'; import type { UserResponse } from '~/types/interfaces';
let newPfpFile: File;
const isCropPopupVisible = ref(false);
const cropImageSrc = ref("")
;
const { fetchUser } = useAuth(); const { fetchUser } = useAuth();
const user: UserResponse | undefined = await fetchUser() const user: UserResponse | undefined = await fetchUser()
if (!user) { if (!user) {
alert("could not fetch user info, aborting :(") alert("could not fetch user info, aborting :(")
} }
let newPfpFile: File;
const isCropPopupVisible = ref(false);
const cropImageSrc = ref('');
async function saveChanges() { async function saveChanges() {
if (!user) return; if (!user) return;

View file

@ -37,19 +37,13 @@ export const useAuth = () => {
//await fetchUser(); //await fetchUser();
} }
async function logout() { async function logout(password: string) {
console.log("password:", password);
console.log("access:", accessToken.value); console.log("access:", accessToken.value);
await fetchWithApi("/auth/logout", { method: "GET", credentials: "include" });
clearAuth();
return await navigateTo("/login");
}
async function revoke(password: string) {
const hashedPass = await hashPassword(password); const hashedPass = await hashPassword(password);
console.log("hashed");
await fetchWithApi("/auth/revoke", { const res = await fetchWithApi("/auth/revoke", {
method: "POST", method: "POST",
body: body:
{ {
@ -60,6 +54,10 @@ export const useAuth = () => {
clearAuth(); clearAuth();
} }
async function revoke() {
clearAuth();
}
async function refresh() { async function refresh() {
console.log("refreshing"); console.log("refreshing");
const res = await fetchWithApi("/auth/refresh", { const res = await fetchWithApi("/auth/refresh", {

View file

@ -27,9 +27,7 @@ export default defineNuxtConfig({
runtimeConfig: { runtimeConfig: {
public: { public: {
apiVersion: 1, apiVersion: 1,
messageGroupingMaxDifference: 300000, messageGroupingMaxDifference: 300000
buildTimeString: new Date().toISOString(),
gitHash: process.env.GIT_SHORT_REV || "N/A",
} }
}, },
/* nitro: { /* nitro: {

View file

@ -100,7 +100,6 @@ function handleMemberClick(member: GuildMemberResponse) {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
overflow-y: scroll; overflow-y: scroll;
max-height: 92dvh;
padding-left: 1dvw; padding-left: 1dvw;
padding-right: 1dvw; padding-right: 1dvw;
margin-top: 1dvh; margin-top: 1dvh;

View file

@ -2,8 +2,8 @@
<div id="settings-page-container"> <div id="settings-page-container">
<div id="settings-page"> <div id="settings-page">
<div id="sidebar"> <div id="sidebar">
<h4>(Search bar here)</h4>
<ul> <ul>
<!-- categories and dynamic settings pages -->
<div v-for="category in categories" :key="category.displayName"> <div v-for="category in categories" :key="category.displayName">
<h2>{{ category.displayName }}</h2> <h2>{{ category.displayName }}</h2>
<li v-for="page in category.pages" :key="page.displayName" @click="selectCategory(page)" <li v-for="page in category.pages" :key="page.displayName" @click="selectCategory(page)"
@ -13,22 +13,7 @@
<span class="spacer"></span> <span class="spacer"></span>
</div> </div>
<p>
<Button text="Log Out" :callback=logout variant="scary"></Button> <Button text="Log Out" :callback=logout variant="scary"></Button>
</p>
<span class="spacer"></span>
<p id="links-and-socials">
<NuxtLink href="https://git.gorb.app/gorb/frontend" title="Source"><Icon name="lucide:git-branch-plus" /></NuxtLink>
<NuxtLink href="https://docs.gorb.app" title="Backend Documentation"><Icon name="lucide:book-open-text" /></NuxtLink>
</p>
<p style="font-size: .8em; color: var(--secondary-text-color)">
Version Hash: {{ appConfig.public.gitHash }}
<br>
Build Time: {{ appConfig.public.buildTimeString }}
</p>
</ul> </ul>
</div> </div>
<div id="sub-page"> <div id="sub-page">
@ -44,8 +29,6 @@ import Button from '~/components/Button.vue';
const { logout } = useAuth() const { logout } = useAuth()
const appConfig = useRuntimeConfig()
interface Page { interface Page {
displayName: string; displayName: string;
pageData: any; // is actually Component but TS is yelling at me :( pageData: any; // is actually Component but TS is yelling at me :(
@ -120,7 +103,7 @@ function selectCategory(page: Page) {
background-color: var(--sidebar-background-color); background-color: var(--sidebar-background-color);
color: var(--text-color); color: var(--text-color);
padding: 1dvh 1dvw; padding: 1dvh 1dvw;
margin-left: 0; margin-left: auto;
overflow-y: auto; overflow-y: auto;
height: 100vh; height: 100vh;
@ -145,10 +128,6 @@ function selectCategory(page: Page) {
transition: background-color 0.3s; transition: background-color 0.3s;
} }
#sidebar p {
margin: 2dvh 0.8dvw;
}
.sidebar-focus { .sidebar-focus {
background-color: var(--sidebar-highlighted-background-color); background-color: var(--sidebar-highlighted-background-color);
} }
@ -168,15 +147,11 @@ function selectCategory(page: Page) {
height: 100vh; height: 100vh;
} }
#links-and-socials * {
margin-right: 0.2em;
}
.spacer { .spacer {
height: 0.2dvh; height: 0.2dvh;
display: block; display: block;
margin: 0.8dvh 1dvw; margin: 0.8dvh 1dvw;
background-color: var(--padding-color); background-color: var(--spacing-color);
} }
/* applies to child pages too */ /* applies to child pages too */