Browse Source

文件分析区对话功能修改,文件上传取消新建文件夹

master
ma-zhongxu 10 months ago
parent
commit
976b377185
  1. 28
      frontend/src/components/Modals/ManageWorkspace/Documents/Directory/index.jsx
  2. 6
      frontend/src/components/Sidebar/ActiveWorkspaces/ThreadContainer/ThreadItem/index.jsx
  3. 8
      frontend/src/components/Sidebar/ActiveWorkspaces/ThreadContainer/index.jsx
  4. 28
      frontend/src/pages/PolicyLibrary/index.jsx
  5. 2
      server/models/workspaceThread.js

28
frontend/src/components/Modals/ManageWorkspace/Documents/Directory/index.jsx

@ -52,7 +52,7 @@ function Directory({
event.stopPropagation();
if (
!window.confirm(
"Are you sure you want to delete these files and folders?\nThis will remove the files from the system and remove them from any existing workspaces automatically.\nThis action is not reversible."
"确定要删除这些文件和文件夹吗?此操作将永久删除它们及在任何现有工作空间中的副本,且无法撤销。"
)
) {
return false;
@ -209,19 +209,19 @@ function Directory({
weight="bold"
/>
</div>
<button
className="border-none flex items-center gap-x-2 cursor-pointer px-[14px] py-[7px] -mr-[14px] rounded-lg hover:bg-theme-sidebar-subitem-hover z-20 relative"
onClick={openFolderModal}
>
<Plus
size={18}
weight="bold"
className="text-theme-text-primary light:text-[#0ba5ec]"
/>
<div className="text-theme-text-primary light:text-[#0ba5ec] text-xs font-bold leading-[18px]">
新文件夹
</div>
</button>
{/*<button*/}
{/* className="border-none flex items-center gap-x-2 cursor-pointer px-[14px] py-[7px] -mr-[14px] rounded-lg hover:bg-theme-sidebar-subitem-hover z-20 relative"*/}
{/* onClick={openFolderModal}*/}
{/*>*/}
{/* <Plus*/}
{/* size={18}*/}
{/* weight="bold"*/}
{/* className="text-theme-text-primary light:text-[#0ba5ec]"*/}
{/* />*/}
{/* <div className="text-theme-text-primary light:text-[#0ba5ec] text-xs font-bold leading-[18px]">*/}
{/* 新文件夹*/}
{/* </div>*/}
{/*</button>*/}
</div>
<div className="relative w-[560px] h-[310px] bg-[#ECEFF6] rounded-2xl overflow-hidden border ">

6
frontend/src/components/Sidebar/ActiveWorkspaces/ThreadContainer/ThreadItem/index.jsx

@ -196,7 +196,7 @@ function OptionsMenu({
const renameThread = async () => {
const name = window
.prompt("您想将此线程重命名为什么?")
.prompt("您想将此对话重命名为什么?")
?.trim();
if (!name || name.length === 0) {
close();
@ -223,7 +223,7 @@ function OptionsMenu({
const handleDelete = async () => {
if (
!window.confirm(
"您确定要删除此线程吗?所有的聊天记录都将被删除。这是无法挽回的。"
"您确定要删除此对话吗?所有的聊天记录都将被删除。这是无法挽回的。"
)
)
return;
@ -262,7 +262,7 @@ function OptionsMenu({
className="w-full rounded-md flex items-center p-2 gap-x-2 hover:bg-red-500/20 text-slate-300 light:text-theme-text-primary hover:text-red-100"
>
<Trash size={18} />
<p className="text-sm">删除线程</p>
<p className="text-sm">删除对话</p>
</button>
</div>
);

8
frontend/src/components/Sidebar/ActiveWorkspaces/ThreadContainer/index.jsx

@ -129,7 +129,7 @@ export default function ThreadContainer({ workspace }) {
idx={0}
activeIdx={activeThreadIdx}
isActive={activeThreadIdx === 0}
thread={{ slug: null, name: "default" }}
thread={{ slug: null, name: "默认对话" }}
hasNext={threads.length > 0}
/>
{threads.map((thread, i) => (
@ -151,7 +151,7 @@ export default function ThreadContainer({ workspace }) {
threads={threads}
onDelete={handleDeleteAll}
/>
<NewThreadButton workspace={workspace} />
{/*<NewThreadButton workspace={workspace} />*/}
</div>
);
}
@ -195,11 +195,11 @@ function NewThreadButton({ workspace }) {
{loading ? (
<p className="text-left text-white light:text-theme-text-primary text-sm">
启动线程...
启动对话...
</p>
) : (
<p className="text-left text-white light:text-theme-text-primary text-sm">
线程
对话
</p>
)}
</div>

28
frontend/src/pages/PolicyLibrary/index.jsx

@ -62,7 +62,7 @@ function Directory({
event.stopPropagation();
if (
!window.confirm(
"Are you sure you want to delete these files and folders?\nThis will remove the files from the system and remove them from any existing workspaces automatically.\nThis action is not reversible."
"确定要删除这些文件和文件夹吗?此操作将永久删除它们及在任何现有工作空间中的副本,且无法撤销。"
)
) {
return false;
@ -231,19 +231,19 @@ function Directory({
weight="bold"
/>
</div>
<button
className="border-none flex items-center gap-x-2 cursor-pointer px-[14px] py-[7px] -mr-[14px] rounded-lg hover:bg-theme-sidebar-subitem-hover z-20 relative"
onClick={openFolderModal}
>
<Plus
size={18}
weight="bold"
className="text-theme-text-primary light:text-[#0ba5ec]"
/>
<div className="text-theme-text-primary light:text-[#0ba5ec] text-xs font-bold leading-[18px]">
新文件夹
</div>
</button>
{/*<button*/}
{/* className="border-none flex items-center gap-x-2 cursor-pointer px-[14px] py-[7px] -mr-[14px] rounded-lg hover:bg-theme-sidebar-subitem-hover z-20 relative"*/}
{/* onClick={openFolderModal}*/}
{/*>*/}
{/* <Plus*/}
{/* size={18}*/}
{/* weight="bold"*/}
{/* className="text-theme-text-primary light:text-[#0ba5ec]"*/}
{/* />*/}
{/* <div className="text-theme-text-primary light:text-[#0ba5ec] text-xs font-bold leading-[18px]">*/}
{/* 新文件夹*/}
{/* </div>*/}
{/*</button>*/}
</div>
<div className="relative w-[100%] h-[500px] bg-[#ECEFF6] rounded-2xl overflow-hidden border ">

2
server/models/workspaceThread.js

@ -3,7 +3,7 @@ const slugifyModule = require("slugify");
const { v4: uuidv4 } = require("uuid");
const WorkspaceThread = {
defaultName: "Thread",
defaultName: "对话",
writable: ["name"],
/**

Loading…
Cancel
Save