diff --git a/backend/open_webui/migrations/versions/7826ab40b532_update_file_table.py b/backend/open_webui/migrations/versions/7826ab40b532_update_file_table.py
new file mode 100644
index 000000000..c8afe9d51
--- /dev/null
+++ b/backend/open_webui/migrations/versions/7826ab40b532_update_file_table.py
@@ -0,0 +1,26 @@
+"""Update file table
+
+Revision ID: 7826ab40b532
+Revises: 57c599a3cb57
+Create Date: 2024-12-23 03:00:00.000000
+
+"""
+
+from alembic import op
+import sqlalchemy as sa
+
+revision = "7826ab40b532"
+down_revision = "57c599a3cb57"
+branch_labels = None
+depends_on = None
+
+
+def upgrade():
+ op.add_column(
+ "file",
+ sa.Column("access_control", sa.JSON(), nullable=True),
+ )
+
+
+def downgrade():
+ op.drop_column("file", "access_control")
diff --git a/backend/open_webui/models/files.py b/backend/open_webui/models/files.py
index 4050b0140..91dea5444 100644
--- a/backend/open_webui/models/files.py
+++ b/backend/open_webui/models/files.py
@@ -27,6 +27,8 @@ class File(Base):
data = Column(JSON, nullable=True)
meta = Column(JSON, nullable=True)
+ access_control = Column(JSON, nullable=True)
+
created_at = Column(BigInteger)
updated_at = Column(BigInteger)
@@ -44,6 +46,8 @@ class FileModel(BaseModel):
data: Optional[dict] = None
meta: Optional[dict] = None
+ access_control: Optional[dict] = None
+
created_at: Optional[int] # timestamp in epoch
updated_at: Optional[int] # timestamp in epoch
@@ -90,6 +94,7 @@ class FileForm(BaseModel):
path: str
data: dict = {}
meta: dict = {}
+ access_control: Optional[dict] = None
class FilesTable:
diff --git a/src/lib/components/channel/Channel.svelte b/src/lib/components/channel/Channel.svelte
index da12e3d2d..51c813765 100644
--- a/src/lib/components/channel/Channel.svelte
+++ b/src/lib/components/channel/Channel.svelte
@@ -80,15 +80,17 @@
}
};
- const submitHandler = async ({ content }) => {
+ const submitHandler = async ({ content, data }) => {
if (!content) {
return;
}
- const res = await sendMessage(localStorage.token, id, { content: content }).catch((error) => {
- toast.error(error);
- return null;
- });
+ const res = await sendMessage(localStorage.token, id, { content: content, data: data }).catch(
+ (error) => {
+ toast.error(error);
+ return null;
+ }
+ );
if (res) {
messagesContainerElement.scrollTop = messagesContainerElement.scrollHeight;
@@ -108,6 +110,7 @@
class="h-screen max-h-[100dvh] {$showSidebar
? 'md:max-w-[calc(100%-260px)]'
: ''} w-full max-w-full flex flex-col"
+ id="channel-container"
>