mirror of
https://github.com/sharevb/it-tools.git
synced 2026-11-27 16:09:01 +03:00
Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d087bd988a |
No files matched your search
Vendored
+4
-1
@@ -129,8 +129,10 @@ declare module '@vue/runtime-core' {
|
|||||||
MetaTagGenerator: typeof import('./src/tools/meta-tag-generator/meta-tag-generator.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']
|
MimeTypes: typeof import('./src/tools/mime-types/mime-types.vue')['default']
|
||||||
NavbarButtons: typeof import('./src/components/NavbarButtons.vue')['default']
|
NavbarButtons: typeof import('./src/components/NavbarButtons.vue')['default']
|
||||||
|
NCode: typeof import('naive-ui')['NCode']
|
||||||
NCollapseTransition: typeof import('naive-ui')['NCollapseTransition']
|
NCollapseTransition: typeof import('naive-ui')['NCollapseTransition']
|
||||||
NConfigProvider: typeof import('naive-ui')['NConfigProvider']
|
NConfigProvider: typeof import('naive-ui')['NConfigProvider']
|
||||||
|
NDivider: typeof import('naive-ui')['NDivider']
|
||||||
NEllipsis: typeof import('naive-ui')['NEllipsis']
|
NEllipsis: typeof import('naive-ui')['NEllipsis']
|
||||||
NH1: typeof import('naive-ui')['NH1']
|
NH1: typeof import('naive-ui')['NH1']
|
||||||
NH3: typeof import('naive-ui')['NH3']
|
NH3: typeof import('naive-ui')['NH3']
|
||||||
@@ -138,6 +140,7 @@ declare module '@vue/runtime-core' {
|
|||||||
NLayout: typeof import('naive-ui')['NLayout']
|
NLayout: typeof import('naive-ui')['NLayout']
|
||||||
NLayoutSider: typeof import('naive-ui')['NLayoutSider']
|
NLayoutSider: typeof import('naive-ui')['NLayoutSider']
|
||||||
NMenu: typeof import('naive-ui')['NMenu']
|
NMenu: typeof import('naive-ui')['NMenu']
|
||||||
|
NScrollbar: typeof import('naive-ui')['NScrollbar']
|
||||||
NumeronymGenerator: typeof import('./src/tools/numeronym-generator/numeronym-generator.vue')['default']
|
NumeronymGenerator: typeof import('./src/tools/numeronym-generator/numeronym-generator.vue')['default']
|
||||||
OtpCodeGeneratorAndValidator: typeof import('./src/tools/otp-code-generator-and-validator/otp-code-generator-and-validator.vue')['default']
|
OtpCodeGeneratorAndValidator: typeof import('./src/tools/otp-code-generator-and-validator/otp-code-generator-and-validator.vue')['default']
|
||||||
PasswordStrengthAnalyser: typeof import('./src/tools/password-strength-analyser/password-strength-analyser.vue')['default']
|
PasswordStrengthAnalyser: typeof import('./src/tools/password-strength-analyser/password-strength-analyser.vue')['default']
|
||||||
@@ -145,6 +148,7 @@ declare module '@vue/runtime-core' {
|
|||||||
PdfSignatureDetails: typeof import('./src/tools/pdf-signature-checker/components/pdf-signature-details.vue')['default']
|
PdfSignatureDetails: typeof import('./src/tools/pdf-signature-checker/components/pdf-signature-details.vue')['default']
|
||||||
PercentageCalculator: typeof import('./src/tools/percentage-calculator/percentage-calculator.vue')['default']
|
PercentageCalculator: typeof import('./src/tools/percentage-calculator/percentage-calculator.vue')['default']
|
||||||
PhoneParserAndFormatter: typeof import('./src/tools/phone-parser-and-formatter/phone-parser-and-formatter.vue')['default']
|
PhoneParserAndFormatter: typeof import('./src/tools/phone-parser-and-formatter/phone-parser-and-formatter.vue')['default']
|
||||||
|
PunycodeConverter: typeof import('./src/tools/punycode-converter/punycode-converter.vue')['default']
|
||||||
QrCodeGenerator: typeof import('./src/tools/qr-code-generator/qr-code-generator.vue')['default']
|
QrCodeGenerator: typeof import('./src/tools/qr-code-generator/qr-code-generator.vue')['default']
|
||||||
RandomPortGenerator: typeof import('./src/tools/random-port-generator/random-port-generator.vue')['default']
|
RandomPortGenerator: typeof import('./src/tools/random-port-generator/random-port-generator.vue')['default']
|
||||||
ResultRow: typeof import('./src/tools/ipv4-range-expander/result-row.vue')['default']
|
ResultRow: typeof import('./src/tools/ipv4-range-expander/result-row.vue')['default']
|
||||||
@@ -180,7 +184,6 @@ declare module '@vue/runtime-core' {
|
|||||||
WifiQrCodeGenerator: typeof import('./src/tools/wifi-qr-code-generator/wifi-qr-code-generator.vue')['default']
|
WifiQrCodeGenerator: typeof import('./src/tools/wifi-qr-code-generator/wifi-qr-code-generator.vue')['default']
|
||||||
XmlFormatter: typeof import('./src/tools/xml-formatter/xml-formatter.vue')['default']
|
XmlFormatter: typeof import('./src/tools/xml-formatter/xml-formatter.vue')['default']
|
||||||
XmlToJson: typeof import('./src/tools/xml-to-json/xml-to-json.vue')['default']
|
XmlToJson: typeof import('./src/tools/xml-to-json/xml-to-json.vue')['default']
|
||||||
XpathTester: typeof import('./src/tools/xpath-tester/xpath-tester.vue')['default']
|
|
||||||
YamlToJson: typeof import('./src/tools/yaml-to-json-converter/yaml-to-json.vue')['default']
|
YamlToJson: typeof import('./src/tools/yaml-to-json-converter/yaml-to-json.vue')['default']
|
||||||
YamlToToml: typeof import('./src/tools/yaml-to-toml/yaml-to-toml.vue')['default']
|
YamlToToml: typeof import('./src/tools/yaml-to-toml/yaml-to-toml.vue')['default']
|
||||||
YamlViewer: typeof import('./src/tools/yaml-viewer/yaml-viewer.vue')['default']
|
YamlViewer: typeof import('./src/tools/yaml-viewer/yaml-viewer.vue')['default']
|
||||||
|
|||||||
+2
-2
@@ -42,12 +42,12 @@
|
|||||||
"@tiptap/starter-kit": "2.1.6",
|
"@tiptap/starter-kit": "2.1.6",
|
||||||
"@tiptap/vue-3": "2.0.3",
|
"@tiptap/vue-3": "2.0.3",
|
||||||
"@types/figlet": "^1.5.8",
|
"@types/figlet": "^1.5.8",
|
||||||
|
"@types/punycode": "^2.1.4",
|
||||||
"@vicons/material": "^0.12.0",
|
"@vicons/material": "^0.12.0",
|
||||||
"@vicons/tabler": "^0.12.0",
|
"@vicons/tabler": "^0.12.0",
|
||||||
"@vueuse/core": "^10.3.0",
|
"@vueuse/core": "^10.3.0",
|
||||||
"@vueuse/head": "^1.0.0",
|
"@vueuse/head": "^1.0.0",
|
||||||
"@vueuse/router": "^10.0.0",
|
"@vueuse/router": "^10.0.0",
|
||||||
"@xmldom/xmldom": "^0.8.10",
|
|
||||||
"bcryptjs": "^2.4.3",
|
"bcryptjs": "^2.4.3",
|
||||||
"change-case": "^4.1.2",
|
"change-case": "^4.1.2",
|
||||||
"colord": "^2.9.3",
|
"colord": "^2.9.3",
|
||||||
@@ -82,6 +82,7 @@
|
|||||||
"pdf-signature-reader": "^1.4.2",
|
"pdf-signature-reader": "^1.4.2",
|
||||||
"pinia": "^2.0.34",
|
"pinia": "^2.0.34",
|
||||||
"plausible-tracker": "^0.3.8",
|
"plausible-tracker": "^0.3.8",
|
||||||
|
"punycode": "^2.3.1",
|
||||||
"qrcode": "^1.5.1",
|
"qrcode": "^1.5.1",
|
||||||
"sql-formatter": "^13.0.0",
|
"sql-formatter": "^13.0.0",
|
||||||
"ua-parser-js": "^1.0.35",
|
"ua-parser-js": "^1.0.35",
|
||||||
@@ -95,7 +96,6 @@
|
|||||||
"vue-tsc": "^1.8.1",
|
"vue-tsc": "^1.8.1",
|
||||||
"xml-formatter": "^3.3.2",
|
"xml-formatter": "^3.3.2",
|
||||||
"xml-js": "^1.6.11",
|
"xml-js": "^1.6.11",
|
||||||
"xpath": "^0.0.34",
|
|
||||||
"yaml": "^2.2.1"
|
"yaml": "^2.2.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
|||||||
Generated
+13
-25
@@ -26,6 +26,9 @@ dependencies:
|
|||||||
'@types/figlet':
|
'@types/figlet':
|
||||||
specifier: ^1.5.8
|
specifier: ^1.5.8
|
||||||
version: 1.5.8
|
version: 1.5.8
|
||||||
|
'@types/punycode':
|
||||||
|
specifier: ^2.1.4
|
||||||
|
version: 2.1.4
|
||||||
'@vicons/material':
|
'@vicons/material':
|
||||||
specifier: ^0.12.0
|
specifier: ^0.12.0
|
||||||
version: 0.12.0
|
version: 0.12.0
|
||||||
@@ -41,9 +44,6 @@ dependencies:
|
|||||||
'@vueuse/router':
|
'@vueuse/router':
|
||||||
specifier: ^10.0.0
|
specifier: ^10.0.0
|
||||||
version: 10.0.0(vue-router@4.1.6)(vue@3.3.4)
|
version: 10.0.0(vue-router@4.1.6)(vue@3.3.4)
|
||||||
'@xmldom/xmldom':
|
|
||||||
specifier: ^0.8.10
|
|
||||||
version: 0.8.10
|
|
||||||
bcryptjs:
|
bcryptjs:
|
||||||
specifier: ^2.4.3
|
specifier: ^2.4.3
|
||||||
version: 2.4.3
|
version: 2.4.3
|
||||||
@@ -146,6 +146,9 @@ dependencies:
|
|||||||
plausible-tracker:
|
plausible-tracker:
|
||||||
specifier: ^0.3.8
|
specifier: ^0.3.8
|
||||||
version: 0.3.8
|
version: 0.3.8
|
||||||
|
punycode:
|
||||||
|
specifier: ^2.3.1
|
||||||
|
version: 2.3.1
|
||||||
qrcode:
|
qrcode:
|
||||||
specifier: ^1.5.1
|
specifier: ^1.5.1
|
||||||
version: 1.5.1
|
version: 1.5.1
|
||||||
@@ -185,9 +188,6 @@ dependencies:
|
|||||||
xml-js:
|
xml-js:
|
||||||
specifier: ^1.6.11
|
specifier: ^1.6.11
|
||||||
version: 1.6.11
|
version: 1.6.11
|
||||||
xpath:
|
|
||||||
specifier: ^0.0.34
|
|
||||||
version: 0.0.34
|
|
||||||
yaml:
|
yaml:
|
||||||
specifier: ^2.2.1
|
specifier: ^2.2.1
|
||||||
version: 2.2.1
|
version: 2.2.1
|
||||||
@@ -3038,6 +3038,10 @@ packages:
|
|||||||
resolution: {integrity: sha512-ZREFYlpUmPQJ0esjxoG1fMvB2HNaD3z+mjqdSosZvd3RalncI9NEur73P8ZJz4YQdL64CmV1w0RuqoRUlhQRBw==}
|
resolution: {integrity: sha512-ZREFYlpUmPQJ0esjxoG1fMvB2HNaD3z+mjqdSosZvd3RalncI9NEur73P8ZJz4YQdL64CmV1w0RuqoRUlhQRBw==}
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
|
/@types/punycode@2.1.4:
|
||||||
|
resolution: {integrity: sha512-trzh6NzBnq8yw5e35f8xe8VTYjqM3NE7bohBtvDVf/dtUer3zYTLK1Ka3DG3p7bdtoaOHZucma6FfVKlQ134pQ==}
|
||||||
|
dev: false
|
||||||
|
|
||||||
/@types/qrcode@1.5.0:
|
/@types/qrcode@1.5.0:
|
||||||
resolution: {integrity: sha512-x5ilHXRxUPIMfjtM+1vf/GPTRWZ81nqscursm5gMznJeK9M0YnZ1c3bEvRLQ0zSSgedLx1J6MGL231ObQGGhaA==}
|
resolution: {integrity: sha512-x5ilHXRxUPIMfjtM+1vf/GPTRWZ81nqscursm5gMznJeK9M0YnZ1c3bEvRLQ0zSSgedLx1J6MGL231ObQGGhaA==}
|
||||||
dependencies:
|
dependencies:
|
||||||
@@ -4017,11 +4021,6 @@ packages:
|
|||||||
- vue
|
- vue
|
||||||
dev: false
|
dev: false
|
||||||
|
|
||||||
/@xmldom/xmldom@0.8.10:
|
|
||||||
resolution: {integrity: sha512-2WALfTl4xo2SkGCYRt6rDTFfk9R1czmBvUQy12gK2KuRKIpWEhcbbzy8EZXtz/jkRqHX8bFEc6FC1HjX4TUWYw==}
|
|
||||||
engines: {node: '>=10.0.0'}
|
|
||||||
dev: false
|
|
||||||
|
|
||||||
/@zhead/schema@1.0.0-beta.13:
|
/@zhead/schema@1.0.0-beta.13:
|
||||||
resolution: {integrity: sha512-P1A1vRGFBhITco8Iw4/hvnDYoE/SoVrd71dW1pBFdXJb3vP+pBtoOuhbEKy0ROJGOyzQuqvFibcwzyLlWMqNiQ==}
|
resolution: {integrity: sha512-P1A1vRGFBhITco8Iw4/hvnDYoE/SoVrd71dW1pBFdXJb3vP+pBtoOuhbEKy0ROJGOyzQuqvFibcwzyLlWMqNiQ==}
|
||||||
dev: false
|
dev: false
|
||||||
@@ -7693,15 +7692,9 @@ packages:
|
|||||||
resolution: {integrity: sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag==}
|
resolution: {integrity: sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag==}
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/punycode@2.3.0:
|
|
||||||
resolution: {integrity: sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA==}
|
|
||||||
engines: {node: '>=6'}
|
|
||||||
dev: true
|
|
||||||
|
|
||||||
/punycode@2.3.1:
|
/punycode@2.3.1:
|
||||||
resolution: {integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==}
|
resolution: {integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==}
|
||||||
engines: {node: '>=6'}
|
engines: {node: '>=6'}
|
||||||
dev: true
|
|
||||||
|
|
||||||
/qrcode@1.5.1:
|
/qrcode@1.5.1:
|
||||||
resolution: {integrity: sha512-nS8NJ1Z3md8uTjKtP+SGGhfqmTCs5flU/xR623oI0JX+Wepz9R8UrRVCTBTJm3qGw3rH6jJ6MUHjkDx15cxSSg==}
|
resolution: {integrity: sha512-nS8NJ1Z3md8uTjKtP+SGGhfqmTCs5flU/xR623oI0JX+Wepz9R8UrRVCTBTJm3qGw3rH6jJ6MUHjkDx15cxSSg==}
|
||||||
@@ -8491,7 +8484,7 @@ packages:
|
|||||||
engines: {node: '>=6'}
|
engines: {node: '>=6'}
|
||||||
dependencies:
|
dependencies:
|
||||||
psl: 1.9.0
|
psl: 1.9.0
|
||||||
punycode: 2.3.0
|
punycode: 2.3.1
|
||||||
universalify: 0.2.0
|
universalify: 0.2.0
|
||||||
url-parse: 1.5.10
|
url-parse: 1.5.10
|
||||||
dev: true
|
dev: true
|
||||||
@@ -8506,7 +8499,7 @@ packages:
|
|||||||
resolution: {integrity: sha512-2lv/66T7e5yNyhAAC4NaKe5nVavzuGJQVVtRYLyQ2OI8tsJ61PMLlelehb0wi2Hx6+hT/OJUWZcw8MjlSRnxvw==}
|
resolution: {integrity: sha512-2lv/66T7e5yNyhAAC4NaKe5nVavzuGJQVVtRYLyQ2OI8tsJ61PMLlelehb0wi2Hx6+hT/OJUWZcw8MjlSRnxvw==}
|
||||||
engines: {node: '>=14'}
|
engines: {node: '>=14'}
|
||||||
dependencies:
|
dependencies:
|
||||||
punycode: 2.3.0
|
punycode: 2.3.1
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/treemate@0.3.11:
|
/treemate@0.3.11:
|
||||||
@@ -8946,7 +8939,7 @@ packages:
|
|||||||
/uri-js@4.4.1:
|
/uri-js@4.4.1:
|
||||||
resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==}
|
resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==}
|
||||||
dependencies:
|
dependencies:
|
||||||
punycode: 2.3.0
|
punycode: 2.3.1
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/url-parse@1.5.10:
|
/url-parse@1.5.10:
|
||||||
@@ -9598,11 +9591,6 @@ packages:
|
|||||||
resolution: {integrity: sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==}
|
resolution: {integrity: sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==}
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/xpath@0.0.34:
|
|
||||||
resolution: {integrity: sha512-FxF6+rkr1rNSQrhUNYrAFJpRXNzlDoMxeXN5qI84939ylEv3qqPFKa85Oxr6tDaJKqwW6KKyo2v26TSv3k6LeA==}
|
|
||||||
engines: {node: '>=0.6.0'}
|
|
||||||
dev: false
|
|
||||||
|
|
||||||
/y18n@4.0.3:
|
/y18n@4.0.3:
|
||||||
resolution: {integrity: sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==}
|
resolution: {integrity: sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==}
|
||||||
dev: false
|
dev: false
|
||||||
|
|||||||
+11
-3
@@ -2,7 +2,7 @@ import { tool as base64FileConverter } from './base64-file-converter';
|
|||||||
import { tool as base64StringConverter } from './base64-string-converter';
|
import { tool as base64StringConverter } from './base64-string-converter';
|
||||||
import { tool as basicAuthGenerator } from './basic-auth-generator';
|
import { tool as basicAuthGenerator } from './basic-auth-generator';
|
||||||
import { tool as emailNormalizer } from './email-normalizer';
|
import { tool as emailNormalizer } from './email-normalizer';
|
||||||
import { tool as xpathTester } from './xpath-tester';
|
import { tool as punycodeConverter } from './punycode-converter';
|
||||||
|
|
||||||
import { tool as asciiTextDrawer } from './ascii-text-drawer';
|
import { tool as asciiTextDrawer } from './ascii-text-drawer';
|
||||||
|
|
||||||
@@ -155,12 +155,20 @@ export const toolsByCategory: ToolCategory[] = [
|
|||||||
xmlFormatter,
|
xmlFormatter,
|
||||||
yamlViewer,
|
yamlViewer,
|
||||||
emailNormalizer,
|
emailNormalizer,
|
||||||
xpathTester,
|
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'Network',
|
name: 'Network',
|
||||||
components: [ipv4SubnetCalculator, ipv4AddressConverter, ipv4RangeExpander, macAddressLookup, macAddressGenerator, ipv6UlaGenerator],
|
components: [
|
||||||
|
ipv4SubnetCalculator,
|
||||||
|
ipv4AddressConverter,
|
||||||
|
// ipv6AddressConverter,
|
||||||
|
ipv4RangeExpander,
|
||||||
|
macAddressLookup,
|
||||||
|
macAddressGenerator,
|
||||||
|
ipv6UlaGenerator,
|
||||||
|
punycodeConverter,
|
||||||
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'Math',
|
name: 'Math',
|
||||||
|
|||||||
@@ -0,0 +1,12 @@
|
|||||||
|
import { World } from '@vicons/tabler';
|
||||||
|
import { defineTool } from '../tool';
|
||||||
|
|
||||||
|
export const tool = defineTool({
|
||||||
|
name: 'Punycode Converter',
|
||||||
|
path: '/punycode-converter',
|
||||||
|
description: 'Convert international unicode domain names or emails from/to ASCII Punycode version',
|
||||||
|
keywords: ['punycode', 'converter', 'rfc3492', 'bootstring', 'domain', 'dns'],
|
||||||
|
component: () => import('./punycode-converter.vue'),
|
||||||
|
icon: World,
|
||||||
|
createdAt: new Date('2024-08-15'),
|
||||||
|
});
|
||||||
@@ -0,0 +1,66 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
import { toASCII, toUnicode } from 'punycode/';
|
||||||
|
import TextareaCopyable from '@/components/TextareaCopyable.vue';
|
||||||
|
|
||||||
|
const punycodeInput = ref('');
|
||||||
|
const intlOutput = computed(
|
||||||
|
() => {
|
||||||
|
try {
|
||||||
|
return toUnicode(punycodeInput.value?.trim());
|
||||||
|
}
|
||||||
|
catch (e: any) {
|
||||||
|
return e.toString();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
||||||
|
const intlInput = ref('');
|
||||||
|
const punycodeOutput = computed(
|
||||||
|
() => {
|
||||||
|
try {
|
||||||
|
return toASCII(intlInput.value?.trim());
|
||||||
|
}
|
||||||
|
catch (e: any) {
|
||||||
|
return e.toString();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
);
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div max-w-600>
|
||||||
|
<c-card title="Punycode to International">
|
||||||
|
<c-input-text
|
||||||
|
v-model:value="punycodeInput"
|
||||||
|
placeholder="Put your punycode domain name or email to decode..."
|
||||||
|
label="Punycode Domain name/Email"
|
||||||
|
raw-text
|
||||||
|
/>
|
||||||
|
|
||||||
|
<n-divider />
|
||||||
|
|
||||||
|
<TextareaCopyable
|
||||||
|
label="Decoded Domain name/Email"
|
||||||
|
:value="intlOutput"
|
||||||
|
readonly
|
||||||
|
/>
|
||||||
|
</c-card>
|
||||||
|
|
||||||
|
<c-card title="International to Punycode" mt-5>
|
||||||
|
<c-input-text
|
||||||
|
v-model:value="intlInput"
|
||||||
|
placeholder="Put your international domain or email name here..."
|
||||||
|
label="Domain name or email to encode"
|
||||||
|
raw-text
|
||||||
|
/>
|
||||||
|
|
||||||
|
<n-divider />
|
||||||
|
|
||||||
|
<TextareaCopyable
|
||||||
|
label="Punycode Domain name/Email"
|
||||||
|
:value="punycodeOutput"
|
||||||
|
readonly
|
||||||
|
/>
|
||||||
|
</c-card>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
import { Brackets } from '@vicons/tabler';
|
|
||||||
import { defineTool } from '../tool';
|
|
||||||
|
|
||||||
export const tool = defineTool({
|
|
||||||
name: 'XPath Tester',
|
|
||||||
path: '/xpath-tester',
|
|
||||||
description: 'Test XPath expression against XML content',
|
|
||||||
keywords: ['xpath', 'xml', 'tester'],
|
|
||||||
component: () => import('./xpath-tester.vue'),
|
|
||||||
icon: Brackets,
|
|
||||||
createdAt: new Date('2024-08-15'),
|
|
||||||
});
|
|
||||||
@@ -1,66 +0,0 @@
|
|||||||
<script setup lang="ts">
|
|
||||||
import XPathEngine from 'xpath';
|
|
||||||
import { DOMParser } from '@xmldom/xmldom';
|
|
||||||
import { useValidation } from '@/composable/validation';
|
|
||||||
|
|
||||||
const xpath = ref('//title');
|
|
||||||
const xml = ref('<book><title>Harry Potter</title></book>');
|
|
||||||
|
|
||||||
const selectedNodes = computed(() => {
|
|
||||||
try {
|
|
||||||
const doc = new DOMParser().parseFromString(xml.value, 'text/xml');
|
|
||||||
const result = XPathEngine.select(xpath.value, doc);
|
|
||||||
return Array.isArray(result) ? result : [result];
|
|
||||||
}
|
|
||||||
catch (e: any) {
|
|
||||||
return [e.toString()];
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
const xmlValidation = useValidation({
|
|
||||||
source: xml,
|
|
||||||
rules: [
|
|
||||||
{
|
|
||||||
validator: (v) => {
|
|
||||||
new DOMParser().parseFromString(v, 'text/xml');
|
|
||||||
return true;
|
|
||||||
},
|
|
||||||
message: 'Provided XML is not valid.',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<template>
|
|
||||||
<div style="max-width: 600px;">
|
|
||||||
<c-card title="Input" mb-2>
|
|
||||||
<c-input-text
|
|
||||||
v-model:value="xpath"
|
|
||||||
label="XPath Expression"
|
|
||||||
placeholder="Put your XPath expression here..."
|
|
||||||
mb-2
|
|
||||||
/>
|
|
||||||
|
|
||||||
<c-input-text
|
|
||||||
v-model:value="xml"
|
|
||||||
label="XML"
|
|
||||||
multiline
|
|
||||||
placeholder="Put your XML here..."
|
|
||||||
rows="5"
|
|
||||||
:validation="xmlValidation"
|
|
||||||
mb-2
|
|
||||||
/>
|
|
||||||
</c-card>
|
|
||||||
|
|
||||||
<c-card title="Result(s)">
|
|
||||||
<ul v-if="selectedNodes?.length > 0">
|
|
||||||
<li v-for="(node, index) in selectedNodes" :key="index">
|
|
||||||
{{ node }}
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
<c-alert v-if="!selectedNodes?.length">
|
|
||||||
XPath expression selected nothing
|
|
||||||
</c-alert>
|
|
||||||
</c-card>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
Reference in new issue
Block a user