big bug fixes
This commit is contained in:
@@ -61,4 +61,31 @@ html, body {
|
||||
|
||||
*:focus-visible {
|
||||
outline: none;
|
||||
}
|
||||
|
||||
/* input */
|
||||
input:not([type="checkbox"], [type="radio"], [type="range"], [type="file"], [type="submit"], [type="reset"], [type="button"]),
|
||||
textarea {
|
||||
padding: 0.5rem 1rem 0.5rem 1rem;
|
||||
resize: none;
|
||||
background-color: rgb(var(--color-overlay));
|
||||
border-radius: 0.375rem;
|
||||
border-width: 1px;
|
||||
transition: border-color 150ms cubic-bezier(0.4, 0, 0.2, 1);
|
||||
max-width: 16rem;
|
||||
}
|
||||
|
||||
input:not([type="checkbox"], [type="radio"], [type="range"], [type="file"], [type="submit"], [type="reset"], [type="button"]):hover,
|
||||
textarea:hover {
|
||||
border-color: rgb(var(--color-muted) / 0.4);
|
||||
}
|
||||
|
||||
input:not([type="checkbox"], [type="radio"], [type="range"], [type="file"], [type="submit"], [type="reset"], [type="button"]):focus,
|
||||
textarea:focus {
|
||||
border-color: rgb(var(--color-muted) / 0.6);
|
||||
}
|
||||
|
||||
::placeholder {
|
||||
font-style: italic;
|
||||
color: rgb(var(--color-subtle));
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
<script setup>
|
||||
const props = defineProps({
|
||||
placeholder: String,
|
||||
type: String | undefined,
|
||||
})
|
||||
const emit = defineEmits(['update:modelValue'])
|
||||
|
||||
function updateValue(value) {
|
||||
emit('update:modelValue', value)
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<input
|
||||
class="py-2 px-4 resize-none bg-overlay rounded-md border hover:border-muted/40 focus:border-muted/60 placeholder:italic placeholder:text-subtle transition-[border-color] max-w-64"
|
||||
:placeholder="placeholder" :type="type" v-on:input="updateValue($event.target.value)" />
|
||||
</template>
|
||||
@@ -2,10 +2,6 @@
|
||||
import { useUser } from '~/composables/useUser'
|
||||
const { getUser } = useUser()
|
||||
|
||||
definePageMeta({
|
||||
middleware: ["auth", "admin"]
|
||||
});
|
||||
|
||||
const user = await getUser();
|
||||
const route = useRoute();
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ export default defineNuxtRouteMiddleware(async (to, from) => {
|
||||
const { getUser } = useUser()
|
||||
const user = await getUser()
|
||||
|
||||
if (!user || !user.is_admin) {
|
||||
if (!user.id || !user.is_admin) {
|
||||
return navigateTo('/home')
|
||||
}
|
||||
})
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
// https://nuxt.com/docs/api/configuration/nuxt-config
|
||||
export default defineNuxtConfig({
|
||||
ssr: true,
|
||||
// in SSG mode, we dont want to prerender pages since that will do actual API calls
|
||||
// and cause pages like /admin to literally be a redirect to /login
|
||||
ssr: process.env.RENDERING_MODE !== 'static',
|
||||
compatibilityDate: '2024-04-03',
|
||||
|
||||
css: ['~/assets/css/main.css'],
|
||||
@@ -12,7 +14,10 @@ export default defineNuxtConfig({
|
||||
nitro: {
|
||||
routeRules: {
|
||||
'/api/**': { proxy: 'http://localhost:1323/api/**' },
|
||||
'/test/**': { proxy: 'http://localhost:1323/api/**' },
|
||||
},
|
||||
// these routes never change so we can statically prerender them
|
||||
prerender: {
|
||||
routes: ['/login', '/signup', '/']
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import type { NuxtError } from '#app';
|
||||
|
||||
definePageMeta({
|
||||
middleware: ["auth", "admin"],
|
||||
// middleware: ["auth", "admin"],
|
||||
layout: "admin"
|
||||
});
|
||||
|
||||
|
||||
@@ -45,12 +45,12 @@ let { data: plans } = await useFetch<Plan[]>('/api/admin/plans');
|
||||
</h4>
|
||||
<div class="p-4">
|
||||
<label for="username" class="block max-w-64 text-sm">Username</label>
|
||||
<Input v-model="username" :value="username" id="username" placeholder="Username" class="w-full mb-2" />
|
||||
<input v-model="username" id="username" placeholder="Username" class="w-full mb-2" />
|
||||
<label for="email" class="block max-w-64 text-sm">Email</label>
|
||||
<Input v-model="email" :value="email" id="email" placeholder="Email" class="w-full mb-2" />
|
||||
<input v-model="email" id="email" placeholder="Email" class="w-full mb-2" />
|
||||
<div class="mb-2">
|
||||
<label for="password" class="block max-w-64 text-sm">Password</label>
|
||||
<Input v-model="password" id="password" placeholder="Password" class="w-full" />
|
||||
<input v-model="password" id="password" placeholder="Password" class="w-full" />
|
||||
<p class="text-muted text-sm">Leave the password empty to keep it unchanged</p>
|
||||
</div>
|
||||
<label for="plan_id" class="block max-w-64 text-sm">Plan</label>
|
||||
|
||||
@@ -46,11 +46,11 @@ onUnmounted(() => {
|
||||
</h4>
|
||||
<div class="p-4">
|
||||
<label for="username" class="block max-w-64 text-sm">Username</label>
|
||||
<Input v-model="username" :value="username" id="username" placeholder="Username" autocomplete="off" class="w-full mb-2" />
|
||||
<input v-model="username" id="username" placeholder="Username" autocomplete="off" class="w-full mb-2" />
|
||||
<label for="email" class="block max-w-64 text-sm">Email</label>
|
||||
<Input v-model="email" :value="email" id="email" placeholder="Email" autocomplete="off" class="w-full mb-2" />
|
||||
<input v-model="email" id="email" placeholder="Email" autocomplete="off" class="w-full mb-2" />
|
||||
<label for="password" class="block max-w-64 text-sm">Password</label>
|
||||
<Input v-model="password" :value="password" id="password" type="password" placeholder="Password" autocomplete="off" class="w-full mb-2" />
|
||||
<input v-model="password" id="password" type="password" placeholder="Password" autocomplete="off" class="w-full mb-2" />
|
||||
<p class="text-love mb-2">{{ error }}</p>
|
||||
<div>
|
||||
<button
|
||||
|
||||
@@ -317,7 +317,7 @@ const downloadFiles = async () => {
|
||||
<div class="mb-3 flex flex-col">
|
||||
<label for="folderNameInput" class="text-sm">name</label>
|
||||
<!-- TODO figure out why I cant focus this when the popup opens -->
|
||||
<Input id="folderNameInput" v-model="folderName" placeholder="Folder name" />
|
||||
<input id="folderNameInput" v-model="folderName" placeholder="Folder name" />
|
||||
<p class="text-love">{{ folderError }}</p>
|
||||
</div>
|
||||
<div class="ml-auto flex gap-x-1.5">
|
||||
|
||||
@@ -42,8 +42,8 @@ onUnmounted(() => {
|
||||
<div class="min-h-screen min-w-screen grid place-content-center bg-base">
|
||||
<div class="flex flex-col text-center bg-surface border shadow-md px-10 py-8 rounded-2xl min-w-0 max-w-[313px]">
|
||||
<h2 class="font-semibold text-2xl mb-2">Login</h2>
|
||||
<Input class="my-2" :value="username_or_email" v-model="username_or_email" placeholder="Username or Email..." />
|
||||
<Input class="my-2" :value="password" v-model="password" type="password" placeholder="Password..." />
|
||||
<input class="my-2" v-model="username_or_email" placeholder="Username or Email..." />
|
||||
<input class="my-2" v-model="password" type="password" placeholder="Password..." />
|
||||
<p class="text-love">{{ error }}</p>
|
||||
<button @click="submitForm"
|
||||
class="py-2 px-4 my-2 bg-pine/10 text-pine rounded-md transition-colors hover:bg-pine/15 active:bg-pine/25 focus:outline-none focus:ring focus:ring-inset">Login</button>
|
||||
|
||||
@@ -45,9 +45,9 @@ onUnmounted(() => {
|
||||
<div
|
||||
class="flex flex-col text-center bg-surface border border-muted/20 shadow-md px-10 py-8 rounded-2xl min-w-0 max-w-[313px]">
|
||||
<h2 class="font-semibold text-2xl mb-2">Signup</h2>
|
||||
<Input class="my-2" v-model="username" placeholder="Username..." />
|
||||
<Input class="my-2" v-model="email" placeholder="Email..." />
|
||||
<Input class="my-2" v-model="password" type="password" placeholder="Password..." />
|
||||
<input class="my-2" v-model="username" placeholder="Username..." />
|
||||
<input class="my-2" v-model="email" placeholder="Email..." />
|
||||
<input class="my-2" v-model="password" type="password" placeholder="Password..." />
|
||||
<p class="text-love">{{ error }}</p>
|
||||
<button @click="submitForm"
|
||||
class="py-2 px-4 my-2 bg-pine/10 text-pine rounded-md transition-colors hover:bg-pine/15 active:bg-pine/25 focus:outline-none focus:ring focus:ring-inset">Login</button>
|
||||
|
||||
@@ -28,7 +28,7 @@ module.exports = {
|
||||
},
|
||||
transitionProperty: {
|
||||
bg: "background-color",
|
||||
},
|
||||
}
|
||||
},
|
||||
},
|
||||
future: {
|
||||
|
||||
Reference in New Issue
Block a user