编排配置文件优化

This commit is contained in:
fofolee
2024-12-30 09:16:12 +08:00
parent c94256c14d
commit dfc1c7e2e3
13 changed files with 342 additions and 209 deletions

View File

@@ -0,0 +1,84 @@
export const encodeCommands = {
label: "编码解码",
icon: "code",
commands: [
{
value: "(text=>Buffer.from(text).toString('base64'))",
label: "Base64编码",
config: [
{
key: "text",
label: "要编码的文本",
type: "input",
defaultValue: "",
icon: "lock",
},
],
},
{
value: "(text=>Buffer.from(text,'base64').toString())",
label: "Base64解码",
config: [
{
key: "text",
label: "要解码的Base64文本",
type: "input",
defaultValue: "",
icon: "lock_open",
},
],
},
{
value: "(text=>Buffer.from(text).toString('hex'))",
label: "十六进制编码",
config: [
{
key: "text",
label: "要编码的文本",
type: "input",
defaultValue: "",
icon: "lock",
},
],
},
{
value: "(text=>Buffer.from(text,'hex').toString())",
label: "十六进制解码",
config: [
{
key: "text",
label: "要解码的十六进制文本",
type: "input",
defaultValue: "",
icon: "lock_open",
},
],
},
{
value: "encodeURIComponent",
label: "URL编码",
config: [
{
key: "text",
label: "要编码的文本",
type: "input",
defaultValue: "",
icon: "link",
},
],
},
{
value: "decodeURIComponent",
label: "URL解码",
config: [
{
key: "text",
label: "要解码的URL编码文本",
type: "input",
defaultValue: "",
icon: "link_off",
},
],
},
],
};

View File

@@ -0,0 +1,32 @@
export const fileCommands = {
label: "文件操作",
icon: "folder",
commands: [
{
value: "open",
label: "打开文件/文件夹/软件",
config: [
{
key: "path",
label: "文件、文件夹或软件的绝对路径",
type: "input",
defaultValue: "",
icon: "folder_open",
},
],
},
{
value: "locate",
label: "在文件管理器中定位文件",
config: [
{
key: "path",
label: "文件、文件夹或软件的绝对路径",
type: "input",
defaultValue: "",
icon: "location_on",
},
],
},
],
};

View File

@@ -0,0 +1,17 @@
import { fileCommands } from "./fileCommands";
import { networkCommands } from "./networkCommands";
import { systemCommands } from "./systemCommands";
import { notifyCommands } from "./notifyCommands";
import { encodeCommands } from "./encodeCommands";
import { otherCommands } from "./otherCommands";
import { keyCommands } from "./keyCommands";
export const commandCategories = [
fileCommands,
networkCommands,
systemCommands,
notifyCommands,
encodeCommands,
otherCommands,
keyCommands,
];

View File

@@ -0,0 +1,12 @@
export const keyCommands = {
label: "按键操作",
icon: "keyboard",
commands: [
{
value: "keyTap",
label: "模拟按键",
config: [],
component: "KeyEditor",
},
],
};

View File

@@ -0,0 +1,49 @@
export const networkCommands = {
label: "网络操作",
icon: "language",
commands: [
{
value: "visit",
label: "用默认浏览器打开网址",
config: [
{
key: "url",
label: "要访问的网址链接",
type: "input",
defaultValue: "",
icon: "language",
},
],
},
{
value: "utools.ubrowser.goto",
label: "用ubrowser打开网址",
config: [
{
key: "url",
label: "要访问的网址链接",
type: "input",
defaultValue: "",
icon: "public",
},
],
isAsync: true,
},
{
value: "ubrowser",
label: "ubrowser浏览器操作",
config: [],
component: "UBrowserEditor",
isAsync: true,
icon: "public",
},
{
value: "axios",
label: "HTTP请求(Axios)",
config: [],
component: "AxiosConfigEditor",
isAsync: true,
icon: "http",
},
],
};

View File

@@ -0,0 +1,45 @@
export const notifyCommands = {
label: "消息通知",
icon: "notifications",
commands: [
{
value: "console.log",
label: "打印消息",
config: [
{
key: "message",
label: "要打印的消息文本",
type: "input",
defaultValue: "",
icon: "info",
},
],
},
{
value: "message",
label: "发送系统消息",
config: [
{
key: "message",
label: "要发送的系统消息文本",
type: "input",
defaultValue: "",
icon: "message",
},
],
},
{
value: "send",
label: "发送文本到活动窗口",
config: [
{
key: "text",
label: "要发送到窗口的文本内容",
type: "input",
defaultValue: "",
icon: "send",
},
],
},
],
};

View File

@@ -0,0 +1,33 @@
export const otherCommands = {
label: "其他功能",
icon: "more_horiz",
commands: [
{
value: "utools.redirect",
label: "转至指定插件",
config: [
{
key: "pluginName",
label: "要跳转至的插件名称",
type: "input",
defaultValue: "",
icon: "alt_route",
},
],
},
{
value: "quickcommand.sleep",
label: "添加延时",
config: [
{
key: "ms",
label: "延迟的毫秒数",
type: "input",
inputType: "number",
defaultValue: "",
icon: "schedule",
},
],
},
],
};

View File

@@ -0,0 +1,38 @@
export const systemCommands = {
label: "系统操作",
icon: "computer",
commands: [
{
value: "system",
label: "执行系统命令",
config: [
{
key: "command",
label: "要执行的命令行",
type: "input",
defaultValue: "",
icon: "terminal",
},
],
},
{
value: "copyTo",
label: "将内容写入剪贴板",
config: [
{
key: "content",
label: "要写入剪切板的内容",
type: "input",
defaultValue: "",
icon: "content_copy",
},
],
},
{
value: "electron.clipboard.readText",
label: "获取剪贴板内容",
config: [],
icon: "content_copy",
},
],
};