Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
open-webui
Commits
028eb7b3
Commit
028eb7b3
authored
Aug 03, 2024
by
Clivia
Browse files
✨
Better Practice
✨
Better Practice
parent
8f494292
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
9 deletions
+7
-9
src/lib/components/chat/MessageInput/Models.svelte
src/lib/components/chat/MessageInput/Models.svelte
+7
-9
No files found.
src/lib/components/chat/MessageInput/Models.svelte
View file @
028eb7b3
...
@@ -21,10 +21,8 @@
...
@@ -21,10 +21,8 @@
let filteredModels = [];
let filteredModels = [];
$: filteredModels = $models
$: filteredModels = $models
.filter(
.filter((p) =>
(p) =>
p.name.toLowerCase().includes(prompt.toLowerCase().split(' ')?.at(0)?.substring(1) ?? '')
p.name.toLowerCase().includes(prompt.toLowerCase().split(' ')?.at(0)?.substring(1) ?? '') &&
p?.info?.meta?.hidden
)
)
.sort((a, b) => a.name.localeCompare(b.name));
.sort((a, b) => a.name.localeCompare(b.name));
...
@@ -149,9 +147,9 @@
...
@@ -149,9 +147,9 @@
<div class="m-1 overflow-y-auto p-1 rounded-r-lg space-y-0.5 scrollbar-hidden">
<div class="m-1 overflow-y-auto p-1 rounded-r-lg space-y-0.5 scrollbar-hidden">
{#each filteredModels as model, modelIdx}
{#each filteredModels as model, modelIdx}
<button
<button
class="
px-3 py-1.5 rounded-xl w-full text-left {modelIdx === selectedIdx
class="px-3 py-1.5 rounded-xl w-full text-left {modelIdx === selectedIdx
? '
bg-gray-50 dark:bg-gray-850
selected-command-option-button'
? 'bg-gray-50 dark:bg-gray-850 selected-command-option-button'
: ''}"
:
''} {model?.info?.meta?.hidden ? 'hidden' :
''}"
type="button"
type="button"
on:click={() => {
on:click={() => {
confirmSelect(model);
confirmSelect(model);
...
@@ -164,7 +162,7 @@
...
@@ -164,7 +162,7 @@
<div class="flex font-medium text-black dark:text-gray-100 line-clamp-1">
<div class="flex font-medium text-black dark:text-gray-100 line-clamp-1">
<img
<img
src={model?.info?.meta?.profile_image_url ?? '/static/favicon.png'}
src={model?.info?.meta?.profile_image_url ?? '/static/favicon.png'}
alt=
"M
odel
"
alt=
{m
odel
.name}
class="rounded-full size-6 items-center mr-2"
class="rounded-full size-6 items-center mr-2"
/>
/>
{model.name}
{model.name}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment