diff --git a/apps/desktop/src/features/inference-server/instance-creator.tsx b/apps/desktop/src/features/inference-server/instance-creator.tsx new file mode 100644 index 0000000..69ad87f --- /dev/null +++ b/apps/desktop/src/features/inference-server/instance-creator.tsx @@ -0,0 +1,32 @@ +import { cn } from "@localai/theme/utils" +import { SpinnerButton } from "@localai/ui/button" +import { useState } from "react" + +export const InstanceCreator = () => { + const [isLoading, setIsLoading] = useState(false) + + const handleClick = async () => { + setIsLoading(true) + // Add your logic here to handle adding a new instance + // For example: + await createNewInstance() + setIsLoading(false) + } + + return ( +
+ + {isLoading ? "..." : "Create New Instance"} + +
+ ) +} +function createNewInstance() { + throw new Error("Function not implemented.") +} diff --git a/apps/desktop/src/features/inference-server/server-list-item.tsx b/apps/desktop/src/features/inference-server/server-list-item.tsx new file mode 100644 index 0000000..887a3ca --- /dev/null +++ b/apps/desktop/src/features/inference-server/server-list-item.tsx @@ -0,0 +1,77 @@ +import { cn } from "@localai/theme/utils" +import { Button } from "@localai/ui/button" +import { Input } from "@localai/ui/input" +import { Textarea } from "@localai/ui/textarea" +import { + ChevronLeftIcon, + ChevronRightIcon, + GearIcon +} from "@radix-ui/react-icons" +import dedent from "ts-dedent" + +import { useToggle } from "~features/layout/use-toggle" +import { type ModelMetadata } from "~features/model-downloader/model-file" +import { useGlobal } from "~providers/global" +import { ModelProvider } from "~providers/model" + +import { ServerConfig } from "./server-config" + +export const ServerListItem = ({ model }: { model: ModelMetadata }) => { + const { + activeModelState: [activeModel] + } = useGlobal() + const [isConfigVisible, toggleConfig] = useToggle(false) + return ( + +
+
+ +
+ + {isConfigVisible && ( + <> +
+
+