windmill-components 1.56.2 → 1.56.5
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/CenteredModal.svelte +15 -14
- package/components/CenteredModal.svelte.d.ts +1 -0
- package/components/Dropdown.svelte +4 -3
- package/components/Dropdown.svelte.d.ts +1 -0
- package/components/Editor.svelte +1 -1
- package/components/FlowPreviewContent.svelte +1 -1
- package/components/InputTransformForm.svelte +43 -35
- package/components/InputTransformForm.svelte.d.ts +1 -0
- package/components/LogViewer.svelte +7 -4
- package/components/ModulePreview.svelte +20 -13
- package/components/Popover.svelte +9 -17
- package/components/Popover.svelte.d.ts +3 -0
- package/components/RadioButton.svelte +5 -3
- package/components/RadioButton.svelte.d.ts +2 -0
- package/components/ResourceEditor.svelte +2 -1
- package/components/SchemaEditor.svelte +3 -0
- package/components/SchemaForm.svelte +84 -76
- package/components/SchemaForm.svelte.d.ts +3 -0
- package/components/ScriptEditor.svelte +14 -9
- package/components/Star.svelte +15 -9
- package/components/TemplateEditor.svelte +4 -10
- package/components/TestJobLoader.svelte +37 -20
- package/components/TestJobLoader.svelte.d.ts +10 -8
- package/components/Toggle.svelte +30 -7
- package/components/Toggle.svelte.d.ts +4 -0
- package/components/Tooltip.svelte +1 -1
- package/components/apps/components/buttons/AppButton.svelte +14 -4
- package/components/apps/components/buttons/AppButton.svelte.d.ts +1 -0
- package/components/apps/components/dataDisplay/AppBarChart.svelte +7 -2
- package/components/apps/components/dataDisplay/AppPieChart.svelte +1 -1
- package/components/apps/components/form/AppForm.svelte +7 -0
- package/components/apps/components/helpers/AlignWrapper.svelte +2 -1
- package/components/apps/components/helpers/AlignWrapper.svelte.d.ts +1 -0
- package/components/apps/components/helpers/InputValue.svelte +17 -5
- package/components/apps/components/helpers/InputValue.svelte.d.ts +1 -0
- package/components/apps/components/helpers/NonRunnableComponent.svelte +3 -0
- package/components/apps/components/helpers/RefreshButton.svelte +16 -11
- package/components/apps/components/helpers/RefreshButton.svelte.d.ts +2 -0
- package/components/apps/components/helpers/RunnableComponent.svelte +40 -15
- package/components/apps/components/selectInputs/AppCheckbox.svelte +4 -0
- package/components/apps/components/table/AppTable.svelte +48 -24
- package/components/apps/components/textInputs/AppTextInput.svelte +7 -3
- package/components/apps/editor/AppEditor.svelte +83 -41
- package/components/apps/editor/AppEditor.svelte.d.ts +2 -0
- package/components/apps/editor/AppEditorHeader.svelte +5 -2
- package/components/apps/editor/AppPreview.svelte +3 -1
- package/components/apps/editor/AppPreview.svelte.d.ts +2 -0
- package/components/apps/editor/ComponentEditor.svelte +6 -7
- package/components/apps/editor/ComponentEditor.svelte.d.ts +1 -0
- package/components/apps/editor/ComponentHeader.svelte +31 -29
- package/components/apps/editor/ComponentHeader.svelte.d.ts +2 -1
- package/components/apps/editor/GridEditor.svelte +62 -46
- package/components/apps/editor/GridEditor.svelte.d.ts +6 -1
- package/components/apps/editor/RecomputeAllComponents.svelte +7 -13
- package/components/apps/editor/SettingsPanel.svelte +2 -2
- package/components/apps/editor/TablePanel.svelte +1 -0
- package/components/apps/editor/componentsPanel/ComponentList.svelte +4 -15
- package/components/apps/editor/componentsPanel/componentStaticValues.d.ts +1 -1
- package/components/apps/editor/componentsPanel/componentStaticValues.js +1 -1
- package/components/apps/editor/componentsPanel/data.js +11 -15
- package/components/apps/editor/contextPanel/ComponentOutputViewer.svelte +1 -0
- package/components/apps/editor/contextPanel/ContextPanel.svelte +46 -43
- package/components/apps/editor/inlineScriptsPanel/InlineScriptEditor.svelte +9 -10
- package/components/apps/editor/inlineScriptsPanel/InlineScriptEditorDrawer.svelte +5 -1
- package/components/apps/editor/inlineScriptsPanel/InlineScriptEditorDrawer.svelte.d.ts +2 -0
- package/components/apps/editor/inlineScriptsPanel/InlineScriptEditorPanel.svelte +62 -20
- package/components/apps/editor/inlineScriptsPanel/InlineScriptsPanel.svelte +2 -2
- package/components/apps/editor/inlineScriptsPanel/InlineScriptsPanelList.svelte +73 -76
- package/components/apps/editor/settingsPanel/ArrayStaticInputEditor.svelte +1 -2
- package/components/apps/editor/settingsPanel/ArrayStaticInputEditor.svelte.d.ts +0 -1
- package/components/apps/editor/settingsPanel/ComponentInputTypeEditor.svelte +5 -5
- package/components/apps/editor/settingsPanel/ComponentPanel.svelte +11 -18
- package/components/apps/editor/settingsPanel/ComponentPanel.svelte.d.ts +1 -0
- package/components/apps/editor/settingsPanel/InputsSpecEditor.svelte +22 -5
- package/components/apps/editor/settingsPanel/InputsSpecEditor.svelte.d.ts +3 -3
- package/components/apps/editor/settingsPanel/InputsSpecsEditor.svelte +16 -15
- package/components/apps/editor/settingsPanel/InputsSpecsEditor.svelte.d.ts +3 -2
- package/components/apps/editor/settingsPanel/Recompute.svelte +1 -1
- package/components/apps/editor/settingsPanel/SelectedRunnable.svelte +21 -3
- package/components/apps/editor/settingsPanel/SubTypeEditor.svelte +1 -3
- package/components/apps/editor/settingsPanel/SubTypeEditor.svelte.d.ts +0 -1
- package/components/apps/editor/settingsPanel/TableActions.svelte +18 -9
- package/components/apps/editor/settingsPanel/TableActions.svelte.d.ts +1 -0
- package/components/apps/editor/settingsPanel/common/PanelSection.svelte +9 -2
- package/components/apps/editor/settingsPanel/common/PanelSection.svelte.d.ts +2 -0
- package/components/apps/editor/settingsPanel/inputEditor/RowInputEditor.svelte +6 -0
- package/components/apps/editor/settingsPanel/inputEditor/RowInputEditor.svelte.d.ts +17 -0
- package/components/apps/editor/settingsPanel/inputEditor/StaticInputEditor.svelte +2 -7
- package/components/apps/editor/settingsPanel/inputEditor/StaticInputEditor.svelte.d.ts +0 -1
- package/components/apps/editor/settingsPanel/mainInput/InlineScriptList.svelte +1 -2
- package/components/apps/editor/settingsPanel/mainInput/RunnableSelector.svelte +7 -6
- package/components/apps/gridUtils.js +3 -2
- package/components/apps/inputType.d.ts +9 -3
- package/components/apps/rx.d.ts +2 -2
- package/components/apps/rx.js +3 -2
- package/components/apps/types.d.ts +2 -1
- package/components/apps/utils.js +4 -2
- package/components/common/button/Button.svelte +3 -1
- package/components/common/button/Button.svelte.d.ts +1 -0
- package/components/common/confirmationModal/ConfirmationModal.svelte +1 -0
- package/components/common/table/AppRow.svelte +5 -1
- package/components/common/table/FlowRow.svelte +5 -1
- package/components/common/table/Row.svelte +10 -8
- package/components/common/table/ScriptRow.svelte +13 -11
- package/components/flows/content/FlowConstants.svelte +68 -0
- package/components/flows/content/FlowConstants.svelte.d.ts +14 -0
- package/components/flows/content/FlowEditorPanel.svelte +3 -0
- package/components/flows/content/FlowModuleComponent.svelte +4 -1
- package/components/flows/content/FlowModuleHeader.svelte +35 -84
- package/components/flows/content/FlowModuleHeader.svelte.d.ts +2 -2
- package/components/flows/flowStore.d.ts +1 -1
- package/components/flows/flowStore.js +8 -8
- package/components/flows/header/FlowPreviewButtons.svelte +2 -1
- package/components/flows/map/FlowConstantsItem.svelte +15 -0
- package/components/flows/map/FlowConstantsItem.svelte.d.ts +14 -0
- package/components/flows/map/FlowInputsItem.svelte +1 -2
- package/components/flows/map/FlowModuleSchemaItem.svelte +34 -25
- package/components/flows/map/FlowModuleSchemaMap.svelte +13 -3
- package/components/flows/map/FlowSettingsItem.svelte +2 -2
- package/components/flows/pickers/PickHubScript.svelte +1 -1
- package/components/sidebar/FavoriteMenu.svelte +23 -19
- package/components/sidebar/SidebarContent.svelte +16 -16
- package/components/sidebar/WorkspaceMenu.svelte +17 -15
- package/logout.d.ts +1 -0
- package/logout.js +5 -3
- package/package.json +6 -3
|
@@ -3,35 +3,36 @@ import { onMount } from 'svelte';
|
|
|
3
3
|
import WindmillIcon from './icons/WindmillIcon.svelte';
|
|
4
4
|
export let subtitle = undefined;
|
|
5
5
|
export let title = 'Windmill';
|
|
6
|
+
export let disableLogo = false;
|
|
6
7
|
let version = '';
|
|
7
8
|
onMount(async () => {
|
|
8
9
|
version = await SettingsService.backendVersion();
|
|
9
10
|
});
|
|
10
11
|
</script>
|
|
11
12
|
|
|
12
|
-
<div class="
|
|
13
|
-
<div class="
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
<div class="center-center min-h-screen p-4 relative bg-[#3b4252]">
|
|
14
|
+
<div class="border rounded-md shadow-md bg-white w-full max-w-[640px]
|
|
15
|
+
p-4 sm:py-8 sm:px-10 mb-6 md:mb-20 z-10">
|
|
16
|
+
<div class="mb-10">
|
|
17
|
+
<h1 class="text-center">
|
|
16
18
|
{title}
|
|
17
19
|
</h1>
|
|
18
20
|
{#if subtitle}
|
|
19
|
-
<p class="
|
|
21
|
+
<p class="text-sm text-center text-gray-600 mt-2">
|
|
20
22
|
{subtitle}
|
|
21
23
|
</p>
|
|
22
24
|
{/if}
|
|
23
|
-
<slot />
|
|
24
25
|
</div>
|
|
25
|
-
|
|
26
|
-
<!-- empty row to make the form a little bit above vertical centering-->
|
|
27
|
-
<div class="py-12" />
|
|
26
|
+
<slot />
|
|
28
27
|
</div>
|
|
29
|
-
|
|
30
|
-
<div class="
|
|
31
|
-
<
|
|
28
|
+
{#if !disableLogo}
|
|
29
|
+
<div class="hidden lg:block absolute top-10 right-50">
|
|
30
|
+
<div class="animate-[spin_100s_linear_infinite] ">
|
|
31
|
+
<WindmillIcon white height="100px" width="100px" />
|
|
32
|
+
</div>
|
|
33
|
+
<h2 class="text-center pt-2 text-gray-100">Windmill</h2>
|
|
32
34
|
</div>
|
|
33
|
-
|
|
34
|
-
</div>
|
|
35
|
+
{/if}
|
|
35
36
|
<div class="absolute top-0 right-0 text-2xs text-gray-300 italic px-3 py-1">
|
|
36
37
|
<span class="font-mono">{version}</span>
|
|
37
38
|
</div>
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
<script>import { createEventDispatcher } from 'svelte';
|
|
2
2
|
import Icon from 'svelte-awesome';
|
|
3
|
-
import {
|
|
3
|
+
import { MoreHorizontal } from 'lucide-svelte';
|
|
4
4
|
import { Button, Menu } from './common';
|
|
5
5
|
export let dropdownItems;
|
|
6
6
|
export let name = undefined;
|
|
7
7
|
export let placement = 'bottom-start';
|
|
8
|
+
export let btnClasses = '!text-blue-500 bg-transparent';
|
|
8
9
|
const dispatch = createEventDispatcher();
|
|
9
10
|
</script>
|
|
10
11
|
|
|
11
12
|
<Menu {placement} let:close>
|
|
12
|
-
<Button color="light" size="xs" btnClasses
|
|
13
|
+
<Button nonCaptureEvent color="light" size="xs" {btnClasses} slot="trigger">
|
|
13
14
|
{#if !$$slots.default}
|
|
14
|
-
<
|
|
15
|
+
<MoreHorizontal size={20} />
|
|
15
16
|
{:else}
|
|
16
17
|
<slot />
|
|
17
18
|
{/if}
|
package/components/Editor.svelte
CHANGED
|
@@ -361,7 +361,7 @@ async function loadMonaco() {
|
|
|
361
361
|
timeoutModel && clearTimeout(timeoutModel);
|
|
362
362
|
timeoutModel = setTimeout(() => {
|
|
363
363
|
code = getCode();
|
|
364
|
-
dispatch('change');
|
|
364
|
+
dispatch('change', code);
|
|
365
365
|
}, 500);
|
|
366
366
|
});
|
|
367
367
|
editor.onDidFocusEditorText(() => {
|
|
@@ -50,7 +50,7 @@ function extractFlow(previewMode) {
|
|
|
50
50
|
}
|
|
51
51
|
else {
|
|
52
52
|
const flow = JSON.parse(JSON.stringify($flowStore));
|
|
53
|
-
const idOrders = dfs(flow.value.modules);
|
|
53
|
+
const idOrders = dfs(flow.value.modules, (x) => x.id);
|
|
54
54
|
let upToIndex = idOrders.indexOf($selectedId);
|
|
55
55
|
if (upToIndex != -1) {
|
|
56
56
|
flow.value.modules = sliceModules(flow.value.modules, upToIndex, idOrders);
|
|
@@ -18,6 +18,7 @@ export let previousModuleId;
|
|
|
18
18
|
export let pickForField = undefined;
|
|
19
19
|
export let variableEditor = undefined;
|
|
20
20
|
export let itemPicker = undefined;
|
|
21
|
+
export let noDynamicToggle = false;
|
|
21
22
|
let monaco = undefined;
|
|
22
23
|
let monacoTemplate = undefined;
|
|
23
24
|
let argInput = undefined;
|
|
@@ -90,7 +91,7 @@ function onFocus() {
|
|
|
90
91
|
}
|
|
91
92
|
}
|
|
92
93
|
const { focusProp, propPickerConfig } = getContext('PropPickerWrapper');
|
|
93
|
-
$: isStaticTemplate(inputCat) && propertyType == 'static' && setPropertyType(arg
|
|
94
|
+
$: isStaticTemplate(inputCat) && propertyType == 'static' && setPropertyType(arg?.value);
|
|
94
95
|
const openBracket = '${';
|
|
95
96
|
const closeBracket = '}';
|
|
96
97
|
</script>
|
|
@@ -118,21 +119,8 @@ const closeBracket = '}';
|
|
|
118
119
|
</span>
|
|
119
120
|
{/if}
|
|
120
121
|
</div>
|
|
121
|
-
|
|
122
|
-
<div>
|
|
123
|
-
<Button
|
|
124
|
-
variant="contained"
|
|
125
|
-
color="blue"
|
|
126
|
-
size="xs"
|
|
127
|
-
on:click={() => {
|
|
128
|
-
focusProp(argName, 'connect', (path) => {
|
|
129
|
-
connectProperty(path)
|
|
130
|
-
return true
|
|
131
|
-
})
|
|
132
|
-
}}>Connect →</Button
|
|
133
|
-
>
|
|
134
|
-
</div>
|
|
135
|
-
<div>
|
|
122
|
+
{#if !noDynamicToggle}
|
|
123
|
+
<div class="flex flex-row gap-x-4 gap-y-1 flex-wrap">
|
|
136
124
|
<ToggleButtonGroup
|
|
137
125
|
bind:selected={propertyType}
|
|
138
126
|
on:selected={(e) => {
|
|
@@ -143,24 +131,29 @@ const closeBracket = '}';
|
|
|
143
131
|
argName,
|
|
144
132
|
previousModuleId,
|
|
145
133
|
staticTemplate
|
|
146
|
-
? `\`${arg
|
|
134
|
+
? `\`${arg?.value ?? ''}\``
|
|
147
135
|
: arg.value
|
|
148
|
-
? JSON.stringify(arg
|
|
136
|
+
? JSON.stringify(arg?.value, null, 4)
|
|
149
137
|
: ''
|
|
150
138
|
)
|
|
151
139
|
}
|
|
152
|
-
|
|
153
|
-
|
|
140
|
+
if (arg) {
|
|
141
|
+
arg.value = undefined
|
|
142
|
+
}
|
|
154
143
|
propertyType = 'javascript'
|
|
155
144
|
arg.type = 'javascript'
|
|
156
145
|
} else {
|
|
157
146
|
if (staticTemplate) {
|
|
158
|
-
|
|
159
|
-
|
|
147
|
+
if (arg) {
|
|
148
|
+
arg.value = codeToStaticTemplate(arg.expr)
|
|
149
|
+
}
|
|
150
|
+
setPropertyType(arg?.value)
|
|
160
151
|
} else {
|
|
161
|
-
arg
|
|
162
|
-
|
|
163
|
-
|
|
152
|
+
if (arg) {
|
|
153
|
+
arg.type = 'static'
|
|
154
|
+
arg.value = undefined
|
|
155
|
+
arg.expr = undefined
|
|
156
|
+
}
|
|
164
157
|
}
|
|
165
158
|
propertyType = 'static'
|
|
166
159
|
}
|
|
@@ -188,9 +181,21 @@ const closeBracket = '}';
|
|
|
188
181
|
Dynamic (JS)
|
|
189
182
|
</ToggleButton>
|
|
190
183
|
</ToggleButtonGroup>
|
|
184
|
+
<Button
|
|
185
|
+
variant="contained"
|
|
186
|
+
color="blue"
|
|
187
|
+
size="xs"
|
|
188
|
+
on:click={() => {
|
|
189
|
+
focusProp(argName, 'connect', (path) => {
|
|
190
|
+
connectProperty(path)
|
|
191
|
+
return true
|
|
192
|
+
})
|
|
193
|
+
}}>Connect →</Button
|
|
194
|
+
>
|
|
191
195
|
</div>
|
|
192
|
-
|
|
196
|
+
{/if}
|
|
193
197
|
</div>
|
|
198
|
+
|
|
194
199
|
<div class="max-w-xs" />
|
|
195
200
|
|
|
196
201
|
<div
|
|
@@ -205,14 +210,17 @@ const closeBracket = '}';
|
|
|
205
210
|
Connect input →
|
|
206
211
|
</span>
|
|
207
212
|
{/if}
|
|
208
|
-
{#if isStaticTemplate(inputCat) && propertyType == 'static'}
|
|
209
|
-
<div class="py-1 rounded border border-1 border-gray-500">
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
213
|
+
{#if isStaticTemplate(inputCat) && propertyType == 'static' && !noDynamicToggle}
|
|
214
|
+
<div class="py-1 mt-2 min-h-[28px] rounded border border-1 border-gray-500">
|
|
215
|
+
{#if arg}
|
|
216
|
+
<TemplateEditor
|
|
217
|
+
bind:this={monacoTemplate}
|
|
218
|
+
{extraLib}
|
|
219
|
+
on:focus={onFocus}
|
|
220
|
+
bind:code={arg.value}
|
|
221
|
+
fontSize={14}
|
|
222
|
+
/>
|
|
223
|
+
{/if}
|
|
216
224
|
</div>
|
|
217
225
|
{:else if propertyType === undefined || propertyType == 'static'}
|
|
218
226
|
<ArgInput
|
|
@@ -265,5 +273,5 @@ const closeBracket = '}';
|
|
|
265
273
|
</div>
|
|
266
274
|
<div class="mb-6" />
|
|
267
275
|
{:else}
|
|
268
|
-
<p class="text-sm text-gray-700">
|
|
276
|
+
<p class="text-sm text-gray-700">Argument at {argName} is undefined</p>
|
|
269
277
|
{/if}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
<script>import {
|
|
1
|
+
<script>import { faSpinner } from '@fortawesome/free-solid-svg-icons';
|
|
2
|
+
import { Icon } from 'svelte-awesome';
|
|
3
|
+
import { fade } from 'svelte/transition';
|
|
2
4
|
import { Drawer, DrawerContent } from './common';
|
|
3
5
|
export let content;
|
|
4
6
|
export let isLoading;
|
|
@@ -43,9 +45,10 @@ let logViewer;
|
|
|
43
45
|
{/if}
|
|
44
46
|
|
|
45
47
|
<pre class="whitespace-pre-wrap break-words bg-gray-50 text-xs w-full p-2"
|
|
46
|
-
>{#if content}<span
|
|
47
|
-
|
|
48
|
-
|
|
48
|
+
>{#if content}<span>{content}</span>{:else if isLoading}<Icon
|
|
49
|
+
data={faSpinner}
|
|
50
|
+
class="animate-spin"
|
|
51
|
+
/>{:else}<span class="text-gray-600">No logs are available yet</span>{/if}</pre
|
|
49
52
|
>
|
|
50
53
|
</div>
|
|
51
54
|
</div>
|
|
@@ -6,46 +6,49 @@ import TestJobLoader from './TestJobLoader.svelte';
|
|
|
6
6
|
import LogViewer from './LogViewer.svelte';
|
|
7
7
|
import DisplayResult from './DisplayResult.svelte';
|
|
8
8
|
import Button from './common/button/Button.svelte';
|
|
9
|
-
import {
|
|
9
|
+
import { faSpinner } from '@fortawesome/free-solid-svg-icons';
|
|
10
10
|
import { flowStateStore } from './flows/flowState';
|
|
11
11
|
import { flowStore } from './flows/flowStore';
|
|
12
|
-
import { Alert } from './common';
|
|
13
12
|
import { workspaceStore } from '../stores';
|
|
14
|
-
|
|
15
|
-
// Test
|
|
16
|
-
let testIsLoading = false;
|
|
17
|
-
let testJob;
|
|
13
|
+
import { Icon } from 'svelte-awesome';
|
|
18
14
|
export let mod;
|
|
19
15
|
export let schema;
|
|
16
|
+
// Test
|
|
17
|
+
let testJobLoader;
|
|
18
|
+
let testIsLoading = false;
|
|
19
|
+
let testJob = undefined;
|
|
20
20
|
let stepArgs = {};
|
|
21
21
|
export function runTestWithStepArgs() {
|
|
22
22
|
runTest(stepArgs);
|
|
23
23
|
}
|
|
24
24
|
export async function runTest(args) {
|
|
25
25
|
const val = mod.value;
|
|
26
|
+
let jobId = undefined;
|
|
26
27
|
if (val.type == 'rawscript') {
|
|
27
|
-
await testJobLoader?.runPreview(val.path, val.content, val.language, args);
|
|
28
|
+
jobId = await testJobLoader?.runPreview(val.path, val.content, val.language, args);
|
|
28
29
|
}
|
|
29
30
|
else if (val.type == 'script') {
|
|
30
31
|
const script = val.hash
|
|
31
32
|
? await ScriptService.getScriptByHash({ workspace: $workspaceStore, hash: val.hash })
|
|
32
33
|
: await getScriptByPath(val.path);
|
|
33
|
-
await testJobLoader?.runPreview(val.path, script.content, script.language, args);
|
|
34
|
+
jobId = await testJobLoader?.runPreview(val.path, script.content, script.language, args);
|
|
34
35
|
}
|
|
35
36
|
else {
|
|
36
37
|
throw Error('not testable module type');
|
|
37
38
|
}
|
|
38
|
-
sendUserToast(`started test ${truncateRev(
|
|
39
|
+
sendUserToast(`started test ${truncateRev(jobId ?? '', 10)}`);
|
|
39
40
|
}
|
|
40
41
|
function jobDone() {
|
|
41
42
|
if (testJob && !testJob.canceled && testJob.type == 'CompletedJob' && `result` in testJob) {
|
|
42
|
-
$flowStateStore[mod.id]
|
|
43
|
+
if ($flowStateStore[mod.id]?.previewResult) {
|
|
44
|
+
$flowStateStore[mod.id].previewResult = testJob.result;
|
|
45
|
+
}
|
|
43
46
|
}
|
|
44
47
|
}
|
|
45
48
|
</script>
|
|
46
49
|
|
|
47
50
|
<TestJobLoader
|
|
48
|
-
on:done={jobDone}
|
|
51
|
+
on:done={() => jobDone()}
|
|
49
52
|
bind:this={testJobLoader}
|
|
50
53
|
bind:isLoading={testIsLoading}
|
|
51
54
|
bind:job={testJob}
|
|
@@ -74,7 +77,7 @@ function jobDone() {
|
|
|
74
77
|
color="red"
|
|
75
78
|
size="sm"
|
|
76
79
|
startIcon={{
|
|
77
|
-
icon:
|
|
80
|
+
icon: faSpinner,
|
|
78
81
|
classes: 'animate-spin'
|
|
79
82
|
}}
|
|
80
83
|
>
|
|
@@ -94,7 +97,11 @@ function jobDone() {
|
|
|
94
97
|
</pre>
|
|
95
98
|
{:else}
|
|
96
99
|
<div class="p-2">
|
|
97
|
-
{testIsLoading
|
|
100
|
+
{#if testIsLoading}
|
|
101
|
+
<Icon data={faSpinner} class="animate-spin" />
|
|
102
|
+
{:else}
|
|
103
|
+
Test to see the result here
|
|
104
|
+
{/if}
|
|
98
105
|
</div>
|
|
99
106
|
{/if}
|
|
100
107
|
</Pane>
|
|
@@ -39,29 +39,21 @@ function close() {
|
|
|
39
39
|
use:popperRef
|
|
40
40
|
on:mouseenter={open}
|
|
41
41
|
on:mouseleave={close}
|
|
42
|
+
on:click
|
|
43
|
+
class={$$props.class}
|
|
42
44
|
>
|
|
43
45
|
<slot />
|
|
44
46
|
</button>
|
|
45
47
|
{#if showTooltip}
|
|
46
|
-
<div
|
|
48
|
+
<div
|
|
49
|
+
use:popperContent={extraOpts}
|
|
50
|
+
on:mouseenter={open}
|
|
51
|
+
on:mouseleave={close}
|
|
52
|
+
class="z-50 py-2 px-3 rounded-md text-sm font-normal !text-gray-300 bg-gray-800
|
|
53
|
+
whitespace-normal text-left {$$props.class}"
|
|
54
|
+
>
|
|
47
55
|
<div class="max-w-sm">
|
|
48
56
|
<slot name="text" />
|
|
49
57
|
</div>
|
|
50
58
|
</div>
|
|
51
59
|
{/if}
|
|
52
|
-
|
|
53
|
-
<style>
|
|
54
|
-
#tooltip {
|
|
55
|
-
z-index: 50;
|
|
56
|
-
white-space: normal;
|
|
57
|
-
border-radius: 0.75rem;
|
|
58
|
-
--tw-bg-opacity: 1;
|
|
59
|
-
background-color: rgb(31 41 55 / var(--tw-bg-opacity));
|
|
60
|
-
padding: 1rem;
|
|
61
|
-
text-align: left;
|
|
62
|
-
font-size: 0.875rem;
|
|
63
|
-
line-height: 1.25rem;
|
|
64
|
-
font-weight: 400;
|
|
65
|
-
--tw-text-opacity: 1;
|
|
66
|
-
color: rgb(209 213 219 / var(--tw-text-opacity))
|
|
67
|
-
}</style>
|
|
@@ -2,19 +2,21 @@
|
|
|
2
2
|
export let options;
|
|
3
3
|
export let value;
|
|
4
4
|
export let disabled = false;
|
|
5
|
+
export let labelClass = '';
|
|
6
|
+
export let inputClass = '';
|
|
5
7
|
import { createEventDispatcher } from 'svelte';
|
|
6
8
|
import Tooltip from './Tooltip.svelte';
|
|
7
9
|
const dispatch = createEventDispatcher();
|
|
8
10
|
</script>
|
|
9
11
|
|
|
10
12
|
<fieldset class="w-full">
|
|
11
|
-
<legend class="sr-only">{label}</legend>
|
|
13
|
+
<legend class="sr-only {labelClass}">{label}</legend>
|
|
12
14
|
<div class="flex flex-row flex-wrap gap-2 items-center mb-2 w-full">
|
|
13
15
|
{#each options as [label, val]}
|
|
14
16
|
<label
|
|
15
17
|
class="text-center text-sm border border-gray-300 h-full rounded-sm cursor-pointer p-2
|
|
16
|
-
grow whitespace-nowrap hover:border-gray-600 hover:bg-gray-100
|
|
17
|
-
{val === value ? '!bg-blue-50 !border-blue-500' : ''}"
|
|
18
|
+
grow whitespace-nowrap duration-200 hover:border-gray-600 hover:bg-gray-100
|
|
19
|
+
{val === value ? '!bg-blue-50 !border-blue-500' : ''} {inputClass}"
|
|
18
20
|
>
|
|
19
21
|
<input
|
|
20
22
|
{disabled}
|
|
@@ -144,8 +144,9 @@ function parseJson() {
|
|
|
144
144
|
{#if !emptyString(jsonError)}<span
|
|
145
145
|
class="text-red-400 text-xs mb-1 flex flex-row-reverse">{jsonError}</span
|
|
146
146
|
>{:else}<div class="py-2" />{/if}
|
|
147
|
-
<div class="h-full w-full">
|
|
147
|
+
<div class="h-full w-full border p-1 rounded">
|
|
148
148
|
<SimpleEditor
|
|
149
|
+
autoHeight
|
|
149
150
|
class="editor"
|
|
150
151
|
lang="json"
|
|
151
152
|
bind:code={rawCode}
|
|
@@ -11,6 +11,9 @@ import Tooltip from './Tooltip.svelte';
|
|
|
11
11
|
import { flip } from 'svelte/animate';
|
|
12
12
|
const dispatch = createEventDispatcher();
|
|
13
13
|
export let schema = emptySchema();
|
|
14
|
+
if (!schema) {
|
|
15
|
+
schema = emptySchema();
|
|
16
|
+
}
|
|
14
17
|
let schemaModal;
|
|
15
18
|
let schemaString = '';
|
|
16
19
|
// Internal state: bound to args builder modal
|
|
@@ -20,6 +20,9 @@ export let previousModuleId = undefined;
|
|
|
20
20
|
export let shouldHideNoInputs = false;
|
|
21
21
|
export let compact = false;
|
|
22
22
|
export let password = undefined;
|
|
23
|
+
export let noVariablePicker = false;
|
|
24
|
+
export let filter = undefined;
|
|
25
|
+
export let noDynamicToggle = false;
|
|
23
26
|
let clazz = '';
|
|
24
27
|
export { clazz as class };
|
|
25
28
|
let inputCheck = {};
|
|
@@ -37,94 +40,99 @@ function removeExtraKey() {
|
|
|
37
40
|
}
|
|
38
41
|
$: schema?.properties && removeExtraKey();
|
|
39
42
|
let pickForField;
|
|
40
|
-
let itemPicker;
|
|
41
|
-
let variableEditor;
|
|
43
|
+
let itemPicker = undefined;
|
|
44
|
+
let variableEditor = undefined;
|
|
42
45
|
</script>
|
|
43
46
|
|
|
44
47
|
<div class="w-full {clazz}">
|
|
45
48
|
{#if Object.keys(schema?.properties ?? {}).length > 0}
|
|
46
49
|
{#each Object.keys(schema?.properties ?? {}) as argName, i (argName)}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
50
|
+
{#if !filter || filter.includes(argName)}
|
|
51
|
+
<div transition:slide|local>
|
|
52
|
+
{#if inputTransform}
|
|
53
|
+
<InputTransformForm
|
|
54
|
+
{previousModuleId}
|
|
55
|
+
bind:arg={args[argName]}
|
|
56
|
+
bind:schema
|
|
57
|
+
bind:argName
|
|
58
|
+
bind:inputCheck={inputCheck[argName]}
|
|
59
|
+
bind:extraLib
|
|
60
|
+
{variableEditor}
|
|
61
|
+
{itemPicker}
|
|
62
|
+
bind:pickForField
|
|
63
|
+
{noDynamicToggle}
|
|
64
|
+
/>
|
|
65
|
+
{:else if typeof args == 'object'}
|
|
66
|
+
<ArgInput
|
|
67
|
+
autofocus={i == 0 && autofocus}
|
|
68
|
+
label={argName}
|
|
69
|
+
bind:description={schema.properties[argName].description}
|
|
70
|
+
bind:value={args[argName]}
|
|
71
|
+
type={schema.properties[argName].type}
|
|
72
|
+
required={schema.required.includes(argName)}
|
|
73
|
+
bind:pattern={schema.properties[argName].pattern}
|
|
74
|
+
bind:valid={inputCheck[argName]}
|
|
75
|
+
defaultValue={schema.properties[argName].default}
|
|
76
|
+
bind:enum_={schema.properties[argName].enum}
|
|
77
|
+
bind:format={schema.properties[argName].format}
|
|
78
|
+
contentEncoding={schema.properties[argName].contentEncoding}
|
|
79
|
+
properties={schema.properties[argName].properties}
|
|
80
|
+
bind:itemsType={schema.properties[argName].items}
|
|
81
|
+
disabled={disabledArgs.includes(argName) || disabled}
|
|
82
|
+
{editableSchema}
|
|
83
|
+
{compact}
|
|
84
|
+
password={argName == password}
|
|
85
|
+
{variableEditor}
|
|
86
|
+
{itemPicker}
|
|
87
|
+
bind:pickForField
|
|
88
|
+
/>
|
|
89
|
+
{:else}
|
|
90
|
+
Expected argument to be an object, got {JSON.stringify(args)} instead
|
|
91
|
+
{/if}
|
|
92
|
+
</div>
|
|
93
|
+
{/if}
|
|
88
94
|
{/each}
|
|
89
95
|
{:else if !shouldHideNoInputs}
|
|
90
96
|
<div class="text-gray-500 text-sm">No inputs</div>
|
|
91
97
|
{/if}
|
|
92
98
|
</div>
|
|
93
99
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
if (
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
100
|
+
{#if !noVariablePicker}
|
|
101
|
+
<ItemPicker
|
|
102
|
+
bind:this={itemPicker}
|
|
103
|
+
pickCallback={(path, _) => {
|
|
104
|
+
if (pickForField) {
|
|
105
|
+
if (inputTransform) {
|
|
106
|
+
args[pickForField].value = '$var:' + path
|
|
107
|
+
} else {
|
|
108
|
+
args[pickForField] = '$var:' + path
|
|
109
|
+
}
|
|
102
110
|
}
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
}))}
|
|
112
|
-
>
|
|
113
|
-
<div
|
|
114
|
-
slot="submission"
|
|
115
|
-
class="flex flex-row-reverse w-full p-5 bg-white border-t border-gray-200 rounded-bl-lg rounded-br-lg"
|
|
111
|
+
}}
|
|
112
|
+
itemName="Variable"
|
|
113
|
+
extraField="name"
|
|
114
|
+
loadItems={async () =>
|
|
115
|
+
(await VariableService.listVariable({ workspace: $workspaceStore ?? '' })).map((x) => ({
|
|
116
|
+
name: x.path,
|
|
117
|
+
...x
|
|
118
|
+
}))}
|
|
116
119
|
>
|
|
117
|
-
<
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
size="sm"
|
|
121
|
-
on:click={() => {
|
|
122
|
-
variableEditor?.initNew?.()
|
|
123
|
-
}}
|
|
120
|
+
<div
|
|
121
|
+
slot="submission"
|
|
122
|
+
class="flex flex-row-reverse w-full p-5 bg-white border-t border-gray-200 rounded-bl-lg rounded-br-lg"
|
|
124
123
|
>
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
124
|
+
<Button
|
|
125
|
+
variant="border"
|
|
126
|
+
color="blue"
|
|
127
|
+
size="sm"
|
|
128
|
+
on:click={() => {
|
|
129
|
+
variableEditor?.initNew?.()
|
|
130
|
+
}}
|
|
131
|
+
>
|
|
132
|
+
Create a new variable
|
|
133
|
+
</Button>
|
|
134
|
+
</div>
|
|
135
|
+
</ItemPicker>
|
|
129
136
|
|
|
130
|
-
<VariableEditor bind:this={variableEditor} on:create={itemPicker.openDrawer} />
|
|
137
|
+
<VariableEditor bind:this={variableEditor} on:create={itemPicker.openDrawer} />
|
|
138
|
+
{/if}
|