Skip to content

Commit 5759eb1

Browse files
committed
🚸 增加一行菜单栏
1 parent 527f906 commit 5759eb1

File tree

2 files changed

+27
-2
lines changed

2 files changed

+27
-2
lines changed

app/src/core/service/dataFileService/autoSaveBackupEngine/autoBackupEngine.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ export class AutoBackupEngine {
3838
const now = performance.now();
3939
if (now - this.lastAutoBackupTime > this.autoBackupInterval) {
4040
if (Stage.path.isDraft()) {
41-
const backupPath = `${this.autoBackupDraftPath}${PathString.getSep()}${PathString.getTime()}.json`;
42-
StageSaveManager.backupHandle(backupPath, StageDumper.dump());
41+
const backupDraftPath = `${this.autoBackupDraftPath}${PathString.getSep()}${PathString.getTime()}.json`;
42+
StageSaveManager.backupHandle(backupDraftPath, StageDumper.dump());
4343
} else {
4444
StageSaveManager.backupHandleWithoutCurrentPath(StageDumper.dump(), false);
4545
}

app/src/pages/_app_menu.tsx

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { open as openFileDialog, save as saveFileDialog } from "@tauri-apps/plug
22
import { useAtom } from "jotai";
33
import {
44
AppWindow,
5+
Axe,
56
BadgeInfo,
67
Database,
78
Dock,
@@ -24,6 +25,7 @@ import {
2425
SquareDashedKanbanIcon,
2526
SquareDashedMousePointer,
2627
TestTube2,
28+
Undo,
2729
View,
2830
} from "lucide-react";
2931
import React, { useEffect } from "react";
@@ -48,6 +50,7 @@ import { GraphMethods } from "../core/stage/stageManager/basicMethods/GraphMetho
4850
import { TextNode } from "../core/stage/stageObject/entity/TextNode";
4951
import { PathString } from "../utils/pathString";
5052
import { HelpService } from "../core/service/helpService/helpService";
53+
import { StageHistoryManager } from "../core/stage/stageManager/StageHistoryManager";
5154

5255
export default function AppMenu({ className = "", open = false }: { className?: string; open: boolean }) {
5356
const navigate = useNavigate();
@@ -458,6 +461,28 @@ export default function AppMenu({ className = "", open = false }: { className?:
458461
{t("view.items.resetScale")}
459462
</Col>
460463
</Row>
464+
<Row icon={<Axe />} title={"操作"}>
465+
<Col
466+
icon={<Undo />}
467+
onClick={() => {
468+
StageHistoryManager.undo();
469+
}}
470+
>
471+
撤销
472+
</Col>
473+
{/* <Col
474+
icon={<Undo />}
475+
onClick={() => {
476+
const userInput = window.prompt("请输入搜索内容:");
477+
if (!userInput) {
478+
return;
479+
}
480+
Stage.contentSearchEngine.startSearch(userInput);
481+
}}
482+
>
483+
查找
484+
</Col> */}
485+
</Row>
461486
<Row icon={<MoreHorizontal />} title={t("more.title")}>
462487
<Col icon={<SettingsIcon />} onClick={() => navigate("/settings/visual")}>
463488
{t("more.items.settings")}

0 commit comments

Comments
 (0)