windmill-components 1.22.42 → 1.28.3
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 +93 -47
- package/components/AppConnect.svelte.d.ts +2 -2
- package/components/ArgInfo.svelte +0 -5
- package/components/ArgInput.svelte +91 -64
- package/components/ArgInput.svelte.d.ts +8 -3
- package/components/Button.svelte +4 -4
- package/components/CenteredPage.svelte +1 -1
- package/components/CollapseLink.svelte +12 -0
- package/components/CollapseLink.svelte.d.ts +19 -0
- package/components/CronInput.svelte +84 -0
- package/components/CronInput.svelte.d.ts +18 -0
- package/components/DisplayResult.svelte +28 -15
- package/components/Editor.svelte +136 -66
- package/components/Editor.svelte.d.ts +2 -0
- package/components/EditorBar.svelte +56 -45
- package/components/FlowBuilder.svelte +155 -70
- package/components/FlowEditor.svelte +79 -200
- package/components/FlowEditor.svelte.d.ts +3 -2
- package/components/FlowJobResult.svelte +1 -1
- package/components/FlowPreview.svelte +18 -24
- package/components/FlowPreviewContent.svelte +68 -0
- package/components/FlowPreviewContent.svelte.d.ts +21 -0
- package/components/FlowStatusViewer.svelte +85 -37
- package/components/FlowStatusViewer.svelte.d.ts +3 -2
- package/components/FlowViewer.svelte +85 -45
- package/components/FlowViewer.svelte.d.ts +2 -1
- package/components/IconedResourceType.svelte +30 -5
- package/components/InputTransformForm.svelte +209 -0
- package/components/InputTransformForm.svelte.d.ts +26 -0
- package/components/InputTransformsViewer.svelte +19 -0
- package/components/InputTransformsViewer.svelte.d.ts +17 -0
- package/components/InviteGlobalUser.svelte +2 -2
- package/components/InviteUser.svelte +2 -2
- package/components/JobStatus.svelte +32 -25
- package/components/Modal.svelte +44 -42
- package/components/ModuleStep.svelte +94 -79
- package/components/ObjectResourceInput.svelte +58 -38
- package/components/ObjectTypeNarrowing.svelte +4 -19
- package/components/Path.svelte +1 -0
- package/components/Path.svelte.d.ts +1 -1
- package/components/RadioButton.svelte +11 -96
- package/components/RadioButton.svelte.d.ts +4 -2
- package/components/ResourceEditor.svelte +4 -5
- package/components/ResourceEditor.svelte.d.ts +2 -2
- package/components/ResourcePicker.svelte +25 -2
- package/components/ResourcePicker.svelte.d.ts +3 -0
- package/components/ResourceTypePicker.svelte +17 -29
- package/components/ResourceTypePicker.svelte.d.ts +1 -0
- package/components/RunForm.svelte +14 -15
- package/components/RunForm.svelte.d.ts +1 -1
- package/components/SchemaEditor.svelte +87 -71
- package/components/SchemaEditor.svelte.d.ts +2 -0
- package/components/SchemaEditorProperty.svelte +11 -0
- package/components/SchemaEditorProperty.svelte.d.ts +17 -0
- package/components/SchemaForm.svelte +21 -127
- package/components/SchemaForm.svelte.d.ts +3 -4
- package/components/SchemaModal.svelte +20 -33
- package/components/SchemaModal.svelte.d.ts +1 -1
- package/components/SchemaViewer.svelte +4 -6
- package/components/ScriptBuilder.svelte +40 -43
- package/components/ScriptEditor.svelte +71 -66
- package/components/ScriptPicker.svelte +10 -12
- package/components/ScriptPicker.svelte.d.ts +1 -1
- package/components/ScriptSchema.svelte +0 -5
- package/components/ShareModal.svelte +1 -1
- package/components/SharedBadge.svelte +12 -10
- package/components/StringTypeNarrowing.svelte +8 -4
- package/components/StringTypeNarrowing.svelte.d.ts +1 -0
- package/components/TableCustom.svelte +7 -9
- package/components/TableSimple.svelte +1 -1
- package/components/Toggle.svelte +8 -10
- package/components/Toggle.svelte.d.ts +5 -11
- package/components/Tooltip.svelte +3 -2
- package/components/VariableEditor.svelte +21 -6
- package/components/flows/CopyFirstStepSchema.svelte +7 -5
- package/components/flows/DynamicInputHelpBox.svelte +1 -1
- package/components/flows/FlowBox.svelte +3 -0
- package/components/flows/FlowBox.svelte.d.ts +23 -0
- package/components/flows/FlowBoxHeader.svelte +9 -0
- package/components/flows/FlowBoxHeader.svelte.d.ts +18 -0
- package/components/flows/FlowInput.svelte +20 -0
- package/components/flows/FlowInput.svelte.d.ts +14 -0
- package/components/flows/FlowInputs.svelte +7 -3
- package/components/flows/FlowModuleHeader.svelte +42 -40
- package/components/flows/FlowModuleHeader.svelte.d.ts +1 -1
- package/components/flows/FlowSettings.svelte +174 -0
- package/components/flows/FlowSettings.svelte.d.ts +21 -0
- package/components/flows/flowStore.d.ts +5 -2
- package/components/flows/flowStore.js +65 -9
- package/components/flows/pickers/FlowScriptPicker.svelte +6 -1
- package/components/flows/pickers/FlowScriptPicker.svelte.d.ts +1 -0
- package/components/flows/utils.d.ts +11 -7
- package/components/flows/utils.js +114 -45
- package/components/icons/AirtableIcon.svelte +17 -0
- package/components/icons/AirtableIcon.svelte.d.ts +17 -0
- package/components/icons/GCloudIcon.svelte +16 -0
- package/components/icons/GCloudIcon.svelte.d.ts +17 -0
- package/components/icons/GItlabIcon.svelte +16 -0
- package/components/icons/GItlabIcon.svelte.d.ts +17 -0
- package/components/icons/GSheetsIcon.svelte +16 -0
- package/components/icons/GSheetsIcon.svelte.d.ts +17 -0
- package/components/icons/GcalIcon.svelte +16 -0
- package/components/icons/GcalIcon.svelte.d.ts +17 -0
- package/components/icons/GdriveIcon.svelte +16 -0
- package/components/icons/GdriveIcon.svelte.d.ts +17 -0
- package/components/icons/GmailIcon.svelte +16 -0
- package/components/icons/GmailIcon.svelte.d.ts +17 -0
- package/components/icons/PostgresIcon.svelte +8 -49
- package/components/icons/Slack.svelte +9 -18
- package/components/icons/TogglIcon.svelte +59 -0
- package/components/icons/TogglIcon.svelte.d.ts +17 -0
- package/components/propertyPicker/ObjectViewer.svelte +35 -37
- package/components/propertyPicker/ObjectViewer.svelte.d.ts +2 -0
- package/components/propertyPicker/OverlayPropertyPicker.svelte +53 -53
- package/components/propertyPicker/OverlayPropertyPicker.svelte.d.ts +5 -2
- package/components/propertyPicker/PropPicker.svelte +13 -15
- package/components/propertyPicker/PropPicker.svelte.d.ts +1 -1
- package/components/propertyPicker/WarningMessage.svelte +14 -41
- package/components/propertyPicker/WarningMessage.svelte.d.ts +11 -8
- package/components/propertyPicker/utils.d.ts +1 -0
- package/components/propertyPicker/utils.js +25 -0
- package/gen/core/OpenAPI.js +1 -1
- package/gen/index.d.ts +11 -2
- package/gen/index.js +1 -2
- package/gen/models/CompletedJob.d.ts +1 -1
- package/gen/models/Flow.d.ts +3 -13
- package/gen/models/FlowMetadata.d.ts +9 -0
- package/gen/models/FlowMetadata.js +4 -0
- package/gen/models/FlowModuleValue.d.ts +5 -22
- package/gen/models/FlowModuleValue.js +1 -15
- package/gen/models/ForloopFlow.d.ts +8 -0
- package/gen/models/ForloopFlow.js +4 -0
- package/gen/models/InputTransform.d.ts +3 -12
- package/gen/models/InputTransform.js +1 -8
- package/gen/models/JavascriptTransform.d.ts +4 -0
- package/gen/models/JavascriptTransform.js +4 -0
- package/gen/models/MainArgSignature.d.ts +1 -1
- package/gen/models/NewSchedule.d.ts +1 -0
- package/gen/models/OpenFlowWPath.d.ts +4 -0
- package/gen/models/OpenFlowWPath.js +4 -0
- package/gen/models/PathFlow.d.ts +4 -0
- package/gen/models/PathFlow.js +4 -0
- package/gen/models/PathScript.d.ts +4 -0
- package/gen/models/PathScript.js +4 -0
- package/gen/models/RawScript.d.ts +12 -0
- package/gen/models/RawScript.js +11 -0
- package/gen/models/Schedule.d.ts +1 -1
- package/gen/models/StaticTransform.d.ts +4 -0
- package/gen/models/StaticTransform.js +4 -0
- package/gen/models/TokenResponse.d.ts +3 -3
- package/gen/models/Usage.d.ts +5 -0
- package/gen/models/Usage.js +4 -0
- package/gen/models/User.d.ts +2 -0
- package/gen/schemas/$AuditLog.d.ts +32 -0
- package/gen/schemas/$AuditLog.js +35 -0
- package/gen/schemas/$CompletedJob.d.ts +98 -0
- package/gen/schemas/$CompletedJob.js +103 -0
- package/gen/schemas/$ContextualVariable.d.ts +16 -0
- package/gen/schemas/$ContextualVariable.js +19 -0
- package/gen/schemas/$CreateResource.d.ts +22 -0
- package/gen/schemas/$CreateResource.js +25 -0
- package/gen/schemas/$CreateVariable.d.ts +26 -0
- package/gen/schemas/$CreateVariable.js +29 -0
- package/gen/schemas/$CreateWorkspace.d.ts +20 -0
- package/gen/schemas/$CreateWorkspace.js +23 -0
- package/gen/schemas/$EditResource.d.ts +13 -0
- package/gen/schemas/$EditResource.js +16 -0
- package/gen/schemas/$EditResourceType.d.ts +10 -0
- package/gen/schemas/$EditResourceType.js +13 -0
- package/gen/schemas/$EditSchedule.d.ts +20 -0
- package/gen/schemas/$EditSchedule.js +23 -0
- package/gen/schemas/$EditVariable.d.ts +16 -0
- package/gen/schemas/$EditVariable.js +19 -0
- package/gen/schemas/$EditWorkspaceUser.d.ts +7 -0
- package/gen/schemas/$EditWorkspaceUser.js +10 -0
- package/gen/schemas/$Flow.d.ts +23 -0
- package/gen/schemas/$Flow.js +26 -0
- package/gen/schemas/$FlowMetadata.d.ts +31 -0
- package/gen/schemas/$FlowMetadata.js +34 -0
- package/gen/schemas/$FlowPreview.d.ts +80 -0
- package/gen/schemas/$FlowPreview.js +83 -0
- package/gen/schemas/$GlobalUserInfo.d.ts +26 -0
- package/gen/schemas/$GlobalUserInfo.js +29 -0
- package/gen/schemas/$Group.d.ts +23 -0
- package/gen/schemas/$Group.js +26 -0
- package/gen/schemas/$Job.d.ts +17 -0
- package/gen/schemas/$Job.js +20 -0
- package/gen/schemas/$ListableVariable.d.ts +35 -0
- package/gen/schemas/$ListableVariable.js +38 -0
- package/gen/schemas/$Login.d.ts +12 -0
- package/gen/schemas/$Login.js +15 -0
- package/gen/schemas/$MainArgSignature.d.ts +50 -0
- package/gen/schemas/$MainArgSignature.js +53 -0
- package/gen/schemas/$NewSchedule.d.ts +30 -0
- package/gen/schemas/$NewSchedule.js +33 -0
- package/gen/schemas/$NewToken.d.ts +11 -0
- package/gen/schemas/$NewToken.js +14 -0
- package/gen/schemas/$NewUser.d.ts +16 -0
- package/gen/schemas/$NewUser.js +19 -0
- package/gen/schemas/$Preview.d.ts +19 -0
- package/gen/schemas/$Preview.js +22 -0
- package/gen/schemas/$QueuedJob.d.ts +139 -0
- package/gen/schemas/$QueuedJob.js +144 -0
- package/gen/schemas/$Resource.d.ts +31 -0
- package/gen/schemas/$Resource.js +34 -0
- package/gen/schemas/$ResourceType.d.ts +17 -0
- package/gen/schemas/$ResourceType.js +20 -0
- package/gen/schemas/$Schedule.d.ts +47 -0
- package/gen/schemas/$Schedule.js +50 -0
- package/gen/schemas/$Script.d.ts +77 -0
- package/gen/schemas/$Script.js +80 -0
- package/gen/schemas/$ScriptArgs.d.ts +6 -0
- package/gen/schemas/$ScriptArgs.js +9 -0
- package/gen/schemas/$SlackToken.d.ts +24 -0
- package/gen/schemas/$SlackToken.js +27 -0
- package/gen/schemas/$TokenResponse.d.ts +23 -0
- package/gen/schemas/$TokenResponse.js +26 -0
- package/gen/schemas/$TruncatedToken.d.ts +25 -0
- package/gen/schemas/$TruncatedToken.js +28 -0
- package/gen/schemas/$Usage.d.ts +13 -0
- package/gen/schemas/$Usage.js +16 -0
- package/gen/schemas/$User.d.ts +42 -0
- package/gen/schemas/$User.js +45 -0
- package/gen/schemas/$UserWorkspaceList.d.ts +28 -0
- package/gen/schemas/$UserWorkspaceList.js +31 -0
- package/gen/schemas/$WorkerPing.d.ts +31 -0
- package/gen/schemas/$WorkerPing.js +34 -0
- package/gen/schemas/$Workspace.d.ts +19 -0
- package/gen/schemas/$Workspace.js +22 -0
- package/gen/schemas/$WorkspaceInvite.d.ts +16 -0
- package/gen/schemas/$WorkspaceInvite.js +19 -0
- package/gen/services/FlowService.d.ts +24 -23
- package/gen/services/FlowService.js +14 -0
- package/gen/services/JobService.d.ts +1 -1
- package/gen/services/ScriptService.d.ts +13 -19
- package/gen/services/ScriptService.js +0 -14
- package/gen/services/WorkspaceService.d.ts +1 -1
- package/gen/services/WorkspaceService.js +1 -1
- package/infer.js +8 -1
- package/package.json +85 -16
- package/script_helpers.d.ts +1 -1
- package/script_helpers.js +11 -13
- package/sql.d.ts +89 -0
- package/sql.js +817 -0
- package/stores.d.ts +0 -1
- package/stores.js +0 -6
- package/utils.d.ts +12 -5
- package/utils.js +55 -9
- package/components/RadioButtonV2.svelte +0 -33
- package/components/RadioButtonV2.svelte.d.ts +0 -20
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
<script>import { faChain } from '@fortawesome/free-solid-svg-icons';
|
|
2
|
+
import { Button, Tooltip } from 'flowbite-svelte';
|
|
3
|
+
import Icon from 'svelte-awesome';
|
|
4
|
+
import ArgInput from './ArgInput.svelte';
|
|
5
|
+
import Editor from './Editor.svelte';
|
|
6
|
+
import FieldHeader from './FieldHeader.svelte';
|
|
7
|
+
import DynamicInputHelpBox from './flows/DynamicInputHelpBox.svelte';
|
|
8
|
+
import { codeToStaticTemplate } from './flows/flowStore';
|
|
9
|
+
import { getDefaultExpr, isCodeInjection } from './flows/utils';
|
|
10
|
+
import OverlayPropertyPicker from './propertyPicker/OverlayPropertyPicker.svelte';
|
|
11
|
+
import Toggle from './Toggle.svelte';
|
|
12
|
+
export let schema;
|
|
13
|
+
export let arg;
|
|
14
|
+
export let argName;
|
|
15
|
+
export let extraLib = 'missing extraLib';
|
|
16
|
+
export let inputCheck;
|
|
17
|
+
export let i = undefined;
|
|
18
|
+
export let pickableProperties = undefined;
|
|
19
|
+
let overlays = {};
|
|
20
|
+
let monacos = {};
|
|
21
|
+
let inputCats = {};
|
|
22
|
+
let propertyType = getPropertyType(arg);
|
|
23
|
+
function getPropertyType(arg) {
|
|
24
|
+
let type = arg.type;
|
|
25
|
+
if (type == 'javascript') {
|
|
26
|
+
if (codeToStaticTemplate(arg.expr)) {
|
|
27
|
+
type = 'static';
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
return type;
|
|
31
|
+
}
|
|
32
|
+
function setPropertyType(rawValue) {
|
|
33
|
+
if (!arg) {
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
if (isCodeInjection(rawValue)) {
|
|
37
|
+
arg.expr = getDefaultExpr(i, argName, `\`${rawValue}\``);
|
|
38
|
+
arg.type = 'javascript';
|
|
39
|
+
propertyType = 'static';
|
|
40
|
+
}
|
|
41
|
+
else {
|
|
42
|
+
if (arg.type === 'javascript' && propertyType === 'static') {
|
|
43
|
+
arg.type = 'static';
|
|
44
|
+
}
|
|
45
|
+
if (arg.type) {
|
|
46
|
+
propertyType = arg.type;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
function isStaticTemplate(inputCat) {
|
|
51
|
+
return inputCat === 'string' || inputCat === 'sql';
|
|
52
|
+
}
|
|
53
|
+
function focusProp(argName, monacoEditor = false) {
|
|
54
|
+
Object.keys(overlays).forEach((k) => {
|
|
55
|
+
if (k == argName && (isStaticTemplate(inputCats[argName]) || monacoEditor)) {
|
|
56
|
+
overlays[k].focus();
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
overlays[k].unfocus();
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
function connectProperty(argName, rawValue) {
|
|
64
|
+
if (isStaticTemplate(inputCats[argName])) {
|
|
65
|
+
arg.value = `\$\{${rawValue}}`;
|
|
66
|
+
setPropertyType(arg.value);
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
arg.expr = getDefaultExpr(i ?? -1, undefined, rawValue);
|
|
70
|
+
arg.type = 'javascript';
|
|
71
|
+
propertyType = 'javascript';
|
|
72
|
+
}
|
|
73
|
+
if (monacos[argName]) {
|
|
74
|
+
monacos[argName].setCode(arg.value);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
$: checked = propertyType == 'javascript';
|
|
78
|
+
</script>
|
|
79
|
+
|
|
80
|
+
{#if arg != undefined}
|
|
81
|
+
<div class="flex justify-between items-center">
|
|
82
|
+
<div class="flex items-center">
|
|
83
|
+
<FieldHeader
|
|
84
|
+
label={argName}
|
|
85
|
+
format={schema.properties[argName].format}
|
|
86
|
+
contentEncoding={schema.properties[argName].contentEncoding}
|
|
87
|
+
required={schema.required.includes(argName)}
|
|
88
|
+
type={schema.properties[argName].type}
|
|
89
|
+
itemsType={schema.properties[argName].items}
|
|
90
|
+
/>
|
|
91
|
+
|
|
92
|
+
{#if !checked && arg.type === 'javascript'}
|
|
93
|
+
<span class="bg-blue-100 text-blue-800 text-sm font-medium mr-2 px-2.5 py-0.5 rounded ml-2">
|
|
94
|
+
{'${...}'}
|
|
95
|
+
</span>
|
|
96
|
+
{/if}
|
|
97
|
+
</div>
|
|
98
|
+
<Toggle
|
|
99
|
+
bind:checked
|
|
100
|
+
options={{
|
|
101
|
+
right: 'Raw Javascript Editor'
|
|
102
|
+
}}
|
|
103
|
+
on:change={(e) => {
|
|
104
|
+
const type = e.detail ? 'javascript' : 'static'
|
|
105
|
+
const staticTemplate = isStaticTemplate(inputCats[argName])
|
|
106
|
+
if (type === 'javascript') {
|
|
107
|
+
arg.expr = getDefaultExpr(
|
|
108
|
+
i ?? -1,
|
|
109
|
+
argName,
|
|
110
|
+
staticTemplate ? `\`${arg.value ?? ''}\`` : arg.value
|
|
111
|
+
)
|
|
112
|
+
|
|
113
|
+
arg.value = undefined
|
|
114
|
+
propertyType = 'javascript'
|
|
115
|
+
} else {
|
|
116
|
+
arg.value = staticTemplate ? codeToStaticTemplate(arg.expr) : undefined
|
|
117
|
+
|
|
118
|
+
arg.expr = undefined
|
|
119
|
+
propertyType = 'static'
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
arg.type = type
|
|
123
|
+
}}
|
|
124
|
+
/>
|
|
125
|
+
</div>
|
|
126
|
+
<div class="max-w-xs" />
|
|
127
|
+
|
|
128
|
+
{#if propertyType === undefined || !checked}
|
|
129
|
+
<OverlayPropertyPicker
|
|
130
|
+
{pickableProperties}
|
|
131
|
+
bind:this={overlays[argName]}
|
|
132
|
+
on:select={({ detail }) => {
|
|
133
|
+
if (detail.pickerVariation === 'connect') {
|
|
134
|
+
connectProperty(argName, detail.propPath)
|
|
135
|
+
} else {
|
|
136
|
+
const toAppend = `\$\{${detail.propPath}}`
|
|
137
|
+
arg.value = `${arg.value ?? ''}${toAppend}`
|
|
138
|
+
if (monacos[argName]) {
|
|
139
|
+
monacos[argName].setCode(arg.value)
|
|
140
|
+
}
|
|
141
|
+
if (isStaticTemplate(inputCats[argName])) {
|
|
142
|
+
setPropertyType(arg.value)
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}}
|
|
146
|
+
>
|
|
147
|
+
<ArgInput
|
|
148
|
+
on:focus={() => focusProp(argName)}
|
|
149
|
+
label={argName}
|
|
150
|
+
bind:editor={monacos[argName]}
|
|
151
|
+
bind:description={schema.properties[argName].description}
|
|
152
|
+
bind:value={arg.value}
|
|
153
|
+
type={schema.properties[argName].type}
|
|
154
|
+
required={schema.required.includes(argName)}
|
|
155
|
+
bind:pattern={schema.properties[argName].pattern}
|
|
156
|
+
bind:valid={inputCheck[argName]}
|
|
157
|
+
defaultValue={schema.properties[argName].default}
|
|
158
|
+
bind:enum_={schema.properties[argName].enum}
|
|
159
|
+
bind:format={schema.properties[argName].format}
|
|
160
|
+
contentEncoding={schema.properties[argName].contentEncoding}
|
|
161
|
+
bind:itemsType={schema.properties[argName].items}
|
|
162
|
+
displayHeader={false}
|
|
163
|
+
bind:inputCat={inputCats[argName]}
|
|
164
|
+
on:input={(e) => {
|
|
165
|
+
if (isStaticTemplate(inputCats[argName])) {
|
|
166
|
+
setPropertyType(e.detail.rawValue)
|
|
167
|
+
}
|
|
168
|
+
}}
|
|
169
|
+
>
|
|
170
|
+
<div slot="actions">
|
|
171
|
+
<div on:click={() => overlays[argName]?.focus('connect')}>
|
|
172
|
+
<Tooltip placement="bottom" content="Input connect">
|
|
173
|
+
<Button size="sm" class="blue-button h-8">
|
|
174
|
+
<Icon data={faChain} />
|
|
175
|
+
</Button>
|
|
176
|
+
</Tooltip>
|
|
177
|
+
</div>
|
|
178
|
+
</div>
|
|
179
|
+
</ArgInput>
|
|
180
|
+
</OverlayPropertyPicker>
|
|
181
|
+
{:else if checked}
|
|
182
|
+
{#if arg.expr != undefined}
|
|
183
|
+
<OverlayPropertyPicker
|
|
184
|
+
bind:this={overlays[argName]}
|
|
185
|
+
{pickableProperties}
|
|
186
|
+
on:select={(event) => {
|
|
187
|
+
monacos[argName].insertAtCursor(event.detail.propPath)
|
|
188
|
+
}}
|
|
189
|
+
>
|
|
190
|
+
<div class="border rounded p-2 mt-2 border-gray-300">
|
|
191
|
+
<Editor
|
|
192
|
+
bind:this={monacos[argName]}
|
|
193
|
+
on:focus={() => focusProp(argName, true)}
|
|
194
|
+
bind:code={arg.expr}
|
|
195
|
+
lang="javascript"
|
|
196
|
+
class="few-lines-editor"
|
|
197
|
+
{extraLib}
|
|
198
|
+
extraLibPath="file:///node_modules/@types/windmill@{i}/index.d.ts"
|
|
199
|
+
/>
|
|
200
|
+
</div>
|
|
201
|
+
</OverlayPropertyPicker>
|
|
202
|
+
<DynamicInputHelpBox />
|
|
203
|
+
{/if}
|
|
204
|
+
{:else}
|
|
205
|
+
<p>Not recognized arg type {arg.type}</p>
|
|
206
|
+
{/if}
|
|
207
|
+
{:else}
|
|
208
|
+
<p>Arg at {argName} is undefined</p>
|
|
209
|
+
{/if}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import type { Schema } from '../common';
|
|
3
|
+
import type { InputTransform } from '../gen';
|
|
4
|
+
declare const __propDef: {
|
|
5
|
+
props: {
|
|
6
|
+
schema: Schema;
|
|
7
|
+
arg: InputTransform | any;
|
|
8
|
+
argName: string;
|
|
9
|
+
extraLib?: string | undefined;
|
|
10
|
+
inputCheck: {
|
|
11
|
+
[id: string]: boolean;
|
|
12
|
+
};
|
|
13
|
+
i?: number | undefined;
|
|
14
|
+
pickableProperties?: Object | undefined;
|
|
15
|
+
};
|
|
16
|
+
events: {
|
|
17
|
+
[evt: string]: CustomEvent<any>;
|
|
18
|
+
};
|
|
19
|
+
slots: {};
|
|
20
|
+
};
|
|
21
|
+
export declare type InputTransformFormProps = typeof __propDef.props;
|
|
22
|
+
export declare type InputTransformFormEvents = typeof __propDef.events;
|
|
23
|
+
export declare type InputTransformFormSlots = typeof __propDef.slots;
|
|
24
|
+
export default class InputTransformForm extends SvelteComponentTyped<InputTransformFormProps, InputTransformFormEvents, InputTransformFormSlots> {
|
|
25
|
+
}
|
|
26
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<script>import { Highlight } from 'svelte-highlight';
|
|
2
|
+
import ObjectViewer from './propertyPicker/ObjectViewer.svelte';
|
|
3
|
+
import typescript from 'svelte-highlight/languages/typescript';
|
|
4
|
+
export let inputTransforms;
|
|
5
|
+
</script>
|
|
6
|
+
|
|
7
|
+
<ul class="mb-1">
|
|
8
|
+
{#each Object.entries(inputTransforms) as [key, val]}
|
|
9
|
+
<li>
|
|
10
|
+
<span class="font-black text-gray-700">{key}</span>: {#if val.type == 'static'}<ObjectViewer
|
|
11
|
+
json={val.value}
|
|
12
|
+
/>{:else}
|
|
13
|
+
<span class="inline-block inline-highlight">
|
|
14
|
+
<Highlight offsetTop={0} language={typescript} code={val.expr} />
|
|
15
|
+
</span>
|
|
16
|
+
{/if}
|
|
17
|
+
</li>
|
|
18
|
+
{/each}
|
|
19
|
+
</ul>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import type { InputTransform } from '../gen';
|
|
3
|
+
declare const __propDef: {
|
|
4
|
+
props: {
|
|
5
|
+
inputTransforms: Record<string, InputTransform>;
|
|
6
|
+
};
|
|
7
|
+
events: {
|
|
8
|
+
[evt: string]: CustomEvent<any>;
|
|
9
|
+
};
|
|
10
|
+
slots: {};
|
|
11
|
+
};
|
|
12
|
+
export declare type InputTransformsViewerProps = typeof __propDef.props;
|
|
13
|
+
export declare type InputTransformsViewerEvents = typeof __propDef.events;
|
|
14
|
+
export declare type InputTransformsViewerSlots = typeof __propDef.slots;
|
|
15
|
+
export default class InputTransformsViewer extends SvelteComponentTyped<InputTransformsViewerProps, InputTransformsViewerEvents, InputTransformsViewerSlots> {
|
|
16
|
+
}
|
|
17
|
+
export {};
|
|
@@ -14,8 +14,8 @@ let password;
|
|
|
14
14
|
let name;
|
|
15
15
|
let company;
|
|
16
16
|
function handleKeyUp(event) {
|
|
17
|
-
const key = event.key
|
|
18
|
-
if (key ===
|
|
17
|
+
const key = event.key;
|
|
18
|
+
if (key === 'Enter') {
|
|
19
19
|
event.preventDefault();
|
|
20
20
|
addUser();
|
|
21
21
|
}
|
|
@@ -12,8 +12,8 @@ export function openModal() {
|
|
|
12
12
|
let email;
|
|
13
13
|
let is_admin = false;
|
|
14
14
|
function handleKeyUp(event) {
|
|
15
|
-
const key = event.key
|
|
16
|
-
if (key ===
|
|
15
|
+
const key = event.key;
|
|
16
|
+
if (key === 'Enter') {
|
|
17
17
|
event.preventDefault();
|
|
18
18
|
inviteUser();
|
|
19
19
|
}
|
|
@@ -1,38 +1,45 @@
|
|
|
1
|
-
<script>import {
|
|
2
|
-
import {
|
|
1
|
+
<script>import { displayDate, forLater, msToSec } from '../utils';
|
|
2
|
+
import { faCalendar, faCheck, faCircle, faClock, faHourglassHalf, faTimes } from '@fortawesome/free-solid-svg-icons';
|
|
3
3
|
import Icon from 'svelte-awesome';
|
|
4
|
-
import {
|
|
4
|
+
import { Badge } from 'flowbite-svelte';
|
|
5
5
|
const SMALL_ICON_SCALE = 0.7;
|
|
6
6
|
export let job;
|
|
7
7
|
</script>
|
|
8
8
|
|
|
9
9
|
{#if job && 'success' in job && job.success}
|
|
10
|
-
<
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
10
|
+
<Badge large color="green">
|
|
11
|
+
<Icon data={faCheck} scale={SMALL_ICON_SCALE} class="mr-2" />
|
|
12
|
+
Succeeded {job.is_skipped ? '(Skipped)' : ''}
|
|
13
|
+
</Badge>
|
|
14
|
+
|
|
15
|
+
<Badge large>
|
|
16
|
+
<Icon data={faHourglassHalf} scale={SMALL_ICON_SCALE} class="mr-2" />
|
|
17
|
+
Job ran in {msToSec(job.duration_ms)} s
|
|
18
|
+
</Badge>
|
|
18
19
|
{:else if job && 'success' in job}
|
|
19
|
-
<
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
</
|
|
20
|
+
<Badge large color="red">
|
|
21
|
+
<Icon data={faTimes} scale={SMALL_ICON_SCALE} class="mr-2" />
|
|
22
|
+
Failed
|
|
23
|
+
</Badge>
|
|
24
|
+
<Badge large>
|
|
25
|
+
<Icon data={faHourglassHalf} scale={SMALL_ICON_SCALE} class="mr-2" />
|
|
26
|
+
Job ran in {msToSec(job.duration_ms)}s
|
|
27
|
+
</Badge>
|
|
27
28
|
{:else if job && 'running' in job && job.running}
|
|
28
|
-
<
|
|
29
|
-
|
|
29
|
+
<Badge large color="yellow">
|
|
30
|
+
<Icon data={faCircle} scale={SMALL_ICON_SCALE} class="mr-2" />
|
|
31
|
+
Running
|
|
32
|
+
</Badge>
|
|
30
33
|
{:else if job && 'running' in job && 'scheduled_for' in job && job.scheduled_for && forLater(job.scheduled_for)}
|
|
31
|
-
<
|
|
32
|
-
|
|
34
|
+
<Badge>
|
|
35
|
+
<Icon data={faCalendar} scale={SMALL_ICON_SCALE} class="mr-2" />
|
|
36
|
+
Scheduled for {displayDate(job.scheduled_for)}
|
|
37
|
+
</Badge>
|
|
33
38
|
{:else if job && 'running' in job}
|
|
34
|
-
<
|
|
35
|
-
|
|
39
|
+
<Badge>
|
|
40
|
+
<Icon data={faClock} scale={SMALL_ICON_SCALE} class="mr-2" />
|
|
41
|
+
Queued
|
|
42
|
+
</Badge>
|
|
36
43
|
{:else}
|
|
37
44
|
<Icon class="text-gray-200" data={faCircle} scale={SMALL_ICON_SCALE} />
|
|
38
45
|
{/if}
|
package/components/Modal.svelte
CHANGED
|
@@ -13,8 +13,8 @@ export function openModal() {
|
|
|
13
13
|
dispatch('open');
|
|
14
14
|
}
|
|
15
15
|
function handleKeyUp(event) {
|
|
16
|
-
const key = event.key
|
|
17
|
-
if (key ===
|
|
16
|
+
const key = event.key;
|
|
17
|
+
if (key === 'Escape' || key === 'Esc') {
|
|
18
18
|
if (open) {
|
|
19
19
|
event.preventDefault();
|
|
20
20
|
closeModal();
|
|
@@ -25,45 +25,18 @@ function handleKeyUp(event) {
|
|
|
25
25
|
|
|
26
26
|
<svelte:window on:keyup={handleKeyUp} />
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
{#if open}
|
|
29
|
+
<div class="blurred-background" />
|
|
29
30
|
|
|
30
|
-
<div class="fixed top-0 w-screen h-screen {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
<button
|
|
37
|
-
on:click={() => {
|
|
38
|
-
open = false
|
|
39
|
-
closeModal()
|
|
40
|
-
}}
|
|
41
|
-
>
|
|
42
|
-
<svg
|
|
43
|
-
class="w-6 h-6"
|
|
44
|
-
fill="none"
|
|
45
|
-
stroke="currentColor"
|
|
46
|
-
viewBox="0 0 24 24"
|
|
47
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
48
|
-
>
|
|
49
|
-
<path
|
|
50
|
-
stroke-linecap="round"
|
|
51
|
-
stroke-linejoin="round"
|
|
52
|
-
stroke-width="2"
|
|
53
|
-
d="M6 18L18 6M6 6l12 12"
|
|
54
|
-
/>
|
|
55
|
-
</svg>
|
|
56
|
-
</button>
|
|
57
|
-
<p class="font-semibold text-gray-800"><slot name="title" /></p>
|
|
58
|
-
<div />
|
|
59
|
-
</div>
|
|
60
|
-
<div class="flex flex-col bg-gray-50 pt-3 px-6 grow overflow-y-auto">
|
|
61
|
-
<slot name="content" />
|
|
62
|
-
</div>
|
|
63
|
-
<div class="flex flex-col bg-white border-gray-200 p-2">
|
|
64
|
-
<div class="flex flex-row justify-between p-2 ">
|
|
31
|
+
<div class="fixed top-0 w-screen h-screen {z}">
|
|
32
|
+
<div
|
|
33
|
+
class="fixed right-0 top-0 flex flex-col w-3/4 sm:w-2/3 lg:w-1/2 h-screen border border-gray-300 shadow-xl"
|
|
34
|
+
>
|
|
35
|
+
{#if open}
|
|
36
|
+
<div class="flex flex-row justify-between p-2 bg-white border-b border-gray-200">
|
|
65
37
|
<button
|
|
66
38
|
on:click={() => {
|
|
39
|
+
open = false
|
|
67
40
|
closeModal()
|
|
68
41
|
}}
|
|
69
42
|
>
|
|
@@ -82,12 +55,41 @@ function handleKeyUp(event) {
|
|
|
82
55
|
/>
|
|
83
56
|
</svg>
|
|
84
57
|
</button>
|
|
85
|
-
<
|
|
58
|
+
<p class="font-semibold text-gray-800"><slot name="title" /></p>
|
|
59
|
+
<div />
|
|
60
|
+
</div>
|
|
61
|
+
<div class="flex flex-col bg-gray-50 pt-3 px-6 grow overflow-y-auto">
|
|
62
|
+
<slot name="content" />
|
|
63
|
+
</div>
|
|
64
|
+
<div class="flex flex-col bg-white border-gray-200 p-2">
|
|
65
|
+
<div class="flex flex-row justify-between p-2 ">
|
|
66
|
+
<button
|
|
67
|
+
on:click={() => {
|
|
68
|
+
closeModal()
|
|
69
|
+
}}
|
|
70
|
+
>
|
|
71
|
+
<svg
|
|
72
|
+
class="w-6 h-6"
|
|
73
|
+
fill="none"
|
|
74
|
+
stroke="currentColor"
|
|
75
|
+
viewBox="0 0 24 24"
|
|
76
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
77
|
+
>
|
|
78
|
+
<path
|
|
79
|
+
stroke-linecap="round"
|
|
80
|
+
stroke-linejoin="round"
|
|
81
|
+
stroke-width="2"
|
|
82
|
+
d="M6 18L18 6M6 6l12 12"
|
|
83
|
+
/>
|
|
84
|
+
</svg>
|
|
85
|
+
</button>
|
|
86
|
+
<span class="mr-4"><slot name="submission"> </slot></span>
|
|
87
|
+
</div>
|
|
86
88
|
</div>
|
|
87
|
-
|
|
88
|
-
|
|
89
|
+
{/if}
|
|
90
|
+
</div>
|
|
89
91
|
</div>
|
|
90
|
-
|
|
92
|
+
{/if}
|
|
91
93
|
|
|
92
94
|
<style>
|
|
93
95
|
.blurred-background {
|