Spaces:
Paused
Paused
Update src/lib/components/workspace/Prompts.svelte
Browse files
src/lib/components/workspace/Prompts.svelte
CHANGED
|
@@ -2,23 +2,18 @@
|
|
| 2 |
import { toast } from 'svelte-sonner';
|
| 3 |
import fileSaver from 'file-saver';
|
| 4 |
const { saveAs } = fileSaver;
|
| 5 |
-
|
| 6 |
import { onMount, getContext } from 'svelte';
|
| 7 |
import { WEBUI_NAME, prompts } from '$lib/stores';
|
| 8 |
import { createNewPrompt, deletePromptByCommand, getPrompts } from '$lib/apis/prompts';
|
| 9 |
import { error } from '@sveltejs/kit';
|
| 10 |
import { goto } from '$app/navigation';
|
| 11 |
-
|
| 12 |
const i18n = getContext('i18n');
|
| 13 |
-
|
| 14 |
let importFiles = '';
|
| 15 |
let query = '';
|
| 16 |
let promptsImportInputElement: HTMLInputElement;
|
| 17 |
const sharePrompt = async (prompt) => {
|
| 18 |
toast.success($i18n.t('Redirecting you to OpenWebUI Community'));
|
| 19 |
-
|
| 20 |
-
const url = 'https://czoffice.top/';
|
| 21 |
-
|
| 22 |
const tab = await window.open(`${url}/prompts/create`, '_blank');
|
| 23 |
window.addEventListener(
|
| 24 |
'message',
|
|
@@ -31,7 +26,6 @@
|
|
| 31 |
false
|
| 32 |
);
|
| 33 |
};
|
| 34 |
-
|
| 35 |
const deletePrompt = async (command) => {
|
| 36 |
await deletePromptByCommand(localStorage.token, command);
|
| 37 |
await prompts.set(await getPrompts(localStorage.token));
|
|
@@ -291,7 +285,24 @@
|
|
| 291 |
</div>
|
| 292 |
</button>
|
| 293 |
|
| 294 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 295 |
<div class=" self-center w-10">
|
| 296 |
<div
|
| 297 |
class="w-full h-10 flex justify-center rounded-full bg-transparent dark:bg-gray-700 border border-dashed border-gray-200"
|
|
@@ -311,4 +322,4 @@
|
|
| 311 |
<div class=" text-sm">{$i18n.t('Discover, download, and explore custom prompts')}</div>
|
| 312 |
</div>
|
| 313 |
</a>
|
| 314 |
-
</div>
|
|
|
|
| 2 |
import { toast } from 'svelte-sonner';
|
| 3 |
import fileSaver from 'file-saver';
|
| 4 |
const { saveAs } = fileSaver;
|
|
|
|
| 5 |
import { onMount, getContext } from 'svelte';
|
| 6 |
import { WEBUI_NAME, prompts } from '$lib/stores';
|
| 7 |
import { createNewPrompt, deletePromptByCommand, getPrompts } from '$lib/apis/prompts';
|
| 8 |
import { error } from '@sveltejs/kit';
|
| 9 |
import { goto } from '$app/navigation';
|
|
|
|
| 10 |
const i18n = getContext('i18n');
|
|
|
|
| 11 |
let importFiles = '';
|
| 12 |
let query = '';
|
| 13 |
let promptsImportInputElement: HTMLInputElement;
|
| 14 |
const sharePrompt = async (prompt) => {
|
| 15 |
toast.success($i18n.t('Redirecting you to OpenWebUI Community'));
|
| 16 |
+
const url = 'https://openwebui.com';
|
|
|
|
|
|
|
| 17 |
const tab = await window.open(`${url}/prompts/create`, '_blank');
|
| 18 |
window.addEventListener(
|
| 19 |
'message',
|
|
|
|
| 26 |
false
|
| 27 |
);
|
| 28 |
};
|
|
|
|
| 29 |
const deletePrompt = async (command) => {
|
| 30 |
await deletePromptByCommand(localStorage.token, command);
|
| 31 |
await prompts.set(await getPrompts(localStorage.token));
|
|
|
|
| 285 |
</div>
|
| 286 |
</button>
|
| 287 |
|
| 288 |
+
<!-- <button
|
| 289 |
+
on:click={() => {
|
| 290 |
+
loadDefaultPrompts();
|
| 291 |
+
}}
|
| 292 |
+
>
|
| 293 |
+
dd
|
| 294 |
+
</button> -->
|
| 295 |
+
</div>
|
| 296 |
+
</div>
|
| 297 |
+
|
| 298 |
+
<div class=" my-16">
|
| 299 |
+
<div class=" text-lg font-semibold mb-3">{$i18n.t('Made by OpenWebUI Community')}</div>
|
| 300 |
+
|
| 301 |
+
<a
|
| 302 |
+
class=" flex space-x-4 cursor-pointer w-full mb-3 px-3 py-2"
|
| 303 |
+
href="https://czoffice.top/"
|
| 304 |
+
target="_blank"
|
| 305 |
+
>
|
| 306 |
<div class=" self-center w-10">
|
| 307 |
<div
|
| 308 |
class="w-full h-10 flex justify-center rounded-full bg-transparent dark:bg-gray-700 border border-dashed border-gray-200"
|
|
|
|
| 322 |
<div class=" text-sm">{$i18n.t('Discover, download, and explore custom prompts')}</div>
|
| 323 |
</div>
|
| 324 |
</a>
|
| 325 |
+
</div>
|