change to show npm install instead of copying file (#5)

This commit is contained in:
Nick Kao 2024-01-29 05:40:19 -08:00 committed by bennykok
parent a90c6c1db4
commit 90107ebe1b

View File

@ -118,15 +118,12 @@ export function DeploymentDisplay({
</TabsList> </TabsList>
<TabsContent className="flex flex-col gap-2 !mt-0" value="client"> <TabsContent className="flex flex-col gap-2 !mt-0" value="client">
<div> <div>
Copy and paste the ComfyDeployClient form&nbsp; Install the node comfydeploy SDK
<a <CodeBlock
href="https://github.com/BennyKok/comfyui-deploy-next-example/blob/main/src/lib/comfy-deploy.ts" lang="bash"
className="text-blue-500 hover:underline" code={`npm i comfydeploy`}
target="_blank" />
rel="noreferrer" Initialize your client
>
here
</a>
</div> </div>
<CodeBlock <CodeBlock
lang="js" lang="js"
@ -200,7 +197,8 @@ function formatCode(
if (inputs && inputs.length > 0) { if (inputs && inputs.length > 0) {
codeTemplate = codeTemplate.replace( codeTemplate = codeTemplate.replace(
"inputs: {}", "inputs: {}",
`inputs: ${JSON.stringify( `inputs: ${
JSON.stringify(
Object.fromEntries( Object.fromEntries(
inputs.map((x) => { inputs.map((x) => {
return [x?.input_id, ""]; return [x?.input_id, ""];
@ -211,7 +209,8 @@ function formatCode(
) )
.split("\n") .split("\n")
.map((line, index) => (index === 0 ? line : ` ${line}`)) // Add two spaces indentation except for the first line .map((line, index) => (index === 0 ? line : ` ${line}`)) // Add two spaces indentation except for the first line
.join("\n")}`, .join("\n")
}`,
); );
} else { } else {
codeTemplate = codeTemplate.replace( codeTemplate = codeTemplate.replace(