From 9f75f2a9fccae5686437b9a2a12e622e9c45e140 Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Wed, 4 Sep 2024 09:22:00 +0100 Subject: [PATCH] account for setting a default config and unset the rest --- .../portal/settings/ai/AIConfigTile.svelte | 43 +++++++++++-------- .../portal/settings/ai/ConfigModal.svelte | 2 +- .../builder/portal/settings/ai/index.svelte | 10 ++++- .../portal/settings/ai/logos/OpenAI.svelte | 10 +++-- packages/types/src/sdk/licensing/quota.ts | 4 ++ 5 files changed, 45 insertions(+), 24 deletions(-) diff --git a/packages/builder/src/pages/builder/portal/settings/ai/AIConfigTile.svelte b/packages/builder/src/pages/builder/portal/settings/ai/AIConfigTile.svelte index 39c0972027..0b7a006312 100644 --- a/packages/builder/src/pages/builder/portal/settings/ai/AIConfigTile.svelte +++ b/packages/builder/src/pages/builder/portal/settings/ai/AIConfigTile.svelte @@ -8,7 +8,6 @@ export let config export let disabled - export let budibaseAIDefault export let editHandler export let deleteHandler @@ -33,25 +32,30 @@
- - + {#if config.name !== "Budibase AI"} + + + {/if} {#if config.active}
Activated
{:else if !config.active}
Disabled
{/if} + {#if config.isDefault} +
Default
+ {/if}
@@ -63,7 +67,7 @@ border-radius: 4px; cursor: pointer; display: grid; - grid-template-columns: 6% 1fr 20%; + grid-template-columns: 6% 1fr auto; grid-gap: 20px; align-items: center; } @@ -109,15 +113,18 @@ align-items: center; gap: 8px; font-size: 12px; + border-radius: 5px; + } + + .default { + background: var(--grey-6); } .active { - border-radius: 5px; background: var(--spectrum-global-color-green-600); } .disabled { - border-radius: 5px; background: var(--spectrum-global-color-red-600); } diff --git a/packages/builder/src/pages/builder/portal/settings/ai/ConfigModal.svelte b/packages/builder/src/pages/builder/portal/settings/ai/ConfigModal.svelte index 73db61161b..99f3aa8e7b 100644 --- a/packages/builder/src/pages/builder/portal/settings/ai/ConfigModal.svelte +++ b/packages/builder/src/pages/builder/portal/settings/ai/ConfigModal.svelte @@ -65,7 +65,7 @@ {#if config.provider !== Providers.Custom.name}