mirror of
https://github.com/sharevb/it-tools.git
synced 2026-11-24 06:40:20 +03:00
Compare commits
3
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
34f25fa0e8 | ||
|
|
94acc0decc | ||
|
|
02593d869a |
No files matched your search
Vendored
+1
-5
@@ -64,6 +64,7 @@ declare module '@vue/runtime-core' {
|
||||
'CTextCopyable.demo': typeof import('./src/ui/c-text-copyable/c-text-copyable.demo.vue')['default']
|
||||
CTooltip: typeof import('./src/ui/c-tooltip/c-tooltip.vue')['default']
|
||||
'CTooltip.demo': typeof import('./src/ui/c-tooltip/c-tooltip.demo.vue')['default']
|
||||
CurlConverter: typeof import('./src/tools/curl-converter/curl-converter.vue')['default']
|
||||
DateTimeConverter: typeof import('./src/tools/date-time-converter/date-time-converter.vue')['default']
|
||||
'DemoHome.page': typeof import('./src/ui/demo/demo-home.page.vue')['default']
|
||||
DemoWrapper: typeof import('./src/ui/demo/demo-wrapper.vue')['default']
|
||||
@@ -102,7 +103,6 @@ declare module '@vue/runtime-core' {
|
||||
IconMdiTriangleDown: typeof import('~icons/mdi/triangle-down')['default']
|
||||
InputCopyable: typeof import('./src/components/InputCopyable.vue')['default']
|
||||
IntegerBaseConverter: typeof import('./src/tools/integer-base-converter/integer-base-converter.vue')['default']
|
||||
IpGeoLocation: typeof import('./src/tools/ip-geo-location/ip-geo-location.vue')['default']
|
||||
Ipv4AddressConverter: typeof import('./src/tools/ipv4-address-converter/ipv4-address-converter.vue')['default']
|
||||
Ipv4RangeExpander: typeof import('./src/tools/ipv4-range-expander/ipv4-range-expander.vue')['default']
|
||||
Ipv4SubnetCalculator: typeof import('./src/tools/ipv4-subnet-calculator/ipv4-subnet-calculator.vue')['default']
|
||||
@@ -127,8 +127,6 @@ declare module '@vue/runtime-core' {
|
||||
MenuLayout: typeof import('./src/components/MenuLayout.vue')['default']
|
||||
MetaTagGenerator: typeof import('./src/tools/meta-tag-generator/meta-tag-generator.vue')['default']
|
||||
MimeTypes: typeof import('./src/tools/mime-types/mime-types.vue')['default']
|
||||
NA: typeof import('naive-ui')['NA']
|
||||
NAlert: typeof import('naive-ui')['NAlert']
|
||||
NavbarButtons: typeof import('./src/components/NavbarButtons.vue')['default']
|
||||
NCode: typeof import('naive-ui')['NCode']
|
||||
NCollapseTransition: typeof import('naive-ui')['NCollapseTransition']
|
||||
@@ -146,8 +144,6 @@ declare module '@vue/runtime-core' {
|
||||
NLayout: typeof import('naive-ui')['NLayout']
|
||||
NLayoutSider: typeof import('naive-ui')['NLayoutSider']
|
||||
NMenu: typeof import('naive-ui')['NMenu']
|
||||
NP: typeof import('naive-ui')['NP']
|
||||
NProgress: typeof import('naive-ui')['NProgress']
|
||||
NScrollbar: typeof import('naive-ui')['NScrollbar']
|
||||
NSpin: typeof import('naive-ui')['NSpin']
|
||||
NumeronymGenerator: typeof import('./src/tools/numeronym-generator/numeronym-generator.vue')['default']
|
||||
|
||||
+2
-2
@@ -55,6 +55,7 @@
|
||||
"cron-validator": "^1.3.1",
|
||||
"cronstrue": "^2.26.0",
|
||||
"crypto-js": "^4.1.1",
|
||||
"curlconverter": "^4.10.1",
|
||||
"date-fns": "^2.29.3",
|
||||
"dompurify": "^3.0.6",
|
||||
"emojilib": "^3.0.10",
|
||||
@@ -138,6 +139,5 @@
|
||||
"vitest": "^0.34.0",
|
||||
"workbox-window": "^7.0.0",
|
||||
"zx": "^7.2.1"
|
||||
},
|
||||
"packageManager": "pnpm@8.15.3"
|
||||
}
|
||||
}
|
||||
Generated
+77
-9
@@ -65,6 +65,9 @@ dependencies:
|
||||
crypto-js:
|
||||
specifier: ^4.1.1
|
||||
version: 4.1.1
|
||||
curlconverter:
|
||||
specifier: ^4.10.1
|
||||
version: 4.10.1
|
||||
date-fns:
|
||||
specifier: ^2.29.3
|
||||
version: 2.29.3
|
||||
@@ -3354,7 +3357,7 @@ packages:
|
||||
dependencies:
|
||||
'@unhead/dom': 0.5.1
|
||||
'@unhead/schema': 0.5.1
|
||||
'@vueuse/shared': 10.8.0(vue@3.3.4)
|
||||
'@vueuse/shared': 11.2.0(vue@3.3.4)
|
||||
unhead: 0.5.1
|
||||
vue: 3.3.4
|
||||
transitivePeerDependencies:
|
||||
@@ -3996,10 +3999,10 @@ packages:
|
||||
- vue
|
||||
dev: false
|
||||
|
||||
/@vueuse/shared@10.8.0(vue@3.3.4):
|
||||
resolution: {integrity: sha512-dUdy6zwHhULGxmr9YUg8e+EnB39gcM4Fe2oKBSrh3cOsV30JcMPtsyuspgFCUo5xxFNaeMf/W2yyKfST7Bg8oQ==}
|
||||
/@vueuse/shared@11.2.0(vue@3.3.4):
|
||||
resolution: {integrity: sha512-VxFjie0EanOudYSgMErxXfq6fo8vhr5ICI+BuE3I9FnX7ePllEsVrRQ7O6Q1TLgApeLuPKcHQxAXpP+KnlrJsg==}
|
||||
dependencies:
|
||||
vue-demi: 0.14.7(vue@3.3.4)
|
||||
vue-demi: 0.14.10(vue@3.3.4)
|
||||
transitivePeerDependencies:
|
||||
- '@vue/composition-api'
|
||||
- vue
|
||||
@@ -4715,6 +4718,20 @@ packages:
|
||||
/csstype@3.1.2:
|
||||
resolution: {integrity: sha512-I7K1Uu0MBPzaFKg4nI5Q7Vs2t+3gWWW648spaF+Rg7pI9ds18Ugn+lvg4SHczUdKlHI5LWBXyqfS8+DufyBsgQ==}
|
||||
|
||||
/curlconverter@4.10.1:
|
||||
resolution: {integrity: sha512-cMV9ZsIBgZCeKiTqOvxtBGB58heQbrulPvtff4IbFunbDIuGWu8ZCDlCIEr74aNGCOfQRv9aery8I2GpYGBzyw==}
|
||||
hasBin: true
|
||||
dependencies:
|
||||
jsesc: 3.0.2
|
||||
lossless-json: 4.0.1
|
||||
tree-sitter: 0.21.1
|
||||
tree-sitter-bash: 0.21.0(tree-sitter@0.21.1)
|
||||
web-tree-sitter: 0.22.6
|
||||
yamljs: 0.3.0
|
||||
transitivePeerDependencies:
|
||||
- tree_sitter
|
||||
dev: false
|
||||
|
||||
/dash-get@1.0.2:
|
||||
resolution: {integrity: sha512-4FbVrHDwfOASx7uQVxeiCTo7ggSdYZbqs8lH+WU6ViypPlDbe9y6IP5VVUDQBv9DcnyaiPT5XT0UWHgJ64zLeQ==}
|
||||
dev: false
|
||||
@@ -6566,7 +6583,6 @@ packages:
|
||||
resolution: {integrity: sha512-xKqzzWXDttJuOcawBt4KnKHHIf5oQ/Cxax+0PWFG+DFDgHNAdi+TXECADI+RYiFUMmx8792xsMbbgXj4CwnP4g==}
|
||||
engines: {node: '>=6'}
|
||||
hasBin: true
|
||||
dev: true
|
||||
|
||||
/json-parse-even-better-errors@2.3.1:
|
||||
resolution: {integrity: sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==}
|
||||
@@ -6720,6 +6736,10 @@ packages:
|
||||
is-unicode-supported: 0.1.0
|
||||
dev: true
|
||||
|
||||
/lossless-json@4.0.1:
|
||||
resolution: {integrity: sha512-l0L+ppmgPDnb+JGxNLndPtJZGNf6+ZmVaQzoxQm3u6TXmhdnsA+YtdVR8DjzZd/em58686CQhOFDPewfJ4l7MA==}
|
||||
dev: false
|
||||
|
||||
/loupe@2.3.6:
|
||||
resolution: {integrity: sha512-RaPMZKiMy8/JruncMU5Bt6na1eftNoo++R4Y+N2FrxkDVTrGvcyzFTsaGif4QTeKESheMGegbhw6iUAq+5A8zA==}
|
||||
dependencies:
|
||||
@@ -7050,6 +7070,15 @@ packages:
|
||||
tslib: 2.5.0
|
||||
dev: false
|
||||
|
||||
/node-addon-api@7.1.1:
|
||||
resolution: {integrity: sha512-5m3bsyrjFWE1xf7nz7YXdN4udnVtXK6/Yfgn5qnahL6bCkf2yKt4k3nuTKAtT4r3IG8JNR2ncsIMdZuAzJjHQQ==}
|
||||
dev: false
|
||||
|
||||
/node-addon-api@8.1.0:
|
||||
resolution: {integrity: sha512-yBY+qqWSv3dWKGODD6OGE6GnTX7Q2r+4+DfpqxHSHh8x0B4EKP9+wVGLS6U/AM1vxSNNmUEuIV5EGhYwPpfOwQ==}
|
||||
engines: {node: ^18 || ^20 || >= 21}
|
||||
dev: false
|
||||
|
||||
/node-domexception@1.0.0:
|
||||
resolution: {integrity: sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==}
|
||||
engines: {node: '>=10.5.0'}
|
||||
@@ -7073,6 +7102,11 @@ packages:
|
||||
engines: {node: '>= 6.13.0'}
|
||||
dev: false
|
||||
|
||||
/node-gyp-build@4.8.1:
|
||||
resolution: {integrity: sha512-OSs33Z9yWr148JZcbZd5WiAXhh/n9z8TxQcdMhIOlpN9AhWpLfvVFO73+m77bBABQMaY9XSvIa+qk0jlI7Gcaw==}
|
||||
hasBin: true
|
||||
dev: false
|
||||
|
||||
/node-releases@2.0.12:
|
||||
resolution: {integrity: sha512-QzsYKWhXTWx8h1kIvqfnC++o0pEmpRQA/aenALsL2F4pqNVr7YzcdMlDij5WBnwftRbJCNJL/O7zdKaxKPHqgQ==}
|
||||
dev: true
|
||||
@@ -8488,6 +8522,30 @@ packages:
|
||||
punycode: 2.3.0
|
||||
dev: true
|
||||
|
||||
/tree-sitter-bash@0.21.0(tree-sitter@0.21.1):
|
||||
resolution: {integrity: sha512-UuXf+wliu1mmS/O2Iz7OQghExM4a+lk+GaVPndZVpAJnFuzanaN33UcHOsrmngHxaOXHz5JSZrwp6i2qM/PKag==}
|
||||
requiresBuild: true
|
||||
peerDependencies:
|
||||
tree-sitter: ^0.21.0
|
||||
tree_sitter: '*'
|
||||
peerDependenciesMeta:
|
||||
tree_sitter:
|
||||
optional: true
|
||||
dependencies:
|
||||
node-addon-api: 7.1.1
|
||||
node-gyp-build: 4.8.1
|
||||
tree-sitter: 0.21.1
|
||||
web-tree-sitter: 0.21.0
|
||||
dev: false
|
||||
|
||||
/tree-sitter@0.21.1:
|
||||
resolution: {integrity: sha512-7dxoA6kYvtgWw80265MyqJlkRl4yawIjO7S5MigytjELkX43fV2WsAXzsNfO7sBpPPCF5Gp0+XzHk0DwLCq3xQ==}
|
||||
requiresBuild: true
|
||||
dependencies:
|
||||
node-addon-api: 8.1.0
|
||||
node-gyp-build: 4.8.1
|
||||
dev: false
|
||||
|
||||
/treemate@0.3.11:
|
||||
resolution: {integrity: sha512-M8RGFoKtZ8dF+iwJfAJTOH/SM4KluKOKRJpjCMhI8bG3qB74zrFoArKZ62ll0Fr3mqkMJiQOmWYkdYgDeITYQg==}
|
||||
dev: false
|
||||
@@ -9143,8 +9201,8 @@ packages:
|
||||
vue: 3.3.4
|
||||
dev: false
|
||||
|
||||
/vue-demi@0.14.5(vue@3.3.4):
|
||||
resolution: {integrity: sha512-o9NUVpl/YlsGJ7t+xuqJKx8EBGf1quRhCiT6D/J0pfwmk9zUwYkC7yrF4SZCe6fETvSM3UNL2edcbYrSyc4QHA==}
|
||||
/vue-demi@0.14.10(vue@3.3.4):
|
||||
resolution: {integrity: sha512-nMZBOwuzabUO0nLgIcc6rycZEebF6eeUfaiQx9+WSk8e29IbLvPU9feI6tqW4kTo3hvoYAJkMh8n8D0fuISphg==}
|
||||
engines: {node: '>=12'}
|
||||
hasBin: true
|
||||
requiresBuild: true
|
||||
@@ -9158,8 +9216,8 @@ packages:
|
||||
vue: 3.3.4
|
||||
dev: false
|
||||
|
||||
/vue-demi@0.14.7(vue@3.3.4):
|
||||
resolution: {integrity: sha512-EOG8KXDQNwkJILkx/gPcoL/7vH+hORoBaKgGe+6W7VFMvCYJfmF2dGbvgDroVnI8LU7/kTu8mbjRZGBU1z9NTA==}
|
||||
/vue-demi@0.14.5(vue@3.3.4):
|
||||
resolution: {integrity: sha512-o9NUVpl/YlsGJ7t+xuqJKx8EBGf1quRhCiT6D/J0pfwmk9zUwYkC7yrF4SZCe6fETvSM3UNL2edcbYrSyc4QHA==}
|
||||
engines: {node: '>=12'}
|
||||
hasBin: true
|
||||
requiresBuild: true
|
||||
@@ -9276,6 +9334,14 @@ packages:
|
||||
engines: {node: '>= 8'}
|
||||
dev: true
|
||||
|
||||
/web-tree-sitter@0.21.0:
|
||||
resolution: {integrity: sha512-iJ+QJ6ikN9D9cG7Kh6q3KtAstYFUQbYZ8OjuPEJYWfj2kLrmp5I3C2n6WjE1Y3jvj7nJbkcrJytJGWUEhCxn+g==}
|
||||
dev: false
|
||||
|
||||
/web-tree-sitter@0.22.6:
|
||||
resolution: {integrity: sha512-hS87TH71Zd6mGAmYCvlgxeGDjqd9GTeqXNqTT+u0Gs51uIozNIaaq/kUAbV/Zf56jb2ZOyG8BxZs2GG9wbLi6Q==}
|
||||
dev: false
|
||||
|
||||
/webidl-conversions@4.0.2:
|
||||
resolution: {integrity: sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg==}
|
||||
dev: true
|
||||
@@ -9449,6 +9515,7 @@ packages:
|
||||
|
||||
/workbox-google-analytics@7.0.0:
|
||||
resolution: {integrity: sha512-MEYM1JTn/qiC3DbpvP2BVhyIH+dV/5BjHk756u9VbwuAhu0QHyKscTnisQuz21lfRpOwiS9z4XdqeVAKol0bzg==}
|
||||
deprecated: It is not compatible with newer versions of GA starting with v4, as long as you are using GAv3 it should be ok, but the package is not longer being maintained
|
||||
dependencies:
|
||||
workbox-background-sync: 7.0.0
|
||||
workbox-core: 7.0.0
|
||||
@@ -9592,6 +9659,7 @@ packages:
|
||||
|
||||
/yamljs@0.3.0:
|
||||
resolution: {integrity: sha512-C/FsVVhht4iPQYXOInoxUM/1ELSf9EsgKH34FofQOp6hwCPrW4vG4w5++TED3xRUo8gD7l0P1J1dLlDYzODsTQ==}
|
||||
hasBin: true
|
||||
dependencies:
|
||||
argparse: 1.0.10
|
||||
glob: 7.2.3
|
||||
|
||||
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
@@ -1,21 +0,0 @@
|
||||
import _ from 'lodash';
|
||||
|
||||
function useDebouncedRef<T>(initialValue: T, delay: number, immediate: boolean = false) {
|
||||
const state = ref(initialValue);
|
||||
const debouncedRef = customRef((track, trigger) => ({
|
||||
get() {
|
||||
track();
|
||||
return state.value;
|
||||
},
|
||||
set: _.debounce(
|
||||
(value) => {
|
||||
state.value = value;
|
||||
trigger();
|
||||
},
|
||||
delay,
|
||||
{ leading: immediate },
|
||||
),
|
||||
}));
|
||||
return debouncedRef;
|
||||
}
|
||||
export default useDebouncedRef;
|
||||
@@ -0,0 +1,133 @@
|
||||
<script setup lang="ts">
|
||||
import {
|
||||
type Warnings, toAnsible, toAnsibleWarn, toCFML, toCFMLWarn, toCSharp,
|
||||
toCSharpWarn, toClojure, toClojureWarn, toDart, toDartWarn, toElixir, toElixirWarn, toGo,
|
||||
toGoWarn, toHTTP, toHTTPWarn, toHarString, toHarStringWarn, toHttpie, toHttpieWarn, toJava,
|
||||
toJavaHttpUrlConnection, toJavaHttpUrlConnectionWarn, toJavaJsoup, toJavaJsoupWarn, toJavaOkHttp,
|
||||
toJavaOkHttpWarn, toJavaScript, toJavaScriptJquery, toJavaScriptJqueryWarn, toJavaScriptWarn, toJavaScriptXHR,
|
||||
toJavaScriptXHRWarn, toJavaWarn, toJsonString, toJsonStringWarn, toJulia, toJuliaWarn, toKotlin, toKotlinWarn, toLua,
|
||||
toLuaWarn, toMATLAB, toMATLABWarn, toNode, toNodeAxios, toNodeAxiosWarn, toNodeGot, toNodeGotWarn, toNodeHttp,
|
||||
toNodeHttpWarn, toNodeKy, toNodeKyWarn, toNodeRequest, toNodeRequestWarn, toNodeSuperAgent, toNodeSuperAgentWarn,
|
||||
toNodeWarn, toOCaml, toOCamlWarn, toObjectiveC, toObjectiveCWarn, toPerl, toPerlWarn, toPhp, toPhpGuzzle,
|
||||
toPhpGuzzleWarn, toPhpRequests, toPhpRequestsWarn, toPhpWarn, toPowershellRestMethod,
|
||||
toPowershellRestMethodWarn, toPowershellWebRequest, toPowershellWebRequestWarn, toPython, toPythonHttp, toPythonHttpWarn, toPythonWarn,
|
||||
toR, toRWarn, toRuby, toRubyWarn, toRust, toRustWarn, toSwift, toSwiftWarn, toWget,
|
||||
toWgetWarn,
|
||||
} from 'curlconverter';
|
||||
import TextareaCopyable from '@/components/TextareaCopyable.vue';
|
||||
|
||||
const translate = {
|
||||
'ansible': [toAnsible, toAnsibleWarn],
|
||||
'cfml': [toCFML, toCFMLWarn],
|
||||
'clojure': [toClojure, toClojureWarn],
|
||||
'csharp': [toCSharp, toCSharpWarn],
|
||||
'c#': [toCSharp, toCSharpWarn],
|
||||
'browser': [toJavaScript, toJavaScriptWarn],
|
||||
'dart': [toDart, toDartWarn],
|
||||
'elixir': [toElixir, toElixirWarn],
|
||||
'go': [toGo, toGoWarn],
|
||||
'golang': [toGo, toGoWarn],
|
||||
'har': [toHarString, toHarStringWarn],
|
||||
'http': [toHTTP, toHTTPWarn],
|
||||
'httpie': [toHttpie, toHttpieWarn],
|
||||
'java': [toJava, toJavaWarn],
|
||||
'java-httpurlconnection': [
|
||||
toJavaHttpUrlConnection,
|
||||
toJavaHttpUrlConnectionWarn,
|
||||
],
|
||||
'java-jsoup': [toJavaJsoup, toJavaJsoupWarn],
|
||||
'java-okhttp': [toJavaOkHttp, toJavaOkHttpWarn],
|
||||
'javascript': [toJavaScript, toJavaScriptWarn],
|
||||
'javascript-axios': [toNodeAxios, toNodeAxiosWarn],
|
||||
'javascript-fetch': [toJavaScript, toJavaScriptWarn],
|
||||
'javascript-got': [toNodeGot, toNodeGotWarn],
|
||||
'javascript-ky': [toNodeKy, toNodeKyWarn],
|
||||
'javascript-jquery': [toJavaScriptJquery, toJavaScriptJqueryWarn],
|
||||
'javascript-request': [toNodeRequest, toNodeRequestWarn],
|
||||
'javascript-superagent': [toNodeSuperAgent, toNodeSuperAgentWarn],
|
||||
'javascript-xhr': [toJavaScriptXHR, toJavaScriptXHRWarn],
|
||||
'json': [toJsonString, toJsonStringWarn],
|
||||
'julia': [toJulia, toJuliaWarn],
|
||||
'kotlin': [toKotlin, toKotlinWarn],
|
||||
'lua': [toLua, toLuaWarn],
|
||||
'matlab': [toMATLAB, toMATLABWarn],
|
||||
'node': [toNode, toNodeWarn],
|
||||
'nodejs': [toNode, toNodeWarn],
|
||||
'nodejs-axios': [toNodeAxios, toNodeAxiosWarn],
|
||||
'nodejs-got': [toNodeGot, toNodeGotWarn],
|
||||
'nodejs-http': [toNodeHttp, toNodeHttpWarn],
|
||||
'nodejs-ky': [toNodeKy, toNodeKyWarn],
|
||||
'nodejs-jquery': [toJavaScriptJquery, toJavaScriptJqueryWarn],
|
||||
'nodejs-request': [toNodeRequest, toNodeRequestWarn],
|
||||
'nodejs-superagent': [toNodeSuperAgent, toNodeSuperAgentWarn],
|
||||
'nodejs-xhr': [toJavaScriptXHR, toJavaScriptXHRWarn],
|
||||
'objc': [toObjectiveC, toObjectiveCWarn],
|
||||
'objective-c': [toObjectiveC, toObjectiveCWarn],
|
||||
'ocaml': [toOCaml, toOCamlWarn],
|
||||
'perl': [toPerl, toPerlWarn],
|
||||
'php': [toPhp, toPhpWarn],
|
||||
'php-guzzle': [toPhpGuzzle, toPhpGuzzleWarn],
|
||||
'php-requests': [toPhpRequests, toPhpRequestsWarn],
|
||||
'powershell': [toPowershellRestMethod, toPowershellRestMethodWarn],
|
||||
'powershell-webrequest': [
|
||||
toPowershellWebRequest,
|
||||
toPowershellWebRequestWarn,
|
||||
],
|
||||
'python': [toPython, toPythonWarn],
|
||||
'python-http': [toPythonHttp, toPythonHttpWarn],
|
||||
'r': [toR, toRWarn],
|
||||
'ruby': [toRuby, toRubyWarn],
|
||||
'rust': [toRust, toRustWarn],
|
||||
'swift': [toSwift, toSwiftWarn],
|
||||
'wget': [toWget, toWgetWarn],
|
||||
};
|
||||
|
||||
const language = ref('python');
|
||||
const curl = ref('curl --data "hello=world" example.com');
|
||||
const inlang = computed(() => {
|
||||
try {
|
||||
let curlCommand = curl.value;
|
||||
if (!curlCommand.startsWith('curl ')) {
|
||||
curlCommand = `curl ${curlCommand}`;
|
||||
}
|
||||
const [translated, warnings] = translate[language.value as (keyof typeof translate)][1](curlCommand);
|
||||
return {
|
||||
translated,
|
||||
warnings,
|
||||
};
|
||||
}
|
||||
catch (e: any) {
|
||||
return {
|
||||
translated: e.toString(),
|
||||
warnings: [],
|
||||
};
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<c-input-text
|
||||
v-model:value="curl"
|
||||
size="large"
|
||||
placeholder="Your curl command"
|
||||
mb-3
|
||||
/>
|
||||
|
||||
<c-select
|
||||
v-model:value="language"
|
||||
searchable
|
||||
label="Language:"
|
||||
:options="Object.keys(translate)"
|
||||
/>
|
||||
|
||||
<n-divider />
|
||||
|
||||
<n-form-item label="Curl language equivalent:">
|
||||
<TextareaCopyable :value="inlang.translated as string" />
|
||||
</n-form-item>
|
||||
<n-form-item label="Warnings:">
|
||||
<TextareaCopyable style="color: red" :value="(inlang.warnings as Warnings || []).map(w => w[1]).join('\n')" />
|
||||
</n-form-item>
|
||||
</div>
|
||||
</template>
|
||||
@@ -0,0 +1,12 @@
|
||||
import { ExternalLink } from '@vicons/tabler';
|
||||
import { defineTool } from '../tool';
|
||||
|
||||
export const tool = defineTool({
|
||||
name: 'Curl Converter',
|
||||
path: '/curl-converter',
|
||||
description: 'Generate common coding languages version of provided curl command line',
|
||||
keywords: ['curl', 'code', 'language', 'generator'],
|
||||
component: () => import('./curl-converter.vue'),
|
||||
icon: ExternalLink,
|
||||
createdAt: new Date('2024-04-20'),
|
||||
});
|
||||
@@ -4,7 +4,6 @@ import emojiKeywords from 'emojilib';
|
||||
import _ from 'lodash';
|
||||
import type { EmojiInfo } from './emoji.types';
|
||||
import { useFuzzySearch } from '@/composable/fuzzySearch';
|
||||
import useDebouncedRef from '@/composable/debouncedref';
|
||||
|
||||
const escapeUnicode = ({ emoji }: { emoji: string }) => emoji.split('').map(unit => `\\u${unit.charCodeAt(0).toString(16).padStart(4, '0')}`).join('');
|
||||
const getEmojiCodePoints = ({ emoji }: { emoji: string }) => emoji.codePointAt(0) ? `0x${emoji.codePointAt(0)?.toString(16)}` : undefined;
|
||||
@@ -24,7 +23,7 @@ const emojisGroups: { emojiInfos: EmojiInfo[]; group: string }[] = _
|
||||
.map((emojiInfos, group) => ({ group, emojiInfos }))
|
||||
.value();
|
||||
|
||||
const searchQuery = useDebouncedRef('', 500);
|
||||
const searchQuery = ref('');
|
||||
|
||||
const { searchResult } = useFuzzySearch({
|
||||
search: searchQuery,
|
||||
|
||||
+3
-10
@@ -5,8 +5,8 @@ import { tool as basicAuthGenerator } from './basic-auth-generator';
|
||||
import { tool as asciiTextDrawer } from './ascii-text-drawer';
|
||||
|
||||
import { tool as textToUnicode } from './text-to-unicode';
|
||||
import { tool as ipGeoLocation } from './ip-geo-location';
|
||||
import { tool as safelinkDecoder } from './safelink-decoder';
|
||||
import { tool as curlConverter } from './curl-converter';
|
||||
import { tool as pdfSignatureChecker } from './pdf-signature-checker';
|
||||
import { tool as numeronymGenerator } from './numeronym-generator';
|
||||
import { tool as macAddressGenerator } from './mac-address-generator';
|
||||
@@ -149,19 +149,12 @@ export const toolsByCategory: ToolCategory[] = [
|
||||
dockerRunToDockerComposeConverter,
|
||||
xmlFormatter,
|
||||
yamlViewer,
|
||||
curlConverter,
|
||||
],
|
||||
},
|
||||
{
|
||||
name: 'Network',
|
||||
components: [
|
||||
ipv4SubnetCalculator,
|
||||
ipv4AddressConverter,
|
||||
ipv4RangeExpander,
|
||||
macAddressLookup,
|
||||
macAddressGenerator,
|
||||
ipv6UlaGenerator,
|
||||
ipGeoLocation,
|
||||
],
|
||||
components: [ipv4SubnetCalculator, ipv4AddressConverter, ipv4RangeExpander, macAddressLookup, macAddressGenerator, ipv6UlaGenerator],
|
||||
},
|
||||
{
|
||||
name: 'Math',
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
import { World } from '@vicons/tabler';
|
||||
import { defineTool } from '../tool';
|
||||
|
||||
export const tool = defineTool({
|
||||
name: 'IP Geo Location',
|
||||
path: '/ip-geo-location',
|
||||
description: 'Retrieve information about an IPv4/6 address or domain location',
|
||||
keywords: ['ip', 'domain', 'geo', 'location'],
|
||||
component: () => import('./ip-geo-location.vue'),
|
||||
icon: World,
|
||||
createdAt: new Date('2024-01-17'),
|
||||
});
|
||||
@@ -1,116 +0,0 @@
|
||||
<script setup lang="ts">
|
||||
import type { CKeyValueListItems } from '@/ui/c-key-value-list/c-key-value-list.types';
|
||||
|
||||
const ip = ref('8.8.8.8');
|
||||
const errorMessage = ref('');
|
||||
|
||||
const fields: Array<{ field: string; name: string }> = [
|
||||
{ field: 'ip', name: 'IP' },
|
||||
{ field: 'hostname', name: 'Host Name' },
|
||||
{ field: 'country', name: 'Country Code' },
|
||||
{ field: 'region', name: 'Region/state Code' },
|
||||
{ field: 'city', name: 'City' },
|
||||
{ field: 'postal', name: 'Postal Code' },
|
||||
{ field: 'loc', name: 'Latitude/Longitude' },
|
||||
{ field: 'timezone', name: 'Timezone' },
|
||||
{ field: 'org', name: 'Organization Name' },
|
||||
];
|
||||
|
||||
const geoInfos = ref<CKeyValueListItems>([]);
|
||||
const geoInfosData = ref<{
|
||||
loc?: string
|
||||
}>({});
|
||||
const status = ref<'pending' | 'error' | 'success'>('pending');
|
||||
const token = useStorage('ip-geoloc:token', '');
|
||||
|
||||
const openStreetMapUrl = computed(
|
||||
() => {
|
||||
const [gpsLatitude, gpsLongitude] = geoInfosData.value.loc?.split(',') || [];
|
||||
return gpsLatitude && gpsLongitude ? `https://www.openstreetmap.org/?mlat=${gpsLatitude}&mlon=${gpsLongitude}#map=18/${gpsLatitude}/${gpsLongitude}` : undefined;
|
||||
},
|
||||
);
|
||||
|
||||
async function onGetInfos() {
|
||||
try {
|
||||
status.value = 'pending';
|
||||
|
||||
const geoInfoQueryResponse = await fetch(
|
||||
token.value !== ''
|
||||
? `https://ipinfo.io/${ip.value}/json?token=${token.value}`
|
||||
: `https://ipinfo.io/${ip.value}/json`);
|
||||
if (!geoInfoQueryResponse.ok) {
|
||||
throw geoInfoQueryResponse.statusText;
|
||||
}
|
||||
|
||||
const data = await geoInfoQueryResponse.json();
|
||||
|
||||
const allGeoInfos = [];
|
||||
for (const field of fields) {
|
||||
if (data[field.field]) {
|
||||
allGeoInfos.push({
|
||||
label: field.name,
|
||||
value: data[field.field],
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
status.value = 'success';
|
||||
geoInfos.value = allGeoInfos;
|
||||
geoInfosData.value = data;
|
||||
}
|
||||
catch (e: any) {
|
||||
errorMessage.value = e.toString();
|
||||
status.value = 'error';
|
||||
return [];
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<div flex items-center gap-2>
|
||||
<c-input-text
|
||||
v-model:value="ip"
|
||||
placeholder="Enter an IPv4/6"
|
||||
@update:value="() => { status = 'pending' }"
|
||||
/>
|
||||
<c-button align-center @click="onGetInfos">
|
||||
Get GEO Location Infos
|
||||
</c-button>
|
||||
</div>
|
||||
|
||||
<details mt-2>
|
||||
<summary>Optional ipinfo.io token</summary>
|
||||
<c-input-text
|
||||
v-model:value="token"
|
||||
placeholder="Optional ipinfo.io token"
|
||||
@update:value="() => { status = 'pending' }"
|
||||
/>
|
||||
<n-p>
|
||||
<n-a href="https://ipinfo.io/">
|
||||
Signup for a free token
|
||||
</n-a>
|
||||
</n-p>
|
||||
</details>
|
||||
|
||||
<n-divider />
|
||||
|
||||
<c-card v-if="status === 'pending'" mt-5>
|
||||
Click on button above to get latest infos
|
||||
</c-card>
|
||||
|
||||
<c-card v-if="status === 'success' && openStreetMapUrl" mt-4>
|
||||
<c-button :href="openStreetMapUrl" target="_blank">
|
||||
Localize on Open Street Map
|
||||
</c-button>
|
||||
</c-card>
|
||||
|
||||
<c-card v-if="status === 'success'" mt-5>
|
||||
<c-key-value-list :items="geoInfos" />
|
||||
</c-card>
|
||||
|
||||
<n-alert v-if="status === 'error'" title="Errors occured" type="error" mt-5>
|
||||
{{ errorMessage }}
|
||||
</n-alert>
|
||||
</div>
|
||||
</template>
|
||||
@@ -113,4 +113,11 @@ export default defineConfig({
|
||||
build: {
|
||||
target: 'esnext',
|
||||
},
|
||||
optimizeDeps: {
|
||||
esbuildOptions: {
|
||||
supported: {
|
||||
'top-level-await': true,
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
Reference in new issue
Block a user