diff --git a/src/routes/(app)/modelfiles/+page.svelte b/src/routes/(app)/modelfiles/+page.svelte index 5887eabb..ff7519da 100644 --- a/src/routes/(app)/modelfiles/+page.svelte +++ b/src/routes/(app)/modelfiles/+page.svelte @@ -42,6 +42,24 @@ await modelfiles.set($modelfiles.filter((modelfile) => modelfile.tagName != tagName)); 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 + ); + };
@@ -99,24 +117,74 @@
-
+
- Edit + + + + + + + + + +
{/each}