feat: run button
This commit is contained in:
@@ -165,41 +165,51 @@ function RenderingNodeComponent({ id, data, width, height, selected }: Props) {
|
|||||||
state.incomingIds.length > 0 ? (
|
state.incomingIds.length > 0 ? (
|
||||||
<div className="flex items-center gap-2 shrink-0">
|
<div className="flex items-center gap-2 shrink-0">
|
||||||
<ButtonGroup className="nodrag nopan">
|
<ButtonGroup className="nodrag nopan">
|
||||||
<Button
|
{state.effectiveUpdateMode === 'manual' ? (
|
||||||
type="button"
|
<Button
|
||||||
size="sm"
|
type="button"
|
||||||
variant="outline"
|
size="sm"
|
||||||
disabled={
|
variant="outline"
|
||||||
state.loading ||
|
disabled={state.loading || !state.hasPendingInputs}
|
||||||
(state.effectiveUpdateMode === 'manual' && !state.hasPendingInputs)
|
className="h-7 gap-1.5 rounded-r-none border-r-0 px-2.5 text-xs"
|
||||||
}
|
onClick={(e) => {
|
||||||
className="h-7 gap-1.5 rounded-r-none border-r-0 px-2.5 text-xs"
|
e.stopPropagation()
|
||||||
onClick={(e) => {
|
state.incrementRunTrigger()
|
||||||
e.stopPropagation()
|
}}
|
||||||
state.incrementRunTrigger()
|
title={
|
||||||
}}
|
state.hasPendingInputs
|
||||||
title={
|
? 'Inputs changed — click to render'
|
||||||
state.effectiveUpdateMode === 'manual' && state.hasPendingInputs
|
: !state.hasPendingInputs
|
||||||
? 'Inputs changed — click to render'
|
? 'No new data to render'
|
||||||
: state.effectiveUpdateMode === 'manual' && !state.hasPendingInputs
|
: undefined
|
||||||
? 'No new data to render'
|
}
|
||||||
: undefined
|
>
|
||||||
}
|
{state.loading ? (
|
||||||
>
|
<Loader2 className="size-3.5 animate-spin shrink-0" aria-hidden />
|
||||||
{state.loading ? (
|
) : (
|
||||||
|
<Play className="size-3.5 shrink-0" />
|
||||||
|
)}
|
||||||
|
Run
|
||||||
|
</Button>
|
||||||
|
) : state.loading ? (
|
||||||
|
<Button
|
||||||
|
type="button"
|
||||||
|
size="sm"
|
||||||
|
variant="outline"
|
||||||
|
disabled
|
||||||
|
className="h-7 gap-1.5 rounded-r-none border-r-0 px-2.5 text-xs"
|
||||||
|
aria-label="Updating"
|
||||||
|
>
|
||||||
<Loader2 className="size-3.5 animate-spin shrink-0" aria-hidden />
|
<Loader2 className="size-3.5 animate-spin shrink-0" aria-hidden />
|
||||||
) : (
|
</Button>
|
||||||
<Play className="size-3.5 shrink-0" />
|
) : null}
|
||||||
)}
|
|
||||||
Run
|
|
||||||
</Button>
|
|
||||||
<DropdownMenu>
|
<DropdownMenu>
|
||||||
<DropdownMenuTrigger asChild>
|
<DropdownMenuTrigger asChild>
|
||||||
<Button
|
<Button
|
||||||
type="button"
|
type="button"
|
||||||
size="sm"
|
size="sm"
|
||||||
variant="outline"
|
variant="outline"
|
||||||
className="h-7 min-w-[4.5rem] gap-1 rounded-l-none pl-2 pr-1.5 text-xs font-normal"
|
className={`h-7 min-w-[4.5rem] gap-1 pl-2 pr-1.5 text-xs font-normal ${state.effectiveUpdateMode === 'manual' || state.loading ? 'rounded-l-none' : 'rounded-l-md'}`}
|
||||||
aria-label="Update mode"
|
aria-label="Update mode"
|
||||||
onClick={(e) => e.stopPropagation()}
|
onClick={(e) => e.stopPropagation()}
|
||||||
>
|
>
|
||||||
|
|||||||
Reference in New Issue
Block a user