From 59f392de39b8cb3dcbf2972259fce1cf0f7e9bb4 Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Thu, 7 Dec 2023 14:37:25 -0800 Subject: [PATCH 1/3] feat: share to ollamahub --- src/routes/(app)/modelfiles/+page.svelte | 28 ++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/src/routes/(app)/modelfiles/+page.svelte b/src/routes/(app)/modelfiles/+page.svelte index 5887eabb..843e8d1d 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 + ); + };
@@ -108,6 +126,16 @@ Edit + +
-
+
- Edit + + + + + + + + + + + + +
{/each} From a4358c2bbec4231cb85ccea7ca5debb19fa7c717 Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Fri, 8 Dec 2023 16:51:52 -0800 Subject: [PATCH 3/3] feat: icon updated --- src/routes/(app)/modelfiles/+page.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/routes/(app)/modelfiles/+page.svelte b/src/routes/(app)/modelfiles/+page.svelte index c352e76d..ff7519da 100644 --- a/src/routes/(app)/modelfiles/+page.svelte +++ b/src/routes/(app)/modelfiles/+page.svelte @@ -158,7 +158,7 @@