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
|
@@ -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
3
|
import FieldHeader from './FieldHeader.svelte';
|
|
6
|
-
import DynamicInputHelpBox from './flows/DynamicInputHelpBox.svelte';
|
|
4
|
+
import DynamicInputHelpBox from './flows/content/DynamicInputHelpBox.svelte';
|
|
7
5
|
import { codeToStaticTemplate, getDefaultExpr, isCodeInjection } from './flows/utils';
|
|
8
|
-
import OverlayPropertyPicker from './propertyPicker/OverlayPropertyPicker.svelte';
|
|
9
6
|
import SimpleEditor from './SimpleEditor.svelte';
|
|
10
7
|
import Toggle from './Toggle.svelte';
|
|
8
|
+
import { Button } from './common';
|
|
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}}`;
|
|
@@ -69,11 +57,9 @@ function connectProperty(argName, rawValue) {
|
|
|
69
57
|
arg.type = 'javascript';
|
|
70
58
|
propertyType = 'javascript';
|
|
71
59
|
}
|
|
72
|
-
if (monacos[argName]) {
|
|
73
|
-
monacos[argName].setCode(arg.value);
|
|
74
|
-
}
|
|
75
60
|
}
|
|
76
61
|
$: checked = propertyType == 'javascript';
|
|
62
|
+
const { focusProp } = getContext('PropPickerWrapper');
|
|
77
63
|
</script>
|
|
78
64
|
|
|
79
65
|
{#if arg != undefined}
|
|
@@ -94,113 +80,109 @@ $: checked = propertyType == 'javascript';
|
|
|
94
80
|
</span>
|
|
95
81
|
{/if}
|
|
96
82
|
</div>
|
|
97
|
-
<
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
83
|
+
<div class="flex flex-row space-x-2 items-center">
|
|
84
|
+
<Toggle
|
|
85
|
+
bind:checked
|
|
86
|
+
options={{
|
|
87
|
+
right: 'Raw Javascript Editor'
|
|
88
|
+
}}
|
|
89
|
+
on:change={(e) => {
|
|
90
|
+
const type = e.detail ? 'javascript' : 'static'
|
|
91
|
+
const staticTemplate = isStaticTemplate(inputCats[argName])
|
|
92
|
+
if (type === 'javascript') {
|
|
93
|
+
arg.expr = getDefaultExpr(
|
|
94
|
+
importPath,
|
|
95
|
+
argName,
|
|
96
|
+
staticTemplate ? `\`${arg.value ?? ''}\`` : arg.value
|
|
97
|
+
)
|
|
111
98
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
99
|
+
arg.value = undefined
|
|
100
|
+
propertyType = 'javascript'
|
|
101
|
+
} else {
|
|
102
|
+
arg.value = staticTemplate ? codeToStaticTemplate(arg.expr) : undefined
|
|
116
103
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
104
|
+
arg.expr = undefined
|
|
105
|
+
propertyType = 'static'
|
|
106
|
+
}
|
|
120
107
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
108
|
+
arg.type = type
|
|
109
|
+
}}
|
|
110
|
+
/>
|
|
111
|
+
<div
|
|
112
|
+
on:click={() => {
|
|
113
|
+
focusProp(argName, 'connect', (path) => {
|
|
114
|
+
connectProperty(argName, path)
|
|
115
|
+
})
|
|
116
|
+
}}
|
|
117
|
+
>
|
|
118
|
+
<Button variant="contained" color="blue" size="md">
|
|
119
|
+
<Icon data={faChain} />
|
|
120
|
+
</Button>
|
|
121
|
+
</div>
|
|
122
|
+
</div>
|
|
124
123
|
</div>
|
|
125
124
|
<div class="max-w-xs" />
|
|
126
125
|
|
|
127
126
|
{#if propertyType === undefined || !checked}
|
|
128
|
-
<
|
|
129
|
-
{
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
} else {
|
|
135
|
-
const toAppend = `\$\{${detail.propPath}}`
|
|
136
|
-
arg.value = `${arg.value ?? ''}${toAppend}`
|
|
137
|
-
if (monacos[argName]) {
|
|
138
|
-
monacos[argName].setCode(arg.value)
|
|
139
|
-
}
|
|
140
|
-
if (isStaticTemplate(inputCats[argName])) {
|
|
127
|
+
<ArgInput
|
|
128
|
+
on:focus={() => {
|
|
129
|
+
if (isStaticTemplate(inputCats[argName])) {
|
|
130
|
+
focusProp(argName, 'append', (path) => {
|
|
131
|
+
const toAppend = `\$\{${path}}`
|
|
132
|
+
arg.value = `${arg.value ?? ''}${toAppend}`
|
|
141
133
|
setPropertyType(arg.value)
|
|
142
|
-
}
|
|
134
|
+
})
|
|
135
|
+
} else {
|
|
136
|
+
focusProp(argName, 'insert', (path) => {
|
|
137
|
+
console.log('path', path)
|
|
138
|
+
arg.expr = path
|
|
139
|
+
arg.type = 'javascript'
|
|
140
|
+
propertyType = 'javascript'
|
|
141
|
+
})
|
|
143
142
|
}
|
|
144
143
|
}}
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
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>
|
|
144
|
+
label={argName}
|
|
145
|
+
bind:editor={monacos[argName]}
|
|
146
|
+
bind:description={schema.properties[argName].description}
|
|
147
|
+
bind:value={arg.value}
|
|
148
|
+
type={schema.properties[argName].type}
|
|
149
|
+
required={schema.required.includes(argName)}
|
|
150
|
+
bind:pattern={schema.properties[argName].pattern}
|
|
151
|
+
bind:valid={inputCheck[argName]}
|
|
152
|
+
defaultValue={schema.properties[argName].default}
|
|
153
|
+
bind:enum_={schema.properties[argName].enum}
|
|
154
|
+
bind:format={schema.properties[argName].format}
|
|
155
|
+
contentEncoding={schema.properties[argName].contentEncoding}
|
|
156
|
+
bind:itemsType={schema.properties[argName].items}
|
|
157
|
+
properties={schema.properties[argName].properties}
|
|
158
|
+
displayHeader={false}
|
|
159
|
+
bind:inputCat={inputCats[argName]}
|
|
160
|
+
on:input={(e) => {
|
|
161
|
+
if (isStaticTemplate(inputCats[argName])) {
|
|
162
|
+
setPropertyType(e.detail.rawValue)
|
|
163
|
+
}
|
|
164
|
+
}}
|
|
165
|
+
/>
|
|
181
166
|
{:else if checked}
|
|
182
167
|
{#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>
|
|
168
|
+
<div class="border rounded p-2 mt-2 border-gray-300">
|
|
169
|
+
<SimpleEditor
|
|
170
|
+
bind:this={monacos[argName]}
|
|
171
|
+
on:focus={() => {
|
|
172
|
+
focusProp(argName, 'insert', (path) => {
|
|
173
|
+
monacos[argName].insertAtCursor(path)
|
|
174
|
+
})
|
|
175
|
+
}}
|
|
176
|
+
bind:code={arg.expr}
|
|
177
|
+
lang="javascript"
|
|
178
|
+
class="few-lines-editor"
|
|
179
|
+
{extraLib}
|
|
180
|
+
extraLibPath="file:///node_modules/@types/windmill@{importPath}/index.d.ts"
|
|
181
|
+
shouldBindKey={false}
|
|
182
|
+
/>
|
|
183
|
+
</div>
|
|
203
184
|
<DynamicInputHelpBox {importPath} />
|
|
185
|
+
<div class="mb-2" />
|
|
204
186
|
{/if}
|
|
205
187
|
{:else}
|
|
206
188
|
<p>Not recognized arg type {arg.type}</p>
|
|
@@ -10,7 +10,7 @@ export let inputTransforms;
|
|
|
10
10
|
<span class="font-black text-gray-700">{key}</span>: {#if val.type == 'static'}<ObjectViewer
|
|
11
11
|
json={val.value}
|
|
12
12
|
/>{:else}
|
|
13
|
-
<span class="
|
|
13
|
+
<span class="text-xs">
|
|
14
14
|
<Highlight offsetTop={0} language={typescript} code={val.expr} />
|
|
15
15
|
</span>
|
|
16
16
|
{/if}
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
import Switch from './Switch.svelte';
|
|
3
3
|
import { createEventDispatcher } from 'svelte';
|
|
4
4
|
import { UserService } from '../gen';
|
|
5
|
+
import { Button } from './common';
|
|
5
6
|
const dispatch = createEventDispatcher();
|
|
6
|
-
let valid = true;
|
|
7
7
|
let modal;
|
|
8
8
|
export function openModal() {
|
|
9
9
|
modal.openModal();
|
|
@@ -43,14 +43,14 @@ async function addUser() {
|
|
|
43
43
|
<input on:keyup={handleKeyUp} placeholder="name" bind:value={name} />
|
|
44
44
|
<input on:keyup={handleKeyUp} placeholder="company" bind:value={company} />
|
|
45
45
|
|
|
46
|
-
<
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
}
|
|
46
|
+
<Button
|
|
47
|
+
variant="contained"
|
|
48
|
+
color="blue"
|
|
49
|
+
size="sm"
|
|
50
|
+
btnClasses="!ml-4 !w-40"
|
|
51
|
+
on:click={addUser}
|
|
52
52
|
disabled={email == undefined || password == undefined}
|
|
53
53
|
>
|
|
54
54
|
Add
|
|
55
|
-
</
|
|
55
|
+
</Button>
|
|
56
56
|
</div>
|
|
@@ -3,8 +3,8 @@ import Switch from './Switch.svelte';
|
|
|
3
3
|
import { createEventDispatcher } from 'svelte';
|
|
4
4
|
import { workspaceStore } from '../stores';
|
|
5
5
|
import { WorkspaceService } from '../gen';
|
|
6
|
+
import { Button } from './common';
|
|
6
7
|
const dispatch = createEventDispatcher();
|
|
7
|
-
let valid = true;
|
|
8
8
|
let modal;
|
|
9
9
|
export function openModal() {
|
|
10
10
|
modal.openModal();
|
|
@@ -35,14 +35,14 @@ async function inviteUser() {
|
|
|
35
35
|
<input on:keyup={handleKeyUp} placeholder="email" bind:value={email} />
|
|
36
36
|
|
|
37
37
|
<Switch class="ml-2" bind:checked={is_admin} horizontal={true} label={'admin: '} />
|
|
38
|
-
<
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
}
|
|
44
|
-
disabled={email
|
|
38
|
+
<Button
|
|
39
|
+
variant="contained"
|
|
40
|
+
color="blue"
|
|
41
|
+
size="sm"
|
|
42
|
+
btnClasses="!ml-4"
|
|
43
|
+
on:click={inviteUser}
|
|
44
|
+
disabled={email === undefined}
|
|
45
45
|
>
|
|
46
46
|
Invite
|
|
47
|
-
</
|
|
47
|
+
</Button>
|
|
48
48
|
</div>
|
|
@@ -6,6 +6,7 @@ export let loadItems;
|
|
|
6
6
|
export let extraField;
|
|
7
7
|
export let itemName;
|
|
8
8
|
export let closeOnClick = true;
|
|
9
|
+
export let noItemMessage = '';
|
|
9
10
|
let items = [];
|
|
10
11
|
let filteredItems = [];
|
|
11
12
|
let itemsFilter = '';
|
|
@@ -17,45 +18,51 @@ const fuse = new Fuse(items, fuseOptions);
|
|
|
17
18
|
export function openModal() {
|
|
18
19
|
loadItems().then((v) => {
|
|
19
20
|
items = v;
|
|
20
|
-
|
|
21
|
+
if (items) {
|
|
22
|
+
fuse.setCollection(items);
|
|
23
|
+
}
|
|
21
24
|
});
|
|
22
25
|
modal.openModal();
|
|
23
26
|
}
|
|
24
27
|
$: filteredItems =
|
|
25
|
-
itemsFilter.length > 0 ? fuse.search(itemsFilter).map((value) => value.item) : items;
|
|
28
|
+
itemsFilter.length > 0 && items ? fuse.search(itemsFilter).map((value) => value.item) : items;
|
|
26
29
|
let modal;
|
|
27
30
|
</script>
|
|
28
31
|
|
|
29
32
|
<Modal bind:this={modal} z="z-30">
|
|
30
|
-
<div slot="title">
|
|
33
|
+
<div slot="title">Search a {itemName}</div>
|
|
31
34
|
<div slot="content">
|
|
32
|
-
|
|
33
|
-
<
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
>{obj[
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
35
|
+
{#if filteredItems}
|
|
36
|
+
<div class="w-12/12 pb-4">
|
|
37
|
+
<input placeholder="Search {itemName}" bind:value={itemsFilter} class="search-item" />
|
|
38
|
+
</div>
|
|
39
|
+
<ul class="divide-y divide-gray-200">
|
|
40
|
+
{#each filteredItems as obj}
|
|
41
|
+
<li
|
|
42
|
+
class="py-4 px-1 gap-1 flex flex-col hover:bg-white hover:border text-black cursor-pointer"
|
|
43
|
+
on:click={() => {
|
|
44
|
+
if (closeOnClick) {
|
|
45
|
+
modal.closeModal()
|
|
46
|
+
}
|
|
47
|
+
pickCallback(obj['path'], obj[extraField])
|
|
48
|
+
}}
|
|
49
|
+
>
|
|
50
|
+
<p class="text-sm font-semibold flex flex-row">
|
|
51
|
+
{#if `app` in obj}
|
|
52
|
+
<IconedResourceType silent={true} name={obj['app']} />
|
|
53
|
+
<span class="mr-2" />
|
|
54
|
+
{/if}
|
|
55
|
+
<span class="mr-2">{obj[extraField]}</span><span class="font-normal break-all"
|
|
56
|
+
>{obj['path'] ?? ''}</span
|
|
57
|
+
>
|
|
58
|
+
</p>
|
|
59
|
+
<p class="text-xs italic">{obj['description'] ?? ''}</p>
|
|
60
|
+
</li>
|
|
61
|
+
{/each}
|
|
62
|
+
</ul>
|
|
63
|
+
{:else}
|
|
64
|
+
<span class="mt-2 text-sm text-red-400">{noItemMessage}</span>
|
|
65
|
+
{/if}
|
|
59
66
|
</div>
|
|
60
67
|
<span slot="submission">
|
|
61
68
|
<slot name="submission" />
|
|
@@ -2,10 +2,11 @@ import { SvelteComponentTyped } from "svelte";
|
|
|
2
2
|
declare const __propDef: {
|
|
3
3
|
props: {
|
|
4
4
|
pickCallback: (path: string, f: string) => void;
|
|
5
|
-
loadItems: () => Promise<Record<string, any>[]>;
|
|
5
|
+
loadItems: () => Promise<Record<string, any>[] | undefined>;
|
|
6
6
|
extraField: string;
|
|
7
7
|
itemName: string;
|
|
8
8
|
closeOnClick?: boolean | undefined;
|
|
9
|
+
noItemMessage?: string | undefined;
|
|
9
10
|
openModal?: (() => void) | undefined;
|
|
10
11
|
};
|
|
11
12
|
events: {
|
|
@@ -28,7 +28,8 @@ export let job;
|
|
|
28
28
|
{:else if job && 'running' in job && job.running}
|
|
29
29
|
<Badge large color="yellow">
|
|
30
30
|
<Icon data={faCircle} scale={SMALL_ICON_SCALE} class="mr-2" />
|
|
31
|
-
Running
|
|
31
|
+
Running {#if job.flow_status}({job.flow_status?.step ?? ''} of {job.raw_flow?.modules?.length ??
|
|
32
|
+
'?'}){/if}
|
|
32
33
|
</Badge>
|
|
33
34
|
{:else if job && 'running' in job && 'scheduled_for' in job && job.scheduled_for && forLater(job.scheduled_for)}
|
|
34
35
|
<Badge>
|
|
@@ -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>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: {
|
|
4
|
+
content: string | undefined;
|
|
5
|
+
isLoading: boolean;
|
|
6
|
+
scrollToBottom?: (() => void) | undefined;
|
|
7
|
+
};
|
|
8
|
+
events: {
|
|
9
|
+
[evt: string]: CustomEvent<any>;
|
|
10
|
+
};
|
|
11
|
+
slots: {};
|
|
12
|
+
};
|
|
13
|
+
export declare type LogViewerProps = typeof __propDef.props;
|
|
14
|
+
export declare type LogViewerEvents = typeof __propDef.events;
|
|
15
|
+
export declare type LogViewerSlots = typeof __propDef.slots;
|
|
16
|
+
export default class LogViewer extends SvelteComponentTyped<LogViewerProps, LogViewerEvents, LogViewerSlots> {
|
|
17
|
+
get scrollToBottom(): () => void;
|
|
18
|
+
}
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
<script>import { getScriptByPath, sendUserToast, truncateRev } from '../utils';
|
|
2
|
+
import { HSplitPane, VSplitPane } from 'svelte-split-pane';
|
|
3
|
+
import RunForm from './RunForm.svelte';
|
|
4
|
+
import TestJobLoader from './TestJobLoader.svelte';
|
|
5
|
+
import LogViewer from './LogViewer.svelte';
|
|
6
|
+
import DisplayResult from './DisplayResult.svelte';
|
|
7
|
+
import Button from './common/button/Button.svelte';
|
|
8
|
+
import { faRotateRight } from '@fortawesome/free-solid-svg-icons';
|
|
9
|
+
import { flowStateStore } from './flows/flowState';
|
|
10
|
+
let testJobLoader;
|
|
11
|
+
// Test
|
|
12
|
+
let testIsLoading = false;
|
|
13
|
+
let testJob;
|
|
14
|
+
export let mod;
|
|
15
|
+
export let schema;
|
|
16
|
+
export let indices;
|
|
17
|
+
let stepArgs = {};
|
|
18
|
+
export function runTestWithStepArgs() {
|
|
19
|
+
runTest(stepArgs);
|
|
20
|
+
}
|
|
21
|
+
export async function runTest(args) {
|
|
22
|
+
const val = mod.value;
|
|
23
|
+
if (val.type == 'rawscript') {
|
|
24
|
+
await testJobLoader?.runPreview(val.path, val.content, val.language, args);
|
|
25
|
+
}
|
|
26
|
+
else if (val.type == 'script') {
|
|
27
|
+
const script = await getScriptByPath(val.path);
|
|
28
|
+
await testJobLoader?.runPreview(val.path, script.content, script.language, args);
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
throw Error('not testable module type');
|
|
32
|
+
}
|
|
33
|
+
sendUserToast(`started test ${truncateRev(testJob?.id ?? '', 10)}`);
|
|
34
|
+
}
|
|
35
|
+
function jobDone() {
|
|
36
|
+
if (testJob && !testJob.canceled && testJob.type == 'CompletedJob' && `result` in testJob) {
|
|
37
|
+
const result = testJob.result;
|
|
38
|
+
const pMod = $flowStateStore.modules[indices[0]];
|
|
39
|
+
if (pMod) {
|
|
40
|
+
if (indices[1] != undefined && pMod.childFlowModules) {
|
|
41
|
+
const cMod = pMod.childFlowModules[indices[1]];
|
|
42
|
+
if (cMod) {
|
|
43
|
+
cMod.previewResult = result;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
pMod.previewResult = result;
|
|
48
|
+
}
|
|
49
|
+
$flowStateStore.modules[indices[0]] = pMod;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
</script>
|
|
54
|
+
|
|
55
|
+
<TestJobLoader
|
|
56
|
+
on:done={jobDone}
|
|
57
|
+
bind:this={testJobLoader}
|
|
58
|
+
bind:isLoading={testIsLoading}
|
|
59
|
+
bind:job={testJob}
|
|
60
|
+
/>
|
|
61
|
+
<HSplitPane leftPaneSize="50%" rightPaneSize="50%" minLeftPaneSize="20%" minRightPaneSize="20%">
|
|
62
|
+
<left slot="left" class="relative">
|
|
63
|
+
<div class="overflow-auto h-full p-4">
|
|
64
|
+
<RunForm
|
|
65
|
+
runnable={{ summary: mod.summary ?? '', schema, description: '' }}
|
|
66
|
+
runAction={(_, args) => runTest(args)}
|
|
67
|
+
schedulable={false}
|
|
68
|
+
buttonText="Test just this step (Ctrl+Enter)"
|
|
69
|
+
detailed={false}
|
|
70
|
+
bind:args={stepArgs}
|
|
71
|
+
/>
|
|
72
|
+
{#if testIsLoading}
|
|
73
|
+
<Button
|
|
74
|
+
on:click={testJobLoader?.cancelJob}
|
|
75
|
+
btnClasses="w-full mt-4"
|
|
76
|
+
color="red"
|
|
77
|
+
size="sm"
|
|
78
|
+
startIcon={{
|
|
79
|
+
icon: faRotateRight,
|
|
80
|
+
classes: 'animate-spin'
|
|
81
|
+
}}
|
|
82
|
+
>
|
|
83
|
+
Cancel
|
|
84
|
+
</Button>
|
|
85
|
+
{/if}
|
|
86
|
+
</div>
|
|
87
|
+
</left>
|
|
88
|
+
<right slot="right">
|
|
89
|
+
<div class="overflow-auto h-full">
|
|
90
|
+
<VSplitPane topPanelSize="50%" downPanelSize="50%">
|
|
91
|
+
<top slot="top">
|
|
92
|
+
<LogViewer content={testJob?.logs} isLoading={testIsLoading} />
|
|
93
|
+
</top>
|
|
94
|
+
<down slot="down">
|
|
95
|
+
<pre class="overflow-x-auto break-all relative h-full p-2 text-sm"
|
|
96
|
+
>{#if testJob && 'result' in testJob && testJob.result != undefined}<DisplayResult
|
|
97
|
+
result={testJob.result}
|
|
98
|
+
/>
|
|
99
|
+
{:else if testIsLoading}Waiting for Result...
|
|
100
|
+
{:else}Test to see the result here
|
|
101
|
+
{/if}
|
|
102
|
+
</pre>
|
|
103
|
+
</down>
|
|
104
|
+
</VSplitPane>
|
|
105
|
+
</div>
|
|
106
|
+
</right>
|
|
107
|
+
</HSplitPane>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import type { Schema } from '../common';
|
|
3
|
+
import type { FlowModule } from '../gen';
|
|
4
|
+
declare const __propDef: {
|
|
5
|
+
props: {
|
|
6
|
+
mod: FlowModule;
|
|
7
|
+
schema: Schema;
|
|
8
|
+
indices: [number, number | undefined];
|
|
9
|
+
runTestWithStepArgs?: (() => void) | undefined;
|
|
10
|
+
runTest?: ((args: any) => Promise<void>) | undefined;
|
|
11
|
+
};
|
|
12
|
+
events: {
|
|
13
|
+
[evt: string]: CustomEvent<any>;
|
|
14
|
+
};
|
|
15
|
+
slots: {};
|
|
16
|
+
};
|
|
17
|
+
export declare type ModulePreviewProps = typeof __propDef.props;
|
|
18
|
+
export declare type ModulePreviewEvents = typeof __propDef.events;
|
|
19
|
+
export declare type ModulePreviewSlots = typeof __propDef.slots;
|
|
20
|
+
export default class ModulePreview extends SvelteComponentTyped<ModulePreviewProps, ModulePreviewEvents, ModulePreviewSlots> {
|
|
21
|
+
get runTestWithStepArgs(): () => void;
|
|
22
|
+
get runTest(): (args: any) => Promise<void>;
|
|
23
|
+
}
|
|
24
|
+
export {};
|
package/components/Path.svelte
CHANGED
|
@@ -188,7 +188,7 @@ $: {
|
|
|
188
188
|
</div>
|
|
189
189
|
<div class="pt-0 text-xs px-1 flex flex-col-reverse sm:grid sm:grid-cols-4 sm:gap-4 w-full">
|
|
190
190
|
<div class="col-span-2"><span class="font-mono">{path}</span></div>
|
|
191
|
-
<div class="text-
|
|
191
|
+
<div class="text-red-600 text-2xs col-span-2">{error}</div>
|
|
192
192
|
</div>
|
|
193
193
|
</div>
|
|
194
194
|
|