mirror of
https://github.com/open-webui/open-webui
synced 2024-11-06 16:59:42 +00:00
refac
This commit is contained in:
parent
5933d7a216
commit
3e012f0219
@ -65,7 +65,7 @@ def upgrade():
|
||||
user_id=doc.user_id,
|
||||
description=doc.name,
|
||||
meta={
|
||||
"legacy": True,
|
||||
"document": True,
|
||||
"tags": json.loads(doc.content or "{}").get("tags", []),
|
||||
},
|
||||
name=doc.title,
|
||||
|
@ -114,7 +114,7 @@
|
||||
files = [
|
||||
...files,
|
||||
{
|
||||
type: e?.detail?.meta?.legacy ? 'file' : 'project',
|
||||
type: e?.detail?.meta?.document ? 'file' : 'project',
|
||||
...e.detail,
|
||||
status: 'processed'
|
||||
}
|
||||
|
@ -111,11 +111,11 @@
|
||||
{project.name}
|
||||
</div>
|
||||
|
||||
{#if project?.meta?.legacy}
|
||||
{#if project?.meta?.document}
|
||||
<div
|
||||
class="bg-gray-500/20 text-gray-700 dark:text-gray-200 rounded uppercase text-xs px-1"
|
||||
>
|
||||
Legacy Document
|
||||
Document
|
||||
</div>
|
||||
{:else}
|
||||
<div
|
||||
|
@ -113,10 +113,17 @@
|
||||
|
||||
<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}
|
||||
<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"
|
||||
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="flex items-center justify-between -mt-1">
|
||||
@ -139,11 +146,11 @@
|
||||
|
||||
<div class="mt-5 flex justify-between">
|
||||
<div>
|
||||
{#if project?.meta?.legacy}
|
||||
{#if project?.meta?.document}
|
||||
<div
|
||||
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>
|
||||
{:else}
|
||||
<div
|
||||
|
@ -37,6 +37,10 @@
|
||||
><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"
|
||||
type="button"
|
||||
on:click={(e) => {
|
||||
e.stopPropagation();
|
||||
show = true;
|
||||
}}
|
||||
>
|
||||
<EllipsisHorizontal className="size-5" />
|
||||
</button>
|
||||
|
Loading…
Reference in New Issue
Block a user