From 0d88907cfd0c644c6b5f40e09074983eb8bbd0d2 Mon Sep 17 00:00:00 2001 From: Nicholas Koben Kao Date: Wed, 24 Jan 2024 22:22:59 -0800 Subject: [PATCH] clean up web --- web/src/components/CheckpointList.tsx | 4 ++-- web/src/server/curdCheckpoint.ts | 4 ---- web/src/types/civitai.ts | 2 +- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/web/src/components/CheckpointList.tsx b/web/src/components/CheckpointList.tsx index faf014b..a0fce75 100644 --- a/web/src/components/CheckpointList.tsx +++ b/web/src/components/CheckpointList.tsx @@ -78,7 +78,6 @@ export const columns: ColumnDef[] = [ }, cell: ({ row }) => { const checkpoint = row.original; - console.log(checkpoint); return ( [] = [ {row.original.status} ); + // NOTE: retry downloads on failures // const oneHourAgo = new Date(new Date().getTime() - (60 * 60 * 1000)); // const lastUpdated = new Date(row.original.updated_at); // const canRefresh = row.original.status === "failed" && lastUpdated < oneHourAgo; @@ -189,6 +189,7 @@ export const columns: ColumnDef[] = [ ), }, + // TODO: deletion and editing for future sprint // { // id: "actions", // enableHiding: false, @@ -274,7 +275,6 @@ export function CheckpointList({ data }: { data: CheckpointItemList[] }) { fieldConfig={{ civitai_url: { fieldType: "fallback", - // fieldType: "fallback", inputProps: { required: true }, description: ( <> diff --git a/web/src/server/curdCheckpoint.ts b/web/src/server/curdCheckpoint.ts index 7dc1046..3c01532 100644 --- a/web/src/server/curdCheckpoint.ts +++ b/web/src/server/curdCheckpoint.ts @@ -8,14 +8,12 @@ import { CheckpointVolumeType, } from "@/db/schema"; import { withServerPromise } from "./withServerPromise"; -import { redirect } from "next/navigation"; import { db } from "@/db/db"; import type { z } from "zod"; import { headers } from "next/headers"; import { addCivitaiCheckpointSchema } from "./addCheckpointSchema"; import { and, eq, isNull } from "drizzle-orm"; import { CivitaiModelResponse } from "@/types/civitai"; -import { CheckpointItemList } from "@/components/CheckpointList"; export async function getCheckpoints() { const { userId, orgId } = auth(); @@ -121,14 +119,12 @@ export const addCivitaiCheckpoint = withServerPromise( if (!userId) return { error: "No user id" }; const { url, modelVersionId } = getUrl(data?.civitai_url); - console.log("4", url, modelVersionId); const civitaiModelRes = await fetch(url) .then((x) => x.json()) .then((a) => { console.log(a); return CivitaiModelResponse.parse(a); }); - console.log("5"); if (civitaiModelRes?.modelVersions?.length === 0) { return; // no versions to download diff --git a/web/src/types/civitai.ts b/web/src/types/civitai.ts index 971ba8b..5e57ed0 100644 --- a/web/src/types/civitai.ts +++ b/web/src/types/civitai.ts @@ -62,7 +62,7 @@ export const imageMetaSchema = z.object({ DenoisingStrength: z.number().nullish(), }); -// all over the place +// NOTE: this definition is all over the place // export const imageSchema = z.object({ // url: z.string().url().nullish(), // nsfw: z.enum(["None", "Soft", "Mature"]).nullish(),