mirror of
https://github.com/fofolee/uTools-quickcommand.git
synced 2025-06-29 04:12:45 +08:00
编排分类调整
This commit is contained in:
parent
a6cc1c8737
commit
296c231c44
@ -1,10 +1,9 @@
|
|||||||
const quickcomposer = {
|
const quickcomposer = {
|
||||||
text: require("./quickcomposer/text"),
|
data: require("./quickcomposer/data"),
|
||||||
simulate: require("./quickcomposer/simulate"),
|
simulate: require("./quickcomposer/simulate"),
|
||||||
file: require("./quickcomposer/file"),
|
file: require("./quickcomposer/file"),
|
||||||
system: require("./quickcomposer/system"),
|
system: require("./quickcomposer/system"),
|
||||||
network: require("./quickcomposer/network"),
|
network: require("./quickcomposer/network"),
|
||||||
developer: require("./quickcomposer/developer"),
|
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports = quickcomposer;
|
module.exports = quickcomposer;
|
||||||
|
@ -2,10 +2,14 @@ const encoder = require("./encoder");
|
|||||||
const hash = require("./hash");
|
const hash = require("./hash");
|
||||||
const string = require("./string");
|
const string = require("./string");
|
||||||
const crypto = require("./crypto");
|
const crypto = require("./crypto");
|
||||||
|
const buffer = require("./buffer");
|
||||||
|
const zlib = require("./zlib");
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
...encoder,
|
...encoder,
|
||||||
...hash,
|
...hash,
|
||||||
...string,
|
...string,
|
||||||
...crypto,
|
...crypto,
|
||||||
|
buffer,
|
||||||
|
zlib,
|
||||||
};
|
};
|
@ -1,3 +0,0 @@
|
|||||||
module.exports = {
|
|
||||||
buffer: require("./buffer"),
|
|
||||||
};
|
|
@ -1,7 +1,5 @@
|
|||||||
const operation = require("./operation");
|
const operation = require("./operation");
|
||||||
const zlib = require("./zlib");
|
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
operation: operation.operation,
|
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>
|
<script>
|
||||||
import { defineComponent, inject } from "vue";
|
import { defineComponent, inject } from "vue";
|
||||||
import { validateVariableName } from "js/common/variableValidator";
|
import { validateVariableName } from "js/common/variableValidator";
|
||||||
import VariableInput from "./ui/VariableInput.vue";
|
import VariableInput from "components/composer/ui/VariableInput.vue";
|
||||||
import MultiParams from "./ui/MultiParams.vue";
|
import MultiParams from "components/composer/MultiParams.vue";
|
||||||
import CommandHead from "./card/CommandHead.vue";
|
import CommandHead from "components/composer/card/CommandHead.vue";
|
||||||
import * as CardComponents from "js/composer/cardComponents";
|
import * as CardComponents from "js/composer/cardComponents";
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
|
@ -52,8 +52,8 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { defineComponent } from "vue";
|
import { defineComponent } from "vue";
|
||||||
import VariableInput from "./VariableInput.vue";
|
import VariableInput from "components/composer/ui/VariableInput.vue";
|
||||||
import NumberInput from "./NumberInput.vue";
|
import NumberInput from "components/composer/ui/NumberInput.vue";
|
||||||
import { stringifyWithType, parseToHasType } from "js/composer/formatString";
|
import { stringifyWithType, parseToHasType } from "js/composer/formatString";
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
@ -93,7 +93,7 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { defineComponent } from "vue";
|
import { defineComponent } from "vue";
|
||||||
import VariableInput from "../ui/VariableInput.vue";
|
import VariableInput from "components/composer/ui/VariableInput.vue";
|
||||||
import RegexInput from "./RegexInput.vue";
|
import RegexInput from "./RegexInput.vue";
|
||||||
import RegexBuilder from "./RegexBuilder.vue";
|
import RegexBuilder from "./RegexBuilder.vue";
|
||||||
import RegexTester from "./RegexTester.vue";
|
import RegexTester from "./RegexTester.vue";
|
@ -28,7 +28,6 @@
|
|||||||
label="主机名"
|
label="主机名"
|
||||||
icon="dns"
|
icon="dns"
|
||||||
class="col"
|
class="col"
|
||||||
v-if="needsHostname"
|
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<!-- IP地址输入 -->
|
<!-- IP地址输入 -->
|
||||||
|
@ -2,7 +2,7 @@ import { defineAsyncComponent } from "vue";
|
|||||||
|
|
||||||
// UI Components
|
// UI Components
|
||||||
export const KeyEditor = defineAsyncComponent(() =>
|
export const KeyEditor = defineAsyncComponent(() =>
|
||||||
import("components/composer/ui/KeyEditor.vue")
|
import("src/components/composer/simulate/KeyEditor.vue")
|
||||||
);
|
);
|
||||||
export const ImageSearchEditor = defineAsyncComponent(() =>
|
export const ImageSearchEditor = defineAsyncComponent(() =>
|
||||||
import("components/composer/simulate/ImageSearchEditor.vue")
|
import("components/composer/simulate/ImageSearchEditor.vue")
|
||||||
@ -36,18 +36,18 @@ export const UBrowserEditor = defineAsyncComponent(() =>
|
|||||||
import("components/composer/ubrowser/UBrowserEditor.vue")
|
import("components/composer/ubrowser/UBrowserEditor.vue")
|
||||||
);
|
);
|
||||||
export const AxiosConfigEditor = defineAsyncComponent(() =>
|
export const AxiosConfigEditor = defineAsyncComponent(() =>
|
||||||
import("components/composer/http/AxiosConfigEditor.vue")
|
import("src/components/composer/network/AxiosConfigEditor.vue")
|
||||||
);
|
);
|
||||||
export const RegexEditor = defineAsyncComponent(() =>
|
export const RegexEditor = defineAsyncComponent(() =>
|
||||||
import("components/composer/regex/RegexEditor.vue")
|
import("components/composer/data/regex/RegexEditor.vue")
|
||||||
);
|
);
|
||||||
|
|
||||||
// Crypto Components
|
// Crypto Components
|
||||||
export const SymmetricCryptoEditor = defineAsyncComponent(() =>
|
export const SymmetricCryptoEditor = defineAsyncComponent(() =>
|
||||||
import("components/composer/crypto/SymmetricCryptoEditor.vue")
|
import("src/components/composer/data/SymmetricCryptoEditor.vue")
|
||||||
);
|
);
|
||||||
export const AsymmetricCryptoEditor = defineAsyncComponent(() =>
|
export const AsymmetricCryptoEditor = defineAsyncComponent(() =>
|
||||||
import("components/composer/crypto/AsymmetricCryptoEditor.vue")
|
import("src/components/composer/data/AsymmetricCryptoEditor.vue")
|
||||||
);
|
);
|
||||||
|
|
||||||
// File Components
|
// File Components
|
||||||
@ -68,7 +68,7 @@ export const PathEditor = defineAsyncComponent(() =>
|
|||||||
import("components/composer/system/PathEditor.vue")
|
import("components/composer/system/PathEditor.vue")
|
||||||
);
|
);
|
||||||
export const ZlibEditor = defineAsyncComponent(() =>
|
export const ZlibEditor = defineAsyncComponent(() =>
|
||||||
import("components/composer/file/ZlibEditor.vue")
|
import("src/components/composer/data/ZlibEditor.vue")
|
||||||
);
|
);
|
||||||
export const UrlEditor = defineAsyncComponent(() =>
|
export const UrlEditor = defineAsyncComponent(() =>
|
||||||
import("components/composer/network/UrlEditor.vue")
|
import("components/composer/network/UrlEditor.vue")
|
||||||
@ -77,5 +77,5 @@ export const DnsEditor = defineAsyncComponent(() =>
|
|||||||
import("components/composer/network/DnsEditor.vue")
|
import("components/composer/network/DnsEditor.vue")
|
||||||
);
|
);
|
||||||
export const BufferEditor = defineAsyncComponent(() =>
|
export const BufferEditor = defineAsyncComponent(() =>
|
||||||
import("components/composer/developer/BufferEditor.vue")
|
import("src/components/composer/data/BufferEditor.vue")
|
||||||
);
|
);
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
export const textCommands = {
|
export const dataCommands = {
|
||||||
label: "文本处理",
|
label: "数据处理",
|
||||||
icon: "code",
|
icon: "auto_graph",
|
||||||
defaultOpened: false,
|
defaultOpened: false,
|
||||||
commands: [
|
commands: [
|
||||||
{
|
{
|
||||||
value: "quickcomposer.text",
|
value: "quickcomposer.data",
|
||||||
label: "编解码",
|
label: "编解码",
|
||||||
desc: "文本编解码",
|
desc: "文本编解码",
|
||||||
icon: "code",
|
icon: "code",
|
||||||
@ -21,42 +21,42 @@ export const textCommands = {
|
|||||||
options: [
|
options: [
|
||||||
{
|
{
|
||||||
label: "Base64编码",
|
label: "Base64编码",
|
||||||
value: "quickcomposer.text.base64Encode",
|
value: "quickcomposer.data.base64Encode",
|
||||||
icon: "title",
|
icon: "title",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "Base64解码",
|
label: "Base64解码",
|
||||||
value: "quickcomposer.text.base64Decode",
|
value: "quickcomposer.data.base64Decode",
|
||||||
icon: "title",
|
icon: "title",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "十六进制编码",
|
label: "十六进制编码",
|
||||||
value: "quickcomposer.text.hexEncode",
|
value: "quickcomposer.data.hexEncode",
|
||||||
icon: "code",
|
icon: "code",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "十六进制解码",
|
label: "十六进制解码",
|
||||||
value: "quickcomposer.text.hexDecode",
|
value: "quickcomposer.data.hexDecode",
|
||||||
icon: "code",
|
icon: "code",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "URL编码",
|
label: "URL编码",
|
||||||
value: "quickcomposer.text.urlEncode",
|
value: "quickcomposer.data.urlEncode",
|
||||||
icon: "link",
|
icon: "link",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "URL解码",
|
label: "URL解码",
|
||||||
value: "quickcomposer.text.urlDecode",
|
value: "quickcomposer.data.urlDecode",
|
||||||
icon: "link",
|
icon: "link",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "HTML编码",
|
label: "HTML编码",
|
||||||
value: "quickcomposer.text.htmlEncode",
|
value: "quickcomposer.data.htmlEncode",
|
||||||
icon: "html",
|
icon: "html",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "HTML解码",
|
label: "HTML解码",
|
||||||
value: "quickcomposer.text.htmlDecode",
|
value: "quickcomposer.data.htmlDecode",
|
||||||
icon: "html",
|
icon: "html",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
@ -64,17 +64,17 @@ export const textCommands = {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
value: "quickcomposer.text.symmetricCrypto",
|
value: "quickcomposer.data.symmetricCrypto",
|
||||||
label: "对称加解密",
|
label: "对称加解密",
|
||||||
component: "SymmetricCryptoEditor",
|
component: "SymmetricCryptoEditor",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
value: "quickcomposer.text.asymmetricCrypto",
|
value: "quickcomposer.data.asymmetricCrypto",
|
||||||
label: "非对称加解密",
|
label: "非对称加解密",
|
||||||
component: "AsymmetricCryptoEditor",
|
component: "AsymmetricCryptoEditor",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
value: "quickcomposer.text",
|
value: "quickcomposer.data",
|
||||||
label: "哈希计算",
|
label: "哈希计算",
|
||||||
desc: "计算文本的哈希值",
|
desc: "计算文本的哈希值",
|
||||||
icon: "enhanced_encryption",
|
icon: "enhanced_encryption",
|
||||||
@ -91,27 +91,27 @@ export const textCommands = {
|
|||||||
options: [
|
options: [
|
||||||
{
|
{
|
||||||
label: "MD5",
|
label: "MD5",
|
||||||
value: "quickcomposer.text.md5Hash",
|
value: "quickcomposer.data.md5Hash",
|
||||||
icon: "functions",
|
icon: "functions",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "SHA1",
|
label: "SHA1",
|
||||||
value: "quickcomposer.text.sha1Hash",
|
value: "quickcomposer.data.sha1Hash",
|
||||||
icon: "functions",
|
icon: "functions",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "SHA256",
|
label: "SHA256",
|
||||||
value: "quickcomposer.text.sha256Hash",
|
value: "quickcomposer.data.sha256Hash",
|
||||||
icon: "functions",
|
icon: "functions",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "SHA512",
|
label: "SHA512",
|
||||||
value: "quickcomposer.text.sha512Hash",
|
value: "quickcomposer.data.sha512Hash",
|
||||||
icon: "functions",
|
icon: "functions",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "SM3",
|
label: "SM3",
|
||||||
value: "quickcomposer.text.sm3Hash",
|
value: "quickcomposer.data.sm3Hash",
|
||||||
icon: "functions",
|
icon: "functions",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
@ -119,7 +119,7 @@ export const textCommands = {
|
|||||||
width: 3,
|
width: 3,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
value: "quickcomposer.text.reverseString",
|
value: "quickcomposer.data.reverseString",
|
||||||
label: "字符串反转",
|
label: "字符串反转",
|
||||||
config: [
|
config: [
|
||||||
{
|
{
|
||||||
@ -131,7 +131,7 @@ export const textCommands = {
|
|||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
value: "quickcomposer.text.replaceString",
|
value: "quickcomposer.data.replaceString",
|
||||||
label: "字符串替换",
|
label: "字符串替换",
|
||||||
config: [
|
config: [
|
||||||
{
|
{
|
||||||
@ -158,7 +158,7 @@ export const textCommands = {
|
|||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
value: "quickcomposer.text.substring",
|
value: "quickcomposer.data.substring",
|
||||||
label: "字符串截取",
|
label: "字符串截取",
|
||||||
config: [
|
config: [
|
||||||
{
|
{
|
||||||
@ -185,12 +185,27 @@ export const textCommands = {
|
|||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
value: "quickcomposer.text.regexTransform",
|
value: "quickcomposer.data.regexTransform",
|
||||||
label: "正则提取/替换",
|
label: "正则提取/替换",
|
||||||
component: "RegexEditor",
|
component: "RegexEditor",
|
||||||
componentProps: {
|
componentProps: {
|
||||||
inputLabel: "要处理的文本",
|
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 { networkCommands } from "./networkCommands";
|
||||||
import { systemCommands } from "./systemCommands";
|
import { systemCommands } from "./systemCommands";
|
||||||
import { notifyCommands } from "./notifyCommands";
|
import { notifyCommands } from "./notifyCommands";
|
||||||
import { textCommands } from "./textCommands";
|
import { dataCommands } from "./dataCommands";
|
||||||
import { otherCommands } from "./otherCommands";
|
import { otherCommands } from "./otherCommands";
|
||||||
import { simulateCommands } from "./simulateCommands";
|
import { simulateCommands } from "./simulateCommands";
|
||||||
import { controlCommands } from "./controlCommands";
|
import { controlCommands } from "./controlCommands";
|
||||||
import { developerCommands } from "./developerCommands";
|
|
||||||
|
|
||||||
export const commandCategories = [
|
export const commandCategories = [
|
||||||
fileCommands,
|
fileCommands,
|
||||||
networkCommands,
|
networkCommands,
|
||||||
systemCommands,
|
systemCommands,
|
||||||
notifyCommands,
|
notifyCommands,
|
||||||
textCommands,
|
dataCommands,
|
||||||
controlCommands,
|
controlCommands,
|
||||||
otherCommands,
|
otherCommands,
|
||||||
simulateCommands,
|
simulateCommands,
|
||||||
developerCommands,
|
|
||||||
];
|
];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user