mirror of
https://github.com/fofolee/uTools-quickcommand.git
synced 2025-06-28 11:52:46 +08:00
编排分类调整
This commit is contained in:
parent
a6cc1c8737
commit
296c231c44
@ -1,10 +1,9 @@
|
||||
const quickcomposer = {
|
||||
text: require("./quickcomposer/text"),
|
||||
data: require("./quickcomposer/data"),
|
||||
simulate: require("./quickcomposer/simulate"),
|
||||
file: require("./quickcomposer/file"),
|
||||
system: require("./quickcomposer/system"),
|
||||
network: require("./quickcomposer/network"),
|
||||
developer: require("./quickcomposer/developer"),
|
||||
};
|
||||
|
||||
module.exports = quickcomposer;
|
||||
|
@ -2,10 +2,14 @@ const encoder = require("./encoder");
|
||||
const hash = require("./hash");
|
||||
const string = require("./string");
|
||||
const crypto = require("./crypto");
|
||||
const buffer = require("./buffer");
|
||||
const zlib = require("./zlib");
|
||||
|
||||
module.exports = {
|
||||
...encoder,
|
||||
...hash,
|
||||
...string,
|
||||
...crypto,
|
||||
buffer,
|
||||
zlib,
|
||||
};
|
@ -1,3 +0,0 @@
|
||||
module.exports = {
|
||||
buffer: require("./buffer"),
|
||||
};
|
@ -1,7 +1,5 @@
|
||||
const operation = require("./operation");
|
||||
const zlib = require("./zlib");
|
||||
|
||||
module.exports = {
|
||||
operation: operation.operation,
|
||||
zlib: zlib,
|
||||
};
|
||||
|
@ -1,75 +0,0 @@
|
||||
const zlib = require("zlib");
|
||||
const { promisify } = require("util");
|
||||
|
||||
// 压缩方法
|
||||
const gzip = promisify(zlib.gzip);
|
||||
const deflate = promisify(zlib.deflate);
|
||||
const brotliCompress = promisify(zlib.brotliCompress);
|
||||
|
||||
// 解压方法
|
||||
const gunzip = promisify(zlib.gunzip);
|
||||
const inflate = promisify(zlib.inflate);
|
||||
const brotliDecompress = promisify(zlib.brotliDecompress);
|
||||
|
||||
// 压缩选项
|
||||
const defaultGzipOptions = {
|
||||
level: zlib.constants.Z_DEFAULT_COMPRESSION,
|
||||
memLevel: zlib.constants.Z_DEFAULT_MEMLEVEL,
|
||||
strategy: zlib.constants.Z_DEFAULT_STRATEGY,
|
||||
};
|
||||
|
||||
const defaultBrotliOptions = {
|
||||
params: {
|
||||
[zlib.constants.BROTLI_PARAM_MODE]: zlib.constants.BROTLI_MODE_GENERIC,
|
||||
[zlib.constants.BROTLI_PARAM_QUALITY]:
|
||||
zlib.constants.BROTLI_DEFAULT_QUALITY,
|
||||
[zlib.constants.BROTLI_PARAM_SIZE_HINT]: 0,
|
||||
},
|
||||
};
|
||||
|
||||
// 异步压缩函数
|
||||
async function compressData(data, method, options = {}) {
|
||||
try {
|
||||
const buffer = Buffer.from(data);
|
||||
switch (method) {
|
||||
case "gzip":
|
||||
return await gzip(buffer, { ...defaultGzipOptions, ...options });
|
||||
case "deflate":
|
||||
return await deflate(buffer, { ...defaultGzipOptions, ...options });
|
||||
case "brotli":
|
||||
return await brotliCompress(buffer, {
|
||||
...defaultBrotliOptions,
|
||||
...options,
|
||||
});
|
||||
default:
|
||||
throw new Error("不支持的压缩方法");
|
||||
}
|
||||
} catch (error) {
|
||||
throw new Error(`压缩失败: ${error.message}`);
|
||||
}
|
||||
}
|
||||
|
||||
// 异步解压函数
|
||||
async function decompressData(data, method, options = {}) {
|
||||
try {
|
||||
const buffer = Buffer.from(data);
|
||||
switch (method) {
|
||||
case "gzip":
|
||||
return await gunzip(buffer, options);
|
||||
case "deflate":
|
||||
return await inflate(buffer, options);
|
||||
case "brotli":
|
||||
return await brotliDecompress(buffer, options);
|
||||
default:
|
||||
throw new Error("不支持的解压方法");
|
||||
}
|
||||
} catch (error) {
|
||||
throw new Error(`解压失败: ${error.message}`);
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
compressData,
|
||||
decompressData,
|
||||
constants: zlib.constants,
|
||||
};
|
@ -1 +0,0 @@
|
||||
module.exports = require("../file/zlib");
|
@ -67,9 +67,9 @@
|
||||
<script>
|
||||
import { defineComponent, inject } from "vue";
|
||||
import { validateVariableName } from "js/common/variableValidator";
|
||||
import VariableInput from "./ui/VariableInput.vue";
|
||||
import MultiParams from "./ui/MultiParams.vue";
|
||||
import CommandHead from "./card/CommandHead.vue";
|
||||
import VariableInput from "components/composer/ui/VariableInput.vue";
|
||||
import MultiParams from "components/composer/MultiParams.vue";
|
||||
import CommandHead from "components/composer/card/CommandHead.vue";
|
||||
import * as CardComponents from "js/composer/cardComponents";
|
||||
|
||||
export default defineComponent({
|
||||
|
@ -52,8 +52,8 @@
|
||||
|
||||
<script>
|
||||
import { defineComponent } from "vue";
|
||||
import VariableInput from "./VariableInput.vue";
|
||||
import NumberInput from "./NumberInput.vue";
|
||||
import VariableInput from "components/composer/ui/VariableInput.vue";
|
||||
import NumberInput from "components/composer/ui/NumberInput.vue";
|
||||
import { stringifyWithType, parseToHasType } from "js/composer/formatString";
|
||||
|
||||
export default defineComponent({
|
@ -93,7 +93,7 @@
|
||||
|
||||
<script>
|
||||
import { defineComponent } from "vue";
|
||||
import VariableInput from "../ui/VariableInput.vue";
|
||||
import VariableInput from "components/composer/ui/VariableInput.vue";
|
||||
import RegexInput from "./RegexInput.vue";
|
||||
import RegexBuilder from "./RegexBuilder.vue";
|
||||
import RegexTester from "./RegexTester.vue";
|
@ -28,7 +28,6 @@
|
||||
label="主机名"
|
||||
icon="dns"
|
||||
class="col"
|
||||
v-if="needsHostname"
|
||||
/>
|
||||
|
||||
<!-- IP地址输入 -->
|
||||
|
@ -2,7 +2,7 @@ import { defineAsyncComponent } from "vue";
|
||||
|
||||
// UI Components
|
||||
export const KeyEditor = defineAsyncComponent(() =>
|
||||
import("components/composer/ui/KeyEditor.vue")
|
||||
import("src/components/composer/simulate/KeyEditor.vue")
|
||||
);
|
||||
export const ImageSearchEditor = defineAsyncComponent(() =>
|
||||
import("components/composer/simulate/ImageSearchEditor.vue")
|
||||
@ -36,18 +36,18 @@ export const UBrowserEditor = defineAsyncComponent(() =>
|
||||
import("components/composer/ubrowser/UBrowserEditor.vue")
|
||||
);
|
||||
export const AxiosConfigEditor = defineAsyncComponent(() =>
|
||||
import("components/composer/http/AxiosConfigEditor.vue")
|
||||
import("src/components/composer/network/AxiosConfigEditor.vue")
|
||||
);
|
||||
export const RegexEditor = defineAsyncComponent(() =>
|
||||
import("components/composer/regex/RegexEditor.vue")
|
||||
import("components/composer/data/regex/RegexEditor.vue")
|
||||
);
|
||||
|
||||
// Crypto Components
|
||||
export const SymmetricCryptoEditor = defineAsyncComponent(() =>
|
||||
import("components/composer/crypto/SymmetricCryptoEditor.vue")
|
||||
import("src/components/composer/data/SymmetricCryptoEditor.vue")
|
||||
);
|
||||
export const AsymmetricCryptoEditor = defineAsyncComponent(() =>
|
||||
import("components/composer/crypto/AsymmetricCryptoEditor.vue")
|
||||
import("src/components/composer/data/AsymmetricCryptoEditor.vue")
|
||||
);
|
||||
|
||||
// File Components
|
||||
@ -68,7 +68,7 @@ export const PathEditor = defineAsyncComponent(() =>
|
||||
import("components/composer/system/PathEditor.vue")
|
||||
);
|
||||
export const ZlibEditor = defineAsyncComponent(() =>
|
||||
import("components/composer/file/ZlibEditor.vue")
|
||||
import("src/components/composer/data/ZlibEditor.vue")
|
||||
);
|
||||
export const UrlEditor = defineAsyncComponent(() =>
|
||||
import("components/composer/network/UrlEditor.vue")
|
||||
@ -77,5 +77,5 @@ export const DnsEditor = defineAsyncComponent(() =>
|
||||
import("components/composer/network/DnsEditor.vue")
|
||||
);
|
||||
export const BufferEditor = defineAsyncComponent(() =>
|
||||
import("components/composer/developer/BufferEditor.vue")
|
||||
import("src/components/composer/data/BufferEditor.vue")
|
||||
);
|
||||
|
@ -1,10 +1,10 @@
|
||||
export const textCommands = {
|
||||
label: "文本处理",
|
||||
icon: "code",
|
||||
export const dataCommands = {
|
||||
label: "数据处理",
|
||||
icon: "auto_graph",
|
||||
defaultOpened: false,
|
||||
commands: [
|
||||
{
|
||||
value: "quickcomposer.text",
|
||||
value: "quickcomposer.data",
|
||||
label: "编解码",
|
||||
desc: "文本编解码",
|
||||
icon: "code",
|
||||
@ -21,42 +21,42 @@ export const textCommands = {
|
||||
options: [
|
||||
{
|
||||
label: "Base64编码",
|
||||
value: "quickcomposer.text.base64Encode",
|
||||
value: "quickcomposer.data.base64Encode",
|
||||
icon: "title",
|
||||
},
|
||||
{
|
||||
label: "Base64解码",
|
||||
value: "quickcomposer.text.base64Decode",
|
||||
value: "quickcomposer.data.base64Decode",
|
||||
icon: "title",
|
||||
},
|
||||
{
|
||||
label: "十六进制编码",
|
||||
value: "quickcomposer.text.hexEncode",
|
||||
value: "quickcomposer.data.hexEncode",
|
||||
icon: "code",
|
||||
},
|
||||
{
|
||||
label: "十六进制解码",
|
||||
value: "quickcomposer.text.hexDecode",
|
||||
value: "quickcomposer.data.hexDecode",
|
||||
icon: "code",
|
||||
},
|
||||
{
|
||||
label: "URL编码",
|
||||
value: "quickcomposer.text.urlEncode",
|
||||
value: "quickcomposer.data.urlEncode",
|
||||
icon: "link",
|
||||
},
|
||||
{
|
||||
label: "URL解码",
|
||||
value: "quickcomposer.text.urlDecode",
|
||||
value: "quickcomposer.data.urlDecode",
|
||||
icon: "link",
|
||||
},
|
||||
{
|
||||
label: "HTML编码",
|
||||
value: "quickcomposer.text.htmlEncode",
|
||||
value: "quickcomposer.data.htmlEncode",
|
||||
icon: "html",
|
||||
},
|
||||
{
|
||||
label: "HTML解码",
|
||||
value: "quickcomposer.text.htmlDecode",
|
||||
value: "quickcomposer.data.htmlDecode",
|
||||
icon: "html",
|
||||
},
|
||||
],
|
||||
@ -64,17 +64,17 @@ export const textCommands = {
|
||||
},
|
||||
},
|
||||
{
|
||||
value: "quickcomposer.text.symmetricCrypto",
|
||||
value: "quickcomposer.data.symmetricCrypto",
|
||||
label: "对称加解密",
|
||||
component: "SymmetricCryptoEditor",
|
||||
},
|
||||
{
|
||||
value: "quickcomposer.text.asymmetricCrypto",
|
||||
value: "quickcomposer.data.asymmetricCrypto",
|
||||
label: "非对称加解密",
|
||||
component: "AsymmetricCryptoEditor",
|
||||
},
|
||||
{
|
||||
value: "quickcomposer.text",
|
||||
value: "quickcomposer.data",
|
||||
label: "哈希计算",
|
||||
desc: "计算文本的哈希值",
|
||||
icon: "enhanced_encryption",
|
||||
@ -91,27 +91,27 @@ export const textCommands = {
|
||||
options: [
|
||||
{
|
||||
label: "MD5",
|
||||
value: "quickcomposer.text.md5Hash",
|
||||
value: "quickcomposer.data.md5Hash",
|
||||
icon: "functions",
|
||||
},
|
||||
{
|
||||
label: "SHA1",
|
||||
value: "quickcomposer.text.sha1Hash",
|
||||
value: "quickcomposer.data.sha1Hash",
|
||||
icon: "functions",
|
||||
},
|
||||
{
|
||||
label: "SHA256",
|
||||
value: "quickcomposer.text.sha256Hash",
|
||||
value: "quickcomposer.data.sha256Hash",
|
||||
icon: "functions",
|
||||
},
|
||||
{
|
||||
label: "SHA512",
|
||||
value: "quickcomposer.text.sha512Hash",
|
||||
value: "quickcomposer.data.sha512Hash",
|
||||
icon: "functions",
|
||||
},
|
||||
{
|
||||
label: "SM3",
|
||||
value: "quickcomposer.text.sm3Hash",
|
||||
value: "quickcomposer.data.sm3Hash",
|
||||
icon: "functions",
|
||||
},
|
||||
],
|
||||
@ -119,7 +119,7 @@ export const textCommands = {
|
||||
width: 3,
|
||||
},
|
||||
{
|
||||
value: "quickcomposer.text.reverseString",
|
||||
value: "quickcomposer.data.reverseString",
|
||||
label: "字符串反转",
|
||||
config: [
|
||||
{
|
||||
@ -131,7 +131,7 @@ export const textCommands = {
|
||||
],
|
||||
},
|
||||
{
|
||||
value: "quickcomposer.text.replaceString",
|
||||
value: "quickcomposer.data.replaceString",
|
||||
label: "字符串替换",
|
||||
config: [
|
||||
{
|
||||
@ -158,7 +158,7 @@ export const textCommands = {
|
||||
],
|
||||
},
|
||||
{
|
||||
value: "quickcomposer.text.substring",
|
||||
value: "quickcomposer.data.substring",
|
||||
label: "字符串截取",
|
||||
config: [
|
||||
{
|
||||
@ -185,12 +185,27 @@ export const textCommands = {
|
||||
],
|
||||
},
|
||||
{
|
||||
value: "quickcomposer.text.regexTransform",
|
||||
value: "quickcomposer.data.regexTransform",
|
||||
label: "正则提取/替换",
|
||||
component: "RegexEditor",
|
||||
componentProps: {
|
||||
inputLabel: "要处理的文本",
|
||||
},
|
||||
},
|
||||
{
|
||||
value: "quickcomposer.data.buffer",
|
||||
label: "Buffer操作",
|
||||
desc: "Buffer创建、转换和操作",
|
||||
component: "BufferEditor",
|
||||
icon: "memory",
|
||||
},
|
||||
{
|
||||
value: "quickcomposer.data.zlib",
|
||||
label: "数据压缩解压",
|
||||
desc: "使用 zlib 进行数据压缩和解压",
|
||||
component: "ZlibEditor",
|
||||
icon: "compress",
|
||||
isAsync: true,
|
||||
},
|
||||
],
|
||||
};
|
@ -1,14 +0,0 @@
|
||||
export const developerCommands = {
|
||||
label: "开发相关",
|
||||
icon: "code",
|
||||
defaultOpened: true,
|
||||
commands: [
|
||||
{
|
||||
value: "quickcomposer.developer.buffer",
|
||||
label: "Buffer操作",
|
||||
desc: "Buffer创建、转换和操作",
|
||||
component: "BufferEditor",
|
||||
icon: "memory",
|
||||
},
|
||||
],
|
||||
};
|
@ -46,13 +46,5 @@ export const fileCommands = {
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
value: "quickcomposer.file.zlib",
|
||||
label: "压缩解压",
|
||||
desc: "使用 zlib 进行数据压缩和解压",
|
||||
component: "ZlibEditor",
|
||||
icon: "compress",
|
||||
isAsync: true,
|
||||
},
|
||||
],
|
||||
};
|
||||
|
@ -2,20 +2,18 @@ import { fileCommands } from "./fileCommands";
|
||||
import { networkCommands } from "./networkCommands";
|
||||
import { systemCommands } from "./systemCommands";
|
||||
import { notifyCommands } from "./notifyCommands";
|
||||
import { textCommands } from "./textCommands";
|
||||
import { dataCommands } from "./dataCommands";
|
||||
import { otherCommands } from "./otherCommands";
|
||||
import { simulateCommands } from "./simulateCommands";
|
||||
import { controlCommands } from "./controlCommands";
|
||||
import { developerCommands } from "./developerCommands";
|
||||
|
||||
export const commandCategories = [
|
||||
fileCommands,
|
||||
networkCommands,
|
||||
systemCommands,
|
||||
notifyCommands,
|
||||
textCommands,
|
||||
dataCommands,
|
||||
controlCommands,
|
||||
otherCommands,
|
||||
simulateCommands,
|
||||
developerCommands,
|
||||
];
|
||||
|
Loading…
x
Reference in New Issue
Block a user