db fixed
This commit is contained in:
+2
-2
@@ -52,9 +52,9 @@
|
||||
--card-foreground: oklch(0.985 0 0);
|
||||
--popover: oklch(0.21 0.006 285.885);
|
||||
--popover-foreground: oklch(0.985 0 0);
|
||||
--primary: oklch(0.72 0.331 293.009);
|
||||
--primary: oklch(0.5 0.331 293.009);
|
||||
--primary-foreground: oklch(0.0 0.016 293.756);
|
||||
--dull-primary: oklch(0.35 0.281 293.009);
|
||||
--dull-primary: oklch(0.3 0.281 293.009);
|
||||
--dull-primary-foreground: oklch(0.969 0.016 293.756);
|
||||
/*--primary-foreground: oklch(0.969 0.016 293.756);*/
|
||||
--secondary: oklch(0.274 0.006 286.033);
|
||||
|
||||
@@ -64,10 +64,11 @@ export async function login(email: string, password: string): Promise<User> {
|
||||
SELECT * FROM users
|
||||
WHERE email = ${email};
|
||||
`;
|
||||
console.log('1.25: ' + Date.now());
|
||||
if (typeof user.settings == 'string') {
|
||||
user.settings = JSON.parse(user.settings);
|
||||
}
|
||||
if (user) {
|
||||
if (await bcrypt.compare(password, user.passwordHash!)) {
|
||||
console.log('1.5: ' + Date.now());
|
||||
delete user.passwordHash;
|
||||
|
||||
await sql`
|
||||
@@ -75,7 +76,6 @@ export async function login(email: string, password: string): Promise<User> {
|
||||
SET last_sign_in = NOW()
|
||||
WHERE id = ${user.id};
|
||||
`;
|
||||
console.log('1.75: ' + Date.now());
|
||||
|
||||
return user;
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
async function onSelect(file: File) {
|
||||
isGenerating = true;
|
||||
|
||||
const resized = await resizeImage(file, 300, 300, 0.8);
|
||||
const resized = await resizeImage(file, 300, 300, 0.7);
|
||||
|
||||
const base64 = await fileToBase64(resized);
|
||||
|
||||
|
||||
@@ -7,8 +7,8 @@
|
||||
base: 'focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive inline-flex shrink-0 items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-all outline-none focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*=\'size-\'])]:size-4',
|
||||
variants: {
|
||||
variant: {
|
||||
default: 'bg-primary text-primary-foreground hover:bg-primary/90 shadow-xs',
|
||||
dull_default: 'bg-dull-primary text-dull-primary-foreground hover:bg-dull-primary/90 shadow-xs',
|
||||
default: 'bg-dull-primary text-dull-primary-foreground hover:bg-primary/90 shadow-xs',
|
||||
// dull_default: 'bg-dull-primary text-dull-primary-foreground hover:bg-dull-primary/90 shadow-xs',
|
||||
destructive:
|
||||
'bg-destructive hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60 text-white shadow-xs',
|
||||
outline:
|
||||
|
||||
@@ -17,7 +17,7 @@ export const genDescription = command(v.string(), async (data) => {
|
||||
const outputBuffer = await image
|
||||
.rotate()
|
||||
.resize({ fit: 'outside', height: 300, width: 300 })
|
||||
.jpeg({ quality: 80 }) // adjust if needed
|
||||
.jpeg({ quality: 70 }) // adjust if needed
|
||||
.toBuffer();
|
||||
|
||||
const description = await LLMDescribe(
|
||||
|
||||
@@ -33,7 +33,7 @@ export async function LLMDescribe(imageData: string) {
|
||||
);
|
||||
|
||||
if (!res.ok) {
|
||||
console.log(await res.text());
|
||||
console.error(await res.text());
|
||||
// process.exit(1);
|
||||
}
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
<div class="mt-10 flex flex-col items-center justify-center gap-4 ">
|
||||
<a
|
||||
href="/items"
|
||||
class={cn(buttonVariants({ variant: 'dull_default', size: 'xl' }), 'text-base')}
|
||||
class={cn(buttonVariants({ variant: 'default', size: 'xl' }), 'text-base')}
|
||||
aria-label="Browse lost items"
|
||||
>
|
||||
Browse lost items
|
||||
|
||||
@@ -59,8 +59,6 @@
|
||||
<!-- Editable Profile Form -->
|
||||
<form method="POST" class="space-y-6" use:enhance={({ formElement, formData, action, cancel, submitter }) => {
|
||||
return async ({ result, update }) => {
|
||||
console.log("bleh")
|
||||
console.log(result.status)
|
||||
if (result.status === 200) {
|
||||
toast('Saved', {
|
||||
icon: CheckIcon,
|
||||
|
||||
@@ -59,12 +59,12 @@
|
||||
<form action="" class="w-full">
|
||||
<Field.Field orientation="horizontal" class="w-full max-w-md">
|
||||
<Input type="search" name="search" id="search" placeholder="Search..." />
|
||||
<Button variant="dull_default" type="submit">Search</Button>
|
||||
<Button variant="default" type="submit">Search</Button>
|
||||
</Field.Field>
|
||||
</form>
|
||||
<!-- <h1 class="text-3xl mb-2 mt-2">Found Items</h1>-->
|
||||
<div class="hidden md:inline-block">
|
||||
<Button variant="dull_default" class="" onclick={openCreateDialog}>
|
||||
<Button variant="default" class="" onclick={openCreateDialog}>
|
||||
Submit a found item
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
@@ -10,11 +10,8 @@ export const actions = {
|
||||
const email = getRequiredFormString(data, 'email');
|
||||
const password = getRequiredFormString(data, 'password');
|
||||
|
||||
console.log('1: ' + Date.now());
|
||||
const user = await login(email, password);
|
||||
console.log('2: ' + Date.now());
|
||||
setJWTCookie(cookies, user);
|
||||
console.log('3: ' + Date.now());
|
||||
} catch (e) {
|
||||
return fail(400, { message: e instanceof Error ? e.message : 'Unknown error occurred' });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user