windmill-components 1.55.0 → 1.55.2
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/common.d.ts +1 -1
- package/common.js +3 -0
- package/components/AppConnect.svelte +2 -2
- package/components/ArgInput.svelte +1 -1
- package/components/CronInput.svelte +54 -53
- package/components/Dropdown.svelte +21 -9
- package/components/Editor.svelte +10 -10
- package/components/EditorBar.svelte +2 -2
- package/components/FlowBuilder.svelte +41 -25
- package/components/FlowGraphViewer.svelte +6 -2
- package/components/FlowMetadata.svelte +8 -3
- package/components/FlowViewer.svelte +2 -2
- package/components/FolderEditor.svelte +299 -0
- package/components/FolderEditor.svelte.d.ts +16 -0
- package/components/FolderInfo.svelte +13 -0
- package/components/FolderInfo.svelte.d.ts +16 -0
- package/components/FolderUsageInfo.svelte +17 -0
- package/components/FolderUsageInfo.svelte.d.ts +16 -0
- package/components/GroupEditor.svelte +287 -0
- package/components/GroupEditor.svelte.d.ts +18 -0
- package/components/GroupInfo.svelte +22 -0
- package/components/GroupInfo.svelte.d.ts +16 -0
- package/components/InputTransformForm.svelte +16 -7
- package/components/MoveDrawer.svelte +75 -0
- package/components/MoveDrawer.svelte.d.ts +19 -0
- package/components/Path.svelte +243 -96
- package/components/Path.svelte.d.ts +1 -4
- package/components/RadioButton.svelte +2 -0
- package/components/RadioButton.svelte.d.ts +1 -0
- package/components/ResourceEditor.svelte +11 -16
- package/components/RunForm.svelte +21 -4
- package/components/RunForm.svelte.d.ts +1 -1
- package/components/ScheduleEditor.svelte +226 -0
- package/components/ScheduleEditor.svelte.d.ts +26 -0
- package/components/ScriptBuilder.svelte +109 -114
- package/components/ScriptEditor.svelte +17 -14
- package/components/ScriptEditor.svelte.d.ts +1 -0
- package/components/ScriptPicker.svelte +55 -29
- package/components/ScriptPicker.svelte.d.ts +1 -0
- package/components/ShareModal.svelte +94 -73
- package/components/ShareModal.svelte.d.ts +2 -4
- package/components/SimpleEditor.svelte +15 -10
- package/components/TemplateEditor.svelte +496 -0
- package/components/TemplateEditor.svelte.d.ts +25 -0
- package/components/TestJobLoader.svelte +1 -1
- package/components/VariableEditor.svelte +2 -1
- package/components/apps/CreateApp.svelte +1 -1
- package/components/apps/components/buttons/AppButton.svelte +3 -3
- package/components/apps/components/dataDisplay/AppBarChart.svelte +5 -4
- package/components/apps/components/dataDisplay/AppPieChart.svelte +3 -3
- package/components/apps/components/dateInputs/AppDateInput.svelte +34 -0
- package/components/apps/components/dateInputs/AppDateInput.svelte.d.ts +22 -0
- package/components/apps/components/form/AppForm.svelte +4 -5
- package/components/apps/components/form/AppForm.svelte.d.ts +0 -1
- package/components/apps/components/helpers/AlignWrapper.svelte +3 -4
- package/components/apps/components/helpers/AlignWrapper.svelte.d.ts +2 -3
- package/components/apps/components/helpers/InputValue.svelte +54 -5
- package/components/apps/components/helpers/InputValue.svelte.d.ts +1 -0
- package/components/apps/components/helpers/NonRunnableComponent.svelte +2 -1
- package/components/apps/components/helpers/RefreshButton.svelte +20 -0
- package/components/apps/components/helpers/RefreshButton.svelte.d.ts +16 -0
- package/components/apps/components/helpers/RunnableComponent.svelte +38 -42
- package/components/apps/components/helpers/RunnableWrapper.svelte +6 -3
- package/components/apps/components/numberInputs/AppNumberInput.svelte +8 -11
- package/components/apps/components/numberInputs/AppNumberInput.svelte.d.ts +1 -0
- package/components/apps/components/selectInputs/AppCheckbox.svelte +1 -1
- package/components/apps/components/selectInputs/AppSelect.svelte +26 -0
- package/components/apps/components/selectInputs/AppSelect.svelte.d.ts +22 -0
- package/components/apps/components/table/AppTable.svelte +159 -0
- package/components/apps/components/{dataDisplay → table}/AppTable.svelte.d.ts +0 -0
- package/components/apps/components/table/AppTableFooter.svelte +54 -0
- package/components/apps/components/table/AppTableFooter.svelte.d.ts +20 -0
- package/components/apps/components/table/tableOptions.d.ts +10 -0
- package/components/apps/components/table/tableOptions.js +11 -0
- package/components/apps/components/textInputs/AppTextInput.svelte +17 -10
- package/components/apps/components/textInputs/AppTextInput.svelte.d.ts +2 -0
- package/components/apps/editor/AppEditor.svelte +35 -20
- package/components/apps/editor/AppEditorHeader.svelte +15 -7
- package/components/apps/editor/AppPreview.svelte +5 -3
- package/components/apps/editor/AppPreview.svelte.d.ts +4 -1
- package/components/apps/editor/ComponentEditor.svelte +21 -3
- package/components/apps/editor/ComponentEditor.svelte.d.ts +2 -0
- package/components/apps/editor/ComponentHeader.svelte +21 -4
- package/components/apps/editor/ComponentHeader.svelte.d.ts +2 -0
- package/components/apps/editor/GridEditor.svelte +40 -20
- package/components/apps/editor/RecomputeAllComponents.svelte +5 -7
- package/components/apps/editor/componentsPanel/ComponentList.svelte +30 -82
- package/components/apps/editor/componentsPanel/data.js +78 -29
- package/components/apps/editor/contextPanel/ComponentOutputViewer.svelte +5 -1
- package/components/apps/editor/contextPanel/ContextPanel.svelte +35 -152
- package/components/apps/editor/contextPanel/ContextPanel.svelte.d.ts +1 -3
- package/components/apps/editor/inlineScriptsPanel/EmptyInlineScript.svelte +64 -0
- package/components/apps/editor/inlineScriptsPanel/EmptyInlineScript.svelte.d.ts +18 -0
- package/components/apps/editor/inlineScriptsPanel/InlineScriptEditor.svelte +95 -0
- package/components/apps/editor/inlineScriptsPanel/InlineScriptEditor.svelte.d.ts +20 -0
- package/components/apps/editor/inlineScriptsPanel/InlineScriptEditorDrawer.svelte +32 -0
- package/components/apps/editor/inlineScriptsPanel/InlineScriptEditorDrawer.svelte.d.ts +19 -0
- package/components/apps/editor/inlineScriptsPanel/InlineScriptEditorPanel.svelte +63 -0
- package/components/apps/editor/inlineScriptsPanel/InlineScriptEditorPanel.svelte.d.ts +17 -0
- package/components/apps/editor/inlineScriptsPanel/InlineScriptsPanel.svelte +44 -0
- package/components/apps/editor/inlineScriptsPanel/InlineScriptsPanel.svelte.d.ts +14 -0
- package/components/apps/editor/inlineScriptsPanel/InlineScriptsPanelList.svelte +126 -0
- package/components/apps/editor/inlineScriptsPanel/InlineScriptsPanelList.svelte.d.ts +16 -0
- package/components/apps/editor/settingsPanel/AlignmentEditor.svelte +41 -0
- package/components/apps/editor/settingsPanel/AlignmentEditor.svelte.d.ts +17 -0
- package/components/apps/editor/settingsPanel/ComponentInputTypeEditor.svelte +44 -0
- package/components/apps/editor/settingsPanel/ComponentInputTypeEditor.svelte.d.ts +18 -0
- package/components/apps/editor/settingsPanel/ComponentPanel.svelte +48 -130
- package/components/apps/editor/settingsPanel/ComponentPanel.svelte.d.ts +3 -0
- package/components/apps/editor/settingsPanel/InputsSpecEditor.svelte +2 -2
- package/components/apps/editor/settingsPanel/InputsSpecsEditor.svelte +1 -1
- package/components/apps/editor/settingsPanel/Recompute.svelte +2 -2
- package/components/apps/editor/settingsPanel/SelectedRunnable.svelte +46 -0
- package/components/apps/editor/settingsPanel/SelectedRunnable.svelte.d.ts +17 -0
- package/components/apps/editor/settingsPanel/SubTypeEditor.svelte +1 -1
- package/components/apps/editor/settingsPanel/common/PanelSection.svelte +1 -1
- package/components/apps/editor/settingsPanel/{ConnectedInputEditor.svelte → inputEditor/ConnectedInputEditor.svelte} +1 -2
- package/components/apps/editor/settingsPanel/{ConnectedInputEditor.svelte.d.ts → inputEditor/ConnectedInputEditor.svelte.d.ts} +1 -1
- package/components/apps/editor/settingsPanel/inputEditor/RunnableInputEditor.svelte +12 -0
- package/components/apps/editor/settingsPanel/inputEditor/RunnableInputEditor.svelte.d.ts +17 -0
- package/components/apps/editor/settingsPanel/{StaticInputEditor.svelte → inputEditor/StaticInputEditor.svelte} +5 -5
- package/components/apps/editor/settingsPanel/{StaticInputEditor.svelte.d.ts → inputEditor/StaticInputEditor.svelte.d.ts} +1 -1
- package/components/apps/editor/settingsPanel/mainInput/InlineScriptList.svelte +6 -3
- package/components/apps/editor/settingsPanel/mainInput/RunnableSelector.svelte +66 -22
- package/components/apps/editor/settingsPanel/mainInput/RunnableSelector.svelte.d.ts +2 -3
- package/components/apps/editor/settingsPanel/mainInput/WorkspaceFlowList.svelte +1 -1
- package/components/apps/gridUtils.d.ts +3 -1
- package/components/apps/gridUtils.js +16 -1
- package/components/apps/inputType.d.ts +10 -4
- package/components/apps/rx.d.ts +8 -8
- package/components/apps/rx.js +17 -9
- package/components/apps/types.d.ts +14 -2
- package/components/apps/utils.d.ts +4 -3
- package/components/apps/utils.js +37 -5
- package/components/common/drawer/Drawer.svelte +1 -1
- package/components/common/drawer/Drawer.svelte.d.ts +1 -0
- package/components/common/popup/Popup.svelte +0 -2
- package/components/common/popup/Popup.svelte.d.ts +0 -4
- package/components/common/table/FlowRow.svelte +21 -7
- package/components/common/table/FlowRow.svelte.d.ts +2 -0
- package/components/common/table/ScriptRow.svelte +22 -7
- package/components/common/table/ScriptRow.svelte.d.ts +2 -0
- package/components/common/toggleButton/ToggleButton.svelte +1 -1
- package/components/common/toggleButton/ToggleButtonGroup.svelte +1 -1
- package/components/common/toggleButton/ToggleButtonGroup.svelte.d.ts +1 -0
- package/components/flows/content/FlowEditorPanel.svelte +10 -16
- package/components/flows/content/FlowInputs.svelte +18 -4
- package/components/flows/content/FlowInputs.svelte.d.ts +1 -0
- package/components/flows/content/FlowModuleComponent.svelte +1 -1
- package/components/flows/content/FlowModuleWrapper.svelte +26 -1
- package/components/flows/content/FlowSchedules.svelte +5 -0
- package/components/flows/content/FlowSettings.svelte +16 -24
- package/components/flows/content/FlowSettings.svelte.d.ts +0 -1
- package/components/flows/header/FlowPreviewButtons.svelte +13 -10
- package/components/flows/map/FlowErrorHandlerItem.svelte +1 -1
- package/components/flows/map/FlowModuleSchemaMap.svelte +12 -3
- package/components/flows/map/FlowSettingsItem.svelte +8 -15
- package/components/flows/map/InsertModuleButton.svelte +29 -2
- package/components/flows/map/InsertModuleButton.svelte.d.ts +3 -1
- package/components/flows/map/MapItem.svelte +2 -1
- package/components/flows/map/MapItem.svelte.d.ts +1 -0
- package/components/flows/pickers/WorkspaceScriptPicker.svelte +3 -0
- package/components/flows/previousResults.js +1 -1
- package/components/graph/FlowGraph.svelte +15 -15
- package/components/graph/model.d.ts +35 -1
- package/components/home/ItemsList.svelte +20 -12
- package/components/jobs/JobDetail.svelte +9 -3
- package/components/sidebar/SidebarContent.svelte +4 -3
- package/components/sidebar/UserMenu.svelte +1 -1
- package/editorUtils.d.ts +7 -1
- package/editorUtils.js +98 -3
- package/es5.d.ts.txt +4526 -0
- package/gen/index.d.ts +2 -0
- package/gen/index.js +1 -0
- package/gen/models/CompletedJob.d.ts +1 -0
- package/gen/models/EditSchedule.d.ts +0 -2
- package/gen/models/Folder.d.ts +5 -0
- package/gen/models/Folder.js +4 -0
- package/gen/models/QueuedJob.d.ts +1 -0
- package/gen/models/Script.d.ts +1 -1
- package/gen/models/User.d.ts +1 -0
- package/gen/services/FolderService.d.ts +128 -0
- package/gen/services/FolderService.js +151 -0
- package/gen/services/GranularAclService.d.ts +3 -3
- package/gen/services/GroupService.d.ts +5 -1
- package/gen/services/GroupService.js +4 -1
- package/gen/services/JobService.d.ts +25 -5
- package/gen/services/JobService.js +10 -5
- package/gen/services/ScriptService.d.ts +2 -1
- package/gen/services/UserService.d.ts +9 -0
- package/gen/services/UserService.js +15 -0
- package/package.json +485 -461
- package/script_helpers.d.ts +2 -2
- package/script_helpers.js +4 -4
- package/stores.d.ts +1 -0
- package/utils.d.ts +3 -0
- package/utils.js +44 -7
- package/components/GroupModal.svelte +0 -98
- package/components/GroupModal.svelte.d.ts +0 -17
- package/components/apps/components/dataDisplay/AppTable.svelte +0 -132
- package/components/apps/components/dataDisplay/app.md +0 -49
- package/components/apps/editor/contextPanel/InlineScriptCreationPanel.svelte +0 -29
- package/components/apps/editor/contextPanel/InlineScriptCreationPanel.svelte.d.ts +0 -16
|
@@ -174,7 +174,7 @@ afterUpdate(() => {
|
|
|
174
174
|
<Tabs bind:selected>
|
|
175
175
|
<Tab value="inputs"><span class="font-semibold">Step Input</span></Tab>
|
|
176
176
|
<Tab value="test"><span class="font-semibold text-md">Test this step</span></Tab>
|
|
177
|
-
<Tab value="advanced">Advanced</Tab>
|
|
177
|
+
<Tab value="advanced-retries">Advanced</Tab>
|
|
178
178
|
</Tabs>
|
|
179
179
|
<div class="h-[calc(100%-32px)]">
|
|
180
180
|
{#if selected === 'inputs'}
|
|
@@ -11,7 +11,7 @@ import { Alert } from '../../common';
|
|
|
11
11
|
import FlowInputsFlow from './FlowInputsFlow.svelte';
|
|
12
12
|
import FlowBranchesAllWrapper from './FlowBranchesAllWrapper.svelte';
|
|
13
13
|
import FlowBranchesOneWrapper from './FlowBranchesOneWrapper.svelte';
|
|
14
|
-
const { selectedId } = getContext('FlowEditorContext');
|
|
14
|
+
const { selectedId, schedule } = getContext('FlowEditorContext');
|
|
15
15
|
export let flowModule;
|
|
16
16
|
// These pointers are used to easily access previewArgs of parent module, and previous module
|
|
17
17
|
// Pointer to parent module, only defined within Branches or Loops.
|
|
@@ -52,6 +52,7 @@ export let previousModule = undefined;
|
|
|
52
52
|
/>
|
|
53
53
|
{:else}
|
|
54
54
|
<FlowInputs
|
|
55
|
+
summary={flowModule.summary}
|
|
55
56
|
shouldDisableTriggerScripts={parentModule !== undefined ||
|
|
56
57
|
previousModule !== undefined ||
|
|
57
58
|
$selectedId == 'failure'}
|
|
@@ -63,6 +64,18 @@ export let previousModule = undefined;
|
|
|
63
64
|
module.suspend = { required_events: 1, timeout: 1800 }
|
|
64
65
|
}
|
|
65
66
|
|
|
67
|
+
if (kind == Script.kind.TRIGGER) {
|
|
68
|
+
if (!$schedule.cron) {
|
|
69
|
+
$schedule.cron = '0 */15 * * *'
|
|
70
|
+
}
|
|
71
|
+
$schedule.enabled = true
|
|
72
|
+
|
|
73
|
+
module.stop_after_if = {
|
|
74
|
+
expr: 'result == undefined || Array.isArray(result) && result.length == 0',
|
|
75
|
+
skip_if_stopped: true
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
66
79
|
flowModule = module
|
|
67
80
|
$flowStateStore[module.id] = state
|
|
68
81
|
}}
|
|
@@ -76,6 +89,18 @@ export let previousModule = undefined;
|
|
|
76
89
|
flowModule.id
|
|
77
90
|
)
|
|
78
91
|
|
|
92
|
+
if (kind == Script.kind.TRIGGER) {
|
|
93
|
+
if (!$schedule.cron) {
|
|
94
|
+
$schedule.cron = '0 */15 * * *'
|
|
95
|
+
}
|
|
96
|
+
$schedule.enabled = true
|
|
97
|
+
|
|
98
|
+
module.stop_after_if = {
|
|
99
|
+
expr: 'result == undefined || Array.isArray(result) && result.length == 0',
|
|
100
|
+
skip_if_stopped: true
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
79
104
|
if (kind == Script.kind.APPROVAL) {
|
|
80
105
|
module.suspend = { required_events: 1, timeout: 1800 }
|
|
81
106
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script>import CronInput from '../../CronInput.svelte';
|
|
2
2
|
import SchemaForm from '../../SchemaForm.svelte';
|
|
3
3
|
import Toggle from '../../Toggle.svelte';
|
|
4
|
+
import { emptyString } from '../../../utils';
|
|
4
5
|
import { getContext } from 'svelte';
|
|
5
6
|
import { flowStore } from '../flowStore';
|
|
6
7
|
const { schedule } = getContext('FlowEditorContext');
|
|
@@ -8,7 +9,11 @@ const { schedule } = getContext('FlowEditorContext');
|
|
|
8
9
|
|
|
9
10
|
<CronInput bind:schedule={$schedule.cron} />
|
|
10
11
|
<SchemaForm schema={$flowStore.schema} bind:args={$schedule.args} />
|
|
12
|
+
{#if emptyString($schedule.cron)}
|
|
13
|
+
<p class="text-xs text-gray-600 mt-10">Define a schedule frequency first</p>
|
|
14
|
+
{/if}
|
|
11
15
|
<Toggle
|
|
16
|
+
disabled={emptyString($schedule.cron)}
|
|
12
17
|
bind:checked={$schedule.enabled}
|
|
13
18
|
options={{
|
|
14
19
|
right: 'Schedule enabled'
|
|
@@ -10,23 +10,23 @@ import Toggle from '../../Toggle.svelte';
|
|
|
10
10
|
import { Alert } from '../../common';
|
|
11
11
|
import { FlowGraph } from '../../graph';
|
|
12
12
|
import { getContext } from 'svelte';
|
|
13
|
+
import autosize from 'svelte-autosize';
|
|
13
14
|
const { selectedId } = getContext('FlowEditorContext');
|
|
14
15
|
export let initialPath;
|
|
15
|
-
export let defaultTab = 'metadata';
|
|
16
16
|
let topHeight = 0;
|
|
17
17
|
</script>
|
|
18
18
|
|
|
19
19
|
<div class="h-full overflow-hidden">
|
|
20
20
|
<FlowCard title="Settings">
|
|
21
21
|
<div class="h-full flex-1">
|
|
22
|
-
<Tabs selected={
|
|
23
|
-
<Tab value="metadata">Metadata</Tab>
|
|
24
|
-
<Tab value="schedule">Schedule</Tab>
|
|
25
|
-
<Tab value="same-worker">Shared Directory</Tab>
|
|
26
|
-
<Tab value="graph">Graph</Tab>
|
|
22
|
+
<Tabs bind:selected={$selectedId}>
|
|
23
|
+
<Tab value="settings-metadata">Metadata</Tab>
|
|
24
|
+
<Tab value="settings-schedule">Schedule</Tab>
|
|
25
|
+
<Tab value="settings-same-worker">Shared Directory</Tab>
|
|
26
|
+
<Tab value="settings-graph">Graph</Tab>
|
|
27
27
|
|
|
28
28
|
<svelte:fragment slot="content">
|
|
29
|
-
<TabContent value="metadata" class="p-4">
|
|
29
|
+
<TabContent value="settings-metadata" class="p-4">
|
|
30
30
|
<Path bind:path={$flowStore.path} {initialPath} namePlaceholder="my_flow" kind="flow" />
|
|
31
31
|
|
|
32
32
|
<label class="block my-4">
|
|
@@ -43,30 +43,20 @@ let topHeight = 0;
|
|
|
43
43
|
<label class="block my-4" for="inp">
|
|
44
44
|
<span class="text-gray-700 text-sm">
|
|
45
45
|
Description
|
|
46
|
-
<Required required={false}
|
|
46
|
+
<Required required={false} />
|
|
47
47
|
<textarea
|
|
48
|
+
use:autosize
|
|
48
49
|
type="text"
|
|
49
50
|
class="text-sm"
|
|
50
51
|
id="inp"
|
|
51
52
|
bind:value={$flowStore.description}
|
|
52
|
-
placeholder="A description to help users understand what this flow does and how to use it.
|
|
53
|
+
placeholder="A description to help users understand what this flow does and how to use it."
|
|
53
54
|
rows="3"
|
|
54
55
|
/>
|
|
55
56
|
</span>
|
|
56
57
|
</label>
|
|
57
|
-
|
|
58
|
-
<div>
|
|
59
|
-
<div class="font-bold pb-1 mt-4">Description preview</div>
|
|
60
|
-
{#if $flowStore.description}
|
|
61
|
-
<div class="prose max-h-48 mt-5 text-xs shadow-inner shadow-blue p-4 overflow-auto">
|
|
62
|
-
{$flowStore.description}
|
|
63
|
-
</div>
|
|
64
|
-
{:else}
|
|
65
|
-
<div class="text-sm text-gray-500"> Enter a description to see the preview </div>
|
|
66
|
-
{/if}
|
|
67
|
-
</div>
|
|
68
58
|
</TabContent>
|
|
69
|
-
<TabContent value="schedule" class="p-4">
|
|
59
|
+
<TabContent value="settings-schedule" class="p-4">
|
|
70
60
|
<Alert type="info" title="Primary Schedule">
|
|
71
61
|
Flows can be triggered by any schedules, their webhooks or their UI but they only have
|
|
72
62
|
only one primary schedules with which they share the same path. The primary schedule
|
|
@@ -76,7 +66,7 @@ let topHeight = 0;
|
|
|
76
66
|
<FlowSchedules />
|
|
77
67
|
</TabContent>
|
|
78
68
|
|
|
79
|
-
<TabContent value="same-worker" class="p-4 flex flex-col">
|
|
69
|
+
<TabContent value="settings-same-worker" class="p-4 flex flex-col">
|
|
80
70
|
<Alert type="info" title="Shared Directory">
|
|
81
71
|
Steps will share a folder at `./shared` in which they can store heavier data and pass
|
|
82
72
|
them to the next step. <br /><br />Beware that the `./shared` folder is not preserved
|
|
@@ -90,7 +80,7 @@ let topHeight = 0;
|
|
|
90
80
|
}}
|
|
91
81
|
/>
|
|
92
82
|
</TabContent>
|
|
93
|
-
<TabContent value="graph">
|
|
83
|
+
<TabContent value="settings-graph">
|
|
94
84
|
<div
|
|
95
85
|
bind:clientHeight={topHeight}
|
|
96
86
|
class="max-w-full w-full overflow-hidden h-screen bg-gray-50"
|
|
@@ -98,7 +88,9 @@ let topHeight = 0;
|
|
|
98
88
|
{#if $flowStore.value.modules}
|
|
99
89
|
<FlowGraph
|
|
100
90
|
on:click={(e) => {
|
|
101
|
-
|
|
91
|
+
if (e.detail.id) {
|
|
92
|
+
$selectedId = e.detail.id
|
|
93
|
+
}
|
|
102
94
|
}}
|
|
103
95
|
minHeight={topHeight}
|
|
104
96
|
modules={$flowStore.value.modules}
|
|
@@ -10,16 +10,19 @@ let previewMode = 'whole';
|
|
|
10
10
|
let jobId = undefined;
|
|
11
11
|
let job = undefined;
|
|
12
12
|
$: upToDisabled =
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
13
|
+
$selectedId == undefined ||
|
|
14
|
+
[
|
|
15
|
+
'settings',
|
|
16
|
+
'settings-metadata',
|
|
17
|
+
'settings-schedule',
|
|
18
|
+
'settings-retries',
|
|
19
|
+
'settings-same-worker',
|
|
20
|
+
'settings-graph',
|
|
21
|
+
'inputs',
|
|
22
|
+
'schedules',
|
|
23
|
+
'failure'
|
|
24
|
+
].includes($selectedId) ||
|
|
25
|
+
$selectedId?.includes('branch');
|
|
23
26
|
</script>
|
|
24
27
|
|
|
25
28
|
<div class="flex flex-row-reverse justify-between items-center gap-x-2">
|
|
@@ -11,7 +11,7 @@ function onToggle() {
|
|
|
11
11
|
if ($flowStore?.value?.failure_module) {
|
|
12
12
|
$flowStore.value.failure_module = undefined;
|
|
13
13
|
// By default, we return to settings when disabling the failure module
|
|
14
|
-
select('settings');
|
|
14
|
+
select('settings-metadata');
|
|
15
15
|
}
|
|
16
16
|
else {
|
|
17
17
|
const failureModule = {
|
|
@@ -35,11 +35,17 @@ async function insertNewModuleAtIndex(index, kind) {
|
|
|
35
35
|
modules.splice(index, 0, flowModule);
|
|
36
36
|
modules = modules;
|
|
37
37
|
$flowStateStore[flowModule.id] = state;
|
|
38
|
+
if (kind == 'trigger') {
|
|
39
|
+
flowModule.summary = 'Trigger';
|
|
40
|
+
}
|
|
41
|
+
else if (kind == 'approval') {
|
|
42
|
+
flowModule.summary = 'Approval';
|
|
43
|
+
}
|
|
38
44
|
select(flowModule.id);
|
|
39
45
|
});
|
|
40
46
|
}
|
|
41
47
|
function removeAtIndex(index) {
|
|
42
|
-
select('settings');
|
|
48
|
+
select('settings-graph');
|
|
43
49
|
if (!modules)
|
|
44
50
|
return;
|
|
45
51
|
const [removedModule] = modules.splice(index, 1);
|
|
@@ -95,6 +101,7 @@ $: confirmationModalOpen = indexToRemove !== undefined;
|
|
|
95
101
|
{#each modules as mod, index (mod.id ?? index)}
|
|
96
102
|
<div transition:slide|local>
|
|
97
103
|
<MapItem
|
|
104
|
+
{index}
|
|
98
105
|
bind:mod
|
|
99
106
|
on:delete={(event) => {
|
|
100
107
|
if (event.detail.detail.shiftKey || mod.value.type === 'identity') {
|
|
@@ -110,8 +117,10 @@ $: confirmationModalOpen = indexToRemove !== undefined;
|
|
|
110
117
|
</div>
|
|
111
118
|
{/each}
|
|
112
119
|
{/if}
|
|
113
|
-
|
|
114
|
-
|
|
120
|
+
<InsertModuleButton
|
|
121
|
+
trigger={modules?.length == 0}
|
|
122
|
+
on:new={(e) => insertNewModuleAtIndex(modules?.length ?? 0, e.detail)}
|
|
123
|
+
/>
|
|
115
124
|
</ul>
|
|
116
125
|
{#if root}
|
|
117
126
|
<div class="sticky bottom-0 bg-gray-50 flex-none px-4 py-1 pb-2 border-t">
|
|
@@ -5,26 +5,19 @@ import { classNames } from '../../../utils';
|
|
|
5
5
|
import { Badge } from '../../common';
|
|
6
6
|
import { flowStore } from '../flowStore';
|
|
7
7
|
const { select, selectedId, schedule } = getContext('FlowEditorContext');
|
|
8
|
-
$: settingsClass = classNames('border w-full rounded-sm p-2 bg-white border-gray-400 text-sm cursor-pointer flex items-center', $selectedId
|
|
8
|
+
$: settingsClass = classNames('border w-full rounded-sm p-2 bg-white border-gray-400 text-sm cursor-pointer flex items-center', $selectedId?.startsWith('settings')
|
|
9
|
+
? 'outline outline-offset-1 outline-2 outline-slate-900'
|
|
10
|
+
: '');
|
|
9
11
|
</script>
|
|
10
12
|
|
|
11
13
|
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
|
12
|
-
<div on:click={() => select('settings')} class={settingsClass}>
|
|
14
|
+
<div on:click={() => select('settings-metadata')} class={settingsClass}>
|
|
13
15
|
<Icon data={faSliders} class="mr-2" />
|
|
14
16
|
<span class="text-xs font-bold flex flex-row justify-between w-full gap-2 items-center truncate">
|
|
15
17
|
Settings
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
{#if $schedule?.enabled}
|
|
21
|
-
<Badge color="gray" baseClass="truncate">
|
|
22
|
-
<Icon data={faCalendarAlt} scale={0.8} />
|
|
23
|
-
</Badge>
|
|
24
|
-
{/if}
|
|
25
|
-
{#if $flowStore.value.same_worker}
|
|
26
|
-
<Badge color="blue" baseClass="truncate">./shared</Badge>
|
|
27
|
-
{/if}
|
|
28
|
-
</span>
|
|
18
|
+
|
|
19
|
+
{#if $flowStore.value.same_worker}
|
|
20
|
+
<Badge color="blue" baseClass="truncate">./shared</Badge>
|
|
21
|
+
{/if}
|
|
29
22
|
</span>
|
|
30
23
|
</div>
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
<script>import { Menu } from '../../common';
|
|
2
|
-
import { faCode, faCodeBranch, faPlus, faBarsStaggered } from '@fortawesome/free-solid-svg-icons';
|
|
2
|
+
import { faCode, faCodeBranch, faPlus, faBarsStaggered, faBolt, faCheck } from '@fortawesome/free-solid-svg-icons';
|
|
3
3
|
import { createEventDispatcher } from 'svelte';
|
|
4
4
|
import Icon from 'svelte-awesome';
|
|
5
5
|
import { Repeat } from 'lucide-svelte';
|
|
6
6
|
const dispatch = createEventDispatcher();
|
|
7
|
+
export let trigger = false;
|
|
7
8
|
</script>
|
|
8
9
|
|
|
9
10
|
<Menu noMinW placement="bottom-start" let:close>
|
|
@@ -25,7 +26,33 @@ const dispatch = createEventDispatcher();
|
|
|
25
26
|
tabindex="-1"
|
|
26
27
|
>
|
|
27
28
|
<Icon data={faCode} scale={0.8} class="mr-1" />
|
|
28
|
-
Script
|
|
29
|
+
Action (Script)
|
|
30
|
+
</button>
|
|
31
|
+
{#if trigger}
|
|
32
|
+
<button
|
|
33
|
+
class="w-full text-left p-2 hover:bg-gray-100"
|
|
34
|
+
on:click={() => {
|
|
35
|
+
close()
|
|
36
|
+
dispatch('new', 'trigger')
|
|
37
|
+
}}
|
|
38
|
+
role="menuitem"
|
|
39
|
+
tabindex="-1"
|
|
40
|
+
>
|
|
41
|
+
<Icon data={faBolt} scale={0.8} class="mr-1" />
|
|
42
|
+
Trigger (Script)
|
|
43
|
+
</button>
|
|
44
|
+
{/if}
|
|
45
|
+
<button
|
|
46
|
+
class="w-full text-left p-2 hover:bg-gray-100"
|
|
47
|
+
on:click={() => {
|
|
48
|
+
close()
|
|
49
|
+
dispatch('new', 'approval')
|
|
50
|
+
}}
|
|
51
|
+
role="menuitem"
|
|
52
|
+
tabindex="-1"
|
|
53
|
+
>
|
|
54
|
+
<Icon data={faCheck} scale={0.8} class="mr-1" />
|
|
55
|
+
Approval (Script)
|
|
29
56
|
</button>
|
|
30
57
|
<button
|
|
31
58
|
class="w-full inline-flex gap-1 text-left p-2 hover:bg-gray-100"
|
|
@@ -10,6 +10,7 @@ import IconedResourceType from '../../IconedResourceType.svelte';
|
|
|
10
10
|
import LanguageIcon from '../../common/languageIcons/LanguageIcon.svelte';
|
|
11
11
|
import { Building, Repeat } from 'lucide-svelte';
|
|
12
12
|
export let mod;
|
|
13
|
+
export let index;
|
|
13
14
|
const { select, selectedId } = getContext('FlowEditorContext');
|
|
14
15
|
const dispatch = createEventDispatcher();
|
|
15
16
|
$: itemProps = {
|
|
@@ -25,7 +26,7 @@ function onDelete(event) {
|
|
|
25
26
|
</script>
|
|
26
27
|
|
|
27
28
|
{#if mod}
|
|
28
|
-
<InsertModuleButton on:new={(e) => dispatch('insert', e.detail)} />
|
|
29
|
+
<InsertModuleButton trigger={index == 0} on:new={(e) => dispatch('insert', e.detail)} />
|
|
29
30
|
{#if mod.value.type === 'forloopflow'}
|
|
30
31
|
<li class="w-full">
|
|
31
32
|
<FlowModuleSchemaItem
|
|
@@ -19,6 +19,9 @@ async function loadItems() {
|
|
|
19
19
|
items = await ScriptService.listScripts({ workspace: $workspaceStore, kind, isTemplate });
|
|
20
20
|
}
|
|
21
21
|
let ownerFilter = undefined;
|
|
22
|
+
$: if ($workspaceStore) {
|
|
23
|
+
ownerFilter = undefined;
|
|
24
|
+
}
|
|
22
25
|
$: prefilteredItems = ownerFilter ? items?.filter((x) => x.path.startsWith(ownerFilter)) : items;
|
|
23
26
|
$: owners = Array.from(new Set(filteredItems?.map((x) => x.path.split('/').slice(0, 2).join('/')) ?? [])).sort();
|
|
24
27
|
const dispatch = createEventDispatcher();
|
|
@@ -91,7 +91,7 @@ export function buildExtraLib(flowInput, results) {
|
|
|
91
91
|
return `
|
|
92
92
|
/**
|
|
93
93
|
* get variable (including secret) at path
|
|
94
|
-
* @param {string} path - path of the variable (e.g:
|
|
94
|
+
* @param {string} path - path of the variable (e.g: f/examples/secret)
|
|
95
95
|
*/
|
|
96
96
|
declare function variable(path: string): string;
|
|
97
97
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<script>import Svelvet
|
|
1
|
+
<script>import Svelvet from '@windmill-labs/svelvet';
|
|
2
2
|
import { sugiyama, dagStratify, decrossOpt, coordCenter } from 'd3-dag';
|
|
3
3
|
import { FlowStatusModule, RawScript } from '../../gen';
|
|
4
4
|
import { NODE, createIdGenerator, isNode, isLoop, isBranch } from '.';
|
|
@@ -57,32 +57,32 @@ async function createGraph() {
|
|
|
57
57
|
height = layered.height;
|
|
58
58
|
edges = createEdges(nodes);
|
|
59
59
|
}
|
|
60
|
-
function getConvertedFlowModule(module, parent = undefined, edgeLabel = undefined) {
|
|
60
|
+
function getConvertedFlowModule(module, parent = undefined, edgeLabel = undefined, insideLoop = false) {
|
|
61
61
|
const type = module.value.type;
|
|
62
62
|
const parentIds = getParentIds(parent);
|
|
63
63
|
if (type === 'rawscript') {
|
|
64
64
|
const lang = module.value.language;
|
|
65
|
-
return flowModuleToNode(parentIds, module.id, module.summary || 'Inline script', 'inline', module, lang, edgeLabel);
|
|
65
|
+
return flowModuleToNode(parentIds, module.id, module.summary || 'Inline script', 'inline', module, lang, edgeLabel, undefined, insideLoop);
|
|
66
66
|
}
|
|
67
67
|
else if (type === 'script') {
|
|
68
68
|
const isHub = module.value.path.startsWith('hub/');
|
|
69
|
-
return flowModuleToNode(parentIds, module.id, module.summary || module.value.path, isHub ? 'hub' : 'workspace', module, undefined, edgeLabel);
|
|
69
|
+
return flowModuleToNode(parentIds, module.id, module.summary || module.value.path, isHub ? 'hub' : 'workspace', module, undefined, edgeLabel, undefined, insideLoop);
|
|
70
70
|
}
|
|
71
71
|
else if (type === 'forloopflow') {
|
|
72
72
|
return flowModuleToLoop(module.value.modules, module, parent);
|
|
73
73
|
}
|
|
74
74
|
else if (type === 'branchone') {
|
|
75
75
|
const branches = [module.value.default, ...module.value.branches.map((b) => b.modules)];
|
|
76
|
-
return flowModuleToBranch(module, branches, ['Default', ...module.value.branches.map((x) => `If ${truncateRev(x.expr, 20)}`)], parent);
|
|
76
|
+
return flowModuleToBranch(module, branches, ['Default', ...module.value.branches.map((x) => `If ${truncateRev(x.expr, 20)}`)], parent, insideLoop);
|
|
77
77
|
}
|
|
78
78
|
else if (type === 'branchall') {
|
|
79
79
|
const branches = module.value.branches.map((b) => b.modules);
|
|
80
|
-
return flowModuleToBranch(module, branches, [], parent);
|
|
80
|
+
return flowModuleToBranch(module, branches, [], parent, insideLoop);
|
|
81
81
|
}
|
|
82
82
|
else if (type === 'flow') {
|
|
83
|
-
return flowModuleToNode(parentIds, module.id, module.summary || 'Flow ' + module.value.path, 'inline', module, undefined, edgeLabel);
|
|
83
|
+
return flowModuleToNode(parentIds, module.id, module.summary || 'Flow ' + module.value.path, 'inline', module, undefined, edgeLabel, undefined, insideLoop);
|
|
84
84
|
}
|
|
85
|
-
return flowModuleToNode(parentIds, module.id, module.summary || 'Identity step', 'inline', module, undefined, edgeLabel);
|
|
85
|
+
return flowModuleToNode(parentIds, module.id, module.summary || 'Identity step', 'inline', module, undefined, edgeLabel, undefined, insideLoop);
|
|
86
86
|
}
|
|
87
87
|
function getParentIds(items = undefined) {
|
|
88
88
|
if (typeof items == 'string') {
|
|
@@ -119,7 +119,7 @@ function getStateColor(state) {
|
|
|
119
119
|
return '#fff';
|
|
120
120
|
}
|
|
121
121
|
}
|
|
122
|
-
function flowModuleToNode(parentIds, id, title, host, onClickDetail, lang, edgeLabel, header) {
|
|
122
|
+
function flowModuleToNode(parentIds, id, title, host, onClickDetail, lang, edgeLabel, header, insideLoop = false) {
|
|
123
123
|
const langImg = {
|
|
124
124
|
deno: '/icons/ts-lang.svg',
|
|
125
125
|
go: '/icons/go-lang.svg',
|
|
@@ -154,7 +154,7 @@ function flowModuleToNode(parentIds, id, title, host, onClickDetail, lang, edgeL
|
|
|
154
154
|
`
|
|
155
155
|
},
|
|
156
156
|
host,
|
|
157
|
-
width: NODE.width,
|
|
157
|
+
width: insideLoop ? NODE.width * 0.8 : NODE.width,
|
|
158
158
|
height: NODE.height,
|
|
159
159
|
borderColor: selectedNode == nodeId ? 'black' : '#999',
|
|
160
160
|
bgColor: selectedNode == nodeId ? '#f5f5f5' : getStateColor(flowModuleStates?.[nodeId]?.type),
|
|
@@ -183,18 +183,18 @@ function flowModuleToLoop(modules, module, parent = undefined) {
|
|
|
183
183
|
]
|
|
184
184
|
};
|
|
185
185
|
modules.forEach((module) => {
|
|
186
|
-
const item = getConvertedFlowModule(module, loop.items);
|
|
186
|
+
const item = getConvertedFlowModule(module, loop.items, undefined, true);
|
|
187
187
|
item && loop.items.push(item);
|
|
188
188
|
});
|
|
189
|
-
loop.items.push(createVirtualNode(getParentIds(loop.items), `Collect iterations' results of For Loop ${module.id}`, undefined, 1000));
|
|
189
|
+
loop.items.push(createVirtualNode(getParentIds(loop.items), `Collect iterations' results of For Loop ${module.id ?? ''}`, undefined, 1000));
|
|
190
190
|
return loop;
|
|
191
191
|
}
|
|
192
|
-
function flowModuleToBranch(module, branches, edgesLabel, parent = undefined) {
|
|
192
|
+
function flowModuleToBranch(module, branches, edgesLabel, parent = undefined, insideLoop = false) {
|
|
193
193
|
const branch = {
|
|
194
194
|
type: 'branch',
|
|
195
195
|
node: flowModuleToNode(getParentIds(parent), module.id, module.summary || module.value.type == 'branchall'
|
|
196
196
|
? 'Run all branches'
|
|
197
|
-
: 'Run one branch given predicate', 'inline', module, undefined),
|
|
197
|
+
: 'Run one branch given predicate', 'inline', module, undefined, undefined, undefined, insideLoop),
|
|
198
198
|
items: []
|
|
199
199
|
};
|
|
200
200
|
const branchParent = [numberToChars(branch.node.id)];
|
|
@@ -208,7 +208,7 @@ function flowModuleToBranch(module, branches, edgesLabel, parent = undefined) {
|
|
|
208
208
|
}
|
|
209
209
|
else {
|
|
210
210
|
modules.forEach((module) => {
|
|
211
|
-
const item = getConvertedFlowModule(module, items.length ? items : numberToChars(branch.node.id), edgesLabel[i]);
|
|
211
|
+
const item = getConvertedFlowModule(module, items.length ? items : numberToChars(branch.node.id), edgesLabel[i], insideLoop);
|
|
212
212
|
item && items.push(item);
|
|
213
213
|
});
|
|
214
214
|
}
|
|
@@ -1,5 +1,39 @@
|
|
|
1
1
|
import type { FlowStatusModule } from "../../gen";
|
|
2
|
-
|
|
2
|
+
export interface SvelvetNode<T = any> {
|
|
3
|
+
id: number;
|
|
4
|
+
position: {
|
|
5
|
+
x: number;
|
|
6
|
+
y: number;
|
|
7
|
+
};
|
|
8
|
+
data: T;
|
|
9
|
+
width: number;
|
|
10
|
+
height: number;
|
|
11
|
+
bgColor?: string;
|
|
12
|
+
fontSize?: number;
|
|
13
|
+
borderColor?: string;
|
|
14
|
+
parentNode?: number;
|
|
15
|
+
childNodes?: number[];
|
|
16
|
+
borderRadius?: number;
|
|
17
|
+
textColor?: string;
|
|
18
|
+
clickCallback?: Function;
|
|
19
|
+
image?: boolean;
|
|
20
|
+
src?: string;
|
|
21
|
+
sourcePosition?: 'left' | 'right' | 'top' | 'bottom';
|
|
22
|
+
targetPosition?: 'left' | 'right' | 'top' | 'bottom';
|
|
23
|
+
}
|
|
24
|
+
export interface Edge {
|
|
25
|
+
id: string;
|
|
26
|
+
source: number;
|
|
27
|
+
target: number;
|
|
28
|
+
label?: string;
|
|
29
|
+
labelBgColor?: string;
|
|
30
|
+
labelTextColor?: string;
|
|
31
|
+
edgeColor?: string;
|
|
32
|
+
type?: string;
|
|
33
|
+
animate?: boolean;
|
|
34
|
+
noHandle?: boolean;
|
|
35
|
+
arrow?: boolean;
|
|
36
|
+
}
|
|
3
37
|
export type ModuleHost = 'workspace' | 'inline' | 'hub';
|
|
4
38
|
export type Node = SvelvetNode & {
|
|
5
39
|
parentIds: string[];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script>import CenteredPage from '../CenteredPage.svelte';
|
|
2
2
|
import { AppService, FlowService, ListableApp, Script, ScriptService } from '../../gen';
|
|
3
|
-
import {
|
|
3
|
+
import { userStore, workspaceStore } from '../../stores';
|
|
4
4
|
import { Skeleton, ToggleButton, ToggleButtonGroup } from '../common';
|
|
5
5
|
import { canWrite } from '../../utils';
|
|
6
6
|
import ShareModal from '../ShareModal.svelte';
|
|
@@ -14,13 +14,14 @@ import ListFilters from './ListFilters.svelte';
|
|
|
14
14
|
import SearchItems from '../SearchItems.svelte';
|
|
15
15
|
import { Icon } from 'svelte-awesome';
|
|
16
16
|
import { faBarsStaggered } from '@fortawesome/free-solid-svg-icons';
|
|
17
|
+
import MoveDrawer from '../MoveDrawer.svelte';
|
|
17
18
|
let scripts;
|
|
18
19
|
let flows;
|
|
19
20
|
let apps;
|
|
20
21
|
let filteredItems = [];
|
|
21
22
|
let itemKind = 'all';
|
|
22
|
-
let
|
|
23
|
-
let
|
|
23
|
+
let shareModal;
|
|
24
|
+
let moveDrawer;
|
|
24
25
|
let loading = true;
|
|
25
26
|
async function loadScripts() {
|
|
26
27
|
const loadedScripts = await ScriptService.listScripts({
|
|
@@ -86,8 +87,11 @@ $: preFilteredItems =
|
|
|
86
87
|
? combinedItems?.filter((x) => x.path.startsWith(ownerFilter ?? '') && (x.type == itemKind || itemKind == 'all'))
|
|
87
88
|
: combinedItems?.filter((x) => x.type == itemKind || itemKind == 'all');
|
|
88
89
|
let ownerFilter = undefined;
|
|
90
|
+
$: if ($workspaceStore) {
|
|
91
|
+
ownerFilter = undefined;
|
|
92
|
+
}
|
|
89
93
|
$: {
|
|
90
|
-
if (
|
|
94
|
+
if ($userStore && $workspaceStore) {
|
|
91
95
|
loadScripts();
|
|
92
96
|
loadFlows();
|
|
93
97
|
loadApps();
|
|
@@ -145,17 +149,19 @@ $: items && resetScroll();
|
|
|
145
149
|
/>
|
|
146
150
|
|
|
147
151
|
<ShareModal
|
|
148
|
-
bind:this={
|
|
149
|
-
kind="script"
|
|
152
|
+
bind:this={shareModal}
|
|
150
153
|
on:change={() => {
|
|
151
154
|
loadScripts()
|
|
155
|
+
loadApps()
|
|
156
|
+
loadFlows()
|
|
152
157
|
}}
|
|
153
158
|
/>
|
|
154
159
|
|
|
155
|
-
<
|
|
156
|
-
bind:this={
|
|
157
|
-
|
|
158
|
-
|
|
160
|
+
<MoveDrawer
|
|
161
|
+
bind:this={moveDrawer}
|
|
162
|
+
on:update={() => {
|
|
163
|
+
loadScripts()
|
|
164
|
+
loadApps()
|
|
159
165
|
loadFlows()
|
|
160
166
|
}}
|
|
161
167
|
/>
|
|
@@ -237,7 +243,8 @@ $: items && resetScroll();
|
|
|
237
243
|
marked={item.marked}
|
|
238
244
|
on:change={loadScripts}
|
|
239
245
|
script={item}
|
|
240
|
-
shareModal
|
|
246
|
+
{shareModal}
|
|
247
|
+
{moveDrawer}
|
|
241
248
|
/>
|
|
242
249
|
{:else if item.type == 'flow'}
|
|
243
250
|
<FlowRow
|
|
@@ -245,7 +252,8 @@ $: items && resetScroll();
|
|
|
245
252
|
marked={item.marked}
|
|
246
253
|
on:change={loadFlows}
|
|
247
254
|
flow={item}
|
|
248
|
-
shareModal
|
|
255
|
+
{shareModal}
|
|
256
|
+
{moveDrawer}
|
|
249
257
|
/>
|
|
250
258
|
{:else if item.type == 'app'}
|
|
251
259
|
<AppRow
|
|
@@ -5,10 +5,14 @@ import { faCalendar, faCircle, faClock, faFastForward, faHourglassHalf, faRobot,
|
|
|
5
5
|
import Icon from 'svelte-awesome';
|
|
6
6
|
import { check } from 'svelte-awesome/icons';
|
|
7
7
|
import { Badge } from '../common';
|
|
8
|
+
import ScheduleEditor from '../ScheduleEditor.svelte';
|
|
8
9
|
const SMALL_ICON_SCALE = 0.7;
|
|
9
10
|
export let job;
|
|
11
|
+
let scheduleEditor;
|
|
10
12
|
</script>
|
|
11
13
|
|
|
14
|
+
<ScheduleEditor on:update={() => goto('/schedules')} bind:this={scheduleEditor} />
|
|
15
|
+
|
|
12
16
|
<div class="border border-gray-400 rounded py-4">
|
|
13
17
|
<div class="grid grid-cols-1 lg:grid-cols-3 w-full gap-4">
|
|
14
18
|
<div class="flex-col">
|
|
@@ -137,9 +141,11 @@ export let job;
|
|
|
137
141
|
{:else if job && job.schedule_path}
|
|
138
142
|
<Icon class="text-gray-700" data={faCalendar} scale={SMALL_ICON_SCALE} />
|
|
139
143
|
<span class="mx-2"
|
|
140
|
-
>Triggered by the schedule: <
|
|
141
|
-
|
|
142
|
-
|
|
144
|
+
>Triggered by the schedule: <button
|
|
145
|
+
class="break-words text-sm text-blue-600 font-normal"
|
|
146
|
+
on:click={() =>
|
|
147
|
+
scheduleEditor?.openEdit(job.schedule_path ?? '', job.job_kind == 'flow')}
|
|
148
|
+
>{job.schedule_path}</button
|
|
143
149
|
></span
|
|
144
150
|
>
|
|
145
151
|
{/if}
|