diff --git a/frontend/src/lib/components/common/actionRow/ActionRow.svelte b/frontend/src/lib/components/common/actionRow/ActionRow.svelte index bc4b3e94cf..314668bdcc 100644 --- a/frontend/src/lib/components/common/actionRow/ActionRow.svelte +++ b/frontend/src/lib/components/common/actionRow/ActionRow.svelte @@ -1,13 +1,20 @@ -
-
+ + +
= 30 ? 'border-b ' : '') : '') + + $$props.class} +> +
{#if $$slots.left} diff --git a/frontend/src/routes/flows/get/[...path].svelte b/frontend/src/routes/flows/get/[...path].svelte index 250a26f619..10f831d55b 100644 --- a/frontend/src/routes/flows/get/[...path].svelte +++ b/frontend/src/routes/flows/get/[...path].svelte @@ -46,7 +46,6 @@ let path = $page.params.path let shareModal: ShareModal - let scrollY: number $: { if ($workspaceStore && $userStore) { @@ -90,10 +89,8 @@ } - - {#if flow} - = 30 ? 'border-b' : '')}> +

Flow

diff --git a/frontend/src/routes/run/[...run].svelte b/frontend/src/routes/run/[...run].svelte index ac27fde12f..5b0ce2616a 100644 --- a/frontend/src/routes/run/[...run].svelte +++ b/frontend/src/routes/run/[...run].svelte @@ -20,7 +20,7 @@ import Icon from 'svelte-awesome' import { check } from 'svelte-awesome/icons' import { - faBolt, + faRefresh, faCircle, faTimes, faTrash, @@ -38,7 +38,6 @@ } from '@fortawesome/free-solid-svg-icons' import Tooltip from '$lib/components/Tooltip.svelte' import DisplayResult from '$lib/components/DisplayResult.svelte' - import { userStore, workspaceStore } from '$lib/stores' import CenteredPage from '$lib/components/CenteredPage.svelte' import FlowStatusViewer from '$lib/components/FlowStatusViewer.svelte' @@ -48,7 +47,7 @@ import HighlightCode from '$lib/components/HighlightCode.svelte' import TestJobLoader from '$lib/components/TestJobLoader.svelte' import LogViewer from '$lib/components/LogViewer.svelte' - import { Button } from '$lib/components/common' + import { Button, ActionRow } from '$lib/components/common' let workspace_id_query: string | undefined = $page.url.searchParams.get('workspace') ?? undefined let workspace_id: string | undefined @@ -108,6 +107,73 @@ bind:job /> +{#if job?.job_kind === 'script' || job?.job_kind === 'flow'} + + + {@const stem = `/${job?.job_kind}s`} + {@const isScript = job?.job_kind === 'script'} + {@const route = isScript ? job?.script_hash : job?.script_path} + {@const runHref = `${stem}/run/${route}${ + job?.args ? '?args=' + encodeURIComponent(encodeState(job?.args)) : '' + }`} + {@const editHref = `${stem}/edit/${route}${isScript ? '?step=2' : ''}`} + {@const isRunning = job && 'running' in job && job.running} + {#if isRunning} + + {/if} + + {#if canWrite(job?.script_path ?? '', {}, $userStore)} + + {/if} + + + {@const stem = `/${job?.job_kind}s`} + {@const isScript = job?.job_kind === 'script'} + {@const runsHref = `/runs/${job?.script_path}${!isScript ? '?jobKind=flow' : ''}`} + {@const viewHref = `${stem}/get/${isScript ? job?.script_hash : job?.script_path}`} + {#if job && 'deleted' in job && !job?.deleted && ($userStore?.is_admin ?? false)} + + {/if} + + + + +{/if}

@@ -173,121 +239,6 @@ {/if}

-
- {#if job && 'deleted' in job && !job?.deleted && ($userStore?.is_admin ?? false)} - - {/if} - {#if job && 'running' in job && job.running} - - {/if} - {#if job?.job_kind == 'script'} - {#if canWrite(job?.script_path ?? '', {}, $userStore)} - - {/if} - - - - {:else if job?.job_kind == 'flow'} - {#if canWrite(job?.script_path ?? '', {}, $userStore)} - - {/if} - - - - {/if} -
{#if job && 'deleted' in job && job?.deleted}