frontend nits

This commit is contained in:
Ruben Fiszel
2022-11-08 11:48:05 +01:00
parent 0cc1a84862
commit c74cde953c
11 changed files with 24 additions and 31 deletions
@@ -191,25 +191,6 @@
class="justify-between flex flex-row w-full py-2 px-4 space-x-4 overflow-x-auto scrollbar-hidden"
>
<div class="flex flex-row space-x-2">
<Button
color="light"
size="sm"
variant="border"
on:click={() => {
const url = new URL('https://hub.windmill.dev/flows/add')
const openFlow = {
value: $flowStore.value,
summary: $flowStore.summary,
description: $flowStore.description,
schema: $flowStore.schema
}
url.searchParams.append('flow', btoa(JSON.stringify(openFlow)))
window.open(url, '_blank')?.focus()
}}
startIcon={{ icon: faGlobe }}
>
Publish to Hub
</Button>
<FlowImportExportMenu />
</div>
<div class="gap-1 flex-row hidden md:flex shrink overflow-hidden">
@@ -52,7 +52,7 @@
{/if}
<p class="font-black text-lg w-full my-4">
<span>Inputs</span>
<span>Flow Inputs</span>
</p>
{#if flow.schema && flow.schema.properties && Object.keys(flow.schema.properties).length > 0 && flow.schema}
<ul class="my-2">
@@ -60,6 +60,7 @@
schedulable={false}
buttonText="Test just this step (Ctrl+Enter)"
detailed={false}
topButton
bind:args={stepArgs}
/>
{#if testIsLoading}
+11 -1
View File
@@ -36,6 +36,7 @@
export let schedulable = true
export let detailed = true
export let autofocus = false
export let topButton = false
export let args: Record<string, any> = decodeArgs($page.url.searchParams.get('args') ?? undefined)
@@ -93,6 +94,15 @@
<h1>Loading...</h1>
{/if}
{/if}
{#if topButton}
<Button
btnClasses="!px-6 !py-1 w-full"
disabled={!isValid}
on:click={() => runAction(undefined, args)}
>
{buttonText}
</Button>
{/if}
{#if runnable?.schema}
<div class="my-2" />
{#if !runnable.schema.properties || Object.keys(runnable.schema.properties).length === 0}
@@ -152,7 +162,7 @@
{scheduledForStr ? 'Schedule run to a later time' : buttonText}
</Button>
</div>
{:else}
{:else if !topButton}
<Button
btnClasses="!px-6 !py-1 w-full"
disabled={!isValid}
@@ -62,7 +62,7 @@
'rounded-md',
'justify-center items-center text-center whitespace-nowrap inline-flex',
btnClasses,
disabled ? 'bg-gray-200' : ''
disabled ? 'bg-gray-300' : ''
),
disabled,
href,
@@ -10,7 +10,7 @@
</script>
<div class="flex flex-col divide-y h-screen max-h-screen">
<div class="flex justify-between items-center py-2 px-6">
<div class="flex justify-between items-center py-2 px-6 gap-x-2">
<Button
variant="border"
size="lg"
@@ -21,7 +21,7 @@
>
<Icon data={faClose} />
</Button>
<span class="font-bold">{title}</span>
<span class="font-bold truncate">{title}</span>
<div class="flex flex-row">
{#if $$slots.submission}
<slot name="submission" class="sticky" />
@@ -48,6 +48,7 @@
<Drawer
bind:this={drawer}
size="900px"
on:open={() => {
startCapturePoint()
interval = setInterval(() => {
@@ -56,7 +57,7 @@
}}
on:close={() => interval && clearInterval(interval)}
>
<DrawerContent title="Capture from a request to seed inputs" on:close={drawer.closeDrawer}>
<DrawerContent title="Capture request" on:close={drawer.closeDrawer}>
Send a payload at: <div>
<a
class="text-2xl"
@@ -183,9 +183,9 @@
><Tooltip>
Move the focus outside of the text editor to recompute the inputs or press
<Kbd>Ctrl/Cmd</Kbd> + <Kbd>S</Kbd>
</Tooltip>Inputs</Tab
</Tooltip><span class="font-semibold">Step Inputs</span></Tab
>
<Tab value="test">Test this step</Tab>
<Tab value="test"><span class="font-semibold text-md">Test this step</span></Tab>
<Tab value="retries">Retries</Tab>
{#if !$selectedId.includes('failure')}
<Tab value="early-stop">Early Stop</Tab>
@@ -2,8 +2,6 @@
import Drawer from '$lib/components/common/drawer/Drawer.svelte'
import DrawerContent from '$lib/components/common/drawer/DrawerContent.svelte'
import Menu from '$lib/components/common/menu/Menu.svelte'
import MenuItem from '$lib/components/common/menu/MenuItem.svelte'
import FlowViewer from '$lib/components/FlowViewer.svelte'
import SimpleEditor from '$lib/components/SimpleEditor.svelte'
import { sendUserToast } from '$lib/utils'
@@ -13,7 +13,8 @@
isFirst
hasLine
selected={$selectedId === 'inputs'}
label="Inputs"
bold
label="Flow Inputs"
>
<div slot="icon">
<Icon data={faPen} scale={0.8} />
@@ -15,6 +15,7 @@
export let retry: boolean = false
export let earlyStop: boolean = false
export let suspend: boolean = false
export let bold: boolean = false
export let id: string | undefined = undefined
export let label: string
@@ -72,7 +73,7 @@
<div
class="flex justify-between items-center w-full overflow-hidden border p-2 bg-white text-sm"
>
<div class="flex-1 truncate">{label}</div>
<div class="flex-1 truncate" class:font-bold={bold}>{label}</div>
<div class="flex items-center space-x-2">
{#if id}
<Badge color="indigo">{id}</Badge>