mirror of
https://github.com/open-webui/open-webui
synced 2025-04-25 00:39:36 +00:00
refac
This commit is contained in:
parent
5f89c1b137
commit
3e7077bb73
@ -1142,9 +1142,10 @@ async def get_app_config(request: Request):
|
|||||||
if data is not None and "id" in data:
|
if data is not None and "id" in data:
|
||||||
user = Users.get_user_by_id(data["id"])
|
user = Users.get_user_by_id(data["id"])
|
||||||
|
|
||||||
|
user_count = Users.get_num_users()
|
||||||
onboarding = False
|
onboarding = False
|
||||||
|
|
||||||
if user is None:
|
if user is None:
|
||||||
user_count = Users.get_num_users()
|
|
||||||
onboarding = user_count == 0
|
onboarding = user_count == 0
|
||||||
|
|
||||||
return {
|
return {
|
||||||
@ -1213,6 +1214,14 @@ async def get_app_config(request: Request):
|
|||||||
"api_key": GOOGLE_DRIVE_API_KEY.value,
|
"api_key": GOOGLE_DRIVE_API_KEY.value,
|
||||||
},
|
},
|
||||||
"onedrive": {"client_id": ONEDRIVE_CLIENT_ID.value},
|
"onedrive": {"client_id": ONEDRIVE_CLIENT_ID.value},
|
||||||
|
**(
|
||||||
|
{
|
||||||
|
"record_count": user_count,
|
||||||
|
"active_entries": app.state.USER_COUNT,
|
||||||
|
}
|
||||||
|
if user.role == "admin"
|
||||||
|
else {}
|
||||||
|
),
|
||||||
}
|
}
|
||||||
if user is not None
|
if user is not None
|
||||||
else {}
|
else {}
|
||||||
|
@ -334,7 +334,7 @@
|
|||||||
<button
|
<button
|
||||||
class="min-w-fit outline-none p-1.5 {selectedTag === ''
|
class="min-w-fit outline-none p-1.5 {selectedTag === ''
|
||||||
? ''
|
? ''
|
||||||
: 'text-gray-300 dark:text-gray-600 hover:text-gray-700 dark:hover:text-white'} transition"
|
: 'text-gray-300 dark:text-gray-600 hover:text-gray-700 dark:hover:text-white'} transition capitalize"
|
||||||
on:click={() => {
|
on:click={() => {
|
||||||
selectedTag = '';
|
selectedTag = '';
|
||||||
}}
|
}}
|
||||||
@ -346,7 +346,7 @@
|
|||||||
<button
|
<button
|
||||||
class="min-w-fit outline-none p-1.5 {selectedTag === tag
|
class="min-w-fit outline-none p-1.5 {selectedTag === tag
|
||||||
? ''
|
? ''
|
||||||
: 'text-gray-300 dark:text-gray-600 hover:text-gray-700 dark:hover:text-white'} transition"
|
: 'text-gray-300 dark:text-gray-600 hover:text-gray-700 dark:hover:text-white'} transition capitalize"
|
||||||
on:click={() => {
|
on:click={() => {
|
||||||
selectedTag = tag;
|
selectedTag = tag;
|
||||||
}}
|
}}
|
||||||
|
Loading…
Reference in New Issue
Block a user