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
7e4a13f8
"git@developer.sourcefind.cn:chenpangpang/open-webui.git" did not exist on "06cbe337de008412adf771770c2e278ce2fc3d21"
Unverified
Commit
7e4a13f8
authored
Jan 03, 2024
by
Kainoa Kanter
Committed by
GitHub
Jan 03, 2024
Browse files
Merge branch 'main' into bun
parents
25cabc27
92528341
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
4 deletions
+39
-4
src/routes/(app)/prompts/+page.svelte
src/routes/(app)/prompts/+page.svelte
+39
-4
No files found.
src/routes/(app)/prompts/+page.svelte
View file @
7e4a13f8
...
@@ -5,8 +5,10 @@
...
@@ -5,8 +5,10 @@
import { onMount } from 'svelte';
import { onMount } from 'svelte';
import { prompts } from '$lib/stores';
import { prompts } from '$lib/stores';
import { deletePromptByCommand, getPrompts } from '$lib/apis/prompts';
import { createNewPrompt, deletePromptByCommand, getPrompts } from '$lib/apis/prompts';
import { error } from '@sveltejs/kit';
let importFiles = '';
let query = '';
let query = '';
const sharePrompt = async (prompt) => {
const sharePrompt = async (prompt) => {
...
@@ -174,10 +176,43 @@
...
@@ -174,10 +176,43 @@
<div class=" flex justify-between w-full mb-3">
<div class=" flex justify-between w-full mb-3">
<div class="flex space-x-2">
<div class="flex space-x-2">
<!-- <button
<input
id="prompts-import-input"
bind:files={importFiles}
type="file"
accept=".json"
hidden
on:change={() => {
console.log(importFiles);
const reader = new FileReader();
reader.onload = async (event) => {
const savedPrompts = JSON.parse(event.target.result);
console.log(savedPrompts);
for (const prompt of savedPrompts) {
await createNewPrompt(
localStorage.token,
prompt.command.charAt(0) === '/' ? prompt.command.slice(1) : prompt.command,
prompt.title,
prompt.content
).catch((error) => {
toast.error(error);
return null;
});
}
await prompts.set(await getPrompts(localStorage.token));
};
reader.readAsText(importFiles[0]);
}}
/>
<button
class="self-center w-fit text-sm px-3 py-1 border dark:border-gray-600 rounded-xl flex"
class="self-center w-fit text-sm px-3 py-1 border dark:border-gray-600 rounded-xl flex"
on:click={async () => {
on:click={async () => {
//
document.getElementById('
modelfile
s-import-input')?.click();
document.getElementById('
prompt
s-import-input')?.click();
}}
}}
>
>
<div class=" self-center mr-2 font-medium">Import Prompts</div>
<div class=" self-center mr-2 font-medium">Import Prompts</div>
...
@@ -196,7 +231,7 @@
...
@@ -196,7 +231,7 @@
/>
/>
</svg>
</svg>
</div>
</div>
</button>
-->
</button>
<button
<button
class="self-center w-fit text-sm px-3 py-1 border dark:border-gray-600 rounded-xl flex"
class="self-center w-fit text-sm px-3 py-1 border dark:border-gray-600 rounded-xl flex"
...
...
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