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
59f392de
Commit
59f392de
authored
Dec 07, 2023
by
Timothy J. Baek
Browse files
feat: share to ollamahub
parent
92ced39a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
0 deletions
+28
-0
src/routes/(app)/modelfiles/+page.svelte
src/routes/(app)/modelfiles/+page.svelte
+28
-0
No files found.
src/routes/(app)/modelfiles/+page.svelte
View file @
59f392de
...
@@ -42,6 +42,24 @@
...
@@ -42,6 +42,24 @@
await modelfiles.set($modelfiles.filter((modelfile) => modelfile.tagName != tagName));
await modelfiles.set($modelfiles.filter((modelfile) => modelfile.tagName != tagName));
localStorage.setItem('modelfiles', JSON.stringify($modelfiles));
localStorage.setItem('modelfiles', JSON.stringify($modelfiles));
};
};
const shareModelfile = async (modelfile) => {
toast.success('Redirecting you to OllamaHub');
const url = 'https://ollamahub.com';
const tab = await window.open(`${url}/create`, '_blank');
window.addEventListener(
'message',
(event) => {
if (event.origin !== url) return;
if (event.data === 'loaded') {
tab.postMessage(JSON.stringify(modelfile), '*');
}
},
false
);
};
</script>
</script>
<div class="min-h-screen w-full flex justify-center dark:text-white">
<div class="min-h-screen w-full flex justify-center dark:text-white">
...
@@ -108,6 +126,16 @@
...
@@ -108,6 +126,16 @@
Edit</a
Edit</a
>
>
<button
class=" w-fit text-sm px-3 py-2 border dark:border-gray-600 rounded-xl"
type="button"
on:click={() => {
shareModelfile(modelfile);
}}
>
Share</button
>
<button
<button
class=" w-fit text-sm px-3 py-2 border dark:border-gray-600 rounded-xl"
class=" w-fit text-sm px-3 py-2 border dark:border-gray-600 rounded-xl"
type="button"
type="button"
...
...
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