windmill-components 1.35.43 → 1.36.1
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 +31 -14
- package/components/Button.svelte +15 -48
- package/components/Button.svelte.d.ts +1 -1
- package/components/CronInput.svelte +1 -1
- package/components/DisplayResult.svelte +31 -29
- package/components/Dropdown.svelte +9 -7
- package/components/Editor.svelte +10 -14
- package/components/EditorBar.svelte +115 -91
- package/components/FlowBuilder.svelte +63 -74
- package/components/FlowPreviewContent.svelte +44 -24
- package/components/FlowStatusViewer.svelte +2 -5
- package/components/FlowViewer.svelte +12 -10
- package/components/GroupModal.svelte +10 -1
- package/components/HighlightCode.svelte +4 -3
- package/components/InputTransformForm.svelte +15 -14
- package/components/InputTransformsViewer.svelte +1 -1
- package/components/InviteGlobalUser.svelte +8 -8
- package/components/InviteUser.svelte +9 -9
- package/components/ItemPicker.svelte +36 -29
- package/components/ItemPicker.svelte.d.ts +2 -1
- package/components/JobStatus.svelte +2 -1
- package/components/ModulePreview.svelte +7 -8
- 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 +23 -31
- package/components/SchemaEditor.svelte +16 -10
- package/components/SchemaForm.svelte +3 -1
- package/components/SchemaForm.svelte.d.ts +1 -0
- package/components/SchemaModal.svelte +18 -7
- package/components/ScriptBuilder.svelte +22 -17
- package/components/ScriptEditor.svelte +2 -1
- package/components/ScriptPicker.svelte +21 -11
- package/components/ScriptSchema.svelte +8 -11
- package/components/ScriptSchema.svelte.d.ts +0 -1
- package/components/ShareModal.svelte +6 -6
- package/components/SimpleEditor.svelte +10 -10
- package/components/StringTypeNarrowing.svelte +24 -30
- package/components/TestJobLoader.svelte +15 -7
- package/components/Tooltip.svelte +1 -1
- package/components/VariableEditor.svelte +15 -24
- package/components/common/actionRow/ActionRow.svelte +11 -6
- package/components/common/actionRow/ActionRow.svelte.d.ts +1 -0
- package/components/common/badge/Badge.svelte +2 -8
- package/components/common/badge/model.d.ts +1 -1
- package/components/common/button/Button.svelte +45 -79
- package/components/common/button/Button.svelte.d.ts +14 -15
- package/components/common/button/ButtonPopup.svelte +67 -0
- package/components/common/button/ButtonPopup.svelte.d.ts +33 -0
- package/components/common/button/ButtonPopupItem.svelte +47 -0
- package/components/common/button/ButtonPopupItem.svelte.d.ts +27 -0
- package/components/common/button/model.d.ts +14 -1
- package/components/common/button/model.js +26 -1
- package/components/common/confirmationModal/ConfirmationModal.svelte +19 -2
- 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 +1 -0
- package/components/common/drawer/Drawer.svelte.d.ts +2 -0
- package/components/common/drawer/DrawerContent.svelte +1 -1
- package/components/common/index.d.ts +4 -0
- package/components/common/index.js +4 -0
- package/components/common/kbd/Kbd.svelte +7 -0
- package/components/common/kbd/Kbd.svelte.d.ts +27 -0
- package/components/common/popup/Popup.svelte +147 -0
- package/components/common/popup/Popup.svelte.d.ts +46 -0
- package/components/flows/FlowEditor.svelte +7 -7
- package/components/flows/FlowEditor.svelte.d.ts +3 -1
- package/components/flows/common/FlowCardHeader.svelte +1 -1
- package/components/flows/content/FlowEditorPanel.svelte +5 -6
- package/components/flows/content/FlowEditorPanel.svelte.d.ts +3 -1
- package/components/flows/content/FlowFailureModule.svelte +2 -4
- package/components/flows/content/FlowInput.svelte +5 -1
- package/components/flows/content/FlowInputs.svelte +27 -12
- package/components/flows/content/FlowInputs.svelte.d.ts +1 -0
- package/components/flows/content/FlowLoop.svelte +159 -29
- package/components/flows/content/FlowLoop.svelte.d.ts +5 -1
- package/components/flows/content/FlowLoopWrapper.svelte +9 -0
- package/components/flows/content/FlowLoopWrapper.svelte.d.ts +14 -0
- package/components/flows/content/FlowModule.svelte +31 -10
- package/components/flows/content/FlowModule.svelte.d.ts +1 -1
- package/components/flows/content/FlowModuleEarlyStop.svelte +76 -0
- package/components/flows/content/FlowModuleEarlyStop.svelte.d.ts +17 -0
- package/components/flows/content/FlowModuleHeader.svelte +92 -3
- package/components/flows/content/FlowModuleHeader.svelte.d.ts +3 -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 +4 -6
- package/components/flows/content/FlowRetries.svelte +18 -18
- package/components/flows/content/FlowRetries.svelte.d.ts +4 -1
- package/components/flows/content/FlowSettings.svelte +51 -11
- package/components/flows/content/FlowSettings.svelte.d.ts +1 -0
- package/components/flows/content/RemoveStepConfirmationModal.svelte +1 -1
- package/components/flows/flowStateUtils.d.ts +1 -1
- package/components/flows/flowStateUtils.js +2 -2
- package/components/flows/header/FlowImportExportMenu.svelte +4 -5
- package/components/flows/header/FlowPreviewButtons.svelte +24 -16
- package/components/flows/map/FlowErrorHandlerItem.svelte +14 -8
- package/components/flows/map/FlowModuleSchemaItem.svelte +41 -19
- package/components/flows/map/FlowModuleSchemaItem.svelte.d.ts +6 -1
- package/components/flows/map/FlowModuleSchemaMap.svelte +86 -6
- package/components/flows/pickers/PickHubScript.svelte +1 -0
- package/components/flows/pickers/model.d.ts +5 -0
- package/components/flows/pickers/model.js +1 -0
- package/components/flows/propPicker/PropPickerWrapper.svelte +3 -1
- package/components/flows/propPicker/PropPickerWrapper.svelte.d.ts +2 -0
- package/components/flows/types.d.ts +0 -1
- package/components/flows/utils.d.ts +2 -0
- package/components/flows/utils.js +19 -0
- 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/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/propertyPicker/ObjectViewer.svelte +9 -12
- package/components/propertyPicker/ObjectViewer.svelte.d.ts +1 -0
- package/components/propertyPicker/PropPicker.svelte +85 -14
- package/components/script_editor/LogPanel.svelte +1 -1
- package/components/scripts/CreateActions.svelte +114 -0
- package/components/scripts/CreateActions.svelte.d.ts +14 -0
- 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/FlowModule.d.ts +2 -0
- package/gen/models/FlowValue.d.ts +1 -11
- package/gen/models/Retry.d.ts +11 -0
- package/gen/models/Retry.js +4 -0
- package/package.json +25 -15
- package/script_helpers.d.ts +4 -1
- package/script_helpers.js +48 -4
- package/stateMachine.d.ts +30 -0
- package/stateMachine.js +41 -0
- package/utils.d.ts +5 -3
- package/utils.js +32 -20
- package/components/flows/content/FlowModuleAdvancedSettings.svelte +0 -64
- package/components/flows/content/FlowModuleAdvancedSettings.svelte.d.ts +0 -17
- package/components/flows/header/FlowEditorHeader.svelte +0 -23
- package/components/flows/header/FlowEditorHeader.svelte.d.ts +0 -14
- package/components/flows/header/FlowStatus.svelte +0 -36
- package/components/flows/header/FlowStatus.svelte.d.ts +0 -14
|
@@ -9,7 +9,7 @@ export let width = '24px';
|
|
|
9
9
|
{width}
|
|
10
10
|
{height}
|
|
11
11
|
viewBox="0 0 50 50"
|
|
12
|
-
style="
|
|
12
|
+
style="fill:currentcolor;"
|
|
13
13
|
><path
|
|
14
14
|
d="M 28 7.9453125 L 21 10.279297 L 21 18.279297 L 16 19.945312 L 10 17.945312 L 3 20.279297 L 3 29.720703 L 3.6835938 29.949219 L 9 31.720703 L 9 39.720703 L 9.6835938 39.949219 L 16 42.054688 L 23 39.720703 L 23 31.720703 L 29 29.720703 L 29 21.720703 L 34 20.054688 L 40 22.054688 L 47 19.720703 L 47 10.279297 L 40 7.9453125 L 34 9.9453125 L 28 7.9453125 z M 28 10.054688 L 32.335938 11.5 L 28 12.945312 L 23.664062 11.5 L 28 10.054688 z M 40 10.054688 L 44.335938 11.5 L 40 12.945312 L 35.664062 11.5 L 40 10.054688 z M 23 13.388672 L 27 14.720703 L 27 19.611328 L 23 18.279297 L 23 13.388672 z M 33 13.388672 L 33 18.279297 L 29 19.611328 L 29 14.720703 L 33 13.388672 z M 35 13.388672 L 39 14.720703 L 39 19.611328 L 35 18.279297 L 35 13.388672 z M 45 13.388672 L 45 18.279297 L 41 19.611328 L 41 14.720703 L 45 13.388672 z M 10 20.054688 L 14.335938 21.5 L 10 22.945312 L 5.6640625 21.5 L 10 20.054688 z M 22 20.054688 L 26.335938 21.5 L 22 22.945312 L 17.664062 21.5 L 22 20.054688 z M 5 23.388672 L 9 24.720703 L 9 29.611328 L 5 28.279297 L 5 23.388672 z M 15 23.388672 L 15 28.279297 L 11 29.611328 L 11 24.720703 L 15 23.388672 z M 17 23.388672 L 21 24.720703 L 21 29.611328 L 17 28.279297 L 17 23.388672 z M 27 23.388672 L 27 28.279297 L 23 29.611328 L 23 24.720703 L 27 23.388672 z M 16 30.054688 L 20.335938 31.5 L 16 32.945312 L 11.664062 31.5 L 16 30.054688 z M 11 33.388672 L 15 34.720703 L 15 39.611328 L 11 38.279297 L 11 33.388672 z M 21 33.388672 L 21 38.279297 L 17 39.611328 L 17 34.720703 L 21 33.388672 z"
|
|
15
15
|
/></svg
|
|
@@ -9,7 +9,7 @@ export let width = '24px';
|
|
|
9
9
|
{width}
|
|
10
10
|
{height}
|
|
11
11
|
viewBox="0 0 30 30"
|
|
12
|
-
style="
|
|
12
|
+
style="fill:currentcolor;"
|
|
13
13
|
>
|
|
14
14
|
<path
|
|
15
15
|
d="M 16.644531 2.0058594 C 16.365063 1.9841719 16.077422 2.0168281 15.794922 2.1113281 C 14.664922 2.4893281 14.053641 3.71375 14.431641 4.84375 L 15.324219 7.5117188 L 10.236328 9.2128906 L 9.3828125 6.6601562 C 9.0048125 5.5301563 7.7803906 4.9208281 6.6503906 5.2988281 C 5.5193906 5.6768281 4.9110625 6.8992969 5.2890625 8.0292969 L 6.1425781 10.582031 L 3.4746094 11.474609 C 2.3446094 11.852609 1.7333281 13.075078 2.1113281 14.205078 C 2.4893281 15.335078 3.71375 15.946359 4.84375 15.568359 L 7.5117188 14.675781 L 9.2128906 19.763672 L 6.6601562 20.617188 C 5.5301563 20.995187 4.9208281 22.219609 5.2988281 23.349609 C 5.6768281 24.480609 6.8992969 25.088938 8.0292969 24.710938 L 10.582031 23.857422 L 11.474609 26.525391 C 11.852609 27.655391 13.075078 28.266672 14.205078 27.888672 C 15.335078 27.510672 15.945359 26.28625 15.568359 25.15625 L 14.675781 22.488281 L 19.763672 20.785156 L 20.617188 23.339844 C 20.995187 24.469844 22.219609 25.079172 23.349609 24.701172 C 24.480609 24.323172 25.089891 23.100703 24.712891 21.970703 L 23.857422 19.416016 L 26.525391 18.523438 C 27.655391 18.145437 28.266672 16.922969 27.888672 15.792969 C 27.510672 14.662969 26.28625 14.053641 25.15625 14.431641 L 22.488281 15.324219 L 20.787109 10.236328 L 23.339844 9.3828125 C 24.469844 9.0048125 25.079172 7.7803906 24.701172 6.6503906 C 24.323172 5.5203906 23.100703 4.9110625 21.970703 5.2890625 L 19.417969 6.1425781 L 18.525391 3.4746094 C 18.241891 2.6271094 17.482937 2.0709219 16.644531 2.0058594 z M 16.693359 11.605469 L 18.394531 16.693359 L 13.306641 18.394531 L 11.605469 13.306641 L 16.693359 11.605469 z"
|
|
@@ -9,51 +9,13 @@ export let width = '24px';
|
|
|
9
9
|
{width}
|
|
10
10
|
{height}
|
|
11
11
|
viewBox="0 0 60 60"
|
|
12
|
-
style="
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
x1="32"
|
|
16
|
-
x2="32"
|
|
17
|
-
y1="7"
|
|
18
|
-
y2="57"
|
|
19
|
-
gradientUnits="userSpaceOnUse"
|
|
20
|
-
><stop offset="0" stop-color="#000000" /><stop
|
|
21
|
-
offset="1"
|
|
22
|
-
stop-color="#000000"
|
|
23
|
-
/></linearGradient
|
|
24
|
-
><path
|
|
25
|
-
fill="url(#2R_xNhRC2gDYhp_e6bogba)"
|
|
12
|
+
style="fill:currentcolor;"
|
|
13
|
+
>
|
|
14
|
+
<path
|
|
26
15
|
d="M32,9c12.682,0,23,10.318,23,23S44.682,55,32,55S9,44.682,9,32S19.318,9,32,9 M32,7 C18.193,7,7,18.193,7,32s11.193,25,25,25s25-11.193,25-25S45.807,7,32,7L32,7z"
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
x2="32.001"
|
|
31
|
-
y1="16.294"
|
|
32
|
-
y2="45.473"
|
|
33
|
-
gradientUnits="userSpaceOnUse"
|
|
34
|
-
><stop offset="0" stop-color="#000000" /><stop
|
|
35
|
-
offset="1"
|
|
36
|
-
stop-color="#000000"
|
|
37
|
-
/></linearGradient
|
|
38
|
-
><rect
|
|
39
|
-
width="3.999"
|
|
40
|
-
height="17.995"
|
|
41
|
-
x="30.001"
|
|
42
|
-
y="16.005"
|
|
43
|
-
fill="url(#2R_xNhRC2gDYhp_e6bogbb)"
|
|
44
|
-
/><linearGradient
|
|
45
|
-
id="2R_xNhRC2gDYhp_e6bogbc"
|
|
46
|
-
x1="32.001"
|
|
47
|
-
x2="32.001"
|
|
48
|
-
y1="16.294"
|
|
49
|
-
y2="45.473"
|
|
50
|
-
gradientUnits="userSpaceOnUse"
|
|
51
|
-
><stop offset="0" stop-color="#000000" /><stop
|
|
52
|
-
offset="1"
|
|
53
|
-
stop-color="#000000"
|
|
54
|
-
/></linearGradient
|
|
55
|
-
><path
|
|
56
|
-
fill="url(#2R_xNhRC2gDYhp_e6bogbc)"
|
|
16
|
+
/>
|
|
17
|
+
<rect width="3.999" height="17.995" x="30.001" y="16.005" />
|
|
18
|
+
<path
|
|
57
19
|
d="M35.5,20.043v3.713c3.35,1.379,5.714,4.67,5.714,8.518c0,5.087-4.126,9.214-9.213,9.214 c-5.087,0-9.212-4.126-9.212-9.214c0-3.847,2.36-7.137,5.712-8.517v-3.714c-5.324,1.525-9.223,6.418-9.223,12.23 C19.277,39.3,24.976,45,32,45c7.026,0,12.724-5.7,12.724-12.725C44.724,26.461,40.822,21.567,35.5,20.043z"
|
|
58
|
-
|
|
59
|
-
>
|
|
20
|
+
/>
|
|
21
|
+
</svg>
|
|
@@ -93,7 +93,7 @@ export let job;
|
|
|
93
93
|
</div>
|
|
94
94
|
</div>
|
|
95
95
|
<div class="bg-white grid grid-cols-2 gap-x-2 col-span-2">
|
|
96
|
-
<div class="w-full text-gray-500 text-xs text-left flex flex-col gap-1 mx-4">
|
|
96
|
+
<div class="w-full text-gray-500 text-xs text-left flex flex-col gap-1 mx-4 overflow-hidden">
|
|
97
97
|
<div>
|
|
98
98
|
<Icon class="text-gray-700" data={faUser} scale={SMALL_ICON_SCALE} /><span class="mx-2">
|
|
99
99
|
By {job.created_by}</span
|
|
@@ -10,6 +10,7 @@ export let isLast = true;
|
|
|
10
10
|
export let currentPath = '';
|
|
11
11
|
export let pureViewer = false;
|
|
12
12
|
export let collapsed = level == 3 || Array.isArray(json);
|
|
13
|
+
export let rawKey = false;
|
|
13
14
|
const collapsedSymbol = '...';
|
|
14
15
|
let keys;
|
|
15
16
|
let isArray;
|
|
@@ -26,23 +27,19 @@ function collapse() {
|
|
|
26
27
|
}
|
|
27
28
|
const dispatch = createEventDispatcher();
|
|
28
29
|
function selectProp(key) {
|
|
29
|
-
dispatch('select', computeKey(key, isArray, currentPath));
|
|
30
|
+
dispatch('select', rawKey ? key : computeKey(key, isArray, currentPath));
|
|
30
31
|
}
|
|
31
32
|
</script>
|
|
32
33
|
|
|
33
34
|
{#if keys.length > 0}
|
|
34
35
|
<span class:hidden={collapsed}>
|
|
35
|
-
{#if level != 0}
|
|
36
|
-
|
|
37
|
-
on:click={collapse}
|
|
38
|
-
>
|
|
39
|
-
(-)
|
|
40
|
-
</span>
|
|
36
|
+
{#if level != 0}
|
|
37
|
+
<span class="cursor-pointer hover:bg-gray-200 px-1 rounded" on:click={collapse}> (-) </span>
|
|
41
38
|
{/if}
|
|
42
39
|
<ul class="w-full">
|
|
43
40
|
{#each keys as key, index}
|
|
44
41
|
<li class="pt-1">
|
|
45
|
-
<button on:click={() => selectProp(key)} class="key rounded px-1 hover:bg-
|
|
42
|
+
<button on:click={() => selectProp(key)} class="key rounded px-1 hover:bg-blue-100">
|
|
46
43
|
{!isArray ? key : index}:
|
|
47
44
|
</button>
|
|
48
45
|
|
|
@@ -57,7 +54,7 @@ function selectProp(key) {
|
|
|
57
54
|
/>
|
|
58
55
|
{:else}
|
|
59
56
|
<button
|
|
60
|
-
class="val rounded px-1 hover:bg-
|
|
57
|
+
class="val rounded px-1 hover:bg-blue-100 {getTypeAsString(json[key])}"
|
|
61
58
|
on:click={() => selectProp(key)}
|
|
62
59
|
>
|
|
63
60
|
{#if json[key] === NEVER_TESTED_THIS_FAR}
|
|
@@ -73,7 +70,7 @@ function selectProp(key) {
|
|
|
73
70
|
{/each}
|
|
74
71
|
</ul>
|
|
75
72
|
</span>
|
|
76
|
-
<span class="cursor-pointer hover:bg-
|
|
73
|
+
<span class="cursor-pointer hover:bg-gray-200" class:hidden={!collapsed} on:click={collapse}>
|
|
77
74
|
{openBracket}{collapsedSymbol}{closeBracket}
|
|
78
75
|
</span>
|
|
79
76
|
{#if !isLast && collapsed}
|
|
@@ -108,7 +105,7 @@ function selectProp(key) {
|
|
|
108
105
|
}
|
|
109
106
|
.val.string {
|
|
110
107
|
--tw-text-opacity: 1;
|
|
111
|
-
color: rgb(
|
|
108
|
+
color: rgb(5 122 85 / var(--tw-text-opacity));
|
|
112
109
|
}
|
|
113
110
|
.val.number {
|
|
114
111
|
--tw-text-opacity: 1;
|
|
@@ -116,5 +113,5 @@ function selectProp(key) {
|
|
|
116
113
|
}
|
|
117
114
|
.val.boolean {
|
|
118
115
|
--tw-text-opacity: 1;
|
|
119
|
-
color: rgb(
|
|
116
|
+
color: rgb(28 100 242 / var(--tw-text-opacity));
|
|
120
117
|
}</style>
|
|
@@ -1,25 +1,50 @@
|
|
|
1
|
-
<script>import {
|
|
1
|
+
<script>import { ResourceService, VariableService } from '../../gen';
|
|
2
|
+
import { workspaceStore } from '../../stores';
|
|
3
|
+
import { faClose } from '@fortawesome/free-solid-svg-icons';
|
|
2
4
|
import { getContext } from 'svelte';
|
|
3
5
|
import Icon from 'svelte-awesome';
|
|
6
|
+
import { Button } from '../common';
|
|
7
|
+
import { createEventDispatcher } from 'svelte';
|
|
4
8
|
import ObjectViewer from './ObjectViewer.svelte';
|
|
5
9
|
import { keepByKey } from './utils';
|
|
6
10
|
export let pickableProperties = {};
|
|
11
|
+
let variables = {};
|
|
12
|
+
let resources = {};
|
|
13
|
+
let displayVariable = false;
|
|
14
|
+
let displayResources = false;
|
|
15
|
+
const dispatch = createEventDispatcher();
|
|
7
16
|
const EMPTY_STRING = '';
|
|
8
17
|
let search = '';
|
|
9
18
|
const { propPickerConfig, clearFocus } = getContext('PropPickerWrapper');
|
|
10
19
|
$: propsFiltered =
|
|
11
20
|
search === EMPTY_STRING ? pickableProperties : keepByKey(pickableProperties, search);
|
|
21
|
+
async function loadVariables() {
|
|
22
|
+
variables = Object.fromEntries((await VariableService.listVariable({
|
|
23
|
+
workspace: $workspaceStore ?? ''
|
|
24
|
+
})).map((variable) => [variable.path, variable.is_secret ? '***' : variable.value ?? '']));
|
|
25
|
+
}
|
|
26
|
+
async function loadResources() {
|
|
27
|
+
resources = Object.fromEntries((await ResourceService.listResource({
|
|
28
|
+
workspace: $workspaceStore ?? ''
|
|
29
|
+
})).map((resource) => [resource.path, resource.description ?? '']));
|
|
30
|
+
}
|
|
12
31
|
</script>
|
|
13
32
|
|
|
14
|
-
<div class="px-
|
|
15
|
-
<
|
|
16
|
-
|
|
33
|
+
<div class="px-2 pt-2">
|
|
34
|
+
<input
|
|
35
|
+
type="text"
|
|
36
|
+
bind:value={search}
|
|
37
|
+
class="bg-gray-50 mt-1 border border-gray-300 text-gray-900 text-sm rounded-lg block px-2 mb-2 w-full"
|
|
38
|
+
placeholder="Search prop..."
|
|
39
|
+
/>
|
|
40
|
+
<div class="flex justify-between items-center space-x-1">
|
|
41
|
+
<span class="font-bold text-sm">Step Context</span>
|
|
17
42
|
<div class="flex space-x-2 items-center">
|
|
18
43
|
{#if $propPickerConfig}
|
|
19
44
|
<span
|
|
20
45
|
class="flex items-center bg-blue-100 text-blue-800 text-xs font-semibold px-2 py-1 rounded dark:bg-green-200 dark:text-green-900"
|
|
21
46
|
>
|
|
22
|
-
{`Selected
|
|
47
|
+
{`Selected: ${$propPickerConfig?.propName}`}
|
|
23
48
|
</span>
|
|
24
49
|
<span
|
|
25
50
|
class="flex items-center bg-blue-100 text-blue-800 text-xs font-semibold px-2 py-1 rounded dark:bg-green-200 dark:text-green-900"
|
|
@@ -36,13 +61,59 @@ $: propsFiltered =
|
|
|
36
61
|
{/if}
|
|
37
62
|
</div>
|
|
38
63
|
</div>
|
|
39
|
-
<
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
64
|
+
<div class="overflow-y-auto mb-2">
|
|
65
|
+
<ObjectViewer json={propsFiltered} on:select />
|
|
66
|
+
</div>
|
|
67
|
+
<span class="font-bold text-sm">Variables </span>
|
|
68
|
+
<div class="overflow-y-auto mb-2">
|
|
69
|
+
{#if displayVariable}
|
|
70
|
+
<Button
|
|
71
|
+
color="light"
|
|
72
|
+
size="xs"
|
|
73
|
+
on:click={() => {
|
|
74
|
+
displayVariable = false
|
|
75
|
+
}}>(-)</Button
|
|
76
|
+
>
|
|
77
|
+
<ObjectViewer
|
|
78
|
+
rawKey={true}
|
|
79
|
+
json={variables}
|
|
80
|
+
on:select={(e) => dispatch('select', `variable('${e.detail}')`)}
|
|
81
|
+
/>
|
|
82
|
+
{:else}
|
|
83
|
+
<Button
|
|
84
|
+
color="light"
|
|
85
|
+
size="xs"
|
|
86
|
+
on:click={async () => {
|
|
87
|
+
await loadVariables()
|
|
88
|
+
displayVariable = true
|
|
89
|
+
}}>{'{...}'}</Button
|
|
90
|
+
>
|
|
91
|
+
{/if}
|
|
92
|
+
</div>
|
|
93
|
+
<span class="font-bold text-sm">Resources</span>
|
|
94
|
+
<div class="overflow-y-auto mb-2">
|
|
95
|
+
{#if displayResources}
|
|
96
|
+
<Button
|
|
97
|
+
color="light"
|
|
98
|
+
size="xs"
|
|
99
|
+
on:click={() => {
|
|
100
|
+
displayResources = false
|
|
101
|
+
}}>(-)</Button
|
|
102
|
+
>
|
|
103
|
+
<ObjectViewer
|
|
104
|
+
rawKey={true}
|
|
105
|
+
json={resources}
|
|
106
|
+
on:select={(e) => dispatch('select', `resource('${e.detail}')`)}
|
|
107
|
+
/>
|
|
108
|
+
{:else}
|
|
109
|
+
<Button
|
|
110
|
+
color="light"
|
|
111
|
+
size="xs"
|
|
112
|
+
on:click={async () => {
|
|
113
|
+
await loadResources()
|
|
114
|
+
displayResources = true
|
|
115
|
+
}}>{'{...}'}</Button
|
|
116
|
+
>
|
|
117
|
+
{/if}
|
|
118
|
+
</div>
|
|
48
119
|
</div>
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
<script>import { goto } from '$app/navigation';
|
|
2
|
+
import { faPlus } from '@fortawesome/free-solid-svg-icons';
|
|
3
|
+
import Fuse from 'fuse.js';
|
|
4
|
+
import { Script } from '../../gen';
|
|
5
|
+
import { ScriptService } from '../../gen';
|
|
6
|
+
import { workspaceStore, hubScripts } from '../../stores';
|
|
7
|
+
import { sendUserToast } from '../../utils';
|
|
8
|
+
import { Button, ButtonPopup, ButtonPopupItem } from '../common';
|
|
9
|
+
import ItemPicker from '../ItemPicker.svelte';
|
|
10
|
+
import Drawer from '../common/drawer/Drawer.svelte';
|
|
11
|
+
import DrawerContent from '../common/drawer/DrawerContent.svelte';
|
|
12
|
+
import SimpleEditor from '../SimpleEditor.svelte';
|
|
13
|
+
import { flowStore, initFlow } from '../flows/flowStore';
|
|
14
|
+
const drawers = {
|
|
15
|
+
hub: undefined,
|
|
16
|
+
template: undefined,
|
|
17
|
+
json: undefined
|
|
18
|
+
};
|
|
19
|
+
let hubItems;
|
|
20
|
+
let pendingJson;
|
|
21
|
+
let templateScripts = [];
|
|
22
|
+
let templateFilter = '';
|
|
23
|
+
let filteredTemplates;
|
|
24
|
+
const fuseOptions = {
|
|
25
|
+
includeScore: false,
|
|
26
|
+
keys: ['description', 'path', 'content', 'hash', 'summary']
|
|
27
|
+
};
|
|
28
|
+
const templateFuse = new Fuse(templateScripts, fuseOptions);
|
|
29
|
+
$: hubItems = $hubScripts?.filter((x) => x.kind == Script.kind.SCRIPT) || [];
|
|
30
|
+
$: filteredTemplates =
|
|
31
|
+
templateFilter.length > 0
|
|
32
|
+
? templateFuse.search(templateFilter).map((value) => value.item)
|
|
33
|
+
: templateScripts;
|
|
34
|
+
function importJson() {
|
|
35
|
+
Object.assign($flowStore, JSON.parse(pendingJson));
|
|
36
|
+
initFlow($flowStore);
|
|
37
|
+
sendUserToast('OpenFlow imported from JSON');
|
|
38
|
+
drawers.json?.toggleDrawer();
|
|
39
|
+
}
|
|
40
|
+
async function loadTemplateScripts() {
|
|
41
|
+
templateScripts = await ScriptService.listScripts({
|
|
42
|
+
workspace: $workspaceStore,
|
|
43
|
+
isTemplate: true
|
|
44
|
+
});
|
|
45
|
+
templateFuse.setCollection(templateScripts);
|
|
46
|
+
}
|
|
47
|
+
</script>
|
|
48
|
+
|
|
49
|
+
<!-- Buttons -->
|
|
50
|
+
<div class="flex flex-row gap-2">
|
|
51
|
+
<ButtonPopup size="sm" startIcon={{ icon: faPlus }} href="/scripts/add">
|
|
52
|
+
<svelte:fragment slot="main">New script</svelte:fragment>
|
|
53
|
+
<ButtonPopupItem on:click={() => drawers.hub?.openModal()}>
|
|
54
|
+
Import script from WindmillHub
|
|
55
|
+
</ButtonPopupItem>
|
|
56
|
+
<ButtonPopupItem on:click={() => drawers.template?.toggleDrawer()}>
|
|
57
|
+
Import script from template
|
|
58
|
+
</ButtonPopupItem>
|
|
59
|
+
<ButtonPopupItem on:click={() => drawers.json?.toggleDrawer()}>
|
|
60
|
+
Import script from raw JSON
|
|
61
|
+
</ButtonPopupItem>
|
|
62
|
+
</ButtonPopup>
|
|
63
|
+
</div>
|
|
64
|
+
|
|
65
|
+
<!-- Initially hidden elements in a drawer -->
|
|
66
|
+
<!-- WindmillHub script list -->
|
|
67
|
+
<ItemPicker
|
|
68
|
+
bind:this={drawers.hub}
|
|
69
|
+
pickCallback={(path) => {
|
|
70
|
+
console.log('pick', { path })
|
|
71
|
+
goto('/scripts/add?hub=' + path)
|
|
72
|
+
}}
|
|
73
|
+
itemName={'Script'}
|
|
74
|
+
extraField="summary"
|
|
75
|
+
loadItems={async () => {
|
|
76
|
+
return hubItems
|
|
77
|
+
}}
|
|
78
|
+
/>
|
|
79
|
+
<!-- Template script list -->
|
|
80
|
+
<Drawer bind:this={drawers.template} size="800px" on:open={loadTemplateScripts}>
|
|
81
|
+
<DrawerContent title="Pick a template" on:close={() => drawers.template?.toggleDrawer()}>
|
|
82
|
+
<div class="pt-2 pb-4">
|
|
83
|
+
<input placeholder="Search templates" bind:value={templateFilter} class="search-bar" />
|
|
84
|
+
</div>
|
|
85
|
+
<div class="flex flex-col mb-2 md:mb-6">
|
|
86
|
+
{#if filteredTemplates && filteredTemplates.length > 0}
|
|
87
|
+
{#each filteredTemplates as { summary, path, hash }}
|
|
88
|
+
<a
|
|
89
|
+
class="p-1 flex flex-row items-baseline gap-2 selected text-gray-700"
|
|
90
|
+
href="/scripts/add?template={path}"
|
|
91
|
+
>
|
|
92
|
+
{#if summary}
|
|
93
|
+
<p class="text-sm font-semibold">{summary}</p>
|
|
94
|
+
{/if}
|
|
95
|
+
|
|
96
|
+
<p class="text-sm">{path}</p>
|
|
97
|
+
<p class="text-gray-400 text-xs text-right grow">
|
|
98
|
+
Last version: {hash}
|
|
99
|
+
</p>
|
|
100
|
+
</a>
|
|
101
|
+
{/each}
|
|
102
|
+
{:else}
|
|
103
|
+
<p class="text-sm text-gray-700">No templates</p>
|
|
104
|
+
{/if}
|
|
105
|
+
</div>
|
|
106
|
+
</DrawerContent>
|
|
107
|
+
</Drawer>
|
|
108
|
+
<!-- Raw JSON -->
|
|
109
|
+
<Drawer bind:this={drawers.json} size="800px">
|
|
110
|
+
<DrawerContent title="Import JSON" on:close={() => drawers.json?.toggleDrawer()}>
|
|
111
|
+
<div class="p-2"><Button size="sm" on:click={importJson}>Import</Button></div>
|
|
112
|
+
<SimpleEditor bind:code={pendingJson} lang="json" class="h-full" />
|
|
113
|
+
</DrawerContent>
|
|
114
|
+
</Drawer>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: {};
|
|
4
|
+
events: {
|
|
5
|
+
[evt: string]: CustomEvent<any>;
|
|
6
|
+
};
|
|
7
|
+
slots: {};
|
|
8
|
+
};
|
|
9
|
+
export declare type CreateActionsProps = typeof __propDef.props;
|
|
10
|
+
export declare type CreateActionsEvents = typeof __propDef.events;
|
|
11
|
+
export declare type CreateActionsSlots = typeof __propDef.slots;
|
|
12
|
+
export default class CreateActions extends SvelteComponentTyped<CreateActionsProps, CreateActionsEvents, CreateActionsSlots> {
|
|
13
|
+
}
|
|
14
|
+
export {};
|
package/editorUtils.d.ts
CHANGED
|
@@ -7,6 +7,9 @@ export declare function editorConfig(model: any, code: string, lang: string, aut
|
|
|
7
7
|
fixedOverflowWidgets: boolean;
|
|
8
8
|
autoDetectHighContrast: boolean;
|
|
9
9
|
lineNumbersMinChars: number;
|
|
10
|
+
scrollbar: {
|
|
11
|
+
alwaysConsumeMouseWheel: boolean;
|
|
12
|
+
};
|
|
10
13
|
lineNumbers: (ln: any) => string;
|
|
11
14
|
folding: boolean;
|
|
12
15
|
scrollBeyondLastLine: boolean;
|
package/editorUtils.js
CHANGED
|
@@ -10,6 +10,7 @@ export function editorConfig(model, code, lang, automaticLayout) {
|
|
|
10
10
|
//lineNumbers: 'off',
|
|
11
11
|
//lineDecorationsWidth: 0,
|
|
12
12
|
lineNumbersMinChars: 4,
|
|
13
|
+
scrollbar: { alwaysConsumeMouseWheel: false },
|
|
13
14
|
lineNumbers: (ln) => '<span class="pr-4 text-gray-400">' + ln + '</span>',
|
|
14
15
|
folding: false,
|
|
15
16
|
scrollBeyondLastLine: false,
|
package/gen/core/OpenAPI.js
CHANGED
package/gen/index.d.ts
CHANGED
|
@@ -42,6 +42,7 @@ export { QueuedJob } from './models/QueuedJob';
|
|
|
42
42
|
export { RawScript } from './models/RawScript';
|
|
43
43
|
export type { Resource } from './models/Resource';
|
|
44
44
|
export type { ResourceType } from './models/ResourceType';
|
|
45
|
+
export type { Retry } from './models/Retry';
|
|
45
46
|
export type { Schedule } from './models/Schedule';
|
|
46
47
|
export { Script } from './models/Script';
|
|
47
48
|
export type { ScriptArgs } from './models/ScriptArgs';
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { FlowModuleValue } from './FlowModuleValue';
|
|
2
2
|
import type { InputTransform } from './InputTransform';
|
|
3
|
+
import type { Retry } from './Retry';
|
|
3
4
|
export declare type FlowModule = {
|
|
4
5
|
input_transforms: Record<string, InputTransform>;
|
|
5
6
|
value: FlowModuleValue;
|
|
@@ -9,4 +10,5 @@ export declare type FlowModule = {
|
|
|
9
10
|
};
|
|
10
11
|
summary?: string;
|
|
11
12
|
suspend?: number;
|
|
13
|
+
retry?: Retry;
|
|
12
14
|
};
|
|
@@ -2,15 +2,5 @@ import type { FlowModule } from './FlowModule';
|
|
|
2
2
|
export declare type FlowValue = {
|
|
3
3
|
modules: Array<FlowModule>;
|
|
4
4
|
failure_module?: FlowModule;
|
|
5
|
-
|
|
6
|
-
constant?: {
|
|
7
|
-
attempts?: number;
|
|
8
|
-
seconds?: number;
|
|
9
|
-
};
|
|
10
|
-
exponential?: {
|
|
11
|
-
attempts?: number;
|
|
12
|
-
multiplier?: number;
|
|
13
|
-
seconds?: number;
|
|
14
|
-
};
|
|
15
|
-
};
|
|
5
|
+
same_worker?: boolean;
|
|
16
6
|
};
|