windmill-components 1.35.1 → 1.35.43
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/ArgInput.svelte +21 -21
- package/components/ArgInput.svelte.d.ts +3 -3
- package/components/DisplayResult.svelte +73 -67
- package/components/Editor.svelte +184 -246
- package/components/Editor.svelte.d.ts +4 -4
- package/components/EditorBar.svelte +58 -45
- package/components/EditorBar.svelte.d.ts +2 -1
- package/components/FlowBuilder.svelte +113 -121
- package/components/FlowJobResult.svelte +4 -5
- package/components/FlowModulesViewer.svelte +89 -7
- package/components/FlowModulesViewer.svelte.d.ts +1 -0
- package/components/FlowPreviewContent.svelte +56 -15
- package/components/FlowPreviewContent.svelte.d.ts +1 -1
- package/components/FlowStatusViewer.svelte +42 -24
- package/components/FlowStatusViewer.svelte.d.ts +0 -1
- package/components/FlowViewer.svelte +7 -3
- package/components/HighlightCode.svelte +21 -0
- package/components/HighlightCode.svelte.d.ts +17 -0
- package/components/IconedPath.svelte +9 -7
- package/components/IconedResourceType.svelte +1 -1
- package/components/InputTransformForm.svelte +88 -107
- package/components/InputTransformForm.svelte.d.ts +0 -1
- package/components/ItemPicker.svelte +2 -2
- package/components/LogViewer.svelte +23 -0
- package/components/LogViewer.svelte.d.ts +19 -0
- package/components/ModulePreview.svelte +108 -0
- package/components/ModulePreview.svelte.d.ts +24 -0
- package/components/RunForm.svelte +29 -18
- package/components/RunForm.svelte.d.ts +6 -2
- package/components/SchemaEditor.svelte +5 -3
- package/components/SchemaForm.svelte +0 -2
- package/components/SchemaForm.svelte.d.ts +0 -1
- package/components/ScriptBuilder.svelte +77 -66
- package/components/ScriptBuilder.svelte.d.ts +2 -4
- package/components/ScriptEditor.svelte +69 -142
- package/components/ScriptEditor.svelte.d.ts +0 -5
- package/components/ScriptPicker.svelte +3 -3
- package/components/ScriptPicker.svelte.d.ts +2 -1
- package/components/SharedBadge.svelte +5 -13
- package/components/SimpleEditor.svelte +147 -0
- package/components/SimpleEditor.svelte.d.ts +35 -0
- package/components/TestJobLoader.svelte +98 -0
- package/components/TestJobLoader.svelte.d.ts +26 -0
- package/components/Tooltip.svelte +2 -1
- package/components/common/actionRow/ActionRow.svelte +26 -0
- package/components/common/actionRow/ActionRow.svelte.d.ts +21 -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 +82 -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 +107 -0
- package/components/common/button/Button.svelte.d.ts +37 -0
- package/components/common/button/model.d.ts +6 -0
- package/components/common/button/model.js +1 -0
- package/components/common/confirmationModal/ConfirmationModal.svelte +55 -0
- package/components/common/confirmationModal/ConfirmationModal.svelte.d.ts +23 -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 -8
- 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 +26 -0
- package/components/flows/content/FlowEditorPanel.svelte.d.ts +14 -0
- package/components/flows/content/FlowFailureModule.svelte +17 -0
- package/components/flows/content/FlowFailureModule.svelte.d.ts +14 -0
- package/components/flows/content/FlowInput.svelte +22 -0
- package/components/flows/{FlowInput.svelte.d.ts → content/FlowInput.svelte.d.ts} +0 -0
- package/components/flows/{FlowInputs.svelte → content/FlowInputs.svelte} +24 -13
- package/components/flows/{FlowInputs.svelte.d.ts → content/FlowInputs.svelte.d.ts} +0 -0
- package/components/flows/content/FlowLoop.svelte +38 -0
- package/components/flows/content/FlowLoop.svelte.d.ts +14 -0
- package/components/flows/content/FlowModule.svelte +190 -0
- package/components/flows/content/FlowModule.svelte.d.ts +29 -0
- package/components/flows/content/FlowModuleAdvancedSettings.svelte +64 -0
- package/components/flows/content/FlowModuleAdvancedSettings.svelte.d.ts +17 -0
- package/components/flows/content/FlowModuleHeader.svelte +68 -0
- package/components/flows/{FlowModuleHeader.svelte.d.ts → content/FlowModuleHeader.svelte.d.ts} +2 -3
- package/components/flows/content/FlowModuleScript.svelte +21 -0
- package/components/flows/content/FlowModuleScript.svelte.d.ts +17 -0
- package/components/flows/content/FlowModuleWrapper.svelte +47 -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 +14 -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 +51 -0
- package/components/flows/{FlowSettings.svelte.d.ts → content/FlowSettings.svelte.d.ts} +1 -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 +15 -13
- package/components/flows/flowStateUtils.js +80 -72
- package/components/flows/flowStore.js +7 -4
- package/components/flows/header/FlowEditorHeader.svelte +23 -0
- package/components/flows/header/FlowEditorHeader.svelte.d.ts +14 -0
- package/components/flows/header/FlowImportExportMenu.svelte +56 -0
- package/components/flows/header/FlowImportExportMenu.svelte.d.ts +14 -0
- package/components/flows/header/FlowPreviewButtons.svelte +49 -0
- package/components/flows/header/FlowPreviewButtons.svelte.d.ts +14 -0
- package/components/flows/header/FlowStatus.svelte +36 -0
- package/components/flows/header/FlowStatus.svelte.d.ts +14 -0
- package/components/flows/map/FlowErrorHandlerItem.svelte +54 -0
- package/components/flows/map/FlowErrorHandlerItem.svelte.d.ts +14 -0
- package/components/flows/map/FlowModuleSchemaItem.svelte +58 -0
- package/components/flows/map/FlowModuleSchemaItem.svelte.d.ts +27 -0
- package/components/flows/map/FlowModuleSchemaMap.svelte +161 -0
- package/components/flows/map/FlowModuleSchemaMap.svelte.d.ts +20 -0
- package/components/flows/pickers/PickHubScript.svelte +4 -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 +42 -0
- package/components/flows/propPicker/PropPickerWrapper.svelte.d.ts +31 -0
- package/components/flows/scheduleUtils.d.ts +0 -1
- package/components/flows/scheduleUtils.js +0 -1
- package/components/flows/types.d.ts +9 -0
- package/components/flows/types.js +1 -0
- package/components/flows/utils.d.ts +1 -1
- package/components/flows/utils.js +8 -11
- package/components/icons/HatIcon.svelte +19 -0
- package/components/icons/HatIcon.svelte.d.ts +16 -0
- 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 +16 -7
- package/components/propertyPicker/PropPicker.svelte +38 -12
- 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 +25 -0
- package/editorUtils.js +43 -0
- package/gen/models/CompletedJob.d.ts +2 -1
- package/gen/models/CompletedJob.js +1 -0
- package/gen/models/FlowModule.d.ts +1 -0
- package/gen/models/FlowStatus.d.ts +3 -0
- package/gen/models/FlowStatusModule.d.ts +1 -1
- package/gen/models/FlowValue.d.ts +11 -0
- 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/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 +67 -35
- package/script_helpers.d.ts +5 -2
- package/script_helpers.js +41 -13
- package/stores.d.ts +1 -1
- package/utils.d.ts +6 -4
- package/utils.js +27 -4
- 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/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,22 +2,43 @@
|
|
|
2
2
|
import { workspaceStore } from '../stores';
|
|
3
3
|
import { faClose, faPlay } from '@fortawesome/free-solid-svg-icons';
|
|
4
4
|
import { Button } from 'flowbite-svelte';
|
|
5
|
-
import { createEventDispatcher, onDestroy } from 'svelte';
|
|
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
10
|
import { runFlowPreview } from './flows/utils';
|
|
11
|
-
import FlowStatusViewer from './FlowStatusViewer.svelte';
|
|
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
16
|
let intervalState = 'idle';
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
const { selectedId, previewArgs } = getContext('FlowEditorContext');
|
|
18
|
+
function extractFlow(previewMode) {
|
|
19
|
+
if (previewMode === 'whole') {
|
|
20
|
+
return $flowStore;
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
const [parentIndex, childIndex] = $selectedId.split('-');
|
|
24
|
+
const modules = $flowStore.value.modules.slice(0, Number(parentIndex) + 1);
|
|
25
|
+
const flow = JSON.parse(JSON.stringify($flowStore));
|
|
26
|
+
flow.value.modules = modules;
|
|
27
|
+
if (childIndex != undefined) {
|
|
28
|
+
const lastModule = modules[modules.length - 1].value;
|
|
29
|
+
if (lastModule.type === 'forloopflow') {
|
|
30
|
+
lastModule.modules = lastModule.modules.slice(0, Number(childIndex) + 1);
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
throw Error('Excepted forloopflow module');
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
return flow;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
19
39
|
const dispatch = createEventDispatcher();
|
|
20
40
|
export async function runPreview(args) {
|
|
41
|
+
const newFlow = extractFlow(previewMode);
|
|
21
42
|
jobId = await runFlowPreview(args, newFlow);
|
|
22
43
|
intervalState = 'running';
|
|
23
44
|
}
|
|
@@ -28,19 +49,32 @@ onDestroy(() => {
|
|
|
28
49
|
|
|
29
50
|
<div class="flex divide-y flex-col space-y-2 h-screen bg-white p-6 w-full">
|
|
30
51
|
<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">
|
|
52
|
+
<div class="flex flex-row justify-center items-center ">
|
|
53
|
+
<div class="flex justify-center p-2 w-8 h-8 bg-blue-200 rounded-lg mr-2 ">
|
|
33
54
|
<Icon data={faPlay} scale={1} class="text-blue-500" />
|
|
34
55
|
</div>
|
|
35
56
|
|
|
36
|
-
<h3 class="text-lg leading-6 font-bold text-gray-900">
|
|
57
|
+
<h3 class="text-lg leading-6 font-bold text-gray-900">
|
|
58
|
+
Test preview - {previewMode === 'upTo'
|
|
59
|
+
? `up to step ${$selectedId.split('-').join(',')}`
|
|
60
|
+
: ' whole flow'}
|
|
61
|
+
</h3>
|
|
37
62
|
</div>
|
|
38
|
-
<Button
|
|
63
|
+
<Button
|
|
64
|
+
color="alternative"
|
|
65
|
+
on:click={() => {
|
|
66
|
+
jobId = undefined
|
|
67
|
+
intervalState = 'idle'
|
|
68
|
+
dispatch('close')
|
|
69
|
+
}}
|
|
70
|
+
>
|
|
39
71
|
<Icon data={faClose} />
|
|
40
72
|
</Button>
|
|
41
73
|
</div>
|
|
42
|
-
<div class="max-h-
|
|
43
|
-
<
|
|
74
|
+
<div class="pb-4 h-full max-h-1/2 overflow-auto">
|
|
75
|
+
<div class="mt-4">
|
|
76
|
+
<SchemaForm schema={$flowStore.schema} bind:isValid bind:args={$previewArgs} />
|
|
77
|
+
</div>
|
|
44
78
|
</div>
|
|
45
79
|
{#if intervalState === 'running'}
|
|
46
80
|
<Button
|
|
@@ -63,7 +97,12 @@ onDestroy(() => {
|
|
|
63
97
|
Cancel
|
|
64
98
|
</Button>
|
|
65
99
|
{:else}
|
|
66
|
-
<Button
|
|
100
|
+
<Button
|
|
101
|
+
disabled={!isValid}
|
|
102
|
+
class="blue-button"
|
|
103
|
+
on:click={() => runPreview($previewArgs)}
|
|
104
|
+
size="md"
|
|
105
|
+
>
|
|
67
106
|
{`Run${intervalState === 'done' ? ' again' : ''}`}
|
|
68
107
|
</Button>
|
|
69
108
|
{/if}
|
|
@@ -74,9 +113,11 @@ onDestroy(() => {
|
|
|
74
113
|
{jobId}
|
|
75
114
|
on:jobsLoaded={(e) => {
|
|
76
115
|
intervalState = 'done'
|
|
77
|
-
|
|
116
|
+
const [parentIndex] = $selectedId.split('-')
|
|
117
|
+
const upToIndex =
|
|
118
|
+
previewMode === 'upTo' ? Number(parentIndex) + 1 : $flowStateStore.modules.length
|
|
119
|
+
mapJobResultsToFlowState(e.detail, upToIndex)
|
|
78
120
|
}}
|
|
79
|
-
root={true}
|
|
80
121
|
/>
|
|
81
122
|
{/if}
|
|
82
123
|
</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,11 @@ 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
|
-
|
|
38
|
-
|
|
32
|
+
$: jobResult &&
|
|
33
|
+
jobResult.job?.type === 'CompletedJob' &&
|
|
34
|
+
jobResult.job.flow_status?.modules.length == jobResult.innerJobs?.length &&
|
|
35
|
+
dispatch('jobsLoaded', jobResult);
|
|
39
36
|
function updateJobId() {
|
|
40
37
|
if (jobId !== jobResult.job?.id) {
|
|
41
38
|
loadJobInProgress();
|
|
@@ -49,7 +46,9 @@ onDestroy(() => {
|
|
|
49
46
|
|
|
50
47
|
{#if jobResult.job}
|
|
51
48
|
<div class="flow-root w-full space-y-4">
|
|
52
|
-
|
|
49
|
+
{#if innerModules.length > 0}
|
|
50
|
+
<h3 class="text-md leading-6 font-bold text-gray-900 border-b pb-2">Flow result</h3>
|
|
51
|
+
{/if}
|
|
53
52
|
<FlowPreviewStatus job={jobResult.job} />
|
|
54
53
|
{#if `result` in jobResult.job}
|
|
55
54
|
<FlowJobResult job={jobResult.job} />
|
|
@@ -87,32 +86,51 @@ onDestroy(() => {
|
|
|
87
86
|
<svelte:self jobId={loopJobId} bind:jobResult={jobResult.loopJobs[j]} />
|
|
88
87
|
</div>
|
|
89
88
|
{/each}
|
|
90
|
-
{:else if
|
|
89
|
+
{:else if innerModules.length > 0}
|
|
91
90
|
<ul class="w-full">
|
|
92
91
|
<h3 class="text-md leading-6 font-bold text-gray-900 border-b mb-4 py-2">
|
|
93
|
-
|
|
92
|
+
Step-by-step results
|
|
94
93
|
</h3>
|
|
95
94
|
|
|
96
|
-
{#each
|
|
97
|
-
<p class="text-gray-500 mb-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
95
|
+
{#each innerModules as mod, i}
|
|
96
|
+
<p class="text-gray-500 mb-2 w-full ">
|
|
97
|
+
{#if jobResult.job?.raw_flow?.modules && i < jobResult.job?.raw_flow?.modules.length}
|
|
98
|
+
Step
|
|
99
|
+
<span class="font-medium text-gray-900">
|
|
100
|
+
{i + 1}
|
|
101
|
+
</span>
|
|
102
|
+
out of
|
|
103
|
+
<span class="font-medium text-gray-900"
|
|
104
|
+
>{jobResult.job?.raw_flow?.modules.length}</span
|
|
105
|
+
>
|
|
106
|
+
{#if jobResult.job.raw_flow?.modules[i]?.summary}
|
|
107
|
+
: <span class="font-medium text-gray-900"
|
|
108
|
+
>{jobResult.job.raw_flow?.modules[i]?.summary ?? ''}</span
|
|
109
|
+
>
|
|
110
|
+
{/if}
|
|
111
|
+
{:else}
|
|
112
|
+
<span class="font-medium text-gray-900"> Failure module </span>
|
|
113
|
+
{/if}
|
|
101
114
|
</p>
|
|
102
115
|
|
|
103
|
-
|
|
104
|
-
|
|
116
|
+
<li class="w-full border p-6 space-y-2">
|
|
117
|
+
{#if [FlowStatusModule.type.IN_PROGRESS, FlowStatusModule.type.SUCCESS, FlowStatusModule.type.FAILURE].includes(mod.type)}
|
|
105
118
|
<svelte:self
|
|
106
|
-
jobId={
|
|
119
|
+
jobId={mod.job}
|
|
107
120
|
bind:jobResult={jobResult.innerJobs[i]}
|
|
108
|
-
forloopJobIds={
|
|
121
|
+
forloopJobIds={mod.forloop_jobs}
|
|
122
|
+
on:jobsLoaded={(e) => {
|
|
123
|
+
jobResult = jobResult
|
|
124
|
+
}}
|
|
109
125
|
/>
|
|
110
|
-
|
|
111
|
-
|
|
126
|
+
{:else}
|
|
127
|
+
<span>{mod.type}</span>
|
|
128
|
+
{/if}
|
|
129
|
+
</li>
|
|
112
130
|
{/each}
|
|
113
131
|
</ul>
|
|
114
132
|
{/if}
|
|
115
133
|
</div>
|
|
116
134
|
{:else}
|
|
117
|
-
|
|
135
|
+
Job loading...
|
|
118
136
|
{/if}
|
|
@@ -9,7 +9,7 @@ import SvelteMarkdown from 'svelte-markdown';
|
|
|
9
9
|
import FlowModulesViewer from './FlowModulesViewer.svelte';
|
|
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,7 +61,10 @@ 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">
|
|
@@ -71,7 +74,8 @@ function toAny(x) {
|
|
|
71
74
|
await navigator.clipboard.writeText(JSON.stringify(flowFiltered, null, 4))
|
|
72
75
|
}}
|
|
73
76
|
class="absolute default-secondary-button-v2 bg-white/30 right-0 my-2 ml-4"
|
|
74
|
-
|
|
77
|
+
>
|
|
78
|
+
copy content</button
|
|
75
79
|
>
|
|
76
80
|
<Highlight language={json} code={JSON.stringify(flowFiltered, null, 4)} />
|
|
77
81
|
</div>
|
|
@@ -0,0 +1,21 @@
|
|
|
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() {
|
|
8
|
+
switch (language) {
|
|
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
|
+
</script>
|
|
20
|
+
|
|
21
|
+
<Highlight language={getLang()} {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>
|
|
@@ -42,7 +42,7 @@ export let width = '24px';
|
|
|
42
42
|
{:else if name === 'slack'}
|
|
43
43
|
<Slack {height} {width} />
|
|
44
44
|
{:else if name === 'github'}
|
|
45
|
-
<
|
|
45
|
+
<GithubIcon />
|
|
46
46
|
{:else if name === 'gmail'}
|
|
47
47
|
<GmailIcon {height} {width} />
|
|
48
48
|
{:else if name === 'gsheets'}
|
|
@@ -1,26 +1,24 @@
|
|
|
1
|
-
<script>import {
|
|
2
|
-
import { Button, Tooltip } from 'flowbite-svelte';
|
|
3
|
-
import Icon from 'svelte-awesome';
|
|
1
|
+
<script>import { getContext } from 'svelte';
|
|
4
2
|
import ArgInput from './ArgInput.svelte';
|
|
5
|
-
import Editor from './Editor.svelte';
|
|
6
3
|
import FieldHeader from './FieldHeader.svelte';
|
|
7
|
-
import DynamicInputHelpBox from './flows/DynamicInputHelpBox.svelte';
|
|
4
|
+
import DynamicInputHelpBox from './flows/content/DynamicInputHelpBox.svelte';
|
|
8
5
|
import { codeToStaticTemplate, getDefaultExpr, isCodeInjection } from './flows/utils';
|
|
9
|
-
import
|
|
6
|
+
import SimpleEditor from './SimpleEditor.svelte';
|
|
10
7
|
import Toggle from './Toggle.svelte';
|
|
8
|
+
import { Button, Tooltip } from 'flowbite-svelte';
|
|
9
|
+
import Icon from 'svelte-awesome';
|
|
10
|
+
import { faChain } from '@fortawesome/free-solid-svg-icons';
|
|
11
11
|
export let schema;
|
|
12
12
|
export let arg;
|
|
13
13
|
export let argName;
|
|
14
14
|
export let extraLib = 'missing extraLib';
|
|
15
15
|
export let inputCheck;
|
|
16
16
|
export let importPath = undefined;
|
|
17
|
-
export let pickableProperties = undefined;
|
|
18
|
-
let overlays = {};
|
|
19
17
|
let monacos = {};
|
|
20
18
|
let inputCats = {};
|
|
21
19
|
let propertyType = getPropertyType(arg);
|
|
22
20
|
function getPropertyType(arg) {
|
|
23
|
-
let type = arg
|
|
21
|
+
let type = arg?.type ?? 'static';
|
|
24
22
|
if (type == 'javascript') {
|
|
25
23
|
if (codeToStaticTemplate(arg.expr)) {
|
|
26
24
|
type = 'static';
|
|
@@ -49,16 +47,6 @@ function setPropertyType(rawValue) {
|
|
|
49
47
|
function isStaticTemplate(inputCat) {
|
|
50
48
|
return inputCat === 'string' || inputCat === 'sql';
|
|
51
49
|
}
|
|
52
|
-
function focusProp(argName, monacoEditor = false) {
|
|
53
|
-
Object.keys(overlays).forEach((k) => {
|
|
54
|
-
if (k == argName && (isStaticTemplate(inputCats[argName]) || monacoEditor)) {
|
|
55
|
-
overlays[k].focus();
|
|
56
|
-
}
|
|
57
|
-
else {
|
|
58
|
-
overlays[k].unfocus();
|
|
59
|
-
}
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
50
|
function connectProperty(argName, rawValue) {
|
|
63
51
|
if (isStaticTemplate(inputCats[argName])) {
|
|
64
52
|
arg.value = `\$\{${rawValue}}`;
|
|
@@ -74,6 +62,7 @@ function connectProperty(argName, rawValue) {
|
|
|
74
62
|
}
|
|
75
63
|
}
|
|
76
64
|
$: checked = propertyType == 'javascript';
|
|
65
|
+
const { focusProp } = getContext('PropPickerWrapper');
|
|
77
66
|
</script>
|
|
78
67
|
|
|
79
68
|
{#if arg != undefined}
|
|
@@ -94,45 +83,54 @@ $: checked = propertyType == 'javascript';
|
|
|
94
83
|
</span>
|
|
95
84
|
{/if}
|
|
96
85
|
</div>
|
|
97
|
-
<
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
86
|
+
<div class="flex flex-row space-x-2 items-center">
|
|
87
|
+
<Toggle
|
|
88
|
+
bind:checked
|
|
89
|
+
options={{
|
|
90
|
+
right: 'Raw Javascript Editor'
|
|
91
|
+
}}
|
|
92
|
+
on:change={(e) => {
|
|
93
|
+
const type = e.detail ? 'javascript' : 'static'
|
|
94
|
+
const staticTemplate = isStaticTemplate(inputCats[argName])
|
|
95
|
+
if (type === 'javascript') {
|
|
96
|
+
arg.expr = getDefaultExpr(
|
|
97
|
+
importPath,
|
|
98
|
+
argName,
|
|
99
|
+
staticTemplate ? `\`${arg.value ?? ''}\`` : arg.value
|
|
100
|
+
)
|
|
111
101
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
102
|
+
arg.value = undefined
|
|
103
|
+
propertyType = 'javascript'
|
|
104
|
+
} else {
|
|
105
|
+
arg.value = staticTemplate ? codeToStaticTemplate(arg.expr) : undefined
|
|
116
106
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
107
|
+
arg.expr = undefined
|
|
108
|
+
propertyType = 'static'
|
|
109
|
+
}
|
|
120
110
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
111
|
+
arg.type = type
|
|
112
|
+
}}
|
|
113
|
+
/>
|
|
114
|
+
<div
|
|
115
|
+
on:click={() => {
|
|
116
|
+
focusProp(argName, 'connect', (path) => {
|
|
117
|
+
connectProperty(argName, path)
|
|
118
|
+
})
|
|
119
|
+
}}
|
|
120
|
+
>
|
|
121
|
+
<Button size="sm" class="blue-button">
|
|
122
|
+
<Icon data={faChain} />
|
|
123
|
+
</Button>
|
|
124
|
+
</div>
|
|
125
|
+
</div>
|
|
124
126
|
</div>
|
|
125
127
|
<div class="max-w-xs" />
|
|
126
128
|
|
|
127
129
|
{#if propertyType === undefined || !checked}
|
|
128
|
-
<
|
|
129
|
-
{
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
if (detail.pickerVariation === 'connect') {
|
|
133
|
-
connectProperty(argName, detail.propPath)
|
|
134
|
-
} else {
|
|
135
|
-
const toAppend = `\$\{${detail.propPath}}`
|
|
130
|
+
<ArgInput
|
|
131
|
+
on:focus={() => {
|
|
132
|
+
focusProp(argName, 'append', (path) => {
|
|
133
|
+
const toAppend = `\$\{${path}}`
|
|
136
134
|
arg.value = `${arg.value ?? ''}${toAppend}`
|
|
137
135
|
if (monacos[argName]) {
|
|
138
136
|
monacos[argName].setCode(arg.value)
|
|
@@ -140,67 +138,50 @@ $: checked = propertyType == 'javascript';
|
|
|
140
138
|
if (isStaticTemplate(inputCats[argName])) {
|
|
141
139
|
setPropertyType(arg.value)
|
|
142
140
|
}
|
|
141
|
+
})
|
|
142
|
+
}}
|
|
143
|
+
label={argName}
|
|
144
|
+
bind:editor={monacos[argName]}
|
|
145
|
+
bind:description={schema.properties[argName].description}
|
|
146
|
+
bind:value={arg.value}
|
|
147
|
+
type={schema.properties[argName].type}
|
|
148
|
+
required={schema.required.includes(argName)}
|
|
149
|
+
bind:pattern={schema.properties[argName].pattern}
|
|
150
|
+
bind:valid={inputCheck[argName]}
|
|
151
|
+
defaultValue={schema.properties[argName].default}
|
|
152
|
+
bind:enum_={schema.properties[argName].enum}
|
|
153
|
+
bind:format={schema.properties[argName].format}
|
|
154
|
+
contentEncoding={schema.properties[argName].contentEncoding}
|
|
155
|
+
bind:itemsType={schema.properties[argName].items}
|
|
156
|
+
properties={schema.properties[argName].properties}
|
|
157
|
+
displayHeader={false}
|
|
158
|
+
bind:inputCat={inputCats[argName]}
|
|
159
|
+
on:input={(e) => {
|
|
160
|
+
if (isStaticTemplate(inputCats[argName])) {
|
|
161
|
+
setPropertyType(e.detail.rawValue)
|
|
143
162
|
}
|
|
144
163
|
}}
|
|
145
|
-
|
|
146
|
-
<ArgInput
|
|
147
|
-
on:focus={() => focusProp(argName)}
|
|
148
|
-
label={argName}
|
|
149
|
-
bind:editor={monacos[argName]}
|
|
150
|
-
bind:description={schema.properties[argName].description}
|
|
151
|
-
bind:value={arg.value}
|
|
152
|
-
type={schema.properties[argName].type}
|
|
153
|
-
required={schema.required.includes(argName)}
|
|
154
|
-
bind:pattern={schema.properties[argName].pattern}
|
|
155
|
-
bind:valid={inputCheck[argName]}
|
|
156
|
-
defaultValue={schema.properties[argName].default}
|
|
157
|
-
bind:enum_={schema.properties[argName].enum}
|
|
158
|
-
bind:format={schema.properties[argName].format}
|
|
159
|
-
contentEncoding={schema.properties[argName].contentEncoding}
|
|
160
|
-
bind:itemsType={schema.properties[argName].items}
|
|
161
|
-
properties={schema.properties[argName].properties}
|
|
162
|
-
displayHeader={false}
|
|
163
|
-
bind:inputCat={inputCats[argName]}
|
|
164
|
-
on:input={(e) => {
|
|
165
|
-
if (isStaticTemplate(inputCats[argName])) {
|
|
166
|
-
setPropertyType(e.detail.rawValue)
|
|
167
|
-
}
|
|
168
|
-
}}
|
|
169
|
-
>
|
|
170
|
-
<div slot="actions">
|
|
171
|
-
<div on:click={() => overlays[argName]?.focus('connect')}>
|
|
172
|
-
<Tooltip placement="bottom" content="Input connect">
|
|
173
|
-
<Button size="sm" class="blue-button h-8">
|
|
174
|
-
<Icon data={faChain} />
|
|
175
|
-
</Button>
|
|
176
|
-
</Tooltip>
|
|
177
|
-
</div>
|
|
178
|
-
</div>
|
|
179
|
-
</ArgInput>
|
|
180
|
-
</OverlayPropertyPicker>
|
|
164
|
+
/>
|
|
181
165
|
{:else if checked}
|
|
182
166
|
{#if arg.expr != undefined}
|
|
183
|
-
<
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
shouldBindKey={false}
|
|
200
|
-
/>
|
|
201
|
-
</div>
|
|
202
|
-
</OverlayPropertyPicker>
|
|
167
|
+
<div class="border rounded p-2 mt-2 border-gray-300">
|
|
168
|
+
<SimpleEditor
|
|
169
|
+
bind:this={monacos[argName]}
|
|
170
|
+
on:focus={() => {
|
|
171
|
+
focusProp(argName, 'insert', (path) => {
|
|
172
|
+
monacos[argName].insertAtCursor(path)
|
|
173
|
+
})
|
|
174
|
+
}}
|
|
175
|
+
bind:code={arg.expr}
|
|
176
|
+
lang="javascript"
|
|
177
|
+
class="few-lines-editor"
|
|
178
|
+
{extraLib}
|
|
179
|
+
extraLibPath="file:///node_modules/@types/windmill@{importPath}/index.d.ts"
|
|
180
|
+
shouldBindKey={false}
|
|
181
|
+
/>
|
|
182
|
+
</div>
|
|
203
183
|
<DynamicInputHelpBox {importPath} />
|
|
184
|
+
<div class="mb-2" />
|
|
204
185
|
{/if}
|
|
205
186
|
{:else}
|
|
206
187
|
<p>Not recognized arg type {arg.type}</p>
|
|
@@ -27,7 +27,7 @@ let modal;
|
|
|
27
27
|
</script>
|
|
28
28
|
|
|
29
29
|
<Modal bind:this={modal} z="z-30">
|
|
30
|
-
<div slot="title">
|
|
30
|
+
<div slot="title">Search a {itemName}</div>
|
|
31
31
|
<div slot="content">
|
|
32
32
|
<div class="w-12/12 pb-4">
|
|
33
33
|
<input placeholder="Search {itemName}" bind:value={itemsFilter} class="search-item" />
|
|
@@ -48,7 +48,7 @@ let modal;
|
|
|
48
48
|
<IconedResourceType silent={true} name={obj['app']} />
|
|
49
49
|
<span class="mr-2" />
|
|
50
50
|
{/if}
|
|
51
|
-
<span class="mr-2">{obj[extraField]}</span><span class="font-normal
|
|
51
|
+
<span class="mr-2">{obj[extraField]}</span><span class="font-normal break-all"
|
|
52
52
|
>{obj['path'] ?? ''}</span
|
|
53
53
|
>
|
|
54
54
|
</p>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<script>export let content;
|
|
2
|
+
export let isLoading;
|
|
3
|
+
let scroll = true;
|
|
4
|
+
let div = null;
|
|
5
|
+
$: if (content != undefined) {
|
|
6
|
+
isLoading = false;
|
|
7
|
+
}
|
|
8
|
+
$: content && scrollToBottom();
|
|
9
|
+
export function scrollToBottom() {
|
|
10
|
+
scroll && setTimeout(() => div?.scroll({ top: div?.scrollHeight, behavior: 'smooth' }), 100);
|
|
11
|
+
}
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<div class="relative w-full h-full">
|
|
15
|
+
<div bind:this={div} class="w-full h-full overflow-auto bg-gray-50 relative">
|
|
16
|
+
<pre
|
|
17
|
+
class="whitespace-pre-wrap break-all bg-gray-50 text-xs w-full p-2">{#if content}{content}{:else if isLoading}Waiting for job to start...{:else}No logs are available yet{/if}</pre>
|
|
18
|
+
</div>
|
|
19
|
+
<div class="absolute top-0 right-0 mr-2 text-gray-500 text-sm bg-gray-50/20">
|
|
20
|
+
Auto scroll
|
|
21
|
+
<input type="checkbox" bind:checked={scroll} />
|
|
22
|
+
</div>
|
|
23
|
+
</div>
|