Skip to content

Commit 8c4d967

Browse files
committed
refac: evaluations settings ui
1 parent ce7cf62 commit 8c4d967

File tree

1 file changed

+47
-41
lines changed

1 file changed

+47
-41
lines changed

src/lib/components/admin/Settings/Evaluations.svelte

Lines changed: 47 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,12 @@
103103
<div class="overflow-y-scroll scrollbar-hidden h-full">
104104
{#if evaluationConfig !== null}
105105
<div class="">
106-
<div class="text-sm font-medium mb-2">{$i18n.t('General Settings')}</div>
106+
<div class="mb-3">
107+
<div class=" mb-2.5 text-base font-medium">{$i18n.t('General')}</div>
107108

108-
<div class=" mb-2">
109-
<div class="flex justify-between items-center text-xs">
109+
<hr class=" border-gray-100 dark:border-gray-850 my-2" />
110+
111+
<div class="mb-2.5 flex w-full justify-between">
110112
<div class=" text-xs font-medium">{$i18n.t('Arena Models')}</div>
111113

112114
<Tooltip content={$i18n.t(`Message rating should be enabled to use this feature`)}>
@@ -116,46 +118,50 @@
116118
</div>
117119

118120
{#if evaluationConfig.ENABLE_EVALUATION_ARENA_MODELS}
119-
<hr class=" border-gray-50 dark:border-gray-700/10 my-2" />
120-
121-
<div class="flex justify-between items-center mb-2">
122-
<div class="text-sm font-medium">{$i18n.t('Manage Arena Models')}</div>
123-
124-
<div>
125-
<Tooltip content={$i18n.t('Add Arena Model')}>
126-
<button
127-
class="p-1"
128-
type="button"
129-
on:click={() => {
130-
showAddModel = true;
131-
}}
132-
>
133-
<Plus />
134-
</button>
135-
</Tooltip>
136-
</div>
137-
</div>
121+
<div class="mb-3">
122+
<div class=" mb-2.5 text-base font-medium flex justify-between items-center">
123+
<div>
124+
{$i18n.t('Manage')}
125+
</div>
138126

139-
<div class="flex flex-col gap-2">
140-
{#if (evaluationConfig?.EVALUATION_ARENA_MODELS ?? []).length > 0}
141-
{#each evaluationConfig.EVALUATION_ARENA_MODELS as model, index}
142-
<Model
143-
{model}
144-
on:edit={(e) => {
145-
editModelHandler(e.detail, index);
146-
}}
147-
on:delete={(e) => {
148-
deleteModelHandler(index);
149-
}}
150-
/>
151-
{/each}
152-
{:else}
153-
<div class=" text-center text-xs text-gray-500">
154-
{$i18n.t(
155-
`Using the default arena model with all models. Click the plus button to add custom models.`
156-
)}
127+
<div>
128+
<Tooltip content={$i18n.t('Add Arena Model')}>
129+
<button
130+
class="p-1"
131+
type="button"
132+
on:click={() => {
133+
showAddModel = true;
134+
}}
135+
>
136+
<Plus />
137+
</button>
138+
</Tooltip>
157139
</div>
158-
{/if}
140+
</div>
141+
142+
<hr class=" border-gray-100 dark:border-gray-850 my-2" />
143+
144+
<div class="flex flex-col gap-2">
145+
{#if (evaluationConfig?.EVALUATION_ARENA_MODELS ?? []).length > 0}
146+
{#each evaluationConfig.EVALUATION_ARENA_MODELS as model, index}
147+
<Model
148+
{model}
149+
on:edit={(e) => {
150+
editModelHandler(e.detail, index);
151+
}}
152+
on:delete={(e) => {
153+
deleteModelHandler(index);
154+
}}
155+
/>
156+
{/each}
157+
{:else}
158+
<div class=" text-center text-xs text-gray-500">
159+
{$i18n.t(
160+
`Using the default arena model with all models. Click the plus button to add custom models.`
161+
)}
162+
</div>
163+
{/if}
164+
</div>
159165
</div>
160166
{/if}
161167
</div>

0 commit comments

Comments
 (0)