clean up web

This commit is contained in:
Nicholas Koben Kao 2024-01-24 22:22:59 -08:00
parent 4c047aea62
commit 0d88907cfd
3 changed files with 3 additions and 7 deletions

View File

@ -78,7 +78,6 @@ export const columns: ColumnDef<CheckpointItemList>[] = [
},
cell: ({ row }) => {
const checkpoint = row.original;
console.log(checkpoint);
return (
<a
className="hover:underline flex gap-2"
@ -116,6 +115,7 @@ export const columns: ColumnDef<CheckpointItemList>[] = [
{row.original.status}
</Badge>
);
// 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<CheckpointItemList>[] = [
</div>
),
},
// 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: (
<>

View File

@ -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

View File

@ -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(),