windmill-components 1.34.0 → 1.35.42
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 +1 -1
- package/components/ArgInput.svelte +2 -2
- package/components/ArgInput.svelte.d.ts +2 -2
- package/components/CenteredPage.svelte +2 -2
- package/components/Editor.svelte +7 -82
- package/components/Editor.svelte.d.ts +0 -2
- package/components/EditorBar.svelte +45 -39
- package/components/FlowBuilder.svelte +4 -4
- package/components/FlowJobResult.svelte +17 -18
- package/components/FlowModulesViewer.svelte +97 -0
- package/components/FlowModulesViewer.svelte.d.ts +17 -0
- package/components/FlowPreview.svelte +35 -34
- package/components/FlowPreviewContent.svelte +4 -1
- package/components/FlowStatusViewer.svelte +31 -49
- package/components/FlowViewer.svelte +60 -159
- package/components/FlowViewer.svelte.d.ts +0 -1
- package/components/IconedResourceType.svelte +3 -3
- package/components/InputTransformForm.svelte +2 -2
- package/components/ModuleStep.svelte +1 -1
- package/components/Multiselect.svelte +1 -1
- package/components/SchemaEditor.svelte +2 -2
- package/components/SchemaViewer.svelte +58 -68
- package/components/ScriptBuilder.svelte +118 -132
- package/components/ScriptEditor.svelte +115 -338
- package/components/ScriptEditor.svelte.d.ts +0 -2
- package/components/ScriptSchema.svelte +45 -44
- package/components/SharedBadge.svelte +1 -1
- package/components/SimpleEditor.svelte +143 -0
- package/components/SimpleEditor.svelte.d.ts +35 -0
- package/components/{Drawer.svelte → common/drawer/Drawer.svelte} +0 -0
- package/components/{Drawer.svelte.d.ts → common/drawer/Drawer.svelte.d.ts} +0 -0
- package/components/common/drawer/DrawerContent.svelte +19 -0
- package/components/common/drawer/DrawerContent.svelte.d.ts +20 -0
- package/components/common/menu/Menu.svelte +57 -0
- package/components/common/menu/Menu.svelte.d.ts +23 -0
- package/components/common/menu/MenuItem.svelte +9 -0
- package/components/common/menu/MenuItem.svelte.d.ts +27 -0
- package/components/common/tabs/Tab.svelte +17 -0
- package/components/{tabs → common/tabs}/Tab.svelte.d.ts +1 -2
- package/components/common/tabs/TabContent.svelte +12 -0
- package/components/common/tabs/TabContent.svelte.d.ts +19 -0
- package/components/common/tabs/Tabs.svelte +20 -0
- package/components/common/tabs/Tabs.svelte.d.ts +24 -0
- package/components/flows/FlowModuleHeader.svelte +1 -2
- package/components/flows/FlowSettings.svelte +41 -37
- package/components/flows/flowState.js +2 -2
- package/components/flows/flowStateUtils.js +7 -9
- package/components/flows/flowStore.js +24 -0
- package/components/flows/utils.d.ts +1 -1
- package/components/flows/utils.js +9 -9
- package/components/icons/GithubIcon.svelte +17 -0
- package/components/icons/GithubIcon.svelte.d.ts +17 -0
- package/components/jobs/JobDetail.svelte +176 -0
- package/components/jobs/JobDetail.svelte.d.ts +17 -0
- package/components/landing/FlowGettingStarted.svelte +95 -0
- package/components/landing/FlowGettingStarted.svelte.d.ts +19 -0
- package/components/landing/FlowLandingBox.svelte +69 -0
- package/components/landing/FlowLandingBox.svelte.d.ts +17 -0
- package/components/landing/RessourceGettingStarted.svelte +51 -0
- package/components/landing/RessourceGettingStarted.svelte.d.ts +19 -0
- package/components/landing/ScriptBox.svelte +81 -0
- package/components/landing/ScriptBox.svelte.d.ts +17 -0
- package/components/landing/ScriptGettingStarted.svelte +93 -0
- package/components/landing/ScriptGettingStarted.svelte.d.ts +19 -0
- package/components/script_editor/LogPanel.svelte +172 -0
- package/components/script_editor/LogPanel.svelte.d.ts +22 -0
- package/components/sidebar/MenuLink.svelte +49 -0
- package/components/sidebar/MenuLink.svelte.d.ts +21 -0
- package/components/sidebar/SidebarContent.svelte +55 -0
- package/components/sidebar/SidebarContent.svelte.d.ts +16 -0
- package/components/sidebar/UserMenu.svelte +62 -0
- package/components/sidebar/UserMenu.svelte.d.ts +16 -0
- package/components/sidebar/WorkspaceMenu.svelte +66 -0
- package/components/sidebar/WorkspaceMenu.svelte.d.ts +16 -0
- package/editorUtils.d.ts +25 -0
- package/editorUtils.js +43 -0
- package/gen/core/OpenAPI.js +1 -1
- package/gen/models/FlowModule.d.ts +5 -3
- package/gen/models/ForloopFlow.d.ts +2 -2
- package/gen/services/ScriptService.d.ts +4 -6
- package/gen/services/ScriptService.js +2 -2
- package/logout.js +1 -1
- package/package.json +33 -15
- package/script_helpers.js +1 -1
- package/stores.d.ts +0 -1
- package/stores.js +0 -1
- package/utils.d.ts +1 -0
- package/utils.js +4 -1
- package/components/tabs/Tab.svelte +0 -12
- package/components/tabs/TabPanel.svelte +0 -11
- package/components/tabs/TabPanel.svelte.d.ts +0 -20
- package/components/tabs/Tabs.svelte +0 -3
- package/components/tabs/Tabs.svelte.d.ts +0 -23
|
@@ -225,7 +225,7 @@ $: isGoogleSignin =
|
|
|
225
225
|
{/if}
|
|
226
226
|
<PageHeader title="Extra Params" primary={false} />
|
|
227
227
|
{#if !manual && resource_type != ''}
|
|
228
|
-
{#each extra_params as [k, v]
|
|
228
|
+
{#each extra_params as [k, v]}
|
|
229
229
|
<div class="flex flex-row max-w-md">
|
|
230
230
|
<input type="text" bind:value={k} />
|
|
231
231
|
<input type="text" bind:value={v} />
|
|
@@ -4,13 +4,13 @@ import { setInputCat as computeInputCat } from '../utils';
|
|
|
4
4
|
import { Button, Tooltip } from 'flowbite-svelte';
|
|
5
5
|
import { createEventDispatcher } from 'svelte';
|
|
6
6
|
import Icon from 'svelte-awesome';
|
|
7
|
-
import Editor from './Editor.svelte';
|
|
8
7
|
import FieldHeader from './FieldHeader.svelte';
|
|
9
8
|
import ObjectResourceInput from './ObjectResourceInput.svelte';
|
|
10
9
|
import ObjectTypeNarrowing from './ObjectTypeNarrowing.svelte';
|
|
11
10
|
import ResourcePicker from './ResourcePicker.svelte';
|
|
12
11
|
import StringTypeNarrowing from './StringTypeNarrowing.svelte';
|
|
13
12
|
import SchemaForm from './SchemaForm.svelte';
|
|
13
|
+
import SimpleEditor from './SimpleEditor.svelte';
|
|
14
14
|
export let label = '';
|
|
15
15
|
export let value;
|
|
16
16
|
export let defaultValue = undefined;
|
|
@@ -275,7 +275,7 @@ $: inputCat = computeInputCat(type, format, itemsType?.type, enum_, contentEncod
|
|
|
275
275
|
<input class="inline-block" type="datetime-local" bind:value />
|
|
276
276
|
{:else if inputCat == 'sql'}
|
|
277
277
|
<div class="border rounded mb-4 w-full border-gray-700">
|
|
278
|
-
<
|
|
278
|
+
<SimpleEditor
|
|
279
279
|
on:focus={() => dispatch('focus')}
|
|
280
280
|
on:blur={() => dispatch('blur')}
|
|
281
281
|
bind:this={editor}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
2
|
import { type InputCat } from '../utils';
|
|
3
|
-
import Editor from './Editor.svelte';
|
|
4
3
|
import type { SchemaProperty } from '../common';
|
|
4
|
+
import SimpleEditor from './SimpleEditor.svelte';
|
|
5
5
|
declare const __propDef: {
|
|
6
6
|
props: {
|
|
7
7
|
label?: string | undefined;
|
|
@@ -27,7 +27,7 @@ declare const __propDef: {
|
|
|
27
27
|
properties?: {
|
|
28
28
|
[name: string]: SchemaProperty;
|
|
29
29
|
} | undefined;
|
|
30
|
-
editor?:
|
|
30
|
+
editor?: SimpleEditor | undefined;
|
|
31
31
|
evalValueToRaw?: (() => void) | undefined;
|
|
32
32
|
inputCat?: InputCat | undefined;
|
|
33
33
|
};
|
package/components/Editor.svelte
CHANGED
|
@@ -1,9 +1,4 @@
|
|
|
1
1
|
<script context="module">import * as monaco from 'monaco-editor';
|
|
2
|
-
monaco.languages.typescript.javascriptDefaults.setCompilerOptions({
|
|
3
|
-
target: monaco.languages.typescript.ScriptTarget.Latest,
|
|
4
|
-
allowNonTsExtensions: true,
|
|
5
|
-
noLib: true
|
|
6
|
-
});
|
|
7
2
|
monaco.languages.typescript.typescriptDefaults.setCompilerOptions({
|
|
8
3
|
target: monaco.languages.typescript.ScriptTarget.Latest,
|
|
9
4
|
allowNonTsExtensions: true,
|
|
@@ -14,25 +9,19 @@ monaco.languages.typescript.typescriptDefaults.setDiagnosticsOptions({
|
|
|
14
9
|
noSuggestionDiagnostics: true,
|
|
15
10
|
noSyntaxValidation: true
|
|
16
11
|
});
|
|
17
|
-
monaco.languages.json.jsonDefaults.setDiagnosticsOptions({
|
|
18
|
-
validate: true,
|
|
19
|
-
allowComments: false,
|
|
20
|
-
schemas: [],
|
|
21
|
-
enableSchemaRequest: true
|
|
22
|
-
});
|
|
23
12
|
</script>
|
|
24
13
|
|
|
25
14
|
<script>import { browser, dev } from '$app/env';
|
|
26
15
|
import { page } from '$app/stores';
|
|
27
16
|
import { sendUserToast } from '../utils';
|
|
28
17
|
import editorWorker from 'monaco-editor/esm/vs/editor/editor.worker?worker';
|
|
29
|
-
import jsonWorker from 'monaco-editor/esm/vs/language/json/json.worker?worker';
|
|
30
18
|
import tsWorker from 'monaco-editor/esm/vs/language/typescript/ts.worker?worker';
|
|
31
19
|
import { buildWorkerDefinition } from 'monaco-editor-workers';
|
|
32
20
|
import { createEventDispatcher, onDestroy, onMount } from 'svelte';
|
|
33
21
|
import getMessageServiceOverride from 'vscode/service-override/messages';
|
|
34
22
|
import { StandaloneServices } from 'vscode/services';
|
|
35
23
|
import { DENO_INIT_CODE_CLEAR, PYTHON_INIT_CODE_CLEAR } from '../script_helpers';
|
|
24
|
+
import { createHash as randomHash, editorConfig, langToExt, updateOptions } from '../editorUtils';
|
|
36
25
|
StandaloneServices.initialize({
|
|
37
26
|
...getMessageServiceOverride(document.body)
|
|
38
27
|
});
|
|
@@ -41,13 +30,11 @@ let editor;
|
|
|
41
30
|
export let deno = false;
|
|
42
31
|
export let lang = deno ? 'typescript' : 'python';
|
|
43
32
|
export let code = '';
|
|
44
|
-
export let hash = (
|
|
33
|
+
export let hash = randomHash();
|
|
45
34
|
export let cmdEnterAction = undefined;
|
|
46
35
|
export let formatAction = undefined;
|
|
47
36
|
export let automaticLayout = true;
|
|
48
37
|
export let websocketAlive = { pyright: false, black: false, deno: false };
|
|
49
|
-
export let extraLib = '';
|
|
50
|
-
export let extraLibPath = '';
|
|
51
38
|
export let shouldBindKey = true;
|
|
52
39
|
let websockets = [];
|
|
53
40
|
let websocketInterval;
|
|
@@ -64,10 +51,7 @@ if (browser) {
|
|
|
64
51
|
// @ts-ignore
|
|
65
52
|
self.MonacoEnvironment = {
|
|
66
53
|
getWorker: function (_moduleId, label) {
|
|
67
|
-
if (label === '
|
|
68
|
-
return new jsonWorker();
|
|
69
|
-
}
|
|
70
|
-
else if (label === 'typescript' || label === 'javascript') {
|
|
54
|
+
if (label === 'typescript' || label === 'javascript') {
|
|
71
55
|
return new tsWorker();
|
|
72
56
|
}
|
|
73
57
|
else {
|
|
@@ -85,22 +69,6 @@ export function insertAtCursor(code) {
|
|
|
85
69
|
editor.trigger('keyboard', 'type', { text: code });
|
|
86
70
|
}
|
|
87
71
|
}
|
|
88
|
-
function langToExt(lang) {
|
|
89
|
-
switch (lang) {
|
|
90
|
-
case 'typescript':
|
|
91
|
-
return 'ts';
|
|
92
|
-
case 'python':
|
|
93
|
-
return 'py';
|
|
94
|
-
case 'javascript':
|
|
95
|
-
return 'js';
|
|
96
|
-
case 'json':
|
|
97
|
-
return 'json';
|
|
98
|
-
case 'sql':
|
|
99
|
-
return 'sql';
|
|
100
|
-
default:
|
|
101
|
-
return 'unknown';
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
72
|
export function insertAtBeginning(code) {
|
|
105
73
|
if (editor) {
|
|
106
74
|
const range = { startLineNumber: 1, startColumn: 1, endLineNumber: 1, endColumn: 1 };
|
|
@@ -336,28 +304,8 @@ async function closeWebsockets() {
|
|
|
336
304
|
}
|
|
337
305
|
async function loadMonaco() {
|
|
338
306
|
const model = monaco.editor.createModel(code, lang, monaco.Uri.parse(uri));
|
|
339
|
-
model.updateOptions(
|
|
340
|
-
editor = monaco.editor.create(divEl,
|
|
341
|
-
model: model,
|
|
342
|
-
value: code,
|
|
343
|
-
language: lang,
|
|
344
|
-
automaticLayout,
|
|
345
|
-
readOnly: false,
|
|
346
|
-
fixedOverflowWidgets: true,
|
|
347
|
-
autoDetectHighContrast: true,
|
|
348
|
-
//lineNumbers: 'off',
|
|
349
|
-
//lineDecorationsWidth: 0,
|
|
350
|
-
lineNumbersMinChars: 4,
|
|
351
|
-
lineNumbers: (ln) => '<span class="pr-4 text-gray-400">' + ln + '</span>',
|
|
352
|
-
folding: false,
|
|
353
|
-
scrollBeyondLastLine: false,
|
|
354
|
-
minimap: {
|
|
355
|
-
enabled: false
|
|
356
|
-
},
|
|
357
|
-
lightbulb: {
|
|
358
|
-
enabled: true
|
|
359
|
-
}
|
|
360
|
-
});
|
|
307
|
+
model.updateOptions(updateOptions);
|
|
308
|
+
editor = monaco.editor.create(divEl, editorConfig(model, code, lang, automaticLayout));
|
|
361
309
|
if (shouldBindKey) {
|
|
362
310
|
editor.addCommand(monaco.KeyMod.CtrlCmd | monaco.KeyCode.KeyS, function () {
|
|
363
311
|
format();
|
|
@@ -390,14 +338,6 @@ async function loadMonaco() {
|
|
|
390
338
|
editor.onDidBlurEditorText(() => {
|
|
391
339
|
dispatch('blur');
|
|
392
340
|
});
|
|
393
|
-
if (lang == 'javascript' && extraLib != '' && extraLibPath != '') {
|
|
394
|
-
monaco.languages.typescript.javascriptDefaults.setExtraLibs([
|
|
395
|
-
{
|
|
396
|
-
content: extraLib,
|
|
397
|
-
filePath: extraLibPath
|
|
398
|
-
}
|
|
399
|
-
]);
|
|
400
|
-
}
|
|
401
341
|
if (lang == 'python' || deno) {
|
|
402
342
|
reloadWebsocket();
|
|
403
343
|
}
|
|
@@ -433,20 +373,5 @@ onDestroy(() => {
|
|
|
433
373
|
padding-left: 0px;
|
|
434
374
|
padding-right: 0px;
|
|
435
375
|
/* stylelint-disable-next-line unit-allowed-list */
|
|
436
|
-
height: 80vh
|
|
437
|
-
}
|
|
438
|
-
|
|
439
|
-
.small-editor {
|
|
440
|
-
/* stylelint-disable-next-line unit-allowed-list */
|
|
441
|
-
height: 26vh;
|
|
442
|
-
}
|
|
443
|
-
|
|
444
|
-
.few-lines-editor {
|
|
445
|
-
/* stylelint-disable-next-line unit-allowed-list */
|
|
446
|
-
height: 80px;
|
|
447
|
-
}
|
|
448
|
-
|
|
449
|
-
.two-lines-editor {
|
|
450
|
-
/* stylelint-disable-next-line unit-allowed-list */
|
|
451
|
-
height: 40px;
|
|
452
|
-
}</style>
|
|
376
|
+
height: 80vh
|
|
377
|
+
}</style>
|
|
@@ -14,8 +14,6 @@ declare const __propDef: {
|
|
|
14
14
|
black: boolean;
|
|
15
15
|
deno: boolean;
|
|
16
16
|
} | undefined;
|
|
17
|
-
extraLib?: string | undefined;
|
|
18
|
-
extraLibPath?: string | undefined;
|
|
19
17
|
shouldBindKey?: boolean | undefined;
|
|
20
18
|
getCode?: (() => string) | undefined;
|
|
21
19
|
insertAtCursor?: ((code: string) => void) | undefined;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
<script>import { ResourceService, ScriptService, VariableService } from '../gen';
|
|
2
2
|
import { getScriptByPath, loadHubScripts, sendUserToast } from '../utils';
|
|
3
|
-
import {
|
|
3
|
+
import { faCode, faCube, faFile, faRotate, faRotateLeft } from '@fortawesome/free-solid-svg-icons';
|
|
4
4
|
import Icon from 'svelte-awesome';
|
|
5
5
|
import { hubScripts, workspaceStore } from '../stores';
|
|
6
|
-
import { Button } from 'flowbite-svelte';
|
|
7
6
|
import { Highlight } from 'svelte-highlight';
|
|
8
7
|
import { python, typescript } from 'svelte-highlight/languages';
|
|
9
8
|
import ItemPicker from './ItemPicker.svelte';
|
|
@@ -157,55 +156,69 @@ async function loadScripts() {
|
|
|
157
156
|
</ItemPicker>
|
|
158
157
|
|
|
159
158
|
<ResourceEditor bind:this={resourceEditor} on:refresh={resourcePicker.openModal} />
|
|
160
|
-
|
|
161
159
|
<VariableEditor bind:this={variableEditor} on:create={variablePicker.openModal} />
|
|
162
160
|
|
|
163
|
-
<div class="flex
|
|
164
|
-
<div
|
|
165
|
-
<
|
|
166
|
-
|
|
167
|
-
|
|
161
|
+
<div class="flex divide-x items-center">
|
|
162
|
+
<div>
|
|
163
|
+
<button
|
|
164
|
+
type="button"
|
|
165
|
+
class="mr-1 bg-white rounded-md items-center flex hover:bg-gray-100 font-medium text-xs p-2"
|
|
168
166
|
on:click={() => {
|
|
169
167
|
variablePicker.openModal()
|
|
170
168
|
}}
|
|
171
169
|
>
|
|
172
|
-
<Icon data={
|
|
173
|
-
|
|
174
|
-
</
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
170
|
+
<Icon data={faFile} class="h-4 w-4 mr-2" />
|
|
171
|
+
Insert variable
|
|
172
|
+
</button>
|
|
173
|
+
</div>
|
|
174
|
+
<div>
|
|
175
|
+
<button
|
|
176
|
+
type="button"
|
|
177
|
+
class="mx-1 bg-white rounded-md items-center flex hover:bg-gray-100 font-medium text-xs p-2"
|
|
179
178
|
on:click={() => {
|
|
180
179
|
resourcePicker.openModal()
|
|
181
180
|
}}
|
|
182
181
|
>
|
|
183
|
-
<Icon data={
|
|
184
|
-
|
|
185
|
-
</
|
|
182
|
+
<Icon data={faCube} class="h-4 w-4 mr-2" />
|
|
183
|
+
Insert resource
|
|
184
|
+
</button>
|
|
185
|
+
</div>
|
|
186
186
|
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
187
|
+
<div>
|
|
188
|
+
<button
|
|
189
|
+
type="button"
|
|
190
|
+
class="mx-1 bg-white rounded-md items-center flex hover:bg-gray-100 font-medium text-xs p-2"
|
|
190
191
|
on:click={() => {
|
|
191
192
|
scriptPicker.openModal()
|
|
192
193
|
}}
|
|
193
194
|
>
|
|
194
|
-
<Icon data={
|
|
195
|
-
|
|
196
|
-
</
|
|
195
|
+
<Icon data={faCode} class="h-4 w-4 mr-2" />
|
|
196
|
+
Search script
|
|
197
|
+
</button>
|
|
197
198
|
</div>
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
199
|
+
|
|
200
|
+
<div>
|
|
201
|
+
<button
|
|
202
|
+
type="button"
|
|
203
|
+
class="mx-1 bg-white rounded-md items-center flex hover:bg-gray-100 font-medium text-xs p-2"
|
|
204
|
+
on:click={() => {
|
|
205
|
+
editor.clearContent()
|
|
206
|
+
}}
|
|
207
|
+
>
|
|
208
|
+
<Icon data={faRotateLeft} class="h-4 w-4 mr-2" />
|
|
209
|
+
Reset content
|
|
210
|
+
</button>
|
|
211
|
+
</div>
|
|
212
|
+
<div>
|
|
213
|
+
<button
|
|
214
|
+
type="button"
|
|
215
|
+
class="ml-1 bg-white rounded-md items-center flex hover:bg-gray-100 font-medium text-xs p-2"
|
|
205
216
|
on:click={() => {
|
|
206
217
|
editor.reloadWebsocket()
|
|
207
218
|
}}
|
|
208
219
|
>
|
|
220
|
+
<Icon data={faRotate} class="h-4 w-4 mr-2" />
|
|
221
|
+
|
|
209
222
|
Reload assistants
|
|
210
223
|
<span class="ml-1">
|
|
211
224
|
{#if lang == 'deno'}
|
|
@@ -216,13 +229,6 @@ async function loadScripts() {
|
|
|
216
229
|
<span class={websocketAlive.black ? 'text-green-600' : 'text-red-700'}>Black</span>)
|
|
217
230
|
{/if}
|
|
218
231
|
</span>
|
|
219
|
-
</
|
|
220
|
-
<Button
|
|
221
|
-
size="xs"
|
|
222
|
-
color="alternative"
|
|
223
|
-
on:click={() => {
|
|
224
|
-
editor.clearContent()
|
|
225
|
-
}}>Reset content</Button
|
|
226
|
-
>
|
|
232
|
+
</button>
|
|
227
233
|
</div>
|
|
228
234
|
</div>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script>import { goto } from '$app/navigation';
|
|
2
2
|
import { page } from '$app/stores';
|
|
3
|
-
import { FlowService,
|
|
3
|
+
import { FlowService, ScheduleService } from '../gen';
|
|
4
4
|
import { workspaceStore } from '../stores';
|
|
5
5
|
import { encodeState, formatCron, loadHubScripts, pathIsEmpty, sendUserToast, setQueryWithoutLoad } from '../utils';
|
|
6
6
|
import { faPlay } from '@fortawesome/free-solid-svg-icons';
|
|
@@ -8,7 +8,7 @@ import { Breadcrumb, BreadcrumbItem, Button } from 'flowbite-svelte';
|
|
|
8
8
|
import { onDestroy, onMount } from 'svelte';
|
|
9
9
|
import Icon from 'svelte-awesome';
|
|
10
10
|
import { OFFSET } from './CronInput.svelte';
|
|
11
|
-
import Drawer from './Drawer.svelte';
|
|
11
|
+
import Drawer from './common/drawer/Drawer.svelte';
|
|
12
12
|
import FlowEditor from './FlowEditor.svelte';
|
|
13
13
|
import FlowPreviewContent from './FlowPreviewContent.svelte';
|
|
14
14
|
import { flowStateStore, flowStateToFlow } from './flows/flowState';
|
|
@@ -133,8 +133,8 @@ onDestroy(() => {
|
|
|
133
133
|
});
|
|
134
134
|
</script>
|
|
135
135
|
|
|
136
|
-
<div class="flex flex-row w-full h-full justify-between">
|
|
137
|
-
<div class={`flex flex-col mb-96 m-auto w-full
|
|
136
|
+
<div class="flex flex-row w-full h-full justify-between ">
|
|
137
|
+
<div class={`flex flex-col mb-96 m-auto w-full`}>
|
|
138
138
|
<!-- Nav between steps-->
|
|
139
139
|
<div class="justify-between flex flex-row w-full my-4">
|
|
140
140
|
<Breadcrumb>
|
|
@@ -1,24 +1,23 @@
|
|
|
1
1
|
<script>import DisplayResult from './DisplayResult.svelte';
|
|
2
|
-
import Tabs from './tabs/Tabs.svelte';
|
|
3
|
-
import Tab from './tabs/Tab.svelte';
|
|
4
|
-
import
|
|
5
|
-
let value = 0;
|
|
2
|
+
import Tabs from './common/tabs/Tabs.svelte';
|
|
3
|
+
import Tab from './common/tabs/Tab.svelte';
|
|
4
|
+
import TabContent from './common/tabs/TabContent.svelte';
|
|
6
5
|
export let job;
|
|
7
6
|
</script>
|
|
8
7
|
|
|
9
8
|
{#if job}
|
|
10
|
-
<
|
|
11
|
-
<
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
</
|
|
22
|
-
</
|
|
23
|
-
</
|
|
9
|
+
<Tabs selected="results">
|
|
10
|
+
<Tab value="results">Results</Tab>
|
|
11
|
+
<Tab value="logs">Logs</Tab>
|
|
12
|
+
<svelte:fragment slot="content">
|
|
13
|
+
<TabContent value="results" class="border p-2 h-36 overflow-y-scroll">
|
|
14
|
+
<DisplayResult result={job.result} />
|
|
15
|
+
</TabContent>
|
|
16
|
+
<TabContent value="logs" class="border p-2 h-36 overflow-y-scroll">
|
|
17
|
+
<div class="text-xs p-4 bg-gray-50 overflow-auto max-h-80 border">
|
|
18
|
+
<pre class="w-full">{job.logs}</pre>
|
|
19
|
+
</div>
|
|
20
|
+
</TabContent>
|
|
21
|
+
</svelte:fragment>
|
|
22
|
+
</Tabs>
|
|
24
23
|
{/if}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
<script>import { scriptPathToHref } from '../utils';
|
|
2
|
+
import Highlight from 'svelte-highlight';
|
|
3
|
+
import python from 'svelte-highlight/languages/python';
|
|
4
|
+
import typescript from 'svelte-highlight/languages/typescript';
|
|
5
|
+
import { slide } from 'svelte/transition';
|
|
6
|
+
import InputTransformsViewer from './InputTransformsViewer.svelte';
|
|
7
|
+
import IconedPath from './IconedPath.svelte';
|
|
8
|
+
export let modules;
|
|
9
|
+
let open = {};
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<p class="font-black text-lg my-6 w-full">
|
|
13
|
+
<span>{modules?.length} Step{modules?.length > 1 ? 's' : ''} </span>
|
|
14
|
+
<span class="mt-4" />
|
|
15
|
+
</p>
|
|
16
|
+
<ul class="-mb-8 w-full">
|
|
17
|
+
{#each modules ?? [] as mod, i}
|
|
18
|
+
<li class="w-full">
|
|
19
|
+
<div class="relative pb-8 w-full">
|
|
20
|
+
{#if i < (modules ?? []).length - 1}
|
|
21
|
+
<span class="absolute top-4 left-4 -ml-px h-full w-0.5 bg-gray-200" aria-hidden="true" />
|
|
22
|
+
{/if}
|
|
23
|
+
<div class="relative flex space-x-3">
|
|
24
|
+
<div>
|
|
25
|
+
<span
|
|
26
|
+
class="h-8 w-8 rounded-full bg-blue-600 flex items-center justify-center ring-8 ring-white text-white"
|
|
27
|
+
>{i + 1}
|
|
28
|
+
</span>
|
|
29
|
+
</div>
|
|
30
|
+
<div class="min-w-0 flex-1 pt-1.5 flex justify-between space-x-4 w-full">
|
|
31
|
+
<div class="w-full">
|
|
32
|
+
<span class="text-black">{mod?.summary ?? ''}</span>
|
|
33
|
+
<p class="text-sm text-gray-500">
|
|
34
|
+
{#if mod?.value?.type == 'script'}
|
|
35
|
+
<a
|
|
36
|
+
target="_blank"
|
|
37
|
+
href={scriptPathToHref(mod?.value?.path ?? '')}
|
|
38
|
+
class="font-medium text-gray-900"
|
|
39
|
+
>
|
|
40
|
+
<IconedPath path={mod?.value?.path ?? ''} />
|
|
41
|
+
</a>
|
|
42
|
+
{#if mod?.value?.path?.startsWith('hub/')}
|
|
43
|
+
<div>
|
|
44
|
+
<button
|
|
45
|
+
on:click={async () => {
|
|
46
|
+
open[i] = !open[i]
|
|
47
|
+
}}
|
|
48
|
+
class="mb-2 underline text-black"
|
|
49
|
+
>
|
|
50
|
+
View code and inputs {open[i] ? '(-)' : '(+)'}</button
|
|
51
|
+
>
|
|
52
|
+
{#if open[i]}
|
|
53
|
+
<div class="border border-black p-2 bg-gray-50 divide-y">
|
|
54
|
+
<InputTransformsViewer inputTransforms={mod?.input_transforms} />
|
|
55
|
+
<div class="w-full h-full mt-6">
|
|
56
|
+
<iframe
|
|
57
|
+
style="height: 400px;"
|
|
58
|
+
class="w-full h-full text-sm"
|
|
59
|
+
title="embedded script from hub"
|
|
60
|
+
frameborder="0"
|
|
61
|
+
src="https://hub.windmill.dev/embed/script/{mod?.value?.path?.substring(
|
|
62
|
+
4
|
|
63
|
+
)}"
|
|
64
|
+
/>
|
|
65
|
+
</div>
|
|
66
|
+
</div>
|
|
67
|
+
{/if}
|
|
68
|
+
</div>
|
|
69
|
+
{/if}
|
|
70
|
+
{:else if mod?.value?.type == 'rawscript'}
|
|
71
|
+
<button on:click={() => (open[i] = !open[i])} class="mb-2 underline text-black">
|
|
72
|
+
Raw {mod?.value?.language} script {open[i] ? '(-)' : '(+)'}</button
|
|
73
|
+
>
|
|
74
|
+
|
|
75
|
+
{#if open[i]}
|
|
76
|
+
<div transition:slide class="border border-black p-2 bg-gray-50 w-full">
|
|
77
|
+
<InputTransformsViewer inputTransforms={mod?.input_transforms} />
|
|
78
|
+
<Highlight
|
|
79
|
+
language={mod?.value?.language == 'deno' ? typescript : python}
|
|
80
|
+
code={mod?.value?.content}
|
|
81
|
+
/>
|
|
82
|
+
</div>
|
|
83
|
+
{/if}
|
|
84
|
+
{:else if mod?.value?.type == 'flow'}
|
|
85
|
+
Flow at path {mod?.value?.path}
|
|
86
|
+
{:else if mod?.value?.type == 'forloopflow'}
|
|
87
|
+
For loop over all the elements of the list returned as a result of step {i}:
|
|
88
|
+
<svelte:self modules={mod.value.modules} />
|
|
89
|
+
{/if}
|
|
90
|
+
</p>
|
|
91
|
+
</div>
|
|
92
|
+
</div>
|
|
93
|
+
</div>
|
|
94
|
+
</div>
|
|
95
|
+
</li>
|
|
96
|
+
{/each}
|
|
97
|
+
</ul>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import type { FlowModule } from '../gen';
|
|
3
|
+
declare const __propDef: {
|
|
4
|
+
props: {
|
|
5
|
+
modules: FlowModule[];
|
|
6
|
+
};
|
|
7
|
+
events: {
|
|
8
|
+
[evt: string]: CustomEvent<any>;
|
|
9
|
+
};
|
|
10
|
+
slots: {};
|
|
11
|
+
};
|
|
12
|
+
export declare type FlowModulesViewerProps = typeof __propDef.props;
|
|
13
|
+
export declare type FlowModulesViewerEvents = typeof __propDef.events;
|
|
14
|
+
export declare type FlowModulesViewerSlots = typeof __propDef.slots;
|
|
15
|
+
export default class FlowModulesViewer extends SvelteComponentTyped<FlowModulesViewerProps, FlowModulesViewerEvents, FlowModulesViewerSlots> {
|
|
16
|
+
}
|
|
17
|
+
export {};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
<script>import {
|
|
2
|
-
import { sendUserToast, truncateRev } from '../utils';
|
|
1
|
+
<script>import { sendUserToast, truncateRev } from '../utils';
|
|
3
2
|
import { faChevronDown, faChevronUp } from '@fortawesome/free-solid-svg-icons';
|
|
4
|
-
import { onDestroy } from 'svelte';
|
|
5
3
|
import Icon from 'svelte-awesome';
|
|
6
4
|
import { flowStateStore, flowStateToFlow } from './flows/flowState';
|
|
7
5
|
import { mapJobResultsToFlowState } from './flows/flowStateUtils';
|
|
8
6
|
import { runFlowPreview } from './flows/utils';
|
|
9
7
|
import FlowStatusViewer from './FlowStatusViewer.svelte';
|
|
10
8
|
import RunForm from './RunForm.svelte';
|
|
11
|
-
import
|
|
9
|
+
import Tab from './common/tabs/Tab.svelte';
|
|
10
|
+
import TabContent from './common/tabs/TabContent.svelte';
|
|
11
|
+
import Tabs from './common/tabs/Tabs.svelte';
|
|
12
12
|
export let i;
|
|
13
13
|
export let flow;
|
|
14
14
|
export let schema;
|
|
@@ -37,14 +37,14 @@ function extractStep(flow) {
|
|
|
37
37
|
return localFlow;
|
|
38
38
|
}
|
|
39
39
|
function setInputTransformFromArgs(flow, args) {
|
|
40
|
-
let
|
|
40
|
+
let input_transforms = {};
|
|
41
41
|
Object.entries(args).forEach(([key, value]) => {
|
|
42
|
-
|
|
42
|
+
input_transforms[key] = {
|
|
43
43
|
type: 'static',
|
|
44
44
|
value: value
|
|
45
45
|
};
|
|
46
46
|
});
|
|
47
|
-
flow.value.modules[0].
|
|
47
|
+
flow.value.modules[0].input_transforms = input_transforms;
|
|
48
48
|
return flow;
|
|
49
49
|
}
|
|
50
50
|
</script>
|
|
@@ -65,33 +65,34 @@ function setInputTransformFromArgs(flow, args) {
|
|
|
65
65
|
|
|
66
66
|
{#if viewPreview}
|
|
67
67
|
{#if i != flow.value.modules.length}
|
|
68
|
-
<
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
68
|
+
<div class="mt-2">
|
|
69
|
+
<Tabs bind:selected={tab}>
|
|
70
|
+
<Tab value="upto">{uptoText}</Tab>
|
|
71
|
+
<Tab value="justthis">Preview just this step</Tab>
|
|
72
|
+
<svelte:fragment slot="content">
|
|
73
|
+
<TabContent value="upto">
|
|
74
|
+
<RunForm
|
|
75
|
+
runnable={truncateFlow(flow)}
|
|
76
|
+
runAction={(_, args) => runPreview(args)}
|
|
77
|
+
schedulable={false}
|
|
78
|
+
buttonText={uptoText}
|
|
79
|
+
detailed={false}
|
|
80
|
+
bind:args
|
|
81
|
+
/>
|
|
82
|
+
</TabContent>
|
|
83
|
+
<TabContent value="justthis">
|
|
84
|
+
<RunForm
|
|
85
|
+
runnable={extractStep(flow)}
|
|
86
|
+
runAction={(_, args) => runPreview(args)}
|
|
87
|
+
schedulable={false}
|
|
88
|
+
buttonText="Preview just this step"
|
|
89
|
+
detailed={false}
|
|
90
|
+
args={stepArgs}
|
|
91
|
+
/>
|
|
92
|
+
</TabContent>
|
|
93
|
+
</svelte:fragment>
|
|
94
|
+
</Tabs>
|
|
95
|
+
</div>
|
|
95
96
|
{/if}
|
|
96
97
|
|
|
97
98
|
{#if jobId}
|
|
@@ -72,7 +72,10 @@ onDestroy(() => {
|
|
|
72
72
|
{#if jobId}
|
|
73
73
|
<FlowStatusViewer
|
|
74
74
|
{jobId}
|
|
75
|
-
on:jobsLoaded={(e) =>
|
|
75
|
+
on:jobsLoaded={(e) => {
|
|
76
|
+
intervalState = 'done'
|
|
77
|
+
mapJobResultsToFlowState(e.detail, 'upto', steps - 1)
|
|
78
|
+
}}
|
|
76
79
|
root={true}
|
|
77
80
|
/>
|
|
78
81
|
{/if}
|