From 76f710323e353603a6f14f8d56e895d1dd3d7505 Mon Sep 17 00:00:00 2001 From: fofolee Date: Fri, 17 Jan 2025 21:22:21 +0800 Subject: [PATCH] =?UTF-8?q?=E9=85=8D=E7=BD=AE=E6=96=87=E4=BB=B6=E5=BE=AE?= =?UTF-8?q?=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/js/composer/commands/fileCommands.js | 2 +- src/js/composer/commands/index.js | 27 +++++++++------------ src/js/composer/commands/networkCommands.js | 2 +- 3 files changed, 14 insertions(+), 17 deletions(-) diff --git a/src/js/composer/commands/fileCommands.js b/src/js/composer/commands/fileCommands.js index d4659f8..bd43b78 100644 --- a/src/js/composer/commands/fileCommands.js +++ b/src/js/composer/commands/fileCommands.js @@ -1,7 +1,7 @@ export const fileCommands = { label: "文件操作", icon: "folder_open", - defaultOpened: true, + defaultOpened: false, commands: [ { value: "quickcomposer.file.operation", diff --git a/src/js/composer/commands/index.js b/src/js/composer/commands/index.js index 05fe320..f2c510c 100644 --- a/src/js/composer/commands/index.js +++ b/src/js/composer/commands/index.js @@ -18,34 +18,31 @@ import { windowsCommands } from "./windowsCommands"; import { statusCommands } from "./statusCommands"; import { macosCommands } from "./macosCommands"; import { scriptCommands } from "./scriptCommands"; -let commands = [ + +const platformCommands = { + win32: [windowsCommands], + darwin: [macosCommands], + linux: [], +}; + +export const commandCategories = [ fileCommands, networkCommands, systemCommands, - statusCommands, audioCommands, imageCommands, - notifyCommands, utoolsCommands, + ...platformCommands[window.processPlatform], dataCommands, codingCommands, controlCommands, scriptCommands, uiCommands, simulateCommands, + statusCommands, mathCommands, userdataCommands, screenCommands, + notifyCommands, + otherCommands, ]; - -if (window.utools.isWindows()) { - commands.push(windowsCommands); -} - -if (window.utools.isMacOS()) { - commands.push(macosCommands); -} - -commands.push(otherCommands); - -export const commandCategories = commands; diff --git a/src/js/composer/commands/networkCommands.js b/src/js/composer/commands/networkCommands.js index c26995e..cec7c32 100644 --- a/src/js/composer/commands/networkCommands.js +++ b/src/js/composer/commands/networkCommands.js @@ -3,7 +3,7 @@ import { newVarInputVal } from "../varInputValManager"; export const networkCommands = { label: "网络操作", icon: "language", - defaultOpened: true, + defaultOpened: false, commands: [ { value: "utools.shellOpenExternal",