mirror of
https://github.com/Significant-Gravitas/AutoGPT.git
synced 2026-02-04 03:45:12 -05:00
Compare commits
1 Commits
fix/copilo
...
fix/google
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6512d4a386 |
@@ -6,11 +6,8 @@ import type {
|
|||||||
CredentialsMetaInput,
|
CredentialsMetaInput,
|
||||||
} from "@/lib/autogpt-server-api/types";
|
} from "@/lib/autogpt-server-api/types";
|
||||||
import { CredentialsInput } from "../CredentialsInputs/CredentialsInputs";
|
import { CredentialsInput } from "../CredentialsInputs/CredentialsInputs";
|
||||||
import {
|
import { RunAgentInputs } from "../RunAgentInputs/RunAgentInputs";
|
||||||
getAgentCredentialsFields,
|
import { getAgentCredentialsFields, getAgentInputFields } from "./helpers";
|
||||||
getAgentInputFields,
|
|
||||||
renderValue,
|
|
||||||
} from "./helpers";
|
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
agent: LibraryAgent;
|
agent: LibraryAgent;
|
||||||
@@ -48,16 +45,18 @@ export function AgentInputsReadOnly({
|
|||||||
{/* Regular inputs */}
|
{/* Regular inputs */}
|
||||||
{hasInputs && (
|
{hasInputs && (
|
||||||
<div className="flex flex-col gap-4">
|
<div className="flex flex-col gap-4">
|
||||||
{inputEntries.map(([key, [schema, value]]) => (
|
{inputEntries.map(([key, [schema, value]]) => {
|
||||||
<div key={key} className="flex flex-col gap-1.5">
|
if (!schema) return null;
|
||||||
<label className="text-sm font-medium">
|
return (
|
||||||
{schema?.title || key}
|
<RunAgentInputs
|
||||||
</label>
|
key={key}
|
||||||
<p className="whitespace-pre-wrap break-words text-sm text-neutral-700">
|
schema={schema}
|
||||||
{renderValue(value)}
|
value={value}
|
||||||
</p>
|
onChange={() => {}}
|
||||||
</div>
|
readOnly={true}
|
||||||
))}
|
/>
|
||||||
|
);
|
||||||
|
})}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ interface Props {
|
|||||||
value?: any;
|
value?: any;
|
||||||
placeholder?: string;
|
placeholder?: string;
|
||||||
onChange: (value: any) => void;
|
onChange: (value: any) => void;
|
||||||
|
readOnly?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -44,6 +45,7 @@ export function RunAgentInputs({
|
|||||||
value,
|
value,
|
||||||
placeholder,
|
placeholder,
|
||||||
onChange,
|
onChange,
|
||||||
|
readOnly,
|
||||||
...props
|
...props
|
||||||
}: Props & React.HTMLAttributes<HTMLElement>) {
|
}: Props & React.HTMLAttributes<HTMLElement>) {
|
||||||
const { handleUploadFile, uploadProgress } = useRunAgentInputs();
|
const { handleUploadFile, uploadProgress } = useRunAgentInputs();
|
||||||
@@ -347,6 +349,11 @@ export function RunAgentInputs({
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="no-drag relative flex w-full">{innerInputElement}</div>
|
<div
|
||||||
|
className="no-drag relative flex w-full"
|
||||||
|
style={readOnly ? { pointerEvents: "none", opacity: 0.7 } : undefined}
|
||||||
|
>
|
||||||
|
{innerInputElement}
|
||||||
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user