windmill-components 1.269.0 → 1.269.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package/components/ContentSearch.svelte +4 -3
- package/package/components/ContentSearch.svelte.d.ts +3 -0
- package/package/components/DeployWorkspace.svelte.d.ts +1 -1
- package/package/components/DeployWorkspaceDrawer.svelte.d.ts +2 -2
- package/package/components/Editor.svelte +1 -1
- package/package/components/EditorBar.svelte +2 -1
- package/package/components/FlowBuilder.svelte +5 -5
- package/package/components/FlowBuilder.svelte.d.ts +3 -0
- package/package/components/InputTransformForm.svelte +5 -2
- package/package/components/InstanceSettings.svelte +157 -118
- package/package/components/JobArgs.svelte +0 -1
- package/package/components/JobArgs.svelte.d.ts +0 -1
- package/package/components/MoveDrawer.svelte.d.ts +2 -2
- package/package/components/Path.svelte +6 -1
- package/package/components/Path.svelte.d.ts +1 -1
- package/package/components/ScriptBuilder.svelte +8 -2
- package/package/components/ScriptEditor.svelte +1 -1
- package/package/components/ShareModal.svelte.d.ts +2 -2
- package/package/components/SupabaseConnect.svelte +7 -2
- package/package/components/apps/components/display/AppScatterChart.svelte +1 -1
- package/package/components/apps/components/helpers/RunnableComponent.svelte +2 -1
- package/package/components/apps/components/helpers/RunnableComponent.svelte.d.ts +1 -0
- package/package/components/apps/components/helpers/RunnableWrapper.svelte +1 -0
- package/package/components/apps/components/inputs/AppCheckbox.svelte +9 -3
- package/package/components/apps/editor/AppEditorHeader.svelte +3 -1
- package/package/components/apps/editor/appUtils.js +12 -1
- package/package/components/apps/editor/settingsPanel/TableActions.svelte +1 -1
- package/package/components/apps/editor/settingsPanel/inputEditor/ColorInput.svelte +1 -2
- package/package/components/build_workers.js +13 -10
- package/package/components/common/confirmationModal/UnsavedConfirmationModal.svelte +12 -5
- package/package/components/common/confirmationModal/UnsavedConfirmationModal.svelte.d.ts +3 -0
- package/package/components/common/confirmationModal/model.d.ts +9 -0
- package/package/components/common/confirmationModal/model.js +1 -0
- package/package/components/common/fileDownload/FileDownload.svelte +2 -2
- package/package/components/common/fileInput/FileInput.svelte +1 -1
- package/package/components/copilot/lib.d.ts +3 -3
- package/package/components/graph/svelvet/types/index.d.ts +1 -1
- package/package/components/graph/svelvet/types/index.js +1 -1
- package/package/components/home/ItemsList.svelte +6 -1
- package/package/components/instanceSettings.js +1 -8
- package/package/components/jobs/JobPreview.svelte +1 -1
- package/package/components/sidebar/MultiplayerMenu.svelte +1 -1
- package/package/components/table/AutoDataTable.svelte +17 -11
- package/package/gen/core/OpenAPI.js +1 -1
- package/package/gen/models/GitRepositorySettings.d.ts +1 -0
- package/package/gen/models/WorkspaceGitSyncSettings.d.ts +1 -1
- package/package.json +15 -14
|
@@ -9,8 +9,8 @@ import ToggleButtonGroup from './common/toggleButton-v2/ToggleButtonGroup.svelte
|
|
|
9
9
|
import ToggleButton from './common/toggleButton-v2/ToggleButton.svelte';
|
|
10
10
|
import FlowIcon from './home/FlowIcon.svelte';
|
|
11
11
|
import { Alert, Button } from './common';
|
|
12
|
-
import { goto } from '$app/navigation';
|
|
13
12
|
import YAML from 'yaml';
|
|
13
|
+
import { createEventDispatcher } from 'svelte';
|
|
14
14
|
let search = '';
|
|
15
15
|
export async function open(nsearch) {
|
|
16
16
|
isOpen = true;
|
|
@@ -71,6 +71,7 @@ $: counts =
|
|
|
71
71
|
flows: getCounts(filteredFlowItems.length),
|
|
72
72
|
scripts: getCounts(filteredScriptItems.length)
|
|
73
73
|
};
|
|
74
|
+
const dispatch = createEventDispatcher();
|
|
74
75
|
</script>
|
|
75
76
|
|
|
76
77
|
<SearchItems
|
|
@@ -261,7 +262,7 @@ $: counts =
|
|
|
261
262
|
<div class="flex gap-2">
|
|
262
263
|
<Button
|
|
263
264
|
on:click|once={() => {
|
|
264
|
-
|
|
265
|
+
dispatch('editScript', item.path)
|
|
265
266
|
}}
|
|
266
267
|
color="light"
|
|
267
268
|
size="sm"
|
|
@@ -301,7 +302,7 @@ $: counts =
|
|
|
301
302
|
<div class="flex gap-2">
|
|
302
303
|
<Button
|
|
303
304
|
on:click|once={() => {
|
|
304
|
-
|
|
305
|
+
dispatch('editFlow', item.path)
|
|
305
306
|
}}
|
|
306
307
|
color="light"
|
|
307
308
|
size="sm"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { SvelteComponent } from "svelte";
|
|
2
2
|
declare const __propDef: {
|
|
3
3
|
props: {
|
|
4
|
-
kind: "flow" | "script" | "app" | "folder" | "resource" | "
|
|
4
|
+
kind: "flow" | "script" | "app" | "folder" | "resource" | "variable" | "schedule" | "raw_app" | "resource_type";
|
|
5
5
|
initialPath?: string | undefined;
|
|
6
6
|
workspaceToDeployTo?: string | undefined;
|
|
7
7
|
hideButton?: boolean | undefined;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { SvelteComponent } from "svelte";
|
|
2
2
|
declare const __propDef: {
|
|
3
3
|
props: {
|
|
4
|
-
openDrawer?: ((initialPath_l: string, kind_l: "flow" | "script" | "app" | "resource" | "
|
|
4
|
+
openDrawer?: ((initialPath_l: string, kind_l: "flow" | "script" | "app" | "resource" | "variable" | "schedule" | "raw_app") => Promise<void>) | undefined;
|
|
5
5
|
};
|
|
6
6
|
events: {
|
|
7
7
|
[evt: string]: CustomEvent<any>;
|
|
@@ -12,6 +12,6 @@ export type DeployWorkspaceDrawerProps = typeof __propDef.props;
|
|
|
12
12
|
export type DeployWorkspaceDrawerEvents = typeof __propDef.events;
|
|
13
13
|
export type DeployWorkspaceDrawerSlots = typeof __propDef.slots;
|
|
14
14
|
export default class DeployWorkspaceDrawer extends SvelteComponent<DeployWorkspaceDrawerProps, DeployWorkspaceDrawerEvents, DeployWorkspaceDrawerSlots> {
|
|
15
|
-
get openDrawer(): (initialPath_l: string, kind_l: "flow" | "script" | "app" | "resource" | "
|
|
15
|
+
get openDrawer(): (initialPath_l: string, kind_l: "flow" | "script" | "app" | "resource" | "variable" | "schedule" | "raw_app") => Promise<void>;
|
|
16
16
|
}
|
|
17
17
|
export {};
|
|
@@ -23,7 +23,7 @@ import { createHash as randomHash, editorConfig, langToExt, updateOptions } from
|
|
|
23
23
|
import { buildWorkerDefinition } from './build_workers';
|
|
24
24
|
import { workspaceStore } from '../stores';
|
|
25
25
|
import { Preview, UserService } from '../gen';
|
|
26
|
-
import { initializeMode } from 'monaco-graphql/esm/initializeMode';
|
|
26
|
+
import { initializeMode } from 'monaco-graphql/esm/initializeMode.js';
|
|
27
27
|
import { sleep } from '../utils';
|
|
28
28
|
import { editorCodeCompletion } from './copilot/completion';
|
|
29
29
|
import { initializeVscode } from './vscode';
|
|
@@ -56,7 +56,8 @@ let showResourceTypePicker = false;
|
|
|
56
56
|
$: showContextVarPicker = ['python3', 'bash', 'powershell', 'go', 'deno', 'bun'].includes(lang);
|
|
57
57
|
$: showVarPicker = ['python3', 'bash', 'powershell', 'go', 'deno', 'bun'].includes(lang);
|
|
58
58
|
$: showResourcePicker = ['python3', 'bash', 'powershell', 'go', 'deno', 'bun'].includes(lang);
|
|
59
|
-
$: showResourceTypePicker =
|
|
59
|
+
$: showResourceTypePicker =
|
|
60
|
+
['typescript', 'javascript'].includes(scriptLangToEditorLang(lang)) || lang === 'python3';
|
|
60
61
|
let codeViewer;
|
|
61
62
|
let codeObj = undefined;
|
|
62
63
|
function addEditorActions() {
|
|
@@ -31,7 +31,6 @@ import FlowTutorials from './FlowTutorials.svelte';
|
|
|
31
31
|
import { ignoredTutorials } from './tutorials/ignoredTutorials';
|
|
32
32
|
import UnsavedConfirmationModal from './common/confirmationModal/UnsavedConfirmationModal.svelte';
|
|
33
33
|
import { cloneDeep } from 'lodash';
|
|
34
|
-
import { goto } from '$app/navigation';
|
|
35
34
|
export let initialPath = '';
|
|
36
35
|
export let newFlow;
|
|
37
36
|
export let selectedId;
|
|
@@ -41,6 +40,8 @@ export let flowStore;
|
|
|
41
40
|
export let flowStateStore;
|
|
42
41
|
export let savedFlow = undefined;
|
|
43
42
|
export let diffDrawer = undefined;
|
|
43
|
+
export let gotoUrl;
|
|
44
|
+
export let beforeNavigate;
|
|
44
45
|
const dispatch = createEventDispatcher();
|
|
45
46
|
async function createSchedule(path) {
|
|
46
47
|
const { cron, timezone, args, enabled } = $scheduleStore;
|
|
@@ -138,12 +139,9 @@ async function saveDraft(forceSave = false) {
|
|
|
138
139
|
path: $pathStore
|
|
139
140
|
}
|
|
140
141
|
};
|
|
141
|
-
if (newFlow) {
|
|
142
|
+
if (newFlow || (savedFlow?.draft_only && $pathStore !== initialPath)) {
|
|
142
143
|
dispatch('saveInitial', $pathStore);
|
|
143
144
|
}
|
|
144
|
-
else if (savedFlow?.draft_only && $pathStore !== initialPath) {
|
|
145
|
-
goto(`/flows/edit/${$pathStore}?selected=${getSelectedId()}`);
|
|
146
|
-
}
|
|
147
145
|
sendUserToast('Saved as draft');
|
|
148
146
|
}
|
|
149
147
|
catch (error) {
|
|
@@ -804,6 +802,8 @@ export function triggerTutorial() {
|
|
|
804
802
|
<svelte:window on:keydown={onKeyDown} />
|
|
805
803
|
|
|
806
804
|
<UnsavedConfirmationModal
|
|
805
|
+
{gotoUrl}
|
|
806
|
+
{beforeNavigate}
|
|
807
807
|
{diffDrawer}
|
|
808
808
|
savedValue={savedFlow}
|
|
809
809
|
modifiedValue={{
|
|
@@ -3,6 +3,7 @@ import { type Flow, type OpenFlow } from '../gen';
|
|
|
3
3
|
import { type Writable } from 'svelte/store';
|
|
4
4
|
import type { FlowState } from './flows/flowState';
|
|
5
5
|
import type DiffDrawer from './DiffDrawer.svelte';
|
|
6
|
+
import type { BeforeNavigate } from './common/confirmationModal/model';
|
|
6
7
|
declare const __propDef: {
|
|
7
8
|
props: {
|
|
8
9
|
initialPath?: string | undefined;
|
|
@@ -16,6 +17,8 @@ declare const __propDef: {
|
|
|
16
17
|
draft?: Flow | undefined;
|
|
17
18
|
}) | undefined;
|
|
18
19
|
diffDrawer?: DiffDrawer | undefined;
|
|
20
|
+
gotoUrl: ((url: URL) => void) | undefined;
|
|
21
|
+
beforeNavigate: BeforeNavigate | undefined;
|
|
19
22
|
computeUnlockedSteps?: ((flow: Flow) => {
|
|
20
23
|
[k: string]: string;
|
|
21
24
|
}) | undefined;
|
|
@@ -177,7 +177,11 @@ loadResourceTypes();
|
|
|
177
177
|
propertyType === 'static' ||
|
|
178
178
|
arg?.expr?.length > 0}
|
|
179
179
|
on:showExpr={(e) => {
|
|
180
|
-
|
|
180
|
+
setTimeout(() => {
|
|
181
|
+
if (monaco && propertyType === 'javascript') {
|
|
182
|
+
monaco.setSuggestion(e.detail)
|
|
183
|
+
}
|
|
184
|
+
}, 0)
|
|
181
185
|
}}
|
|
182
186
|
on:setExpr={(e) => {
|
|
183
187
|
arg = {
|
|
@@ -357,7 +361,6 @@ loadResourceTypes();
|
|
|
357
361
|
focused = false
|
|
358
362
|
}}
|
|
359
363
|
autoHeight
|
|
360
|
-
preventTabOnEmpty={enableAi}
|
|
361
364
|
/>
|
|
362
365
|
</div>
|
|
363
366
|
<DynamicInputHelpBox />
|
|
@@ -25,6 +25,9 @@ export let tab = 'Core';
|
|
|
25
25
|
export let hideTabs = false;
|
|
26
26
|
let values = {};
|
|
27
27
|
let initialOauths = {};
|
|
28
|
+
let initialRequirePreexistingUserForOauth = false;
|
|
29
|
+
let requirePreexistingUserForOauth = false;
|
|
30
|
+
let ssoOrOauth = 'sso';
|
|
28
31
|
let serverConfig = {};
|
|
29
32
|
let initialValues = {};
|
|
30
33
|
loadSettings();
|
|
@@ -44,6 +47,9 @@ async function loadSettings() {
|
|
|
44
47
|
}
|
|
45
48
|
}
|
|
46
49
|
initialOauths = (await SettingService.getGlobal({ key: 'oauths' })) ?? {};
|
|
50
|
+
requirePreexistingUserForOauth =
|
|
51
|
+
(await SettingService.getGlobal({ key: 'require_preexisting_user_for_oauth' })) ?? false;
|
|
52
|
+
initialRequirePreexistingUserForOauth = requirePreexistingUserForOauth;
|
|
47
53
|
oauths = JSON.parse(JSON.stringify(initialOauths));
|
|
48
54
|
initialValues = Object.fromEntries((await Promise.all(Object.entries(settings).map(async ([_, y]) => await Promise.all(y.map(async (x) => [x.key, await getValue(x.key, x.storage)]))))).flat());
|
|
49
55
|
values = JSON.parse(JSON.stringify(initialValues));
|
|
@@ -91,6 +97,12 @@ async function saveSettings() {
|
|
|
91
97
|
});
|
|
92
98
|
initialOauths = JSON.parse(JSON.stringify(oauths));
|
|
93
99
|
}
|
|
100
|
+
if (initialRequirePreexistingUserForOauth !== requirePreexistingUserForOauth) {
|
|
101
|
+
await SettingService.setGlobal({
|
|
102
|
+
key: 'require_preexisting_user_for_oauth',
|
|
103
|
+
requestBody: { value: requirePreexistingUserForOauth }
|
|
104
|
+
});
|
|
105
|
+
}
|
|
94
106
|
}
|
|
95
107
|
else {
|
|
96
108
|
console.error('Values not loaded');
|
|
@@ -174,34 +186,121 @@ let licenseKeyChanged = false;
|
|
|
174
186
|
{/if}
|
|
175
187
|
{/if}
|
|
176
188
|
{#if category == 'SSO/OAuth'}
|
|
189
|
+
<div>
|
|
190
|
+
<Tabs bind:selected={ssoOrOauth} class="mt-2 mb-4">
|
|
191
|
+
<Tab value="sso">SSO</Tab>
|
|
192
|
+
<Tab value="oauth">OAuth</Tab>
|
|
193
|
+
</Tabs>
|
|
194
|
+
</div>
|
|
195
|
+
|
|
177
196
|
<div class="mb-6">
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
197
|
+
{#if ssoOrOauth === 'sso'}
|
|
198
|
+
{#if !$enterpriseLicense || $enterpriseLicense.endsWith('_pro')}
|
|
199
|
+
<Alert type="warning" title="Limited to 10 SSO users">
|
|
200
|
+
Without EE, the number of SSO users is limited to 10. SCIM/SAML is available on
|
|
201
|
+
EE
|
|
202
|
+
</Alert>
|
|
203
|
+
{/if}
|
|
204
|
+
|
|
205
|
+
<div class="py-1" />
|
|
206
|
+
<Alert type="info" title="Single Sign On">
|
|
207
|
+
When at least one of the below option is set, users will be able to login to
|
|
208
|
+
Windmill via their third-party account.
|
|
209
|
+
<br /> To test SSO, the recommended workflow is to to save the settings and try to
|
|
210
|
+
login in an incognito window.
|
|
182
211
|
</Alert>
|
|
183
|
-
|
|
212
|
+
<div class="flex flex-col gap-2 py-4">
|
|
213
|
+
<OAuthSetting name="google" bind:value={oauths['google']} />
|
|
214
|
+
<OAuthSetting name="microsoft" bind:value={oauths['microsoft']} />
|
|
215
|
+
<OktaSetting bind:value={oauths['okta']} />
|
|
216
|
+
<OAuthSetting name="github" bind:value={oauths['github']} />
|
|
217
|
+
<OAuthSetting name="gitlab" bind:value={oauths['gitlab']} />
|
|
218
|
+
<OAuthSetting name="jumpcloud" bind:value={oauths['jumpcloud']} />
|
|
219
|
+
<KeycloakSetting bind:value={oauths['keycloak']} />
|
|
220
|
+
<AuthentikSetting bind:value={oauths['authentik']} />
|
|
221
|
+
<AutheliaSetting bind:value={oauths['authelia']} />
|
|
222
|
+
<KanidmSetting bind:value={oauths['kanidm']} />
|
|
223
|
+
<ZitadelSetting bind:value={oauths['zitadel']} />
|
|
224
|
+
{#each Object.keys(oauths) as k}
|
|
225
|
+
{#if !['authelia', 'authentik', 'google', 'microsoft', 'github', 'gitlab', 'jumpcloud', 'okta', 'keycloak', 'slack', 'kanidm', 'zitadel'].includes(k) && 'login_config' in oauths[k]}
|
|
226
|
+
{#if oauths[k]}
|
|
227
|
+
<div class="flex flex-col gap-2 pb-4">
|
|
228
|
+
<div class="flex flex-row items-center gap-2">
|
|
229
|
+
<label class="text-md font-medium text-primary">{k}</label>
|
|
230
|
+
<CloseButton
|
|
231
|
+
on:close={() => {
|
|
232
|
+
delete oauths[k]
|
|
233
|
+
oauths = { ...oauths }
|
|
234
|
+
}}
|
|
235
|
+
/>
|
|
236
|
+
</div>
|
|
237
|
+
<div class="p-2 border rounded">
|
|
238
|
+
<label class="block pb-2">
|
|
239
|
+
<span class="text-primary font-semibold text-sm">Client Id</span>
|
|
240
|
+
<input
|
|
241
|
+
type="text"
|
|
242
|
+
placeholder="Client Id"
|
|
243
|
+
bind:value={oauths[k]['id']}
|
|
244
|
+
/>
|
|
245
|
+
</label>
|
|
246
|
+
<label class="block pb-2">
|
|
247
|
+
<span class="text-primary font-semibold text-sm">Client Secret</span>
|
|
248
|
+
<input
|
|
249
|
+
type="text"
|
|
250
|
+
placeholder="Client Secret"
|
|
251
|
+
bind:value={oauths[k]['secret']}
|
|
252
|
+
/>
|
|
253
|
+
</label>
|
|
254
|
+
{#if !windmillBuiltins.includes(k) && k != 'slack'}
|
|
255
|
+
<CustomSso bind:login_config={oauths[k]['login_config']} />
|
|
256
|
+
{/if}
|
|
257
|
+
</div>
|
|
258
|
+
</div>
|
|
259
|
+
{/if}
|
|
260
|
+
{/if}
|
|
261
|
+
{/each}
|
|
262
|
+
</div>
|
|
263
|
+
<div class="flex gap-2 py-4">
|
|
264
|
+
<input type="text" placeholder="client_id" bind:value={clientName} />
|
|
265
|
+
<Button
|
|
266
|
+
variant="border"
|
|
267
|
+
color="blue"
|
|
268
|
+
hover="yo"
|
|
269
|
+
size="sm"
|
|
270
|
+
endIcon={{ icon: Plus }}
|
|
271
|
+
disabled={clientName == ''}
|
|
272
|
+
on:click={() => {
|
|
273
|
+
oauths[clientName] = { id: '', secret: '', login_config: {} }
|
|
274
|
+
clientName = ''
|
|
275
|
+
}}
|
|
276
|
+
>
|
|
277
|
+
Add custom SSO client {!$enterpriseLicense ? '(requires ee)' : ''}
|
|
278
|
+
</Button>
|
|
279
|
+
</div>
|
|
280
|
+
<div class="flex gap-2 py-4">
|
|
281
|
+
<Toggle
|
|
282
|
+
options={{
|
|
283
|
+
right:
|
|
284
|
+
'Require users to have been added manually to windmill to sign in through OAuth'
|
|
285
|
+
}}
|
|
286
|
+
bind:checked={requirePreexistingUserForOauth}
|
|
287
|
+
/>
|
|
288
|
+
</div>
|
|
289
|
+
{:else if ssoOrOauth === 'oauth'}
|
|
290
|
+
<Alert type="info" title="OAuth Resources">
|
|
291
|
+
When one of the below option is set, you will be able to create a specific
|
|
292
|
+
resource containing a token automatically generated by the third-party provider.
|
|
293
|
+
<br />
|
|
294
|
+
To test it after setting an oauth client, go to the Resources menu and create a new
|
|
295
|
+
one of the type of your oauth client (i.e. a 'github' resource if you set Github OAuth).
|
|
296
|
+
</Alert>
|
|
297
|
+
<div class="py-1" />
|
|
298
|
+
<OAuthSetting login={false} name="slack" bind:value={oauths['slack']} />
|
|
299
|
+
<div class="py-1" />
|
|
184
300
|
|
|
185
|
-
<div class="py-1" />
|
|
186
|
-
<Alert type="info" title="Test on a separate tab">
|
|
187
|
-
The recommended workflow is to to save your oauth setting and test them directly on
|
|
188
|
-
the login or resource page
|
|
189
|
-
</Alert>
|
|
190
|
-
<div class="flex flex-col gap-2 py-4">
|
|
191
|
-
<OAuthSetting name="google" bind:value={oauths['google']} />
|
|
192
|
-
<OAuthSetting name="microsoft" bind:value={oauths['microsoft']} />
|
|
193
|
-
<OktaSetting bind:value={oauths['okta']} />
|
|
194
|
-
<OAuthSetting name="github" bind:value={oauths['github']} />
|
|
195
|
-
<OAuthSetting name="gitlab" bind:value={oauths['gitlab']} />
|
|
196
|
-
<OAuthSetting name="jumpcloud" bind:value={oauths['jumpcloud']} />
|
|
197
|
-
<KeycloakSetting bind:value={oauths['keycloak']} />
|
|
198
|
-
<AuthentikSetting bind:value={oauths['authentik']} />
|
|
199
|
-
<AutheliaSetting bind:value={oauths['authelia']} />
|
|
200
|
-
<KanidmSetting bind:value={oauths['kanidm']} />
|
|
201
|
-
<ZitadelSetting bind:value={oauths['zitadel']} />
|
|
202
301
|
{#each Object.keys(oauths) as k}
|
|
203
|
-
{#if !
|
|
204
|
-
{#if oauths[k]}
|
|
302
|
+
{#if !('login_config' in oauths[k])}
|
|
303
|
+
{#if !['slack'].includes(k) && oauths[k]}
|
|
205
304
|
<div class="flex flex-col gap-2 pb-4">
|
|
206
305
|
<div class="flex flex-row items-center gap-2">
|
|
207
306
|
<label class="text-md font-medium text-primary">{k}</label>
|
|
@@ -230,108 +329,48 @@ let licenseKeyChanged = false;
|
|
|
230
329
|
/>
|
|
231
330
|
</label>
|
|
232
331
|
{#if !windmillBuiltins.includes(k) && k != 'slack'}
|
|
233
|
-
<
|
|
332
|
+
<CustomOauth bind:connect_config={oauths[k]['connect_config']} />
|
|
234
333
|
{/if}
|
|
235
334
|
</div>
|
|
236
335
|
</div>
|
|
237
336
|
{/if}
|
|
238
337
|
{/if}
|
|
239
338
|
{/each}
|
|
240
|
-
</div>
|
|
241
|
-
<div class="flex gap-2">
|
|
242
|
-
<input type="text" placeholder="client_id" bind:value={clientName} />
|
|
243
|
-
<Button
|
|
244
|
-
variant="border"
|
|
245
|
-
color="blue"
|
|
246
|
-
hover="yo"
|
|
247
|
-
size="sm"
|
|
248
|
-
endIcon={{ icon: Plus }}
|
|
249
|
-
disabled={clientName == ''}
|
|
250
|
-
on:click={() => {
|
|
251
|
-
oauths[clientName] = { id: '', secret: '', login_config: {} }
|
|
252
|
-
clientName = ''
|
|
253
|
-
}}
|
|
254
|
-
>
|
|
255
|
-
Add custom SSO client {!$enterpriseLicense ? '(requires ee)' : ''}
|
|
256
|
-
</Button>
|
|
257
|
-
</div>
|
|
258
|
-
<h4 class="py-4">OAuth</h4>
|
|
259
|
-
<Alert type="info" title="Require a corresponding resource type">
|
|
260
|
-
After setting an oauth client, make sure that there is a corresponding resource type
|
|
261
|
-
with the same name with a "token" field in the admins workspace.
|
|
262
|
-
</Alert>
|
|
263
|
-
<div class="py-1" />
|
|
264
|
-
<OAuthSetting login={false} name="slack" bind:value={oauths['slack']} />
|
|
265
|
-
<div class="py-1" />
|
|
266
339
|
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
<
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
</div>
|
|
280
|
-
<div class="p-2 border rounded">
|
|
281
|
-
<label class="block pb-2">
|
|
282
|
-
<span class="text-primary font-semibold text-sm">Client Id</span>
|
|
283
|
-
<input type="text" placeholder="Client Id" bind:value={oauths[k]['id']} />
|
|
284
|
-
</label>
|
|
285
|
-
<label class="block pb-2">
|
|
286
|
-
<span class="text-primary font-semibold text-sm">Client Secret</span>
|
|
287
|
-
<input
|
|
288
|
-
type="text"
|
|
289
|
-
placeholder="Client Secret"
|
|
290
|
-
bind:value={oauths[k]['secret']}
|
|
291
|
-
/>
|
|
292
|
-
</label>
|
|
293
|
-
{#if !windmillBuiltins.includes(k) && k != 'slack'}
|
|
294
|
-
<CustomOauth bind:connect_config={oauths[k]['connect_config']} />
|
|
295
|
-
{/if}
|
|
296
|
-
</div>
|
|
297
|
-
</div>
|
|
340
|
+
<div class="flex gap-2">
|
|
341
|
+
<select name="oauth_name" id="oauth_name" bind:value={oauth_name}>
|
|
342
|
+
<option value={undefined}>Select an OAuth client</option>
|
|
343
|
+
<option value="custom">Fully Custom (requires ee)</option>
|
|
344
|
+
{#each windmillBuiltins as name}
|
|
345
|
+
<option value={name}>{capitalize(name)}</option>
|
|
346
|
+
{/each}
|
|
347
|
+
</select>
|
|
348
|
+
{#if oauth_name == 'custom'}
|
|
349
|
+
<input type="text" placeholder="client_id" bind:value={resourceName} />
|
|
350
|
+
{:else}
|
|
351
|
+
<input type="text" value={oauth_name ?? ''} disabled />
|
|
298
352
|
{/if}
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
endIcon={{ icon: Plus }}
|
|
321
|
-
disabled={!oauth_name ||
|
|
322
|
-
(oauth_name == 'custom' && resourceName == '') ||
|
|
323
|
-
(oauth_name == 'custom' && !$enterpriseLicense)}
|
|
324
|
-
on:click={() => {
|
|
325
|
-
let name = oauth_name == 'custom' ? resourceName : oauth_name
|
|
326
|
-
oauths[name ?? ''] = { id: '', secret: '' }
|
|
327
|
-
resourceName = ''
|
|
328
|
-
}}
|
|
329
|
-
>
|
|
330
|
-
Add OAuth client {oauth_name == 'custom' && !$enterpriseLicense
|
|
331
|
-
? '(requires ee)'
|
|
332
|
-
: ''}
|
|
333
|
-
</Button>
|
|
334
|
-
</div>
|
|
353
|
+
<Button
|
|
354
|
+
variant="border"
|
|
355
|
+
color="blue"
|
|
356
|
+
hover="yo"
|
|
357
|
+
size="sm"
|
|
358
|
+
endIcon={{ icon: Plus }}
|
|
359
|
+
disabled={!oauth_name ||
|
|
360
|
+
(oauth_name == 'custom' && resourceName == '') ||
|
|
361
|
+
(oauth_name == 'custom' && !$enterpriseLicense)}
|
|
362
|
+
on:click={() => {
|
|
363
|
+
let name = oauth_name == 'custom' ? resourceName : oauth_name
|
|
364
|
+
oauths[name ?? ''] = { id: '', secret: '' }
|
|
365
|
+
resourceName = ''
|
|
366
|
+
}}
|
|
367
|
+
>
|
|
368
|
+
Add OAuth client {oauth_name == 'custom' && !$enterpriseLicense
|
|
369
|
+
? '(requires ee)'
|
|
370
|
+
: ''}
|
|
371
|
+
</Button>
|
|
372
|
+
</div>
|
|
373
|
+
{/if}
|
|
335
374
|
</div>
|
|
336
375
|
{/if}
|
|
337
376
|
<div>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { SvelteComponent } from "svelte";
|
|
2
2
|
declare const __propDef: {
|
|
3
3
|
props: {
|
|
4
|
-
openDrawer?: ((initialPath_l: string, summary_l: string | undefined, kind_l: "flow" | "script" | "app" | "resource" | "
|
|
4
|
+
openDrawer?: ((initialPath_l: string, summary_l: string | undefined, kind_l: "flow" | "script" | "app" | "resource" | "variable" | "schedule" | "raw_app") => Promise<void>) | undefined;
|
|
5
5
|
};
|
|
6
6
|
events: {
|
|
7
7
|
update: CustomEvent<any>;
|
|
@@ -14,6 +14,6 @@ export type MoveDrawerProps = typeof __propDef.props;
|
|
|
14
14
|
export type MoveDrawerEvents = typeof __propDef.events;
|
|
15
15
|
export type MoveDrawerSlots = typeof __propDef.slots;
|
|
16
16
|
export default class MoveDrawer extends SvelteComponent<MoveDrawerProps, MoveDrawerEvents, MoveDrawerSlots> {
|
|
17
|
-
get openDrawer(): (initialPath_l: string, summary_l: string | undefined, kind_l: "flow" | "script" | "app" | "resource" | "
|
|
17
|
+
get openDrawer(): (initialPath_l: string, summary_l: string | undefined, kind_l: "flow" | "script" | "app" | "resource" | "variable" | "schedule" | "raw_app") => Promise<void>;
|
|
18
18
|
}
|
|
19
19
|
export {};
|
|
@@ -17,6 +17,7 @@ import Required from './Required.svelte';
|
|
|
17
17
|
import Tooltip from './Tooltip.svelte';
|
|
18
18
|
import { Eye, Folder, Plus, SearchCode, User } from 'lucide-svelte';
|
|
19
19
|
import ContentSearch from './ContentSearch.svelte';
|
|
20
|
+
import { goto } from '$app/navigation';
|
|
20
21
|
let meta = undefined;
|
|
21
22
|
export let fullNamePlaceholder = undefined;
|
|
22
23
|
export let namePlaceholder = '';
|
|
@@ -237,7 +238,11 @@ let contentSearch;
|
|
|
237
238
|
</script>
|
|
238
239
|
|
|
239
240
|
{#if kind != 'app' && kind != 'schedule' && initialPath != '' && initialPath != undefined}
|
|
240
|
-
<ContentSearch
|
|
241
|
+
<ContentSearch
|
|
242
|
+
on:editScript={(e) => goto(`/scripts/edit/${e.detail}?no_draft=true`)}
|
|
243
|
+
on:editFlow={(e) => goto(`/flows/edit/${e.detail}?no_draft=true`)}
|
|
244
|
+
bind:this={contentSearch}
|
|
245
|
+
/>
|
|
241
246
|
{/if}
|
|
242
247
|
|
|
243
248
|
<Drawer bind:this={newFolder}>
|
|
@@ -10,7 +10,7 @@ declare const __propDef: {
|
|
|
10
10
|
checkInitialPathExistence?: boolean | undefined;
|
|
11
11
|
autofocus?: boolean | undefined;
|
|
12
12
|
dirty?: boolean | undefined;
|
|
13
|
-
kind: "flow" | "script" | "app" | "resource" | "
|
|
13
|
+
kind: "flow" | "script" | "app" | "resource" | "variable" | "schedule" | "raw_app";
|
|
14
14
|
focus?: (() => void) | undefined;
|
|
15
15
|
setName?: ((x: string) => void) | undefined;
|
|
16
16
|
reset?: (() => Promise<void>) | undefined;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
<script>import { DraftService, NewScript, Script, ScriptService } from '../gen';
|
|
2
|
-
import { goto } from '$app/navigation';
|
|
3
2
|
import { page } from '$app/stores';
|
|
4
3
|
import { inferArgs } from '../infer';
|
|
5
4
|
import { initialCode } from '../script_helpers';
|
|
@@ -29,6 +28,7 @@ import Label from './Label.svelte';
|
|
|
29
28
|
import { cloneDeep } from 'lodash';
|
|
30
29
|
import WorkerTagPicker from './WorkerTagPicker.svelte';
|
|
31
30
|
import MetadataGen from './copilot/MetadataGen.svelte';
|
|
31
|
+
import { beforeNavigate, goto } from '$app/navigation';
|
|
32
32
|
export let script;
|
|
33
33
|
export let initialPath = '';
|
|
34
34
|
export let template = 'script';
|
|
@@ -313,7 +313,13 @@ let selectedTab = 'metadata';
|
|
|
313
313
|
</script>
|
|
314
314
|
|
|
315
315
|
<svelte:window on:keydown={onKeyDown} />
|
|
316
|
-
<UnsavedConfirmationModal
|
|
316
|
+
<UnsavedConfirmationModal
|
|
317
|
+
gotoUrl={goto}
|
|
318
|
+
{beforeNavigate}
|
|
319
|
+
{diffDrawer}
|
|
320
|
+
savedValue={savedScript}
|
|
321
|
+
modifiedValue={script}
|
|
322
|
+
/>
|
|
317
323
|
|
|
318
324
|
{#if !$userStore?.operator}
|
|
319
325
|
<Drawer placement="right" bind:open={metadataOpen} size="800px">
|
|
@@ -138,7 +138,7 @@ export async function setCollaborationMode() {
|
|
|
138
138
|
name: $userStore?.username
|
|
139
139
|
});
|
|
140
140
|
function setPeers() {
|
|
141
|
-
peers = Array.from(awareness.getStates().values()).map((x) => x
|
|
141
|
+
peers = Array.from(awareness.getStates().values()).map((x) => x?.['user']);
|
|
142
142
|
}
|
|
143
143
|
setPeers();
|
|
144
144
|
// You can observe when a user updates their awareness information
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { SvelteComponent } from "svelte";
|
|
2
2
|
declare const __propDef: {
|
|
3
3
|
props: {
|
|
4
|
-
openDrawer?: ((newPath: string, kind_l: "flow" | "script" | "app" | "resource" | "
|
|
4
|
+
openDrawer?: ((newPath: string, kind_l: "flow" | "script" | "app" | "resource" | "variable" | "schedule" | "raw_app" | "group_") => Promise<void>) | undefined;
|
|
5
5
|
};
|
|
6
6
|
events: {
|
|
7
7
|
change: CustomEvent<any>;
|
|
@@ -14,6 +14,6 @@ export type ShareModalProps = typeof __propDef.props;
|
|
|
14
14
|
export type ShareModalEvents = typeof __propDef.events;
|
|
15
15
|
export type ShareModalSlots = typeof __propDef.slots;
|
|
16
16
|
export default class ShareModal extends SvelteComponent<ShareModalProps, ShareModalEvents, ShareModalSlots> {
|
|
17
|
-
get openDrawer(): (newPath: string, kind_l: "flow" | "script" | "app" | "resource" | "
|
|
17
|
+
get openDrawer(): (newPath: string, kind_l: "flow" | "script" | "app" | "resource" | "variable" | "schedule" | "raw_app" | "group_") => Promise<void>;
|
|
18
18
|
}
|
|
19
19
|
export {};
|
|
@@ -38,9 +38,14 @@ let description = '';
|
|
|
38
38
|
let pathError = '';
|
|
39
39
|
let password = '';
|
|
40
40
|
let path = undefined;
|
|
41
|
+
/**
|
|
42
|
+
* https://github.com/orgs/supabase/discussions/17817
|
|
43
|
+
* host is in the format of `aws-0-${region}.pooler.supabase.com`
|
|
44
|
+
* user is in the format of `postgres.${id}`
|
|
45
|
+
*/
|
|
41
46
|
$: resourceValue = {
|
|
42
|
-
host: selectedDatabase?.
|
|
43
|
-
user:
|
|
47
|
+
host: `aws-0-${selectedDatabase?.region}.pooler.supabase.com`,
|
|
48
|
+
user: `postgres.${selectedDatabase?.id}`,
|
|
44
49
|
port: 5432,
|
|
45
50
|
dbname: 'postgres',
|
|
46
51
|
sslmode: 'prefer',
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
<script>import zoomPlugin from 'chartjs-plugin-zoom';
|
|
2
2
|
import { Chart as ChartJS, Title, Tooltip, Legend, LineElement, LinearScale, PointElement, CategoryScale, BarElement } from 'chart.js';
|
|
3
3
|
import RunnableWrapper from '../helpers/RunnableWrapper.svelte';
|
|
4
|
-
import Scatter from 'svelte-chartjs/Scatter.svelte';
|
|
5
4
|
import InputValue from '../helpers/InputValue.svelte';
|
|
6
5
|
import { initCss } from '../../utils';
|
|
7
6
|
import { getContext } from 'svelte';
|
|
8
7
|
import { initOutput } from '../../editor/appUtils';
|
|
9
8
|
import { twMerge } from 'tailwind-merge';
|
|
10
9
|
import ResolveStyle from '../helpers/ResolveStyle.svelte';
|
|
10
|
+
import { Scatter } from 'svelte-chartjs';
|
|
11
11
|
export let id;
|
|
12
12
|
export let componentInput;
|
|
13
13
|
export let configuration;
|
|
@@ -36,6 +36,7 @@ export let errorHandledByComponent = false;
|
|
|
36
36
|
export let hideRefreshButton = false;
|
|
37
37
|
export let hasChildrens;
|
|
38
38
|
export let allowConcurentRequests = false;
|
|
39
|
+
export let noInitialize = false;
|
|
39
40
|
const { worldStore, runnableComponents, workspace, appPath, isEditor, jobs, jobsById, noBackend, errorByComponent, mode, stateId, state, componentControl, initialized, selectedComponent, app, connectingInput, bgRuns } = getContext('AppViewerContext');
|
|
40
41
|
const editorContext = getContext('AppEditorContext');
|
|
41
42
|
const iterContext = getContext('ListWrapperContext');
|
|
@@ -414,7 +415,7 @@ onMount(() => {
|
|
|
414
415
|
refreshOnStart: refreshOnStart,
|
|
415
416
|
cb: [...($runnableComponents[id]?.cb ?? []), cancellableRun]
|
|
416
417
|
};
|
|
417
|
-
if (!$initialized.initializedComponents.includes(id)) {
|
|
418
|
+
if (!noInitialize && !$initialized.initializedComponents.includes(id)) {
|
|
418
419
|
$initialized.initializedComponents = [...$initialized.initializedComponents, id];
|
|
419
420
|
}
|
|
420
421
|
});
|
|
@@ -32,6 +32,7 @@ declare const __propDef: {
|
|
|
32
32
|
hideRefreshButton?: boolean | undefined;
|
|
33
33
|
hasChildrens: boolean;
|
|
34
34
|
allowConcurentRequests?: boolean | undefined;
|
|
35
|
+
noInitialize?: boolean | undefined;
|
|
35
36
|
setArgs?: ((value: any) => void) | undefined;
|
|
36
37
|
invalidate?: ((key: string, error: string) => void) | undefined;
|
|
37
38
|
validate?: ((key: string) => void) | undefined;
|
|
@@ -165,6 +165,7 @@ export async function handleSideEffect(success, errorMessage) {
|
|
|
165
165
|
<slot />
|
|
166
166
|
{:else if componentInput.type === 'runnable' && isRunnableDefined(componentInput)}
|
|
167
167
|
<RunnableComponent
|
|
168
|
+
{noInitialize}
|
|
168
169
|
{allowConcurentRequests}
|
|
169
170
|
{refreshOnStart}
|
|
170
171
|
{extraKey}
|
|
@@ -29,6 +29,9 @@ let value = resolvedConfig.defaultValue ?? false;
|
|
|
29
29
|
$componentControl[id] = {
|
|
30
30
|
setValue(nvalue) {
|
|
31
31
|
value = nvalue;
|
|
32
|
+
if (recomputeIds) {
|
|
33
|
+
recomputeIds.forEach((id) => $runnableComponents?.[id]?.cb?.forEach((cb) => cb()));
|
|
34
|
+
}
|
|
32
35
|
}
|
|
33
36
|
};
|
|
34
37
|
if (controls) {
|
|
@@ -47,13 +50,13 @@ function handleInput() {
|
|
|
47
50
|
if (rowContext && rowInputs) {
|
|
48
51
|
rowInputs.set(id, value);
|
|
49
52
|
}
|
|
50
|
-
if (recomputeIds) {
|
|
51
|
-
recomputeIds.forEach((id) => $runnableComponents?.[id]?.cb?.forEach((cb) => cb()));
|
|
52
|
-
}
|
|
53
53
|
}
|
|
54
54
|
function handleDefault() {
|
|
55
55
|
value = resolvedConfig.defaultValue ?? false;
|
|
56
56
|
handleInput();
|
|
57
|
+
if (recomputeIds) {
|
|
58
|
+
recomputeIds.forEach((id) => $runnableComponents?.[id]?.cb?.forEach((cb) => cb()));
|
|
59
|
+
}
|
|
57
60
|
}
|
|
58
61
|
onDestroy(() => {
|
|
59
62
|
listInputs?.remove(id);
|
|
@@ -104,6 +107,9 @@ let css = initCss($app.css?.checkboxcomponent, customCss);
|
|
|
104
107
|
on:change={(e) => {
|
|
105
108
|
preclickAction?.()
|
|
106
109
|
value = e.detail
|
|
110
|
+
if (recomputeIds) {
|
|
111
|
+
recomputeIds.forEach((id) => $runnableComponents?.[id]?.cb?.forEach((cb) => cb()))
|
|
112
|
+
}
|
|
107
113
|
}}
|
|
108
114
|
disabled={resolvedConfig.disabled}
|
|
109
115
|
/>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<script>import { goto } from '$app/navigation';
|
|
1
|
+
<script>import { beforeNavigate, goto } from '$app/navigation';
|
|
2
2
|
import { page } from '$app/stores';
|
|
3
3
|
import { Alert, Badge, Drawer, DrawerContent, Kbd, Tab, Tabs, UndoRedo } from '../../common';
|
|
4
4
|
import Button from '../../common/button/Button.svelte';
|
|
@@ -564,6 +564,8 @@ let appReportingDrawerOpen = false;
|
|
|
564
564
|
<TestJobLoader bind:this={testJobLoader} bind:isLoading={testIsLoading} bind:job />
|
|
565
565
|
|
|
566
566
|
<UnsavedConfirmationModal
|
|
567
|
+
gotoUrl={goto}
|
|
568
|
+
{beforeNavigate}
|
|
567
569
|
{diffDrawer}
|
|
568
570
|
savedValue={savedApp}
|
|
569
571
|
modifiedValue={{
|
|
@@ -350,7 +350,18 @@ export function getAllSubgridsAndComponentIds(app, component) {
|
|
|
350
350
|
return [subgrids, components];
|
|
351
351
|
}
|
|
352
352
|
export function getAllGridItems(app) {
|
|
353
|
-
return app.grid
|
|
353
|
+
return app.grid
|
|
354
|
+
.concat(Object.values(app.subgrids ?? {}).flat())
|
|
355
|
+
.map((x) => {
|
|
356
|
+
if (x?.data?.type === 'tablecomponent') {
|
|
357
|
+
return [x, ...x?.data?.actionButtons?.map((x) => ({ data: x, id: x.id }))];
|
|
358
|
+
}
|
|
359
|
+
else if (x?.data?.type === 'menucomponent') {
|
|
360
|
+
return [x, ...x?.data?.menuItems?.map((x) => ({ data: x, id: x.id }))];
|
|
361
|
+
}
|
|
362
|
+
return [x];
|
|
363
|
+
})
|
|
364
|
+
.flat();
|
|
354
365
|
}
|
|
355
366
|
export function deleteGridItem(app, component, parent) {
|
|
356
367
|
let [subgrids, components] = getAllSubgridsAndComponentIds(app, component);
|
|
@@ -35,7 +35,7 @@ function deleteComponent(cid) {
|
|
|
35
35
|
<div
|
|
36
36
|
class={classNames(
|
|
37
37
|
'w-full text-xs font-bold gap-1 truncate py-1.5 px-2 cursor-pointer transition-all justify-between flex items-center border border-gray-3 rounded-md',
|
|
38
|
-
'bg-surface hover:bg-
|
|
38
|
+
'bg-surface hover:bg-surface-hover focus:border-primary text-secondary',
|
|
39
39
|
$selectedComponent?.includes(component.id) ? 'outline outline-blue-500 bg-red-400' : ''
|
|
40
40
|
)}
|
|
41
41
|
on:click={() => {
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
import cssWorker from 'monaco-editor/esm/vs/language/css/css.worker?worker';
|
|
2
|
-
import tsWorker from 'monaco-editor/esm/vs/language/typescript/ts.worker?worker';
|
|
3
|
-
import htmlWorker from 'monaco-editor/esm/vs/language/html/html.worker?worker';
|
|
4
|
-
import jsonWorker from 'monaco-editor/esm/vs/language/json/json.worker?worker';
|
|
5
|
-
import editorWorker from 'monaco-editor/esm/vs/editor/editor.worker?worker';
|
|
6
1
|
export function buildWorkerDefinition(workerPath, basePath, useModuleWorker) {
|
|
7
2
|
const monWin = self;
|
|
8
3
|
const workerOverrideGlobals = {
|
|
@@ -22,23 +17,31 @@ export function buildWorkerDefinition(workerPath, basePath, useModuleWorker) {
|
|
|
22
17
|
}
|
|
23
18
|
const monEnv = monWin.MonacoEnvironment;
|
|
24
19
|
monEnv.workerOverrideGlobals = workerOverrideGlobals;
|
|
20
|
+
const buildWorker = (globals, label, workerName, editorType) => {
|
|
21
|
+
globals.workerOptions.name = label;
|
|
22
|
+
const workerFilename = globals.workerOptions.type === 'module' ? `${workerName}-es.js` : `${workerName}-iife.js`;
|
|
23
|
+
const workerPathLocal = `${globals.workerPath}/../node_modules/monaco-editor-workers/dist/workers/${workerFilename}`;
|
|
24
|
+
const workerUrl = new URL(workerPathLocal, globals.basePath);
|
|
25
|
+
console.log(`${editorType}: url: ${workerUrl.href} created from basePath: ${globals.basePath} and file: ${workerPathLocal}`);
|
|
26
|
+
return new Worker(workerUrl.href, globals.workerOptions);
|
|
27
|
+
};
|
|
25
28
|
const getWorker = (_, label) => {
|
|
26
29
|
console.log('getWorker: workerId: ' + _ + ' label: ' + label);
|
|
27
30
|
switch (label) {
|
|
28
31
|
case 'template':
|
|
29
32
|
case 'typescript':
|
|
30
33
|
case 'javascript':
|
|
31
|
-
return
|
|
34
|
+
return buildWorker(workerOverrideGlobals, label, 'tsWorker', 'TS Worker');
|
|
32
35
|
case 'html':
|
|
33
36
|
case 'handlebars':
|
|
34
37
|
case 'razor':
|
|
35
|
-
return
|
|
38
|
+
return buildWorker(workerOverrideGlobals, label, 'htmlWorker', 'HTML Worker');
|
|
36
39
|
case 'css':
|
|
37
40
|
case 'scss':
|
|
38
41
|
case 'less':
|
|
39
|
-
return
|
|
42
|
+
return buildWorker(workerOverrideGlobals, label, 'cssWorker', 'CSS Worker');
|
|
40
43
|
case 'json':
|
|
41
|
-
return
|
|
44
|
+
return buildWorker(workerOverrideGlobals, label, 'jsonWorker', 'JSON Worker');
|
|
42
45
|
case 'graphql':
|
|
43
46
|
const workerFilename = `graphql.worker.bundle.js`;
|
|
44
47
|
const workerPathLocal = `${workerOverrideGlobals.workerPath}/${workerFilename}`;
|
|
@@ -47,7 +50,7 @@ export function buildWorkerDefinition(workerPath, basePath, useModuleWorker) {
|
|
|
47
50
|
name: label
|
|
48
51
|
});
|
|
49
52
|
default:
|
|
50
|
-
return
|
|
53
|
+
return buildWorker(workerOverrideGlobals, label, 'editorWorker', 'Editor Worker');
|
|
51
54
|
}
|
|
52
55
|
};
|
|
53
56
|
monWin.MonacoEnvironment.getWorker = getWorker;
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
<script>import ConfirmationModal from './ConfirmationModal.svelte';
|
|
2
|
-
import { beforeNavigate, goto } from '$app/navigation';
|
|
3
2
|
import Button from '../button/Button.svelte';
|
|
4
3
|
import { cleanValueProperties, orderedJsonStringify } from '../../../utils';
|
|
5
4
|
import { tick } from 'svelte';
|
|
6
5
|
export let savedValue = undefined;
|
|
7
6
|
export let modifiedValue = undefined;
|
|
8
7
|
export let diffDrawer = undefined;
|
|
8
|
+
export let gotoUrl;
|
|
9
|
+
export let beforeNavigate;
|
|
9
10
|
let bypassBeforeNavigate = false;
|
|
10
11
|
let open = false;
|
|
11
12
|
let goingTo = undefined;
|
|
12
|
-
beforeNavigate(async (newNavigationState) => {
|
|
13
|
+
beforeNavigate?.(async (newNavigationState) => {
|
|
13
14
|
if (!bypassBeforeNavigate &&
|
|
14
15
|
newNavigationState.to &&
|
|
15
16
|
newNavigationState.to.url.pathname !== newNavigationState.from?.url.pathname) {
|
|
@@ -21,7 +22,10 @@ beforeNavigate(async (newNavigationState) => {
|
|
|
21
22
|
const current = cleanValueProperties(modifiedValue);
|
|
22
23
|
if (orderedJsonStringify(draftOrDeployed) === orderedJsonStringify(current)) {
|
|
23
24
|
bypassBeforeNavigate = true;
|
|
24
|
-
|
|
25
|
+
if (!gotoUrl) {
|
|
26
|
+
console.error('gotoUrl is not defined');
|
|
27
|
+
}
|
|
28
|
+
gotoUrl?.(goingTo);
|
|
25
29
|
}
|
|
26
30
|
else {
|
|
27
31
|
open = true;
|
|
@@ -47,7 +51,10 @@ beforeNavigate(async (newNavigationState) => {
|
|
|
47
51
|
on:confirmed={() => {
|
|
48
52
|
if (goingTo) {
|
|
49
53
|
bypassBeforeNavigate = true
|
|
50
|
-
|
|
54
|
+
if (!gotoUrl) {
|
|
55
|
+
console.error('gotoUrl is not defined')
|
|
56
|
+
}
|
|
57
|
+
gotoUrl?.(goingTo)
|
|
51
58
|
}
|
|
52
59
|
}}
|
|
53
60
|
>
|
|
@@ -76,7 +83,7 @@ beforeNavigate(async (newNavigationState) => {
|
|
|
76
83
|
onClick: () => {
|
|
77
84
|
if (goingTo) {
|
|
78
85
|
bypassBeforeNavigate = true
|
|
79
|
-
|
|
86
|
+
gotoUrl?.(goingTo)
|
|
80
87
|
}
|
|
81
88
|
}
|
|
82
89
|
}
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import { SvelteComponent } from "svelte";
|
|
2
2
|
import type DiffDrawer from '../../DiffDrawer.svelte';
|
|
3
3
|
import { type Value } from '../../../utils';
|
|
4
|
+
import type { BeforeNavigate } from './model';
|
|
4
5
|
declare const __propDef: {
|
|
5
6
|
props: {
|
|
6
7
|
savedValue?: Value | undefined;
|
|
7
8
|
modifiedValue?: Value | undefined;
|
|
8
9
|
diffDrawer?: DiffDrawer | undefined;
|
|
10
|
+
gotoUrl: ((url: URL) => void) | undefined;
|
|
11
|
+
beforeNavigate: BeforeNavigate | undefined;
|
|
9
12
|
};
|
|
10
13
|
events: {
|
|
11
14
|
[evt: string]: CustomEvent<any>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -4,8 +4,8 @@ export let s3object;
|
|
|
4
4
|
</script>
|
|
5
5
|
|
|
6
6
|
<a
|
|
7
|
-
class="relative center-center flex w-full text-center font-
|
|
8
|
-
border
|
|
7
|
+
class="relative center-center flex w-full text-center font-normal text-tertiary text-sm
|
|
8
|
+
border border-dashed border-gray-400 hover:border-blue-500
|
|
9
9
|
focus-within:border-blue-500 hover:bg-blue-50 dark:hover:bg-frost-900 focus-within:bg-blue-50
|
|
10
10
|
duration-200 rounded-lg p-1 gap-2"
|
|
11
11
|
href={`/api/w/${$workspaceStore}/job_helpers/download_s3_file?file_key=${s3object?.s3}`}
|
|
@@ -90,7 +90,7 @@ async function dispatchChange() {
|
|
|
90
90
|
<button
|
|
91
91
|
class={twMerge(
|
|
92
92
|
`relative center-center flex-col text-center font-medium text-tertiary
|
|
93
|
-
border
|
|
93
|
+
border border-dashed border-gray-400 hover:border-blue-500
|
|
94
94
|
focus-within:border-blue-500 hover:bg-blue-50 dark:hover:bg-frost-900 focus-within:bg-blue-50
|
|
95
95
|
duration-200 rounded-lg p-1`,
|
|
96
96
|
c
|
|
@@ -3,7 +3,7 @@ import { OpenAI } from 'openai';
|
|
|
3
3
|
import { Script } from '../../gen';
|
|
4
4
|
import type { Writable } from 'svelte/store';
|
|
5
5
|
import type { DBSchema } from '../../stores';
|
|
6
|
-
import type { ChatCompletionMessageParam } from 'openai/resources/
|
|
6
|
+
import type { ChatCompletionMessageParam } from 'openai/resources/index.mjs';
|
|
7
7
|
export declare const SUPPORTED_LANGUAGES: Set<string>;
|
|
8
8
|
declare class WorkspacedOpenai {
|
|
9
9
|
private client;
|
|
@@ -37,8 +37,8 @@ interface FixScriptOpions extends BaseOptions {
|
|
|
37
37
|
}
|
|
38
38
|
type CopilotOptions = ScriptGenerationOptions | EditScriptOptions | FixScriptOpions;
|
|
39
39
|
export declare function addResourceTypes(scriptOptions: CopilotOptions, prompt: string): Promise<string>;
|
|
40
|
-
export declare function getNonStreamingCompletion(messages: ChatCompletionMessageParam[], abortController: AbortController, model?:
|
|
41
|
-
export declare function getCompletion(messages: ChatCompletionMessageParam[], abortController: AbortController, model?:
|
|
40
|
+
export declare function getNonStreamingCompletion(messages: ChatCompletionMessageParam[], abortController: AbortController, model?: any, noCache?: boolean): Promise<string>;
|
|
41
|
+
export declare function getCompletion(messages: ChatCompletionMessageParam[], abortController: AbortController, model?: any): Promise<OpenAI.Chat.Completions.ChatCompletion>;
|
|
42
42
|
export declare function copilot(scriptOptions: CopilotOptions, generatedCode: Writable<string>, abortController: AbortController, generatedExplanation?: Writable<string>): Promise<string>;
|
|
43
43
|
export declare function deltaCodeCompletion(messages: ChatCompletionMessageParam[], generatedCodeDelta: Writable<string>, abortController: AbortController): Promise<string>;
|
|
44
44
|
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { UserEdgeType, UserNodeType } from './types';
|
|
2
|
-
export { UserEdgeType, UserNodeType };
|
|
2
|
+
export type { UserEdgeType, UserNodeType };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export {};
|
|
@@ -22,6 +22,7 @@ import HighlightCode from '../HighlightCode.svelte';
|
|
|
22
22
|
import DrawerContent from '../common/drawer/DrawerContent.svelte';
|
|
23
23
|
import Item from './Item.svelte';
|
|
24
24
|
import TreeViewRoot from './TreeViewRoot.svelte';
|
|
25
|
+
import { goto } from '$app/navigation';
|
|
25
26
|
let scripts;
|
|
26
27
|
let flows;
|
|
27
28
|
let apps;
|
|
@@ -230,7 +231,11 @@ let collapseAll = true;
|
|
|
230
231
|
</DrawerContent>
|
|
231
232
|
</Drawer>
|
|
232
233
|
|
|
233
|
-
<ContentSearch
|
|
234
|
+
<ContentSearch
|
|
235
|
+
on:editScript={(e) => goto(`/scripts/edit/${e.detail}?no_draft=true`)}
|
|
236
|
+
on:editFlow={(e) => goto(`/flows/edit/${e.detail}?no_draft=true`)}
|
|
237
|
+
bind:this={contentSearch}
|
|
238
|
+
/>
|
|
234
239
|
<CenteredPage>
|
|
235
240
|
<div class="flex flex-wrap gap-2 items-center justify-between w-full mt-2">
|
|
236
241
|
<div class="flex justify-start">
|
|
@@ -75,14 +75,7 @@ export const settings = {
|
|
|
75
75
|
ee_only: ''
|
|
76
76
|
}
|
|
77
77
|
],
|
|
78
|
-
'SSO/OAuth': [
|
|
79
|
-
{
|
|
80
|
-
label: 'Require users to have been added manually to windmill to sign in through OAuth',
|
|
81
|
-
key: 'require_preexisting_user_for_oauth',
|
|
82
|
-
fieldType: 'boolean',
|
|
83
|
-
storage: 'setting'
|
|
84
|
-
}
|
|
85
|
-
],
|
|
78
|
+
'SSO/OAuth': [],
|
|
86
79
|
Registries: [
|
|
87
80
|
{
|
|
88
81
|
label: 'Pip Extra Index Url',
|
|
@@ -99,7 +99,7 @@ onDestroy(() => {
|
|
|
99
99
|
{/if}
|
|
100
100
|
</div>
|
|
101
101
|
<div class="w-1/2 h-full overflow-auto">
|
|
102
|
-
<JobArgs args={job?.args}
|
|
102
|
+
<JobArgs args={job?.args} />
|
|
103
103
|
</div>
|
|
104
104
|
<div class="w-1/2 h-full overflow-auto p-2">
|
|
105
105
|
{#if job && 'scheduled_for' in job && !job.running && job.scheduled_for && forLater(job.scheduled_for)}
|
|
@@ -118,18 +118,24 @@ function isSortable(key) {
|
|
|
118
118
|
color="light"
|
|
119
119
|
startIcon={{ icon: Download }}
|
|
120
120
|
on:click={() => {
|
|
121
|
-
const
|
|
122
|
-
.
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
121
|
+
const headers =
|
|
122
|
+
structuredObjects.length > 0
|
|
123
|
+
? Object.keys(structuredObjects[0].rowData).join(',')
|
|
124
|
+
: ''
|
|
125
|
+
const csvContent = [
|
|
126
|
+
headers, // Add headers as the first row
|
|
127
|
+
...structuredObjects
|
|
128
|
+
.filter(({ _id }) => {
|
|
129
|
+
if (selection.length > 0) {
|
|
130
|
+
return selection.includes(_id)
|
|
131
|
+
} else {
|
|
132
|
+
return true
|
|
133
|
+
}
|
|
134
|
+
})
|
|
135
|
+
.map(({ rowData }) => Object.values(rowData).join(','))
|
|
136
|
+
].join('\n')
|
|
131
137
|
|
|
132
|
-
const blob = new Blob([
|
|
138
|
+
const blob = new Blob([csvContent], { type: 'text/csv;charset=utf-8;' })
|
|
133
139
|
const url = URL.createObjectURL(blob)
|
|
134
140
|
const link = document.createElement('a')
|
|
135
141
|
link.setAttribute('href', url)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { GitRepositorySettings } from './GitRepositorySettings';
|
|
2
2
|
export type WorkspaceGitSyncSettings = {
|
|
3
3
|
include_path?: Array<string>;
|
|
4
|
-
include_type?: Array<'script' | 'flow' | 'app' | 'folder'>;
|
|
4
|
+
include_type?: Array<'script' | 'flow' | 'app' | 'folder' | 'resource' | 'variable' | 'secret' | 'resourcetype' | 'schedule'>;
|
|
5
5
|
repositories?: Array<GitRepositorySettings>;
|
|
6
6
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "windmill-components",
|
|
3
|
-
"version": "1.269.
|
|
3
|
+
"version": "1.269.2",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"dev": "vite dev",
|
|
6
6
|
"build": "vite build",
|
|
@@ -20,9 +20,10 @@
|
|
|
20
20
|
"@floating-ui/core": "^1.3.1",
|
|
21
21
|
"@playwright/test": "^1.34.3",
|
|
22
22
|
"@rgossiaux/svelte-headlessui": "^2.0.0",
|
|
23
|
-
"@sveltejs/adapter-static": "^
|
|
24
|
-
"@sveltejs/kit": "^
|
|
23
|
+
"@sveltejs/adapter-static": "^3.0.0",
|
|
24
|
+
"@sveltejs/kit": "^2.0.0",
|
|
25
25
|
"@sveltejs/package": "^2.2.2",
|
|
26
|
+
"@sveltejs/vite-plugin-svelte": "^3.0.0",
|
|
26
27
|
"@tailwindcss/forms": "^0.5.3",
|
|
27
28
|
"@tailwindcss/typography": "^0.5.8",
|
|
28
29
|
"@types/d3": "^7.4.0",
|
|
@@ -51,21 +52,20 @@
|
|
|
51
52
|
"style-to-object": "^0.4.1",
|
|
52
53
|
"stylelint-config-recommended": "^13.0.0",
|
|
53
54
|
"svelte": "^4.0.0",
|
|
54
|
-
"svelte-awesome-color-picker": "^
|
|
55
|
+
"svelte-awesome-color-picker": "^3.0.4",
|
|
55
56
|
"svelte-check": "^3.4.3",
|
|
56
|
-
"svelte-floating-ui": "^1.5.
|
|
57
|
-
"svelte-highlight": "^7.
|
|
57
|
+
"svelte-floating-ui": "^1.5.8",
|
|
58
|
+
"svelte-highlight": "^7.6.0",
|
|
58
59
|
"svelte-multiselect": "^10.0.0",
|
|
59
|
-
"svelte-overlay": "^1.4.1",
|
|
60
60
|
"svelte-popperjs": "^1.3.2",
|
|
61
61
|
"svelte-preprocess": "^5.0.1",
|
|
62
|
-
"svelte-range-slider-pips": "^2.
|
|
62
|
+
"svelte-range-slider-pips": "^2.3.1",
|
|
63
63
|
"svelte-splitpanes": "^0.8.0",
|
|
64
64
|
"svelte2tsx": "^0.6.16",
|
|
65
65
|
"tailwindcss": "^3.4.1",
|
|
66
66
|
"tslib": "^2.6.1",
|
|
67
67
|
"typescript": "^5.1.3",
|
|
68
|
-
"vite": "^
|
|
68
|
+
"vite": "^5",
|
|
69
69
|
"vite-plugin-circular-dependency": "^0.2.1",
|
|
70
70
|
"yootils": "^0.3.1"
|
|
71
71
|
},
|
|
@@ -116,17 +116,18 @@
|
|
|
116
116
|
"lodash": "^4.17.21",
|
|
117
117
|
"lucide-svelte": "^0.293.0",
|
|
118
118
|
"monaco-editor": "npm:@codingame/monaco-editor-treemended@>=1.83.5 <1.84.0",
|
|
119
|
+
"monaco-editor-workers": "0.44.0",
|
|
119
120
|
"monaco-graphql": "^1.5.1",
|
|
120
121
|
"monaco-languageclient": "~7.0.1",
|
|
121
122
|
"openai": "^4.3.0",
|
|
122
123
|
"quill": "^1.3.7",
|
|
123
124
|
"svelte-autosize": "^1.0.1",
|
|
124
125
|
"svelte-carousel": "^1.0.25",
|
|
125
|
-
"svelte-chartjs": "^3.1.
|
|
126
|
-
"svelte-dnd-action": "^0.9.
|
|
127
|
-
"svelte-exmarkdown": "^
|
|
126
|
+
"svelte-chartjs": "^3.1.5",
|
|
127
|
+
"svelte-dnd-action": "^0.9.38",
|
|
128
|
+
"svelte-exmarkdown": "^3.0.3",
|
|
128
129
|
"svelte-infinite-loading": "^1.3.8",
|
|
129
|
-
"svelte-portal": "^2.2.
|
|
130
|
+
"svelte-portal": "^2.2.1",
|
|
130
131
|
"svelte-tiny-virtual-list": "^2.0.5",
|
|
131
132
|
"tailwind-merge": "^1.13.2",
|
|
132
133
|
"vscode": "npm:@codingame/monaco-vscode-api@>=1.83.5 <1.84.0",
|
|
@@ -140,7 +141,7 @@
|
|
|
140
141
|
"yjs": "^13.6.7"
|
|
141
142
|
},
|
|
142
143
|
"peerDependencies": {
|
|
143
|
-
"@sveltejs/kit": "^
|
|
144
|
+
"@sveltejs/kit": "^2.0.0",
|
|
144
145
|
"svelte": "^4.0.0"
|
|
145
146
|
},
|
|
146
147
|
"exports": {
|