mirror of
https://github.com/open-webui/open-webui
synced 2025-03-27 07:50:37 +00:00
28 lines
640 B
Svelte
28 lines
640 B
Svelte
<script lang="ts">
|
|
import { goto } from '$app/navigation';
|
|
import { onMount } from 'svelte';
|
|
|
|
onMount(async () => {
|
|
window.addEventListener('message', async (event) => {
|
|
if (
|
|
![
|
|
'https://ollamahub.com',
|
|
'https://www.ollamahub.com',
|
|
'https://openwebui.com',
|
|
'https://www.openwebui.com',
|
|
'http://localhost:5173'
|
|
].includes(event.origin)
|
|
)
|
|
return;
|
|
const modelfile = JSON.parse(event.data);
|
|
sessionStorage.modelfile = JSON.stringify(modelfile);
|
|
|
|
goto('/workspace/modelfiles/create');
|
|
});
|
|
|
|
if (window.opener ?? false) {
|
|
window.opener.postMessage('loaded', '*');
|
|
}
|
|
});
|
|
</script>
|