windmill-components 1.28.7 → 1.35.1
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 +3 -0
- package/components/AppConnect.svelte +29 -13
- package/components/ArgInput.svelte +25 -14
- package/components/ArgInput.svelte.d.ts +4 -0
- package/components/CenteredPage.svelte +2 -2
- package/components/DisplayResult.svelte +3 -3
- package/components/Editor.svelte +70 -78
- package/components/Editor.svelte.d.ts +3 -0
- package/components/EditorBar.svelte +57 -38
- package/components/FlowBuilder.svelte +39 -33
- package/components/FlowEditor.svelte +17 -58
- package/components/FlowJobResult.svelte +16 -16
- package/components/FlowModulesViewer.svelte +97 -0
- package/components/FlowModulesViewer.svelte.d.ts +17 -0
- package/components/FlowPreview.svelte +46 -66
- package/components/FlowPreview.svelte.d.ts +2 -4
- package/components/FlowPreviewContent.svelte +59 -44
- package/components/FlowPreviewContent.svelte.d.ts +0 -1
- package/components/FlowStatusViewer.svelte +104 -204
- package/components/FlowStatusViewer.svelte.d.ts +7 -4
- package/components/FlowViewer.svelte +60 -156
- package/components/FlowViewer.svelte.d.ts +0 -1
- package/components/IconedPath.svelte +12 -0
- package/components/IconedPath.svelte.d.ts +16 -0
- package/components/IconedResourceType.svelte +24 -5
- package/components/IconedResourceType.svelte.d.ts +1 -0
- package/components/InputTransformForm.svelte +9 -8
- package/components/InputTransformForm.svelte.d.ts +1 -1
- package/components/InviteGlobalUser.svelte +1 -1
- package/components/ItemPicker.svelte +6 -1
- package/components/JobStatus.svelte +1 -1
- package/components/ModuleStep.svelte +74 -94
- package/components/ModuleStep.svelte.d.ts +7 -2
- package/components/Multiselect.svelte +1 -1
- package/components/Path.svelte +62 -40
- package/components/Path.svelte.d.ts +2 -0
- package/components/ProgressBar.svelte +31 -0
- package/components/ProgressBar.svelte.d.ts +17 -0
- package/components/ProgressBarPart.svelte +20 -0
- package/components/ProgressBarPart.svelte.d.ts +20 -0
- package/components/ResourceEditor.svelte +2 -1
- package/components/ResourcePicker.svelte +9 -0
- package/components/SchemaForm.svelte +9 -4
- package/components/SchemaForm.svelte.d.ts +1 -1
- package/components/SchemaModal.svelte +20 -3
- package/components/SchemaViewer.svelte +58 -68
- package/components/ScriptBuilder.svelte +145 -122
- package/components/ScriptBuilder.svelte.d.ts +1 -0
- package/components/ScriptEditor.svelte +118 -339
- package/components/ScriptEditor.svelte.d.ts +0 -2
- package/components/ScriptSchema.svelte +45 -44
- package/components/SharedBadge.svelte +8 -3
- package/components/VariableEditor.svelte +1 -1
- package/components/common/drawer/Drawer.svelte +108 -0
- package/components/common/drawer/Drawer.svelte.d.ts +23 -0
- package/components/common/drawer/DrawerContent.svelte +19 -0
- package/components/common/drawer/DrawerContent.svelte.d.ts +20 -0
- package/components/common/menu/Menu.svelte +57 -0
- package/components/common/menu/Menu.svelte.d.ts +23 -0
- package/components/common/menu/MenuItem.svelte +9 -0
- package/components/common/menu/MenuItem.svelte.d.ts +27 -0
- package/components/common/tabs/Tab.svelte +17 -0
- package/components/common/tabs/Tab.svelte.d.ts +18 -0
- package/components/common/tabs/TabContent.svelte +12 -0
- package/components/common/tabs/TabContent.svelte.d.ts +19 -0
- package/components/common/tabs/Tabs.svelte +20 -0
- package/components/common/tabs/Tabs.svelte.d.ts +24 -0
- package/components/flows/CopyFirstStepSchema.svelte +4 -3
- package/components/flows/DynamicInputHelpBox.svelte +6 -4
- package/components/flows/DynamicInputHelpBox.svelte.d.ts +1 -1
- package/components/flows/FlowBox.svelte +15 -2
- package/components/flows/FlowBox.svelte.d.ts +14 -14
- package/components/flows/FlowBoxHeader.svelte +10 -3
- package/components/flows/FlowBoxHeader.svelte.d.ts +3 -0
- package/components/flows/FlowInput.svelte +14 -12
- package/components/flows/FlowInputs.svelte +55 -35
- package/components/flows/FlowInputs.svelte.d.ts +3 -1
- package/components/flows/FlowModuleHeader.svelte +69 -54
- package/components/flows/FlowModuleHeader.svelte.d.ts +6 -6
- package/components/flows/FlowSettings.svelte +72 -91
- package/components/flows/FlowSettings.svelte.d.ts +0 -1
- package/components/flows/FlowTimeline.svelte +169 -0
- package/components/flows/FlowTimeline.svelte.d.ts +21 -0
- package/components/flows/flowState.d.ts +14 -0
- package/components/flows/flowState.js +52 -0
- package/components/flows/flowStateUtils.d.ts +37 -0
- package/components/flows/flowStateUtils.js +220 -0
- package/components/flows/flowStore.d.ts +1 -16
- package/components/flows/flowStore.js +26 -203
- package/components/flows/pickers/FlowScriptPicker.svelte +5 -9
- package/components/flows/pickers/FlowScriptPicker.svelte.d.ts +0 -1
- package/components/flows/pickers/PickHubScript.svelte +1 -1
- package/components/flows/pickers/PickHubScript.svelte.d.ts +1 -1
- package/components/flows/pickers/PickScript.svelte +1 -1
- package/components/flows/pickers/PickScript.svelte.d.ts +1 -1
- package/components/flows/scheduleUtils.d.ts +7 -0
- package/components/flows/scheduleUtils.js +21 -0
- package/components/flows/stepOpenedStore.d.ts +1 -0
- package/components/flows/stepOpenedStore.js +6 -0
- package/components/flows/utils.d.ts +6 -13
- package/components/flows/utils.js +47 -119
- package/components/icons/DiscordIcon.svelte +16 -0
- package/components/icons/DiscordIcon.svelte.d.ts +17 -0
- package/components/icons/GithubIcon.svelte +17 -0
- package/components/icons/GithubIcon.svelte.d.ts +17 -0
- package/components/icons/HttpIcon.svelte +21 -0
- package/components/icons/HttpIcon.svelte.d.ts +17 -0
- package/components/icons/MastodonIcon.svelte +16 -0
- package/components/icons/MastodonIcon.svelte.d.ts +17 -0
- package/components/icons/MatrixIcon.svelte +16 -0
- package/components/icons/MatrixIcon.svelte.d.ts +17 -0
- package/components/icons/S3Icon.svelte +16 -0
- package/components/icons/S3Icon.svelte.d.ts +17 -0
- package/components/icons/WindmillIcon.svelte +68 -0
- package/components/icons/WindmillIcon.svelte.d.ts +17 -0
- package/components/jobs/JobDetail.svelte +176 -0
- package/components/jobs/JobDetail.svelte.d.ts +17 -0
- package/components/landing/FlowGettingStarted.svelte +95 -0
- package/components/landing/FlowGettingStarted.svelte.d.ts +19 -0
- package/components/landing/FlowLandingBox.svelte +69 -0
- package/components/landing/FlowLandingBox.svelte.d.ts +17 -0
- package/components/landing/RessourceGettingStarted.svelte +51 -0
- package/components/landing/RessourceGettingStarted.svelte.d.ts +19 -0
- package/components/landing/ScriptBox.svelte +81 -0
- package/components/landing/ScriptBox.svelte.d.ts +17 -0
- package/components/landing/ScriptGettingStarted.svelte +93 -0
- package/components/landing/ScriptGettingStarted.svelte.d.ts +19 -0
- package/components/preview/FlowPreviewStatus.svelte +28 -0
- package/components/preview/FlowPreviewStatus.svelte.d.ts +17 -0
- package/components/propertyPicker/ObjectViewer.svelte +13 -13
- package/components/propertyPicker/utils.js +3 -2
- package/components/script_editor/LogPanel.svelte +172 -0
- package/components/script_editor/LogPanel.svelte.d.ts +22 -0
- package/components/sidebar/MenuLink.svelte +49 -0
- package/components/sidebar/MenuLink.svelte.d.ts +21 -0
- package/components/sidebar/SidebarContent.svelte +55 -0
- package/components/sidebar/SidebarContent.svelte.d.ts +16 -0
- package/components/sidebar/UserMenu.svelte +62 -0
- package/components/sidebar/UserMenu.svelte.d.ts +16 -0
- package/components/sidebar/WorkspaceMenu.svelte +66 -0
- package/components/sidebar/WorkspaceMenu.svelte.d.ts +16 -0
- package/gen/core/OpenAPI.js +1 -1
- package/gen/core/request.js +1 -0
- package/gen/models/FlowModule.d.ts +5 -3
- package/gen/models/ForloopFlow.d.ts +2 -2
- package/gen/models/MainArgSignature.d.ts +14 -3
- package/gen/services/JobService.d.ts +10 -2
- package/gen/services/JobService.js +4 -2
- package/gen/services/ScriptService.d.ts +22 -6
- package/gen/services/ScriptService.js +32 -2
- package/infer.js +47 -24
- package/logout.js +1 -1
- package/package.json +58 -23
- package/script_helpers.d.ts +4 -1
- package/script_helpers.js +68 -17
- package/stores.d.ts +0 -2
- package/stores.js +0 -4
- package/utils.d.ts +5 -2
- package/utils.js +36 -5
|
@@ -2,77 +2,67 @@
|
|
|
2
2
|
import Highlight from 'svelte-highlight';
|
|
3
3
|
import json from 'svelte-highlight/languages/json';
|
|
4
4
|
import TableCustom from './TableCustom.svelte';
|
|
5
|
+
import Tab from './common/tabs/Tab.svelte';
|
|
6
|
+
import TabContent from './common/tabs/TabContent.svelte';
|
|
7
|
+
import Tabs from './common/tabs/Tabs.svelte';
|
|
5
8
|
export let schema = emptySchema();
|
|
6
|
-
let viewJsonSchema = false;
|
|
7
9
|
</script>
|
|
8
10
|
|
|
9
11
|
<div class="w-full">
|
|
10
|
-
<
|
|
11
|
-
<
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
</button>
|
|
26
|
-
</div>
|
|
27
|
-
</div>
|
|
28
|
-
<!--json schema or table view-->
|
|
29
|
-
<div class="border-t py-1">
|
|
30
|
-
<div class={viewJsonSchema ? 'hidden' : ''}>
|
|
31
|
-
{#if schema && schema.properties && Object.keys(schema.properties).length > 0 && schema.required}
|
|
32
|
-
<div class="flex flex-row">
|
|
33
|
-
<TableCustom>
|
|
34
|
-
<tr slot="header-row" class="underline">
|
|
35
|
-
<th>name</th>
|
|
36
|
-
<th>type</th>
|
|
37
|
-
<th>description</th>
|
|
38
|
-
<th>default</th>
|
|
39
|
-
<th>format</th>
|
|
40
|
-
<th>required</th>
|
|
41
|
-
</tr>
|
|
42
|
-
<tbody slot="body">
|
|
43
|
-
{#each Object.entries(schema.properties) as [name, property] (name)}
|
|
44
|
-
<tr>
|
|
45
|
-
<td>{name}</td>
|
|
46
|
-
<td
|
|
47
|
-
>{#if !property.type} any {:else} {property.type} {/if}</td
|
|
48
|
-
>
|
|
49
|
-
<td>{property.description}</td>
|
|
50
|
-
<td
|
|
51
|
-
>{property.default == '<function call>'
|
|
52
|
-
? '<function call>'
|
|
53
|
-
: property.default
|
|
54
|
-
? JSON.stringify(property.default)
|
|
55
|
-
: ''}</td
|
|
56
|
-
>
|
|
57
|
-
<td
|
|
58
|
-
>{property.format ?? ''}
|
|
59
|
-
{property.contentEncoding ? `(encoding: ${property.contentEncoding})` : ''}</td
|
|
60
|
-
>
|
|
61
|
-
<td
|
|
62
|
-
>{#if schema.required.includes(name)}
|
|
63
|
-
<span class="text-red-600 font-bold text-lg">*</span>
|
|
64
|
-
{/if}</td
|
|
65
|
-
>
|
|
12
|
+
<Tabs selected="arguments">
|
|
13
|
+
<Tab value="arguments">Arguments</Tab>
|
|
14
|
+
<Tab value="advanced">Advanced</Tab>
|
|
15
|
+
<svelte:fragment slot="content">
|
|
16
|
+
<TabContent value="arguments">
|
|
17
|
+
{#if schema && schema.properties && Object.keys(schema.properties).length > 0 && schema.required}
|
|
18
|
+
<div class="flex flex-row">
|
|
19
|
+
<TableCustom>
|
|
20
|
+
<tr slot="header-row" class="underline">
|
|
21
|
+
<th>name</th>
|
|
22
|
+
<th>type</th>
|
|
23
|
+
<th>description</th>
|
|
24
|
+
<th>default</th>
|
|
25
|
+
<th>format</th>
|
|
26
|
+
<th>required</th>
|
|
66
27
|
</tr>
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
28
|
+
<tbody slot="body">
|
|
29
|
+
{#each Object.entries(schema.properties) as [name, property] (name)}
|
|
30
|
+
<tr>
|
|
31
|
+
<td>{name}</td>
|
|
32
|
+
<td
|
|
33
|
+
>{#if !property.type} any {:else} {property.type} {/if}</td
|
|
34
|
+
>
|
|
35
|
+
<td>{property.description}</td>
|
|
36
|
+
<td
|
|
37
|
+
>{property.default == '<function call>'
|
|
38
|
+
? '<function call>'
|
|
39
|
+
: property.default
|
|
40
|
+
? JSON.stringify(property.default)
|
|
41
|
+
: ''}</td
|
|
42
|
+
>
|
|
43
|
+
<td
|
|
44
|
+
>{property.format ?? ''}
|
|
45
|
+
{property.contentEncoding
|
|
46
|
+
? `(encoding: ${property.contentEncoding})`
|
|
47
|
+
: ''}</td
|
|
48
|
+
>
|
|
49
|
+
<td
|
|
50
|
+
>{#if schema.required.includes(name)}
|
|
51
|
+
<span class="text-red-600 font-bold text-lg">*</span>
|
|
52
|
+
{/if}</td
|
|
53
|
+
>
|
|
54
|
+
</tr>
|
|
55
|
+
{/each}
|
|
56
|
+
</tbody>
|
|
57
|
+
</TableCustom>
|
|
58
|
+
</div>
|
|
59
|
+
{:else}
|
|
60
|
+
<div class="text-gray-700 text-xs italic">This script has no arguments</div>
|
|
61
|
+
{/if}
|
|
62
|
+
</TabContent>
|
|
63
|
+
<TabContent value="advanced">
|
|
64
|
+
<Highlight language={json} code={JSON.stringify(schema, null, 4)} />
|
|
65
|
+
</TabContent>
|
|
66
|
+
</svelte:fragment>
|
|
67
|
+
</Tabs>
|
|
78
68
|
</div>
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { goto } from '$app/navigation';
|
|
3
3
|
import { page } from '$app/stores';
|
|
4
4
|
import { inferArgs } from '../infer';
|
|
5
|
-
import { DENO_INIT_CODE, DENO_INIT_CODE_TRIGGER, initialCode } from '../script_helpers';
|
|
5
|
+
import { DENO_INIT_CODE, DENO_INIT_CODE_TRIGGER, initialCode, POSTGRES_INIT_CODE } from '../script_helpers';
|
|
6
6
|
import { workspaceStore } from '../stores';
|
|
7
7
|
import { emptySchema, encodeState, sendUserToast, setQueryWithoutLoad } from '../utils';
|
|
8
8
|
import { Breadcrumb, BreadcrumbItem } from 'flowbite-svelte';
|
|
@@ -13,23 +13,25 @@ import RadioButton from './RadioButton.svelte';
|
|
|
13
13
|
import Required from './Required.svelte';
|
|
14
14
|
import ScriptEditor from './ScriptEditor.svelte';
|
|
15
15
|
import ScriptSchema from './ScriptSchema.svelte';
|
|
16
|
+
import CenteredPage from './CenteredPage.svelte';
|
|
16
17
|
let editor;
|
|
17
18
|
let scriptSchema;
|
|
18
|
-
$: step = Number($page.url.searchParams.get('step')) || 1;
|
|
19
19
|
export let script;
|
|
20
20
|
export let initialPath = '';
|
|
21
|
+
export let template = undefined;
|
|
21
22
|
let pathError = '';
|
|
22
23
|
$: setQueryWithoutLoad($page.url, 'state', encodeState(script));
|
|
24
|
+
$: step = Number($page.url.searchParams.get('step')) || 1;
|
|
23
25
|
$: {
|
|
24
26
|
if (script.language == 'python3') {
|
|
25
27
|
script.is_trigger = false;
|
|
26
28
|
}
|
|
27
29
|
}
|
|
28
30
|
if (script.content == '') {
|
|
29
|
-
initContent(script.language,
|
|
31
|
+
initContent(script.language, template);
|
|
30
32
|
}
|
|
31
|
-
function initContent(
|
|
32
|
-
script.content = initialCode(
|
|
33
|
+
function initContent(language, template) {
|
|
34
|
+
script.content = initialCode(language, template == 'pgsql' ? 'pgsql' : script.is_trigger ? 'trigger' : undefined);
|
|
33
35
|
}
|
|
34
36
|
async function editScript() {
|
|
35
37
|
try {
|
|
@@ -81,11 +83,11 @@ onDestroy(() => {
|
|
|
81
83
|
});
|
|
82
84
|
</script>
|
|
83
85
|
|
|
84
|
-
<div class="flex flex-col h-screen
|
|
86
|
+
<div class="flex flex-col h-screen">
|
|
85
87
|
<!-- Nav between steps-->
|
|
86
|
-
<div class="flex flex-col w-full">
|
|
87
|
-
<div class="justify-between flex flex-row drop-shadow-sm w-full
|
|
88
|
-
<div class="
|
|
88
|
+
<div class="flex flex-col w-full px-4 py-2 border-b shadow-sm">
|
|
89
|
+
<div class="justify-between flex flex-row drop-shadow-sm w-full">
|
|
90
|
+
<div class="flex flex-row w-full">
|
|
89
91
|
<Breadcrumb>
|
|
90
92
|
<BreadcrumbItem>
|
|
91
93
|
<button on:click={() => changeStep(1)} class={step === 1 ? 'font-bold' : null}>
|
|
@@ -119,68 +121,92 @@ onDestroy(() => {
|
|
|
119
121
|
class="default-button px-6 max-h-8"
|
|
120
122
|
on:click={() => {
|
|
121
123
|
changeStep(step + 1)
|
|
122
|
-
}}
|
|
124
|
+
}}
|
|
123
125
|
>
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
class="default-button-secondary px-6 max-h-8 mr-2"
|
|
127
|
-
on:click={async () => {
|
|
128
|
-
await inferSchema()
|
|
129
|
-
editScript()
|
|
130
|
-
}}>Save (commit)</button
|
|
131
|
-
>
|
|
132
|
-
{/if}
|
|
126
|
+
Next
|
|
127
|
+
</button>
|
|
133
128
|
{:else}
|
|
134
|
-
<button class="default-button px-6 self-end" on:click={editScript}>Save
|
|
129
|
+
<button class="default-button px-6 self-end" on:click={editScript}>Save</button>
|
|
130
|
+
{/if}
|
|
131
|
+
{#if step > 1}
|
|
132
|
+
<button
|
|
133
|
+
class="default-button-secondary px-6 max-h-8 mr-2"
|
|
134
|
+
on:click={async () => {
|
|
135
|
+
changeStep(step - 1)
|
|
136
|
+
}}
|
|
137
|
+
>
|
|
138
|
+
Back
|
|
139
|
+
</button>
|
|
140
|
+
{/if}
|
|
141
|
+
{#if step == 2}
|
|
142
|
+
<button
|
|
143
|
+
class="default-button-secondary px-6 max-h-8 mr-2"
|
|
144
|
+
on:click={async () => {
|
|
145
|
+
await inferSchema()
|
|
146
|
+
editScript()
|
|
147
|
+
}}
|
|
148
|
+
>
|
|
149
|
+
Save (commit)
|
|
150
|
+
</button>
|
|
135
151
|
{/if}
|
|
136
152
|
</div>
|
|
137
153
|
</div>
|
|
138
|
-
<div class="flex flex-row-reverse">
|
|
139
|
-
<span class="my-1 text-sm text-gray-500 italic">
|
|
140
|
-
{#if script.hash != ''} Editing from {script.hash} with path{/if}
|
|
141
|
-
{#if initialPath && initialPath != script.path} {initialPath} → {/if}
|
|
142
|
-
{script.path}
|
|
143
|
-
</span>
|
|
144
|
-
</div>
|
|
145
154
|
</div>
|
|
146
155
|
|
|
147
156
|
<!-- metadata -->
|
|
148
157
|
{#if step === 1}
|
|
149
|
-
<
|
|
150
|
-
<
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
158
|
+
<CenteredPage>
|
|
159
|
+
<div class="space-y-6">
|
|
160
|
+
<Path
|
|
161
|
+
bind:error={pathError}
|
|
162
|
+
bind:path={script.path}
|
|
163
|
+
{initialPath}
|
|
164
|
+
on:enter={() => changeStep(2)}
|
|
165
|
+
namePlaceholder="my_script"
|
|
166
|
+
kind="script"
|
|
167
|
+
>
|
|
168
|
+
<div slot="ownerToolkit">
|
|
169
|
+
Script permissions depend on their path. Select the group
|
|
170
|
+
<span class="font-mono"> all </span>
|
|
171
|
+
to share your script, and <span class="font-mono">user</span> to keep it private.
|
|
172
|
+
<a href="https://docs.windmill.dev/docs/reference/namespaces">docs</a>
|
|
173
|
+
</div>
|
|
174
|
+
</Path>
|
|
175
|
+
<h3 class="text-gray-700 border-b">Language</h3>
|
|
176
|
+
<div class="max-w-md">
|
|
177
|
+
<RadioButton
|
|
178
|
+
label="Language"
|
|
179
|
+
options={[
|
|
180
|
+
['Typescript (Deno)', 'deno'],
|
|
181
|
+
['Python 3.10', 'python3']
|
|
182
|
+
]}
|
|
183
|
+
on:change={(e) => initContent(e.detail, template)}
|
|
184
|
+
bind:value={script.language}
|
|
185
|
+
/>
|
|
163
186
|
</div>
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
187
|
+
{#if script.language == 'deno'}
|
|
188
|
+
<h4 class="text-gray-700 border-b">Template</h4>
|
|
189
|
+
|
|
190
|
+
<div class="max-w-md">
|
|
191
|
+
<RadioButton
|
|
192
|
+
label="Template"
|
|
193
|
+
options={[
|
|
194
|
+
['None', undefined],
|
|
195
|
+
['PostgreSQL', 'pgsql']
|
|
196
|
+
]}
|
|
197
|
+
on:change={(e) => initContent(script.language, e.detail)}
|
|
198
|
+
bind:value={template}
|
|
199
|
+
/>
|
|
200
|
+
</div>
|
|
201
|
+
{/if}
|
|
202
|
+
|
|
203
|
+
<h3 class="text-gray-700 pb-1 border-b">Metadata</h3>
|
|
178
204
|
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
205
|
+
<label class="block ">
|
|
206
|
+
<span class="text-gray-700">Summary <Required required={false} /></span>
|
|
207
|
+
<textarea
|
|
208
|
+
bind:value={script.summary}
|
|
209
|
+
class="
|
|
184
210
|
mt-1
|
|
185
211
|
block
|
|
186
212
|
w-full
|
|
@@ -189,17 +215,17 @@ onDestroy(() => {
|
|
|
189
215
|
shadow-sm
|
|
190
216
|
focus:border-indigo-300 focus:ring focus:ring-indigo-200 focus:ring-opacity-50
|
|
191
217
|
"
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
218
|
+
placeholder="A very short summary of the script displayed when the script is listed"
|
|
219
|
+
rows="1"
|
|
220
|
+
/>
|
|
221
|
+
</label>
|
|
222
|
+
<label class="block" for="inp">
|
|
223
|
+
<span class="text-gray-700"
|
|
224
|
+
>Description<Required required={false} detail="accept markdown formatting" />
|
|
225
|
+
<textarea
|
|
226
|
+
id="inp"
|
|
227
|
+
bind:value={script.description}
|
|
228
|
+
class="
|
|
203
229
|
mt-1
|
|
204
230
|
block
|
|
205
231
|
w-full
|
|
@@ -208,64 +234,61 @@ onDestroy(() => {
|
|
|
208
234
|
shadow-sm
|
|
209
235
|
focus:border-indigo-300 focus:ring focus:ring-indigo-200 focus:ring-opacity-50
|
|
210
236
|
"
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
237
|
+
placeholder="A description to help users understand what this script does and how to use it."
|
|
238
|
+
rows="3"
|
|
239
|
+
/>
|
|
240
|
+
</span>
|
|
241
|
+
</label>
|
|
216
242
|
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
243
|
+
<label class="block">
|
|
244
|
+
<span class="text-gray-700 mr-2">Save as template</span>
|
|
245
|
+
<input type="checkbox" bind:checked={script.is_template} />
|
|
246
|
+
</label>
|
|
221
247
|
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
248
|
+
<label class="block">
|
|
249
|
+
<span class="text-gray-700 mr-2">Save as trigger script</span>
|
|
250
|
+
<input
|
|
251
|
+
disabled={script.language == 'python3'}
|
|
252
|
+
type="checkbox"
|
|
253
|
+
bind:checked={script.is_trigger}
|
|
254
|
+
on:change={() => {
|
|
255
|
+
if (
|
|
256
|
+
script.content == DENO_INIT_CODE ||
|
|
257
|
+
script.content == DENO_INIT_CODE_TRIGGER ||
|
|
258
|
+
script.content == POSTGRES_INIT_CODE
|
|
259
|
+
) {
|
|
260
|
+
initContent(script.language, template)
|
|
261
|
+
}
|
|
262
|
+
}}
|
|
263
|
+
/>
|
|
264
|
+
</label>
|
|
235
265
|
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
266
|
+
<div>
|
|
267
|
+
<h3 class="text-gray-700 ">Description rendered</h3>
|
|
268
|
+
<div
|
|
269
|
+
class="prose mt-5 text-xs shadow-inner shadow-blue p-4 overflow-auto"
|
|
270
|
+
style="max-height: 200px;"
|
|
271
|
+
>
|
|
272
|
+
<SvelteMarkdown source={script.description ?? ''} />
|
|
273
|
+
</div>
|
|
243
274
|
</div>
|
|
244
275
|
</div>
|
|
245
|
-
</
|
|
276
|
+
</CenteredPage>
|
|
246
277
|
{:else if step === 2}
|
|
247
|
-
<
|
|
248
|
-
|
|
249
|
-
bind:this={editor}
|
|
250
|
-
bind:schema={script.schema}
|
|
251
|
-
path={script.path}
|
|
252
|
-
bind:code={script.content}
|
|
253
|
-
lang={script.language}
|
|
254
|
-
/>
|
|
255
|
-
</div>
|
|
256
|
-
{:else if step === 3}
|
|
257
|
-
<ScriptSchema
|
|
258
|
-
bind:summary={script.summary}
|
|
259
|
-
bind:description={script.description}
|
|
278
|
+
<ScriptEditor
|
|
279
|
+
bind:this={editor}
|
|
260
280
|
bind:schema={script.schema}
|
|
281
|
+
path={script.path}
|
|
282
|
+
bind:code={script.content}
|
|
283
|
+
lang={script.language}
|
|
261
284
|
/>
|
|
285
|
+
{:else if step === 3}
|
|
286
|
+
<CenteredPage>
|
|
287
|
+
<ScriptSchema
|
|
288
|
+
bind:summary={script.summary}
|
|
289
|
+
bind:description={script.description}
|
|
290
|
+
bind:schema={script.schema}
|
|
291
|
+
/>
|
|
292
|
+
</CenteredPage>
|
|
262
293
|
{/if}
|
|
263
294
|
</div>
|
|
264
|
-
|
|
265
|
-
<style>
|
|
266
|
-
/* .wizard-nav {
|
|
267
|
-
@apply w-1/2 sm:w-1/4;
|
|
268
|
-
} */
|
|
269
|
-
.wizard-nav button {
|
|
270
|
-
max-height: 30px;
|
|
271
|
-
}</style>
|