Skip to content

Commit

Permalink
Make technologic tolerant to having OpenAI be renamed.
Browse files Browse the repository at this point in the history
  • Loading branch information
wmeddie committed Dec 12, 2024
1 parent 28268fe commit 7503902
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 23 deletions.
24 changes: 13 additions & 11 deletions src/routes/settings/backends/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
>
<span><IconServer /></span>
<span class="flex-grow">
{backend.name}
{(backend)? backend.name : 'Backend Not found'}
</span>
<span>
<a href="/settings/backends/{backend.name}"><IconEdit /></a>
Expand All @@ -73,16 +73,18 @@
<h3>{$t('settings.backend.useModel')}:</h3>
<nav class="list-nav">
<ul>
{#each currentBackend.models as model}
<li>
<a
on:click={() => setModel(model)}
class:bg-surface-active-token={model === $configStore.backend.model}
>
<span>{model}</span>
</a>
</li>
{/each}
{#if currentBackend }
{#each currentBackend.models as model}
<li>
<a
on:click={() => setModel(model)}
class:bg-surface-active-token={model === $configStore.backend.model}
>
<span>{model}</span>
</a>
</li>
{/each}
{/if}
</ul>
</nav>
</section>
28 changes: 16 additions & 12 deletions src/routes/settings/backends/[backendName]/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
<IconServer />
</span>
<span>
Backend: {backend.name}
Backend: {(backend) ? backend.name : 'No backend found' }
</span>
</h3>
<div class="flex flex-col gap-2 p-5">
Expand Down Expand Up @@ -87,22 +87,26 @@
<span>Default Model</span>
<select class="select" bind:value={dto.defaultModel}>
<option value="" disabled>Select a model</option>
{#each dto.models as model}
<option value={model}>{model}</option>
{/each}
{#if dto.models}
{#each dto.models as model}
<option value={model}>{model}</option>
{/each}
{/if}
</select>
</label>
<div>
<h4>Models</h4>
<ul class="list">
{#each dto.models as model}
<li class="flex">
<EditableString bind:value={model} initialEditing={model === ''} />
<button class="btn-icon w-8 p-0 variant-soft-error" on:click={() => deleteModel(model)}>
<IconTrashX size="16" />
</button>
</li>
{/each}
{#if dto.models}
{#each dto.models as model}
<li class="flex">
<EditableString bind:value={model} initialEditing={model === ''} />
<button class="btn-icon w-8 p-0 variant-soft-error" on:click={() => deleteModel(model)}>
<IconTrashX size="16" />
</button>
</li>
{/each}
{/if}
<li>
<button class="btn variant-soft-surface" on:click={addModel}>
<span>
Expand Down

0 comments on commit 7503902

Please sign in to comment.