OS/URL/PATH/BUFFER组件调整

This commit is contained in:
fofolee
2025-01-07 19:28:14 +08:00
parent 807da38e2e
commit e23d3e5e11
15 changed files with 902 additions and 2013 deletions

View File

@@ -60,19 +60,7 @@ export const SystemCommandEditor = defineAsyncComponent(() =>
import("components/composer/system/SystemCommandEditor.vue")
);
export const OsEditor = defineAsyncComponent(() =>
import("components/composer/system/OsEditor.vue")
);
export const PathEditor = defineAsyncComponent(() =>
import("components/composer/system/PathEditor.vue")
);
export const ZlibEditor = defineAsyncComponent(() =>
import("src/components/composer/data/ZlibEditor.vue")
);
export const UrlEditor = defineAsyncComponent(() =>
import("components/composer/network/UrlEditor.vue")
);
export const BufferEditor = defineAsyncComponent(() =>
import("src/components/composer/data/BufferEditor.vue")
);

View File

@@ -312,11 +312,355 @@ export const dataCommands = {
saveOutput: true,
},
{
value: "quickcomposer.data.buffer",
value: "quickcomposer.data.buffer.from",
label: "Buffer操作",
desc: "Buffer创建、转换和操作",
component: "BufferEditor",
config: [],
icon: "memory",
functionSelector: [
{
value: "quickcomposer.data.buffer.from",
label: "创建Buffer",
icon: "add_box",
config: [
{
label: "数据",
type: "varInput",
icon: "text_fields",
width: 9,
},
{
label: "编码",
type: "select",
icon: "code",
options: [
{ label: "UTF-8", value: "utf8" },
{ label: "UTF-16LE", value: "utf16le" },
{ label: "Latin1", value: "latin1" },
{ label: "Base64", value: "base64" },
{ label: "Hex", value: "hex" },
{ label: "ASCII", value: "ascii" },
{ label: "Binary", value: "binary" },
{ label: "UCS-2", value: "ucs2" },
],
defaultValue: "utf8",
width: 3,
},
],
},
{
value: "quickcomposer.data.buffer.toString",
label: "转换字符串",
icon: "text_fields",
config: [
{
label: "Buffer",
type: "varInput",
icon: "memory",
width: 12,
},
{
label: "编码",
type: "select",
icon: "code",
options: [
{ label: "UTF-8", value: "utf8" },
{ label: "UTF-16LE", value: "utf16le" },
{ label: "Latin1", value: "latin1" },
{ label: "Base64", value: "base64" },
{ label: "Hex", value: "hex" },
{ label: "ASCII", value: "ascii" },
{ label: "Binary", value: "binary" },
{ label: "UCS-2", value: "ucs2" },
],
defaultValue: "utf8",
width: 4,
},
{
label: "起始位置",
type: "numInput",
icon: "first_page",
width: 4,
},
{
label: "结束位置",
type: "numInput",
icon: "last_page",
width: 4,
},
],
},
{
value: "quickcomposer.data.buffer.write",
label: "写入数据",
icon: "edit",
config: [
{
label: "Buffer",
type: "varInput",
icon: "memory",
width: 6,
},
{
label: "要写入的字符串",
type: "varInput",
icon: "edit",
width: 6,
},
{
label: "偏移量",
type: "numInput",
icon: "first_page",
width: 4,
},
{
label: "长度",
type: "numInput",
icon: "straighten",
width: 4,
},
{
label: "编码",
type: "select",
icon: "code",
options: [
{ label: "UTF-8", value: "utf8" },
{ label: "UTF-16LE", value: "utf16le" },
{ label: "Latin1", value: "latin1" },
{ label: "Base64", value: "base64" },
{ label: "Hex", value: "hex" },
{ label: "ASCII", value: "ascii" },
{ label: "Binary", value: "binary" },
{ label: "UCS-2", value: "ucs2" },
],
defaultValue: "utf8",
width: 4,
},
],
},
{
value: "quickcomposer.data.buffer.fill",
label: "填充数据",
icon: "format_color_fill",
config: [
{
label: "Buffer",
type: "varInput",
icon: "memory",
width: 6,
},
{
label: "填充值",
type: "varInput",
icon: "format_color_fill",
width: 6,
},
{
label: "起始位置",
type: "numInput",
icon: "first_page",
width: 4,
},
{
label: "结束位置",
type: "numInput",
icon: "last_page",
width: 4,
},
{
label: "编码",
type: "select",
icon: "code",
options: [
{ label: "UTF-8", value: "utf8" },
{ label: "UTF-16LE", value: "utf16le" },
{ label: "Latin1", value: "latin1" },
{ label: "Base64", value: "base64" },
{ label: "Hex", value: "hex" },
{ label: "ASCII", value: "ascii" },
{ label: "Binary", value: "binary" },
{ label: "UCS-2", value: "ucs2" },
],
defaultValue: "utf8",
width: 4,
},
],
},
{
value: "quickcomposer.data.buffer.copy",
label: "复制数据",
icon: "content_copy",
config: [
{
label: "源Buffer",
type: "varInput",
icon: "content_copy",
width: 6,
},
{
label: "目标Buffer",
type: "varInput",
icon: "save",
width: 6,
},
{
label: "目标起始位置",
type: "numInput",
icon: "first_page",
width: 4,
},
{
label: "源起始位置",
type: "numInput",
icon: "first_page",
width: 4,
},
{
label: "源结束位置",
type: "numInput",
icon: "last_page",
width: 4,
},
],
},
{
value: "quickcomposer.data.buffer.compare",
label: "比较数据",
icon: "compare",
config: [
{
label: "Buffer 1",
type: "varInput",
icon: "memory",
width: 6,
},
{
label: "Buffer 2",
type: "varInput",
icon: "memory",
width: 6,
},
],
},
{
value: "quickcomposer.data.buffer.concat",
label: "连接Buffer",
icon: "merge",
config: [
{
label: "Buffer列表",
type: "arrayEditor",
icon: "memory",
width: 12,
defaultValue: [
{
value: "",
isString: false,
__varInputVal__: true,
},
],
},
{
label: "总长度(可选)",
type: "numInput",
icon: "straighten",
width: 12,
},
],
},
{
value: "quickcomposer.data.buffer.slice",
label: "切片数据",
icon: "content_cut",
config: [
{
label: "Buffer",
type: "varInput",
icon: "memory",
width: 12,
},
{
label: "起始位置",
type: "numInput",
icon: "first_page",
width: 6,
},
{
label: "结束位置",
type: "numInput",
icon: "last_page",
width: 6,
},
],
},
{
value: "quickcomposer.data.buffer.indexOf",
label: "查找数据",
icon: "search",
config: [
{
label: "Buffer",
type: "varInput",
icon: "memory",
width: 12,
},
{
label: "要查找的值",
type: "varInput",
icon: "search",
width: 4,
},
{
label: "起始位置",
type: "numInput",
icon: "first_page",
width: 4,
},
{
label: "编码",
type: "select",
icon: "code",
options: [
{ label: "UTF-8", value: "utf8" },
{ label: "UTF-16LE", value: "utf16le" },
{ label: "Latin1", value: "latin1" },
{ label: "Base64", value: "base64" },
{ label: "Hex", value: "hex" },
{ label: "ASCII", value: "ascii" },
{ label: "Binary", value: "binary" },
{ label: "UCS-2", value: "ucs2" },
],
defaultValue: "utf8",
width: 4,
},
],
},
{
value: "quickcomposer.data.buffer.swap",
label: "交换字节序",
icon: "swap_horiz",
config: [
{
label: "Buffer",
type: "varInput",
icon: "memory",
width: 9,
},
{
label: "字节大小",
type: "select",
icon: "memory",
options: [
{ label: "16位", value: 16 },
{ label: "32位", value: 32 },
{ label: "64位", value: 64 },
],
defaultValue: 16,
width: 3,
},
],
},
],
},
{
value: "quickcomposer.data.zlib",

View File

@@ -47,11 +47,181 @@ export const networkCommands = {
saveOutput: true,
},
{
value: "quickcomposer.network.url",
value: "quickcomposer.network.url.parse",
label: "URL操作",
desc: "URL解析、格式化和参数处理",
component: "UrlEditor",
icon: "link",
config: [
{
label: "URL",
type: "varInput",
icon: "link",
width: "auto",
},
],
functionSelector: [
{
value: "quickcomposer.network.url.parse",
label: "解析URL",
icon: "link_off",
},
{
value: "quickcomposer.network.url.format",
label: "格式化URL",
icon: "link",
excludeConfig: [0],
config: [
{
label: "协议",
type: "varInput",
icon: "security",
width: 6,
},
{
label: "认证信息",
type: "varInput",
icon: "person",
width: 6,
},
{
label: "主机名",
type: "varInput",
icon: "dns",
width: 6,
},
{
label: "端口",
type: "varInput",
icon: "settings_ethernet",
width: 6,
},
{
label: "路径",
type: "varInput",
icon: "folder",
},
{
label: "查询字符串",
type: "varInput",
icon: "search",
width: 6,
},
{
label: "锚点",
type: "varInput",
icon: "tag",
width: 6,
},
],
},
{
value: "quickcomposer.network.url.parseQuery",
label: "解析查询字符串",
icon: "search",
excludeConfig: [0],
config: [
{
label: "查询字符串",
type: "varInput",
icon: "search",
},
],
},
{
value: "quickcomposer.network.url.formatQuery",
label: "格式化查询字符串",
icon: "edit",
excludeConfig: [0],
config: [
{
label: "参数",
type: "dictEditor",
icon: "edit",
},
],
},
{
value: "quickcomposer.network.url.parsePath",
label: "解析路径",
icon: "folder_open",
excludeConfig: [0],
config: [
{
label: "路径",
type: "varInput",
icon: "folder",
},
],
},
{
value: "quickcomposer.network.url.parseHost",
label: "解析主机名",
icon: "dns",
excludeConfig: [0],
config: [
{
label: "主机名",
type: "varInput",
icon: "dns",
},
],
},
{
value: "quickcomposer.network.url.getQueryParam",
label: "获取参数",
icon: "find_in_page",
config: [
{
label: "参数名",
type: "varInput",
icon: "key",
width: "auto",
},
],
},
{
value: "quickcomposer.network.url.addQueryParam",
label: "添加参数",
icon: "add_circle",
config: [
{
label: "参数名",
type: "varInput",
icon: "key",
width: "auto",
},
{
label: "参数值",
type: "varInput",
icon: "text_fields",
width: "auto",
},
],
},
{
value: "quickcomposer.network.url.removeQueryParam",
label: "移除参数",
icon: "remove_circle",
config: [
{
label: "参数名",
type: "varInput",
icon: "key",
width: "auto",
},
],
},
{
value: "quickcomposer.network.url.isAbsolute",
label: "检查绝对URL",
icon: "check_circle",
},
{
value: "quickcomposer.network.url.parseComponents",
label: "解析组成部分",
icon: "category",
},
],
},
{
value: "quickcomposer.network.dns.lookupHost",

View File

@@ -32,20 +32,252 @@ export const systemCommands = {
isAsync: true,
},
{
value: "quickcomposer.system.os",
value: "quickcomposer.system.os.arch",
label: "系统信息",
desc: "获取操作系统相关信息",
component: "OsEditor",
icon: "computer",
isAsync: true,
config: [],
functionSelector: [
{
value: "quickcomposer.system.os.arch",
label: "系统架构",
icon: "memory",
},
{
value: "quickcomposer.system.os.cpus",
label: "CPU信息",
icon: "developer_board",
config: [
{
label: "信息格式",
type: "buttonGroup",
options: [
{ label: "完整信息", value: "full" },
{ label: "仅型号和速度", value: "simple" },
],
defaultValue: "full",
width: 12,
},
],
},
{
value: "quickcomposer.system.os.memory",
label: "内存信息",
icon: "storage",
config: [
{
label: "内存类型",
type: "buttonGroup",
options: [
{ label: "总内存", value: "totalmem" },
{ label: "空闲内存", value: "freemem" },
],
defaultValue: "totalmem",
width: 12,
},
],
},
{
value: "quickcomposer.system.os.network",
label: "网络信息",
icon: "wifi",
config: [
{
label: "网络信息类型",
type: "buttonGroup",
options: [
{ label: "主机名", value: "hostname" },
{ label: "网络接口", value: "networkInterfaces" },
],
defaultValue: "hostname",
width: 12,
},
{
label: "包含内部接口",
type: "checkbox",
defaultValue: false,
width: 12,
condition: "values[0] === 'networkInterfaces'",
},
],
},
{
value: "quickcomposer.system.os.platform",
label: "平台信息",
icon: "computer",
config: [
{
label: "平台信息类型",
type: "buttonGroup",
options: [
{ label: "操作系统名称", value: "platform" },
{ label: "操作系统类型", value: "type" },
{ label: "操作系统版本", value: "release" },
{ label: "操作系统架构", value: "arch" },
{ label: "CPU字节序", value: "endianness" },
{ label: "系统临时目录", value: "tmpdir" },
{ label: "主目录", value: "homedir" },
{ label: "系统正常运行时间", value: "uptime" },
{ label: "用户信息", value: "userInfo" },
],
defaultValue: "platform",
width: 12,
},
],
},
],
},
{
value: "quickcomposer.system.path",
value: "quickcomposer.system.path.normalize",
label: "路径操作",
desc: "路径操作",
component: "PathEditor",
icon: "folder_path",
isAsync: true,
desc: "路径解析和处理",
icon: "folder",
config: [
{
label: "路径",
type: "varInput",
icon: "folder",
width: "auto",
},
],
functionSelector: [
{
value: "quickcomposer.system.path.normalize",
label: "规范化路径",
icon: "straighten",
},
{
value: "quickcomposer.system.path.parse",
label: "解析路径",
icon: "account_tree",
},
{
value: "quickcomposer.system.path.dirname",
label: "获取目录名",
icon: "folder",
},
{
value: "quickcomposer.system.path.basename",
label: "获取文件名",
icon: "description",
config: [
{
label: "要移除的扩展名",
type: "varInput",
icon: "extension",
width: "auto",
},
],
},
{
value: "quickcomposer.system.path.extname",
label: "获取扩展名",
icon: "extension",
},
{
value: "quickcomposer.system.path.isAbsolute",
label: "判断绝对路径",
icon: "check_circle",
},
{
value: "quickcomposer.system.path.join",
label: "连接路径",
icon: "add_link",
excludeConfig: [0],
config: [
{
label: "路径片段",
type: "varInput",
icon: "folder",
width: "auto",
},
{
label: "路径片段",
type: "varInput",
icon: "folder",
width: "auto",
},
],
},
{
value: "quickcomposer.system.path.resolve",
label: "解析绝对路径",
icon: "assistant_direction",
excludeConfig: [0],
config: [
{
label: "路径片段",
type: "varInput",
icon: "folder",
width: "auto",
},
{
label: "路径片段",
type: "varInput",
icon: "folder",
width: "auto",
},
],
},
{
value: "quickcomposer.system.path.relative",
label: "计算相对路径",
icon: "compare_arrows",
excludeConfig: [0],
config: [
{
label: "起始路径",
type: "varInput",
icon: "folder",
width: 6,
},
{
label: "目标路径",
type: "varInput",
icon: "folder",
width: 6,
},
],
},
{
value: "quickcomposer.system.path.format",
label: "格式化路径",
icon: "format_shapes",
excludeConfig: [0],
config: [
{
label: "根路径",
type: "varInput",
icon: "folder",
width: 6,
},
{
label: "目录",
type: "varInput",
icon: "folder",
width: 6,
},
{
label: "基本名称",
type: "varInput",
icon: "description",
width: 6,
},
{
label: "文件名",
type: "varInput",
icon: "insert_drive_file",
width: 6,
},
{
label: "扩展名",
type: "varInput",
icon: "extension",
width: 6,
},
],
},
],
},
],
};