Update RunFlow and RefreshButton components
This commit is contained in:
parent
f0073b55df
commit
9244db0c24
2 changed files with 10 additions and 3 deletions
|
|
@ -21,8 +21,8 @@ class RunFlowComponent(CustomComponent):
|
|||
"multiline": True,
|
||||
},
|
||||
"flow_name": {
|
||||
"display_name": "Flow ID",
|
||||
"info": "The ID of the flow to run.",
|
||||
"display_name": "Flow Name",
|
||||
"info": "The name of the flow to run.",
|
||||
"options": self.get_flow_names,
|
||||
},
|
||||
"tweaks": {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
import { useState } from "react";
|
||||
import { useEffect, useState } from "react";
|
||||
import IconComponent from "../../components/genericIconComponent";
|
||||
import { NodeDataType } from "../../types/flow";
|
||||
import { cn } from "../../utils/utils";
|
||||
|
||||
function RefreshButton({
|
||||
disabled,
|
||||
name,
|
||||
|
|
@ -15,6 +16,10 @@ function RefreshButton({
|
|||
}) {
|
||||
const [isLoading, setIsLoading] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
handleUpdateValues(name, data);
|
||||
}, []); // Empty dependency array to run only once
|
||||
|
||||
const handleClick = async () => {
|
||||
if (disabled) return;
|
||||
setIsLoading(true);
|
||||
|
|
@ -31,10 +36,12 @@ function RefreshButton({
|
|||
setIsLoading(false);
|
||||
}
|
||||
};
|
||||
|
||||
const className = cn(
|
||||
"extra-side-bar-buttons ml-2 mt-1 w-1/6",
|
||||
disabled ? "cursor-not-allowed" : "cursor-pointer"
|
||||
);
|
||||
|
||||
// icon class name should take into account the disabled state and the loading state
|
||||
const disabledIconTextClass = disabled ? "text-muted-foreground" : "";
|
||||
const iconClassName = cn(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue