diff --git a/frontend/bindings/voidraft/internal/models/ent/index.ts b/frontend/bindings/voidraft/internal/models/ent/index.ts new file mode 100644 index 0000000..c9d993a --- /dev/null +++ b/frontend/bindings/voidraft/internal/models/ent/index.ts @@ -0,0 +1,4 @@ +// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL +// This file is automatically generated. DO NOT EDIT + +export * from "./models.js"; diff --git a/frontend/bindings/voidraft/internal/models/ent/models.ts b/frontend/bindings/voidraft/internal/models/ent/models.ts new file mode 100644 index 0000000..87dc9ae --- /dev/null +++ b/frontend/bindings/voidraft/internal/models/ent/models.ts @@ -0,0 +1,302 @@ +// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL +// This file is automatically generated. DO NOT EDIT + +// eslint-disable-next-line @typescript-eslint/ban-ts-comment +// @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 theme$0 from "./theme/models.js"; + +/** + * Document is the model entity for the Document schema. + */ +export class Document { + /** + * ID of the ent. + */ + "id"?: number; + + /** + * 创建时间 + */ + "created_at": string; + + /** + * 最后更新时间 + */ + "updated_at": string; + + /** + * 删除时间,NULL表示未删除 + */ + "deleted_at"?: string | null; + + /** + * 文档标题 + */ + "title": string; + + /** + * 文档内容 + */ + "content": string; + + /** + * 是否锁定 + */ + "locked": boolean; + + /** Creates a new Document instance. */ + constructor($$source: Partial = {}) { + if (!("created_at" in $$source)) { + this["created_at"] = ""; + } + if (!("updated_at" in $$source)) { + this["updated_at"] = ""; + } + if (!("title" in $$source)) { + this["title"] = ""; + } + if (!("content" in $$source)) { + this["content"] = ""; + } + if (!("locked" in $$source)) { + this["locked"] = false; + } + + Object.assign(this, $$source); + } + + /** + * Creates a new Document instance from a string or object. + */ + static createFrom($$source: any = {}): Document { + let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source; + return new Document($$parsedSource as Partial); + } +} + +/** + * Extension is the model entity for the Extension schema. + */ +export class Extension { + /** + * ID of the ent. + */ + "id"?: number; + + /** + * 创建时间 + */ + "created_at": string; + + /** + * 最后更新时间 + */ + "updated_at": string; + + /** + * 删除时间,NULL表示未删除 + */ + "deleted_at"?: string | null; + + /** + * 扩展标识符 + */ + "key": string; + + /** + * 是否启用 + */ + "enabled": boolean; + + /** + * 扩展配置 + */ + "config": { [_: string]: any }; + + /** Creates a new Extension instance. */ + constructor($$source: Partial = {}) { + if (!("created_at" in $$source)) { + this["created_at"] = ""; + } + if (!("updated_at" in $$source)) { + this["updated_at"] = ""; + } + if (!("key" in $$source)) { + this["key"] = ""; + } + if (!("enabled" in $$source)) { + this["enabled"] = false; + } + if (!("config" in $$source)) { + this["config"] = {}; + } + + Object.assign(this, $$source); + } + + /** + * Creates a new Extension instance from a string or object. + */ + static createFrom($$source: any = {}): Extension { + const $$createField6_0 = $$createType0; + let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source; + if ("config" in $$parsedSource) { + $$parsedSource["config"] = $$createField6_0($$parsedSource["config"]); + } + return new Extension($$parsedSource as Partial); + } +} + +/** + * KeyBinding is the model entity for the KeyBinding schema. + */ +export class KeyBinding { + /** + * ID of the ent. + */ + "id"?: number; + + /** + * 创建时间 + */ + "created_at": string; + + /** + * 最后更新时间 + */ + "updated_at": string; + + /** + * 删除时间,NULL表示未删除 + */ + "deleted_at"?: string | null; + + /** + * 快捷键标识符 + */ + "key": string; + + /** + * 快捷键命令 + */ + "command": string; + + /** + * 所属扩展标识符 + */ + "extension"?: string; + + /** + * 是否启用 + */ + "enabled": boolean; + + /** Creates a new KeyBinding instance. */ + constructor($$source: Partial = {}) { + if (!("created_at" in $$source)) { + this["created_at"] = ""; + } + if (!("updated_at" in $$source)) { + this["updated_at"] = ""; + } + if (!("key" in $$source)) { + this["key"] = ""; + } + if (!("command" in $$source)) { + this["command"] = ""; + } + if (!("enabled" in $$source)) { + this["enabled"] = false; + } + + Object.assign(this, $$source); + } + + /** + * Creates a new KeyBinding instance from a string or object. + */ + static createFrom($$source: any = {}): KeyBinding { + let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source; + return new KeyBinding($$parsedSource as Partial); + } +} + +/** + * Theme is the model entity for the Theme schema. + */ +export class Theme { + /** + * ID of the ent. + */ + "id"?: number; + + /** + * 创建时间 + */ + "created_at": string; + + /** + * 最后更新时间 + */ + "updated_at": string; + + /** + * 删除时间,NULL表示未删除 + */ + "deleted_at"?: string | null; + + /** + * 主题标识符 + */ + "key": string; + + /** + * 主题类型 + */ + "type": theme$0.Type; + + /** + * 主题颜色配置 + */ + "colors": { [_: string]: any }; + + /** Creates a new Theme instance. */ + constructor($$source: Partial = {}) { + if (!("created_at" in $$source)) { + this["created_at"] = ""; + } + if (!("updated_at" in $$source)) { + this["updated_at"] = ""; + } + if (!("key" in $$source)) { + this["key"] = ""; + } + if (!("type" in $$source)) { + this["type"] = ("" as theme$0.Type); + } + if (!("colors" in $$source)) { + this["colors"] = {}; + } + + Object.assign(this, $$source); + } + + /** + * Creates a new Theme instance from a string or object. + */ + static createFrom($$source: any = {}): Theme { + const $$createField6_0 = $$createType0; + let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source; + if ("colors" in $$parsedSource) { + $$parsedSource["colors"] = $$createField6_0($$parsedSource["colors"]); + } + return new Theme($$parsedSource as Partial); + } +} + +// Private type creation functions +const $$createType0 = $Create.Map($Create.Any, $Create.Any); diff --git a/frontend/bindings/voidraft/internal/models/ent/theme/index.ts b/frontend/bindings/voidraft/internal/models/ent/theme/index.ts new file mode 100644 index 0000000..c9d993a --- /dev/null +++ b/frontend/bindings/voidraft/internal/models/ent/theme/index.ts @@ -0,0 +1,4 @@ +// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL +// This file is automatically generated. DO NOT EDIT + +export * from "./models.js"; diff --git a/frontend/bindings/voidraft/internal/models/ent/theme/models.ts b/frontend/bindings/voidraft/internal/models/ent/theme/models.ts new file mode 100644 index 0000000..7aa3dfc --- /dev/null +++ b/frontend/bindings/voidraft/internal/models/ent/theme/models.ts @@ -0,0 +1,22 @@ +// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL +// This file is automatically generated. DO NOT EDIT + +// eslint-disable-next-line @typescript-eslint/ban-ts-comment +// @ts-ignore: Unused imports +import {Create as $Create} from "@wailsio/runtime"; + +/** + * Type defines the type for the "type" enum field. + */ +export enum Type { + /** + * The Go zero value for the underlying type of the enum. + */ + $zero = "", + + /** + * Type values. + */ + TypeDark = "dark", + TypeLight = "light", +}; diff --git a/frontend/bindings/voidraft/internal/models/models.ts b/frontend/bindings/voidraft/internal/models/models.ts index 7714cae..fd3ba80 100644 --- a/frontend/bindings/voidraft/internal/models/models.ts +++ b/frontend/bindings/voidraft/internal/models/models.ts @@ -193,58 +193,6 @@ export class ConfigMetadata { } } -/** - * Document represents a document in the system - */ -export class Document { - "id": number; - "title": string; - "content": string; - "createdAt": string; - "updatedAt": string; - "is_deleted": boolean; - - /** - * 锁定标志,锁定的文档无法被删除 - */ - "is_locked": boolean; - - /** Creates a new Document instance. */ - constructor($$source: Partial = {}) { - if (!("id" in $$source)) { - this["id"] = 0; - } - if (!("title" in $$source)) { - this["title"] = ""; - } - if (!("content" in $$source)) { - this["content"] = ""; - } - if (!("createdAt" in $$source)) { - this["createdAt"] = ""; - } - if (!("updatedAt" in $$source)) { - this["updatedAt"] = ""; - } - if (!("is_deleted" in $$source)) { - this["is_deleted"] = false; - } - if (!("is_locked" in $$source)) { - this["is_locked"] = false; - } - - Object.assign(this, $$source); - } - - /** - * Creates a new Document instance from a string or object. - */ - static createFrom($$source: any = {}): Document { - let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source; - return new Document($$parsedSource as Partial); - } -} - /** * EditingConfig 编辑设置配置 */ @@ -332,40 +280,21 @@ export class EditingConfig { } /** - * Extension 单个扩展配置 + * Extension 扩展配置 */ export class Extension { - /** - * 扩展唯一标识 - */ - "id": ExtensionID; - - /** - * 是否启用 - */ + "key": ExtensionKey; "enabled": boolean; - - /** - * 是否为默认扩展 - */ - "isDefault": boolean; - - /** - * 扩展配置项 - */ "config": ExtensionConfig; /** Creates a new Extension instance. */ constructor($$source: Partial = {}) { - if (!("id" in $$source)) { - this["id"] = ("" as ExtensionID); + if (!("key" in $$source)) { + this["key"] = ("" as ExtensionKey); } if (!("enabled" in $$source)) { this["enabled"] = false; } - if (!("isDefault" in $$source)) { - this["isDefault"] = false; - } if (!("config" in $$source)) { this["config"] = ({} as ExtensionConfig); } @@ -377,10 +306,10 @@ export class Extension { * Creates a new Extension instance from a string or object. */ static createFrom($$source: any = {}): Extension { - const $$createField3_0 = $$createType6; + const $$createField2_0 = $$createType6; let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source; if ("config" in $$parsedSource) { - $$parsedSource["config"] = $$createField3_0($$parsedSource["config"]); + $$parsedSource["config"] = $$createField2_0($$parsedSource["config"]); } return new Extension($$parsedSource as Partial); } @@ -392,9 +321,9 @@ export class Extension { export type ExtensionConfig = { [_: string]: any }; /** - * ExtensionID 扩展标识符 + * ExtensionKey 扩展标识符 */ -export enum ExtensionID { +export enum ExtensionKey { /** * The Go zero value for the underlying type of the enum. */ @@ -442,7 +371,6 @@ export enum ExtensionID { ExtensionHighlightTrailingWhitespace = "highlightTrailingWhitespace", /** - * UI增强扩展 * 小地图 */ ExtensionMinimap = "minimap", @@ -458,16 +386,14 @@ export enum ExtensionID { ExtensionContextMenu = "contextMenu", /** - * 工具扩展 * 搜索功能 */ ExtensionSearch = "search", /** - * 核心扩展 - * 编辑器核心功能 + * HTTP 客户端 */ - ExtensionEditor = "editor", + ExtensionHttpClient = "httpClient", }; /** @@ -758,48 +684,25 @@ export class HotkeyCombo { * KeyBinding 单个快捷键绑定 */ export class KeyBinding { - /** - * 快捷键动作 - */ - "command": KeyBindingCommand; - - /** - * 所属扩展 - */ - "extension": ExtensionID; - - /** - * 快捷键组合(如 "Mod-f", "Ctrl-Shift-p") - */ - "key": string; - - /** - * 是否启用 - */ + "key": KeyBindingKey; + "command": string; + "extension": ExtensionKey; "enabled": boolean; - /** - * 是否为默认快捷键 - */ - "isDefault": boolean; - /** Creates a new KeyBinding instance. */ constructor($$source: Partial = {}) { + if (!("key" in $$source)) { + this["key"] = ("" as KeyBindingKey); + } if (!("command" in $$source)) { - this["command"] = ("" as KeyBindingCommand); + this["command"] = ""; } if (!("extension" in $$source)) { - this["extension"] = ("" as ExtensionID); - } - if (!("key" in $$source)) { - this["key"] = ""; + this["extension"] = ("" as ExtensionKey); } if (!("enabled" in $$source)) { this["enabled"] = false; } - if (!("isDefault" in $$source)) { - this["isDefault"] = false; - } Object.assign(this, $$source); } @@ -814,263 +717,258 @@ export class KeyBinding { } /** - * KeyBindingCommand 快捷键命令 + * KeyBindingKey 快捷键命令 */ -export enum KeyBindingCommand { +export enum KeyBindingKey { /** * The Go zero value for the underlying type of the enum. */ $zero = "", /** - * 搜索扩展相关 * 显示搜索 */ - ShowSearchCommand = "showSearch", + ShowSearchKeyBindingKey = "showSearch", /** * 隐藏搜索 */ - HideSearchCommand = "hideSearch", + HideSearchKeyBindingKey = "hideSearch", /** - * 代码块扩展相关 * 块内选择全部 */ - BlockSelectAllCommand = "blockSelectAll", + BlockSelectAllKeyBindingKey = "blockSelectAll", /** * 在当前块后添加新块 */ - BlockAddAfterCurrentCommand = "blockAddAfterCurrent", + BlockAddAfterCurrentKeyBindingKey = "blockAddAfterCurrent", /** * 在最后添加新块 */ - BlockAddAfterLastCommand = "blockAddAfterLast", + BlockAddAfterLastKeyBindingKey = "blockAddAfterLast", /** * 在当前块前添加新块 */ - BlockAddBeforeCurrentCommand = "blockAddBeforeCurrent", + BlockAddBeforeCurrentKeyBindingKey = "blockAddBeforeCurrent", /** * 跳转到上一个块 */ - BlockGotoPreviousCommand = "blockGotoPrevious", + BlockGotoPreviousKeyBindingKey = "blockGotoPrevious", /** * 跳转到下一个块 */ - BlockGotoNextCommand = "blockGotoNext", + BlockGotoNextKeyBindingKey = "blockGotoNext", /** * 选择上一个块 */ - BlockSelectPreviousCommand = "blockSelectPrevious", + BlockSelectPreviousKeyBindingKey = "blockSelectPrevious", /** * 选择下一个块 */ - BlockSelectNextCommand = "blockSelectNext", + BlockSelectNextKeyBindingKey = "blockSelectNext", /** * 删除当前块 */ - BlockDeleteCommand = "blockDelete", + BlockDeleteKeyBindingKey = "blockDelete", /** * 向上移动当前块 */ - BlockMoveUpCommand = "blockMoveUp", + BlockMoveUpKeyBindingKey = "blockMoveUp", /** * 向下移动当前块 */ - BlockMoveDownCommand = "blockMoveDown", + BlockMoveDownKeyBindingKey = "blockMoveDown", /** * 删除行 */ - BlockDeleteLineCommand = "blockDeleteLine", + BlockDeleteLineKeyBindingKey = "blockDeleteLine", /** * 向上移动行 */ - BlockMoveLineUpCommand = "blockMoveLineUp", + BlockMoveLineUpKeyBindingKey = "blockMoveLineUp", /** * 向下移动行 */ - BlockMoveLineDownCommand = "blockMoveLineDown", + BlockMoveLineDownKeyBindingKey = "blockMoveLineDown", /** * 字符转置 */ - BlockTransposeCharsCommand = "blockTransposeChars", + BlockTransposeCharsKeyBindingKey = "blockTransposeChars", /** * 格式化代码块 */ - BlockFormatCommand = "blockFormat", + BlockFormatKeyBindingKey = "blockFormat", /** * 复制 */ - BlockCopyCommand = "blockCopy", + BlockCopyKeyBindingKey = "blockCopy", /** * 剪切 */ - BlockCutCommand = "blockCut", + BlockCutKeyBindingKey = "blockCut", /** * 粘贴 */ - BlockPasteCommand = "blockPaste", + BlockPasteKeyBindingKey = "blockPaste", /** - * 代码折叠扩展相关 * 折叠代码 */ - FoldCodeCommand = "foldCode", + FoldCodeKeyBindingKey = "foldCode", /** * 展开代码 */ - UnfoldCodeCommand = "unfoldCode", + UnfoldCodeKeyBindingKey = "unfoldCode", /** * 折叠全部 */ - FoldAllCommand = "foldAll", + FoldAllKeyBindingKey = "foldAll", /** * 展开全部 */ - UnfoldAllCommand = "unfoldAll", + UnfoldAllKeyBindingKey = "unfoldAll", /** - * 通用编辑扩展相关 * 光标按语法左移 */ - CursorSyntaxLeftCommand = "cursorSyntaxLeft", + CursorSyntaxLeftKeyBindingKey = "cursorSyntaxLeft", /** * 光标按语法右移 */ - CursorSyntaxRightCommand = "cursorSyntaxRight", + CursorSyntaxRightKeyBindingKey = "cursorSyntaxRight", /** * 按语法选择左侧 */ - SelectSyntaxLeftCommand = "selectSyntaxLeft", + SelectSyntaxLeftKeyBindingKey = "selectSyntaxLeft", /** * 按语法选择右侧 */ - SelectSyntaxRightCommand = "selectSyntaxRight", + SelectSyntaxRightKeyBindingKey = "selectSyntaxRight", /** * 向上复制行 */ - CopyLineUpCommand = "copyLineUp", + CopyLineUpKeyBindingKey = "copyLineUp", /** * 向下复制行 */ - CopyLineDownCommand = "copyLineDown", + CopyLineDownKeyBindingKey = "copyLineDown", /** * 插入空行 */ - InsertBlankLineCommand = "insertBlankLine", + InsertBlankLineKeyBindingKey = "insertBlankLine", /** * 选择行 */ - SelectLineCommand = "selectLine", + SelectLineKeyBindingKey = "selectLine", /** * 选择父级语法 */ - SelectParentSyntaxCommand = "selectParentSyntax", + SelectParentSyntaxKeyBindingKey = "selectParentSyntax", /** * 减少缩进 */ - IndentLessCommand = "indentLess", + IndentLessKeyBindingKey = "indentLess", /** * 增加缩进 */ - IndentMoreCommand = "indentMore", + IndentMoreKeyBindingKey = "indentMore", /** * 缩进选择 */ - IndentSelectionCommand = "indentSelection", + IndentSelectionKeyBindingKey = "indentSelection", /** * 光标到匹配括号 */ - CursorMatchingBracketCommand = "cursorMatchingBracket", + CursorMatchingBracketKeyBindingKey = "cursorMatchingBracket", /** * 切换注释 */ - ToggleCommentCommand = "toggleComment", + ToggleCommentKeyBindingKey = "toggleComment", /** * 切换块注释 */ - ToggleBlockCommentCommand = "toggleBlockComment", + ToggleBlockCommentKeyBindingKey = "toggleBlockComment", /** * 插入新行并缩进 */ - InsertNewlineAndIndentCommand = "insertNewlineAndIndent", + InsertNewlineAndIndentKeyBindingKey = "insertNewlineAndIndent", /** * 向后删除字符 */ - DeleteCharBackwardCommand = "deleteCharBackward", + DeleteCharBackwardKeyBindingKey = "deleteCharBackward", /** * 向前删除字符 */ - DeleteCharForwardCommand = "deleteCharForward", + DeleteCharForwardKeyBindingKey = "deleteCharForward", /** * 向后删除组 */ - DeleteGroupBackwardCommand = "deleteGroupBackward", + DeleteGroupBackwardKeyBindingKey = "deleteGroupBackward", /** * 向前删除组 */ - DeleteGroupForwardCommand = "deleteGroupForward", + DeleteGroupForwardKeyBindingKey = "deleteGroupForward", /** - * 历史记录扩展相关 * 撤销 */ - HistoryUndoCommand = "historyUndo", + HistoryUndoKeyBindingKey = "historyUndo", /** * 重做 */ - HistoryRedoCommand = "historyRedo", + HistoryRedoKeyBindingKey = "historyRedo", /** * 撤销选择 */ - HistoryUndoSelectionCommand = "historyUndoSelection", + HistoryUndoSelectionKeyBindingKey = "historyUndoSelection", /** * 重做选择 */ - HistoryRedoSelectionCommand = "historyRedoSelection", + HistoryRedoSelectionKeyBindingKey = "historyRedoSelection", }; /** @@ -1138,76 +1036,6 @@ export enum TabType { TabTypeTab = "tab", }; -/** - * Theme 主题数据库模型 - */ -export class Theme { - "id": number; - "name": string; - "type": ThemeType; - "colors": ThemeColorConfig; - "isDefault": boolean; - "createdAt": string; - "updatedAt": string; - - /** Creates a new Theme instance. */ - constructor($$source: Partial = {}) { - if (!("id" in $$source)) { - this["id"] = 0; - } - if (!("name" in $$source)) { - this["name"] = ""; - } - if (!("type" in $$source)) { - this["type"] = ("" as ThemeType); - } - if (!("colors" in $$source)) { - this["colors"] = ({} as ThemeColorConfig); - } - if (!("isDefault" in $$source)) { - this["isDefault"] = false; - } - if (!("createdAt" in $$source)) { - this["createdAt"] = ""; - } - if (!("updatedAt" in $$source)) { - this["updatedAt"] = ""; - } - - Object.assign(this, $$source); - } - - /** - * Creates a new Theme instance from a string or object. - */ - static createFrom($$source: any = {}): Theme { - const $$createField3_0 = $$createType9; - let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source; - if ("colors" in $$parsedSource) { - $$parsedSource["colors"] = $$createField3_0($$parsedSource["colors"]); - } - return new Theme($$parsedSource as Partial); - } -} - -/** - * ThemeColorConfig 使用与前端 ThemeColors 相同的结构,存储任意主题键值 - */ -export type ThemeColorConfig = { [_: string]: any }; - -/** - * ThemeType 主题类型枚举 - */ -export enum ThemeType { - /** - * The Go zero value for the underlying type of the enum. - */ - $zero = "", - - ThemeTypeDark = "dark", - ThemeTypeLight = "light", -}; - /** * UpdateSourceType 更新源类型 */ @@ -1306,8 +1134,8 @@ export class UpdatesConfig { * Creates a new UpdatesConfig instance from a string or object. */ static createFrom($$source: any = {}): UpdatesConfig { - const $$createField6_0 = $$createType10; - const $$createField7_0 = $$createType11; + const $$createField6_0 = $$createType9; + const $$createField7_0 = $$createType10; let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source; if ("github" in $$parsedSource) { $$parsedSource["github"] = $$createField6_0($$parsedSource["github"]); @@ -1334,11 +1162,5 @@ var $$createType6 = (function $$initCreateType6(...args): any { }); const $$createType7 = $Create.Map($Create.Any, $Create.Any); const $$createType8 = HotkeyCombo.createFrom; -var $$createType9 = (function $$initCreateType9(...args): any { - if ($$createType9 === $$initCreateType9) { - $$createType9 = $$createType7; - } - return $$createType9(...args); -}); -const $$createType10 = GithubConfig.createFrom; -const $$createType11 = GiteaConfig.createFrom; +const $$createType9 = GithubConfig.createFrom; +const $$createType10 = GiteaConfig.createFrom; diff --git a/frontend/bindings/voidraft/internal/services/databaseservice.ts b/frontend/bindings/voidraft/internal/services/databaseservice.ts index d6e307c..132aaa5 100644 --- a/frontend/bindings/voidraft/internal/services/databaseservice.ts +++ b/frontend/bindings/voidraft/internal/services/databaseservice.ts @@ -2,7 +2,7 @@ // This file is automatically generated. DO NOT EDIT /** - * DatabaseService provides shared database functionality + * DatabaseService 数据库服务 * @module */ @@ -15,15 +15,7 @@ import {Call as $Call, Create as $Create} from "@wailsio/runtime"; import * as application$0 from "../../../github.com/wailsapp/wails/v3/pkg/application/models.js"; /** - * RegisterModel 注册模型与表的映射关系 - */ -export function RegisterModel(tableName: string, model: any): Promise & { cancel(): void } { - let $resultPromise = $Call.ByID(175397515, tableName, model) as any; - return $resultPromise; -} - -/** - * ServiceShutdown shuts down the service when the application closes + * ServiceShutdown 服务关闭 */ export function ServiceShutdown(): Promise & { cancel(): void } { let $resultPromise = $Call.ByID(3907893632) as any; @@ -31,7 +23,7 @@ export function ServiceShutdown(): Promise & { cancel(): void } { } /** - * ServiceStartup initializes the service when the application starts + * ServiceStartup 服务启动 */ export function ServiceStartup(options: application$0.ServiceOptions): Promise & { cancel(): void } { let $resultPromise = $Call.ByID(2067840771, options) as any; diff --git a/frontend/bindings/voidraft/internal/services/documentservice.ts b/frontend/bindings/voidraft/internal/services/documentservice.ts index 9758245..83e96c2 100644 --- a/frontend/bindings/voidraft/internal/services/documentservice.ts +++ b/frontend/bindings/voidraft/internal/services/documentservice.ts @@ -2,7 +2,7 @@ // This file is automatically generated. DO NOT EDIT /** - * DocumentService provides document management functionality + * DocumentService 文档服务 * @module */ @@ -15,12 +15,12 @@ import {Call as $Call, Create as $Create} from "@wailsio/runtime"; import * as application$0 from "../../../github.com/wailsapp/wails/v3/pkg/application/models.js"; // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore: Unused imports -import * as models$0 from "../models/models.js"; +import * as ent$0 from "../models/ent/models.js"; /** - * CreateDocument creates a new document and returns the created document with ID + * CreateDocument 创建文档 */ -export function CreateDocument(title: string): Promise & { cancel(): void } { +export function CreateDocument(title: string): Promise & { cancel(): void } { let $resultPromise = $Call.ByID(3360680842, title) as any; let $typingPromise = $resultPromise.then(($result: any) => { return $$createType1($result); @@ -30,7 +30,7 @@ export function CreateDocument(title: string): Promise } /** - * DeleteDocument marks a document as deleted (default document with ID=1 cannot be deleted) + * DeleteDocument 删除文档 */ export function DeleteDocument(id: number): Promise & { cancel(): void } { let $resultPromise = $Call.ByID(412287269, id) as any; @@ -38,9 +38,9 @@ export function DeleteDocument(id: number): Promise & { cancel(): void } { } /** - * GetDocumentByID gets a document by ID + * GetDocumentByID 根据ID获取文档 */ -export function GetDocumentByID(id: number): Promise & { cancel(): void } { +export function GetDocumentByID(id: number): Promise & { cancel(): void } { let $resultPromise = $Call.ByID(3468193232, id) as any; let $typingPromise = $resultPromise.then(($result: any) => { return $$createType1($result); @@ -50,9 +50,9 @@ export function GetDocumentByID(id: number): Promise & } /** - * ListAllDocumentsMeta lists all active (non-deleted) document metadata + * ListAllDocumentsMeta 列出所有文档 */ -export function ListAllDocumentsMeta(): Promise<(models$0.Document | null)[]> & { cancel(): void } { +export function ListAllDocumentsMeta(): Promise<(ent$0.Document | null)[]> & { cancel(): void } { let $resultPromise = $Call.ByID(3073950297) as any; let $typingPromise = $resultPromise.then(($result: any) => { return $$createType2($result); @@ -62,19 +62,7 @@ export function ListAllDocumentsMeta(): Promise<(models$0.Document | null)[]> & } /** - * ListDeletedDocumentsMeta lists all deleted document metadata - */ -export function ListDeletedDocumentsMeta(): Promise<(models$0.Document | null)[]> & { cancel(): void } { - let $resultPromise = $Call.ByID(490143787) as any; - let $typingPromise = $resultPromise.then(($result: any) => { - return $$createType2($result); - }) as any; - $typingPromise.cancel = $resultPromise.cancel.bind($resultPromise); - return $typingPromise; -} - -/** - * LockDocument 锁定文档,防止删除 + * LockDocument 锁定文档 */ export function LockDocument(id: number): Promise & { cancel(): void } { let $resultPromise = $Call.ByID(1889494473, id) as any; @@ -82,15 +70,7 @@ export function LockDocument(id: number): Promise & { cancel(): void } { } /** - * RestoreDocument restores a deleted document - */ -export function RestoreDocument(id: number): Promise & { cancel(): void } { - let $resultPromise = $Call.ByID(784200778, id) as any; - return $resultPromise; -} - -/** - * ServiceStartup initializes the service when the application starts + * ServiceStartup 服务启动 */ export function ServiceStartup(options: application$0.ServiceOptions): Promise & { cancel(): void } { let $resultPromise = $Call.ByID(1474135487, options) as any; @@ -106,7 +86,7 @@ export function UnlockDocument(id: number): Promise & { cancel(): void } { } /** - * UpdateDocumentContent updates the content of a document + * UpdateDocumentContent 更新文档内容 */ export function UpdateDocumentContent(id: number, content: string): Promise & { cancel(): void } { let $resultPromise = $Call.ByID(3251897116, id, content) as any; @@ -114,7 +94,7 @@ export function UpdateDocumentContent(id: number, content: string): Promise & { cancel(): void } { let $resultPromise = $Call.ByID(2045530459, id, title) as any; @@ -122,6 +102,6 @@ export function UpdateDocumentTitle(id: number, title: string): Promise & } // Private type creation functions -const $$createType0 = models$0.Document.createFrom; +const $$createType0 = ent$0.Document.createFrom; const $$createType1 = $Create.Nullable($$createType0); const $$createType2 = $Create.Array($$createType1); diff --git a/frontend/bindings/voidraft/internal/services/extensionservice.ts b/frontend/bindings/voidraft/internal/services/extensionservice.ts index f0ed4a9..b9d4ed2 100644 --- a/frontend/bindings/voidraft/internal/services/extensionservice.ts +++ b/frontend/bindings/voidraft/internal/services/extensionservice.ts @@ -2,7 +2,7 @@ // This file is automatically generated. DO NOT EDIT /** - * ExtensionService 扩展管理服务 + * ExtensionService 扩展服务 * @module */ @@ -16,12 +16,39 @@ import * as application$0 from "../../../github.com/wailsapp/wails/v3/pkg/applic // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore: Unused imports import * as models$0 from "../models/models.js"; +// eslint-disable-next-line @typescript-eslint/ban-ts-comment +// @ts-ignore: Unused imports +import * as ent$0 from "../models/ent/models.js"; /** - * GetAllExtensions 获取所有扩展配置 + * GetAllExtensions 获取所有扩展 */ -export function GetAllExtensions(): Promise & { cancel(): void } { +export function GetAllExtensions(): Promise<(ent$0.Extension | null)[]> & { cancel(): void } { let $resultPromise = $Call.ByID(3094292124) as any; + let $typingPromise = $resultPromise.then(($result: any) => { + return $$createType2($result); + }) as any; + $typingPromise.cancel = $resultPromise.cancel.bind($resultPromise); + return $typingPromise; +} + +/** + * GetDefaultExtensions 获取默认扩展配置(用于前端绑定生成) + */ +export function GetDefaultExtensions(): Promise & { cancel(): void } { + let $resultPromise = $Call.ByID(4036328166) as any; + let $typingPromise = $resultPromise.then(($result: any) => { + return $$createType4($result); + }) as any; + $typingPromise.cancel = $resultPromise.cancel.bind($resultPromise); + return $typingPromise; +} + +/** + * GetExtensionByKey 根据Key获取扩展 + */ +export function GetExtensionByKey(key: string): Promise & { cancel(): void } { + let $resultPromise = $Call.ByID(2551065776, key) as any; let $typingPromise = $resultPromise.then(($result: any) => { return $$createType1($result); }) as any; @@ -30,23 +57,15 @@ export function GetAllExtensions(): Promise & { cancel(): } /** - * ResetAllExtensionsToDefault 重置所有扩展到默认状态 + * ResetExtensionConfig 重置单个扩展到默认状态 */ -export function ResetAllExtensionsToDefault(): Promise & { cancel(): void } { - let $resultPromise = $Call.ByID(270611949) as any; +export function ResetExtensionConfig(key: string): Promise & { cancel(): void } { + let $resultPromise = $Call.ByID(3990780299, key) as any; return $resultPromise; } /** - * ResetExtensionToDefault 重置扩展到默认状态 - */ -export function ResetExtensionToDefault(id: models$0.ExtensionID): Promise & { cancel(): void } { - let $resultPromise = $Call.ByID(868308101, id) as any; - return $resultPromise; -} - -/** - * ServiceStartup 启动时调用 + * ServiceStartup 服务启动 */ export function ServiceStartup(options: application$0.ServiceOptions): Promise & { cancel(): void } { let $resultPromise = $Call.ByID(40324057, options) as any; @@ -54,21 +73,32 @@ export function ServiceStartup(options: application$0.ServiceOptions): Promise & { cancel(): void } { - let $resultPromise = $Call.ByID(1067300094, id, enabled) as any; +export function SyncExtensions(): Promise & { cancel(): void } { + let $resultPromise = $Call.ByID(167560004) as any; return $resultPromise; } /** - * UpdateExtensionState 更新扩展状态 + * UpdateExtensionConfig 更新扩展配置 */ -export function UpdateExtensionState(id: models$0.ExtensionID, enabled: boolean, config: models$0.ExtensionConfig): Promise & { cancel(): void } { - let $resultPromise = $Call.ByID(2917946454, id, enabled, config) as any; +export function UpdateExtensionConfig(key: string, config: { [_: string]: any }): Promise & { cancel(): void } { + let $resultPromise = $Call.ByID(3184142503, key, config) as any; + return $resultPromise; +} + +/** + * UpdateExtensionEnabled 更新扩展启用状态 + */ +export function UpdateExtensionEnabled(key: string, enabled: boolean): Promise & { cancel(): void } { + let $resultPromise = $Call.ByID(1067300094, key, enabled) as any; return $resultPromise; } // Private type creation functions -const $$createType0 = models$0.Extension.createFrom; -const $$createType1 = $Create.Array($$createType0); +const $$createType0 = ent$0.Extension.createFrom; +const $$createType1 = $Create.Nullable($$createType0); +const $$createType2 = $Create.Array($$createType1); +const $$createType3 = models$0.Extension.createFrom; +const $$createType4 = $Create.Array($$createType3); diff --git a/frontend/bindings/voidraft/internal/services/index.ts b/frontend/bindings/voidraft/internal/services/index.ts index 84245b4..4bc0bbe 100644 --- a/frontend/bindings/voidraft/internal/services/index.ts +++ b/frontend/bindings/voidraft/internal/services/index.ts @@ -17,7 +17,6 @@ import * as SystemService from "./systemservice.js"; import * as TestService from "./testservice.js"; import * as ThemeService from "./themeservice.js"; import * as TranslationService from "./translationservice.js"; -import * as TrayService from "./trayservice.js"; import * as WindowService from "./windowservice.js"; export { BackupService, @@ -36,7 +35,6 @@ export { TestService, ThemeService, TranslationService, - TrayService, WindowService }; diff --git a/frontend/bindings/voidraft/internal/services/keybindingservice.ts b/frontend/bindings/voidraft/internal/services/keybindingservice.ts index 54571f7..d4d086d 100644 --- a/frontend/bindings/voidraft/internal/services/keybindingservice.ts +++ b/frontend/bindings/voidraft/internal/services/keybindingservice.ts @@ -2,7 +2,7 @@ // This file is automatically generated. DO NOT EDIT /** - * KeyBindingService 快捷键管理服务 + * KeyBindingService 快捷键服务 * @module */ @@ -16,12 +16,39 @@ import * as application$0 from "../../../github.com/wailsapp/wails/v3/pkg/applic // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore: Unused imports import * as models$0 from "../models/models.js"; +// eslint-disable-next-line @typescript-eslint/ban-ts-comment +// @ts-ignore: Unused imports +import * as ent$0 from "../models/ent/models.js"; /** - * GetAllKeyBindings 获取所有快捷键配置 + * GetAllKeyBindings 获取所有快捷键 */ -export function GetAllKeyBindings(): Promise & { cancel(): void } { +export function GetAllKeyBindings(): Promise<(ent$0.KeyBinding | null)[]> & { cancel(): void } { let $resultPromise = $Call.ByID(1633502882) as any; + let $typingPromise = $resultPromise.then(($result: any) => { + return $$createType2($result); + }) as any; + $typingPromise.cancel = $resultPromise.cancel.bind($resultPromise); + return $typingPromise; +} + +/** + * GetDefaultKeyBindings 获取默认快捷键配置 + */ +export function GetDefaultKeyBindings(): Promise & { cancel(): void } { + let $resultPromise = $Call.ByID(3843471588) as any; + let $typingPromise = $resultPromise.then(($result: any) => { + return $$createType4($result); + }) as any; + $typingPromise.cancel = $resultPromise.cancel.bind($resultPromise); + return $typingPromise; +} + +/** + * GetKeyBindingByKey 根据Key获取快捷键 + */ +export function GetKeyBindingByKey(key: string): Promise & { cancel(): void } { + let $resultPromise = $Call.ByID(852938650, key) as any; let $typingPromise = $resultPromise.then(($result: any) => { return $$createType1($result); }) as any; @@ -30,13 +57,40 @@ export function GetAllKeyBindings(): Promise & { cancel() } /** - * ServiceStartup 启动时调用 + * ServiceStartup 服务启动 */ export function ServiceStartup(options: application$0.ServiceOptions): Promise & { cancel(): void } { let $resultPromise = $Call.ByID(2057121990, options) as any; return $resultPromise; } +/** + * SyncKeyBindings 同步快捷键配置 + */ +export function SyncKeyBindings(): Promise & { cancel(): void } { + let $resultPromise = $Call.ByID(1522202638) as any; + return $resultPromise; +} + +/** + * UpdateKeyBindingCommand 更新快捷键命令 + */ +export function UpdateKeyBindingCommand(key: string, command: string): Promise & { cancel(): void } { + let $resultPromise = $Call.ByID(1293670628, key, command) as any; + return $resultPromise; +} + +/** + * UpdateKeyBindingEnabled 更新快捷键启用状态 + */ +export function UpdateKeyBindingEnabled(key: string, enabled: boolean): Promise & { cancel(): void } { + let $resultPromise = $Call.ByID(843626124, key, enabled) as any; + return $resultPromise; +} + // Private type creation functions -const $$createType0 = models$0.KeyBinding.createFrom; -const $$createType1 = $Create.Array($$createType0); +const $$createType0 = ent$0.KeyBinding.createFrom; +const $$createType1 = $Create.Nullable($$createType0); +const $$createType2 = $Create.Array($$createType1); +const $$createType3 = models$0.KeyBinding.createFrom; +const $$createType4 = $Create.Array($$createType3); diff --git a/frontend/bindings/voidraft/internal/services/models.ts b/frontend/bindings/voidraft/internal/services/models.ts index ba5c171..ff881a3 100644 --- a/frontend/bindings/voidraft/internal/services/models.ts +++ b/frontend/bindings/voidraft/internal/services/models.ts @@ -191,15 +191,14 @@ export class MemoryStats { * MigrationProgress 迁移进度信息 */ export class MigrationProgress { - "status": MigrationStatus; + /** + * 0-100 + */ "progress": number; "error"?: string; /** Creates a new MigrationProgress instance. */ constructor($$source: Partial = {}) { - if (!("status" in $$source)) { - this["status"] = ("" as MigrationStatus); - } if (!("progress" in $$source)) { this["progress"] = 0; } @@ -216,20 +215,6 @@ export class MigrationProgress { } } -/** - * MigrationStatus 迁移状态 - */ -export enum MigrationStatus { - /** - * The Go zero value for the underlying type of the enum. - */ - $zero = "", - - MigrationStatusMigrating = "migrating", - MigrationStatusCompleted = "completed", - MigrationStatusFailed = "failed", -}; - /** * OSInfo 操作系统信息 */ diff --git a/frontend/bindings/voidraft/internal/services/themeservice.ts b/frontend/bindings/voidraft/internal/services/themeservice.ts index e472d72..7f03c00 100644 --- a/frontend/bindings/voidraft/internal/services/themeservice.ts +++ b/frontend/bindings/voidraft/internal/services/themeservice.ts @@ -15,13 +15,13 @@ import {Call as $Call, Create as $Create} from "@wailsio/runtime"; import * as application$0 from "../../../github.com/wailsapp/wails/v3/pkg/application/models.js"; // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore: Unused imports -import * as models$0 from "../models/models.js"; +import * as ent$0 from "../models/ent/models.js"; /** - * GetThemeByName 通过名称获取主题覆盖,若不存在则返回 nil + * GetThemeByKey 根据Key获取主题 */ -export function GetThemeByName(name: string): Promise & { cancel(): void } { - let $resultPromise = $Call.ByID(1938954770, name) as any; +export function GetThemeByKey(key: string): Promise & { cancel(): void } { + let $resultPromise = $Call.ByID(808794256, key) as any; let $typingPromise = $resultPromise.then(($result: any) => { return $$createType1($result); }) as any; @@ -30,18 +30,10 @@ export function GetThemeByName(name: string): Promise & { } /** - * ResetTheme 删除指定主题的覆盖配置 + * ResetTheme 删除主题 */ -export function ResetTheme(name: string): Promise & { cancel(): void } { - let $resultPromise = $Call.ByID(1806334457, name) as any; - return $resultPromise; -} - -/** - * ServiceShutdown 服务关闭 - */ -export function ServiceShutdown(): Promise & { cancel(): void } { - let $resultPromise = $Call.ByID(1676749034) as any; +export function ResetTheme(key: string): Promise & { cancel(): void } { + let $resultPromise = $Call.ByID(1806334457, key) as any; return $resultPromise; } @@ -54,13 +46,13 @@ export function ServiceStartup(options: application$0.ServiceOptions): Promise & { cancel(): void } { - let $resultPromise = $Call.ByID(70189749, name, colors) as any; +export function UpdateTheme(key: string, colors: { [_: string]: any }): Promise & { cancel(): void } { + let $resultPromise = $Call.ByID(70189749, key, colors) as any; return $resultPromise; } // Private type creation functions -const $$createType0 = models$0.Theme.createFrom; +const $$createType0 = ent$0.Theme.createFrom; const $$createType1 = $Create.Nullable($$createType0); diff --git a/frontend/bindings/voidraft/internal/services/trayservice.ts b/frontend/bindings/voidraft/internal/services/trayservice.ts deleted file mode 100644 index b05b8a9..0000000 --- a/frontend/bindings/voidraft/internal/services/trayservice.ts +++ /dev/null @@ -1,59 +0,0 @@ -// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL -// This file is automatically generated. DO NOT EDIT - -/** - * TrayService 系统托盘服务 - * @module - */ - -// eslint-disable-next-line @typescript-eslint/ban-ts-comment -// @ts-ignore: Unused imports -import {Call as $Call, Create as $Create} from "@wailsio/runtime"; - -/** - * AutoShowHide 自动显示/隐藏主窗口 - */ -export function AutoShowHide(): Promise & { cancel(): void } { - let $resultPromise = $Call.ByID(4044219428) as any; - return $resultPromise; -} - -/** - * HandleWindowClose 处理窗口关闭事件 - */ -export function HandleWindowClose(): Promise & { cancel(): void } { - let $resultPromise = $Call.ByID(1824247204) as any; - return $resultPromise; -} - -/** - * HandleWindowMinimize 处理窗口最小化事件 - */ -export function HandleWindowMinimize(): Promise & { cancel(): void } { - let $resultPromise = $Call.ByID(178686624) as any; - return $resultPromise; -} - -/** - * MinimizeButtonClicked 处理标题栏最小化按钮点击 - */ -export function MinimizeButtonClicked(): Promise & { cancel(): void } { - let $resultPromise = $Call.ByID(2477618539) as any; - return $resultPromise; -} - -/** - * ShouldMinimizeToTray 检查是否应该最小化到托盘 - */ -export function ShouldMinimizeToTray(): Promise & { cancel(): void } { - let $resultPromise = $Call.ByID(3403884012) as any; - return $resultPromise; -} - -/** - * ShowWindow 显示主窗口 - */ -export function ShowWindow(): Promise & { cancel(): void } { - let $resultPromise = $Call.ByID(1315913255) as any; - return $resultPromise; -} diff --git a/frontend/src/App.vue b/frontend/src/App.vue index dc5f1a0..039bbe5 100644 --- a/frontend/src/App.vue +++ b/frontend/src/App.vue @@ -19,13 +19,13 @@ onBeforeMount(async () => { // 并行初始化配置、系统信息和快捷键配置 await Promise.all([ configStore.initConfig(), - systemStore.initializeSystemInfo(), + systemStore.initSystemInfo(), keybindingStore.loadKeyBindings(), ]); // 初始化语言和主题 - await configStore.initializeLanguage(); - await themeStore.initializeTheme(); + await configStore.initLanguage(); + await themeStore.initTheme(); await translationStore.loadTranslators(); // 启动时检查更新 diff --git a/frontend/src/common/constant/translation.ts b/frontend/src/common/constant/translation.ts deleted file mode 100644 index 644a657..0000000 --- a/frontend/src/common/constant/translation.ts +++ /dev/null @@ -1,7 +0,0 @@ -/** - * 翻译图标SVG - */ -export const TRANSLATION_ICON_SVG = ` - - -`; \ No newline at end of file diff --git a/frontend/src/common/utils/formatter.ts b/frontend/src/common/utils/formatter.ts new file mode 100644 index 0000000..a5f4150 --- /dev/null +++ b/frontend/src/common/utils/formatter.ts @@ -0,0 +1,65 @@ +/** + * Formatter utility functions + */ + +export interface DateTimeFormatOptions { + locale?: string; + includeTime?: boolean; + hour12?: boolean; +} + +/** + * Format date time string to localized format + * @param dateString - ISO date string or null + * @param options - Formatting options + * @returns Formatted date string or error message + */ +export const formatDateTime = ( + dateString: string | null, + options: DateTimeFormatOptions = {} +): string => { + const { + locale = 'en-US', + includeTime = true, + hour12 = false + } = options; + + if (!dateString) { + return 'Unknown time'; + } + + try { + const date = new Date(dateString); + + if (isNaN(date.getTime())) { + return 'Invalid date'; + } + + const formatOptions: Intl.DateTimeFormatOptions = { + year: 'numeric', + month: '2-digit', + day: '2-digit', + }; + + if (includeTime) { + formatOptions.hour = '2-digit'; + formatOptions.minute = '2-digit'; + formatOptions.hour12 = hour12; + } + + return date.toLocaleString(locale, formatOptions); + } catch { + return 'Time error'; + } +}; + +/** + * Truncate string with ellipsis + * @param str - String to truncate + * @param maxLength - Maximum length before truncation + * @returns Truncated string with ellipsis if needed + */ +export const truncateString = (str: string, maxLength: number): string => { + if (!str) return ''; + return str.length > maxLength ? str.substring(0, maxLength) + '...' : str; +}; diff --git a/frontend/src/common/utils/validation.ts b/frontend/src/common/utils/validation.ts new file mode 100644 index 0000000..bdd08e3 --- /dev/null +++ b/frontend/src/common/utils/validation.ts @@ -0,0 +1,42 @@ +/** + * Validation utility functions + */ + +/** + * Validate document title + * @param title - The title to validate + * @param maxLength - Maximum allowed length (default: 50) + * @returns Error message if invalid, null if valid + */ +export const validateDocumentTitle = (title: string, maxLength: number = 50): string | null => { + const trimmed = title.trim(); + + if (!trimmed) { + return 'Document name cannot be empty'; + } + + if (trimmed.length > maxLength) { + return `Document name cannot exceed ${maxLength} characters`; + } + + return null; +}; + +/** + * Check if a string is empty or whitespace only + * @param value - The string to check + * @returns true if empty or whitespace only + */ +export const isEmpty = (value: string | null | undefined): boolean => { + return !value || value.trim().length === 0; +}; + +/** + * Check if a string exceeds max length + * @param value - The string to check + * @param maxLength - Maximum allowed length + * @returns true if exceeds max length + */ +export const exceedsMaxLength = (value: string, maxLength: number): boolean => { + return value.trim().length > maxLength; +}; diff --git a/frontend/src/components/tabs/TabContextMenu.vue b/frontend/src/components/tabs/TabContextMenu.vue index ed9359b..8b6aee8 100644 --- a/frontend/src/components/tabs/TabContextMenu.vue +++ b/frontend/src/components/tabs/TabContextMenu.vue @@ -1,35 +1,40 @@ \ No newline at end of file + diff --git a/frontend/src/components/titlebar/LinuxTitleBar.vue b/frontend/src/components/titlebar/LinuxTitleBar.vue index 2b8f8b2..dc6174b 100644 --- a/frontend/src/components/titlebar/LinuxTitleBar.vue +++ b/frontend/src/components/titlebar/LinuxTitleBar.vue @@ -1,13 +1,15 @@ @@ -147,11 +110,11 @@ onMounted(async () => { -webkit-user-select: none; width: 100%; font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', system-ui, sans-serif; - + -webkit-context-menu: none; -moz-context-menu: none; context-menu: none; - + &:hover { .titlebar-button { .button-icon { @@ -168,7 +131,7 @@ onMounted(async () => { padding-left: 8px; gap: 8px; flex-shrink: 0; - + -webkit-context-menu: none; -moz-context-menu: none; context-menu: none; @@ -187,7 +150,7 @@ onMounted(async () => { padding: 0; margin: 0; position: relative; - + .button-icon { opacity: 0; transition: opacity 0.2s ease; @@ -198,7 +161,7 @@ onMounted(async () => { height: 100%; color: rgba(0, 0, 0, 0.7); } - + &:hover .button-icon { opacity: 1; } @@ -206,11 +169,11 @@ onMounted(async () => { .close-button { background: #ff5f57; - + &:hover { background: #ff453a; } - + &:active { background: #d7463f; } @@ -218,11 +181,11 @@ onMounted(async () => { .minimize-button { background: #ffbd2e; - + &:hover { background: #ffb524; } - + &:active { background: #e6a220; } @@ -230,11 +193,11 @@ onMounted(async () => { .maximize-button { background: #28ca42; - + &:hover { background: #1ebe36; } - + &:active { background: #1ba932; } @@ -247,7 +210,7 @@ onMounted(async () => { flex: 1; cursor: default; min-width: 0; - + -webkit-context-menu: none; -moz-context-menu: none; context-menu: none; @@ -261,34 +224,32 @@ onMounted(async () => { margin-left: 8px; margin-right: 8px; min-width: 0; - overflow: visible; /* 允许TabContainer内部处理滚动 */ - - /* 确保TabContainer能够正确处理滚动 */ + overflow: visible; + :deep(.tab-container) { width: 100%; height: 100%; } - + :deep(.tab-bar) { width: 100%; height: 100%; } - + :deep(.tab-scroll-wrapper) { overflow-x: auto; overflow-y: hidden; scrollbar-width: none; -ms-overflow-style: none; - + &::-webkit-scrollbar { display: none; } } - - /* 确保底部线条能够正确显示 */ + :deep(.tab-item) { position: relative; - + &::after { content: ''; position: absolute; @@ -319,13 +280,13 @@ onMounted(async () => { background: var(--toolbar-bg, #2d2d2d); border-bottom-color: var(--toolbar-border, rgba(255, 255, 255, 0.1)); } - + .titlebar-title { color: var(--toolbar-text, #fff); } - + .titlebar-button .button-icon { color: rgba(255, 255, 255, 0.8); } } - \ No newline at end of file + diff --git a/frontend/src/components/titlebar/WindowsTitleBar.vue b/frontend/src/components/titlebar/WindowsTitleBar.vue index d5264e3..55cbd75 100644 --- a/frontend/src/components/titlebar/WindowsTitleBar.vue +++ b/frontend/src/components/titlebar/WindowsTitleBar.vue @@ -1,13 +1,15 @@