From ca01808c93236f7f8e0890ce320d4718efff059b Mon Sep 17 00:00:00 2001 From: fofolee Date: Tue, 19 Apr 2022 00:06:22 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=94=B9=E5=85=A8=E5=B1=80=E5=8F=98?= =?UTF-8?q?=E9=87=8F=E5=AD=98=E5=82=A8=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugin/preload.js | 34 ++--- quasar.config.js | 4 +- src/App.vue | 123 ++++++++++++------ src/boot/global.js | 24 ---- src/components/CommandCard.vue | 31 ++--- src/components/CommandEditor.vue | 16 +-- src/components/CommandRunResult.vue | 7 +- src/components/CommandSideBar.vue | 3 +- src/components/ConfigurationMenu.vue | 39 +++--- src/components/popup/CrontabSetting.vue | 12 +- src/components/popup/PanelSetting.vue | 2 +- src/components/quickFeatures/ApiServer.vue | 35 ++--- src/components/quickFeatures/FavFile.vue | 2 +- src/components/quickFeatures/FavUrl.vue | 2 +- .../quickFeatures/PluginNickName.vue | 2 +- src/pages/CommandPage.vue | 2 +- src/pages/ConfigurationPage.vue | 40 +++--- src/pages/ShareCenterPage.vue | 5 +- src/pages/quickFeaturesPage.vue | 6 +- 19 files changed, 209 insertions(+), 180 deletions(-) delete mode 100644 src/boot/global.js diff --git a/plugin/preload.js b/plugin/preload.js index f867bc4..955237a 100644 --- a/plugin/preload.js +++ b/plugin/preload.js @@ -214,22 +214,22 @@ if (process.platform !== 'linux') quickcommand.runInTerminal = function(cmdline, } let getCommandToLaunchTerminal = (cmdline, dir) => { - let cd = '' - if (utools.isWindows()) { - let appPath = path.join(utools.getPath('home'), '/AppData/Local/Microsoft/WindowsApps/') - // 直接 existsSync wt.exe 无效 - if (fs.existsSync(appPath) && fs.readdirSync(appPath).includes('wt.exe')) { - cmdline = cmdline.replace(/"/g, `\\"`) - if (dir) cd = `-d "${dir.replace(/\\/g, '/')}"` - command = `${appPath}wt.exe ${cd} cmd /k "${cmdline}"` + let cd = '' + if (utools.isWindows()) { + let appPath = path.join(utools.getPath('home'), '/AppData/Local/Microsoft/WindowsApps/') + // 直接 existsSync wt.exe 无效 + if (fs.existsSync(appPath) && fs.readdirSync(appPath).includes('wt.exe')) { + cmdline = cmdline.replace(/"/g, `\\"`) + if (dir) cd = `-d "${dir.replace(/\\/g, '/')}"` + command = `${appPath}wt.exe ${cd} cmd /k "${cmdline}"` + } else { + cmdline = cmdline.replace(/"/g, `^"`) + if (dir) cd = `cd /d "${dir.replace(/\\/g, '/')}" &&` + command = `${cd} start "" cmd /k "${cmdline}"` + } } else { - cmdline = cmdline.replace(/"/g, `^"`) - if (dir) cd = `cd /d "${dir.replace(/\\/g, '/')}" &&` - command = `${cd} start "" cmd /k "${cmdline}"` - } - } else { - cmdline = cmdline.replace(/"/g, `\\"`) - if (dir) cd = `cd ${dir.replace(/ /g, `\\\\ `)} &&` + cmdline = cmdline.replace(/"/g, `\\"`) + if (dir) cd = `cd ${dir.replace(/ /g, `\\\\ `)} &&` if (fs.existsSync('/Applications/iTerm.app')) { command = `osascript -e 'tell application "iTerm" create window with default profile @@ -453,7 +453,7 @@ let parseStdout = stdout => stdout.map(x => parseItem(x)).join("\n") // 屏蔽危险函数 window.getuToolsLite = () => { var utoolsLite = Object.assign({}, utools) - if (utools.isDev()) return utoolsLite + // if (utools.isDev()) return utoolsLite // 数据库相关接口 delete utoolsLite.db delete utoolsLite.dbStorage @@ -668,4 +668,4 @@ window.quickcommandHttpServer = () => { run, stop } -} +} \ No newline at end of file diff --git a/quasar.config.js b/quasar.config.js index cf72fcf..bda48b9 100644 --- a/quasar.config.js +++ b/quasar.config.js @@ -28,9 +28,7 @@ module.exports = configure(function(ctx) { // app boot file (/src/boot) // --> boot files are part of "main.js" // https://v2.quasar.dev/quasar-cli-webpack/boot-files - boot: [ - 'global.js' - ], + boot: [], // https://v2.quasar.dev/quasar-cli-webpack/quasar-config-js#Property%3A-css css: [ diff --git a/src/App.vue b/src/App.vue index 12786ba..ce8ada5 100644 --- a/src/App.vue +++ b/src/App.vue @@ -7,12 +7,20 @@