diff --git a/frontend/bindings/github.com/wailsapp/wails/v3/pkg/application/models.ts b/frontend/bindings/github.com/wailsapp/wails/v3/pkg/application/models.ts index 8f62500..518ea0d 100644 --- a/frontend/bindings/github.com/wailsapp/wails/v3/pkg/application/models.ts +++ b/frontend/bindings/github.com/wailsapp/wails/v3/pkg/application/models.ts @@ -62,6 +62,23 @@ export class Menu { } } +export class WebviewWindow { + + /** Creates a new WebviewWindow instance. */ + constructor($$source: Partial = {}) { + + Object.assign(this, $$source); + } + + /** + * Creates a new WebviewWindow instance from a string or object. + */ + static createFrom($$source: any = {}): WebviewWindow { + let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source; + return new WebviewWindow($$parsedSource as Partial); + } +} + // Private type creation functions const $$createType0 = Menu.createFrom; const $$createType1 = $Create.Nullable($$createType0); diff --git a/frontend/bindings/time/models.ts b/frontend/bindings/time/models.ts index 6646738..aca1ad1 100644 --- a/frontend/bindings/time/models.ts +++ b/frontend/bindings/time/models.ts @@ -5,6 +5,42 @@ // @ts-ignore: Unused imports import {Create as $Create} from "@wailsio/runtime"; +/** + * A Duration represents the elapsed time between two instants + * as an int64 nanosecond count. The representation limits the + * largest representable duration to approximately 290 years. + */ +export enum Duration { + /** + * The Go zero value for the underlying type of the enum. + */ + $zero = 0, + + minDuration = -9223372036854775808, + maxDuration = 9223372036854775807, + + /** + * Common durations. There is no definition for units of Day or larger + * to avoid confusion across daylight savings time zone transitions. + * + * To count the number of units in a [Duration], divide: + * + * second := time.Second + * fmt.Print(int64(second/time.Millisecond)) // prints 1000 + * + * To convert an integer number of units to a Duration, multiply: + * + * seconds := 10 + * fmt.Print(time.Duration(seconds)*time.Second) // prints 10s + */ + Nanosecond = 1, + Microsecond = 1000, + Millisecond = 1000000, + Second = 1000000000, + Minute = 60000000000, + Hour = 3600000000000, +}; + /** * A Time represents an instant in time with nanosecond precision. * diff --git a/frontend/bindings/voidraft/internal/models/models.ts b/frontend/bindings/voidraft/internal/models/models.ts index 99fcb07..7e792ea 100644 --- a/frontend/bindings/voidraft/internal/models/models.ts +++ b/frontend/bindings/voidraft/internal/models/models.ts @@ -348,20 +348,9 @@ export class GeneralConfig { "alwaysOnTop": boolean; /** - * 默认数据存储路径 + * 数据存储路径 */ - "defaultDataPath": string; - - /** - * 数据存储路径配置 - * 是否使用自定义数据路径 - */ - "useCustomDataPath": boolean; - - /** - * 自定义数据存储路径 - */ - "customDataPath": string; + "dataPath": string; /** * 全局热键设置 @@ -379,14 +368,8 @@ export class GeneralConfig { if (!("alwaysOnTop" in $$source)) { this["alwaysOnTop"] = false; } - if (!("defaultDataPath" in $$source)) { - this["defaultDataPath"] = ""; - } - if (!("useCustomDataPath" in $$source)) { - this["useCustomDataPath"] = false; - } - if (!("customDataPath" in $$source)) { - this["customDataPath"] = ""; + if (!("dataPath" in $$source)) { + this["dataPath"] = ""; } if (!("enableGlobalHotkey" in $$source)) { this["enableGlobalHotkey"] = false; @@ -402,10 +385,10 @@ export class GeneralConfig { * Creates a new GeneralConfig instance from a string or object. */ static createFrom($$source: any = {}): GeneralConfig { - const $$createField5_0 = $$createType7; + const $$createField3_0 = $$createType7; let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source; if ("globalHotkey" in $$parsedSource) { - $$parsedSource["globalHotkey"] = $$createField5_0($$parsedSource["globalHotkey"]); + $$parsedSource["globalHotkey"] = $$createField3_0($$parsedSource["globalHotkey"]); } return new GeneralConfig($$parsedSource as Partial); } diff --git a/frontend/bindings/voidraft/internal/services/configservice.ts b/frontend/bindings/voidraft/internal/services/configservice.ts index dec2c99..24ab801 100644 --- a/frontend/bindings/voidraft/internal/services/configservice.ts +++ b/frontend/bindings/voidraft/internal/services/configservice.ts @@ -50,6 +50,14 @@ export function Set(key: string, value: any): Promise & { cancel(): void } return $resultPromise; } +/** + * SetDataPathChangeCallback 设置数据路径配置变更回调 + */ +export function SetDataPathChangeCallback(callback: any): Promise & { cancel(): void } { + let $resultPromise = $Call.ByID(393017412, callback) as any; + return $resultPromise; +} + /** * SetHotkeyChangeCallback 设置热键配置变更回调 */ diff --git a/frontend/bindings/voidraft/internal/services/dialogservice.ts b/frontend/bindings/voidraft/internal/services/dialogservice.ts index d6868bd..3456d55 100644 --- a/frontend/bindings/voidraft/internal/services/dialogservice.ts +++ b/frontend/bindings/voidraft/internal/services/dialogservice.ts @@ -10,6 +10,10 @@ // @ts-ignore: Unused imports import {Call as $Call, Create as $Create} from "@wailsio/runtime"; +// eslint-disable-next-line @typescript-eslint/ban-ts-comment +// @ts-ignore: Unused imports +import * as application$0 from "../../../github.com/wailsapp/wails/v3/pkg/application/models.js"; + /** * SelectDirectory 打开目录选择对话框 */ @@ -17,3 +21,11 @@ export function SelectDirectory(): Promise & { cancel(): void } { let $resultPromise = $Call.ByID(2249533621) as any; return $resultPromise; } + +/** + * SetWindow 设置绑定的窗口 + */ +export function SetWindow(window: application$0.WebviewWindow | null): Promise & { cancel(): void } { + let $resultPromise = $Call.ByID(968177170, window) as any; + return $resultPromise; +} diff --git a/frontend/bindings/voidraft/internal/services/documentservice.ts b/frontend/bindings/voidraft/internal/services/documentservice.ts index ee530c0..55a6cac 100644 --- a/frontend/bindings/voidraft/internal/services/documentservice.ts +++ b/frontend/bindings/voidraft/internal/services/documentservice.ts @@ -15,7 +15,7 @@ import {Call as $Call, Create as $Create} from "@wailsio/runtime"; import * as models$0 from "../models/models.js"; /** - * ForceSave 强制保存当前文档 + * ForceSave 强制保存 */ export function ForceSave(): Promise & { cancel(): void } { let $resultPromise = $Call.ByID(2767091023) as any; @@ -23,7 +23,7 @@ export function ForceSave(): Promise & { cancel(): void } { } /** - * GetActiveDocument 获取当前活动文档 + * GetActiveDocument 获取活动文档 */ export function GetActiveDocument(): Promise & { cancel(): void } { let $resultPromise = $Call.ByID(1785823398) as any; @@ -35,15 +35,7 @@ export function GetActiveDocument(): Promise & { cance } /** - * GetActiveDocumentContent 获取当前活动文档内容 - */ -export function GetActiveDocumentContent(): Promise & { cancel(): void } { - let $resultPromise = $Call.ByID(922617063) as any; - return $resultPromise; -} - -/** - * Initialize 初始化文档服务 + * Initialize 初始化服务 */ export function Initialize(): Promise & { cancel(): void } { let $resultPromise = $Call.ByID(3418008221) as any; @@ -51,15 +43,23 @@ export function Initialize(): Promise & { cancel(): void } { } /** - * SaveDocumentSync 同步保存文档内容 + * OnDataPathChanged 处理数据路径变更 */ -export function SaveDocumentSync(content: string): Promise & { cancel(): void } { - let $resultPromise = $Call.ByID(3770207288, content) as any; +export function OnDataPathChanged(oldPath: string, newPath: string): Promise & { cancel(): void } { + let $resultPromise = $Call.ByID(269349439, oldPath, newPath) as any; return $resultPromise; } /** - * ServiceShutdown 服务关闭 + * ReloadDocument 重新加载文档 + */ +export function ReloadDocument(): Promise & { cancel(): void } { + let $resultPromise = $Call.ByID(3093415283) as any; + return $resultPromise; +} + +/** + * ServiceShutdown 关闭服务 */ export function ServiceShutdown(): Promise & { cancel(): void } { let $resultPromise = $Call.ByID(638578044) as any; @@ -67,7 +67,7 @@ export function ServiceShutdown(): Promise & { cancel(): void } { } /** - * UpdateActiveDocumentContent 更新当前活动文档内容 + * UpdateActiveDocumentContent 更新文档内容 */ export function UpdateActiveDocumentContent(content: string): Promise & { cancel(): void } { let $resultPromise = $Call.ByID(1486276638, content) as any; diff --git a/frontend/bindings/voidraft/internal/services/index.ts b/frontend/bindings/voidraft/internal/services/index.ts index 67cf0c7..b7eb8df 100644 --- a/frontend/bindings/voidraft/internal/services/index.ts +++ b/frontend/bindings/voidraft/internal/services/index.ts @@ -5,12 +5,14 @@ import * as ConfigService from "./configservice.js"; import * as DialogService from "./dialogservice.js"; import * as DocumentService from "./documentservice.js"; import * as HotkeyService from "./hotkeyservice.js"; +import * as MigrationService from "./migrationservice.js"; import * as SystemService from "./systemservice.js"; export { ConfigService, DialogService, DocumentService, HotkeyService, + MigrationService, SystemService }; diff --git a/frontend/bindings/voidraft/internal/services/migrationservice.ts b/frontend/bindings/voidraft/internal/services/migrationservice.ts new file mode 100644 index 0000000..b29a615 --- /dev/null +++ b/frontend/bindings/voidraft/internal/services/migrationservice.ts @@ -0,0 +1,62 @@ +// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL +// This file is automatically generated. DO NOT EDIT + +/** + * MigrationService 迁移服务 + * @module + */ + +// eslint-disable-next-line @typescript-eslint/ban-ts-comment +// @ts-ignore: Unused imports +import {Call as $Call, Create as $Create} from "@wailsio/runtime"; + +// eslint-disable-next-line @typescript-eslint/ban-ts-comment +// @ts-ignore: Unused imports +import * as $models from "./models.js"; + +/** + * CancelMigration 取消迁移 + */ +export function CancelMigration(): Promise & { cancel(): void } { + let $resultPromise = $Call.ByID(1813274502) as any; + return $resultPromise; +} + +/** + * GetProgress 获取当前进度 + */ +export function GetProgress(): Promise<$models.MigrationProgress> & { cancel(): void } { + let $resultPromise = $Call.ByID(3413264131) as any; + let $typingPromise = $resultPromise.then(($result: any) => { + return $$createType0($result); + }) as any; + $typingPromise.cancel = $resultPromise.cancel.bind($resultPromise); + return $typingPromise; +} + +/** + * MigrateDirectory 迁移目录 + */ +export function MigrateDirectory(srcPath: string, dstPath: string): Promise & { cancel(): void } { + let $resultPromise = $Call.ByID(311970580, srcPath, dstPath) as any; + return $resultPromise; +} + +/** + * ServiceShutdown 服务关闭 + */ +export function ServiceShutdown(): Promise & { cancel(): void } { + let $resultPromise = $Call.ByID(3472042605) as any; + return $resultPromise; +} + +/** + * SetProgressCallback 设置进度回调 + */ +export function SetProgressCallback(callback: $models.MigrationProgressCallback): Promise & { cancel(): void } { + let $resultPromise = $Call.ByID(75752256, callback) as any; + return $resultPromise; +} + +// Private type creation functions +const $$createType0 = $models.MigrationProgress.createFrom; diff --git a/frontend/bindings/voidraft/internal/services/models.ts b/frontend/bindings/voidraft/internal/services/models.ts index 89c3190..568167c 100644 --- a/frontend/bindings/voidraft/internal/services/models.ts +++ b/frontend/bindings/voidraft/internal/services/models.ts @@ -5,6 +5,10 @@ // @ts-ignore: Unused imports import {Create as $Create} from "@wailsio/runtime"; +// eslint-disable-next-line @typescript-eslint/ban-ts-comment +// @ts-ignore: Unused imports +import * as time$0 from "../../../time/models.js"; + /** * MemoryStats 内存统计信息 */ @@ -71,3 +75,152 @@ export class MemoryStats { return new MemoryStats($$parsedSource as Partial); } } + +/** + * MigrationProgress 迁移进度信息 + */ +export class MigrationProgress { + /** + * 迁移状态 + */ + "status": MigrationStatus; + + /** + * 当前处理的文件 + */ + "currentFile": string; + + /** + * 已处理文件数 + */ + "processedFiles": number; + + /** + * 总文件数 + */ + "totalFiles": number; + + /** + * 已处理字节数 + */ + "processedBytes": number; + + /** + * 总字节数 + */ + "totalBytes": number; + + /** + * 进度百分比 (0-100) + */ + "progress": number; + + /** + * 状态消息 + */ + "message": string; + + /** + * 错误信息 + */ + "error"?: string; + + /** + * 开始时间 + */ + "startTime": time$0.Time; + + /** + * 估计剩余时间 + */ + "estimatedTime": time$0.Duration; + + /** Creates a new MigrationProgress instance. */ + constructor($$source: Partial = {}) { + if (!("status" in $$source)) { + this["status"] = ("" as MigrationStatus); + } + if (!("currentFile" in $$source)) { + this["currentFile"] = ""; + } + if (!("processedFiles" in $$source)) { + this["processedFiles"] = 0; + } + if (!("totalFiles" in $$source)) { + this["totalFiles"] = 0; + } + if (!("processedBytes" in $$source)) { + this["processedBytes"] = 0; + } + if (!("totalBytes" in $$source)) { + this["totalBytes"] = 0; + } + if (!("progress" in $$source)) { + this["progress"] = 0; + } + if (!("message" in $$source)) { + this["message"] = ""; + } + if (!("startTime" in $$source)) { + this["startTime"] = null; + } + if (!("estimatedTime" in $$source)) { + this["estimatedTime"] = (0 as time$0.Duration); + } + + Object.assign(this, $$source); + } + + /** + * Creates a new MigrationProgress instance from a string or object. + */ + static createFrom($$source: any = {}): MigrationProgress { + let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source; + return new MigrationProgress($$parsedSource as Partial); + } +} + +/** + * MigrationProgressCallback 进度回调函数类型 + */ +export type MigrationProgressCallback = any; + +/** + * MigrationStatus 迁移状态 + */ +export enum MigrationStatus { + /** + * The Go zero value for the underlying type of the enum. + */ + $zero = "", + + /** + * 空闲状态 + */ + MigrationStatusIdle = "idle", + + /** + * 准备中 + */ + MigrationStatusPreparing = "preparing", + + /** + * 迁移中 + */ + MigrationStatusMigrating = "migrating", + + /** + * 完成 + */ + MigrationStatusCompleted = "completed", + + /** + * 失败 + */ + MigrationStatusFailed = "failed", + + /** + * 取消 + */ + MigrationStatusCancelled = "cancelled", +}; diff --git a/frontend/components.d.ts b/frontend/components.d.ts index f8c07ae..bb1da7d 100644 --- a/frontend/components.d.ts +++ b/frontend/components.d.ts @@ -9,6 +9,7 @@ export {} declare module 'vue' { export interface GlobalComponents { MemoryMonitor: typeof import('./src/components/monitor/MemoryMonitor.vue')['default'] + MigrationProgress: typeof import('./src/components/migration/MigrationProgress.vue')['default'] RouterLink: typeof import('vue-router')['RouterLink'] RouterView: typeof import('vue-router')['RouterView'] Toolbar: typeof import('./src/components/toolbar/Toolbar.vue')['default'] diff --git a/frontend/src/components/migration/MigrationProgress.vue b/frontend/src/components/migration/MigrationProgress.vue new file mode 100644 index 0000000..e3de665 --- /dev/null +++ b/frontend/src/components/migration/MigrationProgress.vue @@ -0,0 +1,540 @@ + + + + + \ No newline at end of file diff --git a/frontend/src/i18n/locales/en-US.ts b/frontend/src/i18n/locales/en-US.ts index d3f34a5..98cc573 100644 --- a/frontend/src/i18n/locales/en-US.ts +++ b/frontend/src/i18n/locales/en-US.ts @@ -45,8 +45,38 @@ export default { loadFailed: 'Failed to load save settings', saveSuccess: 'Save settings updated', saveFailed: 'Failed to update save settings' + }, + migration: { + inProgress: 'Migrating data to new path...', + success: 'Data migration completed', + failed: 'Data migration failed' } }, + migration: { + title: 'Data Migration', + preparing: 'Preparing', + migrating: 'Migrating', + completed: 'Completed', + failed: 'Failed', + cancelled: 'Cancelled', + idle: 'Idle', + currentFile: 'Current File', + files: 'Files', + size: 'Size', + timeRemaining: 'Time Remaining', + complete: 'Complete', + retry: 'Retry', + close: 'Close', + migrationInProgress: 'Migrating data to new path...', + migrationCompleted: 'Data migration completed', + migrationFailed: 'Data migration failed', + recursiveCopyError: 'Target path cannot be a subdirectory of source path, this would cause infinite recursive copying', + targetNotDirectory: 'Target path exists but is not a directory', + targetNotEmpty: 'Target directory is not empty, cannot migrate', + compressing: 'Compressing source directory...', + extracting: 'Extracting to target location...', + cleaning: 'Cleaning up source directory...' + }, settings: { title: 'Settings', backToEditor: 'Back to Editor', @@ -69,13 +99,11 @@ export default { showInSystemTray: 'Show in System Tray', alwaysOnTop: 'Always on Top', dataStorage: 'Data Storage', - useCustomDataPath: 'Use custom data storage path', - selectDirectory: 'Select Directory', - selectDataDirectory: 'Select Data Storage Directory', - defaultDataPath: 'Default data storage path', - bufferFiles: 'Buffer Files Path', - useCustomLocation: 'Use custom location for buffer files', - customDataPath: 'Custom Data Storage Path', + dataPath: 'Data Storage Path', + clickToSelectPath: 'Click to select path', + resetDefault: 'Reset Default', + resetToDefaultPath: 'Reset to default path', + restartRequiredForDataPath: 'Restart required', fontSize: 'Font Size', fontSizeDescription: 'Editor font size', fontSettings: 'Font Settings', @@ -95,6 +123,10 @@ export default { restartRequired: '(Restart required)', saveOptions: 'Save Options', autoSaveDelay: 'Auto Save Delay (ms)', - selectDirectoryFailed: 'Failed to select directory' + selectDirectoryFailed: 'Failed to select directory', + validation: { + customPathRequired: 'A valid directory must be selected when enabling custom path', + customPathAutoDisabled: 'Custom data path has been automatically disabled due to no valid directory selected' + } } }; \ No newline at end of file diff --git a/frontend/src/i18n/locales/zh-CN.ts b/frontend/src/i18n/locales/zh-CN.ts index 1603e81..2f478aa 100644 --- a/frontend/src/i18n/locales/zh-CN.ts +++ b/frontend/src/i18n/locales/zh-CN.ts @@ -45,8 +45,38 @@ export default { loadFailed: '加载保存设置失败', saveSuccess: '保存设置已更新', saveFailed: '保存设置更新失败' + }, + migration: { + inProgress: '正在迁移数据到新路径...', + success: '数据迁移完成', + failed: '数据迁移失败' } }, + migration: { + title: '数据迁移', + preparing: '准备中', + migrating: '迁移中', + completed: '已完成', + failed: '失败', + cancelled: '已取消', + idle: '空闲', + currentFile: '当前文件', + files: '文件', + size: '大小', + timeRemaining: '剩余时间', + complete: '完成', + retry: '重试', + close: '关闭', + migrationInProgress: '正在迁移数据到新路径...', + migrationCompleted: '数据迁移完成', + migrationFailed: '数据迁移失败', + recursiveCopyError: '目标路径不能是源路径的子目录,这会导致无限递归复制', + targetNotDirectory: '目标路径存在但不是目录', + targetNotEmpty: '目标目录不为空,无法迁移', + compressing: '正在压缩源目录...', + extracting: '正在解压到目标位置...', + cleaning: '正在清理源目录...' + }, settings: { title: '设置', backToEditor: '返回编辑器', @@ -69,13 +99,11 @@ export default { showInSystemTray: '在系统托盘中显示', alwaysOnTop: '窗口始终置顶', dataStorage: '数据存储', - useCustomDataPath: '使用自定义数据存储路径', - selectDirectory: '选择目录', - selectDataDirectory: '选择数据存储目录', - defaultDataPath: '默认数据存储路径', - bufferFiles: '缓冲文件路径', - useCustomLocation: '使用自定义位置存储缓冲文件', - customDataPath: '自定义数据存储路径', + dataPath: '数据存储路径', + clickToSelectPath: '点击选择路径', + resetDefault: '恢复默认', + resetToDefaultPath: '恢复为默认路径', + restartRequiredForDataPath: '需要重启应用程序', fontSize: '字体大小', fontSizeDescription: '编辑器字体大小', fontSettings: '字体设置', @@ -95,6 +123,10 @@ export default { restartRequired: '(需要重启)', saveOptions: '保存选项', autoSaveDelay: '自动保存延迟(毫秒)', - selectDirectoryFailed: '选择目录失败' + selectDirectoryFailed: '选择目录失败', + validation: { + customPathRequired: '启用自定义路径时必须选择一个有效的目录', + customPathAutoDisabled: '由于未选择有效目录,自定义数据路径已自动关闭' + } } }; \ No newline at end of file diff --git a/frontend/src/stores/configStore.ts b/frontend/src/stores/configStore.ts index afd3945..da57585 100644 --- a/frontend/src/stores/configStore.ts +++ b/frontend/src/stores/configStore.ts @@ -47,9 +47,7 @@ type NumberConfigKey = 'fontSize' | 'tabSize' | 'lineHeight'; // 配置键映射 const GENERAL_CONFIG_KEY_MAP: GeneralConfigKeyMap = { alwaysOnTop: 'general.always_on_top', - defaultDataPath: 'general.default_data_path', - useCustomDataPath: 'general.use_custom_data_path', - customDataPath: 'general.custom_data_path', + dataPath: 'general.data_path', enableGlobalHotkey: 'general.enable_global_hotkey', globalHotkey: 'general.global_hotkey' } as const; @@ -115,9 +113,7 @@ const getBrowserLanguage = (): SupportedLocaleType => { const DEFAULT_CONFIG: AppConfig = { general: { alwaysOnTop: false, - defaultDataPath: './data', - useCustomDataPath: false, - customDataPath: '', + dataPath: './data', enableGlobalHotkey: false, globalHotkey: { ctrl: false, @@ -333,7 +329,7 @@ export const useConfigStore = defineStore('config', () => { const setters = { fontFamily: (value: string) => safeCall(() => updateEditingConfig('fontFamily', value), 'config.saveFailed', 'config.saveSuccess'), fontWeight: (value: string) => safeCall(() => updateEditingConfig('fontWeight', value), 'config.saveFailed', 'config.saveSuccess'), - defaultDataPath: (value: string) => safeCall(() => updateGeneralConfig('defaultDataPath', value), 'config.saveFailed', 'config.saveSuccess'), + dataPath: (value: string) => safeCall(() => updateGeneralConfig('dataPath', value), 'config.saveFailed', 'config.saveSuccess'), autoSaveDelay: (value: number) => safeCall(() => updateEditingConfig('autoSaveDelay', value), 'config.saveFailed', 'config.saveSuccess') }; @@ -382,9 +378,7 @@ export const useConfigStore = defineStore('config', () => { setFontWeight: setters.fontWeight, // 路径操作 - setDefaultDataPath: setters.defaultDataPath, - setUseCustomDataPath: (value: boolean) => safeCall(() => updateGeneralConfig('useCustomDataPath', value), 'config.saveFailed', 'config.saveSuccess'), - setCustomDataPath: (value: string) => safeCall(() => updateGeneralConfig('customDataPath', value), 'config.saveFailed', 'config.saveSuccess'), + setDataPath: setters.dataPath, // 保存配置相关方法 setAutoSaveDelay: setters.autoSaveDelay, diff --git a/frontend/src/views/editor/extensions/autoSaveExtension.ts b/frontend/src/views/editor/extensions/autoSaveExtension.ts index 803e9a7..2f86628 100644 --- a/frontend/src/views/editor/extensions/autoSaveExtension.ts +++ b/frontend/src/views/editor/extensions/autoSaveExtension.ts @@ -24,7 +24,7 @@ export interface AutoSaveOptions { export function createAutoSavePlugin(options: AutoSaveOptions = {}) { const { onSave = () => {}, - debounceDelay = 1000 // 默认1000ms延迟,原为300ms + debounceDelay = 2000 } = options; return ViewPlugin.fromClass( diff --git a/frontend/src/views/settings/Settings.vue b/frontend/src/views/settings/Settings.vue index 73a4bcd..c4fbdea 100644 --- a/frontend/src/views/settings/Settings.vue +++ b/frontend/src/views/settings/Settings.vue @@ -1,12 +1,10 @@