mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-09-10 16:05:58 +00:00
32 lines
786 B
Svelte
32 lines
786 B
Svelte
<script lang="ts">
|
|
import { copilotInfo } from '$lib/aiStore'
|
|
import { codeCompletionSessionEnabled, CODE_COMPLETION_SETTING_NAME } from '$lib/stores'
|
|
import { storeLocalSetting } from '$lib/utils'
|
|
import Toggle from '../Toggle.svelte'
|
|
|
|
function storeSetting() {
|
|
storeLocalSetting(CODE_COMPLETION_SETTING_NAME, $codeCompletionSessionEnabled.toString())
|
|
}
|
|
</script>
|
|
|
|
{#if $copilotInfo.enabled && $copilotInfo.codeCompletionModel}
|
|
<Toggle
|
|
size="xs"
|
|
bind:checked={$codeCompletionSessionEnabled}
|
|
on:change={() => {
|
|
storeSetting()
|
|
}}
|
|
options={{ right: 'AI code completion' }}
|
|
/>
|
|
{:else}
|
|
<Toggle
|
|
disabled
|
|
size="xs"
|
|
checked={false}
|
|
on:change={() => {
|
|
storeSetting()
|
|
}}
|
|
options={{ right: 'AI code completion (disabled in workspace settings)' }}
|
|
/>
|
|
{/if}
|