windmill-components 1.75.0 → 1.77.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/DisplayResult.svelte +1 -1
- package/components/Dropdown.svelte +14 -4
- package/components/FlowGraphViewer.svelte +1 -1
- package/components/FolderUsageInfo.svelte +16 -6
- package/components/FolderUsageInfo.svelte.d.ts +2 -0
- package/components/PageHeader.svelte +1 -1
- package/components/Path.svelte +22 -3
- package/components/ScriptBuilder.svelte +122 -122
- package/components/SettingSection.svelte +44 -0
- package/components/SettingSection.svelte.d.ts +21 -0
- package/components/Tooltip.svelte +3 -1
- package/components/WhitelistIp.svelte +1 -3
- package/components/apps/components/buttons/AppButton.svelte +11 -5
- package/components/apps/components/buttons/AppButton.svelte.d.ts +1 -0
- package/components/apps/components/buttons/AppForm.svelte +3 -7
- package/components/apps/components/buttons/AppFormButton.svelte +2 -6
- package/components/apps/components/display/table/AppAggridTable.svelte +4 -1
- package/components/apps/components/display/table/AppTable.svelte +4 -1
- package/components/apps/components/helpers/HiddenComponent.svelte +3 -0
- package/components/apps/components/helpers/HiddenComponent.svelte.d.ts +1 -0
- package/components/apps/components/helpers/InputValue.svelte +26 -43
- package/components/apps/components/helpers/InputValue.svelte.d.ts +4 -3
- package/components/apps/components/helpers/RefreshButton.svelte +2 -3
- package/components/apps/components/helpers/RunnableComponent.svelte +61 -34
- package/components/apps/components/helpers/RunnableComponent.svelte.d.ts +2 -0
- package/components/apps/components/helpers/RunnableWrapper.svelte +2 -0
- package/components/apps/components/helpers/RunnableWrapper.svelte.d.ts +1 -0
- package/components/apps/components/helpers/eval.d.ts +5 -0
- package/components/apps/components/helpers/eval.js +57 -0
- package/components/apps/components/layout/AppContainer.svelte +1 -6
- package/components/apps/components/layout/AppDrawer.svelte +0 -3
- package/components/apps/components/layout/AppSplitpanes.svelte +1 -6
- package/components/apps/components/layout/AppTabs.svelte +64 -33
- package/components/apps/components/layout/AppTabs.svelte.d.ts +1 -0
- package/components/apps/editor/AppEditor.svelte +136 -131
- package/components/apps/editor/AppEditorHeader.svelte +43 -35
- package/components/apps/editor/AppPreview.svelte +3 -2
- package/components/apps/editor/ComponentHeader.svelte +3 -1
- package/components/apps/editor/ComponentHeader.svelte.d.ts +1 -0
- package/components/apps/editor/GridEditor.svelte +53 -51
- package/components/apps/editor/RecomputeAllComponents.svelte +7 -1
- package/components/apps/editor/SettingsPanel.svelte +23 -10
- package/components/apps/editor/SubGridEditor.svelte +56 -52
- package/components/apps/editor/SubGridEditor.svelte.d.ts +3 -4
- package/components/apps/editor/appUtils.d.ts +12 -3
- package/components/apps/editor/appUtils.js +111 -37
- package/components/apps/editor/component/Component.svelte +4 -9
- package/components/apps/editor/component/ComponentNavigation.svelte +91 -46
- package/components/apps/editor/component/components.d.ts +1 -1
- package/components/apps/editor/component/components.js +24 -43
- package/components/apps/editor/componentsPanel/componentStaticValues.d.ts +1 -0
- package/components/apps/editor/componentsPanel/componentStaticValues.js +1 -0
- package/components/apps/editor/contextPanel/ComponentOutput.svelte +77 -0
- package/components/apps/editor/contextPanel/ComponentOutput.svelte.d.ts +21 -0
- package/components/apps/editor/contextPanel/ComponentOutputViewer.svelte +9 -5
- package/components/apps/editor/contextPanel/ContextPanel.svelte +80 -136
- package/components/apps/editor/contextPanel/SubGridOutput.svelte +71 -0
- package/components/apps/editor/contextPanel/SubGridOutput.svelte.d.ts +19 -0
- package/components/apps/editor/contextPanel/components/BackgroundScriptOutput.svelte +38 -0
- package/components/apps/editor/contextPanel/components/BackgroundScriptOutput.svelte.d.ts +19 -0
- package/components/apps/editor/contextPanel/components/BackgroundScriptsOutput.svelte +10 -0
- package/components/apps/editor/contextPanel/components/BackgroundScriptsOutput.svelte.d.ts +16 -0
- package/components/apps/editor/contextPanel/components/MinMaxButton.svelte +25 -0
- package/components/apps/editor/contextPanel/components/MinMaxButton.svelte.d.ts +16 -0
- package/components/apps/editor/contextPanel/components/OutputHeader.svelte +78 -0
- package/components/apps/editor/contextPanel/components/OutputHeader.svelte.d.ts +26 -0
- package/components/apps/editor/contextPanel/components/TableActionOutput.svelte +19 -0
- package/components/apps/editor/contextPanel/components/TableActionOutput.svelte.d.ts +18 -0
- package/components/apps/editor/contextPanel/components/TableActionsOutput.svelte +14 -0
- package/components/apps/editor/contextPanel/components/TableActionsOutput.svelte.d.ts +18 -0
- package/components/apps/editor/inlineScriptsPanel/EmptyInlineScript.svelte +53 -21
- package/components/apps/editor/inlineScriptsPanel/InlineScriptEditor.svelte +69 -43
- package/components/apps/editor/inlineScriptsPanel/InlineScriptEditorDrawer.svelte +1 -1
- package/components/apps/editor/settingsPanel/ArrayStaticInputEditor.svelte.d.ts +2 -2
- package/components/apps/editor/settingsPanel/ComponentPanel.svelte +32 -31
- package/components/apps/editor/settingsPanel/GridTab.svelte +4 -12
- package/components/apps/editor/settingsPanel/Recompute.svelte +1 -0
- package/components/apps/editor/settingsPanel/SelectedRunnable.svelte +6 -0
- package/components/apps/editor/settingsPanel/TableActions.svelte +2 -1
- package/components/apps/editor/settingsPanel/inputEditor/ConnectedInputEditor.svelte +2 -8
- package/components/apps/editor/settingsPanel/inputEditor/EvalInputEditor.svelte +2 -2
- package/components/apps/editor/settingsPanel/inputEditor/IconSelectInput.svelte +58 -46
- package/components/apps/editor/settingsPanel/inputEditor/JsonEditor.svelte +1 -1
- package/components/apps/editor/settingsPanel/inputEditor/JsonEditor.svelte.d.ts +2 -0
- package/components/apps/rx.d.ts +6 -4
- package/components/apps/rx.js +34 -14
- package/components/apps/svelte-grid/Grid.svelte +171 -0
- package/components/apps/svelte-grid/Grid.svelte.d.ts +47 -0
- package/components/apps/svelte-grid/LICENSE +23 -0
- package/components/apps/svelte-grid/MoveResize.svelte +328 -0
- package/components/apps/svelte-grid/MoveResize.svelte.d.ts +46 -0
- package/components/apps/svelte-grid/types.d.ts +25 -0
- package/components/apps/svelte-grid/utils/container.d.ts +1 -0
- package/components/apps/svelte-grid/utils/container.js +4 -0
- package/components/apps/svelte-grid/utils/helper.d.ts +14 -0
- package/components/apps/svelte-grid/utils/helper.js +36 -0
- package/components/apps/svelte-grid/utils/item.d.ts +14 -0
- package/components/apps/svelte-grid/utils/item.js +192 -0
- package/components/apps/svelte-grid/utils/matrix.d.ts +6 -0
- package/components/apps/svelte-grid/utils/matrix.js +53 -0
- package/components/apps/svelte-grid/utils/other.d.ts +3 -0
- package/components/apps/svelte-grid/utils/other.js +30 -0
- package/components/apps/types.d.ts +10 -7
- package/components/apps/utils.d.ts +1 -1
- package/components/apps/utils.js +13 -7
- package/components/common/CloseButton.svelte +18 -0
- package/components/common/CloseButton.svelte.d.ts +27 -0
- package/components/common/badge/Badge.svelte +6 -1
- package/components/common/badge/Badge.svelte.d.ts +1 -0
- package/components/common/drawer/DrawerContent.svelte +2 -6
- package/components/common/languageIcons/JavaScript.svelte +11 -0
- package/components/common/languageIcons/JavaScript.svelte.d.ts +25 -0
- package/components/common/languageIcons/LanguageIcon.svelte +3 -1
- package/components/common/languageIcons/LanguageIcon.svelte.d.ts +1 -1
- package/components/common/menu/Menu.svelte +1 -1
- package/components/common/popup/Popup.svelte +2 -1
- package/components/common/popup/Popup.svelte.d.ts +9 -0
- package/components/common/table/AppRow.svelte +1 -4
- package/components/common/table/FlowRow.svelte +1 -4
- package/components/common/table/ScriptRow.svelte +1 -4
- package/components/common/tabs/Tab.svelte +1 -0
- package/components/common/tabs/Tab.svelte.d.ts +2 -0
- package/components/flows/pickers/FlowScriptPicker.svelte.d.ts +1 -1
- package/components/graph/FlowGraph.svelte +1 -1
- package/components/sidebar/SidebarContent.svelte +2 -2
- package/consts.js +1 -1
- package/history.js +8 -1
- package/package.json +21 -27
- package/utils.js +0 -1
- package/components/apps/editor/settingsPanel/MoveToOtherGrid.svelte +0 -92
- package/components/apps/editor/settingsPanel/MoveToOtherGrid.svelte.d.ts +0 -18
- package/components/graph/svelvet/d3/controllers/README.md +0 -3
- package/components/graph/svelvet/d3/controllers/d3Old.d.ts +0 -1
- package/components/graph/svelvet/d3/controllers/d3Old.js +0 -43
- package/components/graph/svelvet/docs/CHANGELOG.md +0 -145
- package/components/graph/svelvet/docs/DESIGN_PATTERNS.md +0 -44
- package/components/graph/svelvet/docs/DOCUMENTATION.md +0 -5
- package/components/graph/svelvet/docs/README.md +0 -34
- package/components/graph/svelvet/docs/TODO.md +0 -14
- package/components/graph/svelvet/docs/Tutorials.md +0 -25
- package/components/graph/svelvet/docs/images/css-background-after.png +0 -0
- package/components/graph/svelvet/docs/images/css-background-before.png +0 -0
- package/components/graph/svelvet/docs/images/custom-edges-after.png +0 -0
- package/components/graph/svelvet/docs/images/custom-edges-before.png +0 -0
- package/components/graph/svelvet/docs/images/custom-nodes-after.png +0 -0
- package/components/graph/svelvet/docs/images/custom-nodes-before.png +0 -0
- package/components/graph/svelvet/docs/images/custom-svelte-components-after.png +0 -0
- package/components/graph/svelvet/docs/images/custom-svelte-components-before.png +0 -0
- package/components/graph/svelvet/docs/images/html-docs-after.png +0 -0
- package/components/graph/svelvet/docs/images/html-docs-before.png +0 -0
- package/components/graph/svelvet/docs/images/minimap-after.png +0 -0
- package/components/graph/svelvet/docs/images/minimap-before.png +0 -0
- package/components/graph/svelvet/docs/images/node-classes-after.png +0 -0
- package/components/graph/svelvet/docs/images/node-classes-before.png +0 -0
- package/components/graph/svelvet/docs/images/node-create-after.png +0 -0
- package/components/graph/svelvet/docs/images/node-create-before.png +0 -0
|
@@ -231,6 +231,6 @@ let jsonViewer;
|
|
|
231
231
|
<Highlight language={json} code={JSON.stringify(result, null, 4).replace(/\\n/g, '\n')} />
|
|
232
232
|
{/if}
|
|
233
233
|
{:else}
|
|
234
|
-
<div class="text-gray-500 text-sm">No result</div>
|
|
234
|
+
<div class="text-gray-500 text-sm">No result: {JSON.stringify(result)}</div>
|
|
235
235
|
{/if}
|
|
236
236
|
</div>
|
|
@@ -1,19 +1,29 @@
|
|
|
1
1
|
<script>import { createEventDispatcher } from 'svelte';
|
|
2
2
|
import Icon from 'svelte-awesome';
|
|
3
|
-
import {
|
|
3
|
+
import { MoreVertical } from 'lucide-svelte';
|
|
4
4
|
import { Button, Menu } from './common';
|
|
5
5
|
import { goto } from '$app/navigation';
|
|
6
|
+
import { twMerge } from 'tailwind-merge';
|
|
6
7
|
export let dropdownItems;
|
|
7
8
|
export let name = undefined;
|
|
8
9
|
export let placement = 'bottom-start';
|
|
9
|
-
export let btnClasses = '
|
|
10
|
+
export let btnClasses = '';
|
|
11
|
+
$: buttonClass = twMerge('!border-0 bg-transparent !p-[6px]', btnClasses);
|
|
10
12
|
const dispatch = createEventDispatcher();
|
|
11
13
|
</script>
|
|
12
14
|
|
|
13
15
|
<Menu {placement} let:close>
|
|
14
|
-
<Button
|
|
16
|
+
<Button
|
|
17
|
+
nonCaptureEvent
|
|
18
|
+
color="dark"
|
|
19
|
+
variant="border"
|
|
20
|
+
size="xs"
|
|
21
|
+
btnClasses={buttonClass}
|
|
22
|
+
{...$$restProps}
|
|
23
|
+
slot="trigger"
|
|
24
|
+
>
|
|
15
25
|
{#if !$$slots.default}
|
|
16
|
-
<
|
|
26
|
+
<MoreVertical size={20} />
|
|
17
27
|
{:else}
|
|
18
28
|
<slot />
|
|
19
29
|
{/if}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
<script>import { FolderService, GroupService } from '../gen';
|
|
2
2
|
import { workspaceStore } from '../stores';
|
|
3
3
|
export let name;
|
|
4
|
+
export let tabular = false;
|
|
5
|
+
export let order = ['scripts', 'flows', 'apps', 'schedules', 'variables', 'resources'];
|
|
4
6
|
$: $workspaceStore && loadUsage();
|
|
5
7
|
let usage = {};
|
|
6
8
|
async function loadUsage() {
|
|
@@ -8,10 +10,18 @@ async function loadUsage() {
|
|
|
8
10
|
}
|
|
9
11
|
</script>
|
|
10
12
|
|
|
11
|
-
|
|
12
|
-
{#each
|
|
13
|
-
<
|
|
14
|
-
{
|
|
15
|
-
</
|
|
13
|
+
{#if tabular}
|
|
14
|
+
{#each order as key}
|
|
15
|
+
<td class="text-center">
|
|
16
|
+
{usage[key] ?? ''}
|
|
17
|
+
</td>
|
|
16
18
|
{/each}
|
|
17
|
-
|
|
19
|
+
{:else}
|
|
20
|
+
<div class="flex flex-col text-xs text-gray-600">
|
|
21
|
+
{#each Object.entries(usage) as [k, v]}
|
|
22
|
+
<div>
|
|
23
|
+
{k}: {v}
|
|
24
|
+
</div>
|
|
25
|
+
{/each}
|
|
26
|
+
</div>
|
|
27
|
+
{/if}
|
package/components/Path.svelte
CHANGED
|
@@ -12,6 +12,7 @@ import Tooltip from './Tooltip.svelte';
|
|
|
12
12
|
import FolderEditor from './FolderEditor.svelte';
|
|
13
13
|
import GroupEditor from './GroupEditor.svelte';
|
|
14
14
|
import { random_adj } from './random_positive_adjetive';
|
|
15
|
+
import Badge from './common/badge/Badge.svelte';
|
|
15
16
|
let meta = undefined;
|
|
16
17
|
export let namePlaceholder = '';
|
|
17
18
|
export let initialPath;
|
|
@@ -272,7 +273,7 @@ async function addGroup() {
|
|
|
272
273
|
{#if meta != undefined}
|
|
273
274
|
<div class="flex gap-4 shrink">
|
|
274
275
|
<label class="block">
|
|
275
|
-
<span class="text-gray-700 text-sm whitespace-nowrap"
|
|
276
|
+
<span class="text-gray-700 text-sm whitespace-nowrap">Owner</span>
|
|
276
277
|
|
|
277
278
|
<ToggleButtonGroup
|
|
278
279
|
class="mt-0.5"
|
|
@@ -375,8 +376,26 @@ async function addGroup() {
|
|
|
375
376
|
{/if}
|
|
376
377
|
</div>
|
|
377
378
|
|
|
378
|
-
<div class="flex
|
|
379
|
-
<div
|
|
379
|
+
<div class="flex flex-col w-full mt-4">
|
|
380
|
+
<div class="flex justify-start w-full">
|
|
381
|
+
<Badge
|
|
382
|
+
color="gray"
|
|
383
|
+
class="center-center !bg-gray-300 !text-gray-600 !w-[70px] !h-[24px] rounded-r-none"
|
|
384
|
+
>
|
|
385
|
+
Full path
|
|
386
|
+
</Badge>
|
|
387
|
+
<input
|
|
388
|
+
type="text"
|
|
389
|
+
readonly
|
|
390
|
+
value={path}
|
|
391
|
+
size={path?.length || 50}
|
|
392
|
+
class="font-mono !text-xs max-w-[calc(100%-70px)] !w-auto !h-[24px] !py-0 !border-l-0 !rounded-l-none"
|
|
393
|
+
on:focus={({ currentTarget }) => {
|
|
394
|
+
currentTarget.select()
|
|
395
|
+
}}
|
|
396
|
+
/>
|
|
397
|
+
<!-- <span class="font-mono text-sm break-all">{path}</span> -->
|
|
398
|
+
</div>
|
|
380
399
|
<div class="text-red-600 text-2xs">{error}</div>
|
|
381
400
|
</div>
|
|
382
401
|
</div>
|
|
@@ -2,19 +2,20 @@
|
|
|
2
2
|
import { goto } from '$app/navigation';
|
|
3
3
|
import { page } from '$app/stores';
|
|
4
4
|
import { inferArgs } from '../infer';
|
|
5
|
-
import { initialCode
|
|
5
|
+
import { initialCode } from '../script_helpers';
|
|
6
6
|
import { userStore, workspaceStore } from '../stores';
|
|
7
7
|
import { emptySchema, encodeState, sendUserToast, setQueryWithoutLoad } from '../utils';
|
|
8
8
|
import Path from './Path.svelte';
|
|
9
|
-
import RadioButton from './RadioButton.svelte';
|
|
10
9
|
import ScriptEditor from './ScriptEditor.svelte';
|
|
11
10
|
import ScriptSchema from './ScriptSchema.svelte';
|
|
12
11
|
import CenteredPage from './CenteredPage.svelte';
|
|
13
12
|
import { dirtyStore } from './common/confirmationModal/dirtyStore';
|
|
14
13
|
import { Button, ButtonPopup, ButtonPopupItem, Kbd } from './common';
|
|
15
|
-
import {
|
|
14
|
+
import { faPen, faSave } from '@fortawesome/free-solid-svg-icons';
|
|
16
15
|
import Breadcrumb from './common/breadcrumb/Breadcrumb.svelte';
|
|
17
16
|
import LanguageIcon from './common/languageIcons/LanguageIcon.svelte';
|
|
17
|
+
import Tooltip from './Tooltip.svelte';
|
|
18
|
+
import SettingSection from './SettingSection.svelte';
|
|
18
19
|
export let script;
|
|
19
20
|
export let initialPath = '';
|
|
20
21
|
export let template = 'script';
|
|
@@ -26,10 +27,31 @@ const langs = [
|
|
|
26
27
|
['Go', Script.language.GO],
|
|
27
28
|
['Bash', Script.language.BASH]
|
|
28
29
|
];
|
|
29
|
-
|
|
30
|
+
const scriptKindOptions = [
|
|
31
|
+
{
|
|
32
|
+
value: Script.kind.SCRIPT,
|
|
33
|
+
title: 'Action'
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
value: Script.kind.TRIGGER,
|
|
37
|
+
title: 'Trigger',
|
|
38
|
+
desc: 'First module of flows to trigger them based on external changes. These kind of scripts are usually running on a schedule to periodically look for changes.'
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
value: Script.kind.APPROVAL,
|
|
42
|
+
title: 'Approval',
|
|
43
|
+
desc: 'Send notifications externally to ask for approval to continue a flow.'
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
value: Script.kind.FAILURE,
|
|
47
|
+
title: 'Error Handler',
|
|
48
|
+
desc: 'Handle errors in flows after all retry attempts have been exhausted.'
|
|
49
|
+
}
|
|
50
|
+
];
|
|
30
51
|
let pathError = '';
|
|
31
52
|
let summaryC = undefined;
|
|
32
53
|
let pathC = undefined;
|
|
54
|
+
let loadingSave = false;
|
|
33
55
|
$: setQueryWithoutLoad($page.url, [{ key: 'state', value: encodeState(script) }]);
|
|
34
56
|
$: step = Number($page.url.searchParams.get('step')) || 1;
|
|
35
57
|
if (script.content == '') {
|
|
@@ -38,7 +60,6 @@ if (script.content == '') {
|
|
|
38
60
|
function initContent(language, kind, template) {
|
|
39
61
|
script.content = initialCode(language, kind, template);
|
|
40
62
|
}
|
|
41
|
-
let loadingSave = false;
|
|
42
63
|
async function editScript(leave) {
|
|
43
64
|
loadingSave = true;
|
|
44
65
|
try {
|
|
@@ -190,132 +211,111 @@ function onKeyDown(event) {
|
|
|
190
211
|
<!-- metadata -->
|
|
191
212
|
{#if step === 1}
|
|
192
213
|
<CenteredPage>
|
|
193
|
-
<
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
<
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
{
|
|
214
|
+
<SettingSection title="Path" element="h2">
|
|
215
|
+
<Path
|
|
216
|
+
bind:this={pathC}
|
|
217
|
+
bind:error={pathError}
|
|
218
|
+
bind:path={script.path}
|
|
219
|
+
{initialPath}
|
|
220
|
+
on:enter={() => changeStep(2)}
|
|
221
|
+
namePlaceholder="script"
|
|
222
|
+
kind="script"
|
|
223
|
+
/>
|
|
224
|
+
</SettingSection>
|
|
225
|
+
<SettingSection title="Summary" element="h2">
|
|
226
|
+
<input
|
|
227
|
+
type="text"
|
|
228
|
+
bind:this={summaryC}
|
|
229
|
+
bind:value={script.summary}
|
|
230
|
+
placeholder="Short summary to be displayed when listed"
|
|
231
|
+
/>
|
|
232
|
+
</SettingSection>
|
|
233
|
+
<SettingSection title="Language" element="h2">
|
|
234
|
+
{#if lockedLanguage}
|
|
235
|
+
<div class="text-sm text-gray-600 italic mb-2">
|
|
236
|
+
As a forked script, the language '{script.language}' cannot be modified.
|
|
237
|
+
</div>
|
|
238
|
+
{/if}
|
|
239
|
+
<div class="flex flex-row gap-2 flex-wrap">
|
|
240
|
+
{#each langs as [label, lang]}
|
|
241
|
+
{@const isPicked = script.language == lang && template == 'script'}
|
|
242
|
+
<Button
|
|
243
|
+
size="sm"
|
|
244
|
+
variant="border"
|
|
245
|
+
color={isPicked ? 'blue' : 'dark'}
|
|
246
|
+
btnClasses={isPicked ? '!border-2 !bg-blue-50/75' : 'm-[1px]'}
|
|
247
|
+
on:click={() => {
|
|
248
|
+
script.language = lang
|
|
249
|
+
template = 'script'
|
|
250
|
+
initContent(lang, script.kind, template)
|
|
251
|
+
}}
|
|
252
|
+
disabled={lockedLanguage}
|
|
253
|
+
>
|
|
254
|
+
<LanguageIcon {lang} />
|
|
255
|
+
<span class="ml-2 py-2">{label}</span>
|
|
256
|
+
</Button>
|
|
257
|
+
{/each}
|
|
220
258
|
<Button
|
|
221
259
|
size="sm"
|
|
222
260
|
variant="border"
|
|
223
|
-
color={
|
|
224
|
-
btnClasses={
|
|
261
|
+
color={template == 'pgsql' ? 'blue' : 'dark'}
|
|
262
|
+
btnClasses={template == 'pgsql' ? '!border-2 !bg-blue-50/75' : 'm-[1px]'}
|
|
263
|
+
disabled={lockedLanguage}
|
|
225
264
|
on:click={() => {
|
|
226
|
-
script.language =
|
|
227
|
-
template = '
|
|
228
|
-
initContent(
|
|
265
|
+
script.language = Script.language.DENO
|
|
266
|
+
template = 'pgsql'
|
|
267
|
+
initContent(script.language, script.kind, template)
|
|
229
268
|
}}
|
|
230
|
-
disabled={lockedLanguage}
|
|
231
269
|
>
|
|
232
|
-
<LanguageIcon
|
|
270
|
+
<LanguageIcon lang="pgsql" /><span class="ml-2 py-2">PostgreSQL</span>
|
|
233
271
|
</Button>
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
template = 'pgsql'
|
|
244
|
-
initContent(script.language, script.kind, template)
|
|
245
|
-
}}
|
|
246
|
-
>
|
|
247
|
-
<LanguageIcon lang="pgsql" /><span class="ml-2 py-4">PostgreSQL</span>
|
|
248
|
-
</Button>
|
|
249
|
-
<!-- <Button
|
|
250
|
-
size="sm"
|
|
251
|
-
variant="border"
|
|
252
|
-
color={template == 'mysql' ? 'blue' : 'dark'}
|
|
253
|
-
btnClasses={template == 'mysql' ? '!border-2 !bg-blue-50/75' : 'm-[1px]'}
|
|
254
|
-
on:click={() => {
|
|
255
|
-
script.language = Script.language.DENO
|
|
256
|
-
template = 'mysql'
|
|
257
|
-
initContent(script.language, script.kind, template)
|
|
258
|
-
}}
|
|
259
|
-
>
|
|
260
|
-
<LanguageIcon lang="mysql" /><span class="ml-2 py-4">MySQL</span>
|
|
261
|
-
</Button> -->
|
|
262
|
-
</div>
|
|
263
|
-
<div class="mt-16 mb-4">
|
|
264
|
-
<Button
|
|
265
|
-
color="light"
|
|
266
|
-
size="sm"
|
|
267
|
-
endIcon={{ icon: viewScriptKind ? faChevronUp : faChevronDown }}
|
|
268
|
-
on:click={() => (viewScriptKind = !viewScriptKind)}
|
|
269
|
-
>
|
|
270
|
-
Tag this script as having a specific purpose inside flows
|
|
271
|
-
</Button>
|
|
272
|
-
</div>
|
|
273
|
-
{#if viewScriptKind}
|
|
274
|
-
<div class="max-w-lg">
|
|
275
|
-
<RadioButton
|
|
276
|
-
label="Script Type"
|
|
277
|
-
options={[
|
|
278
|
-
['Action', Script.kind.SCRIPT],
|
|
279
|
-
[
|
|
280
|
-
{
|
|
281
|
-
title: 'Trigger',
|
|
282
|
-
desc: `First module of flows to trigger them based on watching changes external periodically using an internal state`
|
|
283
|
-
},
|
|
284
|
-
Script.kind.TRIGGER
|
|
285
|
-
],
|
|
286
|
-
[
|
|
287
|
-
{
|
|
288
|
-
title: 'Approval',
|
|
289
|
-
desc: `Send notification externally to ask for approval to continue a flow`
|
|
290
|
-
},
|
|
291
|
-
Script.kind.APPROVAL
|
|
292
|
-
],
|
|
293
|
-
[
|
|
294
|
-
{
|
|
295
|
-
title: 'Error Handler',
|
|
296
|
-
desc: `Handle errors for flows after all retries attempts have been exhausted`
|
|
297
|
-
},
|
|
298
|
-
Script.kind.FAILURE
|
|
299
|
-
]
|
|
300
|
-
|
|
301
|
-
// ['Command Handler', Script.kind.COMMAND]
|
|
302
|
-
]}
|
|
303
|
-
on:change={(e) => {
|
|
304
|
-
if (isInitialCode(script.content)) {
|
|
305
|
-
template = 'script'
|
|
306
|
-
initContent(script.language, e.detail, template)
|
|
307
|
-
}
|
|
272
|
+
<!-- <Button
|
|
273
|
+
size="sm"
|
|
274
|
+
variant="border"
|
|
275
|
+
color={template == 'mysql' ? 'blue' : 'dark'}
|
|
276
|
+
btnClasses={template == 'mysql' ? '!border-2 !bg-blue-50/75' : 'm-[1px]'}
|
|
277
|
+
on:click={() => {
|
|
278
|
+
script.language = Script.language.DENO
|
|
279
|
+
template = 'mysql'
|
|
280
|
+
initContent(script.language, script.kind, template)
|
|
308
281
|
}}
|
|
309
|
-
|
|
310
|
-
|
|
282
|
+
>
|
|
283
|
+
<LanguageIcon lang="mysql" /><span class="ml-2 py-2">MySQL</span>
|
|
284
|
+
</Button> -->
|
|
311
285
|
</div>
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
286
|
+
</SettingSection>
|
|
287
|
+
<SettingSection
|
|
288
|
+
title="Script kind"
|
|
289
|
+
element="h3"
|
|
290
|
+
tooltip="Tag this script as having a specific purpose inside flows. If it won't be used in flows,
|
|
291
|
+
you don't have to worry about this."
|
|
292
|
+
accordion
|
|
293
|
+
>
|
|
294
|
+
<div class="flex flex-wrap gap-2">
|
|
295
|
+
{#each scriptKindOptions as { value, title, desc }}
|
|
296
|
+
{@const isPicked = script.kind === value}
|
|
297
|
+
<Button
|
|
298
|
+
size="sm"
|
|
299
|
+
variant="border"
|
|
300
|
+
color={isPicked ? 'blue' : 'dark'}
|
|
301
|
+
btnClasses="font-medium {isPicked ? '!bg-blue-50/75' : ''}"
|
|
302
|
+
on:click={() => {
|
|
303
|
+
template = 'script'
|
|
304
|
+
script.kind = value
|
|
305
|
+
initContent(script.language, value, template)
|
|
306
|
+
}}
|
|
307
|
+
disabled={lockedLanguage}
|
|
308
|
+
>
|
|
309
|
+
{title}
|
|
310
|
+
{#if desc}
|
|
311
|
+
<Tooltip class="mb-0.5 ml-1">
|
|
312
|
+
{desc}
|
|
313
|
+
</Tooltip>
|
|
314
|
+
{/if}
|
|
315
|
+
</Button>
|
|
316
|
+
{/each}
|
|
317
|
+
</div>
|
|
318
|
+
</SettingSection>
|
|
319
319
|
</CenteredPage>
|
|
320
320
|
{:else if step === 2}
|
|
321
321
|
<ScriptEditor
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
<script>import { ChevronDown } from 'lucide-svelte';
|
|
2
|
+
import { slide } from 'svelte/transition';
|
|
3
|
+
import Tooltip from './Tooltip.svelte';
|
|
4
|
+
export let title;
|
|
5
|
+
export let tooltip = '';
|
|
6
|
+
export let element = 'h2';
|
|
7
|
+
export let accordion = false;
|
|
8
|
+
let showContent = !accordion;
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<div class="border-b [&:has(button:hover)]:border-gray-400 duration-200 pb-1 mt-8 mb-2">
|
|
12
|
+
{#if accordion}
|
|
13
|
+
<button
|
|
14
|
+
class="flex w-full justify-start items-center"
|
|
15
|
+
on:click={() => (showContent = !showContent)}
|
|
16
|
+
>
|
|
17
|
+
<span class="rounded-full hover:bg-gray-100 focus:bg-gray-100 p-1 mr-1">
|
|
18
|
+
<ChevronDown size={22} class="rotate-0 duration-300 {showContent ? '!-rotate-180' : ''}" />
|
|
19
|
+
</span>
|
|
20
|
+
<svelte:element this={element}>
|
|
21
|
+
{title}
|
|
22
|
+
{#if tooltip}
|
|
23
|
+
<Tooltip scale={0.9} class="mb-0.5">
|
|
24
|
+
{tooltip}
|
|
25
|
+
</Tooltip>
|
|
26
|
+
{/if}
|
|
27
|
+
</svelte:element>
|
|
28
|
+
</button>
|
|
29
|
+
{:else}
|
|
30
|
+
<svelte:element this={element}>
|
|
31
|
+
{title}
|
|
32
|
+
{#if tooltip}
|
|
33
|
+
<Tooltip scale={0.9} class="mb-0.5">
|
|
34
|
+
{tooltip}
|
|
35
|
+
</Tooltip>
|
|
36
|
+
{/if}
|
|
37
|
+
</svelte:element>
|
|
38
|
+
{/if}
|
|
39
|
+
</div>
|
|
40
|
+
{#if showContent}
|
|
41
|
+
<div transition:slide={{ duration: 300 }}>
|
|
42
|
+
<slot />
|
|
43
|
+
</div>
|
|
44
|
+
{/if}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: {
|
|
4
|
+
title: string;
|
|
5
|
+
tooltip?: string | undefined;
|
|
6
|
+
element?: "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | undefined;
|
|
7
|
+
accordion?: boolean | undefined;
|
|
8
|
+
};
|
|
9
|
+
events: {
|
|
10
|
+
[evt: string]: CustomEvent<any>;
|
|
11
|
+
};
|
|
12
|
+
slots: {
|
|
13
|
+
default: {};
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
export type SettingSectionProps = typeof __propDef.props;
|
|
17
|
+
export type SettingSectionEvents = typeof __propDef.events;
|
|
18
|
+
export type SettingSectionSlots = typeof __propDef.slots;
|
|
19
|
+
export default class SettingSection extends SvelteComponentTyped<SettingSectionProps, SettingSectionEvents, SettingSectionSlots> {
|
|
20
|
+
}
|
|
21
|
+
export {};
|
|
@@ -5,9 +5,7 @@ WorkerService.listWorkers({}).then((workers) => {
|
|
|
5
5
|
ips = [
|
|
6
6
|
...new Set(workers
|
|
7
7
|
.filter((worker) => {
|
|
8
|
-
|
|
9
|
-
const ping_at = new Date(worker.ping_at).getTime();
|
|
10
|
-
return worker.ip != 'unretrievable IP' && ping_at > date;
|
|
8
|
+
return worker.ip != 'unretrievable IP' && worker.last_ping && worker.last_ping < 300;
|
|
11
9
|
})
|
|
12
10
|
.map((worker) => worker.ip))
|
|
13
11
|
];
|
|
@@ -17,8 +17,9 @@ export let noWFull = false;
|
|
|
17
17
|
export let preclickAction = undefined;
|
|
18
18
|
export let customCss = undefined;
|
|
19
19
|
export let render;
|
|
20
|
+
export let initializing = true;
|
|
20
21
|
export const staticOutputs = ['loading', 'result'];
|
|
21
|
-
const {
|
|
22
|
+
const { worldStore, app } = getContext('AppViewerContext');
|
|
22
23
|
let labelValue;
|
|
23
24
|
let color;
|
|
24
25
|
let size;
|
|
@@ -52,6 +53,7 @@ $: if (outputs?.loading != undefined) {
|
|
|
52
53
|
outputs.loading.set(false, true);
|
|
53
54
|
}
|
|
54
55
|
$: outputs?.loading.subscribe({
|
|
56
|
+
id: 'loading-' + id,
|
|
55
57
|
next: (value) => {
|
|
56
58
|
isLoading = value;
|
|
57
59
|
if (ownClick && !value) {
|
|
@@ -84,13 +86,15 @@ async function handleClick(event) {
|
|
|
84
86
|
else {
|
|
85
87
|
await runnableComponent?.runComponent();
|
|
86
88
|
}
|
|
87
|
-
if (recomputeIds) {
|
|
88
|
-
await Promise.all(recomputeIds.map((id) => $runnableComponents?.[id]?.()));
|
|
89
|
-
}
|
|
90
89
|
}
|
|
91
90
|
</script>
|
|
92
91
|
|
|
93
|
-
<InputValue
|
|
92
|
+
<InputValue
|
|
93
|
+
on:done={() => initializing && (initializing = false)}
|
|
94
|
+
{id}
|
|
95
|
+
input={configuration.label}
|
|
96
|
+
bind:value={labelValue}
|
|
97
|
+
/>
|
|
94
98
|
<InputValue {id} input={configuration.goto} bind:value={gotoUrl} />
|
|
95
99
|
<InputValue {id} input={configuration.color} bind:value={color} />
|
|
96
100
|
<InputValue {id} input={configuration.size} bind:value={size} />
|
|
@@ -101,6 +105,7 @@ async function handleClick(event) {
|
|
|
101
105
|
<InputValue
|
|
102
106
|
{id}
|
|
103
107
|
input={configuration.disabled}
|
|
108
|
+
extraContext={extraQueryParams}
|
|
104
109
|
bind:value={disabled}
|
|
105
110
|
bind:error={errors.disabled}
|
|
106
111
|
/>
|
|
@@ -109,6 +114,7 @@ async function handleClick(event) {
|
|
|
109
114
|
|
|
110
115
|
<RunnableWrapper
|
|
111
116
|
flexWrap
|
|
117
|
+
{recomputeIds}
|
|
112
118
|
bind:runnableComponent
|
|
113
119
|
{componentInput}
|
|
114
120
|
{id}
|
|
@@ -15,7 +15,7 @@ export let horizontalAlignment = undefined;
|
|
|
15
15
|
export let customCss = undefined;
|
|
16
16
|
export let render;
|
|
17
17
|
export const staticOutputs = ['loading', 'result'];
|
|
18
|
-
const { app,
|
|
18
|
+
const { app, worldStore, stateId } = getContext('AppViewerContext');
|
|
19
19
|
let labelValue = 'Default label';
|
|
20
20
|
let color;
|
|
21
21
|
let size;
|
|
@@ -30,6 +30,7 @@ $: if (outputs?.loading != undefined) {
|
|
|
30
30
|
outputs.loading.set(false, true);
|
|
31
31
|
}
|
|
32
32
|
$: outputs?.loading.subscribe({
|
|
33
|
+
id: 'loading-' + id,
|
|
33
34
|
next: (value) => {
|
|
34
35
|
isLoading = value;
|
|
35
36
|
}
|
|
@@ -43,6 +44,7 @@ $: css = concatCustomCss($app.css?.formcomponent, customCss);
|
|
|
43
44
|
<InputValue {id} input={configuration.size} bind:value={size} />
|
|
44
45
|
|
|
45
46
|
<RunnableWrapper
|
|
47
|
+
{recomputeIds}
|
|
46
48
|
{render}
|
|
47
49
|
bind:runnableComponent
|
|
48
50
|
{componentInput}
|
|
@@ -84,12 +86,6 @@ $: css = concatCustomCss($app.css?.formcomponent, customCss);
|
|
|
84
86
|
}}
|
|
85
87
|
on:click={() => {
|
|
86
88
|
runnableComponent?.runComponent()
|
|
87
|
-
|
|
88
|
-
if (recomputeIds) {
|
|
89
|
-
recomputeIds.forEach((id) => {
|
|
90
|
-
$runnableComponents[id]?.()
|
|
91
|
-
})
|
|
92
|
-
}
|
|
93
89
|
}}
|
|
94
90
|
{size}
|
|
95
91
|
{color}
|
|
@@ -38,6 +38,7 @@ $: if (outputs?.loading != undefined) {
|
|
|
38
38
|
outputs.loading.set(false, true);
|
|
39
39
|
}
|
|
40
40
|
$: outputs?.loading.subscribe({
|
|
41
|
+
id: 'loading-' + id,
|
|
41
42
|
next: (value) => {
|
|
42
43
|
isLoading = value;
|
|
43
44
|
if (ownClick && !value) {
|
|
@@ -73,6 +74,7 @@ $: css = concatCustomCss($app?.css?.formbuttoncomponent, customCss);
|
|
|
73
74
|
}}
|
|
74
75
|
>
|
|
75
76
|
<RunnableWrapper
|
|
77
|
+
{recomputeIds}
|
|
76
78
|
{render}
|
|
77
79
|
bind:runnableComponent
|
|
78
80
|
{componentInput}
|
|
@@ -107,12 +109,6 @@ $: css = concatCustomCss($app?.css?.formbuttoncomponent, customCss);
|
|
|
107
109
|
on:click={async () => {
|
|
108
110
|
await runnableComponent?.runComponent()
|
|
109
111
|
|
|
110
|
-
if (recomputeIds) {
|
|
111
|
-
recomputeIds.forEach((id) => {
|
|
112
|
-
$runnableComponents[id]?.()
|
|
113
|
-
})
|
|
114
|
-
}
|
|
115
|
-
|
|
116
112
|
open = false
|
|
117
113
|
}}
|
|
118
114
|
size="xs"
|