mirror of
https://github.com/open-webui/open-webui
synced 2025-01-30 06:18:20 +00:00
refac
This commit is contained in:
parent
5933d7a216
commit
3e012f0219
@ -65,7 +65,7 @@ def upgrade():
|
|||||||
user_id=doc.user_id,
|
user_id=doc.user_id,
|
||||||
description=doc.name,
|
description=doc.name,
|
||||||
meta={
|
meta={
|
||||||
"legacy": True,
|
"document": True,
|
||||||
"tags": json.loads(doc.content or "{}").get("tags", []),
|
"tags": json.loads(doc.content or "{}").get("tags", []),
|
||||||
},
|
},
|
||||||
name=doc.title,
|
name=doc.title,
|
||||||
|
@ -114,7 +114,7 @@
|
|||||||
files = [
|
files = [
|
||||||
...files,
|
...files,
|
||||||
{
|
{
|
||||||
type: e?.detail?.meta?.legacy ? 'file' : 'project',
|
type: e?.detail?.meta?.document ? 'file' : 'project',
|
||||||
...e.detail,
|
...e.detail,
|
||||||
status: 'processed'
|
status: 'processed'
|
||||||
}
|
}
|
||||||
|
@ -111,11 +111,11 @@
|
|||||||
{project.name}
|
{project.name}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{#if project?.meta?.legacy}
|
{#if project?.meta?.document}
|
||||||
<div
|
<div
|
||||||
class="bg-gray-500/20 text-gray-700 dark:text-gray-200 rounded uppercase text-xs px-1"
|
class="bg-gray-500/20 text-gray-700 dark:text-gray-200 rounded uppercase text-xs px-1"
|
||||||
>
|
>
|
||||||
Legacy Document
|
Document
|
||||||
</div>
|
</div>
|
||||||
{:else}
|
{:else}
|
||||||
<div
|
<div
|
||||||
|
@ -113,10 +113,17 @@
|
|||||||
|
|
||||||
<hr class=" border-gray-50 dark:border-gray-850 my-2.5" />
|
<hr class=" border-gray-50 dark:border-gray-850 my-2.5" />
|
||||||
|
|
||||||
<div class="my-3 mb-5 grid md:grid-cols-2 gap-2">
|
<div class="my-3 mb-5 grid lg:grid-cols-2 xl:grid-cols-3 gap-2">
|
||||||
{#each filteredProjects as project}
|
{#each filteredProjects as project}
|
||||||
<button
|
<button
|
||||||
class=" flex space-x-4 cursor-pointer text-left w-full px-4 py-3 border border-gray-50 dark:border-gray-850 hover:bg-gray-50 dark:hover:bg-gray-850 rounded-xl"
|
class=" flex space-x-4 cursor-pointer text-left w-full px-4 py-3 border border-gray-50 dark:border-gray-850 hover:bg-gray-50 dark:hover:bg-gray-850 rounded-xl"
|
||||||
|
on:click={() => {
|
||||||
|
if (project?.meta?.document) {
|
||||||
|
toast.error($i18n.t('Documents cannot be edited, please create a new project.'));
|
||||||
|
} else {
|
||||||
|
goto(`/workspace/projects/${project.id}`);
|
||||||
|
}
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
<div class=" w-full">
|
<div class=" w-full">
|
||||||
<div class="flex items-center justify-between -mt-1">
|
<div class="flex items-center justify-between -mt-1">
|
||||||
@ -139,11 +146,11 @@
|
|||||||
|
|
||||||
<div class="mt-5 flex justify-between">
|
<div class="mt-5 flex justify-between">
|
||||||
<div>
|
<div>
|
||||||
{#if project?.meta?.legacy}
|
{#if project?.meta?.document}
|
||||||
<div
|
<div
|
||||||
class="bg-gray-500/20 text-gray-700 dark:text-gray-200 rounded uppercase text-xs font-bold px-1"
|
class="bg-gray-500/20 text-gray-700 dark:text-gray-200 rounded uppercase text-xs font-bold px-1"
|
||||||
>
|
>
|
||||||
{$i18n.t('Legacy Document')}
|
{$i18n.t('Document')}
|
||||||
</div>
|
</div>
|
||||||
{:else}
|
{:else}
|
||||||
<div
|
<div
|
||||||
|
@ -37,6 +37,10 @@
|
|||||||
><button
|
><button
|
||||||
class="self-center w-fit text-sm p-1.5 dark:text-gray-300 dark:hover:text-white hover:bg-black/5 dark:hover:bg-white/5 rounded-xl"
|
class="self-center w-fit text-sm p-1.5 dark:text-gray-300 dark:hover:text-white hover:bg-black/5 dark:hover:bg-white/5 rounded-xl"
|
||||||
type="button"
|
type="button"
|
||||||
|
on:click={(e) => {
|
||||||
|
e.stopPropagation();
|
||||||
|
show = true;
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
<EllipsisHorizontal className="size-5" />
|
<EllipsisHorizontal className="size-5" />
|
||||||
</button>
|
</button>
|
||||||
|
Loading…
Reference in New Issue
Block a user