windmill-components 1.83.4 → 1.85.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/AppConnect.svelte +2 -2
- package/components/ArgInfo.svelte +4 -6
- package/components/ArgInput.svelte +12 -12
- package/components/ArgInput.svelte.d.ts +1 -2
- package/components/CronInput.svelte +1 -1
- package/components/DisplayResult.svelte +5 -7
- package/components/Dropdown.svelte +5 -4
- package/components/Editor.svelte +47 -47
- package/components/EditorBar.svelte +58 -27
- package/components/FlowBuilder.svelte +65 -59
- package/components/FlowGraphViewer.svelte +3 -8
- package/components/FlowPreviewContent.svelte +11 -9
- package/components/FlowStatusViewer.svelte +54 -44
- package/components/FolderEditor.svelte +2 -10
- package/components/FolderUsageInfo.svelte +1 -1
- package/components/GroupEditor.svelte +6 -15
- package/components/HighlightCode.svelte +1 -1
- package/components/InlineCodeCopy.svelte +2 -1
- package/components/InputTransformForm.svelte +1 -2
- package/components/InputTransformSchemaForm.svelte +1 -1
- package/components/InputTransformsViewer.svelte +1 -1
- package/components/LightweightArgInput.svelte +9 -0
- package/components/LightweightSchemaForm.svelte +1 -1
- package/components/Modal.svelte +2 -2
- package/components/ModulePreview.svelte +10 -10
- package/components/ModuleStatus.svelte +0 -1
- package/components/Multiselect.svelte +1 -0
- package/components/ObjectResourceInput.svelte +1 -23
- package/components/Path.svelte +42 -92
- package/components/Range.svelte +1 -4
- package/components/ResourceEditor.svelte +6 -6
- package/components/ResourcePicker.svelte +2 -2
- package/components/RunForm.svelte +5 -6
- package/components/ScheduleEditor.svelte +10 -10
- package/components/SchemaModal.svelte +1 -0
- package/components/SchemaModal.svelte.d.ts +1 -1
- package/components/ScriptEditor.svelte +0 -1
- package/components/SearchItems.svelte +1 -1
- package/components/SharedBadge.svelte +0 -1
- package/components/SimpleEditor.svelte +10 -36
- package/components/TemplateEditor.svelte +8 -29
- package/components/apps/components/display/AppBarChart.svelte +5 -5
- package/components/apps/components/display/AppImage.svelte +1 -1
- package/components/apps/components/display/AppPdf.svelte +12 -11
- package/components/apps/components/display/AppPdf.svelte.d.ts +1 -0
- package/components/apps/components/display/AppText.svelte +10 -10
- package/components/apps/components/display/table/AppAggridTable.svelte +25 -12
- package/components/apps/components/display/table/AppAggridTable.svelte.d.ts +1 -1
- package/components/apps/components/display/table/AppTable.svelte +1 -2
- package/components/apps/components/display/table/AppTableFooter.svelte +0 -1
- package/components/apps/components/helpers/NonRunnableComponent.svelte +1 -3
- package/components/apps/components/helpers/RunnableComponent.svelte +16 -0
- package/components/apps/components/helpers/eval.d.ts +4 -0
- package/components/apps/components/helpers/eval.js +3 -1
- package/components/apps/components/inputs/AppMultiSelect.svelte +2 -2
- package/components/apps/components/inputs/AppRangeInput.svelte +5 -5
- package/components/apps/components/inputs/AppTextInput.svelte +11 -7
- package/components/apps/components/layout/AppTabs.svelte +1 -1
- package/components/apps/editor/AppEditor.svelte +13 -17
- package/components/apps/editor/AppEditorHeader.svelte +37 -2
- package/components/apps/editor/SubGridEditor.svelte +5 -7
- package/components/apps/editor/appUtils.d.ts +2 -0
- package/components/apps/editor/appUtils.js +30 -1
- package/components/apps/editor/component/ComponentWrapper.svelte +6 -2
- package/components/apps/editor/componentsPanel/CssSettings.svelte +0 -2
- package/components/apps/editor/componentsPanel/QuickStyleMenu.svelte +2 -2
- package/components/apps/editor/contextPanel/ContextPanel.svelte +1 -2
- package/components/apps/editor/contextPanel/components/IdEditor.svelte +90 -0
- package/components/apps/editor/contextPanel/components/IdEditor.svelte.d.ts +18 -0
- package/components/apps/editor/contextPanel/components/OutputHeader.svelte +92 -21
- package/components/apps/editor/inlineScriptsPanel/InlineScriptsPanelList.svelte +3 -3
- package/components/apps/editor/settingsPanel/TableActions.svelte +1 -1
- package/components/apps/editor/settingsPanel/mainInput/WorkspaceFlowList.svelte +2 -5
- package/components/apps/editor/settingsPanel/mainInput/WorkspaceScriptList.svelte +2 -5
- package/components/apps/svelte-grid/utils/helper.js +1 -1
- package/components/apps/types.d.ts +6 -0
- package/components/apps/utils.d.ts +1 -3
- package/components/apps/utils.js +2 -30
- package/components/common/badge/Badge.svelte +0 -1
- package/components/common/button/ButtonPopup.svelte +13 -10
- package/components/common/drawer/Drawer.svelte +2 -2
- package/components/common/drawer/DrawerContent.svelte +1 -5
- package/components/common/popup/Popup.svelte +7 -3
- package/components/common/popup/Popup.svelte.d.ts +6 -0
- package/components/common/table/AppRow.svelte +0 -1
- package/components/common/table/FlowRow.svelte +0 -1
- package/components/common/table/ScriptRow.svelte +0 -1
- package/components/flows/CreateActionsApp.svelte +2 -2
- package/components/flows/content/DynamicInputHelpBox.svelte +1 -0
- package/components/flows/content/FlowBranchesAllWrapper.svelte +2 -2
- package/components/flows/content/FlowBranchesOneWrapper.svelte +2 -2
- package/components/flows/content/FlowInputsFlow.svelte +1 -1
- package/components/flows/content/FlowInputsFlow.svelte.d.ts +1 -3
- package/components/flows/content/FlowModuleComponent.svelte +26 -28
- package/components/flows/content/FlowModuleWrapper.svelte +0 -1
- package/components/flows/content/FlowRetries.svelte +1 -2
- package/components/flows/content/ScriptEditorDrawer.svelte +1 -1
- package/components/flows/flowStateUtils.d.ts +0 -3
- package/components/flows/flowStateUtils.js +3 -23
- package/components/flows/header/FlowPreviewButtons.svelte +0 -1
- package/components/flows/idUtils.d.ts +4 -0
- package/components/flows/idUtils.js +47 -0
- package/components/flows/map/FlowModuleSchemaItem.svelte +6 -6
- package/components/flows/map/MapItem.svelte +9 -9
- package/components/flows/map/MapItem.svelte.d.ts +0 -1
- package/components/flows/utils.d.ts +0 -2
- package/components/flows/utils.js +3 -35
- package/components/graph/FlowGraph.svelte +1 -1
- package/components/graph/svelvet/collapsible/controllers/util.js +3 -14
- package/components/graph/svelvet/container/views/GraphView.svelte +9 -14
- package/components/graph/svelvet/container/views/Svelvet.svelte +1 -0
- package/components/graph/svelvet/edges/controllers/anchorCbDev.js +5 -5
- package/components/graph/svelvet/edges/controllers/util.js +1 -1
- package/components/graph/svelvet/edges/models/Edge.js +2 -2
- package/components/graph/svelvet/edges/views/Edges/SimpleBezierEdge.svelte +1 -1
- package/components/graph/svelvet/nodes/models/Node.js +0 -1
- package/components/graph/svelvet/nodes/views/Node.svelte +0 -1
- package/components/graph/svelvet/nodes/views/Node.svelte.d.ts +0 -1
- package/components/graph/svelvet/store/controllers/util.d.ts +1 -1
- package/components/graph/svelvet/store/controllers/util.js +3 -3
- package/components/home/ItemsList.svelte +11 -11
- package/components/propertyPicker/ObjectViewer.svelte +0 -5
- package/components/propertyPicker/ObjectViewer.svelte.d.ts +0 -1
- package/components/sidebar/WorkspaceMenu.svelte +8 -4
- package/editorUtils.d.ts +3 -0
- package/editorUtils.js +5 -2
- package/gen/core/OpenAPI.js +1 -1
- package/gen/index.d.ts +1 -1
- package/gen/index.js +1 -0
- package/gen/models/MainArgSignature.d.ts +8 -0
- package/gen/models/MainArgSignature.js +8 -1
- package/infer.js +3 -0
- package/init_scripts/python_init_code.d.ts +1 -1
- package/init_scripts/python_init_code.js +2 -2
- package/package.json +673 -674
- package/stores.js +14 -1
- package/user.d.ts +1 -1
- package/user.js +6 -6
- package/components/graph/svelvet/editEdges/views/EditEdge.svelte +0 -151
- package/components/graph/svelvet/editEdges/views/EditEdge.svelte.d.ts +0 -20
- package/components/path_store.d.ts +0 -1
- package/components/path_store.js +0 -2
|
@@ -46,76 +46,82 @@ async function createSchedule(path) {
|
|
|
46
46
|
let loadingSave = false;
|
|
47
47
|
async function saveFlow(leave) {
|
|
48
48
|
loadingSave = true;
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
49
|
+
try {
|
|
50
|
+
const flow = cleanInputs($flowStore);
|
|
51
|
+
const { cron, args, enabled } = $scheduleStore;
|
|
52
|
+
$dirtyStore = false;
|
|
53
|
+
if (initialPath === '') {
|
|
54
|
+
localStorage.removeItem('flow');
|
|
55
|
+
await FlowService.createFlow({
|
|
56
|
+
workspace: $workspaceStore,
|
|
57
|
+
requestBody: {
|
|
58
|
+
path: flow.path,
|
|
59
|
+
summary: flow.summary,
|
|
60
|
+
description: flow.description ?? '',
|
|
61
|
+
value: flow.value,
|
|
62
|
+
schema: flow.schema
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
if (enabled) {
|
|
66
|
+
await createSchedule(flow.path);
|
|
62
67
|
}
|
|
63
|
-
});
|
|
64
|
-
if (enabled) {
|
|
65
|
-
await createSchedule(flow.path);
|
|
66
68
|
}
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
const scheduleExists = await ScheduleService.existsSchedule({
|
|
82
|
-
workspace: $workspaceStore ?? '',
|
|
83
|
-
path: flow.path
|
|
84
|
-
});
|
|
85
|
-
if (scheduleExists) {
|
|
86
|
-
const schedule = await ScheduleService.getSchedule({
|
|
69
|
+
else {
|
|
70
|
+
localStorage.removeItem(`flow-${initialPath}`);
|
|
71
|
+
await FlowService.updateFlow({
|
|
72
|
+
workspace: $workspaceStore,
|
|
73
|
+
path: initialPath,
|
|
74
|
+
requestBody: {
|
|
75
|
+
path: flow.path,
|
|
76
|
+
summary: flow.summary,
|
|
77
|
+
description: flow.description ?? '',
|
|
78
|
+
value: flow.value,
|
|
79
|
+
schema: flow.schema
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
const scheduleExists = await ScheduleService.existsSchedule({
|
|
87
83
|
workspace: $workspaceStore ?? '',
|
|
88
84
|
path: flow.path
|
|
89
85
|
});
|
|
90
|
-
if (
|
|
91
|
-
await ScheduleService.
|
|
86
|
+
if (scheduleExists) {
|
|
87
|
+
const schedule = await ScheduleService.getSchedule({
|
|
92
88
|
workspace: $workspaceStore ?? '',
|
|
93
|
-
path: flow.path
|
|
94
|
-
requestBody: {
|
|
95
|
-
schedule: formatCron(cron),
|
|
96
|
-
args
|
|
97
|
-
}
|
|
89
|
+
path: flow.path
|
|
98
90
|
});
|
|
91
|
+
if (JSON.stringify(schedule.args) != JSON.stringify(args) || schedule.schedule != cron) {
|
|
92
|
+
await ScheduleService.updateSchedule({
|
|
93
|
+
workspace: $workspaceStore ?? '',
|
|
94
|
+
path: flow.path,
|
|
95
|
+
requestBody: {
|
|
96
|
+
schedule: formatCron(cron),
|
|
97
|
+
args
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
if (enabled != schedule.enabled) {
|
|
102
|
+
await ScheduleService.setScheduleEnabled({
|
|
103
|
+
workspace: $workspaceStore ?? '',
|
|
104
|
+
path: flow.path,
|
|
105
|
+
requestBody: { enabled }
|
|
106
|
+
});
|
|
107
|
+
}
|
|
99
108
|
}
|
|
100
|
-
if (enabled
|
|
101
|
-
await
|
|
102
|
-
workspace: $workspaceStore ?? '',
|
|
103
|
-
path: flow.path,
|
|
104
|
-
requestBody: { enabled }
|
|
105
|
-
});
|
|
109
|
+
else if (enabled) {
|
|
110
|
+
await createSchedule(flow.path);
|
|
106
111
|
}
|
|
107
112
|
}
|
|
108
|
-
|
|
109
|
-
|
|
113
|
+
loadingSave = false;
|
|
114
|
+
if (leave) {
|
|
115
|
+
goto(`/flows/get/${$flowStore.path}?workspace_id=${$workspaceStore}`);
|
|
116
|
+
}
|
|
117
|
+
else if (initialPath !== $flowStore.path) {
|
|
118
|
+
initialPath = $flowStore.path;
|
|
119
|
+
goto(`/flows/edit/${$flowStore.path}?workspace_id=${$workspaceStore}`);
|
|
110
120
|
}
|
|
111
121
|
}
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
}
|
|
116
|
-
else if (initialPath !== $flowStore.path) {
|
|
117
|
-
initialPath = $flowStore.path;
|
|
118
|
-
goto(`/flows/edit/${$flowStore.path}?workspace_id=${$workspaceStore}`);
|
|
122
|
+
catch (err) {
|
|
123
|
+
sendUserToast(`The flow could not be saved: ${err.body}`, true);
|
|
124
|
+
loadingSave = false;
|
|
119
125
|
}
|
|
120
126
|
}
|
|
121
127
|
let timeout = undefined;
|
|
@@ -238,7 +244,7 @@ function generateIds() {
|
|
|
238
244
|
<div class="flex flex-col flex-1 h-screen">
|
|
239
245
|
<!-- Nav between steps-->
|
|
240
246
|
<div
|
|
241
|
-
class="justify-between flex flex-row w-full items-center pl-2.5 pr-6
|
|
247
|
+
class="justify-between flex flex-row w-full items-center pl-2.5 pr-6 space-x-4 overflow-x-auto scrollbar-hidden max-h-12 h-full"
|
|
242
248
|
>
|
|
243
249
|
<div class="flex flex-row gap-4 items-center">
|
|
244
250
|
<FlowImportExportMenu />
|
|
@@ -15,7 +15,6 @@ export let overflowAuto = false;
|
|
|
15
15
|
export let noSide = false;
|
|
16
16
|
let stepDetail = undefined;
|
|
17
17
|
let codeViewer;
|
|
18
|
-
let topHeight = 0;
|
|
19
18
|
</script>
|
|
20
19
|
|
|
21
20
|
<Drawer bind:this={codeViewer} size="900px">
|
|
@@ -40,7 +39,7 @@ let topHeight = 0;
|
|
|
40
39
|
<div class="mt-6">
|
|
41
40
|
<h3>Code</h3>
|
|
42
41
|
<iframe
|
|
43
|
-
class="w-full h-full
|
|
42
|
+
class="w-full h-full text-sm"
|
|
44
43
|
title="embedded script from hub"
|
|
45
44
|
frameborder="0"
|
|
46
45
|
src="https://hub.windmill.dev/embed/script/{stepDetail.value?.path?.substring(4)}"
|
|
@@ -133,7 +132,7 @@ let topHeight = 0;
|
|
|
133
132
|
>
|
|
134
133
|
</h3>
|
|
135
134
|
<iframe
|
|
136
|
-
class="w-full h-full
|
|
135
|
+
class="w-full h-full text-sm"
|
|
137
136
|
title="embedded script from hub"
|
|
138
137
|
frameborder="0"
|
|
139
138
|
src="https://hub.windmill.dev/embed/script/{stepDetail.value?.path?.substring(4)}"
|
|
@@ -146,11 +145,7 @@ let topHeight = 0;
|
|
|
146
145
|
json={stepDetail.value.iterator.value}
|
|
147
146
|
/>{:else}
|
|
148
147
|
<span class="text-xs">
|
|
149
|
-
<Highlight
|
|
150
|
-
offsetTop={0}
|
|
151
|
-
language={typescript}
|
|
152
|
-
code={cleanExpr(stepDetail.value.iterator.expr)}
|
|
153
|
-
/>
|
|
148
|
+
<Highlight language={typescript} code={cleanExpr(stepDetail.value.iterator.expr)} />
|
|
154
149
|
</span>
|
|
155
150
|
{/if}</p
|
|
156
151
|
>
|
|
@@ -86,12 +86,14 @@ $: if (job?.type === 'CompletedJob') {
|
|
|
86
86
|
|
|
87
87
|
<div class="flex divide-y flex-col space-y-2 h-screen bg-white px-6 py-2 w-full">
|
|
88
88
|
<div class="flex flex-row justify-between w-full items-center gap-x-2">
|
|
89
|
-
<
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
89
|
+
<div class="w-8">
|
|
90
|
+
<button
|
|
91
|
+
on:click={() => dispatch('close')}
|
|
92
|
+
class="hover:bg-gray-200 bg-gray-100 rounded-full w-8 h-8 flex items-center justify-center transition-all"
|
|
93
|
+
>
|
|
94
|
+
<Icon data={faClose} class="text-gray-500" />
|
|
95
|
+
</button>
|
|
96
|
+
</div>
|
|
95
97
|
|
|
96
98
|
{#if isRunning}
|
|
97
99
|
<Button
|
|
@@ -127,17 +129,17 @@ $: if (job?.type === 'CompletedJob') {
|
|
|
127
129
|
</Button>
|
|
128
130
|
{/if}
|
|
129
131
|
<Button
|
|
130
|
-
btnClasses="h-full"
|
|
132
|
+
btnClasses="h-full truncate"
|
|
131
133
|
size="sm"
|
|
132
134
|
variant="border"
|
|
133
135
|
on:click={() => {
|
|
134
136
|
capturePayload.openDrawer()
|
|
135
|
-
}}>Fill
|
|
137
|
+
}}>Fill args from a request</Button
|
|
136
138
|
>
|
|
137
139
|
</div>
|
|
138
140
|
<FlowProgressBar {job} bind:reset={jobProgressReset} />
|
|
139
141
|
|
|
140
|
-
<div class="overflow-y-auto grow
|
|
142
|
+
<div class="overflow-y-auto grow divide-y divide-gray-600 pr-4">
|
|
141
143
|
<div class="max-h-1/2 overflow-auto border-b border-gray-700">
|
|
142
144
|
<SchemaForm
|
|
143
145
|
noVariablePicker
|
|
@@ -137,6 +137,34 @@ function isSuccess(arg) {
|
|
|
137
137
|
return arg == true;
|
|
138
138
|
}
|
|
139
139
|
}
|
|
140
|
+
function onJobsLoaded(mod, job) {
|
|
141
|
+
if (mod.id && (mod.flow_jobs ?? []).length == 0) {
|
|
142
|
+
if (flowState && flowState[mod.id]) {
|
|
143
|
+
flowState[mod.id].previewResult = job['result'];
|
|
144
|
+
flowState[mod.id].previewArgs = job.args;
|
|
145
|
+
}
|
|
146
|
+
if (job.type == 'QueuedJob') {
|
|
147
|
+
localFlowModuleStates[mod.id] = {
|
|
148
|
+
type: FlowStatusModule.type.IN_PROGRESS,
|
|
149
|
+
logs: job.logs,
|
|
150
|
+
args: job.args,
|
|
151
|
+
parent_module: mod['parent_module']
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
else {
|
|
155
|
+
localFlowModuleStates[mod.id] = {
|
|
156
|
+
args: job.args,
|
|
157
|
+
type: job['success'] ? FlowStatusModule.type.SUCCESS : FlowStatusModule.type.FAILURE,
|
|
158
|
+
logs: job.logs,
|
|
159
|
+
result: job['result'],
|
|
160
|
+
job_id: job.id,
|
|
161
|
+
parent_module: mod['parent_module'],
|
|
162
|
+
iteration_total: mod.iterator?.itered?.length
|
|
163
|
+
// retries: flowState?.raw_flow
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
}
|
|
140
168
|
</script>
|
|
141
169
|
|
|
142
170
|
{#if job}
|
|
@@ -343,49 +371,31 @@ function isSuccess(arg) {
|
|
|
343
371
|
<div class="line w-8 h-10" />
|
|
344
372
|
<li class="w-full border border-gray-600 p-6 space-y-2 bg-blue-50/50">
|
|
345
373
|
{#if [FlowStatusModule.type.IN_PROGRESS, FlowStatusModule.type.SUCCESS, FlowStatusModule.type.FAILURE].includes(mod.type)}
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
:
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
}
|
|
372
|
-
} else {
|
|
373
|
-
localFlowModuleStates[mod.id] = {
|
|
374
|
-
args: e.detail.args,
|
|
375
|
-
type: e.detail.success
|
|
376
|
-
? FlowStatusModule.type.SUCCESS
|
|
377
|
-
: FlowStatusModule.type.FAILURE,
|
|
378
|
-
logs: e.detail.logs,
|
|
379
|
-
result: e.detail.result,
|
|
380
|
-
job_id: e.detail.id,
|
|
381
|
-
parent_module: mod['parent_module'],
|
|
382
|
-
iteration_total: mod.iterator?.itered?.length
|
|
383
|
-
// retries: flowState?.raw_flow
|
|
384
|
-
}
|
|
385
|
-
}
|
|
386
|
-
}
|
|
387
|
-
}}
|
|
388
|
-
/>
|
|
374
|
+
{#if job.raw_flow?.modules[i]?.value.type == 'flow'}
|
|
375
|
+
<svelte:self
|
|
376
|
+
{workspaceId}
|
|
377
|
+
jobId={mod.job}
|
|
378
|
+
bind:suspend_status
|
|
379
|
+
bind:retry_status
|
|
380
|
+
on:jobsLoaded={(e) => onJobsLoaded(mod, e.detail)}
|
|
381
|
+
/>
|
|
382
|
+
{:else}
|
|
383
|
+
<svelte:self
|
|
384
|
+
{workspaceId}
|
|
385
|
+
bind:suspend_status
|
|
386
|
+
bind:retry_status
|
|
387
|
+
bind:flowState
|
|
388
|
+
bind:flowModuleStates={localFlowModuleStates}
|
|
389
|
+
jobId={mod.job}
|
|
390
|
+
flowJobIds={mod.flow_jobs
|
|
391
|
+
? {
|
|
392
|
+
moduleId: mod.id,
|
|
393
|
+
flowJobs: mod.flow_jobs
|
|
394
|
+
}
|
|
395
|
+
: undefined}
|
|
396
|
+
on:jobsLoaded={(e) => onJobsLoaded(mod, e.detail)}
|
|
397
|
+
/>
|
|
398
|
+
{/if}
|
|
389
399
|
{:else}
|
|
390
400
|
<ModuleStatus
|
|
391
401
|
type={mod.type}
|
|
@@ -456,7 +466,7 @@ function isSuccess(arg) {
|
|
|
456
466
|
<p class="p-2">No arguments</p>
|
|
457
467
|
{/if}
|
|
458
468
|
{:else if node}
|
|
459
|
-
<div class="px-2 flex gap-2 min-w-0
|
|
469
|
+
<div class="px-2 flex gap-2 min-w-0">
|
|
460
470
|
<ModuleStatus type={node.type} scheduled_for={node['scheduled_for']} />
|
|
461
471
|
{#if node.job_id}
|
|
462
472
|
<div class="truncate"
|
|
@@ -9,11 +9,9 @@ export let name;
|
|
|
9
9
|
let can_write = false;
|
|
10
10
|
let folder;
|
|
11
11
|
let perms = undefined;
|
|
12
|
-
let managing_folders = [];
|
|
13
12
|
let usernames = [];
|
|
14
13
|
let groups = [];
|
|
15
14
|
let ownerItem = '';
|
|
16
|
-
let folders = [];
|
|
17
15
|
async function loadUsernames() {
|
|
18
16
|
usernames = await UserService.listUsernames({ workspace: $workspaceStore });
|
|
19
17
|
}
|
|
@@ -28,12 +26,8 @@ $: {
|
|
|
28
26
|
async function load() {
|
|
29
27
|
loadUsernames();
|
|
30
28
|
loadGroups();
|
|
31
|
-
loadFolders();
|
|
32
29
|
await loadFolder();
|
|
33
30
|
}
|
|
34
|
-
async function loadFolders() {
|
|
35
|
-
folders = (await FolderService.listFolders({ workspace: $workspaceStore })).map((x) => x.name);
|
|
36
|
-
}
|
|
37
31
|
async function addToFolder() {
|
|
38
32
|
await GranularAclService.addGranularAcls({
|
|
39
33
|
workspace: $workspaceStore ?? '',
|
|
@@ -50,7 +44,8 @@ async function loadFolder() {
|
|
|
50
44
|
can_write =
|
|
51
45
|
$userStore != undefined &&
|
|
52
46
|
(folder?.owners.includes('u/' + $userStore.username) ||
|
|
53
|
-
($userStore.is_admin ?? false) ||
|
|
47
|
+
($userStore.is_admin ?? false) ||
|
|
48
|
+
($userStore.is_super_admin ?? false) ||
|
|
54
49
|
$userStore.pgroups.findIndex((x) => folder?.owners.includes(x)) != -1);
|
|
55
50
|
perms = Array.from(new Set(Object.entries(folder?.extra_perms ?? {})
|
|
56
51
|
.map((x) => x[0])
|
|
@@ -60,9 +55,6 @@ async function loadFolder() {
|
|
|
60
55
|
role: getRole(x)
|
|
61
56
|
};
|
|
62
57
|
});
|
|
63
|
-
managing_folders = Object.entries(folder?.extra_perms ?? {})
|
|
64
|
-
.filter(([k, v]) => k.startsWith('g/') && v)
|
|
65
|
-
.map(([k, v]) => k);
|
|
66
58
|
}
|
|
67
59
|
function getRole(x) {
|
|
68
60
|
const viewer = x in (folder?.extra_perms ?? {});
|
|
@@ -1,21 +1,19 @@
|
|
|
1
|
-
<script>import {
|
|
2
|
-
import {
|
|
3
|
-
import AutoComplete from 'simple-svelte-autocomplete';
|
|
4
|
-
import TableCustom from './TableCustom.svelte';
|
|
1
|
+
<script>import { GranularAclService, GroupService, UserService } from '../gen';
|
|
2
|
+
import { userStore, workspaceStore } from '../stores';
|
|
5
3
|
import { canWrite, sendUserToast } from '../utils';
|
|
4
|
+
import AutoComplete from 'simple-svelte-autocomplete';
|
|
5
|
+
import { createEventDispatcher } from 'svelte';
|
|
6
|
+
import autosize from 'svelte-autosize';
|
|
6
7
|
import { Button, ToggleButton, ToggleButtonGroup } from './common';
|
|
7
8
|
import Skeleton from './common/skeleton/Skeleton.svelte';
|
|
9
|
+
import TableCustom from './TableCustom.svelte';
|
|
8
10
|
import Tooltip from './Tooltip.svelte';
|
|
9
|
-
import autosize from 'svelte-autosize';
|
|
10
|
-
import { createEventDispatcher } from 'svelte';
|
|
11
11
|
export let name;
|
|
12
12
|
let can_write = false;
|
|
13
13
|
let group;
|
|
14
14
|
let members = undefined;
|
|
15
|
-
let managing_groups = [];
|
|
16
15
|
let usernames = [];
|
|
17
16
|
let username = '';
|
|
18
|
-
let groups = [];
|
|
19
17
|
const dispatch = createEventDispatcher();
|
|
20
18
|
async function loadUsernames() {
|
|
21
19
|
usernames = await UserService.listUsernames({ workspace: $workspaceStore });
|
|
@@ -26,13 +24,9 @@ $: {
|
|
|
26
24
|
}
|
|
27
25
|
}
|
|
28
26
|
async function load() {
|
|
29
|
-
loadGroups();
|
|
30
27
|
await loadGroup();
|
|
31
28
|
loadUsernames();
|
|
32
29
|
}
|
|
33
|
-
async function loadGroups() {
|
|
34
|
-
groups = (await GroupService.listGroups({ workspace: $workspaceStore })).map((x) => x.name);
|
|
35
|
-
}
|
|
36
30
|
async function addToGroup() {
|
|
37
31
|
await GroupService.addUserToGroup({
|
|
38
32
|
workspace: $workspaceStore ?? '',
|
|
@@ -53,9 +47,6 @@ async function loadGroup() {
|
|
|
53
47
|
role: getRole(x)
|
|
54
48
|
};
|
|
55
49
|
});
|
|
56
|
-
managing_groups = Object.entries(group?.extra_perms ?? {})
|
|
57
|
-
.filter(([k, v]) => k.startsWith('g/') && v)
|
|
58
|
-
.map(([k, v]) => k);
|
|
59
50
|
}
|
|
60
51
|
function getRole(x) {
|
|
61
52
|
const writer = 'u/' + x in (group?.extra_perms ?? {}) && (group?.extra_perms ?? {})['u/' + x];
|
|
@@ -23,7 +23,7 @@ $: lang = getLang(language);
|
|
|
23
23
|
</script>
|
|
24
24
|
|
|
25
25
|
{#if code?.length < 5000}
|
|
26
|
-
<Highlight
|
|
26
|
+
<Highlight class="nowrap {$$props.class}" language={lang} {code} />
|
|
27
27
|
{:else}
|
|
28
28
|
<pre class="overflow-auto max-h-screen {$$props.class}"
|
|
29
29
|
><code class="language-{language}">{code}</code></pre
|
|
@@ -4,7 +4,8 @@ import { Icon } from 'svelte-awesome';
|
|
|
4
4
|
export let content;
|
|
5
5
|
</script>
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
|
8
|
+
<pre class="bg-gray-700 text-gray-100 p-2 font-mono text-sm whitespace-pre-wrap"
|
|
8
9
|
>{content} <span on:click={() => copyToClipboard(content)} class="cursor-pointer ml-2"
|
|
9
10
|
><Icon data={faClipboard} /></span
|
|
10
11
|
></pre
|
|
@@ -137,9 +137,9 @@ $: schema.properties[argName].default && setDefaultCode();
|
|
|
137
137
|
}
|
|
138
138
|
if (arg) {
|
|
139
139
|
arg.value = undefined
|
|
140
|
+
arg.type = 'javascript'
|
|
140
141
|
}
|
|
141
142
|
propertyType = 'javascript'
|
|
142
|
-
arg.type = 'javascript'
|
|
143
143
|
} else {
|
|
144
144
|
if (staticTemplate) {
|
|
145
145
|
if (arg) {
|
|
@@ -198,7 +198,6 @@ $: schema.properties[argName].default && setDefaultCode();
|
|
|
198
198
|
</div>
|
|
199
199
|
|
|
200
200
|
<div class="max-w-xs" />
|
|
201
|
-
|
|
202
201
|
<div
|
|
203
202
|
class="relative mb-6 {$propPickerConfig?.propName == argName
|
|
204
203
|
? 'outline outline-offset-0 outline-2 outline-blue-500 rounded-md'
|
|
@@ -44,7 +44,7 @@ $: {
|
|
|
44
44
|
|
|
45
45
|
<div class="w-full {clazz}">
|
|
46
46
|
{#if keys.length > 0}
|
|
47
|
-
{#each keys as argName
|
|
47
|
+
{#each keys as argName (argName)}
|
|
48
48
|
{#if (!filter || filter.includes(argName)) && Object.keys(schema.properties ?? {}).includes(argName)}
|
|
49
49
|
<div class="z-10">
|
|
50
50
|
<InputTransformForm
|
|
@@ -12,7 +12,7 @@ export let inputTransforms;
|
|
|
12
12
|
json={val.value}
|
|
13
13
|
/>{:else}
|
|
14
14
|
<span class="text-xs">
|
|
15
|
-
<Highlight
|
|
15
|
+
<Highlight language={typescript} code={cleanExpr(val.expr)} />
|
|
16
16
|
</span>
|
|
17
17
|
{/if}
|
|
18
18
|
</li>
|
|
@@ -298,5 +298,14 @@ $: inputCat = computeInputCat(type, format, itemsType?.type, enum_, contentEncod
|
|
|
298
298
|
{/if}
|
|
299
299
|
<slot name="actions" />
|
|
300
300
|
</div>
|
|
301
|
+
{#if error && error != ''}
|
|
302
|
+
<div class="text-right text-xs text-red-600">
|
|
303
|
+
{#if error === ''}
|
|
304
|
+
|
|
305
|
+
{:else}
|
|
306
|
+
{error}
|
|
307
|
+
{/if}
|
|
308
|
+
</div>
|
|
309
|
+
{/if}
|
|
301
310
|
</div>
|
|
302
311
|
</div>
|
|
@@ -7,7 +7,7 @@ $: if (args === undefined) {
|
|
|
7
7
|
</script>
|
|
8
8
|
|
|
9
9
|
<div class="w-full">
|
|
10
|
-
{#each Object.keys(schema.properties ?? {}) as argName
|
|
10
|
+
{#each Object.keys(schema.properties ?? {}) as argName (argName)}
|
|
11
11
|
<div>
|
|
12
12
|
{#if typeof args == 'object' && schema?.properties[argName] && args}
|
|
13
13
|
<LightweightArgInput
|
package/components/Modal.svelte
CHANGED
|
@@ -58,11 +58,11 @@ function handleKeyUp(event) {
|
|
|
58
58
|
<p class="font-semibold text-gray-800"><slot name="title" /></p>
|
|
59
59
|
<div />
|
|
60
60
|
</div>
|
|
61
|
-
<div class="flex flex-col
|
|
61
|
+
<div class="flex flex-col bg-gray-50 pt-3 px-6 grow overflow-y-auto">
|
|
62
62
|
<slot name="content" />
|
|
63
63
|
</div>
|
|
64
64
|
<div class="flex flex-col bg-white border-gray-200 p-2">
|
|
65
|
-
<div class="flex flex-row justify-between p-2
|
|
65
|
+
<div class="flex flex-row justify-between p-2">
|
|
66
66
|
<button
|
|
67
67
|
on:click={() => {
|
|
68
68
|
closeDrawer()
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
<script>import { ScriptService } from '../gen';
|
|
2
|
-
import { getScriptByPath, sendUserToast, truncateRev } from '../utils';
|
|
3
|
-
import { Pane, Splitpanes } from 'svelte-splitpanes';
|
|
4
|
-
import RunForm from './RunForm.svelte';
|
|
5
|
-
import TestJobLoader from './TestJobLoader.svelte';
|
|
6
|
-
import LogViewer from './LogViewer.svelte';
|
|
7
|
-
import DisplayResult from './DisplayResult.svelte';
|
|
8
|
-
import Button from './common/button/Button.svelte';
|
|
9
2
|
import { workspaceStore } from '../stores';
|
|
3
|
+
import { getScriptByPath } from '../utils';
|
|
10
4
|
import { Loader2 } from 'lucide-svelte';
|
|
11
5
|
import { getContext } from 'svelte';
|
|
6
|
+
import { Pane, Splitpanes } from 'svelte-splitpanes';
|
|
7
|
+
import Button from './common/button/Button.svelte';
|
|
8
|
+
import DisplayResult from './DisplayResult.svelte';
|
|
9
|
+
import LogViewer from './LogViewer.svelte';
|
|
10
|
+
import RunForm from './RunForm.svelte';
|
|
11
|
+
import TestJobLoader from './TestJobLoader.svelte';
|
|
12
12
|
export let mod;
|
|
13
13
|
export let schema;
|
|
14
14
|
const { flowStore, flowStateStore, testStepStore } = getContext('FlowEditorContext');
|
|
@@ -31,15 +31,15 @@ export function runTestWithStepArgs() {
|
|
|
31
31
|
}
|
|
32
32
|
export async function runTest(args) {
|
|
33
33
|
const val = mod.value;
|
|
34
|
-
let jobId = undefined
|
|
34
|
+
// let jobId: string | undefined = undefined
|
|
35
35
|
if (val.type == 'rawscript') {
|
|
36
|
-
|
|
36
|
+
await testJobLoader?.runPreview(val.path, val.content, val.language, args);
|
|
37
37
|
}
|
|
38
38
|
else if (val.type == 'script') {
|
|
39
39
|
const script = val.hash
|
|
40
40
|
? await ScriptService.getScriptByHash({ workspace: $workspaceStore, hash: val.hash })
|
|
41
41
|
: await getScriptByPath(val.path);
|
|
42
|
-
|
|
42
|
+
await testJobLoader?.runPreview(val.path, script.content, script.language, args);
|
|
43
43
|
}
|
|
44
44
|
else {
|
|
45
45
|
throw Error('not testable module type');
|
|
@@ -110,6 +110,7 @@
|
|
|
110
110
|
</script>
|
|
111
111
|
|
|
112
112
|
<div class="multiselect" class:readonly>
|
|
113
|
+
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
|
113
114
|
<div class="tokens" class:showOptions on:click={handleTokenClick}>
|
|
114
115
|
{#each Object.values(selected) as s}
|
|
115
116
|
<div class="token" data-id={s.value}>
|
|
@@ -1,28 +1,10 @@
|
|
|
1
|
-
<script>import
|
|
2
|
-
import { workspaceStore } from '../stores';
|
|
3
|
-
import ResourcePicker from './ResourcePicker.svelte';
|
|
1
|
+
<script>import ResourcePicker from './ResourcePicker.svelte';
|
|
4
2
|
export let format;
|
|
5
3
|
export let value;
|
|
6
4
|
function isString(value) {
|
|
7
5
|
return typeof value === 'string' || value instanceof String;
|
|
8
6
|
}
|
|
9
7
|
let path = '';
|
|
10
|
-
let args = {};
|
|
11
|
-
let schema = undefined;
|
|
12
|
-
let resourceTypeName = '';
|
|
13
|
-
$: format.startsWith('resource-') && loadSchema(format);
|
|
14
|
-
async function loadSchema(format) {
|
|
15
|
-
resourceTypeName = format.substring('resource-'.length);
|
|
16
|
-
try {
|
|
17
|
-
schema = (await ResourceService.getResourceType({
|
|
18
|
-
workspace: $workspaceStore,
|
|
19
|
-
path: resourceTypeName
|
|
20
|
-
})).schema;
|
|
21
|
-
}
|
|
22
|
-
catch (e) {
|
|
23
|
-
schema = undefined;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
8
|
function resourceToValue() {
|
|
27
9
|
if (path) {
|
|
28
10
|
value = `$res:${path}`;
|
|
@@ -35,9 +17,6 @@ function isResource() {
|
|
|
35
17
|
return isString(value) && value.length >= '$res:'.length;
|
|
36
18
|
}
|
|
37
19
|
function valueToPath() {
|
|
38
|
-
if (!isString(value) && value) {
|
|
39
|
-
args = value;
|
|
40
|
-
}
|
|
41
20
|
if (isResource()) {
|
|
42
21
|
path = value.substr('$res:'.length);
|
|
43
22
|
}
|
|
@@ -47,7 +26,6 @@ $: value && valueToPath();
|
|
|
47
26
|
|
|
48
27
|
<div class="flex flex-row w-full flex-wrap gap-x-2 gap-y-0.5">
|
|
49
28
|
<ResourcePicker
|
|
50
|
-
on:refresh={() => loadSchema(format)}
|
|
51
29
|
on:change={(e) => {
|
|
52
30
|
path = e.detail
|
|
53
31
|
resourceToValue()
|