mod model select

This commit is contained in:
l.gabrysiak 2025-03-01 12:21:43 +01:00
parent 53b9dd3487
commit b1c326253a
1 changed files with 54 additions and 52 deletions

View File

@ -52,66 +52,68 @@
/> />
</div> </div>
</div> </div>
{#if $user.role === 'admin'}
{#if selectedModelIdx === 0 && $user.role === 'admin'} {#if selectedModelIdx === 0}
<div <div
class=" self-center mx-1 disabled:text-gray-600 disabled:hover:text-gray-600 -translate-y-[0.5px]" class=" self-center mx-1 disabled:text-gray-600 disabled:hover:text-gray-600 -translate-y-[0.5px]"
> >
<Tooltip content={$i18n.t('Add Model')}> <Tooltip content={$i18n.t('Add Model')}>
<button <button
class=" " class=" "
{disabled} {disabled}
on:click={() => { on:click={() => {
selectedModels = [...selectedModels, '']; selectedModels = [...selectedModels, ''];
}} }}
aria-label="Add Model" aria-label="Add Model"
>
<svg
xmlns="http://www.w3.org/2000/svg"
fill="none"
viewBox="0 0 24 24"
stroke-width="2"
stroke="currentColor"
class="size-3.5"
> >
<path stroke-linecap="round" stroke-linejoin="round" d="M12 6v12m6-6H6" /> <svg
</svg> xmlns="http://www.w3.org/2000/svg"
</button> fill="none"
</Tooltip> viewBox="0 0 24 24"
</div> stroke-width="2"
{:else} stroke="currentColor"
<div class="size-3.5"
class=" self-center mx-1 disabled:text-gray-600 disabled:hover:text-gray-600 -translate-y-[0.5px]" >
> <path stroke-linecap="round" stroke-linejoin="round" d="M12 6v12m6-6H6" />
<Tooltip content={$i18n.t('Remove Model')}> </svg>
<button </button>
{disabled} </Tooltip>
on:click={() => { </div>
selectedModels.splice(selectedModelIdx, 1); {:else}
selectedModels = selectedModels; <div
}} class=" self-center mx-1 disabled:text-gray-600 disabled:hover:text-gray-600 -translate-y-[0.5px]"
aria-label="Remove Model" >
> <Tooltip content={$i18n.t('Remove Model')}>
<svg <button
xmlns="http://www.w3.org/2000/svg" {disabled}
fill="none" on:click={() => {
viewBox="0 0 24 24" selectedModels.splice(selectedModelIdx, 1);
stroke-width="2" selectedModels = selectedModels;
stroke="currentColor" }}
class="size-3" aria-label="Remove Model"
> >
<path stroke-linecap="round" stroke-linejoin="round" d="M19.5 12h-15" /> <svg
</svg> xmlns="http://www.w3.org/2000/svg"
</button> fill="none"
</Tooltip> viewBox="0 0 24 24"
</div> stroke-width="2"
stroke="currentColor"
class="size-3"
>
<path stroke-linecap="round" stroke-linejoin="round" d="M19.5 12h-15" />
</svg>
</button>
</Tooltip>
</div>
{/if}
{/if} {/if}
</div> </div>
{/each} {/each}
</div> </div>
{#if $user.role === 'admin'}
{#if showSetDefault} {#if showSetDefault}
<div class=" absolute text-left mt-[1px] ml-1 text-[0.7rem] text-gray-500 font-primary"> <div class=" absolute text-left mt-[1px] ml-1 text-[0.7rem] text-gray-500 font-primary">
<button on:click={saveDefaultModel}> {$i18n.t('Set as default')}</button> <button on:click={saveDefaultModel}> {$i18n.t('Set as default')}</button>
</div> </div>
{/if} {/if}
{/if}