mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-09-10 00:05:27 +00:00
* feat: add instance-level AI settings with workspace fallback Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * feat: add AI step to onboarding setup wizard Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * fix: thread workspace prop through resource editor and disable chat offset Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * Revert "fix: thread workspace prop through resource editor and disable chat offset" This reverts commit 9fea9cc0c239f6432d1fef1487c45e74ab752e21. * fix: set workspace store and disable chat offset during AI setup step Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * fix: thread workspace and disableChatOffset props through resource editors Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * fix: populate workspace and user stores for AI step path component Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: initialize AI clients for test key during onboarding Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * refactor: extract AI config state into InstanceAISettings component Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * refactor: move AI config state ownership into AISettings component Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * Persist instance AI settings before navigation * Reload effective workspace AI state after save * Scope AI key tests to the rendered workspace * Add post-create AI onboarding for new workspaces * Unify instance AI settings header * Fix instance AI drawer offset on workspace selection * Add instance AI fallback settings behavior * Update sqlx metadata * Update sqlx metadata * Clarify active instance AI in workspace settings * Refresh workspace AI state after instance AI save * Declare instance AI summary in API schema * Normalize empty instance AI config handling * Clean up workspace AI settings UI * Unify AI config provider checks * Split AI settings metadata from effective config * Propagate instance AI cache invalidation across servers * Fix AI settings dirty state tracking * Update sqlx metadata --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
104 lines
2.6 KiB
Svelte
104 lines
2.6 KiB
Svelte
<script lang="ts">
|
|
import { run } from 'svelte/legacy'
|
|
|
|
import { createEventDispatcher } from 'svelte'
|
|
import { Button, Drawer } from './common'
|
|
import DrawerContent from './common/drawer/DrawerContent.svelte'
|
|
|
|
import AppConnectInner from './AppConnectInner.svelte'
|
|
import DarkModeObserver from './DarkModeObserver.svelte'
|
|
|
|
interface Props {
|
|
expressOAuthSetup?: boolean
|
|
workspace?: string
|
|
disableChatOffset?: boolean
|
|
}
|
|
|
|
let { expressOAuthSetup = false, workspace = undefined, disableChatOffset = false }: Props = $props()
|
|
|
|
let drawer: Drawer | undefined = $state()
|
|
let resourceType = $state('')
|
|
let step = $state(1)
|
|
let disabled = $state(false)
|
|
let isGoogleSignin = $state(false)
|
|
let manual = $state(true)
|
|
|
|
let appConnectInner: AppConnectInner | undefined = $state(undefined)
|
|
|
|
let rtToLoad: string | undefined = $state('')
|
|
export async function open(rt?: string) {
|
|
rtToLoad = rt
|
|
drawer?.openDrawer?.()
|
|
}
|
|
|
|
function onRtToLoadChange(rtToLoad: string | undefined) {
|
|
appConnectInner?.open(rtToLoad)
|
|
}
|
|
|
|
const dispatch = createEventDispatcher()
|
|
|
|
let darkMode: boolean = $state(false)
|
|
run(() => {
|
|
appConnectInner && onRtToLoadChange(rtToLoad)
|
|
})
|
|
</script>
|
|
|
|
<DarkModeObserver bind:darkMode />
|
|
|
|
<Drawer
|
|
bind:this={drawer}
|
|
on:close={() => {
|
|
step = 1
|
|
dispatch('close')
|
|
}}
|
|
size="800px"
|
|
{disableChatOffset}
|
|
>
|
|
<DrawerContent
|
|
title="Add a resource"
|
|
id="add-resource-drawer"
|
|
on:close={drawer?.closeDrawer}
|
|
tooltip="Resources represent connections to third party systems. Learn more on how to integrate external APIs."
|
|
documentationLink="https://www.windmill.dev/docs/integrations/integrations_on_windmill"
|
|
>
|
|
<AppConnectInner
|
|
bind:this={appConnectInner}
|
|
bind:step
|
|
bind:resourceType
|
|
bind:isGoogleSignin
|
|
bind:disabled
|
|
bind:manual
|
|
on:close={drawer?.closeDrawer}
|
|
on:refresh
|
|
express={expressOAuthSetup}
|
|
{workspace}
|
|
/>
|
|
{#snippet actions()}
|
|
<div class="flex gap-1">
|
|
{#if step > 1}
|
|
<Button variant="default" on:click={appConnectInner?.back ?? (() => {})}>Back</Button>
|
|
{/if}
|
|
{#if isGoogleSignin}
|
|
<button {disabled} onclick={appConnectInner?.next}>
|
|
<img
|
|
class="h-10 w-auto object-contain"
|
|
src={darkMode ? '/google_signin_dark.png' : '/google_signin_light.png'}
|
|
alt="Google sign-in"
|
|
/>
|
|
</button>
|
|
{:else}
|
|
<Button variant="accent" {disabled} on:click={appConnectInner?.next ?? (() => {})}>
|
|
{#if step == 2 && !manual}
|
|
Connect
|
|
{:else if step == 1}
|
|
Next
|
|
{:else}
|
|
Save
|
|
{/if}
|
|
</Button>
|
|
{/if}
|
|
</div>
|
|
{/snippet}
|
|
</DrawerContent>
|
|
</Drawer>
|