Skip to content

Commit 3e7077b

Browse files
committed
refac
1 parent 5f89c1b commit 3e7077b

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

backend/open_webui/main.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1142,9 +1142,10 @@ async def get_app_config(request: Request):
11421142
if data is not None and "id" in data:
11431143
user = Users.get_user_by_id(data["id"])
11441144

1145+
user_count = Users.get_num_users()
11451146
onboarding = False
1147+
11461148
if user is None:
1147-
user_count = Users.get_num_users()
11481149
onboarding = user_count == 0
11491150

11501151
return {
@@ -1213,6 +1214,14 @@ async def get_app_config(request: Request):
12131214
"api_key": GOOGLE_DRIVE_API_KEY.value,
12141215
},
12151216
"onedrive": {"client_id": ONEDRIVE_CLIENT_ID.value},
1217+
**(
1218+
{
1219+
"record_count": user_count,
1220+
"active_entries": app.state.USER_COUNT,
1221+
}
1222+
if user.role == "admin"
1223+
else {}
1224+
),
12161225
}
12171226
if user is not None
12181227
else {}

src/lib/components/chat/ModelSelector/Selector.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@
334334
<button
335335
class="min-w-fit outline-none p-1.5 {selectedTag === ''
336336
? ''
337-
: 'text-gray-300 dark:text-gray-600 hover:text-gray-700 dark:hover:text-white'} transition"
337+
: 'text-gray-300 dark:text-gray-600 hover:text-gray-700 dark:hover:text-white'} transition capitalize"
338338
on:click={() => {
339339
selectedTag = '';
340340
}}
@@ -346,7 +346,7 @@
346346
<button
347347
class="min-w-fit outline-none p-1.5 {selectedTag === tag
348348
? ''
349-
: 'text-gray-300 dark:text-gray-600 hover:text-gray-700 dark:hover:text-white'} transition"
349+
: 'text-gray-300 dark:text-gray-600 hover:text-gray-700 dark:hover:text-white'} transition capitalize"
350350
on:click={() => {
351351
selectedTag = tag;
352352
}}

0 commit comments

Comments
 (0)