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
6c2cab25
Commit
6c2cab25
authored
Dec 15, 2023
by
Timothy J. Baek
Browse files
feat: share chat modelfiles info
parent
832770e7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
3 deletions
+10
-3
src/lib/components/layout/Navbar.svelte
src/lib/components/layout/Navbar.svelte
+10
-3
No files found.
src/lib/components/layout/Navbar.svelte
View file @
6c2cab25
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
import { v4 as uuidv4 } from 'uuid';
import { v4 as uuidv4 } from 'uuid';
import { goto } from '$app/navigation';
import { goto } from '$app/navigation';
import { chatId, db } from '$lib/stores';
import { chatId, db
, modelfiles
} from '$lib/stores';
import toast from 'svelte-french-toast';
import toast from 'svelte-french-toast';
export let title: string = 'Ollama Web UI';
export let title: string = 'Ollama Web UI';
...
@@ -13,7 +13,8 @@
...
@@ -13,7 +13,8 @@
console.log('share', chat);
console.log('share', chat);
toast.success('Redirecting you to OllamaHub');
toast.success('Redirecting you to OllamaHub');
const url = 'https://ollamahub.com';
// const url = 'https://ollamahub.com';
const url = 'http://localhost:5173';
const tab = await window.open(`${url}/chats/upload`, '_blank');
const tab = await window.open(`${url}/chats/upload`, '_blank');
window.addEventListener(
window.addEventListener(
...
@@ -21,7 +22,13 @@
...
@@ -21,7 +22,13 @@
(event) => {
(event) => {
if (event.origin !== url) return;
if (event.origin !== url) return;
if (event.data === 'loaded') {
if (event.data === 'loaded') {
tab.postMessage(JSON.stringify(chat), '*');
tab.postMessage(
JSON.stringify({
chat: chat,
modelfiles: $modelfiles.filter((modelfile) => chat.models.includes(modelfile.tagName))
}),
'*'
);
}
}
},
},
false
false
...
...
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