windmill-components 1.510.1 → 1.511.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/package/components/AppConnectInner.svelte +28 -5
- package/package/components/ArgInput.svelte +14 -4
- package/package/components/Editor.svelte +108 -84
- package/package/components/Editor.svelte.d.ts +30 -55
- package/package/components/FlowPreviewContent.svelte +1 -0
- package/package/components/FlowPreviewContent.svelte.d.ts +3 -0
- package/package/components/FlowStatusViewer.svelte +2 -1
- package/package/components/FlowStatusViewer.svelte.d.ts +3 -0
- package/package/components/FlowStatusViewerInner.svelte +3 -1
- package/package/components/FlowStatusViewerInner.svelte.d.ts +3 -0
- package/package/components/HttpAgentWorkerDrawer.svelte +1 -1
- package/package/components/JsonEditor.svelte +11 -11
- package/package/components/JsonEditor.svelte.d.ts +14 -56
- package/package/components/Label.svelte +6 -11
- package/package/components/Label.svelte.d.ts +14 -39
- package/package/components/NumberTypeNarrowing.svelte +13 -16
- package/package/components/NumberTypeNarrowing.svelte.d.ts +4 -18
- package/package/components/ResourceTypePicker.svelte +20 -17
- package/package/components/ResourceTypePicker.svelte.d.ts +7 -6
- package/package/components/Section.svelte +7 -20
- package/package/components/Section.svelte.d.ts +20 -47
- package/package/components/SimpleEditor.svelte +4 -4
- package/package/components/SimpleEditor.svelte.d.ts +1 -0
- package/package/components/SqlRepl.svelte +0 -1
- package/package/components/Subsection.svelte +10 -12
- package/package/components/Subsection.svelte.d.ts +15 -39
- package/package/components/WorkerGroup.svelte +260 -165
- package/package/components/WorkerGroup.svelte.d.ts +2 -0
- package/package/components/WorkerTagPicker.svelte +3 -3
- package/package/components/WorkerTagSelect.svelte +3 -3
- package/package/components/copilot/AIFormSettings.svelte +3 -4
- package/package/components/copilot/AIFormSettings.svelte.d.ts +5 -19
- package/package/components/copilot/autocomplete/Autocompletor.d.ts +3 -1
- package/package/components/copilot/autocomplete/Autocompletor.js +250 -34
- package/package/components/copilot/autocomplete/request.d.ts +3 -0
- package/package/components/copilot/autocomplete/request.js +15 -7
- package/package/components/copilot/chat/script/core.js +30 -22
- package/package/components/copilot/lib.d.ts +1 -1
- package/package/components/copilot/lib.js +3 -0
- package/package/components/custom_ui.d.ts +1 -0
- package/package/components/flows/content/FlowModuleCache.svelte +4 -4
- package/package/components/flows/content/FlowModuleCache.svelte.d.ts +4 -18
- package/package/components/flows/content/FlowModuleComponent.svelte +1 -1
- package/package/components/flows/content/FlowModuleDeleteAfterUse.svelte +3 -4
- package/package/components/flows/content/FlowModuleDeleteAfterUse.svelte.d.ts +4 -18
- package/package/components/flows/content/FlowModuleSleep.svelte +6 -7
- package/package/components/flows/content/FlowModuleSleep.svelte.d.ts +4 -18
- package/package/components/flows/content/FlowModuleSuspend.svelte +19 -17
- package/package/components/flows/content/FlowModuleSuspend.svelte.d.ts +4 -18
- package/package/components/flows/content/FlowModuleTimeout.svelte +4 -4
- package/package/components/flows/content/FlowModuleTimeout.svelte.d.ts +4 -18
- package/package/components/triggers/gcp/GcpTriggerEditorInner.svelte +4 -4
- package/package/components/triggers/http/OpenAPISpecGenerator.svelte +2 -2
- package/package/components/triggers/http/RouteEditorConfigSection.svelte +26 -23
- package/package/components/triggers/http/RouteEditorConfigSection.svelte.d.ts +5 -19
- package/package/components/triggers/http/RouteEditorInner.svelte +18 -18
- package/package/components/triggers/kafka/KafkaTriggerEditorInner.svelte +4 -4
- package/package/components/triggers/mqtt/MqttTriggerEditorInner.svelte +4 -4
- package/package/components/triggers/nats/NatsTriggerEditorInner.svelte +4 -4
- package/package/components/triggers/schedules/ScheduleEditorInner.svelte +4 -4
- package/package/components/triggers/sqs/SqsTriggerEditorInner.svelte +4 -4
- package/package/components/triggers/websocket/WebsocketTriggerEditorInner.svelte +4 -4
- package/package/gen/core/OpenAPI.js +1 -1
- package/package/gen/schemas.gen.d.ts +26 -18
- package/package/gen/schemas.gen.js +29 -21
- package/package/gen/types.gen.d.ts +25 -6
- package/package/inferArgSig.d.ts +14 -7
- package/package/inferArgSig.js +22 -15
- package/package.json +12 -12
|
@@ -1,41 +1,17 @@
|
|
|
1
|
-
interface
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
interface Props {
|
|
2
|
+
label?: string | undefined;
|
|
3
|
+
tooltip?: string | undefined;
|
|
4
|
+
eeOnly?: boolean;
|
|
5
|
+
collapsable?: boolean;
|
|
6
|
+
collapsed?: boolean;
|
|
7
|
+
openInitially?: boolean;
|
|
8
|
+
headless?: boolean;
|
|
9
|
+
class?: string | undefined;
|
|
10
|
+
header?: import('svelte').Snippet;
|
|
11
|
+
action?: import('svelte').Snippet;
|
|
12
|
+
badge?: import('svelte').Snippet;
|
|
13
|
+
children?: import('svelte').Snippet;
|
|
13
14
|
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
} ? Props extends Record<string, never> ? any : {
|
|
17
|
-
children?: any;
|
|
18
|
-
} : {});
|
|
19
|
-
declare const Subsection: $$__sveltets_2_IsomorphicComponent<$$__sveltets_2_PropsWithChildren<{
|
|
20
|
-
[x: string]: any;
|
|
21
|
-
label?: string | undefined | undefined;
|
|
22
|
-
tooltip?: string | undefined | undefined;
|
|
23
|
-
eeOnly?: boolean | undefined;
|
|
24
|
-
collapsable?: boolean | undefined;
|
|
25
|
-
collapsed?: boolean | undefined;
|
|
26
|
-
headless?: boolean | undefined;
|
|
27
|
-
}, {
|
|
28
|
-
header: {};
|
|
29
|
-
action: {};
|
|
30
|
-
badge: {};
|
|
31
|
-
default: {};
|
|
32
|
-
}>, {
|
|
33
|
-
[evt: string]: CustomEvent<any>;
|
|
34
|
-
}, {
|
|
35
|
-
header: {};
|
|
36
|
-
action: {};
|
|
37
|
-
badge: {};
|
|
38
|
-
default: {};
|
|
39
|
-
}, {}, string>;
|
|
40
|
-
type Subsection = InstanceType<typeof Subsection>;
|
|
15
|
+
declare const Subsection: import("svelte").Component<Props, {}, "collapsed">;
|
|
16
|
+
type Subsection = ReturnType<typeof Subsection>;
|
|
41
17
|
export default Subsection;
|
|
@@ -21,6 +21,7 @@ import TagsToListenTo from './TagsToListenTo.svelte';
|
|
|
21
21
|
import Select from './select/Select.svelte';
|
|
22
22
|
import MultiSelect from './select/MultiSelect.svelte';
|
|
23
23
|
import { safeSelectItems } from './select/utils.svelte';
|
|
24
|
+
import Subsection from './Subsection.svelte';
|
|
24
25
|
function computeVCpuAndMemory(workers) {
|
|
25
26
|
let vcpus = 0;
|
|
26
27
|
let memory = 0;
|
|
@@ -96,13 +97,13 @@ async function deleteWorkerGroup() {
|
|
|
96
97
|
dispatch('reload');
|
|
97
98
|
}
|
|
98
99
|
let dirty = $state(false);
|
|
99
|
-
let dirtyCode = $state(false);
|
|
100
100
|
let openDelete = $state(false);
|
|
101
101
|
let openClean = $state(false);
|
|
102
102
|
let drawer = $state();
|
|
103
103
|
let vcpus_memory = $derived(computeVCpuAndMemory(workers));
|
|
104
104
|
let selected = $derived(nconfig?.dedicated_worker != undefined ? 'dedicated' : 'normal');
|
|
105
105
|
$effect(() => {
|
|
106
|
+
;
|
|
106
107
|
($superadmin || $devopsRole) && listWorkspaces();
|
|
107
108
|
});
|
|
108
109
|
</script>
|
|
@@ -157,7 +158,7 @@ $effect(() => {
|
|
|
157
158
|
<Drawer bind:this={drawer} size="800px">
|
|
158
159
|
<DrawerContent
|
|
159
160
|
on:close={() => drawer?.closeDrawer()}
|
|
160
|
-
title={
|
|
161
|
+
title={$superadmin || $devopsRole ? `Edit worker config '${name}'` : `Worker config '${name}'`}
|
|
161
162
|
>
|
|
162
163
|
{#if !$enterpriseLicense}
|
|
163
164
|
<Alert type="warning" title="Worker management UI is EE only">
|
|
@@ -359,147 +360,35 @@ $effect(() => {
|
|
|
359
360
|
</Section>
|
|
360
361
|
{/if}
|
|
361
362
|
{:else if selected == 'dedicated'}
|
|
362
|
-
|
|
363
|
-
<input
|
|
364
|
-
disabled={!($superadmin || $devopsRole)}
|
|
365
|
-
placeholder="<workspace>:<script path>"
|
|
366
|
-
type="text"
|
|
367
|
-
onchange={() => {
|
|
368
|
-
dirtyCode = true
|
|
369
|
-
dirty = true
|
|
370
|
-
}}
|
|
371
|
-
bind:value={nconfig.dedicated_worker}
|
|
372
|
-
/>
|
|
363
|
+
<div class="flex flex-col gap-2">
|
|
373
364
|
{#if $superadmin || $devopsRole}
|
|
374
|
-
<div class="py-2"
|
|
375
|
-
|
|
365
|
+
<div class="py-2">
|
|
366
|
+
<Alert
|
|
367
|
+
size="xs"
|
|
376
368
|
type="info"
|
|
377
369
|
title="Script's runtime setting 'dedicated worker' must be toggled on as well"
|
|
378
|
-
|
|
379
|
-
>
|
|
380
|
-
<p class="text-2xs text-tertiary mt-2"
|
|
381
|
-
>Workers will get killed upon detecting this setting change. It is assumed they are in
|
|
382
|
-
an environment where the supervisor will restart them. Upon restart, they will pick the
|
|
383
|
-
new dedicated worker config.</p
|
|
384
|
-
>
|
|
385
|
-
{/if}
|
|
386
|
-
{/if}
|
|
387
|
-
{/if}
|
|
388
|
-
|
|
389
|
-
<div class="mt-8"></div>
|
|
390
|
-
<Section
|
|
391
|
-
label="Python runtime settings"
|
|
392
|
-
collapsable={true}
|
|
393
|
-
tooltip="Add Python runtime specific settings like additional python paths and PIP local dependencies"
|
|
394
|
-
>
|
|
395
|
-
<div class="flex flex-col gap-3 gap-y-2 pb-2 max-w">
|
|
396
|
-
<span class="text-sm text-primary">Additional Python Paths</span>
|
|
397
|
-
{#if nconfig.additional_python_paths}
|
|
398
|
-
{#each nconfig.additional_python_paths as _, i}
|
|
399
|
-
<div class="flex gap-1 items-center">
|
|
400
|
-
<input
|
|
401
|
-
type="text"
|
|
402
|
-
disabled={!($superadmin || $devopsRole)}
|
|
403
|
-
placeholder="/path/to/python3.X/site-packages"
|
|
404
|
-
bind:value={nconfig.additional_python_paths![i]}
|
|
405
|
-
/>
|
|
406
|
-
{#if $superadmin || $devopsRole}
|
|
407
|
-
<button
|
|
408
|
-
class="rounded-full bg-surface/60 hover:bg-gray-200"
|
|
409
|
-
aria-label="Clear"
|
|
410
|
-
onclick={() => {
|
|
411
|
-
if (
|
|
412
|
-
nconfig.additional_python_paths === undefined ||
|
|
413
|
-
nconfig.additional_python_paths.length == 0
|
|
414
|
-
) {
|
|
415
|
-
return
|
|
416
|
-
}
|
|
417
|
-
nconfig.additional_python_paths.splice(i, 1)
|
|
418
|
-
nconfig.additional_python_paths = [...nconfig.additional_python_paths]
|
|
419
|
-
dirty = true
|
|
420
|
-
}}
|
|
421
|
-
>
|
|
422
|
-
<X size={14} />
|
|
423
|
-
</button>
|
|
424
|
-
{/if}
|
|
425
|
-
</div>
|
|
426
|
-
{/each}
|
|
427
|
-
{/if}
|
|
428
|
-
{#if $superadmin || $devopsRole}
|
|
429
|
-
<div class="flex">
|
|
430
|
-
<Button
|
|
431
|
-
variant="contained"
|
|
432
|
-
color="blue"
|
|
433
|
-
size="xs"
|
|
434
|
-
startIcon={{ icon: Plus }}
|
|
435
|
-
on:click={() => {
|
|
436
|
-
if (nconfig.additional_python_paths === undefined) {
|
|
437
|
-
nconfig.additional_python_paths = []
|
|
438
|
-
}
|
|
439
|
-
nconfig.additional_python_paths.push('')
|
|
440
|
-
nconfig.additional_python_paths = [...nconfig.additional_python_paths]
|
|
441
|
-
dirty = true
|
|
442
|
-
}}
|
|
443
|
-
>
|
|
444
|
-
Add additional Python path
|
|
445
|
-
</Button>
|
|
370
|
+
/>
|
|
446
371
|
</div>
|
|
447
372
|
{/if}
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
{#if $superadmin || $devopsRole}
|
|
460
|
-
<button
|
|
461
|
-
class="rounded-full bg-surface/60 hover:bg-gray-200"
|
|
462
|
-
aria-label="Clear"
|
|
463
|
-
onclick={() => {
|
|
464
|
-
if (
|
|
465
|
-
nconfig.pip_local_dependencies === undefined ||
|
|
466
|
-
nconfig.pip_local_dependencies.length == 0
|
|
467
|
-
) {
|
|
468
|
-
return
|
|
469
|
-
}
|
|
470
|
-
nconfig.pip_local_dependencies.splice(i, 1)
|
|
471
|
-
nconfig.pip_local_dependencies = [...nconfig.pip_local_dependencies]
|
|
472
|
-
dirty = true
|
|
473
|
-
}}
|
|
474
|
-
>
|
|
475
|
-
<X size={14} />
|
|
476
|
-
</button>
|
|
477
|
-
{/if}
|
|
478
|
-
</div>
|
|
479
|
-
{/each}
|
|
480
|
-
{/if}
|
|
481
|
-
{#if $superadmin || $devopsRole}
|
|
482
|
-
<div class="flex">
|
|
483
|
-
<Button
|
|
484
|
-
variant="contained"
|
|
485
|
-
color="blue"
|
|
486
|
-
size="xs"
|
|
487
|
-
startIcon={{ icon: Plus }}
|
|
488
|
-
on:click={() => {
|
|
489
|
-
if (nconfig.pip_local_dependencies === undefined) {
|
|
490
|
-
nconfig.pip_local_dependencies = []
|
|
491
|
-
}
|
|
492
|
-
nconfig.pip_local_dependencies.push('')
|
|
493
|
-
nconfig.pip_local_dependencies = [...nconfig.pip_local_dependencies]
|
|
373
|
+
{#if nconfig?.dedicated_worker != undefined}
|
|
374
|
+
<div
|
|
375
|
+
><p class="text-xs mb-2"
|
|
376
|
+
>Workers will get killed upon detecting changes. It is assumed they are in an
|
|
377
|
+
environment where the supervisor will restart them.</p
|
|
378
|
+
>
|
|
379
|
+
<input
|
|
380
|
+
disabled={!($superadmin || $devopsRole)}
|
|
381
|
+
placeholder="<workspace>:<script path>"
|
|
382
|
+
type="text"
|
|
383
|
+
onchange={() => {
|
|
494
384
|
dirty = true
|
|
495
385
|
}}
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
</div>
|
|
386
|
+
bind:value={nconfig.dedicated_worker}
|
|
387
|
+
/></div
|
|
388
|
+
>
|
|
500
389
|
{/if}
|
|
501
390
|
</div>
|
|
502
|
-
|
|
391
|
+
{/if}
|
|
503
392
|
|
|
504
393
|
<div class="mt-8"></div>
|
|
505
394
|
|
|
@@ -659,40 +548,239 @@ $effect(() => {
|
|
|
659
548
|
bind:config={nconfig.autoscaling}
|
|
660
549
|
/>
|
|
661
550
|
</Section>
|
|
551
|
+
|
|
552
|
+
<div class="mt-8"></div>
|
|
553
|
+
<Section label="Python dependencies overrides" collapsable={true}>
|
|
554
|
+
<div class="flex flex-col gap-3 gap-y-6 pb-2 max-w">
|
|
555
|
+
<Subsection
|
|
556
|
+
label="Additional Python Paths"
|
|
557
|
+
tooltip="Paths to add to the Python path for it to search dependencies, useful if you have packages pre-installed on the workers at a given path."
|
|
558
|
+
>
|
|
559
|
+
{#if nconfig.additional_python_paths}
|
|
560
|
+
{#each nconfig.additional_python_paths as _, i}
|
|
561
|
+
<div class="flex gap-1 items-center">
|
|
562
|
+
<input
|
|
563
|
+
type="text"
|
|
564
|
+
disabled={!($superadmin || $devopsRole)}
|
|
565
|
+
placeholder="/path/to/python3.X/site-packages"
|
|
566
|
+
bind:value={nconfig.additional_python_paths![i]}
|
|
567
|
+
/>
|
|
568
|
+
{#if $superadmin || $devopsRole}
|
|
569
|
+
<button
|
|
570
|
+
class="rounded-full bg-surface/60 hover:bg-gray-200"
|
|
571
|
+
aria-label="Clear"
|
|
572
|
+
onclick={() => {
|
|
573
|
+
if (
|
|
574
|
+
nconfig.additional_python_paths === undefined ||
|
|
575
|
+
nconfig.additional_python_paths.length == 0
|
|
576
|
+
) {
|
|
577
|
+
return
|
|
578
|
+
}
|
|
579
|
+
nconfig.additional_python_paths.splice(i, 1)
|
|
580
|
+
nconfig.additional_python_paths = [...nconfig.additional_python_paths]
|
|
581
|
+
dirty = true
|
|
582
|
+
}}
|
|
583
|
+
>
|
|
584
|
+
<X size={14} />
|
|
585
|
+
</button>
|
|
586
|
+
{/if}
|
|
587
|
+
</div>
|
|
588
|
+
{/each}
|
|
589
|
+
{/if}
|
|
590
|
+
{#if $superadmin || $devopsRole}
|
|
591
|
+
<div class="flex">
|
|
592
|
+
<Button
|
|
593
|
+
variant="contained"
|
|
594
|
+
color="blue"
|
|
595
|
+
size="xs"
|
|
596
|
+
startIcon={{ icon: Plus }}
|
|
597
|
+
on:click={() => {
|
|
598
|
+
if (nconfig.additional_python_paths === undefined) {
|
|
599
|
+
nconfig.additional_python_paths = []
|
|
600
|
+
}
|
|
601
|
+
nconfig.additional_python_paths.push('')
|
|
602
|
+
nconfig.additional_python_paths = [...nconfig.additional_python_paths]
|
|
603
|
+
dirty = true
|
|
604
|
+
}}
|
|
605
|
+
>
|
|
606
|
+
Add additional Python path
|
|
607
|
+
</Button>
|
|
608
|
+
</div>
|
|
609
|
+
{/if}
|
|
610
|
+
</Subsection>
|
|
611
|
+
<Subsection
|
|
612
|
+
label="Local dependencies import names to skip during resolution"
|
|
613
|
+
tooltip="uv will not try to resolve dependencies for these packages, useful if you have packages pre-installed on the workers at a given path."
|
|
614
|
+
>
|
|
615
|
+
{#if nconfig.pip_local_dependencies}
|
|
616
|
+
{#each nconfig.pip_local_dependencies as _, i}
|
|
617
|
+
<div class="flex gap-1 items-center">
|
|
618
|
+
<input
|
|
619
|
+
disabled={!($superadmin || $devopsRole)}
|
|
620
|
+
type="text"
|
|
621
|
+
placeholder="httpx"
|
|
622
|
+
bind:value={nconfig.pip_local_dependencies[i]}
|
|
623
|
+
/>
|
|
624
|
+
{#if $superadmin || $devopsRole}
|
|
625
|
+
<button
|
|
626
|
+
class="rounded-full bg-surface/60 hover:bg-gray-200"
|
|
627
|
+
aria-label="Clear"
|
|
628
|
+
onclick={() => {
|
|
629
|
+
if (
|
|
630
|
+
nconfig.pip_local_dependencies === undefined ||
|
|
631
|
+
nconfig.pip_local_dependencies.length == 0
|
|
632
|
+
) {
|
|
633
|
+
return
|
|
634
|
+
}
|
|
635
|
+
nconfig.pip_local_dependencies.splice(i, 1)
|
|
636
|
+
nconfig.pip_local_dependencies = [...nconfig.pip_local_dependencies]
|
|
637
|
+
dirty = true
|
|
638
|
+
}}
|
|
639
|
+
>
|
|
640
|
+
<X size={14} />
|
|
641
|
+
</button>
|
|
642
|
+
{/if}
|
|
643
|
+
</div>
|
|
644
|
+
{/each}
|
|
645
|
+
{/if}
|
|
646
|
+
{#if $superadmin || $devopsRole}
|
|
647
|
+
<div class="flex">
|
|
648
|
+
<Button
|
|
649
|
+
variant="contained"
|
|
650
|
+
color="blue"
|
|
651
|
+
size="xs"
|
|
652
|
+
startIcon={{ icon: Plus }}
|
|
653
|
+
on:click={() => {
|
|
654
|
+
if (nconfig.pip_local_dependencies === undefined) {
|
|
655
|
+
nconfig.pip_local_dependencies = []
|
|
656
|
+
}
|
|
657
|
+
nconfig.pip_local_dependencies.push('')
|
|
658
|
+
nconfig.pip_local_dependencies = [...nconfig.pip_local_dependencies]
|
|
659
|
+
dirty = true
|
|
660
|
+
}}
|
|
661
|
+
>
|
|
662
|
+
Add PIP local dependency
|
|
663
|
+
</Button>
|
|
664
|
+
</div>
|
|
665
|
+
{/if}
|
|
666
|
+
</Subsection>
|
|
667
|
+
</div></Section
|
|
668
|
+
>
|
|
669
|
+
|
|
662
670
|
<div class="mt-8"></div>
|
|
663
671
|
|
|
664
672
|
<Section
|
|
665
|
-
label="
|
|
666
|
-
tooltip="Bash scripts
|
|
673
|
+
label="Worker scripts"
|
|
674
|
+
tooltip="Bash scripts for worker initialization and maintenance. Init scripts run at worker start, periodic scripts run at configurable intervals."
|
|
667
675
|
>
|
|
668
|
-
|
|
669
|
-
<div class="
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
}
|
|
693
|
-
|
|
694
|
-
}
|
|
695
|
-
|
|
676
|
+
{#if $superadmin || $devopsRole}
|
|
677
|
+
<div class="mb-4">
|
|
678
|
+
<Alert size="xs" type="info" title="Worker Restart Required">
|
|
679
|
+
Workers will get killed upon detecting any changes in this section (scripts or
|
|
680
|
+
interval). It is assumed they are in an environment where the supervisor will restart
|
|
681
|
+
them.
|
|
682
|
+
</Alert>
|
|
683
|
+
</div>
|
|
684
|
+
{/if}
|
|
685
|
+
|
|
686
|
+
<div class="space-y-6">
|
|
687
|
+
<div>
|
|
688
|
+
<div class="text-sm text-secondary mb-1">
|
|
689
|
+
Run at start of the workers. More lightweight than requiring custom worker images.
|
|
690
|
+
</div>
|
|
691
|
+
<Subsection
|
|
692
|
+
label="Init script"
|
|
693
|
+
collapsable
|
|
694
|
+
openInitially={nconfig.init_bash !== undefined}
|
|
695
|
+
>
|
|
696
|
+
{#snippet header()}
|
|
697
|
+
<div class="ml-4 flex flex-row gap-2 items-center">
|
|
698
|
+
{#if nconfig.init_bash !== undefined}
|
|
699
|
+
<Badge color="green">Enabled</Badge>
|
|
700
|
+
{/if}
|
|
701
|
+
</div>
|
|
702
|
+
{/snippet}
|
|
703
|
+
<div class="border w-full h-40">
|
|
704
|
+
<Editor
|
|
705
|
+
fixedOverflowWidgets={true}
|
|
706
|
+
disabled={!($superadmin || $devopsRole)}
|
|
707
|
+
class="flex flex-1 grow h-full w-full"
|
|
708
|
+
automaticLayout
|
|
709
|
+
scriptLang={'bash'}
|
|
710
|
+
useWebsockets={false}
|
|
711
|
+
code={config?.init_bash ?? ''}
|
|
712
|
+
on:change={(e) => {
|
|
713
|
+
if (config) {
|
|
714
|
+
dirty = true
|
|
715
|
+
const code = e.detail
|
|
716
|
+
if (code != '') {
|
|
717
|
+
nconfig.init_bash = code?.replace(/\r\n/g, '\n')
|
|
718
|
+
} else {
|
|
719
|
+
nconfig.init_bash = undefined
|
|
720
|
+
}
|
|
721
|
+
}
|
|
722
|
+
}}
|
|
723
|
+
/>
|
|
724
|
+
</div>
|
|
725
|
+
</Subsection>
|
|
726
|
+
</div>
|
|
727
|
+
<div>
|
|
728
|
+
<div class="text-sm mb-1 text-secondary">
|
|
729
|
+
Run periodically at configurable intervals. Useful for maintenance tasks like cleaning
|
|
730
|
+
disk space.
|
|
731
|
+
</div>
|
|
732
|
+
<Subsection
|
|
733
|
+
label="Periodic script"
|
|
734
|
+
collapsable
|
|
735
|
+
openInitially={nconfig.periodic_script_bash !== undefined}
|
|
736
|
+
>
|
|
737
|
+
{#snippet header()}
|
|
738
|
+
<div class="ml-4 flex flex-row gap-2 items-center">
|
|
739
|
+
{#if nconfig.periodic_script_bash !== undefined}
|
|
740
|
+
<Badge color="green">Enabled</Badge>
|
|
741
|
+
{/if}
|
|
742
|
+
</div>
|
|
743
|
+
{/snippet}
|
|
744
|
+
|
|
745
|
+
<div class="flex gap-4 items-center mb-4">
|
|
746
|
+
<Label class="text-sm">Execution interval (seconds):</Label>
|
|
747
|
+
<input
|
|
748
|
+
disabled={!($superadmin || $devopsRole)}
|
|
749
|
+
type="number"
|
|
750
|
+
min="60"
|
|
751
|
+
placeholder="3600"
|
|
752
|
+
class="!w-24 text-center"
|
|
753
|
+
bind:value={nconfig.periodic_script_interval_seconds}
|
|
754
|
+
onchange={() => {
|
|
755
|
+
dirty = true
|
|
756
|
+
}}
|
|
757
|
+
/>
|
|
758
|
+
<span class="text-xs text-gray-500">Minimum: 60 seconds</span>
|
|
759
|
+
</div>
|
|
760
|
+
|
|
761
|
+
<div class="border w-full h-40">
|
|
762
|
+
<Editor
|
|
763
|
+
disabled={!($superadmin || $devopsRole)}
|
|
764
|
+
class="flex flex-1 grow h-full w-full"
|
|
765
|
+
automaticLayout
|
|
766
|
+
scriptLang={'bash'}
|
|
767
|
+
useWebsockets={false}
|
|
768
|
+
fixedOverflowWidgets={false}
|
|
769
|
+
code={config?.periodic_script_bash ?? ''}
|
|
770
|
+
on:change={(e) => {
|
|
771
|
+
if (config) {
|
|
772
|
+
dirty = true
|
|
773
|
+
const code = e.detail
|
|
774
|
+
if (code != '') {
|
|
775
|
+
nconfig.periodic_script_bash = code?.replace(/\r\n/g, '\n')
|
|
776
|
+
} else {
|
|
777
|
+
nconfig.periodic_script_bash = undefined
|
|
778
|
+
}
|
|
779
|
+
}
|
|
780
|
+
}}
|
|
781
|
+
/>
|
|
782
|
+
</div>
|
|
783
|
+
</Subsection>
|
|
696
784
|
</div>
|
|
697
785
|
</div>
|
|
698
786
|
</Section>
|
|
@@ -713,6 +801,14 @@ $effect(() => {
|
|
|
713
801
|
sendUserToast('Minimum alive workers alert threshold must be at least 1', true)
|
|
714
802
|
return
|
|
715
803
|
}
|
|
804
|
+
if (
|
|
805
|
+
nconfig?.periodic_script_bash &&
|
|
806
|
+
(!nconfig?.periodic_script_interval_seconds ||
|
|
807
|
+
nconfig?.periodic_script_interval_seconds < 60)
|
|
808
|
+
) {
|
|
809
|
+
sendUserToast('Periodic script interval must be at least 60 seconds', true)
|
|
810
|
+
return
|
|
811
|
+
}
|
|
716
812
|
// Remove duplicate env vars by keeping only the last occurrence of each key
|
|
717
813
|
const seenKeys = new Set()
|
|
718
814
|
customEnvVars = customEnvVars
|
|
@@ -748,7 +844,6 @@ $effect(() => {
|
|
|
748
844
|
sendUserToast('Configuration set')
|
|
749
845
|
dispatch('reload')
|
|
750
846
|
dirty = false
|
|
751
|
-
dirtyCode = false
|
|
752
847
|
}}
|
|
753
848
|
disabled={(!dirty && nconfig?.dedicated_worker == undefined) ||
|
|
754
849
|
!$enterpriseLicense ||
|
|
@@ -12,6 +12,8 @@ interface Props {
|
|
|
12
12
|
pip_local_dependencies?: string[];
|
|
13
13
|
min_alive_workers_alert_threshold?: number;
|
|
14
14
|
autoscaling?: AutoscalingConfig;
|
|
15
|
+
periodic_script_bash?: string;
|
|
16
|
+
periodic_script_interval_seconds?: number;
|
|
15
17
|
};
|
|
16
18
|
activeWorkers: number;
|
|
17
19
|
customTags: string[] | undefined;
|
|
@@ -6,8 +6,8 @@ import { WorkerService } from '../gen';
|
|
|
6
6
|
import WorkerTagSelect from './WorkerTagSelect.svelte';
|
|
7
7
|
let { tag = $bindable(), popupPlacement = 'bottom-end', disabled = false, placeholder } = $props();
|
|
8
8
|
loadWorkerTags();
|
|
9
|
-
async function loadWorkerTags() {
|
|
10
|
-
if (!$workerTags) {
|
|
9
|
+
async function loadWorkerTags(force = false) {
|
|
10
|
+
if (!$workerTags || force) {
|
|
11
11
|
$workerTags = await WorkerService.getCustomTags({ workspace: $workspaceStore });
|
|
12
12
|
}
|
|
13
13
|
}
|
|
@@ -43,7 +43,7 @@ async function loadWorkerTags() {
|
|
|
43
43
|
color="light"
|
|
44
44
|
on:click={() => {
|
|
45
45
|
$workerTags = undefined
|
|
46
|
-
loadWorkerTags()
|
|
46
|
+
loadWorkerTags(true)
|
|
47
47
|
}}
|
|
48
48
|
startIcon={{ icon: RotateCw }}
|
|
49
49
|
{disabled}
|
|
@@ -10,10 +10,10 @@ let { tag = $bindable(), noLabel = false, nullTag = undefined, disabled = false,
|
|
|
10
10
|
let loading = $state(false);
|
|
11
11
|
loadWorkerGroups();
|
|
12
12
|
const dispatch = createEventDispatcher();
|
|
13
|
-
async function loadWorkerGroups() {
|
|
13
|
+
async function loadWorkerGroups(force = false) {
|
|
14
14
|
loading = true;
|
|
15
15
|
try {
|
|
16
|
-
if (!$workerTags) {
|
|
16
|
+
if (!$workerTags || force) {
|
|
17
17
|
$workerTags = await WorkerService.getCustomTags({ workspace: $workspaceStore });
|
|
18
18
|
}
|
|
19
19
|
}
|
|
@@ -54,7 +54,7 @@ let open = $state(false);
|
|
|
54
54
|
size="xs"
|
|
55
55
|
startIcon={{ icon: RotateCw, classes: loading ? 'animate-spin' : '' }}
|
|
56
56
|
on:click={async () => {
|
|
57
|
-
loadWorkerGroups()
|
|
57
|
+
loadWorkerGroups(true)
|
|
58
58
|
open = true
|
|
59
59
|
}}
|
|
60
60
|
></Button>
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
<script lang="ts">import Label from '../Label.svelte';
|
|
2
2
|
import Toggle from '../Toggle.svelte';
|
|
3
3
|
import Tooltip from '../Tooltip.svelte';
|
|
4
|
-
|
|
5
|
-
export let type = 'script';
|
|
4
|
+
let { prompt = $bindable(undefined), type = 'script' } = $props();
|
|
6
5
|
</script>
|
|
7
6
|
|
|
8
7
|
<div class="flex flex-col gap-2">
|
|
@@ -22,13 +21,13 @@ export let type = 'script';
|
|
|
22
21
|
/>
|
|
23
22
|
{#if prompt !== undefined}
|
|
24
23
|
<Label label="Additional prompt for AI">
|
|
25
|
-
|
|
24
|
+
{#snippet header()}
|
|
26
25
|
<Tooltip>
|
|
27
26
|
AI will use script description and each field description to fill the inputs form. In
|
|
28
27
|
addition, any prompt passed here will be used by AI to guide it. You can mention specific
|
|
29
28
|
fields and interaction between fields here.
|
|
30
29
|
</Tooltip>
|
|
31
|
-
|
|
30
|
+
{/snippet}
|
|
32
31
|
<textarea bind:value={prompt} placeholder="Instructions for the AI about how to fill the form"
|
|
33
32
|
></textarea>
|
|
34
33
|
</Label>
|
|
@@ -1,21 +1,7 @@
|
|
|
1
|
-
interface
|
|
2
|
-
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
3
|
-
$$bindings?: Bindings;
|
|
4
|
-
} & Exports;
|
|
5
|
-
(internal: unknown, props: Props & {
|
|
6
|
-
$$events?: Events;
|
|
7
|
-
$$slots?: Slots;
|
|
8
|
-
}): Exports & {
|
|
9
|
-
$set?: any;
|
|
10
|
-
$on?: any;
|
|
11
|
-
};
|
|
12
|
-
z_$$bindings?: Bindings;
|
|
13
|
-
}
|
|
14
|
-
declare const AiFormSettings: $$__sveltets_2_IsomorphicComponent<{
|
|
1
|
+
interface Props {
|
|
15
2
|
prompt?: string | undefined;
|
|
16
|
-
type?:
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
type AiFormSettings = InstanceType<typeof AiFormSettings>;
|
|
3
|
+
type?: 'flow' | 'script';
|
|
4
|
+
}
|
|
5
|
+
declare const AiFormSettings: import("svelte").Component<Props, {}, "prompt">;
|
|
6
|
+
type AiFormSettings = ReturnType<typeof AiFormSettings>;
|
|
21
7
|
export default AiFormSettings;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import type { AIProviderModel, ScriptLang } from '../../../gen';
|
|
2
|
-
import {
|
|
2
|
+
import { editor as meditor } from 'monaco-editor';
|
|
3
|
+
import type { MonacoLanguageClient } from 'monaco-languageclient';
|
|
3
4
|
export declare class Autocompletor {
|
|
4
5
|
#private;
|
|
5
6
|
constructor(editor: meditor.IStandaloneCodeEditor, scriptLang: ScriptLang | 'bunnative' | 'jsx' | 'tsx' | 'json');
|
|
6
7
|
static isProviderModelSupported(providerModel: AIProviderModel | undefined): boolean | undefined;
|
|
7
8
|
dispose(): void;
|
|
9
|
+
setLanguageClient(client: MonacoLanguageClient): void;
|
|
8
10
|
}
|