Skip to content

Commit 788d103

Browse files
authored
refactor: update provider panels for improved layout and styling (#7248)
1 parent 328748b commit 788d103

File tree

7 files changed

+426
-114
lines changed

7 files changed

+426
-114
lines changed

dashboard/src/assets/mdi-subset/materialdesignicons-subset.css

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Auto-generated MDI subset – 256 icons */
1+
/* Auto-generated MDI subset – 255 icons */
22
/* Do not edit manually. Run: pnpm run subset-icons */
33

44
@font-face {
@@ -132,10 +132,6 @@
132132
content: "\F0B66";
133133
}
134134

135-
.mdi-calendar-clock-outline::before {
136-
content: "\F16E1";
137-
}
138-
139135
.mdi-calendar-edit::before {
140136
content: "\F08A7";
141137
}
@@ -296,6 +292,10 @@
296292
content: "\F0193";
297293
}
298294

295+
.mdi-content-save-outline::before {
296+
content: "\F0818";
297+
}
298+
299299
.mdi-creation::before {
300300
content: "\F0674";
301301
}
@@ -844,10 +844,6 @@
844844
content: "\F048A";
845845
}
846846

847-
.mdi-send-clock-outline::before {
848-
content: "\F1164";
849-
}
850-
851847
.mdi-server::before {
852848
content: "\F048B";
853849
}
Binary file not shown.
Binary file not shown.

dashboard/src/components/provider/ProviderModelsPanel.vue

Lines changed: 109 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
<template>
2-
<div class="mt-4">
3-
<div class="d-flex align-center ga-2 mb-2">
4-
<h3 class="text-h5 font-weight-bold mb-0">{{ tm('models.configured') }}</h3>
5-
<small style="color: grey;" v-if="availableCount">{{ tm('models.available') }} {{ availableCount }}</small>
2+
<div class="provider-models-panel">
3+
<div class="provider-models-head">
4+
<div class="provider-models-title-wrap">
5+
<h3 class="provider-models-title">{{ tm('models.configured') }}</h3>
6+
<small v-if="availableCount" class="provider-models-subtitle">{{ tm('models.available') }} {{ availableCount }}</small>
7+
</div>
68
<v-text-field
79
v-model="modelSearchProxy"
810
density="compact"
@@ -11,37 +13,35 @@
1113
hide-details
1214
variant="solo-filled"
1315
flat
14-
class="ml-1"
15-
style="max-width: 240px;"
16+
class="provider-models-search"
1617
:placeholder="tm('models.searchPlaceholder')"
1718
/>
18-
<v-spacer></v-spacer>
19-
<v-btn
20-
color="primary"
21-
prepend-icon="mdi-download"
22-
:loading="loadingModels"
23-
@click="emit('fetch-models')"
24-
variant="tonal"
25-
size="small"
26-
>
27-
{{ isSourceModified ? tm('providerSources.saveAndFetchModels') : tm('providerSources.fetchModels') }}
28-
</v-btn>
29-
<v-btn
30-
color="primary"
31-
prepend-icon="mdi-pencil-plus"
32-
variant="text"
33-
size="small"
34-
class="ml-1"
35-
@click="emit('open-manual-model')"
36-
>
37-
{{ tm('models.manualAddButton') }}
38-
</v-btn>
19+
<div class="provider-models-actions">
20+
<v-btn
21+
color="primary"
22+
prepend-icon="mdi-download"
23+
:loading="loadingModels"
24+
@click="emit('fetch-models')"
25+
variant="tonal"
26+
size="small"
27+
>
28+
{{ isSourceModified ? tm('providerSources.saveAndFetchModels') : tm('providerSources.fetchModels') }}
29+
</v-btn>
30+
<v-btn
31+
color="primary"
32+
prepend-icon="mdi-pencil-plus"
33+
variant="text"
34+
size="small"
35+
@click="emit('open-manual-model')"
36+
>
37+
{{ tm('models.manualAddButton') }}
38+
</v-btn>
39+
</div>
3940
</div>
4041

4142
<v-list
4243
density="compact"
43-
class="rounded-lg border"
44-
style="max-height: 520px; overflow-y: auto; font-family:system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;"
44+
class="provider-models-list"
4545
>
4646
<template v-if="entries.length > 0">
4747
<template v-for="entry in entries" :key="entry.type === 'configured' ? `provider-${entry.provider.id}` : `model-${entry.model}`">
@@ -55,7 +55,7 @@
5555
<v-list-item-title class="font-weight-medium text-truncate">
5656
{{ entry.provider.id }}
5757
</v-list-item-title>
58-
<v-list-item-subtitle class="text-caption text-grey d-flex align-center ga-1" style="font-family: monospace;">
58+
<v-list-item-subtitle class="provider-model-subtitle d-flex align-center ga-1">
5959
<span>{{ entry.provider.model }}</span>
6060
<v-icon v-if="supportsImageInput(entry.metadata)" size="14" color="grey">
6161
mdi-eye-outline
@@ -124,7 +124,7 @@
124124
<template #activator="{ props }">
125125
<v-list-item v-bind="props" class="cursor-pointer" @click="emit('add-model-provider', entry.model)">
126126
<v-list-item-title>{{ entry.model }}</v-list-item-title>
127-
<v-list-item-subtitle class="text-caption text-grey d-flex align-center ga-1">
127+
<v-list-item-subtitle class="provider-model-subtitle d-flex align-center ga-1">
128128
<span>{{ entry.model }}</span>
129129
<v-icon v-if="supportsImageInput(entry.metadata)" size="14" color="grey">
130130
mdi-eye-outline
@@ -231,11 +231,87 @@ const isProviderTesting = (providerId) => props.testingProviders.includes(provid
231231
</script>
232232

233233
<style scoped>
234-
.border {
235-
border: 1px solid rgba(var(--v-border-color), var(--v-border-opacity));
234+
.provider-models-panel {
235+
display: grid;
236+
gap: 14px;
237+
}
238+
239+
.provider-models-head {
240+
display: flex;
241+
align-items: center;
242+
gap: 10px;
243+
flex-wrap: wrap;
244+
}
245+
246+
.provider-models-title-wrap {
247+
min-width: 0;
248+
}
249+
250+
.provider-models-title {
251+
margin: 0;
252+
font-size: 18px;
253+
line-height: 1.3;
254+
font-weight: 650;
255+
}
256+
257+
.provider-models-subtitle {
258+
display: block;
259+
margin-top: 6px;
260+
color: rgba(var(--v-theme-on-surface), 0.6);
261+
font-size: 12px;
262+
}
263+
264+
.provider-models-search {
265+
max-width: 240px;
266+
}
267+
268+
.provider-models-actions {
269+
margin-left: auto;
270+
display: flex;
271+
align-items: center;
272+
gap: 6px;
273+
flex-wrap: wrap;
274+
}
275+
276+
.provider-models-list {
277+
max-height: 520px;
278+
overflow-y: auto;
279+
border: 1px solid rgba(var(--v-theme-on-surface), 0.1);
280+
border-radius: 14px;
281+
background: rgb(var(--v-theme-surface));
282+
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
283+
}
284+
285+
.provider-compact-item {
286+
border-bottom: 1px solid rgba(var(--v-theme-on-surface), 0.08);
287+
}
288+
289+
.provider-models-list :deep(.v-list-item:last-child) {
290+
border-bottom: 0;
291+
}
292+
293+
.provider-model-subtitle {
294+
color: rgba(var(--v-theme-on-surface), 0.62);
295+
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
236296
}
237297
238298
.cursor-pointer {
239299
cursor: pointer;
240300
}
301+
302+
@media (max-width: 900px) {
303+
.provider-models-head {
304+
align-items: stretch;
305+
}
306+
307+
.provider-models-search {
308+
max-width: none;
309+
width: 100%;
310+
}
311+
312+
.provider-models-actions {
313+
margin-left: 0;
314+
width: 100%;
315+
}
316+
}
241317
</style>

0 commit comments

Comments
 (0)