Merge branch 'cz/inspection' of https://github.com/langflow-ai/langflow into cz/inspection
This commit is contained in:
commit
312a959ae1
2 changed files with 39 additions and 19 deletions
|
|
@ -45,6 +45,7 @@ import useHandleOnNewValue from "../../../hooks/use-handle-new-value";
|
||||||
import useHandleNodeClass from "../../../hooks/use-handle-node-class";
|
import useHandleNodeClass from "../../../hooks/use-handle-node-class";
|
||||||
import useHandleRefreshButtonPress from "../../../hooks/use-handle-refresh-buttons";
|
import useHandleRefreshButtonPress from "../../../hooks/use-handle-refresh-buttons";
|
||||||
import TooltipRenderComponent from "../tooltipRenderComponent";
|
import TooltipRenderComponent from "../tooltipRenderComponent";
|
||||||
|
import OutputModal from "../outputModal";
|
||||||
|
|
||||||
export default function ParameterComponent({
|
export default function ParameterComponent({
|
||||||
left,
|
left,
|
||||||
|
|
@ -77,6 +78,10 @@ export default function ParameterComponent({
|
||||||
const flow = currentFlow?.data?.nodes ?? null;
|
const flow = currentFlow?.data?.nodes ?? null;
|
||||||
const groupedEdge = useRef(null);
|
const groupedEdge = useRef(null);
|
||||||
const setFilterEdge = useFlowStore((state) => state.setFilterEdge);
|
const setFilterEdge = useFlowStore((state) => state.setFilterEdge);
|
||||||
|
const [openOutputModal, setOpenOutputModal] = useState(false);
|
||||||
|
const flowPool = useFlowStore((state) => state.flowPool);
|
||||||
|
|
||||||
|
const displayOutputPreview = !!flowPool[data.id];
|
||||||
|
|
||||||
const { handleOnNewValue: handleOnNewValueHook } = useHandleOnNewValue(
|
const { handleOnNewValue: handleOnNewValueHook } = useHandleOnNewValue(
|
||||||
data,
|
data,
|
||||||
|
|
@ -249,9 +254,33 @@ export default function ParameterComponent({
|
||||||
</span>
|
</span>
|
||||||
</ShadTooltip>
|
</ShadTooltip>
|
||||||
) : (
|
) : (
|
||||||
<span className={!left && data.node?.frozen ? " text-ice" : ""}>
|
<div className="flex gap-2">
|
||||||
{title}
|
<span className={!left && data.node?.frozen ? " text-ice" : ""}>
|
||||||
</span>
|
{title}
|
||||||
|
</span>
|
||||||
|
<ShadTooltip
|
||||||
|
content={
|
||||||
|
displayOutputPreview
|
||||||
|
? "Inspect Output"
|
||||||
|
: "Please build the component first"
|
||||||
|
}
|
||||||
|
>
|
||||||
|
<button
|
||||||
|
disabled={!displayOutputPreview}
|
||||||
|
onClick={() => setOpenOutputModal(true)}
|
||||||
|
>
|
||||||
|
<IconComponent
|
||||||
|
className={classNames(
|
||||||
|
"h-5 w-5",
|
||||||
|
displayOutputPreview
|
||||||
|
? ""
|
||||||
|
: " cursor-not-allowed text-muted-foreground",
|
||||||
|
)}
|
||||||
|
name={"Eye"}
|
||||||
|
/>
|
||||||
|
</button>
|
||||||
|
</ShadTooltip>
|
||||||
|
</div>
|
||||||
)}
|
)}
|
||||||
<span className={(required ? "ml-2 " : "") + "text-status-red"}>
|
<span className={(required ? "ml-2 " : "") + "text-status-red"}>
|
||||||
{required ? "*" : ""}
|
{required ? "*" : ""}
|
||||||
|
|
@ -582,6 +611,13 @@ export default function ParameterComponent({
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</Case>
|
</Case>
|
||||||
|
{openOutputModal && (
|
||||||
|
<OutputModal
|
||||||
|
open={openOutputModal}
|
||||||
|
nodeId={data.id}
|
||||||
|
setOpen={setOpenOutputModal}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
</>
|
</>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -68,7 +68,6 @@ export default function GenericNode({
|
||||||
const [nodeDescription, setNodeDescription] = useState(
|
const [nodeDescription, setNodeDescription] = useState(
|
||||||
data.node?.description!,
|
data.node?.description!,
|
||||||
);
|
);
|
||||||
const [openOutputModal, setOpenOutputModal] = useState(false);
|
|
||||||
const [isOutdated, setIsOutdated] = useState(false);
|
const [isOutdated, setIsOutdated] = useState(false);
|
||||||
const [validationStatus, setValidationStatus] =
|
const [validationStatus, setValidationStatus] =
|
||||||
useState<VertexBuildTypeAPI | null>(null);
|
useState<VertexBuildTypeAPI | null>(null);
|
||||||
|
|
@ -449,13 +448,6 @@ export default function GenericNode({
|
||||||
</div>
|
</div>
|
||||||
{showNode && (
|
{showNode && (
|
||||||
<>
|
<>
|
||||||
<Button
|
|
||||||
onClick={() => {
|
|
||||||
setOpenOutputModal(true);
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
STATUS##
|
|
||||||
</Button>
|
|
||||||
<ShadTooltip
|
<ShadTooltip
|
||||||
content={
|
content={
|
||||||
buildStatus === BuildStatus.BUILDING ? (
|
buildStatus === BuildStatus.BUILDING ? (
|
||||||
|
|
@ -706,14 +698,6 @@ export default function GenericNode({
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{openOutputModal && (
|
|
||||||
<OutputModal
|
|
||||||
open={openOutputModal}
|
|
||||||
nodeId={data.id}
|
|
||||||
setOpen={setOpenOutputModal}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue