0.4.0 convex及界面修改

This commit is contained in:
liaibo
2026-02-01 08:47:40 +08:00
parent d1f055f51a
commit af92c4b149
636 changed files with 7522 additions and 1815 deletions
@@ -6,6 +6,7 @@ import { Button } from "@/components/ui/button";
import { ScrollArea } from "@/components/ui/scroll-area";
import { Textarea } from "@/components/ui/textarea";
import { clamp } from "@/lib/constants";
import { useAppPreferencesStore } from "@/store/app-preferences";
type AgentMessage = { role: "user" | "assistant"; content: string };
@@ -83,6 +84,7 @@ export function OnlyOfficeAiAgentPanel({
}: {
openFile: { id: string; title: string; fileUrl: string; mimeType?: string | null };
}) {
const flightMode = useAppPreferencesStore((s) => s.flightMode);
const [open, setOpen] = useState(false);
const [page, setPage] = useState<PanelPage>("chat");
@@ -91,7 +93,7 @@ export function OnlyOfficeAiAgentPanel({
const [loading, setLoading] = useState(false);
const [toolLogs, setToolLogs] = useState<ToolLog[]>([]);
const [networkOn, setNetworkOn] = useState(true);
const [networkOn, setNetworkOn] = useState(() => !flightMode);
const [toolAuto, setToolAuto] = useState(true);
const [aiProvider, setAiProvider] = useState<"online" | "local">("online");
const [aiModel, setAiModel] = useState<string>("");
@@ -117,6 +119,12 @@ export function OnlyOfficeAiAgentPanel({
[openFile.fileUrl, openFile.id, openFile.mimeType, openFile.title],
);
useEffect(() => {
if (flightMode) {
setNetworkOn(false);
}
}, [flightMode]);
useEffect(() => {
try {
const stepsRaw = window.localStorage.getItem("onlyoffice_ai_max_steps") || "";
@@ -606,4 +614,3 @@ export function OnlyOfficeAiAgentPanel({
</>
);
}