{$i18n.t('Prompts')} / {$WEBUI_NAME} {#if loaded} { deleteHandler(deletePrompt); }} >
{$i18n.t('This will delete')} {deletePrompt.command}.
{#key createPrompt} { closeCreateModal(); }} /> {/key} { console.log(importFiles); if (!importFiles || importFiles.length === 0) return; const reader = new FileReader(); reader.onload = async (event) => { const savedPrompts = JSON.parse(event.target.result); console.log(savedPrompts); try { for (const prompt of savedPrompts) { await createNewPrompt(localStorage.token, { command: prompt.command, name: prompt.name, content: prompt.content }).catch((error) => { toast.error(typeof error === 'string' ? error : JSON.stringify(error)); return null; }); } page = 1; await getPromptList(); } finally { importFiles = null; promptsImportInputElement.value = ''; } }; reader.readAsText(importFiles[0]); }} />
{#if query}
{/if}
{ if (e.deltaY !== 0) { e.preventDefault(); e.currentTarget.scrollLeft += e.deltaY; } }} >
{ localStorage.workspaceViewOption = value; page = 1; await tick(); }} /> {#if (tags ?? []).length > 0} ({ value: tag, label: tag }))} onChange={async () => { page = 1; await tick(); }} /> {/if}
{#if prompts === null || loading}
{:else if (prompts ?? []).length !== 0}
{#each prompts as prompt (prompt.id)}
{ if (shouldIgnoreRowClick(e.target)) return; openPrompt(prompt); }} on:keydown={(e) => { if (e.currentTarget !== e.target) return; if (e.key === 'Enter' || e.key === ' ') { e.preventDefault(); openPrompt(prompt); } }} >
{prompt.name}
/{prompt.command}
{dayjs((prompt.updated_at ?? prompt.created_at) * 1000).fromNow()}
{#if !prompt.write_access} {/if}
{#if prompt.content}
{prompt.content}
{/if}
{#if shiftKey} {:else}
{ goto(`/workspace/prompts/${prompt.id}`); }} shareHandler={() => { shareHandler(prompt); }} cloneHandler={() => { cloneHandler(prompt); }} exportHandler={() => { exportHandler(prompt); }} deleteHandler={async () => { deletePrompt = prompt; showDeleteConfirm = true; }} onClose={() => { openPromptMenuId = null; }} >
{/if}
{/each}
{#if total > 30}
{/if} {:else}
{$i18n.t('No prompts found')}
{$i18n.t('Try adjusting your search or filter to find what you are looking for.')}
{/if}
{#if $config?.features.enable_community_sharing} {/if} {:else}
{/if}