windmill-components 1.35.42 → 1.36.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/AppConnect.svelte +85 -59
- package/components/ArgInput.svelte +50 -33
- package/components/ArgInput.svelte.d.ts +1 -1
- package/components/Button.svelte +15 -48
- package/components/Button.svelte.d.ts +1 -1
- package/components/CronInput.svelte +1 -1
- package/components/DisplayResult.svelte +75 -67
- package/components/Dropdown.svelte +9 -7
- package/components/Editor.svelte +187 -178
- package/components/Editor.svelte.d.ts +4 -2
- package/components/EditorBar.svelte +135 -98
- package/components/EditorBar.svelte.d.ts +2 -1
- package/components/FlowBuilder.svelte +115 -134
- package/components/FlowJobResult.svelte +4 -5
- package/components/FlowModulesViewer.svelte +89 -7
- package/components/FlowModulesViewer.svelte.d.ts +1 -0
- package/components/FlowPreviewContent.svelte +88 -27
- package/components/FlowPreviewContent.svelte.d.ts +1 -1
- package/components/FlowStatusViewer.svelte +39 -24
- package/components/FlowStatusViewer.svelte.d.ts +0 -1
- package/components/FlowViewer.svelte +17 -11
- package/components/GroupModal.svelte +10 -1
- package/components/HighlightCode.svelte +22 -0
- package/components/HighlightCode.svelte.d.ts +17 -0
- package/components/IconedPath.svelte +9 -7
- package/components/InputTransformForm.svelte +97 -115
- package/components/InputTransformForm.svelte.d.ts +0 -1
- package/components/InputTransformsViewer.svelte +1 -1
- package/components/InviteGlobalUser.svelte +8 -8
- package/components/InviteUser.svelte +9 -9
- package/components/ItemPicker.svelte +37 -30
- package/components/ItemPicker.svelte.d.ts +2 -1
- package/components/JobStatus.svelte +2 -1
- package/components/LogViewer.svelte +23 -0
- package/components/LogViewer.svelte.d.ts +19 -0
- package/components/ModulePreview.svelte +107 -0
- package/components/ModulePreview.svelte.d.ts +24 -0
- package/components/Path.svelte +1 -1
- package/components/RadioButton.svelte +3 -2
- package/components/ResourceEditor.svelte +22 -34
- package/components/ResourceTypePicker.svelte +23 -34
- package/components/RunForm.svelte +34 -31
- package/components/RunForm.svelte.d.ts +6 -2
- package/components/SchemaEditor.svelte +19 -11
- package/components/SchemaForm.svelte +3 -3
- package/components/SchemaForm.svelte.d.ts +1 -1
- package/components/SchemaModal.svelte +18 -7
- package/components/ScriptBuilder.svelte +99 -83
- package/components/ScriptBuilder.svelte.d.ts +2 -4
- package/components/ScriptEditor.svelte +71 -143
- package/components/ScriptEditor.svelte.d.ts +0 -5
- package/components/ScriptPicker.svelte +24 -14
- package/components/ScriptPicker.svelte.d.ts +2 -1
- package/components/ScriptSchema.svelte +8 -11
- package/components/ScriptSchema.svelte.d.ts +0 -1
- package/components/ShareModal.svelte +6 -6
- package/components/SharedBadge.svelte +5 -13
- package/components/SimpleEditor.svelte +14 -10
- package/components/StringTypeNarrowing.svelte +24 -30
- package/components/TestJobLoader.svelte +106 -0
- package/components/TestJobLoader.svelte.d.ts +26 -0
- package/components/Tooltip.svelte +3 -2
- package/components/VariableEditor.svelte +15 -24
- package/components/common/actionRow/ActionRow.svelte +31 -0
- package/components/common/actionRow/ActionRow.svelte.d.ts +22 -0
- package/components/common/alert/Alert.svelte +53 -0
- package/components/common/alert/Alert.svelte.d.ts +20 -0
- package/components/common/alert/model.d.ts +1 -0
- package/components/common/alert/model.js +1 -0
- package/components/common/badge/Badge.svelte +76 -0
- package/components/common/badge/Badge.svelte.d.ts +28 -0
- package/components/common/badge/model.d.ts +8 -0
- package/components/common/badge/model.js +1 -0
- package/components/common/button/Button.svelte +110 -0
- package/components/common/button/Button.svelte.d.ts +39 -0
- package/components/common/button/model.d.ts +6 -0
- package/components/common/button/model.js +1 -0
- package/components/common/confirmationModal/ConfirmationModal.svelte +72 -0
- package/components/common/confirmationModal/ConfirmationModal.svelte.d.ts +23 -0
- package/components/common/confirmationModal/UnsavedConfirmationModal.svelte +41 -0
- package/components/common/confirmationModal/UnsavedConfirmationModal.svelte.d.ts +14 -0
- package/components/common/confirmationModal/dirtyStore.d.ts +1 -0
- package/components/common/confirmationModal/dirtyStore.js +2 -0
- package/components/common/drawer/Drawer.svelte +3 -0
- package/components/common/drawer/Drawer.svelte.d.ts +2 -0
- package/components/common/index.d.ts +14 -0
- package/components/common/index.js +14 -0
- package/components/common/tabs/TabContent.svelte +3 -2
- package/components/common/tabs/TabContent.svelte.d.ts +1 -0
- package/components/common/tabs/Tabs.svelte +8 -1
- package/components/common/tabs/Tabs.svelte.d.ts +2 -0
- package/components/common/toggleButton/ToggleButton.svelte +20 -0
- package/components/common/toggleButton/ToggleButton.svelte.d.ts +19 -0
- package/components/common/toggleButton/ToggleButtonGroup.svelte +33 -0
- package/components/common/toggleButton/ToggleButtonGroup.svelte.d.ts +24 -0
- package/components/flows/FlowEditor.svelte +30 -0
- package/components/{FlowEditor.svelte.d.ts → flows/FlowEditor.svelte.d.ts} +1 -6
- package/components/flows/common/FlowCard.svelte +9 -0
- package/components/flows/common/FlowCard.svelte.d.ts +21 -0
- package/components/flows/common/FlowCardHeader.svelte +39 -0
- package/components/flows/common/FlowCardHeader.svelte.d.ts +20 -0
- package/components/flows/content/CopyFirstStepSchema.svelte +13 -0
- package/components/flows/{CopyFirstStepSchema.svelte.d.ts → content/CopyFirstStepSchema.svelte.d.ts} +0 -0
- package/components/flows/{DynamicInputHelpBox.svelte → content/DynamicInputHelpBox.svelte} +0 -0
- package/components/flows/{DynamicInputHelpBox.svelte.d.ts → content/DynamicInputHelpBox.svelte.d.ts} +0 -0
- package/components/flows/content/FlowEditorPanel.svelte +25 -0
- package/components/flows/content/FlowEditorPanel.svelte.d.ts +16 -0
- package/components/flows/content/FlowFailureModule.svelte +15 -0
- package/components/flows/content/FlowFailureModule.svelte.d.ts +14 -0
- package/components/flows/content/FlowInput.svelte +26 -0
- package/components/flows/{FlowInput.svelte.d.ts → content/FlowInput.svelte.d.ts} +0 -0
- package/components/flows/content/FlowInputs.svelte +91 -0
- package/components/flows/{FlowInputs.svelte.d.ts → content/FlowInputs.svelte.d.ts} +1 -0
- package/components/flows/content/FlowLoop.svelte +168 -0
- package/components/flows/content/FlowLoop.svelte.d.ts +18 -0
- package/components/flows/content/FlowLoopWrapper.svelte +9 -0
- package/components/flows/content/FlowLoopWrapper.svelte.d.ts +14 -0
- package/components/flows/content/FlowModule.svelte +211 -0
- package/components/flows/content/FlowModule.svelte.d.ts +29 -0
- package/components/flows/content/FlowModuleEarlyStop.svelte +76 -0
- package/components/flows/content/FlowModuleEarlyStop.svelte.d.ts +17 -0
- package/components/flows/content/FlowModuleHeader.svelte +157 -0
- package/components/flows/{FlowModuleHeader.svelte.d.ts → content/FlowModuleHeader.svelte.d.ts} +5 -3
- package/components/flows/content/FlowModuleScript.svelte +21 -0
- package/components/flows/content/FlowModuleScript.svelte.d.ts +17 -0
- package/components/flows/content/FlowModuleSuspend.svelte +27 -0
- package/components/flows/content/FlowModuleSuspend.svelte.d.ts +17 -0
- package/components/flows/content/FlowModuleWrapper.svelte +45 -0
- package/components/flows/content/FlowModuleWrapper.svelte.d.ts +14 -0
- package/components/flows/content/FlowRetries.svelte +80 -0
- package/components/flows/content/FlowRetries.svelte.d.ts +17 -0
- package/components/flows/content/FlowSchedules.svelte +18 -0
- package/components/flows/content/FlowSchedules.svelte.d.ts +14 -0
- package/components/flows/content/FlowSettings.svelte +78 -0
- package/components/flows/{FlowSettings.svelte.d.ts → content/FlowSettings.svelte.d.ts} +2 -6
- package/components/flows/content/RemoveStepConfirmationModal.svelte +32 -0
- package/components/flows/content/RemoveStepConfirmationModal.svelte.d.ts +19 -0
- package/components/flows/flowState.d.ts +8 -7
- package/components/flows/flowState.js +25 -46
- package/components/flows/flowStateUtils.d.ts +16 -14
- package/components/flows/flowStateUtils.js +81 -73
- package/components/flows/flowStore.js +7 -4
- package/components/flows/header/FlowImportExportMenu.svelte +55 -0
- package/components/flows/header/FlowImportExportMenu.svelte.d.ts +14 -0
- package/components/flows/header/FlowPreviewButtons.svelte +57 -0
- package/components/flows/header/FlowPreviewButtons.svelte.d.ts +14 -0
- package/components/flows/map/FlowErrorHandlerItem.svelte +60 -0
- package/components/flows/map/FlowErrorHandlerItem.svelte.d.ts +14 -0
- package/components/flows/map/FlowModuleSchemaItem.svelte +80 -0
- package/components/flows/map/FlowModuleSchemaItem.svelte.d.ts +32 -0
- package/components/flows/map/FlowModuleSchemaMap.svelte +241 -0
- package/components/flows/map/FlowModuleSchemaMap.svelte.d.ts +20 -0
- package/components/flows/pickers/PickHubScript.svelte +5 -3
- package/components/flows/pickers/PickHubScript.svelte.d.ts +2 -1
- package/components/flows/pickers/PickScript.svelte +4 -12
- package/components/flows/pickers/PickScript.svelte.d.ts +1 -1
- package/components/flows/propPicker/PropPickerWrapper.svelte +44 -0
- package/components/flows/propPicker/PropPickerWrapper.svelte.d.ts +33 -0
- package/components/flows/scheduleUtils.d.ts +0 -1
- package/components/flows/scheduleUtils.js +0 -1
- package/components/flows/types.d.ts +8 -0
- package/components/flows/types.js +1 -0
- package/components/flows/utils.d.ts +3 -1
- package/components/flows/utils.js +26 -10
- package/components/icons/AirtableIcon.svelte +1 -1
- package/components/icons/DiscordIcon.svelte +1 -1
- package/components/icons/GCloudIcon.svelte +1 -1
- package/components/icons/GItlabIcon.svelte +1 -1
- package/components/icons/GSheetsIcon.svelte +1 -1
- package/components/icons/GcalIcon.svelte +1 -1
- package/components/icons/GdriveIcon.svelte +1 -1
- package/components/icons/GithubIcon.svelte +1 -1
- package/components/icons/GmailIcon.svelte +1 -1
- package/components/icons/HatIcon.svelte +19 -0
- package/components/icons/HatIcon.svelte.d.ts +16 -0
- package/components/icons/MastodonIcon.svelte +1 -1
- package/components/icons/MatrixIcon.svelte +1 -1
- package/components/icons/PostgresIcon.svelte +1 -1
- package/components/icons/S3Icon.svelte +1 -1
- package/components/icons/Slack.svelte +1 -1
- package/components/icons/TogglIcon.svelte +8 -46
- package/components/jobs/JobDetail.svelte +1 -1
- package/components/landing/FlowGettingStarted.svelte +22 -68
- package/components/landing/FlowLandingBox.svelte +1 -1
- package/components/landing/RessourceGettingStarted.svelte +7 -37
- package/components/landing/ScriptBox.svelte +33 -60
- package/components/landing/ScriptGettingStarted.svelte +23 -69
- package/components/propertyPicker/ObjectViewer.svelte +18 -12
- package/components/propertyPicker/ObjectViewer.svelte.d.ts +1 -0
- package/components/propertyPicker/PropPicker.svelte +108 -11
- package/components/propertyPicker/WarningMessage.svelte +2 -15
- package/components/script_editor/LogPanel.svelte +108 -119
- package/components/script_editor/LogPanel.svelte.d.ts +2 -0
- package/components/sidebar/SidebarContent.svelte +2 -2
- package/editorUtils.d.ts +3 -0
- package/editorUtils.js +1 -0
- package/gen/core/OpenAPI.js +1 -1
- package/gen/index.d.ts +1 -0
- package/gen/models/CompletedJob.d.ts +2 -1
- package/gen/models/CompletedJob.js +1 -0
- package/gen/models/FlowModule.d.ts +3 -0
- package/gen/models/FlowStatus.d.ts +3 -0
- package/gen/models/FlowStatusModule.d.ts +1 -1
- package/gen/models/Preview.d.ts +2 -1
- package/gen/models/Preview.js +1 -0
- package/gen/models/QueuedJob.d.ts +2 -1
- package/gen/models/QueuedJob.js +1 -0
- package/gen/models/RawScript.d.ts +2 -1
- package/gen/models/RawScript.js +1 -0
- package/gen/models/Retry.d.ts +11 -0
- package/gen/models/Retry.js +4 -0
- package/gen/models/Script.d.ts +9 -2
- package/gen/models/Script.js +8 -0
- package/gen/services/JobService.d.ts +40 -0
- package/gen/services/JobService.js +70 -0
- package/gen/services/ScriptService.d.ts +14 -3
- package/gen/services/ScriptService.js +13 -0
- package/infer.d.ts +1 -1
- package/infer.js +6 -1
- package/package.json +71 -38
- package/script_helpers.d.ts +8 -2
- package/script_helpers.js +88 -16
- package/stores.d.ts +1 -1
- package/utils.d.ts +8 -6
- package/utils.js +57 -21
- package/components/FlowEditor.svelte +0 -55
- package/components/FlowPreview.svelte +0 -107
- package/components/FlowPreview.svelte.d.ts +0 -23
- package/components/ModuleStep.svelte +0 -131
- package/components/ModuleStep.svelte.d.ts +0 -25
- package/components/flows/CopyFirstStepSchema.svelte +0 -13
- package/components/flows/FlowBox.svelte +0 -16
- package/components/flows/FlowBox.svelte.d.ts +0 -23
- package/components/flows/FlowBoxHeader.svelte +0 -16
- package/components/flows/FlowBoxHeader.svelte.d.ts +0 -21
- package/components/flows/FlowInput.svelte +0 -22
- package/components/flows/FlowInputs.svelte +0 -65
- package/components/flows/FlowModuleHeader.svelte +0 -109
- package/components/flows/FlowSettings.svelte +0 -165
- package/components/flows/FlowTimeline.svelte +0 -169
- package/components/flows/FlowTimeline.svelte.d.ts +0 -21
- package/components/flows/stepOpenedStore.d.ts +0 -1
- package/components/flows/stepOpenedStore.js +0 -6
- package/components/propertyPicker/OverlayPropertyPicker.svelte +0 -69
- package/components/propertyPicker/OverlayPropertyPicker.svelte.d.ts +0 -24
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import Tabs from './common/tabs/Tabs.svelte';
|
|
3
3
|
import Tab from './common/tabs/Tab.svelte';
|
|
4
4
|
import TabContent from './common/tabs/TabContent.svelte';
|
|
5
|
+
import LogViewer from './LogViewer.svelte';
|
|
5
6
|
export let job;
|
|
6
7
|
</script>
|
|
7
8
|
|
|
@@ -10,13 +11,11 @@ export let job;
|
|
|
10
11
|
<Tab value="results">Results</Tab>
|
|
11
12
|
<Tab value="logs">Logs</Tab>
|
|
12
13
|
<svelte:fragment slot="content">
|
|
13
|
-
<TabContent value="results" class="border p-2 h-36 overflow-
|
|
14
|
+
<TabContent value="results" class="border p-2 h-36 overflow-auto">
|
|
14
15
|
<DisplayResult result={job.result} />
|
|
15
16
|
</TabContent>
|
|
16
|
-
<TabContent value="logs" class="border
|
|
17
|
-
<
|
|
18
|
-
<pre class="w-full">{job.logs}</pre>
|
|
19
|
-
</div>
|
|
17
|
+
<TabContent value="logs" class="border h-36 overflow-auto">
|
|
18
|
+
<LogViewer content={job.logs ?? ''} isLoading={false} />
|
|
20
19
|
</TabContent>
|
|
21
20
|
</svelte:fragment>
|
|
22
21
|
</Tabs>
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
<script>import { scriptPathToHref } from '../utils';
|
|
2
|
-
import Highlight from 'svelte-highlight';
|
|
3
|
-
import python from 'svelte-highlight/languages/python';
|
|
4
|
-
import typescript from 'svelte-highlight/languages/typescript';
|
|
5
2
|
import { slide } from 'svelte/transition';
|
|
6
3
|
import InputTransformsViewer from './InputTransformsViewer.svelte';
|
|
7
4
|
import IconedPath from './IconedPath.svelte';
|
|
5
|
+
import HighlightCode from './HighlightCode.svelte';
|
|
6
|
+
import { faBug } from '@fortawesome/free-solid-svg-icons';
|
|
7
|
+
import Icon from 'svelte-awesome';
|
|
8
8
|
export let modules;
|
|
9
|
+
export let failureModule;
|
|
9
10
|
let open = {};
|
|
10
11
|
</script>
|
|
11
12
|
|
|
@@ -17,14 +18,15 @@ let open = {};
|
|
|
17
18
|
{#each modules ?? [] as mod, i}
|
|
18
19
|
<li class="w-full">
|
|
19
20
|
<div class="relative pb-8 w-full">
|
|
20
|
-
{#if i < (modules ?? []).length - 1}
|
|
21
|
+
{#if i < (modules ?? []).length - 1 || failureModule}
|
|
21
22
|
<span class="absolute top-4 left-4 -ml-px h-full w-0.5 bg-gray-200" aria-hidden="true" />
|
|
22
23
|
{/if}
|
|
23
24
|
<div class="relative flex space-x-3">
|
|
24
25
|
<div>
|
|
25
26
|
<span
|
|
26
27
|
class="h-8 w-8 rounded-full bg-blue-600 flex items-center justify-center ring-8 ring-white text-white"
|
|
27
|
-
|
|
28
|
+
>
|
|
29
|
+
{i + 1}
|
|
28
30
|
</span>
|
|
29
31
|
</div>
|
|
30
32
|
<div class="min-w-0 flex-1 pt-1.5 flex justify-between space-x-4 w-full">
|
|
@@ -75,8 +77,8 @@ let open = {};
|
|
|
75
77
|
{#if open[i]}
|
|
76
78
|
<div transition:slide class="border border-black p-2 bg-gray-50 w-full">
|
|
77
79
|
<InputTransformsViewer inputTransforms={mod?.input_transforms} />
|
|
78
|
-
<
|
|
79
|
-
language={mod?.value?.language
|
|
80
|
+
<HighlightCode
|
|
81
|
+
language={mod?.value?.language ?? 'deno'}
|
|
80
82
|
code={mod?.value?.content}
|
|
81
83
|
/>
|
|
82
84
|
</div>
|
|
@@ -94,4 +96,84 @@ let open = {};
|
|
|
94
96
|
</div>
|
|
95
97
|
</li>
|
|
96
98
|
{/each}
|
|
99
|
+
{#if failureModule}
|
|
100
|
+
<li class="w-full">
|
|
101
|
+
<div class="relative pb-8 w-full">
|
|
102
|
+
<div class="relative flex space-x-3">
|
|
103
|
+
<div>
|
|
104
|
+
<span
|
|
105
|
+
class="h-8 w-8 rounded-full bg-red-600 flex items-center justify-center ring-8 ring-white text-white"
|
|
106
|
+
>
|
|
107
|
+
<Icon data={faBug} />
|
|
108
|
+
</span>
|
|
109
|
+
</div>
|
|
110
|
+
<div class="min-w-0 flex-1 pt-1.5 flex justify-between space-x-4 w-full">
|
|
111
|
+
<div class="w-full">
|
|
112
|
+
<span class="text-black">{failureModule?.summary ?? ''}</span>
|
|
113
|
+
<p class="text-sm text-gray-500">
|
|
114
|
+
{#if failureModule?.value?.type == 'script'}
|
|
115
|
+
<a
|
|
116
|
+
target="_blank"
|
|
117
|
+
href={scriptPathToHref(failureModule?.value?.path ?? '')}
|
|
118
|
+
class="font-medium text-gray-900"
|
|
119
|
+
>
|
|
120
|
+
<IconedPath path={failureModule?.value?.path ?? ''} />
|
|
121
|
+
</a>
|
|
122
|
+
{#if failureModule?.value?.path?.startsWith('hub/')}
|
|
123
|
+
<div>
|
|
124
|
+
<button
|
|
125
|
+
on:click={async () => {
|
|
126
|
+
open[modules.length] = !open[modules.length]
|
|
127
|
+
}}
|
|
128
|
+
class="mb-2 underline text-black"
|
|
129
|
+
>
|
|
130
|
+
View code and inputs {open[modules.length] ? '(-)' : '(+)'}</button
|
|
131
|
+
>
|
|
132
|
+
{#if open[modules.length]}
|
|
133
|
+
<div class="border border-black p-2 bg-gray-50 divide-y">
|
|
134
|
+
<InputTransformsViewer
|
|
135
|
+
inputTransforms={failureModule?.input_transforms}
|
|
136
|
+
/>
|
|
137
|
+
<div class="w-full h-full mt-6">
|
|
138
|
+
<iframe
|
|
139
|
+
style="height: 400px;"
|
|
140
|
+
class="w-full h-full text-sm"
|
|
141
|
+
title="embedded script from hub"
|
|
142
|
+
frameborder="0"
|
|
143
|
+
src="https://hub.windmill.dev/embed/script/{failureModule?.value?.path?.substring(
|
|
144
|
+
4
|
|
145
|
+
)}"
|
|
146
|
+
/>
|
|
147
|
+
</div>
|
|
148
|
+
</div>
|
|
149
|
+
{/if}
|
|
150
|
+
</div>
|
|
151
|
+
{/if}
|
|
152
|
+
{:else if failureModule?.value?.type == 'rawscript'}
|
|
153
|
+
<button
|
|
154
|
+
on:click={() => (open[modules.length] = !open[modules.length])}
|
|
155
|
+
class="mb-2 underline text-black"
|
|
156
|
+
>
|
|
157
|
+
Error handler: Raw {failureModule?.value?.language} script {open[modules.length]
|
|
158
|
+
? '(-)'
|
|
159
|
+
: '(+)'}</button
|
|
160
|
+
>
|
|
161
|
+
|
|
162
|
+
{#if open[modules.length]}
|
|
163
|
+
<div transition:slide class="border border-black p-2 bg-gray-50 w-full">
|
|
164
|
+
<InputTransformsViewer inputTransforms={failureModule?.input_transforms} />
|
|
165
|
+
<HighlightCode
|
|
166
|
+
language={failureModule?.value?.language ?? 'deno'}
|
|
167
|
+
code={failureModule?.value?.content}
|
|
168
|
+
/>
|
|
169
|
+
</div>
|
|
170
|
+
{/if}
|
|
171
|
+
{/if}
|
|
172
|
+
</p>
|
|
173
|
+
</div>
|
|
174
|
+
</div>
|
|
175
|
+
</div>
|
|
176
|
+
</div>
|
|
177
|
+
</li>
|
|
178
|
+
{/if}
|
|
97
179
|
</ul>
|
|
@@ -1,53 +1,104 @@
|
|
|
1
1
|
<script>import { JobService } from '../gen';
|
|
2
2
|
import { workspaceStore } from '../stores';
|
|
3
|
-
import { faClose, faPlay } from '@fortawesome/free-solid-svg-icons';
|
|
4
|
-
import { Button } from '
|
|
5
|
-
import { createEventDispatcher, onDestroy } from 'svelte';
|
|
3
|
+
import { faClose, faPlay, faRefresh } from '@fortawesome/free-solid-svg-icons';
|
|
4
|
+
import { Button } from './common';
|
|
5
|
+
import { createEventDispatcher, getContext, onDestroy } from 'svelte';
|
|
6
6
|
import Icon from 'svelte-awesome';
|
|
7
|
-
import { flowStateStore
|
|
7
|
+
import { flowStateStore } from './flows/flowState';
|
|
8
8
|
import { mapJobResultsToFlowState } from './flows/flowStateUtils';
|
|
9
9
|
import { flowStore } from './flows/flowStore';
|
|
10
|
-
import { runFlowPreview } from './flows/utils';
|
|
11
|
-
import FlowStatusViewer from './FlowStatusViewer.svelte';
|
|
10
|
+
import { runFlowPreview, selectedIdToIndexes } from './flows/utils';
|
|
12
11
|
import SchemaForm from './SchemaForm.svelte';
|
|
13
|
-
|
|
12
|
+
import FlowStatusViewer from '../components/FlowStatusViewer.svelte';
|
|
13
|
+
export let previewMode;
|
|
14
14
|
let jobId = undefined;
|
|
15
15
|
let isValid = false;
|
|
16
|
-
let
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
let isRunning = false;
|
|
17
|
+
const { selectedId, previewArgs } = getContext('FlowEditorContext');
|
|
18
|
+
function extractFlow(previewMode) {
|
|
19
|
+
if (previewMode === 'whole') {
|
|
20
|
+
return $flowStore;
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
let [parentIndex, childIndex] = selectedIdToIndexes($selectedId);
|
|
24
|
+
const flow = JSON.parse(JSON.stringify($flowStore));
|
|
25
|
+
const modules = flow.value.modules.slice(0, Number(parentIndex) + 1);
|
|
26
|
+
flow.value.modules = modules;
|
|
27
|
+
if (childIndex != undefined) {
|
|
28
|
+
console.log(modules);
|
|
29
|
+
const lastModule = modules[modules.length - 1].value;
|
|
30
|
+
if (lastModule.type === 'forloopflow') {
|
|
31
|
+
lastModule.modules = lastModule.modules.slice(0, Number(childIndex) + 1);
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
throw Error('Excepted forloopflow module');
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
return flow;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
19
40
|
const dispatch = createEventDispatcher();
|
|
20
41
|
export async function runPreview(args) {
|
|
42
|
+
const newFlow = extractFlow(previewMode);
|
|
21
43
|
jobId = await runFlowPreview(args, newFlow);
|
|
22
|
-
|
|
44
|
+
isRunning = true;
|
|
45
|
+
}
|
|
46
|
+
function onKeyDown(event) {
|
|
47
|
+
switch (event.key) {
|
|
48
|
+
case 'Enter':
|
|
49
|
+
if (event.ctrlKey) {
|
|
50
|
+
event.preventDefault();
|
|
51
|
+
runPreview($previewArgs);
|
|
52
|
+
}
|
|
53
|
+
break;
|
|
54
|
+
case 'Escape':
|
|
55
|
+
dispatch('close');
|
|
56
|
+
break;
|
|
57
|
+
}
|
|
23
58
|
}
|
|
24
|
-
onDestroy(() => {
|
|
25
|
-
intervalState = 'done';
|
|
26
|
-
});
|
|
27
59
|
</script>
|
|
28
60
|
|
|
61
|
+
<svelte:window on:keydown={onKeyDown} />
|
|
62
|
+
|
|
29
63
|
<div class="flex divide-y flex-col space-y-2 h-screen bg-white p-6 w-full">
|
|
30
64
|
<div class="flex justify-between">
|
|
31
|
-
<div class="flex flex-row justify-center items-center">
|
|
32
|
-
<div class="flex justify-center p-2 w-8 h-8 bg-blue-200 rounded-lg mr-2">
|
|
65
|
+
<div class="flex flex-row justify-center items-center ">
|
|
66
|
+
<div class="flex justify-center p-2 w-8 h-8 bg-blue-200 rounded-lg mr-2 ">
|
|
33
67
|
<Icon data={faPlay} scale={1} class="text-blue-500" />
|
|
34
68
|
</div>
|
|
35
69
|
|
|
36
|
-
<h3 class="text-lg leading-6 font-bold text-gray-900">
|
|
70
|
+
<h3 class="text-lg leading-6 font-bold text-gray-900">
|
|
71
|
+
Test preview - {previewMode === 'upTo'
|
|
72
|
+
? `up to step ${$selectedId.split('-').join(',')}`
|
|
73
|
+
: ' whole flow'}
|
|
74
|
+
</h3>
|
|
37
75
|
</div>
|
|
38
|
-
<Button
|
|
76
|
+
<Button
|
|
77
|
+
variant="border"
|
|
78
|
+
size="lg"
|
|
79
|
+
color="dark"
|
|
80
|
+
btnClasses="!p-0 !w-8 !h-8"
|
|
81
|
+
on:click={() => {
|
|
82
|
+
dispatch('close')
|
|
83
|
+
}}
|
|
84
|
+
>
|
|
39
85
|
<Icon data={faClose} />
|
|
40
86
|
</Button>
|
|
41
87
|
</div>
|
|
42
|
-
<div class="max-h-
|
|
43
|
-
<SchemaForm
|
|
88
|
+
<div class="grow pb-8 max-h-1/2 overflow-auto">
|
|
89
|
+
<SchemaForm
|
|
90
|
+
class="h-full pt-4"
|
|
91
|
+
schema={$flowStore.schema}
|
|
92
|
+
bind:isValid
|
|
93
|
+
bind:args={$previewArgs}
|
|
94
|
+
/>
|
|
44
95
|
</div>
|
|
45
|
-
{#if
|
|
96
|
+
{#if isRunning}
|
|
46
97
|
<Button
|
|
47
98
|
disabled={!isValid}
|
|
48
99
|
color="red"
|
|
49
100
|
on:click={async () => {
|
|
50
|
-
|
|
101
|
+
isRunning = false
|
|
51
102
|
try {
|
|
52
103
|
jobId &&
|
|
53
104
|
(await JobService.cancelQueuedJob({
|
|
@@ -63,8 +114,16 @@ onDestroy(() => {
|
|
|
63
114
|
Cancel
|
|
64
115
|
</Button>
|
|
65
116
|
{:else}
|
|
66
|
-
<Button
|
|
67
|
-
|
|
117
|
+
<Button
|
|
118
|
+
variant="contained"
|
|
119
|
+
endIcon={{ icon: isRunning ? faRefresh : faPlay }}
|
|
120
|
+
size="lg"
|
|
121
|
+
color="blue"
|
|
122
|
+
btnClasses="w-full"
|
|
123
|
+
disabled={!isValid}
|
|
124
|
+
on:click={() => runPreview($previewArgs)}
|
|
125
|
+
>
|
|
126
|
+
Test flow (Ctrl/Cmd + Enter)
|
|
68
127
|
</Button>
|
|
69
128
|
{/if}
|
|
70
129
|
|
|
@@ -73,10 +132,12 @@ onDestroy(() => {
|
|
|
73
132
|
<FlowStatusViewer
|
|
74
133
|
{jobId}
|
|
75
134
|
on:jobsLoaded={(e) => {
|
|
76
|
-
|
|
77
|
-
|
|
135
|
+
isRunning = false
|
|
136
|
+
const parentIndex = selectedIdToIndexes($selectedId)[0]
|
|
137
|
+
const upToIndex =
|
|
138
|
+
previewMode === 'upTo' ? Number(parentIndex) + 1 : $flowStateStore.modules.length
|
|
139
|
+
mapJobResultsToFlowState(e.detail, upToIndex)
|
|
78
140
|
}}
|
|
79
|
-
root={true}
|
|
80
141
|
/>
|
|
81
142
|
{/if}
|
|
82
143
|
</div>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<script>import { JobService } from '../gen';
|
|
1
|
+
<script>import { FlowStatusModule, JobService } from '../gen';
|
|
2
2
|
import { workspaceStore } from '../stores';
|
|
3
3
|
import FlowJobResult from './FlowJobResult.svelte';
|
|
4
4
|
import FlowPreviewStatus from './preview/FlowPreviewStatus.svelte';
|
|
@@ -9,7 +9,6 @@ import { createEventDispatcher } from 'svelte';
|
|
|
9
9
|
import { onDestroy } from 'svelte';
|
|
10
10
|
const dispatch = createEventDispatcher();
|
|
11
11
|
export let jobId;
|
|
12
|
-
export let root = false;
|
|
13
12
|
export let forloopJobIds = undefined;
|
|
14
13
|
export let jobResult = {
|
|
15
14
|
job: undefined,
|
|
@@ -18,6 +17,7 @@ export let jobResult = {
|
|
|
18
17
|
};
|
|
19
18
|
let forloop_selected = '';
|
|
20
19
|
let timeout;
|
|
20
|
+
$: innerModules = jobResult?.job?.flow_status?.modules ?? [];
|
|
21
21
|
async function loadJobInProgress() {
|
|
22
22
|
const job = await JobService.getJob({
|
|
23
23
|
workspace: $workspaceStore ?? '',
|
|
@@ -28,14 +28,8 @@ async function loadJobInProgress() {
|
|
|
28
28
|
if (job?.type !== 'CompletedJob') {
|
|
29
29
|
timeout = setTimeout(() => loadJobInProgress(), 500);
|
|
30
30
|
}
|
|
31
|
-
else if (root) {
|
|
32
|
-
dispatch('jobsLoaded', jobResult);
|
|
33
|
-
}
|
|
34
31
|
}
|
|
35
|
-
$:
|
|
36
|
-
jobResult.job &&
|
|
37
|
-
Array.isArray(jobResult.job?.raw_flow?.modules) &&
|
|
38
|
-
jobResult.job?.raw_flow?.modules.length > 1;
|
|
32
|
+
$: jobResult && jobResult.job?.type === 'CompletedJob' && dispatch('jobsLoaded', jobResult);
|
|
39
33
|
function updateJobId() {
|
|
40
34
|
if (jobId !== jobResult.job?.id) {
|
|
41
35
|
loadJobInProgress();
|
|
@@ -49,7 +43,9 @@ onDestroy(() => {
|
|
|
49
43
|
|
|
50
44
|
{#if jobResult.job}
|
|
51
45
|
<div class="flow-root w-full space-y-4">
|
|
52
|
-
|
|
46
|
+
{#if innerModules.length > 0}
|
|
47
|
+
<h3 class="text-md leading-6 font-bold text-gray-900 border-b pb-2">Flow result</h3>
|
|
48
|
+
{/if}
|
|
53
49
|
<FlowPreviewStatus job={jobResult.job} />
|
|
54
50
|
{#if `result` in jobResult.job}
|
|
55
51
|
<FlowJobResult job={jobResult.job} />
|
|
@@ -87,32 +83,51 @@ onDestroy(() => {
|
|
|
87
83
|
<svelte:self jobId={loopJobId} bind:jobResult={jobResult.loopJobs[j]} />
|
|
88
84
|
</div>
|
|
89
85
|
{/each}
|
|
90
|
-
{:else if
|
|
86
|
+
{:else if innerModules.length > 0}
|
|
91
87
|
<ul class="w-full">
|
|
92
88
|
<h3 class="text-md leading-6 font-bold text-gray-900 border-b mb-4 py-2">
|
|
93
|
-
|
|
89
|
+
Step-by-step results
|
|
94
90
|
</h3>
|
|
95
91
|
|
|
96
|
-
{#each
|
|
97
|
-
<p class="text-gray-500 mb-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
92
|
+
{#each innerModules as mod, i}
|
|
93
|
+
<p class="text-gray-500 mb-2 w-full ">
|
|
94
|
+
{#if jobResult.job?.raw_flow?.modules && i < jobResult.job?.raw_flow?.modules.length}
|
|
95
|
+
Step
|
|
96
|
+
<span class="font-medium text-gray-900">
|
|
97
|
+
{i + 1}
|
|
98
|
+
</span>
|
|
99
|
+
out of
|
|
100
|
+
<span class="font-medium text-gray-900"
|
|
101
|
+
>{jobResult.job?.raw_flow?.modules.length}</span
|
|
102
|
+
>
|
|
103
|
+
{#if jobResult.job.raw_flow?.modules[i]?.summary}
|
|
104
|
+
: <span class="font-medium text-gray-900"
|
|
105
|
+
>{jobResult.job.raw_flow?.modules[i]?.summary ?? ''}</span
|
|
106
|
+
>
|
|
107
|
+
{/if}
|
|
108
|
+
{:else}
|
|
109
|
+
<span class="font-medium text-gray-900"> Failure module </span>
|
|
110
|
+
{/if}
|
|
101
111
|
</p>
|
|
102
112
|
|
|
103
|
-
|
|
104
|
-
|
|
113
|
+
<li class="w-full border p-6 space-y-2">
|
|
114
|
+
{#if [FlowStatusModule.type.IN_PROGRESS, FlowStatusModule.type.SUCCESS, FlowStatusModule.type.FAILURE].includes(mod.type)}
|
|
105
115
|
<svelte:self
|
|
106
|
-
jobId={
|
|
116
|
+
jobId={mod.job}
|
|
107
117
|
bind:jobResult={jobResult.innerJobs[i]}
|
|
108
|
-
forloopJobIds={
|
|
118
|
+
forloopJobIds={mod.forloop_jobs}
|
|
119
|
+
on:jobsLoaded={(e) => {
|
|
120
|
+
jobResult = jobResult
|
|
121
|
+
}}
|
|
109
122
|
/>
|
|
110
|
-
|
|
111
|
-
|
|
123
|
+
{:else}
|
|
124
|
+
<span>{mod.type}</span>
|
|
125
|
+
{/if}
|
|
126
|
+
</li>
|
|
112
127
|
{/each}
|
|
113
128
|
</ul>
|
|
114
129
|
{/if}
|
|
115
130
|
</div>
|
|
116
131
|
{:else}
|
|
117
|
-
|
|
132
|
+
Job loading...
|
|
118
133
|
{/if}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
<script>import Highlight from 'svelte-highlight';
|
|
2
2
|
import json from 'svelte-highlight/languages/json';
|
|
3
|
-
import
|
|
4
|
-
import Tab from './common
|
|
5
|
-
import TabContent from './common/tabs/TabContent.svelte';
|
|
3
|
+
import { faClipboard } from '@fortawesome/free-solid-svg-icons';
|
|
4
|
+
import { Tab, Tabs, TabContent, Button } from './common';
|
|
6
5
|
import SchemaViewer from './SchemaViewer.svelte';
|
|
7
6
|
import FieldHeader from './FieldHeader.svelte';
|
|
8
7
|
import SvelteMarkdown from 'svelte-markdown';
|
|
9
8
|
import FlowModulesViewer from './FlowModulesViewer.svelte';
|
|
9
|
+
import { copyToClipboard } from '../utils';
|
|
10
10
|
export let flow;
|
|
11
11
|
export let initialOpen = undefined;
|
|
12
|
-
|
|
12
|
+
$: flowFiltered = {
|
|
13
13
|
summary: flow.summary,
|
|
14
14
|
description: flow.description,
|
|
15
15
|
value: flow.value,
|
|
@@ -61,18 +61,24 @@ function toAny(x) {
|
|
|
61
61
|
{:else}
|
|
62
62
|
<div class="text-gray-700 text-xs italic mb-4">No inputs</div>
|
|
63
63
|
{/if}
|
|
64
|
-
<FlowModulesViewer
|
|
64
|
+
<FlowModulesViewer
|
|
65
|
+
modules={flow?.value?.modules}
|
|
66
|
+
failureModule={flow?.value?.failure_module}
|
|
67
|
+
/>
|
|
65
68
|
</div>
|
|
66
69
|
</TabContent>
|
|
67
70
|
<TabContent value="json">
|
|
68
71
|
<div class="relative">
|
|
69
|
-
<
|
|
70
|
-
on:click={
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
72
|
+
<Button
|
|
73
|
+
on:click={() => copyToClipboard(JSON.stringify(flowFiltered, null, 4))}
|
|
74
|
+
color="dark"
|
|
75
|
+
variant="border"
|
|
76
|
+
size="sm"
|
|
77
|
+
startIcon={{ icon: faClipboard }}
|
|
78
|
+
btnClasses="absolute top-2 right-2"
|
|
75
79
|
>
|
|
80
|
+
Copy content
|
|
81
|
+
</Button>
|
|
76
82
|
<Highlight language={json} code={JSON.stringify(flowFiltered, null, 4)} />
|
|
77
83
|
</div>
|
|
78
84
|
</TabContent>
|
|
@@ -5,6 +5,7 @@ import AutoComplete from 'simple-svelte-autocomplete';
|
|
|
5
5
|
import PageHeader from './PageHeader.svelte';
|
|
6
6
|
import TableCustom from './TableCustom.svelte';
|
|
7
7
|
import { canWrite } from '../utils';
|
|
8
|
+
import { Button } from './common';
|
|
8
9
|
let name = '';
|
|
9
10
|
let modal;
|
|
10
11
|
let can_write = false;
|
|
@@ -54,7 +55,15 @@ async function loadGroup() {
|
|
|
54
55
|
{#if can_write}
|
|
55
56
|
<div>
|
|
56
57
|
<AutoComplete items={usernames} bind:selectedItem={username} />
|
|
57
|
-
<
|
|
58
|
+
<Button
|
|
59
|
+
variant="contained"
|
|
60
|
+
color="blue"
|
|
61
|
+
size="sm"
|
|
62
|
+
btnClasses="!ml-4"
|
|
63
|
+
on:click={addToGroup}
|
|
64
|
+
>
|
|
65
|
+
Add member
|
|
66
|
+
</Button>
|
|
58
67
|
</div>
|
|
59
68
|
{/if}
|
|
60
69
|
</PageHeader>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<script>import Highlight from 'svelte-highlight';
|
|
2
|
+
import python from 'svelte-highlight/languages/python';
|
|
3
|
+
import typescript from 'svelte-highlight/languages/typescript';
|
|
4
|
+
import go from 'svelte-highlight/languages/go';
|
|
5
|
+
export let code = '';
|
|
6
|
+
export let language;
|
|
7
|
+
function getLang(lang) {
|
|
8
|
+
switch (lang) {
|
|
9
|
+
case 'python3':
|
|
10
|
+
return python;
|
|
11
|
+
case 'deno':
|
|
12
|
+
return typescript;
|
|
13
|
+
case 'go':
|
|
14
|
+
return go;
|
|
15
|
+
default:
|
|
16
|
+
return python;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
$: lang = getLang(language);
|
|
20
|
+
</script>
|
|
21
|
+
|
|
22
|
+
<Highlight language={lang} {code} />
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: {
|
|
4
|
+
code?: string | undefined;
|
|
5
|
+
language: 'python3' | 'deno' | 'go' | undefined;
|
|
6
|
+
};
|
|
7
|
+
events: {
|
|
8
|
+
[evt: string]: CustomEvent<any>;
|
|
9
|
+
};
|
|
10
|
+
slots: {};
|
|
11
|
+
};
|
|
12
|
+
export declare type HighlightCodeProps = typeof __propDef.props;
|
|
13
|
+
export declare type HighlightCodeEvents = typeof __propDef.events;
|
|
14
|
+
export declare type HighlightCodeSlots = typeof __propDef.slots;
|
|
15
|
+
export default class HighlightCode extends SvelteComponentTyped<HighlightCodeProps, HighlightCodeEvents, HighlightCodeSlots> {
|
|
16
|
+
}
|
|
17
|
+
export {};
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
<script>import
|
|
1
|
+
<script>import Badge from './common/badge/Badge.svelte';
|
|
2
|
+
import IconedResourceType from './IconedResourceType.svelte';
|
|
2
3
|
export let path;
|
|
3
4
|
</script>
|
|
4
5
|
|
|
5
|
-
|
|
6
|
-
|
|
6
|
+
<div class="flex space-x-2 items-center">
|
|
7
|
+
{#if path.startsWith('hub/')}
|
|
7
8
|
<IconedResourceType name={path.split('/')[2]} silent={true} />
|
|
8
9
|
<span>{path}</span>
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
{/if}
|
|
10
|
+
{:else}
|
|
11
|
+
<Badge color="blue">Workspace</Badge>
|
|
12
|
+
<span>{path}</span>
|
|
13
|
+
{/if}
|
|
14
|
+
</div>
|