diff --git a/README.md b/README.md index c794c6b1..bde67525 100644 --- a/README.md +++ b/README.md @@ -71,6 +71,11 @@ Don't forget to explore our sibling project, [OllamaHub](https://ollamahub.com/) ## How to Install 🚀 +🌟 **Important Note on User Roles:** + +- **Admin Creation:** The very first account to sign up on the Ollama Web UI will be granted **Administrator privileges**. This account will have comprehensive control over the platform, including user management and system settings. +- **User Registrations:** All subsequent users signing up will initially have their accounts set to **Pending** status by default. These accounts will require approval from the Administrator to gain access to the platform functionalities. + ### Installing Both Ollama and Ollama Web UI Using Docker Compose If you don't have Ollama installed yet, you can use the provided Docker Compose file for a hassle-free installation. Simply run the following command: diff --git a/TROUBLESHOOTING.md b/TROUBLESHOOTING.md index 4399ffc5..59f7049b 100644 --- a/TROUBLESHOOTING.md +++ b/TROUBLESHOOTING.md @@ -7,7 +7,7 @@ If you're running ollama-webui and have chosen to install webui and ollama separ Here's an example of the command you should run: ```bash -docker run -d --network=host -e OLLAMA_API_BASE_URL=http://127.0.0.1:11434/api --name ollama-webui --restart always ghcr.io/ollama-webui/ollama-webui:main +docker run -d --network=host -v ollama-webui:/app/backend/data -e OLLAMA_API_BASE_URL=http://127.0.0.1:11434/api --name ollama-webui --restart always ghcr.io/ollama-webui/ollama-webui:main ``` ## Connection Errors diff --git a/backend/apps/web/routers/auths.py b/backend/apps/web/routers/auths.py index 02b77248..27d6a3b6 100644 --- a/backend/apps/web/routers/auths.py +++ b/backend/apps/web/routers/auths.py @@ -88,7 +88,9 @@ async def signup(form_data: SignupForm): try: role = "admin" if Users.get_num_users() == 0 else "pending" hashed = get_password_hash(form_data.password) - user = Auths.insert_new_auth(form_data.email, hashed, form_data.name, role) + user = Auths.insert_new_auth( + form_data.email.lower(), hashed, form_data.name, role + ) if user: token = create_token(data={"email": user.email}) diff --git a/backend/dev.sh b/backend/dev.sh index e4e1aaa1..9d0b5fa4 100644 --- a/backend/dev.sh +++ b/backend/dev.sh @@ -1 +1 @@ -uvicorn main:app --port 8080 --host 0.0.0.0 --reload \ No newline at end of file +uvicorn main:app --port 8080 --host 0.0.0.0 --forwarded-allow-ips '*' --reload \ No newline at end of file diff --git a/backend/start.sh b/backend/start.sh index 2d070299..9fb1f576 100644 --- a/backend/start.sh +++ b/backend/start.sh @@ -1 +1 @@ -uvicorn main:app --host 0.0.0.0 --port 8080 \ No newline at end of file +uvicorn main:app --host 0.0.0.0 --port 8080 --forwarded-allow-ips '*' \ No newline at end of file diff --git a/src/lib/apis/auths/index.ts b/src/lib/apis/auths/index.ts index 41c397f9..56a4a7a6 100644 --- a/src/lib/apis/auths/index.ts +++ b/src/lib/apis/auths/index.ts @@ -3,7 +3,7 @@ import { WEBUI_API_BASE_URL } from '$lib/constants'; export const getSessionUser = async (token: string) => { let error = null; - const res = await fetch(`${WEBUI_API_BASE_URL}/auths`, { + const res = await fetch(`${WEBUI_API_BASE_URL}/auths/`, { method: 'GET', headers: { 'Content-Type': 'application/json', diff --git a/src/lib/apis/users/index.ts b/src/lib/apis/users/index.ts index 5939d39d..b1f9e5d9 100644 --- a/src/lib/apis/users/index.ts +++ b/src/lib/apis/users/index.ts @@ -34,7 +34,7 @@ export const updateUserRole = async (token: string, id: string, role: string) => export const getUsers = async (token: string) => { let error = null; - const res = await fetch(`${WEBUI_API_BASE_URL}/users`, { + const res = await fetch(`${WEBUI_API_BASE_URL}/users/`, { method: 'GET', headers: { 'Content-Type': 'application/json', diff --git a/src/lib/components/chat/Messages.svelte b/src/lib/components/chat/Messages.svelte index 8516dc40..df8a72b8 100644 --- a/src/lib/components/chat/Messages.svelte +++ b/src/lib/components/chat/Messages.svelte @@ -119,6 +119,7 @@ langDiv.style.fontSize = '0.75rem'; let button = document.createElement('button'); + button.className = 'copy-code-button'; button.textContent = 'Copy Code'; button.style.background = 'none'; button.style.fontSize = '0.75rem'; @@ -832,7 +833,7 @@ + +
+ +
+
+
+
+
Open new chat
+ +
+
+ Ctrl/⌘ +
+ +
+ Shift +
+ +
+ O +
+
+
+ +
+
Focus chat input
+ +
+
+ Shift +
+ +
+ Esc +
+
+
+ +
+
Copy last code block
+ +
+
+ Ctrl/⌘ +
+ +
+ Shift +
+ +
+ ; +
+
+
+ +
+
Copy last response
+ +
+
+ Ctrl/⌘ +
+ +
+ Shift +
+ +
+ C +
+
+
+
+ +
+
+
Toggle sidebar
+ +
+
+ Ctrl/⌘ +
+ +
+ Shift +
+ +
+ S +
+
+
+ +
+
Delete chat
+ +
+
+ Ctrl/⌘ +
+
+ Shift +
+ +
+ ⌫ +
+
+
+ +
+
Show shortcuts
+ +
+
+ Ctrl/⌘ +
+ +
+ / +
+
+
+
+
+
+ + + + diff --git a/src/lib/components/layout/Sidebar.svelte b/src/lib/components/layout/Sidebar.svelte index 6d7b33bd..18b4f5fb 100644 --- a/src/lib/components/layout/Sidebar.svelte +++ b/src/lib/components/layout/Sidebar.svelte @@ -61,6 +61,7 @@
{:else}
+ +
+ + +
{#if !['user', 'admin'].includes($user.role)}
diff --git a/src/routes/(app)/modelfiles/+page.svelte b/src/routes/(app)/modelfiles/+page.svelte index 41691524..d3c0b098 100644 --- a/src/routes/(app)/modelfiles/+page.svelte +++ b/src/routes/(app)/modelfiles/+page.svelte @@ -15,6 +15,7 @@ } from '$lib/apis/modelfiles'; let localModelfiles = []; + let importFiles; const deleteModelHandler = async (tagName) => { let success = null; @@ -199,78 +200,133 @@
{/each} - {#if localModelfiles.length > 0} -
+
-
-
- {localModelfiles.length} Local Modelfiles Detected -
+
+
+ { + console.log(importFiles); -
- + reader.readAsText(importFiles[0]); + }} + /> - -
+
+ + + +
+
- {/if} + + {#if localModelfiles.length > 0} +
+
+ {localModelfiles.length} Local Modelfiles Detected +
+ +
+ + + +
+
+ {/if} +
Made by OllamaHub Community