feat: add s3 localstack, upload api

This commit is contained in:
BennyKok
2023-12-13 17:14:55 +08:00
parent f9ed8145d2
commit 0835d966f1
34 changed files with 1112 additions and 227 deletions
+3 -2
View File
@@ -1,6 +1,5 @@
"use client";
import type { findFirstTableWithVersion } from "@/app/[workflow_id]/page";
import { LoadingIcon } from "@/components/LoadingIcon";
import { Button } from "@/components/ui/button";
import {
@@ -14,6 +13,7 @@ import {
} from "@/components/ui/select";
import { createRun } from "@/server/createRun";
import type { getMachines } from "@/server/curdMachine";
import type { findFirstTableWithVersion } from "@/server/findFirstTableWithVersion";
import { Play } from "lucide-react";
import { parseAsInteger, useQueryState } from "next-usequerystate";
import { useState } from "react";
@@ -56,7 +56,7 @@ export function MachineSelect({
machines: Awaited<ReturnType<typeof getMachines>>;
}) {
const [machine, setMachine] = useQueryState("machine", {
defaultValue: machines[0].id ?? "",
defaultValue: machines?.[0].id ?? "",
});
return (
<Select
@@ -111,6 +111,7 @@ export function RunWorkflowButton({
try {
const origin = window.location.origin;
await createRun(origin, workflow_version_id, machine);
// console.log(res.json());
setIsLoading(false);
} catch (error) {
setIsLoading(false);