可视化编排添加文本处理,添加堆成和非对称加解密

This commit is contained in:
fofolee
2024-12-30 18:37:42 +08:00
parent 97a0ce2f99
commit 5e2994fe6d
15 changed files with 2127 additions and 94 deletions

View File

@@ -1,85 +0,0 @@
export const encodeCommands = {
label: "编码解码",
icon: "code",
defaultOpened: false,
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

@@ -2,7 +2,7 @@ import { fileCommands } from "./fileCommands";
import { networkCommands } from "./networkCommands";
import { systemCommands } from "./systemCommands";
import { notifyCommands } from "./notifyCommands";
import { encodeCommands } from "./encodeCommands";
import { textProcessingCommands } from "./textProcessingCommands";
import { otherCommands } from "./otherCommands";
import { keyCommands } from "./keyCommands";
@@ -11,7 +11,7 @@ export const commandCategories = [
networkCommands,
systemCommands,
notifyCommands,
encodeCommands,
textProcessingCommands,
otherCommands,
keyCommands,
];

View File

@@ -0,0 +1,249 @@
export const textProcessingCommands = {
label: "文本处理",
icon: "code",
defaultOpened: false,
commands: [
{
value: "quickcomposer.textProcessing.base64Encode",
label: "Base64编码",
config: [
{
key: "text",
label: "要编码的文本",
type: "input",
defaultValue: "",
icon: "lock",
},
],
},
{
value: "quickcomposer.textProcessing.base64Decode",
label: "Base64解码",
config: [
{
key: "text",
label: "要解码的Base64文本",
type: "input",
defaultValue: "",
icon: "lock_open",
},
],
},
{
value: "quickcomposer.textProcessing.hexEncode",
label: "十六进制编码",
config: [
{
key: "text",
label: "要编码的文本",
type: "input",
defaultValue: "",
icon: "lock",
},
],
},
{
value: "quickcomposer.textProcessing.hexDecode",
label: "十六进制解码",
config: [
{
key: "text",
label: "要解码的十六进制文本",
type: "input",
defaultValue: "",
icon: "lock_open",
},
],
},
{
value: "quickcomposer.textProcessing.urlEncode",
label: "URL编码",
config: [
{
key: "text",
label: "要编码的文本",
type: "input",
defaultValue: "",
icon: "link",
},
],
},
{
value: "quickcomposer.textProcessing.urlDecode",
label: "URL解码",
config: [
{
key: "text",
label: "要解码的URL编码文本",
type: "input",
defaultValue: "",
icon: "link_off",
},
],
},
{
value: "quickcomposer.textProcessing.htmlEncode",
label: "HTML编码",
config: [
{
key: "text",
label: "要编码的文本",
type: "input",
defaultValue: "",
icon: "code",
},
],
},
{
value: "quickcomposer.textProcessing.htmlDecode",
label: "HTML解码",
config: [
{
key: "text",
label: "要解码的HTML文本",
type: "input",
defaultValue: "",
icon: "code_off",
},
],
},
{
value: "quickcomposer.textProcessing.reverseString",
label: "字符串反转",
config: [
{
key: "text",
label: "要反转的文本",
type: "input",
defaultValue: "",
icon: "swap_horiz",
},
],
},
{
value: "quickcomposer.textProcessing.replaceString",
label: "字符串替换",
config: [
{
key: "text",
label: "原始文本",
type: "input",
defaultValue: "",
icon: "text_fields",
},
{
key: "oldStr",
label: "要替换的文本",
type: "input",
defaultValue: "",
icon: "find_replace",
},
{
key: "newStr",
label: "替换为",
type: "input",
defaultValue: "",
icon: "text_fields",
},
],
},
{
value: "quickcomposer.textProcessing.substring",
label: "字符串截取",
config: [
{
key: "text",
label: "原始文本",
type: "input",
defaultValue: "",
icon: "text_fields",
},
{
key: "start",
label: "起始位置",
type: "input",
inputType: "number",
defaultValue: "0",
icon: "first_page",
},
{
key: "end",
label: "结束位置",
type: "input",
inputType: "number",
defaultValue: "",
icon: "last_page",
},
],
},
{
value: "quickcomposer.textProcessing.regexExtract",
label: "正则提取",
config: [
{
key: "text",
label: "原始文本",
type: "input",
defaultValue: "",
icon: "text_fields",
},
{
key: "regex",
label: "正则表达式",
type: "input",
defaultValue: "",
icon: "regex",
},
],
},
{
value: "quickcomposer.textProcessing.symmetricCrypto",
label: "对称加解密",
component: "SymmetricCryptoEditor",
},
{
value: "quickcomposer.textProcessing.asymmetricCrypto",
label: "非对称加解密",
component: "AsymmetricCryptoEditor",
},
{
value: "quickcomposer.textProcessing.md5Hash",
label: "MD5哈希",
config: [
{
key: "text",
label: "要哈希的文本",
type: "input",
defaultValue: "",
icon: "enhanced_encryption",
},
],
},
{
value: "quickcomposer.textProcessing.sha256Hash",
label: "SHA256哈希",
config: [
{
key: "text",
label: "要哈希的文本",
type: "input",
defaultValue: "",
icon: "enhanced_encryption",
},
],
},
{
value: "quickcomposer.textProcessing.sm3Hash",
label: "SM3哈希",
config: [
{
key: "text",
label: "要哈希的文本",
type: "input",
defaultValue: "",
icon: "enhanced_encryption",
},
],
},
],
};