From 4f859a49338a4fda86ad85c438b95738a67e3249 Mon Sep 17 00:00:00 2001 From: Jasery Date: Mon, 27 Oct 2025 18:19:39 +0800 Subject: [PATCH] feat: add @mdi/font and electron-devtools-installer dependencies - Added @mdi/font for Material Design Icons support. - Included electron-devtools-installer to facilitate Vue DevTools installation in development. refactor: enhance CreateTemplateScreen layout and functionality - Improved layout with a responsive design. - Added functionality for adding directories and files with validation. - Implemented a file content editor dialog for editing file contents. - Updated template save logic to handle changes more effectively. fix: update TemplateListScreen for better UX - Enhanced template list display with improved card layout. - Added action buttons for viewing, executing, editing, and deleting templates. - Improved dialog handling for template details and execution. chore: update vuetify plugin configuration - Removed unused icon set configuration. - Updated locale settings to use simplified Chinese. style: clean up HeaderLayout and vuetify styles - Removed commented-out code and unnecessary styles. - Improved overall styling for better readability and consistency. --- .vscode/settings.json | 5 +- package.json | 2 + pnpm-lock.yaml | 40 +- src/main/index.ts | 12 + .../components/layout/HeaderLayout.vue | 34 +- src/renderer/plugins/vuetify.ts | 21 +- src/renderer/screens/CreateTemplateScreen.vue | 715 ++++++++++++------ src/renderer/screens/TemplateListScreen.vue | 218 +++--- 8 files changed, 653 insertions(+), 394 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index e546dd2..225277b 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -21,5 +21,8 @@ "*.mjs": "javascript", "*.cjs": "javascript", "*.mts": "typescript" - } + }, + "i18n-ally.localesPaths": [ + "src/renderer/locales" + ] } diff --git a/package.json b/package.json index 960cef4..38affac 100644 --- a/package.json +++ b/package.json @@ -42,6 +42,7 @@ "node": ">=20.0.0" }, "dependencies": { + "@mdi/font": "^7.4.47", "electron-log": "^5.4.3", "fs-extra": "^11.3.2", "pinia": "^3.0.3", @@ -61,6 +62,7 @@ "dotenv": "^17.2.3", "electron": "^38.3.0", "electron-builder": "^26.0.14", + "electron-devtools-installer": "^4.0.0", "electron-extension-installer": "^2.0.0", "eslint": "^9.37.0", "eslint-config-prettier": "^10.1.8", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 817c9c1..5a65942 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -8,6 +8,9 @@ importers: .: dependencies: + '@mdi/font': + specifier: ^7.4.47 + version: 7.4.47 electron-log: specifier: ^5.4.3 version: 5.4.3 @@ -60,6 +63,9 @@ importers: electron-builder: specifier: ^26.0.14 version: 26.0.15(electron-builder-squirrel-windows@26.0.15) + electron-devtools-installer: + specifier: ^4.0.0 + version: 4.0.0 electron-extension-installer: specifier: ^2.0.0 version: 2.0.0(electron@38.3.0) @@ -280,8 +286,8 @@ packages: resolution: {integrity: sha512-Qkzpg2s9GnVV2I2BjRksUi43U5e6+zaQMcjoJy0C+C5oxaKl+fmckGDQFtRpZpZV0NQekuZZ+tGz7EA9TVnQtQ==} engines: {node: '>=12'} - '@electron/node-gyp@https://codeload.github.com/electron/node-gyp/tar.gz/06b29aafb7708acef8b3669835c8a7857ebc92d2': - resolution: {tarball: https://codeload.github.com/electron/node-gyp/tar.gz/06b29aafb7708acef8b3669835c8a7857ebc92d2} + '@electron/node-gyp@git+https://git@github.com:electron/node-gyp.git#06b29aafb7708acef8b3669835c8a7857ebc92d2': + resolution: {commit: 06b29aafb7708acef8b3669835c8a7857ebc92d2, repo: git@github.com:electron/node-gyp.git, type: git} version: 10.2.0-electron.1 engines: {node: '>=12.13.0'} hasBin: true @@ -569,6 +575,9 @@ packages: resolution: {integrity: sha512-9QOtNffcOF/c1seMCDnjckb3R9WHcG34tky+FHpNKKCW0wc/scYLwMtO+ptyGUfMW0/b/n4qRiALlaFHc9Oj7Q==} engines: {node: '>= 10.0.0'} + '@mdi/font@7.4.47': + resolution: {integrity: sha512-43MtGpd585SNzHZPcYowu/84Vz2a2g31TvPMTm9uTiCSWzaheQySUcSyUH/46fPnuPQWof2yd0pGBtzee/IQWw==} + '@mdi/js@7.4.47': resolution: {integrity: sha512-KPnNOtm5i2pMabqZxpUz7iQf+mfrYZyKCZ8QNz85czgEt7cuHcGorWfdzUMWYA0SD+a6Hn4FmJ+YhzzzjkTZrQ==} @@ -1387,6 +1396,9 @@ packages: engines: {node: '>=14.0.0'} hasBin: true + electron-devtools-installer@4.0.0: + resolution: {integrity: sha512-9Tntu/jtfSn0n6N/ZI6IdvRqXpDyLQiDuuIbsBI+dL+1Ef7C8J2JwByw58P3TJiNeuqyV3ZkphpNWuZK5iSY2w==} + electron-extension-installer@2.0.0: resolution: {integrity: sha512-dneHKI4zcKRiYJbdO/KP3XxzptlhUqQ/9h4WvIIg4I21rRKr7ZysoRU1vVd7Rgf695Rb5MUJXBwCY2dQm6qHQw==} peerDependencies: @@ -2945,6 +2957,9 @@ packages: resolution: {integrity: sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==} engines: {node: '>= 10.0.0'} + unzip-crx-3@0.2.0: + resolution: {integrity: sha512-0+JiUq/z7faJ6oifVB5nSwt589v1KCduqIJupNVDoWSXZtWDmjDGO3RAEOvwJ07w90aoXoP4enKsR7ecMrJtWQ==} + upath@2.0.1: resolution: {integrity: sha512-1uEe95xksV1O0CYKXo8vQvN1JEbtJp7lb7C5U9HMsIp6IVwntkH/oNUzyVNQSd4S1sYk2FpSSW44FqMc8qee5w==} engines: {node: '>=4'} @@ -3133,6 +3148,9 @@ packages: resolution: {integrity: sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==} engines: {node: '>=10'} + yaku@0.16.7: + resolution: {integrity: sha512-Syu3IB3rZvKvYk7yTiyl1bo/jiEFaaStrgv1V2TIJTqYPStSMQVO8EQjg/z+DRzLq/4LIIharNT3iH1hylEIRw==} + yallist@3.1.1: resolution: {integrity: sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==} @@ -3385,7 +3403,7 @@ snapshots: transitivePeerDependencies: - supports-color - '@electron/node-gyp@https://codeload.github.com/electron/node-gyp/tar.gz/06b29aafb7708acef8b3669835c8a7857ebc92d2': + '@electron/node-gyp@git+https://git@github.com:electron/node-gyp.git#06b29aafb7708acef8b3669835c8a7857ebc92d2': dependencies: env-paths: 2.2.1 exponential-backoff: 3.1.2 @@ -3422,7 +3440,7 @@ snapshots: '@electron/rebuild@3.7.2': dependencies: - '@electron/node-gyp': https://codeload.github.com/electron/node-gyp/tar.gz/06b29aafb7708acef8b3669835c8a7857ebc92d2 + '@electron/node-gyp': git+https://git@github.com:electron/node-gyp.git#06b29aafb7708acef8b3669835c8a7857ebc92d2 '@malept/cross-spawn-promise': 2.0.0 chalk: 4.1.2 debug: 4.4.0 @@ -3659,6 +3677,8 @@ snapshots: transitivePeerDependencies: - supports-color + '@mdi/font@7.4.47': {} + '@mdi/js@7.4.47': {} '@nodelib/fs.scandir@2.1.5': @@ -4642,6 +4662,10 @@ snapshots: - electron-builder-squirrel-windows - supports-color + electron-devtools-installer@4.0.0: + dependencies: + unzip-crx-3: 0.2.0 + electron-extension-installer@2.0.0(electron@38.3.0): dependencies: electron: 38.3.0 @@ -6481,6 +6505,12 @@ snapshots: universalify@2.0.1: {} + unzip-crx-3@0.2.0: + dependencies: + jszip: 3.10.1 + mkdirp: 0.5.6 + yaku: 0.16.7 + upath@2.0.1: {} update-browserslist-db@1.1.3(browserslist@4.24.5): @@ -6662,6 +6692,8 @@ snapshots: y18n@5.0.8: {} + yaku@0.16.7: {} + yallist@3.1.1: {} yallist@4.0.0: {} diff --git a/src/main/index.ts b/src/main/index.ts index ed7403c..4ea3068 100644 --- a/src/main/index.ts +++ b/src/main/index.ts @@ -28,6 +28,18 @@ const initializeMainLogger = () => { app.on('ready', async () => { if (Constants.IS_DEV_ENV) { import('./index.dev') + + // Install Vue DevTools + try { + const { default: installExtension, VUEJS_DEVTOOLS } = await import('electron-devtools-installer') + await installExtension(VUEJS_DEVTOOLS, { + loadExtensionOptions: { + allowFileAccess: true, + }, + }) + } catch (err) { + console.log('Failed to install Vue DevTools: ', err) + } } // Disable special menus on macOS by uncommenting the following, if necessary diff --git a/src/renderer/components/layout/HeaderLayout.vue b/src/renderer/components/layout/HeaderLayout.vue index 482f561..7118a20 100644 --- a/src/renderer/components/layout/HeaderLayout.vue +++ b/src/renderer/components/layout/HeaderLayout.vue @@ -22,25 +22,22 @@ const headerMenus: { text: string path: string }[] = [ - { - icon: mdiHome, - text: 'title.main', - path: '/' - }, - { - icon: mdiFitToScreenOutline, - text: 'title.second', - path: '/second' - } -] + { + icon: mdiHome, + text: 'title.main', + path: '/' + }, + { + icon: mdiFitToScreenOutline, + text: 'title.second', + path: '/second' + } + ]