diff --git a/web/src/app/workflows/[workflow_id]/page.tsx b/web/src/app/workflows/[workflow_id]/page.tsx index 08ffe0c..ba059b6 100644 --- a/web/src/app/workflows/[workflow_id]/page.tsx +++ b/web/src/app/workflows/[workflow_id]/page.tsx @@ -5,6 +5,7 @@ import { CreateDeploymentButton, MachineSelect, RunWorkflowButton, + VersionDetails, VersionSelect, } from "@/components/VersionSelect"; import { @@ -46,6 +47,8 @@ export default async function Page({ + + diff --git a/web/src/components/MachinesWS.tsx b/web/src/components/MachinesWS.tsx index d151306..7b065be 100644 --- a/web/src/components/MachinesWS.tsx +++ b/web/src/components/MachinesWS.tsx @@ -1,6 +1,8 @@ "use client"; +import { Badge } from "@/components/ui/badge"; import type { getMachines } from "@/server/curdMachine"; +import { Check, CircleOff, SatelliteDish } from "lucide-react"; import React, { useEffect } from "react"; import useWebSocket, { ReadyState } from "react-use-websocket"; import { create } from "zustand"; @@ -36,11 +38,13 @@ export function MachinesWSMain(props: { machines: Awaited>; }) { return ( -
+
Machine Status - {props.machines.map((x) => ( - - ))} +
+ {props.machines.map((x) => ( + + ))} +
); } @@ -55,17 +59,19 @@ function MachineWS({ const { lastMessage, readyState } = useWebSocket( `${wsEndpoint}/comfyui-deploy/ws`, { - shouldReconnect: ()=> true, + shouldReconnect: () => true, reconnectAttempts: 20, reconnectInterval: 1000, } ); const connectionStatus = { - [ReadyState.CONNECTING]: "Connecting", - [ReadyState.OPEN]: "Open", - [ReadyState.CLOSING]: "Closing", - [ReadyState.CLOSED]: "Closed", + [ReadyState.CONNECTING]: ( + + ), + [ReadyState.OPEN]: , + [ReadyState.CLOSING]: , + [ReadyState.CLOSED]: , [ReadyState.UNINSTANTIATED]: "Uninstantiated", }[readyState]; @@ -81,8 +87,8 @@ function MachineWS({ }, [lastMessage]); return ( -
- {machine.name} - {connectionStatus} -
+ + {machine.name} {connectionStatus} + ); } diff --git a/web/src/components/VersionSelect.tsx b/web/src/components/VersionSelect.tsx index 9f8c5fb..48aadba 100644 --- a/web/src/components/VersionSelect.tsx +++ b/web/src/components/VersionSelect.tsx @@ -2,6 +2,7 @@ import { callServerPromise } from "./callServerPromise"; import { LoadingIcon } from "@/components/LoadingIcon"; +import { Badge } from "@/components/ui/badge"; import { Button } from "@/components/ui/button"; import { DropdownMenu, @@ -199,3 +200,48 @@ export function CreateDeploymentButton({ ); } + +const customInputNodes: Record = { + ComfyUIDeployExternalText: "string", +}; + +export function VersionDetails({ + workflow, +}: { + workflow: Awaited>; +}) { + const [version] = useQueryState("version", { + defaultValue: workflow?.versions[0].version ?? 1, + ...parseAsInteger, + }); + const workflow_version = workflow?.versions.find( + (x) => x.version === version + ); + return ( +
+ Workflow Details +
+ {workflow_version?.workflow_api && ( +
+ {Object.entries(workflow_version.workflow_api).map( + ([key, value]) => { + if (!value.class_type) return <> ; + const nodeType = customInputNodes[value.class_type]; + if (nodeType) { + const input_id = value.inputs.input_id; + const defaultValue = value.inputs.default_value; + return ( + <> + {input_id} {nodeType} {defaultValue} + + ); + } + return <>; + } + )} +
+ )} +
+
+ ); +}