mirror of
https://github.com/sharevb/it-tools.git
synced 2026-11-24 06:40:20 +03:00
Compare commits
72
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a99d322926 | ||
|
|
6743523b50 | ||
|
|
0e038509e7 | ||
|
|
1b45ce3ca7 | ||
|
|
e2448b6339 | ||
|
|
6ef5e596e7 | ||
|
|
c016ed8ba9 | ||
|
|
91da9baed4 | ||
|
|
48854592b0 | ||
|
|
e2a6580851 | ||
|
|
9eb888f49b | ||
|
|
648ef7bca6 | ||
|
|
3e1b05fa22 | ||
|
|
386b4fd7a2 | ||
|
|
009864506d | ||
|
|
4c600f0a6d | ||
|
|
3a11b592f3 | ||
|
|
dae5fe60b7 | ||
|
|
99f4f830bb | ||
|
|
8de053540a | ||
|
|
7a48c2fe41 | ||
|
|
665db9b9ec | ||
|
|
dd5ca6f693 | ||
|
|
eaa8b5b672 | ||
|
|
368d088c7e | ||
|
|
00053c3e83 | ||
|
|
6762677a94 | ||
|
|
3b21a6b60e | ||
|
|
58e2fb39b7 | ||
|
|
91f565f839 | ||
|
|
937ddc64c7 | ||
|
|
2593df0ef5 | ||
|
|
9c925ac711 | ||
|
|
2da9832fd9 | ||
|
|
4751417bf6 | ||
|
|
e073f3b99a | ||
|
|
77e76679b0 | ||
|
|
93532cec55 | ||
|
|
b982fa5e56 | ||
|
|
41d24a52e7 | ||
|
|
134a5e829b | ||
|
|
ca12661fa1 | ||
|
|
6cb20b76b1 | ||
|
|
ece277001f | ||
|
|
3564ccfb7d | ||
|
|
4089c6231f | ||
|
|
1829733f3b | ||
|
|
6eccfc126e | ||
|
|
68c56e4742 | ||
|
|
02e40dced8 | ||
|
|
7931c9ba3c | ||
|
|
40d90b94a2 | ||
|
|
bcf93f3824 | ||
|
|
0e9c33ddd3 | ||
|
|
f4d4de8cc3 | ||
|
|
2160e7a894 | ||
|
|
2c12e1e38c | ||
|
|
8efe340740 | ||
|
|
2037d14cd6 | ||
|
|
e99d7b4755 | ||
|
|
35e91b3008 | ||
|
|
af6ccec7ff | ||
|
|
06e4f84749 | ||
|
|
f01d56cd6b | ||
|
|
faaeeb28fa | ||
|
|
520d2cd77f | ||
|
|
2464f1ff3e | ||
|
|
ec865b7595 | ||
|
|
53aa948027 | ||
|
|
5a990ae515 | ||
|
|
4cc875f2d2 | ||
|
|
7ed2e419c6 |
No files matched your search
@@ -11,7 +11,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4
|
||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
|
||||
- run: |
|
||||
echo "Before: corepack version => $(corepack --version || echo 'not installed')"
|
||||
npm install -g corepack@latest
|
||||
|
||||
@@ -37,7 +37,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
|
||||
|
||||
# Initializes the CodeQL tools for scanning.
|
||||
- name: Initialize CodeQL
|
||||
@@ -55,7 +55,7 @@ jobs:
|
||||
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
|
||||
# If this step fails, then you should remove it and run the build manually (see below)
|
||||
- name: Autobuild
|
||||
uses: github/codeql-action/autobuild@v2
|
||||
uses: github/codeql-action/autobuild@v3
|
||||
|
||||
# ℹ️ Command-line programs to run using the OS shell.
|
||||
# 📚 https://git.io/JvXDl
|
||||
@@ -69,4 +69,4 @@ jobs:
|
||||
# make release
|
||||
|
||||
- name: Perform CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@v2
|
||||
uses: github/codeql-action/analyze@v3
|
||||
@@ -12,7 +12,7 @@ jobs:
|
||||
outputs:
|
||||
should_run: ${{ steps.should_run.outputs.should_run }}
|
||||
steps:
|
||||
- uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4
|
||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
|
||||
- name: print latest_commit
|
||||
run: echo ${{ github.sha }}
|
||||
|
||||
@@ -28,7 +28,7 @@ jobs:
|
||||
if: ${{ needs.check_date.outputs.should_run != 'false' }}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4
|
||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
|
||||
- run: |
|
||||
echo "Before: corepack version => $(corepack --version || echo 'not installed')"
|
||||
npm install -g corepack@latest
|
||||
@@ -60,7 +60,7 @@ jobs:
|
||||
steps:
|
||||
# Checkout the repository
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Login to Docker Hub
|
||||
uses: docker/login-action@v3
|
||||
|
||||
+2
-13
@@ -1,4 +1,4 @@
|
||||
name: Build and Push Docker Image
|
||||
name: Build and Push Docker Image (baseurl-it-tools)
|
||||
|
||||
on:
|
||||
push:
|
||||
@@ -41,7 +41,7 @@ jobs:
|
||||
steps:
|
||||
# Checkout the repository
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Login to Docker Hub
|
||||
uses: docker/login-action@v3
|
||||
@@ -75,17 +75,6 @@ jobs:
|
||||
sharevb/it-tools:baseurl-it-tools
|
||||
ghcr.io/sharevb/it-tools:baseurl-it-tools
|
||||
|
||||
- name: Build and push
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
context: .
|
||||
file: ./Dockerfile
|
||||
platforms: linux/amd64,linux/arm64
|
||||
push: true
|
||||
tags: |
|
||||
sharevb/it-tools:latest
|
||||
ghcr.io/${{ github.repository_owner }}/it-tools:latest
|
||||
|
||||
# Optionally log out
|
||||
- name: Log out from GitHub Container Registry
|
||||
run: docker logout ghcr.io
|
||||
@@ -0,0 +1,78 @@
|
||||
name: Build and Push Docker Image (latest)
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- chore/all-my-stuffs
|
||||
|
||||
jobs:
|
||||
ci:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- run: |
|
||||
echo "Before: corepack version => $(corepack --version || echo 'not installed')"
|
||||
npm install -g corepack@latest
|
||||
echo "After : corepack version => $(corepack --version)"
|
||||
corepack enable
|
||||
pnpm --version
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 20
|
||||
cache: 'pnpm'
|
||||
|
||||
- name: Install dependencies
|
||||
run: pnpm i
|
||||
|
||||
- name: Run linters
|
||||
run: pnpm lint
|
||||
|
||||
- name: Run unit tests
|
||||
run: pnpm test
|
||||
|
||||
- name: Build the app
|
||||
run: pnpm build
|
||||
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
needs:
|
||||
- ci
|
||||
steps:
|
||||
# Checkout the repository
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Login to Docker Hub
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
|
||||
- name: Login to GitHub Container Registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.repository_owner }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Build and push
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
context: .
|
||||
file: ./Dockerfile
|
||||
platforms: linux/amd64,linux/arm64
|
||||
push: true
|
||||
tags: |
|
||||
sharevb/it-tools:latest
|
||||
ghcr.io/${{ github.repository_owner }}/it-tools:latest
|
||||
|
||||
# Optionally log out
|
||||
- name: Log out from GitHub Container Registry
|
||||
run: docker logout ghcr.io
|
||||
@@ -12,7 +12,7 @@ jobs:
|
||||
matrix:
|
||||
shard: [1/3, 2/3, 3/3]
|
||||
steps:
|
||||
- uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4
|
||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
|
||||
|
||||
- run: |
|
||||
echo "Before: corepack version => $(corepack --version || echo 'not installed')"
|
||||
@@ -37,7 +37,7 @@ jobs:
|
||||
run: pnpm build
|
||||
|
||||
- name: Restore Playwright browsers from cache
|
||||
uses: actions/cache@v3
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/.cache/ms-playwright
|
||||
key: ${{ runner.os }}-playwright-${{ steps.playwright-version.outputs.PLAYWRIGHT_VERSION }}-${{ hashFiles('**/playwright.config.ts') }}
|
||||
|
||||
@@ -13,7 +13,7 @@ jobs:
|
||||
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
|
||||
|
||||
- name: Login to Docker Hub
|
||||
uses: docker/login-action@v3
|
||||
@@ -70,7 +70,7 @@ jobs:
|
||||
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
|
||||
|
||||
- run: |
|
||||
echo "Before: corepack version => $(corepack --version || echo 'not installed')"
|
||||
|
||||
@@ -50,10 +50,10 @@ Category matches on category (English) names ; Tools matches on tools path/url.
|
||||
|
||||
See (docker-tools-filter-and-home-content)[https://github.com/sharevb/it-tools]
|
||||
|
||||
## To build using a custom folder:
|
||||
## To build using a custom default language:
|
||||
|
||||
```
|
||||
docker build -t it-tools-fr --build-arg BVITE_LANGUAGE=fr .
|
||||
docker build -t it-tools-fr --build-arg VITE_LANGUAGE=fr .
|
||||
docker run -d --name it-tools-fr --restart unless-stopped -p 8080:8080 it-tools-fr
|
||||
```
|
||||
|
||||
|
||||
Vendored
+37
-7
@@ -31,7 +31,9 @@ declare module '@vue/runtime-core' {
|
||||
BasicAuthGenerator: typeof import('./src/tools/basic-auth-generator/basic-auth-generator.vue')['default']
|
||||
Bcrypt: typeof import('./src/tools/bcrypt/bcrypt.vue')['default']
|
||||
BenchmarkBuilder: typeof import('./src/tools/benchmark-builder/benchmark-builder.vue')['default']
|
||||
BimiDnsGenerator: typeof import('./src/tools/bimi-dns-generator/bimi-dns-generator.vue')['default']
|
||||
Bip39Generator: typeof import('./src/tools/bip39-generator/bip39-generator.vue')['default']
|
||||
BmiCalculator: typeof import('./src/tools/bmi-calculator/bmi-calculator.vue')['default']
|
||||
BounceParser: typeof import('./src/tools/bounce-parser/bounce-parser.vue')['default']
|
||||
CAlert: typeof import('./src/ui/c-alert/c-alert.vue')['default']
|
||||
'CAlert.demo': typeof import('./src/ui/c-alert/c-alert.demo.vue')['default']
|
||||
@@ -78,6 +80,7 @@ declare module '@vue/runtime-core' {
|
||||
CommandPaletteOption: typeof import('./src/modules/command-palette/components/command-palette-option.vue')['default']
|
||||
CommonRegex: typeof import('./src/tools/common-regex-memo/common-regex.md')['default']
|
||||
CommonRegexMemo: typeof import('./src/tools/common-regex-memo/common-regex-memo.vue')['default']
|
||||
CookiesParser: typeof import('./src/tools/cookies-parser/cookies-parser.vue')['default']
|
||||
Countdown: typeof import('./src/tools/countdown/countdown.vue')['default']
|
||||
Counter: typeof import('./src/tools/pomodoro-timer/app/components/Counter.vue')['default']
|
||||
CrcCalculator: typeof import('./src/tools/crc-calculator/crc-calculator.vue')['default']
|
||||
@@ -89,6 +92,7 @@ declare module '@vue/runtime-core' {
|
||||
CssSelectors: typeof import('./src/tools/css-selectors-memo/css-selectors.md')['default']
|
||||
CssSelectorsMemo: typeof import('./src/tools/css-selectors-memo/css-selectors-memo.vue')['default']
|
||||
CssXpathConverter: typeof import('./src/tools/css-xpath-converter/css-xpath-converter.vue')['default']
|
||||
CsvToData: typeof import('./src/tools/csv-to-data/csv-to-data.vue')['default']
|
||||
CsvToJson: typeof import('./src/tools/csv-to-json/csv-to-json.vue')['default']
|
||||
CTable: typeof import('./src/ui/c-table/c-table.vue')['default']
|
||||
'CTable.demo': typeof import('./src/ui/c-table/c-table.demo.vue')['default']
|
||||
@@ -97,7 +101,9 @@ declare module '@vue/runtime-core' {
|
||||
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']
|
||||
CurlGenerator: typeof import('./src/tools/curl-generator/curl-generator.vue')['default']
|
||||
CurrencyConverter: typeof import('./src/tools/currency-converter/currency-converter.vue')['default']
|
||||
DataFaker: typeof import('./src/tools/data-faker/data-faker.vue')['default']
|
||||
DataStorageUnitConverter: typeof import('./src/tools/data-storage-unit-converter/data-storage-unit-converter.vue')['default']
|
||||
DataTransferRateConverter: typeof import('./src/tools/data-transfer-rate-converter/data-transfer-rate-converter.vue')['default']
|
||||
DateDurationCalculator: typeof import('./src/tools/date-duration-calculator/date-duration-calculator.vue')['default']
|
||||
@@ -108,6 +114,9 @@ declare module '@vue/runtime-core' {
|
||||
DeviceInformation: typeof import('./src/tools/device-information/device-information.vue')['default']
|
||||
DiceRoller: typeof import('./src/tools/dice-roller/dice-roller.vue')['default']
|
||||
DiffViewer: typeof import('./src/tools/json-diff/diff-viewer/diff-viewer.vue')['default']
|
||||
DistinctWords: typeof import('./src/tools/distinct-words/distinct-words.vue')['default']
|
||||
DkimDnsGenerator: typeof import('./src/tools/dkim-dns-generator/dkim-dns-generator.vue')['default']
|
||||
DmarcDnsGenerator: typeof import('./src/tools/dmarc-dns-generator/dmarc-dns-generator.vue')['default']
|
||||
DmarcReportAnalyzer: typeof import('./src/tools/dmarc-report-analyzer/dmarc-report-analyzer.vue')['default']
|
||||
DnsQueries: typeof import('./src/tools/dns-queries/dns-queries.vue')['default']
|
||||
Docker: typeof import('./src/tools/docker-memo/docker.md')['default']
|
||||
@@ -133,20 +142,25 @@ declare module '@vue/runtime-core' {
|
||||
EnergyComputer: typeof import('./src/tools/energy-computer/energy-computer.vue')['default']
|
||||
EnergyConverter: typeof import('./src/tools/energy-converter/energy-converter.vue')['default']
|
||||
EtaCalculator: typeof import('./src/tools/eta-calculator/eta-calculator.vue')['default']
|
||||
ExcelToData: typeof import('./src/tools/excel-to-data/excel-to-data.vue')['default']
|
||||
ExtractTextFromHtml: typeof import('./src/tools/extract-text-from-html/extract-text-from-html.vue')['default']
|
||||
FavoriteButton: typeof import('./src/components/FavoriteButton.vue')['default']
|
||||
FileHasher: typeof import('./src/tools/file-hasher/file-hasher.vue')['default']
|
||||
FileType: typeof import('./src/tools/file-type/file-type.vue')['default']
|
||||
FinishedPopup: typeof import('./src/tools/pomodoro-timer/app/components/FinishedPopup.vue')['default']
|
||||
FirewalldGenerator: typeof import('./src/tools/firewalld-generator/firewalld-generator.vue')['default']
|
||||
FloatingPointNumberConverter: typeof import('./src/tools/floating-point-number-converter/floating-point-number-converter.vue')['default']
|
||||
FolderStructureDiagram: typeof import('./src/tools/folder-structure-diagram/folder-structure-diagram.vue')['default']
|
||||
Footer: typeof import('./src/tools/pomodoro-timer/app/components/Footer.vue')['default']
|
||||
ForceConverter: typeof import('./src/tools/force-converter/force-converter.vue')['default']
|
||||
FormatTransformer: typeof import('./src/components/FormatTransformer.vue')['default']
|
||||
FortuneWheel: typeof import('./src/tools/fortune-wheel/fortune-wheel.vue')['default']
|
||||
FstabGenerator: typeof import('./src/tools/fstab-generator/fstab-generator.vue')['default']
|
||||
GeoDistanceCalculator: typeof import('./src/tools/geo-distance-calculator/geo-distance-calculator.vue')['default']
|
||||
GitMemo: typeof import('./src/tools/git-memo/git-memo.vue')['default']
|
||||
'GitMemo.content': typeof import('./src/tools/git-memo/git-memo.content.md')['default']
|
||||
'GitSem.memo': typeof import('./src/tools/git-semantic-commit-memo/git-sem.memo.md')['default']
|
||||
GitSemanticCommitMemo: typeof import('./src/tools/git-semantic-commit-memo/git-semantic-commit-memo.vue')['default']
|
||||
GptTokenEstimator: typeof import('./src/tools/gpt-token-estimator/gpt-token-estimator.vue')['default']
|
||||
GzipConverter: typeof import('./src/tools/gzip-converter/gzip-converter.vue')['default']
|
||||
HarSanitizer: typeof import('./src/tools/har-sanitizer/har-sanitizer.vue')['default']
|
||||
@@ -159,6 +173,7 @@ declare module '@vue/runtime-core' {
|
||||
HmacGenerator: typeof import('./src/tools/hmac-generator/hmac-generator.vue')['default']
|
||||
Home: typeof import('./src/tools/pomodoro-timer/app/views/Home.vue')['default']
|
||||
'Home.page': typeof import('./src/pages/Home.page.vue')['default']
|
||||
HtaccessGenerator: typeof import('./src/tools/htaccess-generator/htaccess-generator.vue')['default']
|
||||
HtmlCleaner: typeof import('./src/tools/html-cleaner/html-cleaner.vue')['default']
|
||||
HtmlEntities: typeof import('./src/tools/html-entities/html-entities.vue')['default']
|
||||
HtmlPrettifier: typeof import('./src/tools/html-prettifier/html-prettifier.vue')['default']
|
||||
@@ -197,6 +212,7 @@ declare module '@vue/runtime-core' {
|
||||
IpGeoLocation: typeof import('./src/tools/ip-geo-location/ip-geo-location.vue')['default']
|
||||
IpIncludeExclude: typeof import('./src/tools/ip-include-exclude/ip-include-exclude.vue')['default']
|
||||
IpRangeToCidr: typeof import('./src/tools/ip-range-to-cidr/ip-range-to-cidr.vue')['default']
|
||||
IptablesGenerator: typeof import('./src/tools/iptables-generator/iptables-generator.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']
|
||||
@@ -226,10 +242,16 @@ declare module '@vue/runtime-core' {
|
||||
JsonToJava: typeof import('./src/tools/json-to-java/json-to-java.vue')['default']
|
||||
JsonToJavascript: typeof import('./src/tools/json-to-javascript/json-to-javascript.vue')['default']
|
||||
JsonToObject: typeof import('./src/tools/json-to-object/json-to-object.vue')['default']
|
||||
JsonToPhp: typeof import('./src/tools/json-to-php/json-to-php.vue')['default']
|
||||
JsonToPhpArray: typeof import('./src/tools/json-to-php-array/json-to-php-array.vue')['default']
|
||||
JsonToProtobuf: typeof import('./src/tools/json-to-protobuf/json-to-protobuf.vue')['default']
|
||||
JsonToPython: typeof import('./src/tools/json-to-python/json-to-python.vue')['default']
|
||||
JsonToSchema: typeof import('./src/tools/json-to-schema/json-to-schema.vue')['default']
|
||||
JsonToSqlDdl: typeof import('./src/tools/json-to-sql-ddl/json-to-sql-ddl.vue')['default']
|
||||
JsonToSqlInsert: typeof import('./src/tools/json-to-sql-insert/json-to-sql-insert.vue')['default']
|
||||
JsonToToml: typeof import('./src/tools/json-to-toml/json-to-toml.vue')['default']
|
||||
JsonToTs: typeof import('./src/tools/json-to-ts/json-to-ts.vue')['default']
|
||||
JsonToTypescript: typeof import('./src/tools/json-to-typescript/json-to-typescript.vue')['default']
|
||||
JsonToXml: typeof import('./src/tools/json-to-xml/json-to-xml.vue')['default']
|
||||
JsonToYaml: typeof import('./src/tools/json-to-yaml-converter/json-to-yaml.vue')['default']
|
||||
JsonViewer: typeof import('./src/tools/json-viewer/json-viewer.vue')['default']
|
||||
@@ -270,15 +292,14 @@ declare module '@vue/runtime-core' {
|
||||
MorseConverter: typeof import('./src/tools/morse-converter/morse-converter.vue')['default']
|
||||
MultiLinkDownloader: typeof import('./src/tools/multi-link-downloader/multi-link-downloader.vue')['default']
|
||||
MyIp: typeof import('./src/tools/my-ip/my-ip.vue')['default']
|
||||
NA: typeof import('naive-ui')['NA']
|
||||
NanoidGenerator: typeof import('./src/tools/nanoid-generator/nanoid-generator.vue')['default']
|
||||
NanoMemo: typeof import('./src/tools/nano-memo/nano-memo.vue')['default']
|
||||
'NanoMemo.content': typeof import('./src/tools/nano-memo/nano-memo.content.md')['default']
|
||||
NavbarButtons: typeof import('./src/components/NavbarButtons.vue')['default']
|
||||
NButton: typeof import('naive-ui')['NButton']
|
||||
NCode: typeof import('naive-ui')['NCode']
|
||||
NCollapseTransition: typeof import('naive-ui')['NCollapseTransition']
|
||||
NConfigProvider: typeof import('naive-ui')['NConfigProvider']
|
||||
NDivider: typeof import('naive-ui')['NDivider']
|
||||
NDataTable: typeof import('naive-ui')['NDataTable']
|
||||
NEllipsis: typeof import('naive-ui')['NEllipsis']
|
||||
NFormItem: typeof import('naive-ui')['NFormItem']
|
||||
NginxFormatter: typeof import('./src/tools/nginx-formatter/nginx-formatter.vue')['default']
|
||||
@@ -289,9 +310,7 @@ declare module '@vue/runtime-core' {
|
||||
NLayout: typeof import('naive-ui')['NLayout']
|
||||
NLayoutSider: typeof import('naive-ui')['NLayoutSider']
|
||||
NMenu: typeof import('naive-ui')['NMenu']
|
||||
NScrollbar: typeof import('naive-ui')['NScrollbar']
|
||||
NSpace: typeof import('naive-ui')['NSpace']
|
||||
NSwitch: typeof import('naive-ui')['NSwitch']
|
||||
NTable: typeof import('naive-ui')['NTable']
|
||||
NumberInput: typeof import('./src/tools/pomodoro-timer/app/components/NumberInput.vue')['default']
|
||||
NumeronymGenerator: typeof import('./src/tools/numeronym-generator/numeronym-generator.vue')['default']
|
||||
OcrImage: typeof import('./src/tools/ocr-image/ocr-image.vue')['default']
|
||||
@@ -299,10 +318,14 @@ declare module '@vue/runtime-core' {
|
||||
OtpCodeGeneratorAndValidator: typeof import('./src/tools/otp-code-generator-and-validator/otp-code-generator-and-validator.vue')['default']
|
||||
OutlookParser: typeof import('./src/tools/outlook-parser/outlook-parser.vue')['default']
|
||||
ParquetsReader: typeof import('./src/tools/parquets-reader/parquets-reader.vue')['default']
|
||||
PasetoEncryption: typeof import('./src/tools/paseto-encryption/paseto-encryption.vue')['default']
|
||||
PasetoSigning: typeof import('./src/tools/paseto-signing/paseto-signing.vue')['default']
|
||||
PassphraseGenerator: typeof import('./src/tools/passphrase-generator/passphrase-generator.vue')['default']
|
||||
PasswordStrengthAnalyser: typeof import('./src/tools/password-strength-analyser/password-strength-analyser.vue')['default']
|
||||
PasteAsMarkdown: typeof import('./src/tools/paste-as-markdown/paste-as-markdown.vue')['default']
|
||||
PdfConcat: typeof import('./src/tools/pdf-concat/pdf-concat.vue')['default']
|
||||
PdfEncrypt: typeof import('./src/tools/pdf-encrypt/pdf-encrypt.vue')['default']
|
||||
PdfExtract: typeof import('./src/tools/pdf-extract/pdf-extract.vue')['default']
|
||||
PdfLinearize: typeof import('./src/tools/pdf-linearize/pdf-linearize.vue')['default']
|
||||
PdfSignatureChecker: typeof import('./src/tools/pdf-signature-checker/pdf-signature-checker.vue')['default']
|
||||
PdfSignatureDetails: typeof import('./src/tools/pdf-signature-checker/components/pdf-signature-details.vue')['default']
|
||||
@@ -322,11 +345,12 @@ declare module '@vue/runtime-core' {
|
||||
PowerConverter: typeof import('./src/tools/power-converter/power-converter.vue')['default']
|
||||
PressureConverter: typeof import('./src/tools/pressure-converter/pressure-converter.vue')['default']
|
||||
ProgressBar: typeof import('./src/tools/pomodoro-timer/app/components/ProgressBar.vue')['default']
|
||||
PropertiesToYaml: typeof import('./src/tools/properties-to-yaml/properties-to-yaml.vue')['default']
|
||||
PropertiesConverter: typeof import('./src/tools/properties-converter/properties-converter.vue')['default']
|
||||
PunycodeConverter: typeof import('./src/tools/punycode-converter/punycode-converter.vue')['default']
|
||||
QrCodeDecoder: typeof import('./src/tools/qr-code-decoder/qr-code-decoder.vue')['default']
|
||||
QrCodeGenerator: typeof import('./src/tools/qr-code-generator/qr-code-generator.vue')['default']
|
||||
QrContactInfoGenerator: typeof import('./src/tools/qr-contact-info-generator/qr-contact-info-generator.vue')['default']
|
||||
QuoteConverter: typeof import('./src/tools/quote-converter/quote-converter.vue')['default']
|
||||
RaidCalculator: typeof import('./src/tools/raid-calculator/raid-calculator.vue')['default']
|
||||
RandomPortGenerator: typeof import('./src/tools/random-port-generator/random-port-generator.vue')['default']
|
||||
RegexMemo: typeof import('./src/tools/regex-memo/regex-memo.vue')['default']
|
||||
@@ -343,6 +367,7 @@ declare module '@vue/runtime-core' {
|
||||
RsaEcdsaSigning: typeof import('./src/tools/rsa-ecdsa-signing/rsa-ecdsa-signing.vue')['default']
|
||||
RsaEncryption: typeof import('./src/tools/rsa-encryption/rsa-encryption.vue')['default']
|
||||
RsaKeyPairGenerator: typeof import('./src/tools/rsa-key-pair-generator/rsa-key-pair-generator.vue')['default']
|
||||
RsyncGenerator: typeof import('./src/tools/rsync-generator/rsync-generator.vue')['default']
|
||||
RuneConverter: typeof import('./src/tools/rune-converter/rune-converter.vue')['default']
|
||||
SafelinkDecoder: typeof import('./src/tools/safelink-decoder/safelink-decoder.vue')['default']
|
||||
SensitiveDataMasker: typeof import('./src/tools/sensitive-data-masker/sensitive-data-masker.vue')['default']
|
||||
@@ -356,12 +381,16 @@ declare module '@vue/runtime-core' {
|
||||
SnowflakeIdExtractor: typeof import('./src/tools/snowflake-id-extractor/snowflake-id-extractor.vue')['default']
|
||||
SoftwareLicenceCompatibility: typeof import('./src/tools/software-licence-compatibility/software-licence-compatibility.vue')['default']
|
||||
SpanCopyable: typeof import('./src/components/SpanCopyable.vue')['default']
|
||||
SpfDnsGenerator: typeof import('./src/tools/spf-dns-generator/spf-dns-generator.vue')['default']
|
||||
SplashScreen: typeof import('./src/tools/pomodoro-timer/app/views/SplashScreen.vue')['default']
|
||||
SqlMinifier: typeof import('./src/tools/sql-minifier/sql-minifier.vue')['default']
|
||||
SqlPrettify: typeof import('./src/tools/sql-prettify/sql-prettify.vue')['default']
|
||||
SslCertConverter: typeof import('./src/tools/ssl-cert-converter/ssl-cert-converter.vue')['default']
|
||||
StacktracePrettier: typeof import('./src/tools/stacktrace-prettier/stacktrace-prettier.vue')['default']
|
||||
StringEscaper: typeof import('./src/tools/string-escaper/string-escaper.vue')['default']
|
||||
StringObfuscator: typeof import('./src/tools/string-obfuscator/string-obfuscator.vue')['default']
|
||||
SvgPlaceholderGenerator: typeof import('./src/tools/svg-placeholder-generator/svg-placeholder-generator.vue')['default']
|
||||
TcpdumpGenerator: typeof import('./src/tools/tcpdump-generator/tcpdump-generator.vue')['default']
|
||||
TemperatureConverter: typeof import('./src/tools/temperature-converter/temperature-converter.vue')['default']
|
||||
TextareaCopyable: typeof import('./src/components/TextareaCopyable.vue')['default']
|
||||
TextDiff: typeof import('./src/tools/text-diff/text-diff.vue')['default']
|
||||
@@ -379,6 +408,7 @@ declare module '@vue/runtime-core' {
|
||||
'Tool.layout': typeof import('./src/layouts/tool.layout.vue')['default']
|
||||
ToolCard: typeof import('./src/components/ToolCard.vue')['default']
|
||||
TorrentToMagnet: typeof import('./src/tools/torrent-to-magnet/torrent-to-magnet.vue')['default']
|
||||
TraefikComposeMaker: typeof import('./src/tools/traefik-compose-maker/traefik-compose-maker.vue')['default']
|
||||
TtlCalculator: typeof import('./src/tools/ttl-calculator/ttl-calculator.vue')['default']
|
||||
UlidGenerator: typeof import('./src/tools/ulid-generator/ulid-generator.vue')['default']
|
||||
UnicodeCharactersToJavaEntities: typeof import('./src/tools/unicode-characters-to-java-entities-converter/unicode-characters-to-java-entities.vue')['default']
|
||||
|
||||
+485
@@ -0,0 +1,485 @@
|
||||
home:
|
||||
categories:
|
||||
newestTools: أحدث الأدوات
|
||||
favoriteTools: 'أدواتك المفضلة'
|
||||
allTools: 'جميع الأدوات'
|
||||
favoritesDndToolTip: 'اسحب وأفلت لإعادة ترتيب المفضلة'
|
||||
subtitle: 'أدوات مفيدة للمطورين'
|
||||
toggleMenu: 'تبديل القائمة'
|
||||
home: الصفحة الرئيسية
|
||||
uiLib: 'UI Lib'
|
||||
support: 'ادعم تطوير IT-Tools'
|
||||
buyMeACoffee: 'ادعمنا بشراء قهوة'
|
||||
follow:
|
||||
title: 'هل يعجبك it-tools؟'
|
||||
p1: 'أعطنا نجمة على'
|
||||
githubRepository: 'مستودع IT-Tools على GitHub'
|
||||
p2: 'أو تابعنا على'
|
||||
twitterXAccount: 'حساب IT-Tools على X'
|
||||
thankYou: 'شكرًا لك!'
|
||||
nav:
|
||||
github: 'مستودع GitHub'
|
||||
githubRepository: 'مستودع IT-Tools على GitHub'
|
||||
twitterX: 'حساب X'
|
||||
twitterXAccount: 'حساب IT-Tools على X'
|
||||
about: 'حول IT-Tools'
|
||||
aboutLabel: 'نبذة عن التطبيق'
|
||||
darkMode: 'الوضع الليلي'
|
||||
lightMode: 'الوضع النهاري'
|
||||
mode: 'تبديل الوضع الليلي/النهاري'
|
||||
about:
|
||||
content: >
|
||||
# حول IT-Tools
|
||||
|
||||
هذا الموقع المميز، الذي تم إنشاؤه مع ❤ بواسطة [كورنتين توماسيت](https://corentin.tech?utm_source=it-tools&utm_medium=about)، يجمع أدوات مفيدة للمطورين والأشخاص الذين يعملون في مجال تكنولوجيا المعلومات. إذا وجدته مفيدًا، فلا تتردد في مشاركته مع الأشخاص الذين تعتقد أنهم قد يجدونه مفيدًا أيضًا، ولا تنسى وضع إشارة مرجعية عليه في شريط الاختصارات الخاص بك!
|
||||
|
||||
IT-Tools هو مشروع مجاني ومفتوح المصدر (تحت رخصة GPL-3.0)، وسيظل كذلك، ولكن استضافة الموقع وتجديد اسم النطاق يكلفني المال. إذا كنت ترغب في دعم عملي، وتشجيعي على إضافة المزيد من الأدوات، يرجى التفكير في الدعم من خلال [رعايتي](https://www.buymeacoffee.com/cthmsst).
|
||||
|
||||
## التقنيات المستخدمة
|
||||
|
||||
تم بناء IT Tools باستخدام الاصدار الثالث من Vue.js مع مكتبةNaive UI component ويتم استضافتها ونشرها باستمرار بواسطة Vercel. يتم استخدام مكتبات خارجية مفتوحة المصدر في بعض الأدوات، يمكنك العثور على القائمة الكاملة في ملف [package.json](https://github.com/sharevb/it-tools/blob/main/package.json) في المستودع.
|
||||
|
||||
## هل عثرت على خطأ؟ هل هناك أداة غير متوفرة؟
|
||||
|
||||
إذا كنت بحاجة إلى أداة غير متوفرة حاليًا هنا، وتعتقد أنها يمكن أن تكون مفيدة، فيمكنك إرسال طلب ميزة في [قسم المشكلات](https://github.com/sharevb/it-tools/issues/new/choose) في مستودع GitHub الخاص بنا.
|
||||
|
||||
وإذا اكتشفت وجود خطأ، أو أن شيئًا ما لا يعمل كما هو متوقع، يرجى تقديم تقرير عن الخطأ في [قسم المشكلات](https://github.com/sharevb/it-tools/issues/new/choose) في مستودع GitHub الخاص بنا.
|
||||
|
||||
404:
|
||||
notFound: '404 غير موجود'
|
||||
sorry: 'عذرًا، هذه الصفحة غير موجودة'
|
||||
maybe: 'قد يكون الكاش يعمل بشكل غير متوقع، جرب تحديث الصفحة يدويًا؟'
|
||||
backHome: 'العودة للصفحة الرئيسية'
|
||||
favoriteButton:
|
||||
remove: 'إزالة من المفضلة'
|
||||
add: 'إضافة إلى المفضلة'
|
||||
toolCard:
|
||||
new: جديد
|
||||
search:
|
||||
label: بحث
|
||||
tools:
|
||||
categories:
|
||||
favorite-tools: 'أدواتك المفضلة'
|
||||
crypto: التشفير
|
||||
converter: التحويل
|
||||
web: الويب
|
||||
images and videos: 'الصور والفيديو'
|
||||
development: التطوير
|
||||
network: الشبكة
|
||||
math: الرياضيات
|
||||
measurement: القياس
|
||||
text: النصوص
|
||||
data: البيانات
|
||||
|
||||
password-strength-analyser:
|
||||
title: محلل قوة كلمة المرور
|
||||
description: اكتشف قوة كلمة المرور الخاصة بك باستخدام أداة التحليل هذه التي تعمل على جانب العميل فقط مع تقدير الوقت اللازم لكسرها.
|
||||
|
||||
chronometer:
|
||||
title: مقياس الزمن
|
||||
description: مراقبة مدة حدوث شيء ما. عبارة عن مقياس زمني بميزات أساسية.
|
||||
|
||||
token-generator:
|
||||
title: مولد الرموز
|
||||
description: توليد سلسلة عشوائية بالأحرف التي تريدها بأحرف كبيرة أو صغيرة أو أرقام أو رموز.
|
||||
|
||||
uppercase: أحرف كبيرة (ABC...)
|
||||
lowercase: أحرف صغيرة (abc...)
|
||||
numbers: أرقام (123...)
|
||||
symbols: رموز (!-;...)
|
||||
length: الطول
|
||||
tokenPlaceholder: 'الرمز...'
|
||||
copied: تم نسخ الرمز إلى الحافظة
|
||||
button:
|
||||
copy: نسخ
|
||||
refresh: تحديث
|
||||
percentage-calculator:
|
||||
title: حاسبة النسب المئوية
|
||||
description: احسب النسب المئوية بسهولة بين قيمتين أو من نسبة إلى قيمة.
|
||||
|
||||
svg-placeholder-generator:
|
||||
title: مولد صور SVG مؤقتة
|
||||
description: إنشاء صور SVG لاستخدامها كعناصر نائبة في تطبيقاتك.
|
||||
|
||||
json-to-csv:
|
||||
title: JSON إلى CSV
|
||||
description: تحويل من تنسيق JSON إلى CSV مع الكشف التلقائي للرؤوس.
|
||||
|
||||
csv-to-json:
|
||||
title: CSV إلى JSON
|
||||
description: تحويل من تنسيق CSV إلى JSON مع الكشف التلقائي للرؤوس.
|
||||
|
||||
camera-recorder:
|
||||
title: مسجل الكاميرا
|
||||
description: التقاط صورة أو تسجيل فيديو من كاميرا الويب أو كاميرا الجهاز.
|
||||
|
||||
keycode-info:
|
||||
title: معلومات رموز المفاتيح
|
||||
description: استكشاف الرمز المميز في جافا سكريبت والكود والموقع والمعدِّلات لأي مفتاح يتم الضغط عليه.
|
||||
|
||||
emoji-picker:
|
||||
title: منتقي الرموز التعبيرية
|
||||
description: نسخ ولصق الرموز التعبيرية بسهولة والحصول على الترميز الموحد (Unicode) وقيمة نقطة الرمز (code point) لكل رمز تعبيري.
|
||||
|
||||
color-converter:
|
||||
title: محول الألوان
|
||||
description: تحويل الألوان بين التنسيقات المختلفة (hex, rgb, hsl, وأسماء CSS).
|
||||
|
||||
bcrypt:
|
||||
title: Bcrypt
|
||||
description: تجزئة ومقارنة سلسلة نصية باستخدام Bcrypt .bcrypt هي دالة تجزئة لكلمات المرور تعتمد على تشفير Blowfish.
|
||||
|
||||
crontab-generator:
|
||||
title: مولد Crontab
|
||||
description: توليد تعبيرات crontab والتحقق منها والحصول على وصف سهل القراءة للجدول الزمني للـ cron.
|
||||
|
||||
http-status-codes:
|
||||
title: رموز حالة HTTP
|
||||
description: قائمة تضم كافة رموز حالة HTTP واسمائها ومعانيها.
|
||||
|
||||
sql-prettify:
|
||||
title: تجميل وتنسيق SQL
|
||||
description: تجميل وتنسيق استعلامات SQL الخاصة بك عبر الإنترنت (يدعم العديد من لهجات SQL).
|
||||
|
||||
benchmark-builder:
|
||||
title: صانع مقاييس الأداء
|
||||
description: مقارنة وقت تنفيذ المهام بسهولة باستخدام أداة صنع مقاييس الأداء البسيطة جدًا المتاحة عبر الإنترنت.
|
||||
|
||||
git-memo:
|
||||
title: ملخص أوامر Git
|
||||
description: Git هو برمجية لا مركزية لإدارة الإصدارات. باستخدام هذا الملخص، سوف يكون لديك وصول سريع إلى أوامر git الأكثر شيوعًا.
|
||||
|
||||
slugify-string:
|
||||
title: تهيئة سلسلة نصية كـ Slug
|
||||
description: جعل سلسلة نصية لرابط أو اسم ملف أو معرف آمنة.
|
||||
|
||||
encryption:
|
||||
title: تشفير / فك تشفير النص
|
||||
description: تشفير نص واضح وفك تشفير نص مشفر باستخدام خوارزميات تشفير مثل AES أو TripleDES أو Rabbit أو RC4.
|
||||
|
||||
random-port-generator:
|
||||
title: مولد منفذ عشوائي
|
||||
description: توليد أرقام منافذ عشوائية خارج نطاق المنافذ "المعروفة" (0-1023).
|
||||
|
||||
yaml-prettify:
|
||||
title: تجميل وتنسيق YAML
|
||||
description: تجميل سلسلة نصية بتسنيق YAML إلى صيغة سلسة وسهلة القراءة.
|
||||
|
||||
eta-calculator:
|
||||
title: حاسبة وقت الوصول المتوقع (ETA)
|
||||
description: حاسبة وقت الوصول المتوقع (ETA) لحساب الوقت التقريبي لانتهاء مهمة ما، على سبيل المثال، وقت انتهاء تنزيل ملف ومدته.
|
||||
|
||||
roman-numeral-converter:
|
||||
title: محول الأرقام الرومانية
|
||||
description: تحويل الأرقام الرومانية إلى أرقام والعكس.
|
||||
|
||||
hmac-generator:
|
||||
title: مولد HMAC
|
||||
description: حساب رمز مصادقة الرسائل القائم على التجزئة (HMAC) باستخدام مفتاح سري ودالة التجزئة المفضلة لديك.
|
||||
|
||||
bip39-generator:
|
||||
title: مولد عبارات مرور BIP39
|
||||
description: توليد عبارة مرور BIP39 من عبارة ذاكرة (mnemonic) موجودة أو عشوائية، أو الحصول على عبارة الذاكرة من عبارة المرور.
|
||||
|
||||
base64-file-converter:
|
||||
title: تحويل الملفات إلى Base64
|
||||
description: تحويل سلسلة نصية أو ملف أو صورة إلى تمثيل Base64 الخاص بها.
|
||||
|
||||
list-converter:
|
||||
title: محول القوائم
|
||||
description: يمكن لهذه الأداة معالجة البيانات ذات الأعمدة وتطبيق تغييرات متنوعة (التبديل وإضافة بادئة ولاحقة وعكس القائمة وترتيب القائمة وتحويل القيم إلى أحرف صغيرة وكذلك اقتطاع القيم) لكل الصفوف في القائمة.
|
||||
|
||||
base64-string-converter:
|
||||
title: مرمز Base64 للنصوص
|
||||
description: ترميز النصوص وفك ترميزها بصيغة Base64 بكل بساطة.
|
||||
|
||||
toml-to-yaml:
|
||||
title: تحويل TOML إلى YAML
|
||||
description: تحليل TOML وتحويله إلى YAML.
|
||||
|
||||
math-evaluator:
|
||||
title: محلل رياضي
|
||||
description: آلة حاسبة لتقييم التعابير الرياضية. يمكنك استخدام دوال مثل الجذر التربيعي (sqrt) وجيب التمام (cos) والجيب (sin) والقيمة المطلقة (abs) وغيرها.
|
||||
|
||||
json-to-yaml-converter:
|
||||
title: محول JSON إلى YAML
|
||||
description: تحويل JSON إلى YAML ببساطة عبر الإنترنت باستخدام أداة التحويل هذه.
|
||||
|
||||
json-to-javascript:
|
||||
title: محول JSON إلى JS
|
||||
description: تحويل JSON إلى كائن JavaScript ببساطة عبر الإنترنت باستخدام أداة التحويل هذه.
|
||||
|
||||
javascript-to-json:
|
||||
title: محول JS إلى JSON
|
||||
description: تحويل كائن JavaScript إلى JSON ببساطة عبر الإنترنت باستخدام أداة التحويل هذه.
|
||||
|
||||
url-parser:
|
||||
title: محلل عنوان URL
|
||||
description: تفكيك عنوان URL إلى أجزائه الأساسية (البروتوكول والمصدر والمعاملات والمنفذ واسم المستخدم-كلمة المرور ...)
|
||||
|
||||
iban-validator-and-parser:
|
||||
title: محلل ومدقق رقم الحساب المصرفي الدولي (IBAN)
|
||||
description: تحليل أرقام IBAN والتحقق من صحتها. تحقق مما إذا كان رقم الحساب المصرفي الدولي (IBAN) صالحًا واحصل على البلد ورقم الحساب المصرفي الأساسي (BBAN) في حال إذا كان هذا الرقم يمثل QR-IBAN ويستخدم تنسيق IBAN الملائم.
|
||||
|
||||
user-agent-parser:
|
||||
title: محلل وكيل المستخدم
|
||||
description: تحليل سلسلة نصية لوكيل المستخدم (user-agent) للتعرف على المتصفح والمحرك ونظام التشغيل ووحدة المعالجة المركزية ونوع/طراز الجهاز.
|
||||
|
||||
numeronym-generator:
|
||||
title: مولد الاختصارات الرقمية (Numeronym)
|
||||
description: الاختصار الرقمي (Numeronym) هو مصطلح يشير إلى الكلمة التي يُستخدم فيها رقم لتكوين اختصار. على سبيل المثال، "i18n" هو اختصار رقمي لكلمة "internationalization"، حيث يرمز الرقم 18 إلى عدد الحروف بين أول حرف i وآخر حرف n في الكلمة.
|
||||
|
||||
case-converter:
|
||||
title: محول حالة الأحرف
|
||||
description: تحويل حالة الأحرف في سلسلة نصية مع إمكانية الاختيار من بين صيغ متعددة
|
||||
|
||||
html-entities:
|
||||
title: تهريب كيانات HTML (HTML Entities)
|
||||
description: تهريب أو الغاء تهريب كيانات HTML ( استبدال أحرف مثل < و > و & و " و \' بصيغة HTML الخاصة بها)
|
||||
|
||||
json-prettify:
|
||||
title: تجميل وتنسيق JSON
|
||||
description: تجميل سلسلة نصية بتنسيق JSON إلى صيغة سلسة وسهلة القراءة.
|
||||
|
||||
docker-run-to-docker-compose-converter:
|
||||
title: محول أوامر Docker run إلى Docker compose
|
||||
description: تحويل أوامر "docker run" إلى ملفات docker-compose!
|
||||
|
||||
mac-address-lookup:
|
||||
title: التحقق من عنوان MAC
|
||||
description: العثور على البائع والشركة المصنعة لجهاز ما من خلال عنوان MAC الخاص به.
|
||||
|
||||
mime-types:
|
||||
title: أنواع الوسائط (MIME types)
|
||||
description: تحويل أنواع الوسائط (MIME types) إلى امتدادات ملفات وبالعكس.
|
||||
|
||||
mic-tester:
|
||||
title: أداة اختبار الميكروفون
|
||||
description: تسجيل الصوت من الميكروفون ومن ثم تشغيله مع عرض مرئي له و إضافة ثانية واحدة من التأخير
|
||||
start-button-text: بدء تشغيل الميكروفون
|
||||
stop-button-text: إيقاف تشغيل الميكروفون
|
||||
|
||||
toml-to-json:
|
||||
title: TOML إلى JSON
|
||||
description: تحليل TOML وتحويله إلى JSON.
|
||||
|
||||
lorem-ipsum-generator:
|
||||
title: مولد نصوص Lorem ipsum
|
||||
description: Lorem ipsum هو عبارة عن نص نائب يستخدم عادةً لتوضيح الشكل المرئي لمستند أو محرف دون الاعتماد على محتوى ذو معنى.
|
||||
|
||||
qrcode-generator:
|
||||
title: مولد رمز الاستجابة السريعة (QR Code)
|
||||
description: إنشاء وتنزيل رمز الاستجابة السريعة (QR Code) لعنوان URL (أو لمجرد نص عادي)، وتخصيص ألوان الخلفية والنمط.
|
||||
|
||||
wifi-qrcode-generator:
|
||||
title: مولد رمز الاستجابة السريعة (QR Code) للشبكة اللاسلكية
|
||||
description: إنشاء وتنزيل رموز الاستجابة السريعة (QR Code) للاتصال السريع بالشبكات اللاسلكية.
|
||||
|
||||
qr-contact-info-generator:
|
||||
title: مولد رمز الاستجابة السريعة (QR Code) لمعلومات الاتصال
|
||||
description: إنشاء وتنزيل رموز الاستجابة السريعة (QR Code) لمعلومات الاتصال (vCard)، وتخصيص ألوان الخلفية والنمط.
|
||||
|
||||
xml-formatter:
|
||||
title: منسق XML
|
||||
description: تجميل سلسلة نصية بتنسيق XML إلى هيئة سهلة القراءة من قبل البشر.
|
||||
|
||||
temperature-converter:
|
||||
title: محول درجات الحرارة
|
||||
description: تحويلات لدرجات الحرارة بين وحدات كلفن ومئوية وفهرنهايت ورانكين وديليسل ونيوتن وريومور ورومر.
|
||||
|
||||
chmod-calculator:
|
||||
title: حاسبة أمر Chmod
|
||||
description: حساب أذونات وأوامر chmod الخاصة بك باستخدام هذه الآلة الحاسبة المتوفرة على الويب.
|
||||
|
||||
rsa-key-pair-generator:
|
||||
title: مولد زوج مفاتيح RSA
|
||||
description: توليد زوج مفاتيح RSA عشوائي جديد بصيغة PEM (خاص/عام)
|
||||
|
||||
html-wysiwyg-editor:
|
||||
title: محرر HTML مرئي
|
||||
description: محرر ويب لصفحات HTML (ما تراه هو ما تحصل عليه WYSIWYG). يتيح لك هذ المحرر الحصول على الكود المصدري للمحتوى على الفور.
|
||||
|
||||
yaml-to-toml:
|
||||
title: YAML إلى TOML
|
||||
description: تحليل YAML وتحويله إلى TOML.
|
||||
|
||||
mac-address-generator:
|
||||
title: مولد عناوين MAC
|
||||
description: قم بإدخال الكمية والبادئة. سيتم إنشاء عناوين MAC بالحالة التي اخترتها (أحرف كبيرة أو صغيرة)
|
||||
|
||||
json-diff:
|
||||
title: مقارنة JSON
|
||||
description: مقارنة كائنين بتنسيق JSON وعرض الاختلافات بينهما.
|
||||
|
||||
jwt-parser:
|
||||
title: محلل JWT
|
||||
description: تحليل وفك تشفير رمز JSON Web Token (الذي يُعرف اختصارًا بـ JWT) ثم عرض محتواه.
|
||||
|
||||
date-converter:
|
||||
title: محول الوقت والتاريخ
|
||||
description: تحويل التاريخ والوقت إلى صيغ متعددة
|
||||
|
||||
phone-parser-and-formatter:
|
||||
title: محلل ومنسق رقم الهاتف
|
||||
description: تحليل أرقام الهواتف وتنسيقها والتحقق من صحتها. الحصول على معلومات حول رقم الهاتف، مثل رمز البلد والنوع وما إلى ذلك. وبالإضافة إلى ذلك، إنشاء رابط مباشر لإرسالة رسالة عبر WhatsApp أو رسالة نصية قصيرة (SMS)
|
||||
|
||||
ipv4-subnet-calculator:
|
||||
title: حاسبة الشبكات الفرعية لـ IPv4
|
||||
description: تحليل كتل ترميز CIDR لبروتوكول IPv4 للحصول على كافة المعلومات التي تحتاجها حول شبكتك الفرعية.
|
||||
|
||||
og-meta-generator:
|
||||
title: مولد علامات Open Graph
|
||||
description: توليد علامات HTML الوصفية (meta tags) الخاصة بـ open-graph ومواقع التواصل الاجتماعي لموقعك على الويب.
|
||||
|
||||
ipv6-ula-generator:
|
||||
title: مولد عناوين IPv6 ULA
|
||||
description: توليد عناوين IP محلية خاصة بك وغير قابلة للتوجيه للشبكة الخاصة بك وفقًا لـ RFC4193.
|
||||
|
||||
hash-text:
|
||||
title: تجزئة النص
|
||||
description: 'تجزئة سلسلة نصية باستخدام الدالة التي تريدها : MD5 أو SHA1 أو SHA256 أو SHA256 أو SHA224 أو SHA512 أو SHA384 أو SHA3 أو RIPEMD160'
|
||||
|
||||
json-to-toml:
|
||||
title: JSON إلى TOML
|
||||
description: تحليل JSON وتحويله إلى TOML.
|
||||
|
||||
json-to-ts:
|
||||
title: JSON إلى TS
|
||||
description: تحويل من تنسيق JSON إلى نوع بيانات TS.
|
||||
|
||||
device-information:
|
||||
title: معلومات الجهاز
|
||||
description: الحصول على معلومات حول جهازك الحالي (حجم الشاشة ونسبة البكسل ووكيل المستخدم ...)
|
||||
|
||||
pdf-signature-checker:
|
||||
title: مدقق تواقيع PDF
|
||||
description: التحقق من تواقيع ملف PDF. يحتوي ملف PDF الموقع على توقيع واحد أو أكثر، والتي يمكن استخدامها لتحديد ما إذا كان قد تم إجراء تغييرات على محتويات الملف منذ توقعيه.
|
||||
|
||||
json-sort-master:
|
||||
title: أداة ترتيب JSON
|
||||
description: ترتيب JSON حسب القيم أو المفاتيح .
|
||||
|
||||
json-minify:
|
||||
title: مصغر JSON
|
||||
description: تصغير وضغط بيانات JSON من خلال إزالة المسافات البيضاء غير الضرورية.
|
||||
|
||||
json-string-converter:
|
||||
title: أداة التحويل الى نص بتنسيق JSON
|
||||
description: تحويل النص العادي أو كائنات JavaScript إلى سلسلة نصية بتنسيق JSON وبالعكس.
|
||||
|
||||
ulid-generator:
|
||||
title: مولد ULID
|
||||
description: توليد معرف فريد عالميًا قابل للفرز المعجمي (ULID) بشكل عشوائي.
|
||||
|
||||
string-obfuscator:
|
||||
title: تعتيم سلسلة نصية
|
||||
description: تعتيم سلسلة نصية (مثل سر ما أو رقم الحساب المصرفي الدولي (IBAN) أو رمز معين) لجعلها قابلة للمشاركة والتعرف عليها دون الكشف عن محتواها.
|
||||
|
||||
base-converter:
|
||||
title: محول الأنظمة العددية
|
||||
description: تحويل رقم بين أنظمة عد مختلفة (عشري وسادس عشري وثنائي وثماني وbase64 ...)
|
||||
|
||||
floating-point-converter:
|
||||
title: محول أرقام الفاصلة العائمة (float number)
|
||||
description: تحويل رقم عشري إلى رقم فاصلة عائمة بنظام IEEE 754 الثنائي وبالعكس.
|
||||
|
||||
yaml-to-json-converter:
|
||||
title: محول YAML إلى JSON
|
||||
description: تحويل YAML إلى JSON ببساطة عبر الإنترنت باستخدام أداة التحويل هذه.
|
||||
|
||||
uuid-generator:
|
||||
title: مولد معرفات UUIDs
|
||||
description: المعرف الفريد عالميًا (UUID) هو رقم يتكون من 128 بت يستخدم لتحديد المعلومات في أنظمة الحاسوب. عدد معرفات UUID الممكنة هي 16^32، أي 2^128 وهو ما يساوي 3.4x10^38 (وهو عدد كبير!).
|
||||
|
||||
nanoid-generator:
|
||||
title: مولد معرفات NanoIDs
|
||||
description: إنشاء معرفات عشوائية وفريدة وملائمة لعناوين URL لتطبيقاتك
|
||||
uppercase: أحرف كبيرة
|
||||
lowercase: أحرف صغيرة
|
||||
numbers: أرقام
|
||||
symbols: رموز
|
||||
excludeLookalikes: استبعاد المتشابهة
|
||||
length: الطول
|
||||
quantity: الكمية
|
||||
copied: تم نسخ معرف NanoID إلى الحافظة
|
||||
button:
|
||||
copy: نسخ
|
||||
refresh: تحديث
|
||||
|
||||
|
||||
ipv4-address-converter:
|
||||
title: محول عناوين IPv4
|
||||
description: تحويل عنوان IP إلى رقم عشري أو ثنائي أو سداسي عشري أو حتى صيغة IPv6 له.
|
||||
|
||||
text-statistics:
|
||||
title: إحصائيات النص
|
||||
description: الحصول على معلومات حول نص معين من حيث عدد الأحرف وعدد الكلمات وحجمه بالبايت ...
|
||||
|
||||
text-to-nato-alphabet:
|
||||
title: نص إلى أبجدية الناتو
|
||||
description: تحويل نص إلى أبجدية الناتو الصوتية للإرسال الشفهي.
|
||||
|
||||
basic-auth-generator:
|
||||
title: مولد مصادقة أساسية
|
||||
description: توليد ترويسة مصادقة أساسية مرمزة باستخدام base64 من اسم مستخدم وكلمة مرور.
|
||||
|
||||
text-to-unicode:
|
||||
title: نص إلى الترميز الموحد (Unicode)
|
||||
description: تحليل نص وتحويله إلى رمز موحد (Unicode) وبالعكس
|
||||
|
||||
ipv4-range-expander:
|
||||
title: موسع نطاقات IPv4
|
||||
description: احسب CIDR والمساحة المتاحة من نطاق عناوين IPv4.
|
||||
|
||||
text-diff:
|
||||
title: مقارنة النصوص
|
||||
description: مقارنة بين نصين اثنين والاطلاع على الاختلافات بينهما.
|
||||
|
||||
otp-generator:
|
||||
title: مولد رمز كلمة مرور لمرة واحدة (OTP)
|
||||
description: توليد والتحقق من صحة رمز كلمة مرور لمرة واحدة (OTP) المعتمد على الوقت أو الحدث لإجراء مصادقة متعددة العوامل.
|
||||
|
||||
url-encoder:
|
||||
title: ترميز/فك ترميز السلاسل النصية بصيغة ترميز عنوان URL
|
||||
description: ترميز نص إلى صيغة ترميز عنوان URL (يُعرف أيضًا باسم "ترميز النسبة المئوية")، أو فك ترميز النص المرمز.
|
||||
|
||||
text-to-binary:
|
||||
title: تحويل نص إلى تمثيله الثنائي في UTF-8
|
||||
description: تحويل النص إلى تمثيله الثنائي في UTF-8 وبالعكس.
|
||||
|
||||
image-resizer:
|
||||
title: أداة تغيير حجم الصورة
|
||||
description: تغيير العرض والارتفاع لملف صورة مع عرض معاينة للصورة الجديدة وتنزيلها بالصيغة المرغوبة (.jpg أو .jpeg أو .png أو .bmp أو .ico أو .svg)
|
||||
|
||||
json-to-object:
|
||||
title: JSON إلى object
|
||||
description: تحليل JSON وتحويله إلى كائن.
|
||||
|
||||
multi-link-downloader:
|
||||
title: أداة تنزيل الروابط المتعددة
|
||||
description: التنزيل بشكل غير متزامن من روابط متعددة في ملف مضغوط أو التنزيل من رابط واحد مباشرةً. (يتطلب اتصالاً بالإنترنت)
|
||||
|
||||
unicode-to-java-entities:
|
||||
title: محول أحرف Unicode إلى كيانات جافا
|
||||
description: تحويل أحرف Unicode إلى كيانات جافا وبالعكس
|
||||
|
||||
sip-auth:
|
||||
password: كلمة مرور SIP
|
||||
password-tips: أدخل كلمة المرور...
|
||||
message: نص رسالة SIP
|
||||
message-tips: الصق نص رسالة SIP هنا...
|
||||
result: النتيجة
|
||||
sucess: نجاح
|
||||
failure: فشل
|
||||
|
||||
uuid-converter:
|
||||
title: محول UUID
|
||||
description: تحويل UUID مع واصلة أو بدون واصلة إلى ترميزات SQL الشائعة الأخرى وبالعكس.
|
||||
|
||||
uuid: معرف UUID
|
||||
uuidhexupper: تمثيل في النظام السادس عشري (أحرف كبيرة)
|
||||
uuidhexlower: تمثيل في النظام السادس عشري (أحرف صغيرة)
|
||||
uuidversion: نسخة RFC
|
||||
input:
|
||||
label: النص المدخل
|
||||
placeholder: معرف UUID الخاص بك مع أو بدون واصلة
|
||||
+720
-5
@@ -156,6 +156,9 @@ tools:
|
||||
encryption:
|
||||
title: Encrypt / decrypt text
|
||||
description: Encrypt clear text and decrypt ciphertext using crypto algorithms like AES, TripleDES, Rabbit or RC4.
|
||||
defaultErrorMessage: Unable to cypher your text
|
||||
title-encrypt: Encrypt
|
||||
title-decrypt: Decrypt
|
||||
|
||||
random-port-generator:
|
||||
title: Random port generator
|
||||
@@ -311,10 +314,6 @@ tools:
|
||||
title: JSON diff
|
||||
description: Compare two JSON objects and get the differences between them.
|
||||
|
||||
jwt-parser:
|
||||
title: JWT parser
|
||||
description: Parse and decode your JSON Web Token (jwt) and display its content.
|
||||
|
||||
date-converter:
|
||||
title: Date-time converter
|
||||
description: Convert date and time into the various different formats
|
||||
@@ -464,6 +463,9 @@ tools:
|
||||
description: Unicode Characters to Java Entities Converter and vice-versa
|
||||
|
||||
sip-auth:
|
||||
title: SIP Authorization
|
||||
description: This tool helps you to verify the SIP authorization header. The tool performs all calculations in the browser and does not transmit sensitive information over the network, so feel free to use it.
|
||||
|
||||
password: SIP password
|
||||
password-tips: Enter a password...
|
||||
message: SIP message
|
||||
@@ -482,4 +484,717 @@ tools:
|
||||
uuidversion: RFC Version
|
||||
input:
|
||||
label: Your Input
|
||||
placeholder: Your UUID with/without hyphen
|
||||
placeholder: Your UUID with/without hyphen
|
||||
|
||||
ad-ldap-searcher:
|
||||
title: ActiveDirectory LDAP properties searcher
|
||||
description: Search in mapping of LDAP properties and ActiveDirectory UI
|
||||
|
||||
ai-prompt-splitter:
|
||||
title: AI Prompt Splitter
|
||||
description: Split a long document to multiple chat (ie ChatGPT) prompts
|
||||
|
||||
angle-converter:
|
||||
title: Angle Units Converter
|
||||
description: Convert values between angle units
|
||||
|
||||
ansible-vault-crypt-decrypt:
|
||||
title: Ansible vault crypt decrypt
|
||||
description: Encrypt and decrypt Ansible Vault Secrets
|
||||
|
||||
api-tester:
|
||||
title: API Tester
|
||||
description: HTTP API Tester
|
||||
|
||||
area-converter:
|
||||
title: Area Units Converter
|
||||
description: Convert values between area units
|
||||
|
||||
ascii-text-drawer:
|
||||
title: ASCII Text Drawer
|
||||
description: Create ASCII art text with many fonts and styles.
|
||||
|
||||
aspect-ratio-calculator:
|
||||
title: Aspect Ratio Calculator
|
||||
description: Use this ratio calculator to check the dimensions when resizing images.
|
||||
|
||||
barcode-generator:
|
||||
title: Barcode generator
|
||||
description: Barcode generator
|
||||
|
||||
barcode-reader:
|
||||
title: Barcode Reader
|
||||
description: Barcode reader
|
||||
|
||||
base64-hex-converter:
|
||||
title: Base64 Hex array encoder/decoder
|
||||
description: Simply encode and decode Hex array into a their base64 representation.
|
||||
|
||||
bounce-parser:
|
||||
title: Bounce Email Parser
|
||||
description: Parse SMTP Bounce Emails
|
||||
|
||||
card-picker:
|
||||
title: Card Picker
|
||||
description: Generate a deck of playing cards
|
||||
|
||||
certificate-key-parser:
|
||||
title: Certificate/Key parser
|
||||
description: Parse Key and Certificate
|
||||
|
||||
cidr-in-cidr:
|
||||
title: IPv4-6/IPRange/CIDR in IPRange/CIDR/IPMask
|
||||
description: Given a CIDR/IP Range/Wildcard IP/IP Mask, tell if a given IPv4-6/Range/CIDR/Wildcard IP/IP Mask is in subnet range
|
||||
|
||||
code-highlighter:
|
||||
title: Code/Scripts Highlighter
|
||||
description: Highlight programming code fragments
|
||||
|
||||
coin-flipper:
|
||||
title: Coin Flipper
|
||||
description: Flip a coin
|
||||
|
||||
color-contrast-checker:
|
||||
title: Color Contrast Checker
|
||||
description: Check the WCAG constrast level between two colors
|
||||
|
||||
color-wheel:
|
||||
title: Color Wheel
|
||||
description: Choose a color palette/theme using a wheel and mode
|
||||
|
||||
common-regex-memo:
|
||||
title: Common Regex Cheatsheet
|
||||
description: Cheatsheet for common regex patterns
|
||||
|
||||
countdown:
|
||||
title: Countdown
|
||||
description: Countdown and alarm at ellapsed duration
|
||||
|
||||
crc-calculator:
|
||||
title: CRC calculator
|
||||
description: Compute text or file CRC (CRC1, CRC8, CRC8 1-Wire, CRC8 DVB-S2, CRC16, CRC16 CCITT, CRC16 Modbus, CRC16 Kermit, CRC16 XModem, CRC24, CRC32, CRC32 MPEG-2, CRCJAM)
|
||||
|
||||
csr-generator:
|
||||
title: CSR Generator
|
||||
description: Certificate Signing Request generator (PEM format)
|
||||
|
||||
css-prettifier:
|
||||
title: Css prettifier
|
||||
description: CSS Prettify
|
||||
|
||||
css-selectors-memo:
|
||||
title: CSS Selectors Cheatsheet
|
||||
description: CSS Selectors Syntax Cheatsheet
|
||||
|
||||
css-xpath-converter:
|
||||
title: CSS XPath Converter
|
||||
description: Convert CSS selector to/from XPath expression
|
||||
|
||||
curl-converter:
|
||||
title: Curl Converter
|
||||
description: Generate common coding languages version of provided curl command line
|
||||
|
||||
currency-converter:
|
||||
title: Currency Converter
|
||||
description: Convert currency values using https://github.com/fawazahmed0/exchange-api
|
||||
|
||||
data-storage-unit-converter:
|
||||
title: Data Storage Unit converter
|
||||
description: Convert data storage or transfer units (bytes, bibytes, bits, kilobytes...)
|
||||
|
||||
data-transfer-rate-converter:
|
||||
title: Data Transfer Rate Calculator
|
||||
description: Compute Data Transfer times, rates and amount of data
|
||||
|
||||
date-duration-calculator:
|
||||
title: Date+Durations Calculator
|
||||
description: Add/substract durations from a specific date
|
||||
|
||||
days-calculator:
|
||||
title: Days Calculator
|
||||
description: Calculate days interval, holidays, difference, business times
|
||||
|
||||
dice-roller:
|
||||
title: Dice Roller
|
||||
description: RPG Dice Roller using Dice Notation
|
||||
|
||||
dmarc-report-analyzer:
|
||||
title: DMARC Report Analyzer
|
||||
description: Read and display DMARC Xml Reports
|
||||
|
||||
dns-queries:
|
||||
title: DNS Queries
|
||||
description: Perform DNS Queries (over HTTPS)
|
||||
|
||||
docker-compose-converter:
|
||||
title: Docker Compose Format Converter
|
||||
description: Convert Docker Compose file between V1, 2.x, 3.x or CommonSpec and may expand ports/volumes syntaxes
|
||||
|
||||
docker-compose-to-docker-run-converter:
|
||||
title: Docker Compose to Docker run converter
|
||||
description: Turns Docker Compose filt to docker run command(s)!
|
||||
|
||||
docker-compose-to-kubernetes:
|
||||
title: Docker compose to kubernetes
|
||||
description: Docker Compose to Kubernetes manifests
|
||||
|
||||
docker-compose-validator:
|
||||
title: Docker Compose Validator
|
||||
description: Validate Docker Compose files against CommonSpec schema
|
||||
|
||||
docker-memo:
|
||||
title: Docker Cheatsheet
|
||||
description: Docker command memo
|
||||
|
||||
docker-run-to-kubernetes:
|
||||
title: Docker run to kubernetes
|
||||
description: Docker run command(s) to Kubernetes manifests
|
||||
|
||||
duplicate-line-finder:
|
||||
title: Duplicate Lines Finder
|
||||
description: Find and list duplicated lines
|
||||
|
||||
duration-calculator:
|
||||
title: Duration Calculator
|
||||
description: Calculate/parse durations
|
||||
|
||||
ecdsa-key-pair-generator:
|
||||
title: ECDSA key pair generator
|
||||
description: Generate new random ECDSA private and public keys (with or without passphrase).
|
||||
|
||||
ed25519-key-pair-generator:
|
||||
title: Ed25519 key pair generator
|
||||
description: Generate new random Ed25519 private and public keys (with or without passphrase).
|
||||
|
||||
email-normalizer:
|
||||
title: Email normalizer
|
||||
description: Normalize email addresses to a standard format for easier comparison. Useful for deduplication and data cleaning.
|
||||
|
||||
email-parser:
|
||||
title: Email Parser
|
||||
description: Parse and extract information from raw Email content
|
||||
|
||||
energy-computer:
|
||||
title: Energy Consumption and Expense Computer
|
||||
description: Compute energy consumption and expense
|
||||
|
||||
energy-converter:
|
||||
title: Energy Units Converter
|
||||
description: Convert values between energy units
|
||||
|
||||
file-hasher:
|
||||
title: File Hasher
|
||||
description: Compute Hash of files
|
||||
|
||||
file-type:
|
||||
title: File Type Detector
|
||||
description: Identify the type of a file
|
||||
|
||||
folder-structure-diagram:
|
||||
title: Folder Structure Diagram
|
||||
description: tree-like utility for generating ASCII folder structure diagrams
|
||||
|
||||
force-converter:
|
||||
title: Force Units Converter
|
||||
description: Convert values between force units
|
||||
|
||||
geo-distance-calculator:
|
||||
title: Geo distance calculator
|
||||
description: Compute distance between two geo location (and display current user location information)
|
||||
|
||||
gpt-token-estimator:
|
||||
title: GPT Token Estimator
|
||||
description: OpenAI GPT Token Estimator
|
||||
|
||||
gzip-converter:
|
||||
title: GZip/Deflate converter
|
||||
description: Convert text from/to gzip/deflate
|
||||
|
||||
har-sanitizer:
|
||||
title: HAR Sanitizer
|
||||
description: HAR Files Sanitizer
|
||||
|
||||
hdd-calculator:
|
||||
title: HDD calculator
|
||||
description: Storage device manufacturers report capacities in decimal form (like GB), while operating systems and other software uses binary form (GiB), although still incorrectly using the decimal unit (GiB). This tool converts decimal form capacity into various binary forms.
|
||||
|
||||
heic-converter:
|
||||
title: HEIC Converter
|
||||
description: HEIC Converter to JPEG or PNG
|
||||
|
||||
hex-converter:
|
||||
title: Hex Encoder/Decoder
|
||||
description: Encode and decode Hex buffers to number (bits, endianess, sign or floating point or chars) and structures
|
||||
|
||||
hex-file-converter:
|
||||
title: HEX File Converter
|
||||
description: Convert between file and hexadecimal representation
|
||||
|
||||
html-cleaner:
|
||||
title: Html cleaner
|
||||
description: Clean HTML
|
||||
|
||||
html-prettifier:
|
||||
title: Html Prettifier
|
||||
description: Prettify HTML code
|
||||
|
||||
html-to-markdown:
|
||||
title: Html to markdown
|
||||
description: Convert HTML (either from clipboard) to Markdown
|
||||
|
||||
htpasswd-generator:
|
||||
title: Htpasswd/htaccess generator
|
||||
description: htpassword/htaccess user/password generator
|
||||
|
||||
ical-generator:
|
||||
title: ICAL Generator
|
||||
description: Generate ICAL/ICS file from event infos
|
||||
|
||||
ical-merger:
|
||||
title: iCal Merger
|
||||
description: Merge many iCal file to a single
|
||||
|
||||
ical-parser:
|
||||
title: ICAL File Parser
|
||||
description: Parse ICAL/ICS file to event display
|
||||
|
||||
ico-converter:
|
||||
title: ICO/PNG converter
|
||||
description: Convert from PNG/JPEG to/from ICO
|
||||
|
||||
ies-lighting-guidelines:
|
||||
title: IES Lighting Guidelines
|
||||
description: Search in the Illuminating Engineering Society’s (IES) current illuminance recommendations.
|
||||
|
||||
illuminance-converter:
|
||||
title: Illuminance Converter
|
||||
description: Illuminance units converter (Lux, Foot Candles, Nox, Phot, Flame)
|
||||
|
||||
image-converter:
|
||||
title: Image Formats Converter
|
||||
description: Convert images from one format to another
|
||||
|
||||
image-exif-reader:
|
||||
title: Image EXIF/Metadata/GPS/JPEG Quality reader
|
||||
description: Read EXIF, IPTC, XMP, GPS and other metadata, JPEG Quality, and other infos from images files
|
||||
|
||||
image-to-ascii-art:
|
||||
title: Image to ASCII Art
|
||||
description: Image to ASCII Art Generator
|
||||
|
||||
image-to-css:
|
||||
title: Image to CSS
|
||||
description: Convert image to CSS (url, background, ...)
|
||||
|
||||
integers-to-ip:
|
||||
title: Integers to IPv4/IPv6
|
||||
description: Convert integers to IP
|
||||
|
||||
ip-cidr-to-range:
|
||||
title: Ipv4/6 CIDR to IP Range Calculator
|
||||
description: Calculate IP Range from a CIDR (IPv4/6)
|
||||
|
||||
ip-geo-location:
|
||||
title: IP Geo Location
|
||||
description: Retrieve information about an IPv4/6 address or domain location
|
||||
|
||||
ip-include-exclude:
|
||||
title: IP Subnets Exclude Calculator
|
||||
description: Substract a disallowed IP Ranges/Mask/CIDR list from an allowed IP Ranges/Mask/CIDR list
|
||||
|
||||
ip-range-to-cidr:
|
||||
title: IPv4/6 Range to CIDR(s) Calculator
|
||||
description: Calculate CIDR(s) from an IP Range (IPv4/6)
|
||||
|
||||
ipv6-address-converter:
|
||||
title: Ipv6 address converter
|
||||
description: Convert an ip address into decimal, binary, hexadecimal and get infos
|
||||
|
||||
ipv6-subnet-calculator:
|
||||
title: Ipv6 subnet calculator
|
||||
description: Parse your IPv6 CIDR blocks and get all the info you need about your sub network.
|
||||
|
||||
isbn-validator-and-parser:
|
||||
title: ISBN Validator and Parser
|
||||
description: Parse, validate, format and get infos for an ISBN
|
||||
|
||||
iso-3166-searcher:
|
||||
title: ISO 3166 Country Codes Searcher
|
||||
description: Allow searching for Country Code (ISO 3166) and info
|
||||
|
||||
javascript-prettifier:
|
||||
title: Javascript Prettifier
|
||||
description: JS/Javascript Prettifier
|
||||
|
||||
jq-memo:
|
||||
title: Jq Cheatsheet
|
||||
description: JQ command cheatsheet
|
||||
|
||||
jq-tester:
|
||||
title: Jq/JSONPath Tester
|
||||
description: Test jq/JSONPath expression against a JSON content
|
||||
|
||||
js-unobfuscator:
|
||||
title: Javascript Unobfuscator/Unpacker
|
||||
description: webcrack is a tool for reverse engineering javascript. It can deobfuscate obfuscator.io, unminify, transpile, and unpack webpack/browserify, to resemble the original source code as much as possible.
|
||||
|
||||
json-editor:
|
||||
title: JSON Editor
|
||||
description: Edit JSON content
|
||||
|
||||
json-escaper:
|
||||
title: Json Escaper/Unescaper
|
||||
description: Escape and unescape JSON string
|
||||
|
||||
json-linter:
|
||||
title: JSON Linter
|
||||
description: Check and lint JSON content
|
||||
|
||||
json-size-analyzer:
|
||||
title: Json Size Analyzer
|
||||
description: Measure JSON nodes relative weights
|
||||
|
||||
json-to-csharp:
|
||||
title: JSON to C#
|
||||
description: Convert JSON data to C# type definition
|
||||
|
||||
json-to-go:
|
||||
title: JSON to Go
|
||||
description: Convert JSON to Go struct
|
||||
|
||||
json-to-java:
|
||||
title: JSON to Java Entity
|
||||
description: Convert JSON into Java entities
|
||||
|
||||
json-to-php-array:
|
||||
title: Json to PHP-Array
|
||||
description: Convert JSON to PHP Array
|
||||
|
||||
json-to-schema:
|
||||
title: Json to Schema
|
||||
description: Convert JSON data to JSON Schema, MySQL DDL, Mongoose Schema, Google BigQuery schema or ClickHouse Table Schema
|
||||
|
||||
json-to-xml:
|
||||
title: Json to XML
|
||||
description: Convert JSON to XML
|
||||
|
||||
jsonpath-memo:
|
||||
title: JSONPath Syntax Cheatsheet
|
||||
description: JSONPath Syntax Cheatsheet
|
||||
|
||||
jwt-generator:
|
||||
title: JWT Generator
|
||||
description: JWT Token generator and editor
|
||||
|
||||
jwt-parser:
|
||||
title: JWT parser
|
||||
description: Parse and decode your JSON Web Token (jwt) and display its content.
|
||||
|
||||
length-converter:
|
||||
title: Length Units Converter
|
||||
description: Convert values from length units
|
||||
|
||||
list-comparer:
|
||||
title: Lists Comparer
|
||||
description: Compare two list items
|
||||
|
||||
luhn-validator:
|
||||
title: Luhn Validator
|
||||
description: Check and generate key for identifier validated by a Luhn checknum
|
||||
|
||||
mac-address-converter:
|
||||
title: MAC Address Converter
|
||||
description: Change the format of a MAC address and chose between different formats (EUI-48, EUI-64, IPv6)
|
||||
|
||||
many-units-converter:
|
||||
title: Many Units Converter
|
||||
description: Convert all kind of units
|
||||
|
||||
markdown-cheatsheet:
|
||||
title: Markdown Cheat Sheet
|
||||
description: Markdown Cheat Sheet
|
||||
|
||||
markdown-editor:
|
||||
title: Markdown Editor
|
||||
description: Simple Markdown Editor
|
||||
|
||||
markdown-to-html:
|
||||
title: Markdown to HTML
|
||||
description: Convert Markdown to Html and allow to print (as PDF)
|
||||
|
||||
markdown-toc-generator:
|
||||
title: Markdown toc generator
|
||||
description: Generate a TOC from a markdown file/content
|
||||
|
||||
mass-converter:
|
||||
title: Mass Units Converter
|
||||
description: Convert values between mass units
|
||||
|
||||
math-formats-converter:
|
||||
title: Math Formats Converter
|
||||
description: Convert mathematical expression between formats
|
||||
|
||||
math-ocr:
|
||||
title: Math OCR
|
||||
description: Convert Math Formula images to Latex
|
||||
|
||||
mermaid-exporter:
|
||||
title: Mermaid exporter
|
||||
description: Convert Markdown (Mermaid) to image and allow to export to PNG, JPG & SVG
|
||||
|
||||
mime-converter:
|
||||
title: MIME Encoding Converter
|
||||
description: Convert from/to MIME Encoded-Word format (Mail Subject)
|
||||
|
||||
mongo-objectid-converter:
|
||||
title: MongoDB ObjectId Converter
|
||||
description: Convert between MongoDB ObjectId and internal timestamp
|
||||
|
||||
morse-converter:
|
||||
title: Morse Code Converter
|
||||
description: Encode/Decode to Morse code
|
||||
|
||||
my-ip:
|
||||
title: My IP Address
|
||||
description: Get your client IP Address (IPv4/6) using https://www.ipify.org/
|
||||
|
||||
nano-memo:
|
||||
title: Nano CheatSheet
|
||||
description: Nano Editor Cheatsheet
|
||||
|
||||
nginx-formatter:
|
||||
title: Nginx formatter
|
||||
description: Format/prettify Nginx configuration files
|
||||
|
||||
ocr-image:
|
||||
title: OCRize image and PDF
|
||||
description: Perform OCR (Tesseract) on an image or PDF
|
||||
|
||||
option43-generator:
|
||||
title: Option43 generator
|
||||
description: Generate Option43 Wifi DHCP configuration
|
||||
|
||||
outlook-parser:
|
||||
title: Outlook MSG Parser
|
||||
description: Parse Outlook MSG Files
|
||||
|
||||
parquets-reader:
|
||||
title: Parquet files Reader
|
||||
description: Read parquet file as JSON object arrays
|
||||
|
||||
passphrase-generator:
|
||||
title: Passphrase Generator
|
||||
description: Generate random memoizable Passphrases
|
||||
|
||||
paste-as-markdown:
|
||||
title: Paste as Markdown
|
||||
description: Paste cells/tables and links from clipboard content as Markdown
|
||||
|
||||
pdf-encrypt:
|
||||
title: Pdf Encrypt
|
||||
description: Encrypt and add protection to a PDF File
|
||||
|
||||
pdf-linearize:
|
||||
title: Pdf Linearize/FastWeb
|
||||
description: Create a Linearized version of a PDF (turn to FastWeb)
|
||||
|
||||
pdf-unlock:
|
||||
title: Pdf Decrypt and Unlock
|
||||
description: Decrypt a PDF and unlock (remove security permissions)
|
||||
|
||||
pgp-encryption:
|
||||
title: PGP encryption
|
||||
description: Encrypt and decrypt text clear text using PGP Keys.
|
||||
|
||||
pgp-key-pair-generator:
|
||||
title: PGP keygen
|
||||
description: Generate new random PGP private and public keys (with or without passphrase).
|
||||
|
||||
php-array-to-json:
|
||||
title: PHP-Array to JSON
|
||||
description: Convert PHP Array to JSON
|
||||
|
||||
pin-code-generator:
|
||||
title: Pin Code Generator
|
||||
description: Generate Unique PIN (digits) codes
|
||||
|
||||
pomodoro-timer:
|
||||
title: Pomodoro Timer
|
||||
description: Basic Pomodoro Timer
|
||||
|
||||
port-numbers:
|
||||
title: Port Numbers
|
||||
description: Search for assigned usage of a given port and protocol
|
||||
|
||||
potrace:
|
||||
title: Image to SVG (potrace)
|
||||
description: Convert an raster image to vectorial SVG
|
||||
|
||||
power-converter:
|
||||
title: Power Converter
|
||||
description: Convert values between power units
|
||||
|
||||
pressure-converter:
|
||||
title: Pressure Units Converter
|
||||
description: Convert values between pressure units
|
||||
|
||||
properties-to-yaml:
|
||||
title: Properties to YAML
|
||||
description: Convert Java .properties content to Yaml
|
||||
|
||||
raid-calculator:
|
||||
title: RAID Calculator
|
||||
description: Calculate storage capacity, fault tolerance and space efficiency of an array based on the number of disks, size, and RAID type
|
||||
|
||||
regex-memo:
|
||||
title: Regex cheatsheet
|
||||
description: Javascript Regex/Regular Expression cheatsheet
|
||||
|
||||
regex-tester:
|
||||
title: Regex Tester
|
||||
description: Test your regular expressions with sample text.
|
||||
|
||||
rem-px-converter:
|
||||
title: REM Pixel converter
|
||||
description: Convert px to rem and vice versa
|
||||
|
||||
remove-exif:
|
||||
title: Remove EXIF
|
||||
description: Remove Exif from JPEG Files
|
||||
|
||||
rmb-numbers:
|
||||
title: RMB Uppercase Converter
|
||||
description: RMB/Renminbi Capitalization Conversion Tool
|
||||
|
||||
rsa-ecdsa-signing:
|
||||
title: RSA/DSA/ECDSA Signer and Verifier
|
||||
description: Sign data and verify signature using RSA/DSA/ECDSA Keys
|
||||
|
||||
rsa-encryption:
|
||||
title: RSA encryption
|
||||
description: Encrypt and decrypt text clear text using RSA Keys.
|
||||
|
||||
rune-converter:
|
||||
title: Rune converter
|
||||
description: Convert Text to Runes and vice-versa
|
||||
|
||||
safelink-decoder:
|
||||
title: Outlook Safelink decoder
|
||||
description: Decode Outlook SafeLink links
|
||||
|
||||
sensitive-data-masker:
|
||||
title: Sensitive data masker
|
||||
description: Clean sensitive data from textual content (ie logs)
|
||||
|
||||
sharepoint-decoder:
|
||||
title: Sharepoint Share Url Decoder
|
||||
description: Decode sharepoint.com share urls to "normal" Sharepoint Url
|
||||
|
||||
sla-calculator:
|
||||
title: SLA calculator
|
||||
description: Service Level Agreement Calcultator
|
||||
|
||||
smart-raw-converter:
|
||||
title: SMART Raw Converter
|
||||
description: Convert SMART Raw values to human readable
|
||||
|
||||
smart-text-replacer:
|
||||
title: Smart Text Replacer and Linebreaker
|
||||
description: Search and replace a word on single or multiple occurrences just like windows notepad search and replace. Also allows to manage linebreaking and text splitting
|
||||
|
||||
snowflake-id-extractor:
|
||||
title: Snowflake ID extractor
|
||||
description: Extract timestamp, machine ID, and sequence number from a Snowflake ID
|
||||
|
||||
software-licence-compatibility:
|
||||
title: Software licence compatibility
|
||||
description: Software Licence compatibility checker and information
|
||||
|
||||
ssl-cert-converter:
|
||||
title: SSL Certificate converter
|
||||
description: Convert SSL Certificate from different formats
|
||||
|
||||
stacktrace-prettier:
|
||||
title: Stacktrace prettier
|
||||
description: Highlight .Net and JS stacktraces
|
||||
|
||||
timezone-converter:
|
||||
title: Timezone Converter
|
||||
description: Convert Date-Time from a timezone to others and get timezone vs countries infos
|
||||
|
||||
torrent-to-magnet:
|
||||
title: Torrent to Magnet
|
||||
description: Convert a torrent file to a Magnet url
|
||||
|
||||
ttl-calculator:
|
||||
title: TTL calculator
|
||||
description: TTL to Time converter
|
||||
|
||||
unicode-formatter:
|
||||
title: Unicode Formatter
|
||||
description: Format text using Unicode fonts
|
||||
|
||||
unicode-search:
|
||||
title: Unicode Search
|
||||
description: Search in Unicode Characters
|
||||
|
||||
url-cleaner:
|
||||
title: Url Cleaner
|
||||
description: Clean Ads tracker, UTM, Facebook and other ads provider parameters from an URL
|
||||
|
||||
url-fanger:
|
||||
title: Url Fanger
|
||||
description: Defang/Refang an URL or email address
|
||||
|
||||
url-text-fragment-maker:
|
||||
title: Url Text Search Fragment Maker
|
||||
description: Create url that allows linking directly to a specific portion of text in a web document
|
||||
|
||||
utm-url-generator:
|
||||
title: UTM Url Generator
|
||||
description: Generate an URL with utm_ parameters
|
||||
|
||||
vat-validator:
|
||||
title: VAT Numbers Validator
|
||||
description: Validate VAT Numbers
|
||||
|
||||
volume-converter:
|
||||
title: Volume Units Converter
|
||||
description: Convert values from volume units
|
||||
|
||||
websocket-tester:
|
||||
title: Websocket tester
|
||||
description: Allows to test WebSocket connections
|
||||
|
||||
week-number-converter:
|
||||
title: Week Numbers Converter
|
||||
description: Convert between ISO Week number, Week number in month and date
|
||||
|
||||
wpa-psk-generator:
|
||||
title: WPA PSK generator
|
||||
description: WPA Pre-shared Key Generator to convert a WPA passphrase and SSID to the 256-bit pre-shared ("raw") key
|
||||
|
||||
x-vr-spamcause-decoder:
|
||||
title: X-VR-SpamCause Decoder
|
||||
description: Decode X-VR-SPAMCAUSE header in OVH mails
|
||||
|
||||
x509-certificate-generator:
|
||||
title: X509 certificate generator
|
||||
description: Generate a self signed SSL/x509 certificate
|
||||
|
||||
xml-to-json:
|
||||
title: XML to Json
|
||||
description: Convert XML to JSON
|
||||
|
||||
xpath-memo:
|
||||
title: XPath Syntax Cheatsheet
|
||||
description: XPath Syntax Cheatsheet
|
||||
|
||||
xpath-tester:
|
||||
title: XPath Tester
|
||||
description: Test XPath expression against XML content
|
||||
|
||||
xslt-tester:
|
||||
title: XSLT tester
|
||||
description: Allows to test XML transformation using XSLT Stylesheets
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@ home:
|
||||
favoriteTools: 'Suas ferramentas favoritas'
|
||||
allTools: 'Todas as ferramentas'
|
||||
favoritesDndToolTip: 'Arraste e solte para reordenar favoritos'
|
||||
subtitle: 'Ferraentas úteis para desenvolvedores'
|
||||
subtitle: 'Ferramentas úteis para desenvolvedores'
|
||||
toggleMenu: 'Menu'
|
||||
home: 'Início'
|
||||
uiLib: 'Biblioteca de UI'
|
||||
|
||||
+1186
File diff suppressed because it is too large.
Load diff
+1112
-3
File diff suppressed because it is too large.
Load diff
@@ -6,6 +6,7 @@ server {
|
||||
index index.html;
|
||||
|
||||
location / {
|
||||
rewrite ^/it-tools/(.*) /$1 break;
|
||||
try_files $uri $uri/ /index.html;
|
||||
}
|
||||
}
|
||||
+12
-2
@@ -40,6 +40,7 @@
|
||||
"@chenfengyuan/vue-barcode": "^2.0.2",
|
||||
"@date-fns/utc": "^1.2.0",
|
||||
"@dice-roller/rpg-dice-roller": "^5.5.1",
|
||||
"@faker-js/faker": "^9.7.0",
|
||||
"@fortawesome/fontawesome-svg-core": "^6.7.2",
|
||||
"@fortawesome/free-solid-svg-icons": "^6.7.2",
|
||||
"@fortawesome/vue-fontawesome": "^3.0.8",
|
||||
@@ -95,7 +96,7 @@
|
||||
"chinesegen": "^0.3.3",
|
||||
"cidr-tools": "^11.0.2",
|
||||
"colord": "^2.9.3",
|
||||
"composerize": "^1.7.1",
|
||||
"composerize": "^1.7.2",
|
||||
"composeverter": "^1.7.4",
|
||||
"convert": "^5.7.0",
|
||||
"countries-and-timezones": "^3.7.2",
|
||||
@@ -135,6 +136,7 @@
|
||||
"figue": "^1.2.0",
|
||||
"file-type": "^20.1.0",
|
||||
"flatten-anything": "^4.0.1",
|
||||
"flexsearch": "^0.8.167",
|
||||
"fuse.js": "^7.1.0",
|
||||
"generate-schema": "^2.6.0",
|
||||
"get-timezone-offset": "^1.0.5",
|
||||
@@ -166,7 +168,7 @@
|
||||
"jks-js": "^1.1.4",
|
||||
"jose": "^5.9.6",
|
||||
"jpeg-quality-estimator": "^1.0.1",
|
||||
"jq-wasm": "^0.0.9",
|
||||
"jq-wasm": "^1.0.0",
|
||||
"js-base64": "^3.7.7",
|
||||
"js-beautify": "^1.15.2",
|
||||
"jsbarcode": "^3.11.6",
|
||||
@@ -178,6 +180,7 @@
|
||||
"jsonlint-mod": "^1.7.6",
|
||||
"jsonpath": "^1.1.1",
|
||||
"jsonrepair": "^3.12.0",
|
||||
"jsonschema-protobuf": "^1.0.2",
|
||||
"jsstack.js": "^2.0.0",
|
||||
"jsvat-next": "^3.0.4",
|
||||
"jszip": "^3.10.1",
|
||||
@@ -211,6 +214,7 @@
|
||||
"naive-ui": "^2.35.0",
|
||||
"nanoid": "^5.0.9",
|
||||
"nanoid-dictionary": "^4.3.0",
|
||||
"nestify-anything": "^3.0.3",
|
||||
"netmask": "^2.0.2",
|
||||
"netstack.js": "^2.1.1",
|
||||
"nginx-config-formatter": "^1.4.5",
|
||||
@@ -219,6 +223,7 @@
|
||||
"oui-data": "^1.1.281",
|
||||
"parse-duration": "^2.1.2",
|
||||
"parse-torrent": "^11.0.18",
|
||||
"paseto-ts": "^2.0.5",
|
||||
"path2d-polyfill": "^3.1.3",
|
||||
"pdf-signature-reader": "^1.4.3",
|
||||
"pdfjs-dist": "^4.8.69",
|
||||
@@ -229,12 +234,14 @@
|
||||
"potrace": "^2.1.8",
|
||||
"pp-qr-code": "^0.6.4",
|
||||
"pretty-ms": "^9.2.0",
|
||||
"properties": "^1.2.1",
|
||||
"punycode": "^2.3.1",
|
||||
"pythonstack.js": "^1.0.2",
|
||||
"qpdf-wasm-esm-embedded": "^1.1.1",
|
||||
"qrcode": "^1.5.4",
|
||||
"qrcode-parser": "^2.1.3",
|
||||
"qrcode-terminal-nooctal": "^0.12.1",
|
||||
"quicktype-core": "^23.1.3",
|
||||
"randexp": "^0.5.3",
|
||||
"regex": "^4.4.0",
|
||||
"riimut": "^0.9.1",
|
||||
@@ -249,12 +256,15 @@
|
||||
"spdx-satisfies": "^5.0.1",
|
||||
"sql-formatter": "^15.5.1",
|
||||
"sshpk": "^1.18.0",
|
||||
"staveless-futhark": "^0.6.1",
|
||||
"stringify-object": "^5.0.0",
|
||||
"svg2png-wasm": "^1.4.1",
|
||||
"svgo": "^3.3.2",
|
||||
"tesseract.js": "^5.1.1",
|
||||
"text-encoding-utf-8": "^1.0.2",
|
||||
"tidy-url": "^1.18.3",
|
||||
"to-double-quotes": "^4.0.0",
|
||||
"to-single-quotes": "^4.0.0",
|
||||
"turndown": "^7.2.0",
|
||||
"ua-parser-js": "^2.0.1",
|
||||
"ulid": "^2.3.0",
|
||||
|
||||
Generated
+1067
-682
File diff suppressed because it is too large.
Load diff
@@ -16,6 +16,7 @@ const props = withDefaults(
|
||||
outputLanguage?: string
|
||||
downloadFileName?: string
|
||||
downloadButtonText?: string
|
||||
rows?: number
|
||||
}>(),
|
||||
{
|
||||
transformer: _.identity,
|
||||
@@ -27,12 +28,13 @@ const props = withDefaults(
|
||||
outputLanguage: '',
|
||||
downloadFileName: '',
|
||||
downloadButtonText: 'Download',
|
||||
rows: 15,
|
||||
},
|
||||
);
|
||||
|
||||
const {
|
||||
transformer, inputValidationRules, inputLabel, outputLabel, outputLanguage,
|
||||
inputPlaceholder, inputDefault, downloadFileName, downloadButtonText,
|
||||
inputPlaceholder, inputDefault, downloadFileName, downloadButtonText, rows,
|
||||
} = toRefs(props);
|
||||
|
||||
const inputElement = ref<typeof CInputText>();
|
||||
@@ -54,13 +56,14 @@ const { download } = useDownloadFileFromBase64(
|
||||
v-model:value="input"
|
||||
:placeholder="inputPlaceholder"
|
||||
:label="inputLabel"
|
||||
rows="20"
|
||||
:rows="rows"
|
||||
autosize
|
||||
raw-text
|
||||
multiline
|
||||
test-id="input"
|
||||
:validation-rules="inputValidationRules"
|
||||
monospace
|
||||
mb-1
|
||||
/>
|
||||
|
||||
<div overflow-auto>
|
||||
|
||||
@@ -13,7 +13,10 @@ import markdownHljs from 'highlight.js/lib/languages/markdown';
|
||||
import jsHljs from 'highlight.js/lib/languages/javascript';
|
||||
import cssHljs from 'highlight.js/lib/languages/css';
|
||||
import goHljs from 'highlight.js/lib/languages/go';
|
||||
import pythonHljs from 'highlight.js/lib/languages/python';
|
||||
import phpHljs from 'highlight.js/lib/languages/php';
|
||||
import csharpHljs from 'highlight.js/lib/languages/csharp';
|
||||
import protobufHljs from 'highlight.js/lib/languages/protobuf';
|
||||
import { Base64 } from 'js-base64';
|
||||
import { useCopy } from '@/composable/copy';
|
||||
import { useDownloadFileFromBase64 } from '@/composable/downloadBase64';
|
||||
@@ -45,12 +48,16 @@ hljs.registerLanguage('xml', xmlHljs);
|
||||
hljs.registerLanguage('yaml', yamlHljs);
|
||||
hljs.registerLanguage('toml', iniHljs);
|
||||
hljs.registerLanguage('ts', tsHljs);
|
||||
hljs.registerLanguage('typescript', tsHljs);
|
||||
hljs.registerLanguage('bash', bashHljs);
|
||||
hljs.registerLanguage('markdown', markdownHljs);
|
||||
hljs.registerLanguage('css', cssHljs);
|
||||
hljs.registerLanguage('javascript', jsHljs);
|
||||
hljs.registerLanguage('go', goHljs);
|
||||
hljs.registerLanguage('csharp', csharpHljs);
|
||||
hljs.registerLanguage('python', pythonHljs);
|
||||
hljs.registerLanguage('php', phpHljs);
|
||||
hljs.registerLanguage('protobuf', protobufHljs);
|
||||
|
||||
const { value, language, followHeightOf, copyPlacement, copyMessage, downloadFileName, downloadButtonText } = toRefs(props);
|
||||
const { height } = followHeightOf.value ? useElementSize(followHeightOf) : { height: ref(null) };
|
||||
|
||||
@@ -0,0 +1,119 @@
|
||||
import { type MaybeRef, get } from '@vueuse/core';
|
||||
import { computed, ref, watch } from 'vue';
|
||||
import FlexSearch from 'flexsearch';
|
||||
|
||||
export function useFlexSearch<Data extends Record<string, any>>({
|
||||
search,
|
||||
data,
|
||||
options = {
|
||||
keys: [],
|
||||
},
|
||||
limit = -1,
|
||||
}: {
|
||||
search: MaybeRef<string>
|
||||
data: Data[]
|
||||
options?: {
|
||||
keys: string[]
|
||||
filterEmpty?: boolean
|
||||
tokenize?: 'strict' | 'forward' | 'reverse' | 'full'
|
||||
resolution?: number
|
||||
optimize?: boolean
|
||||
cache?: boolean | number
|
||||
}
|
||||
limit?: MaybeRef<number>
|
||||
}) {
|
||||
// Extract options
|
||||
const { keys, filterEmpty = true, ...indexOptions } = options;
|
||||
|
||||
// Create a map to store original data items
|
||||
const data_map = ref(new Map<number, Data>());
|
||||
|
||||
// Create separate indices for each key
|
||||
const indices = keys.map((key) => {
|
||||
return {
|
||||
key,
|
||||
index: new FlexSearch.Index({
|
||||
tokenize: 'forward',
|
||||
preset: 'performance',
|
||||
resolution: 9,
|
||||
optimize: true,
|
||||
cache: 100,
|
||||
fastupdate: true,
|
||||
...indexOptions,
|
||||
}),
|
||||
};
|
||||
});
|
||||
|
||||
// Initialize indices with data
|
||||
const initialize_indices = () => {
|
||||
data_map.value.clear();
|
||||
|
||||
data.forEach((item, idx) => {
|
||||
// Store original item
|
||||
data_map.value.set(idx, item);
|
||||
|
||||
// Add to each field index
|
||||
indices.forEach(({ key, index }) => {
|
||||
// Get the value for this key, potentially from nested paths
|
||||
const value = key.split('.').reduce((obj, path) => obj?.[path], item);
|
||||
if (value) {
|
||||
index.add(idx, String(value));
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
// Initialize on creation
|
||||
initialize_indices();
|
||||
|
||||
// Function to search across all indices
|
||||
const search_all_indices = (query: string, search_limit: number) => {
|
||||
if (!query) {
|
||||
return [];
|
||||
}
|
||||
|
||||
// Use a higher individual limit for each index to ensure we don't miss potential matches
|
||||
const individual_limit = search_limit > 0 ? search_limit * 2 : undefined;
|
||||
|
||||
// Search each index
|
||||
const result_sets = indices.map(({ index }) =>
|
||||
index.search(query, individual_limit ? { limit: individual_limit } : undefined),
|
||||
);
|
||||
|
||||
// Combine and deduplicate results
|
||||
const unique_ids = new Set<number>();
|
||||
result_sets.forEach((results) => {
|
||||
results.forEach(id => unique_ids.add(id as number));
|
||||
});
|
||||
|
||||
// Convert back to array of original items
|
||||
const result_array = Array.from(unique_ids)
|
||||
.map(id => data_map.value.get(id))
|
||||
.filter(Boolean) as Data[];
|
||||
|
||||
// Apply the limit to the final combined results
|
||||
return search_limit > 0 ? result_array.slice(0, search_limit) : result_array;
|
||||
};
|
||||
|
||||
// Watch for data changes to rebuild indices
|
||||
watch(() => data.length, initialize_indices);
|
||||
|
||||
// Computed results
|
||||
const searchResult = computed<Data[]>(() => {
|
||||
const query = get(search);
|
||||
const search_limit: number = get(limit);
|
||||
|
||||
// Handle empty query case
|
||||
if (!query && !filterEmpty) {
|
||||
return search_limit > 0 ? data.slice(0, search_limit) : data;
|
||||
}
|
||||
|
||||
if (!query) {
|
||||
return [];
|
||||
}
|
||||
|
||||
return search_all_indices(query, search_limit);
|
||||
});
|
||||
|
||||
return { searchResult };
|
||||
}
|
||||
@@ -13,6 +13,7 @@ const localesLong: Record<string, string> = {
|
||||
uk: 'Українська',
|
||||
zh: '中文',
|
||||
vi: 'Tiếng Việt',
|
||||
ar: 'عربي',
|
||||
};
|
||||
|
||||
const localeOptions = computed(() =>
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
import { Folder } from '@vicons/tabler';
|
||||
import { defineTool } from '../tool';
|
||||
import { translate } from '@/plugins/i18n.plugin';
|
||||
|
||||
export const tool = defineTool({
|
||||
name: 'ActiveDirectory LDAP properties searcher',
|
||||
name: translate('tools.ad-ldap-searcher.title'),
|
||||
path: '/ad-ldap-searcher',
|
||||
description: 'Search in mapping of LDAP properties and ActiveDirectory UI',
|
||||
description: translate('tools.ad-ldap-searcher.description'),
|
||||
keywords: ['active', 'directory', 'ad', 'ldap', 'prop', 'searcher'],
|
||||
component: () => import('./ad-ldap-searcher.vue'),
|
||||
icon: Folder,
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
import { Prompt } from '@vicons/tabler';
|
||||
import { defineTool } from '../tool';
|
||||
import { translate } from '@/plugins/i18n.plugin';
|
||||
|
||||
export const tool = defineTool({
|
||||
name: 'AI Prompt Splitter',
|
||||
name: translate('tools.ai-prompt-splitter.title'),
|
||||
path: '/ai-prompt-splitter',
|
||||
description: 'Split a long document to multiple chat (ie ChatGPT) prompts',
|
||||
description: translate('tools.ai-prompt-splitter.description'),
|
||||
keywords: ['ai', 'chatgpt', 'gpt', 'prompt', 'splitter'],
|
||||
component: () => import('./ai-prompt-splitter.vue'),
|
||||
icon: Prompt,
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
import { Angle } from '@vicons/tabler';
|
||||
import { defineTool } from '../tool';
|
||||
import { translate } from '@/plugins/i18n.plugin';
|
||||
|
||||
export const tool = defineTool({
|
||||
name: 'Angle Units Converter',
|
||||
name: translate('tools.angle-converter.title'),
|
||||
path: '/angle-converter',
|
||||
description: 'Convert values between angle units',
|
||||
description: translate('tools.angle-converter.description'),
|
||||
keywords: ['angle', 'converter'],
|
||||
component: () => import('./angle-converter.vue'),
|
||||
icon: Angle,
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
import { LockSquare } from '@vicons/tabler';
|
||||
import { defineTool } from '../tool';
|
||||
import { translate } from '@/plugins/i18n.plugin';
|
||||
|
||||
export const tool = defineTool({
|
||||
name: 'Ansible vault crypt decrypt',
|
||||
name: translate('tools.ansible-vault-crypt-decrypt.title'),
|
||||
path: '/ansible-vault-crypt-decrypt',
|
||||
description: 'Encrypt and decrypt Ansible Vault Secrets',
|
||||
description: translate('tools.ansible-vault-crypt-decrypt.description'),
|
||||
keywords: ['ansible', 'vault', 'crypt', 'decrypt'],
|
||||
component: () => import('./ansible-vault-crypt-decrypt.vue'),
|
||||
icon: LockSquare,
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
import { World } from '@vicons/tabler';
|
||||
import { defineTool } from '../tool';
|
||||
import { translate } from '@/plugins/i18n.plugin';
|
||||
|
||||
export const tool = defineTool({
|
||||
name: 'API Tester',
|
||||
name: translate('tools.api-tester.title'),
|
||||
path: '/api-tester',
|
||||
description: 'HTTP API Tester',
|
||||
description: translate('tools.api-tester.description'),
|
||||
keywords: ['api', 'http', 'call', 'tester'],
|
||||
component: () => import('./api-tester.vue'),
|
||||
icon: World,
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
import { SquaresDiagonal } from '@vicons/tabler';
|
||||
import { defineTool } from '../tool';
|
||||
import { translate } from '@/plugins/i18n.plugin';
|
||||
|
||||
export const tool = defineTool({
|
||||
name: 'Area Units Converter',
|
||||
name: translate('tools.area-converter.title'),
|
||||
path: '/area-converter',
|
||||
description: 'Convert values between area units',
|
||||
description: translate('tools.area-converter.description'),
|
||||
keywords: ['area', 'converter'],
|
||||
component: () => import('./area-converter.vue'),
|
||||
icon: SquaresDiagonal,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<script setup lang="ts">
|
||||
import figlet from 'figlet';
|
||||
import TextareaCopyable from '@/components/TextareaCopyable.vue';
|
||||
import { languages, translateToLanguage } from '@/utils/ascii-lang-utils';
|
||||
import { languages, printToLanguage } from '@/utils/ascii-lang-utils';
|
||||
|
||||
const input = ref('Ascii ART');
|
||||
const language = useStorage('ascii-text-drawer:language', 'raw');
|
||||
@@ -40,7 +40,7 @@ watchEffect(async () => {
|
||||
resolve(text ?? '');
|
||||
})));
|
||||
|
||||
output.value = translateToLanguage(rawOutput, languageValue);
|
||||
output.value = printToLanguage(rawOutput, languageValue);
|
||||
errored.value = false;
|
||||
}
|
||||
catch (e: any) {
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
import { Artboard } from '@vicons/tabler';
|
||||
import { defineTool } from '../tool';
|
||||
import { translate } from '@/plugins/i18n.plugin';
|
||||
|
||||
export const tool = defineTool({
|
||||
name: 'ASCII Art Text Generator',
|
||||
name: translate('tools.ascii-text-drawer.title'),
|
||||
path: '/ascii-text-drawer',
|
||||
description: 'Create ASCII art text with many fonts and styles.',
|
||||
description: translate('tools.ascii-text-drawer.description'),
|
||||
keywords: ['ascii', 'asciiart', 'text', 'drawer'],
|
||||
component: () => import('./ascii-text-drawer.vue'),
|
||||
icon: Artboard,
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
import { AspectRatio } from '@vicons/tabler';
|
||||
import { defineTool } from '../tool';
|
||||
import { translate } from '@/plugins/i18n.plugin';
|
||||
|
||||
export const tool = defineTool({
|
||||
name: 'Aspect Ratio Calculator',
|
||||
name: translate('tools.aspect-ratio-calculator.title'),
|
||||
path: '/aspect-ratio-calculator',
|
||||
description: 'Use this ratio calculator to check the dimensions when resizing images.',
|
||||
description: translate('tools.aspect-ratio-calculator.description'),
|
||||
keywords: ['aspect', 'ratio', 'calculator'],
|
||||
component: () => import('./aspect-ratio-calculator.vue'),
|
||||
icon: AspectRatio,
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
import { Barcode } from '@vicons/tabler';
|
||||
import { defineTool } from '../tool';
|
||||
import { translate } from '@/plugins/i18n.plugin';
|
||||
|
||||
export const tool = defineTool({
|
||||
name: 'Barcode Generator',
|
||||
name: translate('tools.barcode-generator.title'),
|
||||
path: '/barcode-generator',
|
||||
description: 'Barcode generator',
|
||||
description: translate('tools.barcode-generator.description'),
|
||||
keywords: ['barcode', 'generator'],
|
||||
component: () => import('./barcode-generator.vue'),
|
||||
icon: Barcode,
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
import { Barcode } from '@vicons/tabler';
|
||||
import { defineTool } from '../tool';
|
||||
import { translate } from '@/plugins/i18n.plugin';
|
||||
|
||||
export const tool = defineTool({
|
||||
name: 'Barcode Reader',
|
||||
name: translate('tools.barcode-reader.title'),
|
||||
path: '/barcode-reader',
|
||||
description: 'Barcode reader',
|
||||
description: translate('tools.barcode-reader.description'),
|
||||
keywords: ['barcode', 'reader'],
|
||||
component: () => import('./barcode-reader.vue'),
|
||||
icon: Barcode,
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue';
|
||||
import { NCard, NForm, NFormItem, NInput } from 'naive-ui';
|
||||
|
||||
const bimiData = ref({
|
||||
domain: '',
|
||||
logoUrl: '',
|
||||
vmcUrl: '',
|
||||
});
|
||||
|
||||
const bimiRecord = computed(() => {
|
||||
if (!bimiData.value.domain || !bimiData.value.logoUrl) {
|
||||
return '';
|
||||
}
|
||||
|
||||
let record = `default._bimi.${bimiData.value.domain} IN TXT "v=BIMI1; l=${bimiData.value.logoUrl}`;
|
||||
|
||||
if (bimiData.value.vmcUrl) {
|
||||
record += `; a=${bimiData.value.vmcUrl}`;
|
||||
}
|
||||
|
||||
record += '"';
|
||||
|
||||
return record;
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<NCard title="BIMI DNS Record Generator">
|
||||
<NForm :model="bimiData" label-placement="left" label-width="150px">
|
||||
<NFormItem label="Domain:">
|
||||
<NInput v-model:value="bimiData.domain" placeholder="example.com" />
|
||||
</NFormItem>
|
||||
<NFormItem label="Logo URL:">
|
||||
<NInput v-model:value="bimiData.logoUrl" placeholder="https://example.com/logo.svg" />
|
||||
</NFormItem>
|
||||
<NFormItem label="VMC Certificate URL:">
|
||||
<NInput v-model:value="bimiData.vmcUrl" placeholder="https://example.com/vmc.pem" />
|
||||
</NFormItem>
|
||||
</NForm>
|
||||
|
||||
<c-card title="Generated BIMI record">
|
||||
<textarea-copyable :value="bimiRecord" />
|
||||
</c-card>
|
||||
</NCard>
|
||||
</template>
|
||||
@@ -0,0 +1,13 @@
|
||||
import { World } from '@vicons/tabler';
|
||||
import { defineTool } from '../tool';
|
||||
|
||||
export const tool = defineTool({
|
||||
name: 'BIMI DNS Generator',
|
||||
path: '/bimi-dns-generator',
|
||||
description: 'Generate BIMI DNS TXT record',
|
||||
keywords: ['bimi', 'dns', 'txt'],
|
||||
component: () => import('./bimi-dns-generator.vue'),
|
||||
icon: World,
|
||||
createdAt: new Date('2025-04-21'),
|
||||
category: 'Network',
|
||||
});
|
||||
@@ -0,0 +1,66 @@
|
||||
<script setup lang="ts">
|
||||
const units = ref('metric');
|
||||
const weight = ref<number | null>(null);
|
||||
const height = ref<number | null>(null);
|
||||
|
||||
const options = [
|
||||
{ label: 'Metric (kg, m)', value: 'metric' },
|
||||
{ label: 'US (lbs, in)', value: 'us' },
|
||||
];
|
||||
|
||||
const bmi = computed(() => {
|
||||
if (!weight.value || !height.value) {
|
||||
return null;
|
||||
}
|
||||
let convertedWeight = weight.value;
|
||||
let convertedHeight = height.value;
|
||||
|
||||
if (units.value === 'us') {
|
||||
convertedWeight = weight.value * 0.453592; // lbs to kg
|
||||
convertedHeight = height.value * 0.0254; // inches to meters
|
||||
}
|
||||
|
||||
return (convertedWeight / (convertedHeight * convertedHeight)).toFixed(2);
|
||||
});
|
||||
|
||||
const bmiCategory = computed(() => {
|
||||
if (!bmi.value) {
|
||||
return '';
|
||||
}
|
||||
const value = Number.parseFloat(bmi.value);
|
||||
if (value < 18.5) {
|
||||
return 'Underweight';
|
||||
}
|
||||
if (value < 24.999) {
|
||||
return 'Normal weight';
|
||||
}
|
||||
if (value < 29.999) {
|
||||
return 'Overweight';
|
||||
}
|
||||
if (value < 34.999) {
|
||||
return 'Class 1 Obesity';
|
||||
}
|
||||
if (value < 39.999) {
|
||||
return 'Class 2 Obesity';
|
||||
}
|
||||
return 'Severe Obesity (Class 3 Obesity)';
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<c-card title="BMI Calculator" max-w-800px>
|
||||
<c-select v-model:value="units" label="Select Units:" :options="options" mb-2 label-position="left" />
|
||||
<n-space justify="space-evenly">
|
||||
<n-form-item :label="`Weight (${(units === 'metric' ? 'kg' : 'lbs')}):`" label-placement="left" mb-2>
|
||||
<n-input-number v-model:value="weight" placeholder="Enter weight" />
|
||||
</n-form-item>
|
||||
<n-form-item :label="`Height (${(units === 'metric' ? 'm' : 'in')}):`" label-placement="left" mb-2>
|
||||
<n-input-number v-model:value="height" placeholder="Enter height" />
|
||||
</n-form-item>
|
||||
</n-space>
|
||||
<c-card v-if="bmi" title="Result">
|
||||
<input-copyable label="BMI:" label-position="left" label-width="100px" :value="bmi" mb-1 />
|
||||
<input-copyable label="Category:" label-position="left" label-width="100px" :value="bmiCategory" />
|
||||
</c-card>
|
||||
</c-card>
|
||||
</template>
|
||||
@@ -0,0 +1,13 @@
|
||||
import { MedicalCross } from '@vicons/tabler';
|
||||
import { defineTool } from '../tool';
|
||||
|
||||
export const tool = defineTool({
|
||||
name: 'BMI Calculator',
|
||||
path: '/bmi-calculator',
|
||||
description: 'Body Mass Index Calculator (us or metric units)',
|
||||
keywords: ['bmi', 'body', 'mass'],
|
||||
component: () => import('./bmi-calculator.vue'),
|
||||
icon: MedicalCross,
|
||||
createdAt: new Date('2025-04-21'),
|
||||
category: 'Data',
|
||||
});
|
||||
@@ -18,6 +18,22 @@ import * as openpgp from 'openpgp';
|
||||
import * as forge from 'node-forge';
|
||||
import { type LabelValue, getCSRLabelValues, getCertificateLabelValues, getFingerprintLabelValues, getPGPPrivateKeyLabelValuesAsync, getPGPPublicKeyLabelValuesAsync, getPrivateKeyLabelValues, getPublicKeyLabelValues, getSignatureLabelValues } from './certificate-key-parser.infos';
|
||||
|
||||
export async function getKeysOrCertificatesInfosAsync(keyOrCertificateValue: string | Buffer, passphrase: string) {
|
||||
const parts = keyOrCertificateValue.toString().trim().split(/(-----BEGIN [^-]+-----\n)/).filter(s => s !== '');
|
||||
if (!parts.length) {
|
||||
return [await getKeyOrCertificateInfosAsync(keyOrCertificateValue, passphrase)];
|
||||
}
|
||||
const parsedPEMs: Array<{
|
||||
values: LabelValue[]
|
||||
certificateX509DER?: undefined | string
|
||||
}> = [];
|
||||
for (let i = 0; i < parts.length; i += 2) {
|
||||
const pemPart = parts[i] + parts[i + 1];
|
||||
parsedPEMs.push(await getKeyOrCertificateInfosAsync(pemPart, passphrase));
|
||||
}
|
||||
return parsedPEMs;
|
||||
}
|
||||
|
||||
export async function getKeyOrCertificateInfosAsync(keyOrCertificateValue: string | Buffer, passphrase: string) {
|
||||
try {
|
||||
const canParse = (value: string | Buffer, parseFunction: (value: string | Buffer) => any) => {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<script setup lang="ts">
|
||||
import { Buffer } from 'node:buffer';
|
||||
|
||||
import { getKeyOrCertificateInfosAsync } from './certificate-key-parser.service';
|
||||
import { getKeysOrCertificatesInfosAsync } from './certificate-key-parser.service';
|
||||
import { type LabelValue } from './certificate-key-parser.infos';
|
||||
import { useDownloadFileFromBase64 } from '@/composable/downloadBase64';
|
||||
|
||||
@@ -37,7 +37,7 @@ function downloadX509DERFile() {
|
||||
}
|
||||
}
|
||||
|
||||
const parsedSections = computedAsync<LabelValue[]>(async () => {
|
||||
const parsedSections = computedAsync<LabelValue[][]>(async () => {
|
||||
const inputContent = inputKeyOrCertificate.value;
|
||||
const file = fileInput.value;
|
||||
let inputKeyOrCertificateValue: string | Buffer = '';
|
||||
@@ -47,9 +47,15 @@ const parsedSections = computedAsync<LabelValue[]>(async () => {
|
||||
else if (inputType.value === 'content' && inputContent) {
|
||||
inputKeyOrCertificateValue = inputContent;
|
||||
}
|
||||
const { values, certificateX509DER: certPEM } = await getKeyOrCertificateInfosAsync(inputKeyOrCertificateValue, passphrase.value);
|
||||
certificateX509DER.value = certPEM || '';
|
||||
return values;
|
||||
const parsed = await getKeysOrCertificatesInfosAsync(inputKeyOrCertificateValue, passphrase.value);
|
||||
if (parsed.length === 1) {
|
||||
const { values, certificateX509DER: certPEM } = parsed[0];
|
||||
certificateX509DER.value = certPEM || '';
|
||||
return [values];
|
||||
}
|
||||
else {
|
||||
return parsed.map(p => p.values);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
@@ -96,20 +102,26 @@ const parsedSections = computedAsync<LabelValue[]>(async () => {
|
||||
|
||||
<n-divider />
|
||||
|
||||
<input-copyable
|
||||
v-for="{ label, value, multiline } of parsedSections"
|
||||
:key="label"
|
||||
:label="label"
|
||||
:data-test-id="label"
|
||||
label-position="left"
|
||||
label-width="100px"
|
||||
label-align="right"
|
||||
<c-card
|
||||
v-for="(part, partIndex) of parsedSections"
|
||||
:key="partIndex"
|
||||
mb-2
|
||||
>
|
||||
<input-copyable
|
||||
v-for="{ label, value, multiline } of part"
|
||||
:key="label"
|
||||
:label="label"
|
||||
:data-test-id="label"
|
||||
label-position="left"
|
||||
label-width="100px"
|
||||
label-align="right"
|
||||
|
||||
autosize mb-2
|
||||
:multiline="multiline"
|
||||
:value="value"
|
||||
placeholder="Not Set"
|
||||
/>
|
||||
autosize mb-2
|
||||
:multiline="multiline"
|
||||
:value="value"
|
||||
placeholder="Not Set"
|
||||
/>
|
||||
</c-card>
|
||||
|
||||
<div v-if="certificateX509DER !== ''" flex justify-center>
|
||||
<c-button @click="downloadX509DERFile()">
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
<script lang="ts" setup>
|
||||
import { useQueryParam } from '@/composable/queryParams';
|
||||
|
||||
const cookieHeader = useQueryParam({ name: 'cookies', defaultValue: '' });
|
||||
|
||||
const parsedCookies = computed(() => {
|
||||
return (cookieHeader.value || '').replace(/^Cookie:\s*/, '').split('; ').map((cookie) => {
|
||||
const [name, ...values] = cookie.split('=');
|
||||
return { name, value: decodeURIComponent(values?.join('=') || '') };
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<n-card title="Cookie Parser">
|
||||
<n-space vertical>
|
||||
<n-input v-model:value="cookieHeader" placeholder="Enter cookie header" type="text" />
|
||||
</n-space>
|
||||
<n-p>
|
||||
Tip: Navigate to a website to test, open F12 Console and run <n-tag :bordered="false">
|
||||
<code>window.copy(document.cookie)</code>
|
||||
</n-tag>. This will copy the cookie string to your clipboard. Note: This will only copy cookies available to javascript (HTTP only and secure cookies will be omitted).
|
||||
</n-p>
|
||||
<n-table v-if="parsedCookies.length">
|
||||
<thead><tr><th>Name</th><th>Value</th></tr></thead>
|
||||
<tbody>
|
||||
<tr v-for="cookie in parsedCookies" :key="cookie.name">
|
||||
<td>
|
||||
<n-a :href="`https://cookiedatabase.org/?s=${cookie.name}`" target="_blank">
|
||||
{{ cookie.name }}
|
||||
</n-a>
|
||||
</td>
|
||||
<td>{{ cookie.value }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</n-table>
|
||||
<n-alert v-else type="warning">
|
||||
No cookies found
|
||||
</n-alert>
|
||||
</n-card>
|
||||
</template>
|
||||
@@ -0,0 +1,13 @@
|
||||
import { Cookie } from '@vicons/tabler';
|
||||
import { defineTool } from '../tool';
|
||||
|
||||
export const tool = defineTool({
|
||||
name: 'Cookies Parser',
|
||||
path: '/cookies-parser',
|
||||
description: 'Parse Cookie HTTP Header',
|
||||
keywords: ['cookies', 'parser'],
|
||||
component: () => import('./cookies-parser.vue'),
|
||||
icon: Cookie,
|
||||
createdAt: new Date('2025-05-01'),
|
||||
category: 'Forensic',
|
||||
});
|
||||
@@ -0,0 +1,130 @@
|
||||
<script lang="ts" setup>
|
||||
import { convertCsvToArray } from '../csv-to-json/csv-to-json.service';
|
||||
import { objectArrayToData } from '@/utils/objectarray.export';
|
||||
import type { ExportFormat } from '@/utils/objectarray.export';
|
||||
|
||||
const inputType = ref<'file' | 'content'>('file');
|
||||
const csvContent = ref('');
|
||||
const fileInput = ref() as Ref<File | null>;
|
||||
const error = ref('');
|
||||
|
||||
const convertedData = ref<string>('');
|
||||
const selectedFormat = ref<string>('json');
|
||||
const tableName = ref<string>('TableName');
|
||||
const nestify = ref(false);
|
||||
const typedValues = ref(false);
|
||||
|
||||
const formats = [
|
||||
{ label: 'JSON', value: 'json' },
|
||||
{ label: 'YAML', value: 'yaml' },
|
||||
{ label: 'SQL INSERT', value: 'sql' },
|
||||
{ label: 'CSV (comma)', value: 'csv' },
|
||||
{ label: 'CSV (semicolon)', value: 'csv_semicolon' },
|
||||
{ label: 'CSV (tab)', value: 'tsv' },
|
||||
{ label: 'Markdown', value: 'markdown' },
|
||||
{ label: 'XML', value: 'xml' },
|
||||
];
|
||||
|
||||
async function handleFileUpload(file: File) {
|
||||
if (file) {
|
||||
fileInput.value = file;
|
||||
}
|
||||
}
|
||||
|
||||
function readFileAsString(file: File) {
|
||||
return new Promise<string>((resolve, reject) => {
|
||||
const fr = new FileReader();
|
||||
fr.onload = () => {
|
||||
resolve(fr.result as string || '');
|
||||
};
|
||||
fr.onerror = reject;
|
||||
fr.readAsText(file);
|
||||
});
|
||||
}
|
||||
|
||||
async function convertFile() {
|
||||
let csvContentValue = csvContent.value;
|
||||
const file = fileInput.value;
|
||||
error.value = '';
|
||||
try {
|
||||
if (inputType.value === 'file' && file) {
|
||||
csvContentValue = await readFileAsString(file);
|
||||
}
|
||||
|
||||
const data = convertCsvToArray(csvContentValue, typedValues.value);
|
||||
convertedData.value = objectArrayToData(data, selectedFormat.value as ExportFormat, {
|
||||
tableName: tableName.value,
|
||||
nestify: nestify.value,
|
||||
});
|
||||
}
|
||||
catch (e: any) {
|
||||
error.value = e.toString();
|
||||
return null;
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<NCard title="CSV Converter">
|
||||
<c-card>
|
||||
<n-radio-group v-model:value="inputType" name="radiogroup" mb-2 flex justify-center>
|
||||
<n-space>
|
||||
<n-radio
|
||||
value="file"
|
||||
label="File"
|
||||
/>
|
||||
<n-radio
|
||||
value="content"
|
||||
label="Content"
|
||||
/>
|
||||
</n-space>
|
||||
</n-radio-group>
|
||||
|
||||
<c-file-upload
|
||||
v-if="inputType === 'file'"
|
||||
accept=".csv,.tsv"
|
||||
title="Drag and drop a CSV file here, or click to select a file"
|
||||
@file-upload="handleFileUpload"
|
||||
/>
|
||||
|
||||
<c-input-text
|
||||
v-if="inputType === 'content'"
|
||||
v-model:value="csvContent"
|
||||
label="Paste your CSV Content:"
|
||||
placeholder="Your CSV..."
|
||||
multiline
|
||||
rows="8"
|
||||
data-test-id="input"
|
||||
/>
|
||||
</c-card>
|
||||
|
||||
<n-space justify="center">
|
||||
<n-form-item label="Typed Values" label-placement="left">
|
||||
<n-checkbox v-model:checked="typedValues" />
|
||||
</n-form-item>
|
||||
<n-form-item label="Nestify ('a.b.c' to nested objects)" label-placement="left">
|
||||
<n-checkbox v-model:checked="nestify" />
|
||||
</n-form-item>
|
||||
</n-space>
|
||||
|
||||
<NFormItem label="Select output format:" label-placement="left">
|
||||
<NSelect v-model:value="selectedFormat" :options="formats" placeholder="Select format" />
|
||||
</NFormItem>
|
||||
|
||||
<c-input-text v-if="selectedFormat === 'sql'" v-model:value="tableName" label="Table Name:" label-placement="left" />
|
||||
|
||||
<div mt-3 flex justify-center>
|
||||
<NButton :disabled="!((inputType === 'file' && fileInput) || csvContent)" @click="convertFile">
|
||||
Convert
|
||||
</NButton>
|
||||
</div>
|
||||
|
||||
<c-alert v-if="error">
|
||||
{{ error }}
|
||||
</c-alert>
|
||||
|
||||
<c-card v-if="convertedData" title="Converted data">
|
||||
<textarea-copyable :value="convertedData" :language="selectedFormat" />
|
||||
</c-card>
|
||||
</NCard>
|
||||
</template>
|
||||
@@ -0,0 +1,14 @@
|
||||
import { TableExport } from '@vicons/tabler';
|
||||
import { defineTool } from '../tool';
|
||||
|
||||
export const tool = defineTool({
|
||||
name: 'Csv to Data',
|
||||
path: '/csv-to-data',
|
||||
description: 'Convert CSV file to JSON, YAML, CSV, SQL INSERT, XML or Markdown',
|
||||
keywords: ['excel', 'csv', 'xlsx', 'sql', 'json', 'yaml', 'insert', 'markdown', 'md', 'tsv', 'xml'],
|
||||
component: () => import('./csv-to-data.vue'),
|
||||
icon: TableExport,
|
||||
createdAt: new Date('2025-05-01'),
|
||||
redirectFrom: ['/csv-to-json'],
|
||||
category: 'Converters',
|
||||
});
|
||||
@@ -15,7 +15,7 @@ function deserializeValue(value: string, tryParseValues: boolean): unknown {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (value === '') {
|
||||
if (value === '' || typeof value === 'undefined') {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ const rules: UseValidationRule<string>[] = [
|
||||
|
||||
<template>
|
||||
<n-form-item label="Typed Values" label-placement="left">
|
||||
<n-checkbox v-model:value="typedValues" />
|
||||
<n-checkbox v-model:checked="typedValues" />
|
||||
</n-form-item>
|
||||
<FormatTransformer
|
||||
input-label="Your raw CSV"
|
||||
|
||||
@@ -0,0 +1,124 @@
|
||||
<script setup lang="ts">
|
||||
import JSON5 from 'json5';
|
||||
import { useValidation } from '@/composable/validation';
|
||||
|
||||
const url = ref('');
|
||||
const method = ref('POST'); // Default method set to POST for body support
|
||||
const bodyType = ref('json'); // Default body type
|
||||
const jsonData = ref('');
|
||||
|
||||
const headers = ref([{ key: '', value: '' }]);
|
||||
const formData = ref([{ key: '', value: '' }]);
|
||||
|
||||
const methods = ['GET', 'POST', 'PUT', 'DELETE', 'PATCH'];
|
||||
|
||||
const optionsList = [
|
||||
{ key: 'compressed', description: 'Request compressed response' },
|
||||
{ key: 'compressed-ssh', description: 'Enable SSH compression' },
|
||||
{ key: 'fail', description: 'Fail silently on HTTP errors' },
|
||||
{ key: 'fail-early', description: 'Fail on first transfer error, do not continue' },
|
||||
{ key: 'head', description: 'Show document info only' },
|
||||
{ key: 'include', description: 'Include protocol response headers in output' },
|
||||
{ key: 'insecure', description: 'Allow insecure server connections when using SSL' },
|
||||
{ key: 'ipv4', description: 'Resolve names to IPv4 addresses' },
|
||||
{ key: 'ipv6', description: 'Resolve names to IPv6 addresses' },
|
||||
{ key: 'list-only', description: 'List only mode' },
|
||||
{ key: 'location', description: 'Follow redirects' },
|
||||
{ key: 'location-trusted', description: 'Follow redirects and send auth to other hosts' },
|
||||
{ key: 'no-keepalive', description: 'Disable TCP keepalive on connection' },
|
||||
{ key: 'show-error', description: 'Show error even when silent mode is used' },
|
||||
{ key: 'silent', description: 'Suppress output' },
|
||||
{ key: 'ssl', description: 'Try SSL/TLS connection' },
|
||||
{ key: 'sslv2', description: 'Use SSLv2' },
|
||||
{ key: 'sslv3', description: 'Use SSLv3' },
|
||||
{ key: 'verbose', description: 'Increase output verbosity' },
|
||||
];
|
||||
|
||||
const selectedOptions = ref<Record<string, boolean>>({});
|
||||
|
||||
const curlCommand = computed(() => {
|
||||
let command = `curl -X ${method.value} "${url.value}"`;
|
||||
|
||||
headers.value.forEach(({ key, value }) => {
|
||||
if (key && value) {
|
||||
command += ` -H "${key}: ${value}"`;
|
||||
}
|
||||
});
|
||||
|
||||
if (bodyType.value === 'json' && jsonData.value) {
|
||||
command += ` -H "Content-Type: application/json" --data '${JSON.stringify(JSON5.parse(jsonData.value))}'`;
|
||||
}
|
||||
else if (bodyType.value === 'form-data') {
|
||||
formData.value.forEach(({ key, value }) => {
|
||||
if (key && value) {
|
||||
command += ` -F "${key}=${value}"`;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
optionsList.forEach(({ key }) => {
|
||||
if (selectedOptions.value[key]) {
|
||||
command += ` --${key}`;
|
||||
}
|
||||
});
|
||||
|
||||
return command;
|
||||
});
|
||||
|
||||
const jsonBodyValidation = useValidation({
|
||||
source: jsonData,
|
||||
rules: [
|
||||
{
|
||||
message: 'Invalid JSON string',
|
||||
validator: value => !value || JSON5.parse(value),
|
||||
},
|
||||
],
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<NFormItem label="Url:" label-placement="left">
|
||||
<NInput v-model:value="url" placeholder="Enter URL" />
|
||||
</NFormItem>
|
||||
<NFormItem label="Method:" label-placement="left">
|
||||
<NSelect v-model:value="method" :options="methods.map(m => ({ label: m, value: m }))" />
|
||||
</NFormItem>
|
||||
|
||||
<NRadioGroup v-model:value="bodyType" mb-2>
|
||||
<NRadio value="json">
|
||||
JSON Body
|
||||
</NRadio>
|
||||
<NRadio value="form-data">
|
||||
Multipart Form-Data
|
||||
</NRadio>
|
||||
</NRadioGroup>
|
||||
|
||||
<c-card v-if="bodyType === 'json'" title="JSON Body:" mb-2>
|
||||
<c-input-text
|
||||
v-model:value="jsonData" multiline rows="6"
|
||||
placeholder="Enter JSON body" :validation="jsonBodyValidation"
|
||||
/>
|
||||
</c-card>
|
||||
|
||||
<c-card v-else title="Form entries:" mb-2>
|
||||
<NDynamicInput v-model:value="formData" preset="pair" key-placeholder="Key" value-placeholder="Value" />
|
||||
</c-card>
|
||||
|
||||
<c-card title="HTTP Headers:" mb-2>
|
||||
<NDynamicInput v-model:value="headers" preset="pair" key-placeholder="Header" value-placeholder="Value" />
|
||||
</c-card>
|
||||
|
||||
<c-card title="Options:" mb-2>
|
||||
<template v-for="option in optionsList" :key="option.key">
|
||||
<NCheckbox v-model:checked="selectedOptions[option.key]">
|
||||
{{ `--${option.key}` }} <em>({{ option.description }})</em>
|
||||
</NCheckbox>
|
||||
</template>
|
||||
</c-card>
|
||||
|
||||
<c-card title="Generated curl command">
|
||||
<textarea-copyable :value="curlCommand" />
|
||||
</c-card>
|
||||
</div>
|
||||
</template>
|
||||
@@ -0,0 +1,13 @@
|
||||
import { Download } from '@vicons/tabler';
|
||||
import { defineTool } from '../tool';
|
||||
|
||||
export const tool = defineTool({
|
||||
name: 'Curl Command Generator',
|
||||
path: '/curl-generator',
|
||||
description: 'Generate CURL command lines',
|
||||
keywords: ['curl'],
|
||||
component: () => import('./curl-generator.vue'),
|
||||
icon: Download,
|
||||
createdAt: new Date('2025-04-21'),
|
||||
category: 'Network',
|
||||
});
|
||||
@@ -0,0 +1,156 @@
|
||||
<script setup lang="ts">
|
||||
import { type Faker, allFakers } from '@faker-js/faker';
|
||||
import JSON5 from 'json5';
|
||||
import { objectArrayToData } from '@/utils/objectarray.export';
|
||||
import type { ExportFormat } from '@/utils/objectarray.export';
|
||||
import type { UseValidationRule } from '@/composable/validation';
|
||||
import { useQueryParamOrStorage } from '@/composable/queryParams';
|
||||
|
||||
const jsonInput = useQueryParamOrStorage({
|
||||
name: 'template',
|
||||
storageName: 'faker:tmpl',
|
||||
defaultValue: JSON.stringify({
|
||||
name: 'faker.person.fullName',
|
||||
email: 'faker.internet.email',
|
||||
address: {
|
||||
street: 'faker.location.streetAddress',
|
||||
city: 'faker.location.city',
|
||||
country: 'faker.location.country',
|
||||
},
|
||||
phone: 'faker.phone.number',
|
||||
}, null, 2),
|
||||
});
|
||||
|
||||
const generatedData = ref<string>('');
|
||||
const itemCount = useQueryParamOrStorage({ name: 'count', storageName: 'faker:c', defaultValue: 1 });
|
||||
const error = ref('');
|
||||
const selectedFormat = useQueryParamOrStorage({ name: 'fmt', storageName: 'faker:f', defaultValue: 'json' });
|
||||
const tableName = ref<string>('TableName');
|
||||
const nestify = ref(false);
|
||||
|
||||
const allLocales = Object.keys(allFakers);
|
||||
const selectedLocale = useQueryParamOrStorage({ name: 'locale', storageName: 'faker:l', defaultValue: 'en' });
|
||||
const faker = computed(() => (allFakers as Record<string, Faker>)[selectedLocale.value]);
|
||||
|
||||
const formats = [
|
||||
{ label: 'JSON', value: 'json' },
|
||||
{ label: 'YAML', value: 'yaml' },
|
||||
{ label: 'SQL INSERT', value: 'sql' },
|
||||
{ label: 'CSV (comma)', value: 'csv' },
|
||||
{ label: 'CSV (semicolon)', value: 'csv_semicolon' },
|
||||
{ label: 'CSV (tab)', value: 'tsv' },
|
||||
{ label: 'Markdown', value: 'markdown' },
|
||||
{ label: 'XML', value: 'xml' },
|
||||
];
|
||||
|
||||
// Extract all faker methods dynamically
|
||||
const fakerMethods = computed(() => {
|
||||
const methods: string[] = [];
|
||||
const fakerObj = (faker as Record<string, any>);
|
||||
Object.keys(fakerObj).forEach((category) => {
|
||||
if (typeof fakerObj[category] === 'object') {
|
||||
Object.keys(fakerObj[category]).forEach((method) => {
|
||||
methods.push(`faker.${category}.${method}`);
|
||||
});
|
||||
}
|
||||
});
|
||||
return methods.map(method => ({ label: method, value: method }));
|
||||
});
|
||||
|
||||
// Selected faker method for insertion
|
||||
const selectedMethod = ref<string>('');
|
||||
|
||||
function resolveFakerValue(value: string) {
|
||||
try {
|
||||
return value.startsWith('faker.')
|
||||
? value.split('.').slice(1).reduce((acc: any, prop: string) => acc[prop], faker.value)()
|
||||
: value;
|
||||
}
|
||||
catch {
|
||||
return value; // Fallback for invalid faker function names
|
||||
}
|
||||
}
|
||||
|
||||
function generateFakeData(template: Record<string, any>): Record<string, any> {
|
||||
return Object.entries(template).reduce((result, [key, value]) => {
|
||||
result[key] = typeof value === 'object' && value !== null
|
||||
? generateFakeData(value) // Recursive handling for nested objects
|
||||
: resolveFakerValue(value);
|
||||
return result;
|
||||
}, {} as Record<string, any>);
|
||||
}
|
||||
|
||||
function handleGenerate() {
|
||||
try {
|
||||
error.value = '';
|
||||
const parsedTemplate = JSON.parse(jsonInput.value);
|
||||
generatedData.value = objectArrayToData(
|
||||
Array.from({ length: itemCount.value },
|
||||
() => generateFakeData(parsedTemplate)),
|
||||
selectedFormat.value as ExportFormat, {
|
||||
tableName: tableName.value,
|
||||
nestify: nestify.value,
|
||||
});
|
||||
}
|
||||
catch (e: any) {
|
||||
error.value = e.toString();
|
||||
}
|
||||
}
|
||||
|
||||
function insertMethodIntoJson() {
|
||||
if (selectedMethod.value) {
|
||||
jsonInput.value = jsonInput.value.replace(/\n?\}$/, `,\n "newField": "${selectedMethod.value}"\n}`);
|
||||
}
|
||||
}
|
||||
|
||||
const rules: UseValidationRule<string>[] = [
|
||||
{
|
||||
validator: (v: string) => v === '' || JSON5.parse(v),
|
||||
message: 'Provided JSON is not valid.',
|
||||
},
|
||||
];
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<NCard title="Fake Data Generator">
|
||||
<c-input-text v-model:value="jsonInput" label="JSON Template:" multiline mb-1 rows="10" placeholder="Enter JSON template..." :validation-rules="rules" />
|
||||
|
||||
<c-card title="Faker Method insertion" mb-1>
|
||||
<n-space>
|
||||
<c-select v-model:value="selectedMethod" style="width: 200px" :options="fakerMethods" searchable placeholder="Search Faker Method" />
|
||||
<NButton @click="insertMethodIntoJson">
|
||||
Insert Selected Method
|
||||
</NButton>
|
||||
</n-space>
|
||||
</c-card>
|
||||
|
||||
<n-space mb-1>
|
||||
<NFormItem label="Number of objects to generate:" label-placement="left">
|
||||
<NInputNumber v-model:value="itemCount" :min="1" placeholder="Number of objects to generate" />
|
||||
</NFormItem>
|
||||
<n-form-item label="Nestify (handle nested objects)" label-placement="left">
|
||||
<n-checkbox v-model:checked="nestify" />
|
||||
</n-form-item>
|
||||
</n-space>
|
||||
|
||||
<c-select v-model:value="selectedLocale" label="Locale:" label-position="left" :options="allLocales" searchable mb-1 placeholder="Search locale version" />
|
||||
|
||||
<NFormItem label="Select output format:" label-placement="left" mb-1>
|
||||
<NSelect v-model:value="selectedFormat" :options="formats" placeholder="Select format" />
|
||||
</NFormItem>
|
||||
|
||||
<c-input-text v-if="selectedFormat === 'sql'" v-model:value="tableName" label="Table Name:" label-placement="left" mb-1 />
|
||||
|
||||
<NButton mb-2 mt-2 @click="handleGenerate">
|
||||
Generate Fake Data
|
||||
</NButton>
|
||||
|
||||
<c-alert v-if="error">
|
||||
{{ error }}
|
||||
</c-alert>
|
||||
|
||||
<c-card v-if="generatedData" title="Generated data">
|
||||
<textarea-copyable :value="generatedData" :language="selectedFormat" />
|
||||
</c-card>
|
||||
</NCard>
|
||||
</template>
|
||||
@@ -0,0 +1,13 @@
|
||||
import { ArrowsShuffle } from '@vicons/tabler';
|
||||
import { defineTool } from '../tool';
|
||||
|
||||
export const tool = defineTool({
|
||||
name: 'Data Faker',
|
||||
path: '/data-faker',
|
||||
description: 'Generate fake data using JSON template',
|
||||
keywords: ['data', 'json', 'sample', 'faker'],
|
||||
component: () => import('./data-faker.vue'),
|
||||
icon: ArrowsShuffle,
|
||||
createdAt: new Date('2025-05-01'),
|
||||
category: 'Development',
|
||||
});
|
||||
@@ -53,6 +53,13 @@ const convertedValue = computed(() => {
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<n-p text-center>
|
||||
1MiB = 1024KiB ; 1MB = 1000kB ; 1GiB = 1024MiB ; 1GB = 1000MB ;
|
||||
<n-a href="https://en.wikipedia.org/wiki/Byte" target="_blank" rel="noopener">
|
||||
see here for details
|
||||
</n-a>
|
||||
</n-p>
|
||||
|
||||
<c-card>
|
||||
<n-form-item label="Input Size:" label-placement="left" mb-1>
|
||||
<c-input-text
|
||||
|
||||
@@ -142,6 +142,13 @@ const amountTransferableOutput = computed(() => {
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<n-p text-center>
|
||||
1MiB = 1024KiB ; 1MB = 1000kB ; 1GiB = 1024MiB ; 1GB = 1000MB ;
|
||||
<n-a href="https://en.wikipedia.org/wiki/Byte" target="_blank" rel="noopener">
|
||||
see here for details
|
||||
</n-a>
|
||||
</n-p>
|
||||
|
||||
<c-card title="Transfer Time" mb-2>
|
||||
<n-form-item label="Data Size:" label-placement="left">
|
||||
<n-input v-model:value="transferTimeInput.dataSize" placeholder="Data Size..." :min="0" w-full />
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
<script lang="ts" setup>
|
||||
import { computed, ref } from 'vue';
|
||||
import { countBy, orderBy } from 'lodash';
|
||||
|
||||
const inputText = ref('');
|
||||
const sortedWordCounts = computed(() => {
|
||||
// Remove punctuation, extract words, count occurrences
|
||||
const cleanedText = inputText.value.replace(/\p{P}+\s|\s\p{P}+|\p{P}+$|^\p{P}+|\s+/gu, ' ').trim(); // Remove punctuation
|
||||
const wordCountObj = countBy(cleanedText.split(' ') || []);
|
||||
|
||||
// Convert to array and sort by count descending
|
||||
return orderBy(Object.entries(wordCountObj), ([, count]) => count, 'desc');
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<c-input-text v-model:value="inputText" multiline rows="10" label="Text:" placeholder="Enter text..." mb-1 />
|
||||
<c-card title="Distinct words">
|
||||
<n-table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Word</th>
|
||||
<th>Count</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="([word, count]) in sortedWordCounts" :key="word">
|
||||
<td>{{ word }}</td><td>{{ count }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</n-table>
|
||||
</c-card>
|
||||
</div>
|
||||
</template>
|
||||
@@ -0,0 +1,13 @@
|
||||
import { FileText } from '@vicons/tabler';
|
||||
import { defineTool } from '../tool';
|
||||
|
||||
export const tool = defineTool({
|
||||
name: 'Distinct Words',
|
||||
path: '/distinct-words',
|
||||
description: 'Extract and count occurences of each unique word in a text',
|
||||
keywords: ['distinct', 'words'],
|
||||
component: () => import('./distinct-words.vue'),
|
||||
icon: FileText,
|
||||
createdAt: new Date('2025-05-01'),
|
||||
category: 'Text',
|
||||
});
|
||||
@@ -0,0 +1,86 @@
|
||||
<script setup lang="ts">
|
||||
import { NForm, NFormItem, NInput, NSelect } from 'naive-ui';
|
||||
import { generateKeyPair } from '../rsa-key-pair-generator/rsa-key-pair-generator.service';
|
||||
import { withDefaultOnErrorAsync } from '@/utils/defaults';
|
||||
import { computedRefreshableAsync } from '@/composable/computedRefreshable';
|
||||
|
||||
const domain = ref('');
|
||||
const selector = ref('default');
|
||||
const keySize = ref('2048');
|
||||
const password = ref('');
|
||||
|
||||
const keySizes = [
|
||||
{ label: '1024-bit (Less secure, but faster)', value: '1024' },
|
||||
{ label: '2048-bit (Recommended for security)', value: '2048' },
|
||||
{ label: '4096-bit (Stronger security, but slower)', value: '4096' },
|
||||
];
|
||||
|
||||
const emptyCerts = { publicKey: '', privateKey: '' };
|
||||
const [certs, refreshCerts] = computedRefreshableAsync(
|
||||
() => withDefaultOnErrorAsync(() => generateKeyPair({
|
||||
bits: Number(keySize.value),
|
||||
password: password.value,
|
||||
format: 'pem',
|
||||
}), emptyCerts),
|
||||
emptyCerts,
|
||||
);
|
||||
|
||||
const dKIMRecord = computed(() => {
|
||||
if (!domain.value || !selector.value) {
|
||||
return '';
|
||||
}
|
||||
|
||||
const pubKey = certs.value.publicKey.replace(/-----(BEGIN|END) PUBLIC KEY-----|\s/g, '');
|
||||
const parts = [
|
||||
'v=DKIM1',
|
||||
'k=rsa',
|
||||
`p=${pubKey}`,
|
||||
];
|
||||
|
||||
const record = parts.join('; ');
|
||||
return `${selector.value}._domainkey.${domain.value} IN TXT "${record}"`;
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<NForm label-placement="top">
|
||||
<NFormItem label="Domain Name:">
|
||||
<NInput v-model:value="domain" placeholder="Enter domain (e.g., example.com)" />
|
||||
</NFormItem>
|
||||
|
||||
<NFormItem label="Selector (Unique name used to distinguish DKIM records for the same domain):">
|
||||
<NInput v-model:value="selector" placeholder="Enter selector (e.g., default)" />
|
||||
</NFormItem>
|
||||
|
||||
<NFormItem label="Key Size (of the RSA key used for signing emails):">
|
||||
<NSelect v-model:value="keySize" :options="keySizes" placeholder="Select key size" />
|
||||
</NFormItem>
|
||||
|
||||
<NFormItem label="Passphrase (of private key):">
|
||||
<NInput
|
||||
v-model:value="password"
|
||||
type="password"
|
||||
show-password-on="mousedown"
|
||||
placeholder="Passphrase"
|
||||
/>
|
||||
</NFormItem>
|
||||
|
||||
<div mb-2 flex justify-center>
|
||||
<n-button @click="refreshCerts()">
|
||||
Refresh Certificate
|
||||
</n-button>
|
||||
</div>
|
||||
|
||||
<c-card title="Generate DKIM Record" mb-1>
|
||||
<textarea-copyable :value="dKIMRecord" />
|
||||
</c-card>
|
||||
|
||||
<c-card v-if="dKIMRecord" title="RSA Public Key" mb-1>
|
||||
<textarea-copyable :value="certs.publicKey" />
|
||||
</c-card>
|
||||
|
||||
<c-card v-if="dKIMRecord" title="PEM RSA Private key">
|
||||
<textarea-copyable :value="certs.privateKey" />
|
||||
</c-card>
|
||||
</NForm>
|
||||
</template>
|
||||
@@ -0,0 +1,13 @@
|
||||
import { World } from '@vicons/tabler';
|
||||
import { defineTool } from '../tool';
|
||||
|
||||
export const tool = defineTool({
|
||||
name: 'DKIM DNS Generator',
|
||||
path: '/dkim-dns-generator',
|
||||
description: 'Generate DKIM DNS TXT record',
|
||||
keywords: ['dkim', 'dns'],
|
||||
component: () => import('./dkim-dns-generator.vue'),
|
||||
icon: World,
|
||||
createdAt: new Date('2025-04-21'),
|
||||
category: 'Network',
|
||||
});
|
||||
@@ -0,0 +1,96 @@
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue';
|
||||
|
||||
const domain = ref('');
|
||||
const policy = ref('none');
|
||||
const subPolicy = ref('none');
|
||||
const percentage = ref(100);
|
||||
const rua = ref('');
|
||||
const ruf = ref('');
|
||||
const aspf = ref('r');
|
||||
const adkim = ref('r');
|
||||
const ri = ref(86400);
|
||||
const dmarcRecord = computed(() => {
|
||||
const recordParts = ['v=DMARC1', `p=${policy.value}`, `sp=${subPolicy.value}`];
|
||||
|
||||
if (percentage.value !== 100) {
|
||||
recordParts.push(`pct=${percentage.value}`);
|
||||
}
|
||||
if (rua.value) {
|
||||
recordParts.push(`rua=mailto:${rua.value}`);
|
||||
}
|
||||
if (ruf.value) {
|
||||
recordParts.push(`ruf=mailto:${ruf.value}`);
|
||||
}
|
||||
if (aspf.value) {
|
||||
recordParts.push(`aspf=${aspf.value}`);
|
||||
}
|
||||
if (adkim.value) {
|
||||
recordParts.push(`adkim=${adkim.value}`);
|
||||
}
|
||||
if (ri.value) {
|
||||
recordParts.push(`ri=${ri.value}`);
|
||||
}
|
||||
|
||||
return recordParts.join('; ');
|
||||
});
|
||||
|
||||
const policies = [
|
||||
{ label: 'None', value: 'none' },
|
||||
{ label: 'Quarantine', value: 'quarantine' },
|
||||
{ label: 'Reject', value: 'reject' },
|
||||
];
|
||||
|
||||
const alignments = [
|
||||
{ label: 'Relaxed (r)', value: 'r' },
|
||||
{ label: 'Strict (s)', value: 's' },
|
||||
];
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<n-card title="DMARC Record Generator" max-w-600px>
|
||||
<n-form-item label="Domain:" label-placement="left">
|
||||
<n-input v-model:value="domain" placeholder="example.com" />
|
||||
</n-form-item>
|
||||
|
||||
<n-form-item label="Policy:" label-placement="left">
|
||||
<n-select v-model:value="policy" :options="policies" placeholder="Select policy" />
|
||||
</n-form-item>
|
||||
|
||||
<n-form-item label="Subdomain Policy:" label-placement="left">
|
||||
<n-select v-model:value="subPolicy" :options="policies" placeholder="Select policy" />
|
||||
</n-form-item>
|
||||
|
||||
<n-form-item label="Percentage (of emails subject to DMARC policy enforcement (0-100%)):" label-placement="top">
|
||||
<n-input-number v-model:value="percentage" :min="0" :max="100" placeholder="Enter percentage" />
|
||||
</n-form-item>
|
||||
|
||||
<n-form-item label="Aggregate Email (where aggregate DMARC reports should be sent):" label-placement="top">
|
||||
<n-input v-model:value="rua" placeholder="admin@example.com" />
|
||||
</n-form-item>
|
||||
|
||||
<n-form-item label="Forensic Email (where forensic DMARC failure reports should be sent):" label-placement="top">
|
||||
<n-input v-model:value="ruf" placeholder="admin@example.com" />
|
||||
</n-form-item>
|
||||
|
||||
<n-form-item label="Alignment (SPF):" label-placement="left">
|
||||
<n-select v-model:value="aspf" :options="alignments" placeholder="Select alignment" />
|
||||
</n-form-item>
|
||||
|
||||
<n-form-item label="Alignment (DKIM):" label-placement="left">
|
||||
<n-select v-model:value="adkim" :options="alignments" placeholder="Select alignment" />
|
||||
</n-form-item>
|
||||
|
||||
<n-form-item label="Reporting Interval (for sending DMARC aggregate reports):" label-placement="top">
|
||||
<n-input-number v-model:value="ri" :min="3600" placeholder="Enter interval">
|
||||
<template #suffix>
|
||||
seconds
|
||||
</template>
|
||||
</n-input-number>
|
||||
</n-form-item>
|
||||
|
||||
<n-card v-if="dmarcRecord" title="Generated DMARC Record">
|
||||
<textarea-copyable :value="dmarcRecord" />
|
||||
</n-card>
|
||||
</n-card>
|
||||
</template>
|
||||
@@ -0,0 +1,13 @@
|
||||
import { World } from '@vicons/tabler';
|
||||
import { defineTool } from '../tool';
|
||||
|
||||
export const tool = defineTool({
|
||||
name: 'DMARC DNS Generator',
|
||||
path: '/dmarc-dns-generator',
|
||||
description: 'Generate DMARC DNS TXT record',
|
||||
keywords: ['dmarc', 'dns'],
|
||||
component: () => import('./dmarc-dns-generator.vue'),
|
||||
icon: World,
|
||||
createdAt: new Date('2025-04-21'),
|
||||
category: 'Network',
|
||||
});
|
||||
@@ -19,13 +19,13 @@ Docker images are a lightweight, standalone, executable package of software that
|
||||
Build an Image from a Dockerfile
|
||||
|
||||
```bash
|
||||
docker build -t <image_name> .
|
||||
docker build -t <image_name> .
|
||||
```
|
||||
|
||||
Build an Image from a Dockerfile without the cache
|
||||
|
||||
```bash
|
||||
docker build -t <image\_name> . -no-cache
|
||||
docker build -t <image\_name> . -no-cache
|
||||
```
|
||||
|
||||
List local images
|
||||
@@ -37,7 +37,7 @@ docker images
|
||||
Delete an Image
|
||||
|
||||
```bash
|
||||
docker rmi <image\_name>
|
||||
docker rmi <image\_name>
|
||||
```
|
||||
|
||||
Remove all unused images
|
||||
@@ -53,25 +53,25 @@ Docker Hub is a service provided by Docker for finding and sharing container ima
|
||||
Login into Docker
|
||||
|
||||
```bash
|
||||
docker login -u <username>
|
||||
docker login -u <username>
|
||||
```
|
||||
|
||||
Publish an image to Docker Hub
|
||||
|
||||
```bash
|
||||
docker push <username>/<image\_name>
|
||||
docker push <username>/<image\_name>
|
||||
```
|
||||
|
||||
Search Hub for an image
|
||||
|
||||
```bash
|
||||
docker search <image\_name>
|
||||
docker search <image\_name>
|
||||
```
|
||||
|
||||
Pull an image from a Docker Hub
|
||||
|
||||
```bash
|
||||
docker pull <image\_name>
|
||||
docker pull <image\_name>
|
||||
```
|
||||
|
||||
Start the docker daemon
|
||||
@@ -99,49 +99,49 @@ A container is a runtime instance of a docker image. A container will always run
|
||||
Create and run a container from an image, with a custom name:
|
||||
|
||||
```bash
|
||||
docker run --name <container\_name> <image\_name>
|
||||
docker run --name <container\_name> <image\_name>
|
||||
```
|
||||
|
||||
Run a container with and publish a container's port(s) to the host.
|
||||
|
||||
```bash
|
||||
docker run -p <host\_port>:<container\_port> <image\_name>
|
||||
docker run -p <host\_port>:<container\_port> <image\_name>
|
||||
```
|
||||
|
||||
Run a container in the background
|
||||
|
||||
```bash
|
||||
docker run -d <image\_name>
|
||||
docker run -d <image\_name>
|
||||
```
|
||||
|
||||
Start or stop an existing container:
|
||||
|
||||
```bash
|
||||
docker start|stop <container\_name> (or <container-id>)
|
||||
docker start|stop <container\_name> (or <container-id>)
|
||||
```
|
||||
|
||||
Remove a stopped container:
|
||||
|
||||
```bash
|
||||
docker rm <container\_name>
|
||||
docker rm <container\_name>
|
||||
```
|
||||
|
||||
Open a shell inside a running container:
|
||||
|
||||
```bash
|
||||
docker exec -it <container\_name> sh
|
||||
docker exec -it <container\_name> sh
|
||||
```
|
||||
|
||||
Fetch and follow the logs of a container:
|
||||
|
||||
```bash
|
||||
docker logs -f <container\_name>
|
||||
docker logs -f <container\_name>
|
||||
```
|
||||
|
||||
To inspect a running container:
|
||||
|
||||
```bash
|
||||
docker inspect <container\_name> (or <container\_id>)
|
||||
docker inspect <container\_name> (or <container\_id>)
|
||||
```
|
||||
|
||||
To list currently running containers:
|
||||
|
||||
@@ -3,13 +3,15 @@ import type { KeyEncoding } from './encryption.service';
|
||||
import { algos } from './encryption.service';
|
||||
import { computedCatch } from '@/composable/computed/catchedComputed';
|
||||
|
||||
const { t } = useI18n();
|
||||
|
||||
const cypherInput = ref('Lorem ipsum dolor sit amet');
|
||||
const cypherAlgo = ref<keyof typeof algos>('AES-CBC');
|
||||
const cypherSecret = ref('my secret key 16');
|
||||
const cypherSecretEncoding = ref<KeyEncoding>('Text');
|
||||
const [cypherOutput, cypherError] = computedCatch(() => algos[cypherAlgo.value].encrypt(cypherInput.value, cypherSecret.value, cypherSecretEncoding.value), {
|
||||
defaultValue: '',
|
||||
defaultErrorMessage: 'Unable to cypher your text',
|
||||
defaultErrorMessage: t('tools.encryption.defaultErrorMessage'),
|
||||
});
|
||||
|
||||
const decryptInput = ref('dopEIE7v5TJlhHl+0+mA4Q+BxNj4xcdTsiVGw4tmpLlkDln8lzmzavO3egJuzpCD');
|
||||
@@ -18,12 +20,12 @@ const decryptSecret = ref('my secret key 16');
|
||||
const decryptSecretEncoding = ref<KeyEncoding>('Text');
|
||||
const [decryptOutput, decryptError] = computedCatch(() => algos[decryptAlgo.value].decrypt(decryptInput.value, decryptSecret.value, decryptSecretEncoding.value), {
|
||||
defaultValue: '',
|
||||
defaultErrorMessage: 'Unable to decrypt your text',
|
||||
defaultErrorMessage: t('tools.encryption.defaultErrorMessage'),
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<c-card title="Encrypt">
|
||||
<c-card :title="t('tools.encryption.title-encrypt')">
|
||||
<div flex gap-3>
|
||||
<c-input-text
|
||||
v-model:value="cypherInput"
|
||||
@@ -69,7 +71,7 @@ const [decryptOutput, decryptError] = computedCatch(() => algos[decryptAlgo.valu
|
||||
multiline monospace readonly autosize mt-5
|
||||
/>
|
||||
</c-card>
|
||||
<c-card title="Decrypt">
|
||||
<c-card :title="t('tools.encryption.title-decrypt')">
|
||||
<div flex gap-3>
|
||||
<c-input-text
|
||||
v-model:value="decryptInput"
|
||||
|
||||
@@ -0,0 +1,91 @@
|
||||
<script lang="ts" setup>
|
||||
import * as XLSX from 'xlsx';
|
||||
import { objectArrayToData } from '@/utils/objectarray.export';
|
||||
import type { ExportFormat } from '@/utils/objectarray.export';
|
||||
|
||||
const workbook = ref<XLSX.WorkBook | null>(null);
|
||||
const convertedData = ref<string>('');
|
||||
const selectedFormat = ref<string>('json');
|
||||
const tableName = ref<string>('TableName');
|
||||
const nestify = ref(false);
|
||||
const sheetName = ref('');
|
||||
const error = ref('');
|
||||
|
||||
const formats = [
|
||||
{ label: 'JSON', value: 'json' },
|
||||
{ label: 'YAML', value: 'yaml' },
|
||||
{ label: 'SQL INSERT', value: 'sql' },
|
||||
{ label: 'CSV (comma)', value: 'csv' },
|
||||
{ label: 'CSV (semicolon)', value: 'csv_semicolon' },
|
||||
{ label: 'CSV (tab)', value: 'tsv' },
|
||||
{ label: 'Markdown', value: 'markdown' },
|
||||
{ label: 'XML', value: 'xml' },
|
||||
];
|
||||
|
||||
async function handleFileUpload(file: File) {
|
||||
error.value = '';
|
||||
workbook.value = null;
|
||||
sheetName.value = '';
|
||||
try {
|
||||
workbook.value = XLSX.read(await file.arrayBuffer(), { type: 'binary' });
|
||||
sheetName.value = workbook.value.SheetNames[0];
|
||||
}
|
||||
catch (e: any) {
|
||||
error.value = e.toString();
|
||||
}
|
||||
}
|
||||
|
||||
function convertFile() {
|
||||
if (!workbook.value) {
|
||||
return;
|
||||
}
|
||||
const data = XLSX.utils.sheet_to_json(workbook.value.Sheets[sheetName.value]);
|
||||
if (!data.length || !selectedFormat.value) {
|
||||
return;
|
||||
}
|
||||
|
||||
convertedData.value = objectArrayToData(data, selectedFormat.value as ExportFormat, {
|
||||
tableName: tableName.value,
|
||||
nestify: nestify.value,
|
||||
});
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<NCard title="XLSX Converter">
|
||||
<c-file-upload
|
||||
title="Drag and drop a XLSX here, or click to select a file"
|
||||
accept=".xlsx"
|
||||
mb-3
|
||||
@file-upload="handleFileUpload"
|
||||
/>
|
||||
|
||||
<NFormItem v-if="workbook" label="Select Sheet to use:" label-placement="left">
|
||||
<NSelect v-model:value="sheetName" :options="workbook.SheetNames?.map((s) => ({ label: s, value: s }))" placeholder="Select sheet" />
|
||||
</NFormItem>
|
||||
|
||||
<NFormItem label="Select output format:" label-placement="left">
|
||||
<NSelect v-model:value="selectedFormat" :options="formats" placeholder="Select format" />
|
||||
</NFormItem>
|
||||
|
||||
<n-form-item label="Nestify ('a.b.c' to nested objects)" label-placement="left">
|
||||
<n-checkbox v-model:checked="nestify" />
|
||||
</n-form-item>
|
||||
|
||||
<c-input-text v-if="selectedFormat === 'sql'" v-model:value="tableName" label="Table Name:" label-placement="left" />
|
||||
|
||||
<div mt-3 flex justify-center>
|
||||
<NButton :disabled="!workbook" @click="convertFile">
|
||||
Convert
|
||||
</NButton>
|
||||
</div>
|
||||
|
||||
<c-alert v-if="error">
|
||||
{{ error }}
|
||||
</c-alert>
|
||||
|
||||
<c-card v-if="convertedData" title="Converted data">
|
||||
<textarea-copyable :value="convertedData" :language="selectedFormat" />
|
||||
</c-card>
|
||||
</NCard>
|
||||
</template>
|
||||
@@ -0,0 +1,13 @@
|
||||
import { TableExport } from '@vicons/tabler';
|
||||
import { defineTool } from '../tool';
|
||||
|
||||
export const tool = defineTool({
|
||||
name: 'Excel to data',
|
||||
path: '/excel-to-data',
|
||||
description: 'Convert XLSX file to JSON, YAML, CSV, SQL INSERT, XML or Markdown',
|
||||
keywords: ['excel', 'csv', 'xlsx', 'sql', 'json', 'yaml', 'insert', 'markdown', 'md', 'tsv', 'xml'],
|
||||
component: () => import('./excel-to-data.vue'),
|
||||
icon: TableExport,
|
||||
createdAt: new Date('2024-12-25'),
|
||||
category: 'Converters',
|
||||
});
|
||||
@@ -0,0 +1,58 @@
|
||||
<script setup lang="ts">
|
||||
const zone = ref<string>('public');
|
||||
const action = ref<string>('add');
|
||||
const ruleType = ref<string>('service');
|
||||
const value = ref<string>('http');
|
||||
const permanent = ref<boolean>(true);
|
||||
|
||||
const ruleTypes = [
|
||||
{ label: 'Service', value: 'service' },
|
||||
{ label: 'Port', value: 'port' },
|
||||
{ label: 'Protocol', value: 'protocol' },
|
||||
{ label: 'Rich Rule', value: 'rich-rule' },
|
||||
];
|
||||
|
||||
const actions = [
|
||||
{ label: 'Add', value: 'add' },
|
||||
{ label: 'Remove', value: 'remove' },
|
||||
];
|
||||
|
||||
const command = computed(() => {
|
||||
let result = `firewall-cmd --zone=${zone.value} --${action.value}-${ruleType.value}=${value.value}`;
|
||||
if (permanent.value) {
|
||||
result += ' --permanent';
|
||||
}
|
||||
result += ' && firewall-cmd --reload';
|
||||
return result;
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<NForm label-width="120px" label-placement="left">
|
||||
<NFormItem label="Zone:">
|
||||
<NSelect v-model:value="zone" :options="[{ label: 'Public', value: 'public' }, { label: 'Home', value: 'home' }, { label: 'Work', value: 'work' }]" />
|
||||
</NFormItem>
|
||||
|
||||
<NFormItem label="Action:">
|
||||
<NSelect v-model:value="action" :options="actions" />
|
||||
</NFormItem>
|
||||
|
||||
<NFormItem label="Rule Type:">
|
||||
<NSelect v-model:value="ruleType" :options="ruleTypes" />
|
||||
</NFormItem>
|
||||
|
||||
<NFormItem label="Value:">
|
||||
<NInput v-model:value="value" placeholder="Enter the service/port/protocol" />
|
||||
</NFormItem>
|
||||
|
||||
<NFormItem label="Permanent">
|
||||
<NSelect v-model:value="permanent" :options="[{ label: 'Yes', value: true }, { label: 'No', value: false }]" />
|
||||
</NFormItem>
|
||||
</NForm>
|
||||
|
||||
<c-card title="Generated fw command:" mt-2>
|
||||
<textarea-copyable :value="command" />
|
||||
</c-card>
|
||||
</div>
|
||||
</template>
|
||||
@@ -0,0 +1,13 @@
|
||||
import { Firetruck } from '@vicons/tabler';
|
||||
import { defineTool } from '../tool';
|
||||
|
||||
export const tool = defineTool({
|
||||
name: 'FW command line generator',
|
||||
path: '/firewalld-generator',
|
||||
description: 'Generate fw command lines',
|
||||
keywords: ['firewalld', 'fw'],
|
||||
component: () => import('./firewalld-generator.vue'),
|
||||
icon: Firetruck,
|
||||
createdAt: new Date('2025-04-21'),
|
||||
category: 'Network',
|
||||
});
|
||||
@@ -21,19 +21,25 @@ const inputStructure = ref([
|
||||
'empty dir',
|
||||
].join('\n'));
|
||||
const outputTree = computed(() => withDefaultOnError(() => generateTree(parseInput(inputStructure.value)), ''));
|
||||
|
||||
const MONACO_EDITOR_OPTIONS = {
|
||||
automaticLayout: true,
|
||||
formatOnType: true,
|
||||
formatOnPaste: true,
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<c-input-text
|
||||
v-model:value="inputStructure"
|
||||
label="Your indented structure"
|
||||
placeholder="Paste your indented structure here..."
|
||||
rows="20"
|
||||
multiline
|
||||
raw-text
|
||||
monospace
|
||||
/>
|
||||
<c-card title="Your indented structure" w-full>
|
||||
<c-monaco-editor
|
||||
v-model:value="inputStructure"
|
||||
theme="vs-dark"
|
||||
height="250px"
|
||||
placeholder="Paste your indented structure here..."
|
||||
:options="MONACO_EDITOR_OPTIONS"
|
||||
/>
|
||||
</c-card>
|
||||
|
||||
<n-divider />
|
||||
|
||||
|
||||
@@ -78,7 +78,7 @@ function restart() {
|
||||
|
||||
<div flex justify-center>
|
||||
<c-button @click="restart()">
|
||||
Restart
|
||||
Spin!
|
||||
</c-button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -0,0 +1,149 @@
|
||||
<script setup lang="ts">
|
||||
import { NForm, NFormItem, NInput, NSelect } from 'naive-ui';
|
||||
|
||||
const device = ref('');
|
||||
const mountPoint = ref('');
|
||||
const fsType = ref('auto');
|
||||
const options = ref<string[]>([]);
|
||||
const dump = ref('0');
|
||||
const pass = ref('0');
|
||||
const username = ref('');
|
||||
const password = ref('');
|
||||
|
||||
const fileSystems = [
|
||||
'auto', 'ext2', 'ext3', 'ext4', 'xfs', 'btrfs', 'jfs', 'reiserfs', 'nfs', 'cifs', 'smbfs',
|
||||
'tmpfs', 'devtmpfs', 'overlay', 'aufs', 'iso9660', 'udf', 'vfat', 'ntfs',
|
||||
'swap',
|
||||
];
|
||||
|
||||
const defaultOptions = [
|
||||
{ value: 'defaults', description: 'Standard mount options (rw, suid, dev, exec, auto, nouser, async).' },
|
||||
{ value: 'noatime', description: 'Prevents access time updates for better performance.' },
|
||||
{ value: 'nodiratime', description: 'Prevents directory access time updates.' },
|
||||
{ value: 'relatime', description: 'Updates access time only when modified or accessed after reboot.' },
|
||||
{ value: 'ro', description: 'Mount filesystem as read-only.' },
|
||||
{ value: 'rw', description: 'Mount filesystem as read/write.' },
|
||||
{ value: 'sync', description: 'Writes synchronously for better integrity.' },
|
||||
{ value: 'async', description: 'Writes asynchronously for better performance.' },
|
||||
{ value: 'user', description: 'Allow normal users to mount the filesystem.' },
|
||||
{ value: 'nouser', description: 'Only root can mount.' },
|
||||
{ value: 'exec', description: 'Allows execution of binaries.' },
|
||||
{ value: 'noexec', description: 'Disables execution of binaries (security measure).' },
|
||||
{ value: 'errors=remount-ro', description: 'Remount as read-only upon errors.' },
|
||||
{ value: 'auto', description: 'Mount automatically at boot.' },
|
||||
{ value: 'noauto', description: 'Requires manual mount.' },
|
||||
{ value: 'dev', description: 'Interpret character or block special devices on the file system.' },
|
||||
{ value: 'nodev', description: 'Do not interpret character or block special devices on the file system.' },
|
||||
{ value: 'suid', description: 'Permit the operation of suid, and sgid bits.' },
|
||||
{ value: 'nosuid', description: 'Block the operation of suid, and sgid bits.' },
|
||||
]; ;
|
||||
|
||||
const nfsOptions = [
|
||||
{ value: 'vers=3', description: 'Use NFS protocol version 3.' },
|
||||
{ value: 'soft', description: 'Fail after timeout if server is unreachable.' },
|
||||
{ value: 'hard', description: 'Retry indefinitely if server is unreachable.' },
|
||||
{ value: 'rsize=8192,wsize=8192', description: 'Tunable read/write buffer sizes.' },
|
||||
];
|
||||
|
||||
const cifsOptions = [
|
||||
{ value: 'sec=ntlm', description: 'Use NTLM security protocol.' },
|
||||
];
|
||||
|
||||
const tmpfsOptions = [
|
||||
{ value: 'size=512M', description: 'Define tmpfs size limit.' },
|
||||
{ value: 'mode=1777', description: 'Set permissions on tmpfs mount.' },
|
||||
];
|
||||
|
||||
const filesystemOptions = computed(() => {
|
||||
if (fsType.value === 'nfs') {
|
||||
return [...defaultOptions, ...nfsOptions];
|
||||
}
|
||||
if (fsType.value === 'cifs') {
|
||||
return [...defaultOptions, ...cifsOptions];
|
||||
}
|
||||
if (fsType.value === 'tmpfs') {
|
||||
return [...defaultOptions, ...tmpfsOptions];
|
||||
}
|
||||
return defaultOptions;
|
||||
});
|
||||
|
||||
const fstabLine = computed(
|
||||
() => {
|
||||
if (!device.value || !mountPoint.value) {
|
||||
return '';
|
||||
}
|
||||
const allOptions = [...options.value];
|
||||
if (username.value) {
|
||||
allOptions.push(`user=${username.value}`);
|
||||
}
|
||||
if (password.value) {
|
||||
allOptions.push(`pass=${password.value}`);
|
||||
}
|
||||
if (!allOptions.length) {
|
||||
allOptions.push('defaults');
|
||||
}
|
||||
return `${device.value} ${mountPoint.value} ${fsType.value} ${allOptions.join(',')} ${dump.value} ${pass.value}`;
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<NForm>
|
||||
<NFormItem label="Device:" label-placement="left" label-width="140px">
|
||||
<NInput v-model:value="device" placeholder="/dev/sda1 or UUID=... or server:/path" />
|
||||
</NFormItem>
|
||||
|
||||
<NFormItem label="Mount Point:" label-placement="left" label-width="140px">
|
||||
<NInput v-model:value="mountPoint" placeholder="/mnt/data or /home" />
|
||||
</NFormItem>
|
||||
|
||||
<NFormItem label="Filesystem Type:" label-placement="left" label-width="140px">
|
||||
<NSelect v-model:value="fsType" :options="fileSystems.map(fs => ({ label: fs, value: fs }))" />
|
||||
</NFormItem>
|
||||
|
||||
<NFormItem label="Filesystem options:">
|
||||
<NSelect
|
||||
v-model:value="options" placeholder="By default: Standard mount options (rw, suid, dev, exec, auto, nouser, async)"
|
||||
multiple
|
||||
:options="filesystemOptions.map(o => ({ value: o.value, label: `${o.description} (${o.value})` }))"
|
||||
/>
|
||||
</NFormItem>
|
||||
|
||||
<NFormItem label="Dump (Determines whether the 'dump' utility should back up this filesystem):">
|
||||
<NSelect v-model:value="dump" :options="[{ label: 'Do not include in backups', value: '0' }, { label: 'Include in backups', value: '1' }]" />
|
||||
</NFormItem>
|
||||
|
||||
<NFormItem label="Pass (Controls the order for filesystem checks at boot):">
|
||||
<NSelect
|
||||
v-model:value="pass"
|
||||
:options="[{ label: 'No check', value: '0' }, { label: 'Root filesystem first', value: '1' }, { label: 'Other filesystems after root', value: '2' }]"
|
||||
/>
|
||||
</NFormItem>
|
||||
|
||||
<c-input-text
|
||||
v-model:value="username"
|
||||
placeholder="Username"
|
||||
label="Username:"
|
||||
label-position="left"
|
||||
label-width="140px"
|
||||
label-align="right"
|
||||
raw-text
|
||||
mb-1
|
||||
flex-1
|
||||
/>
|
||||
|
||||
<c-input-text
|
||||
v-model:value="password"
|
||||
placeholder="Password"
|
||||
label="Password:"
|
||||
label-position="left"
|
||||
label-width="140px"
|
||||
label-align="right"
|
||||
raw-text
|
||||
flex-1
|
||||
/>
|
||||
|
||||
<c-card title="Generated /etc/fstab line" mt-5>
|
||||
<textarea-copyable :value="fstabLine" />
|
||||
</c-card>
|
||||
</NForm>
|
||||
</template>
|
||||
@@ -0,0 +1,13 @@
|
||||
import { DeviceFloppy } from '@vicons/tabler';
|
||||
import { defineTool } from '../tool';
|
||||
|
||||
export const tool = defineTool({
|
||||
name: 'FStab Generator',
|
||||
path: '/fstab-generator',
|
||||
description: 'Generate /etc/fstab line',
|
||||
keywords: ['fstab', 'etc'],
|
||||
component: () => import('./fstab-generator.vue'),
|
||||
icon: DeviceFloppy,
|
||||
createdAt: new Date('2025-04-21'),
|
||||
category: 'Network',
|
||||
});
|
||||
@@ -0,0 +1,34 @@
|
||||
# Semantic Commit Messages
|
||||
|
||||
See how a minor change to your commit message style can make you a better programmer.
|
||||
|
||||
Format: `<type>(<scope>): <subject>`
|
||||
|
||||
`<scope>` is optional
|
||||
|
||||
## Example
|
||||
|
||||
```
|
||||
feat: add hat wobble
|
||||
^--^ ^------------^
|
||||
| |
|
||||
| +-> Summary in present tense.
|
||||
|
|
||||
+-------> Type: chore, docs, feat, fix, refactor, style, or test.
|
||||
```
|
||||
|
||||
More Examples:
|
||||
|
||||
- `feat`: (new feature for the user, not a new feature for build script)
|
||||
- `fix`: (bug fix for the user, not a fix to a build script)
|
||||
- `docs`: (changes to the documentation)
|
||||
- `style`: (formatting, missing semi colons, etc; no production code change)
|
||||
- `refactor`: (refactoring production code, eg. renaming a variable)
|
||||
- `test`: (adding missing tests, refactoring tests; no production code change)
|
||||
- `chore`: (updating grunt tasks etc; no production code change)
|
||||
|
||||
References:
|
||||
|
||||
- https://www.conventionalcommits.org/
|
||||
- https://seesparkbox.com/foundry/semantic_commit_messages
|
||||
- http://karma-runner.github.io/1.0/dev/git-commit-msg.html
|
||||
@@ -0,0 +1,22 @@
|
||||
<script setup lang="ts">
|
||||
import { useThemeVars } from 'naive-ui';
|
||||
import Memo from './git-sem.memo.md';
|
||||
|
||||
const themeVars = useThemeVars();
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<Memo />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style lang="less" scoped>
|
||||
::v-deep(pre) {
|
||||
margin: 0;
|
||||
padding: 15px 22px;
|
||||
background-color: v-bind('themeVars.cardColor');
|
||||
border-radius: 4px;
|
||||
overflow: auto;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,13 @@
|
||||
import { GitCommit } from '@vicons/tabler';
|
||||
import { defineTool } from '../tool';
|
||||
|
||||
export const tool = defineTool({
|
||||
name: 'Git Semantic Commit Cheatsheet',
|
||||
path: '/git-semantic-commit-memo',
|
||||
description: 'Cheatsheet for committing using semantic prefixes',
|
||||
keywords: ['git', 'semantic', 'commit', 'cheatsheet'],
|
||||
component: () => import('./git-semantic-commit-memo.vue'),
|
||||
icon: GitCommit,
|
||||
createdAt: new Date('2025-05-01'),
|
||||
category: 'Cheatsheets',
|
||||
});
|
||||
@@ -32,6 +32,12 @@ const claimedUnit = ref('tb');
|
||||
label="Unit:"
|
||||
:options="dec_units"
|
||||
/>
|
||||
<n-p>
|
||||
1MiB = 1024KiB ; 1MB = 1000kB ; 1GiB = 1024MiB ; 1GB = 1000MB ;
|
||||
<n-a href="https://en.wikipedia.org/wiki/Byte" target="_blank" rel="noopener">
|
||||
see here for details
|
||||
</n-a>
|
||||
</n-p>
|
||||
|
||||
<n-divider />
|
||||
|
||||
|
||||
@@ -0,0 +1,272 @@
|
||||
<script setup lang="ts">
|
||||
const formData = ref({
|
||||
domainName: '',
|
||||
redirects: [] as { key: string; value: string }[],
|
||||
cacheExtensions: '',
|
||||
cacheDuration: 60,
|
||||
cacheDurationMultiple: '60',
|
||||
cacheType: 'public',
|
||||
mustRevalidate: false,
|
||||
protectedFile: '',
|
||||
htpasswdPath: '',
|
||||
referrer: '',
|
||||
hotlinkExtensions: '',
|
||||
nohotlinkImageHref: '',
|
||||
errorPages: [] as { key: string; value: string }[],
|
||||
ipRules: [] as { key: string; value: string }[],
|
||||
blockBots: false,
|
||||
defaultPage: '',
|
||||
preventDirectoryListing: false,
|
||||
preventViewingHtaccess: true,
|
||||
});
|
||||
|
||||
const htaccessContent = computed(() => {
|
||||
let content = '';
|
||||
|
||||
if (formData.value.domainName) {
|
||||
content += `Options +FollowSymLinks\nRewriteEngine On\nRewriteCond %{HTTP_HOST} ^${formData.value.domainName}[nc]\nRewriteRule ^(.*)$ https://www.${formData.value.domainName}/$1 [R=301,nc]\n\n`;
|
||||
}
|
||||
|
||||
formData.value.redirects.forEach(({ key, value }) => {
|
||||
if (!key || !value) {
|
||||
return;
|
||||
}
|
||||
content += `Redirect 301 ${key} ${value}\n`;
|
||||
});
|
||||
|
||||
if (formData.value.cacheExtensions) {
|
||||
content += `<FilesMatch "\\.(${formData.value.cacheExtensions.split(',').join('|')})$">\nHeader set Cache-Control "${formData.value.cacheType}${(formData.value.mustRevalidate ? ', proxy-revalidate' : '')}, max-age=${formData.value.cacheDuration * Number(formData.value.cacheDurationMultiple)}"\n</FilesMatch>\n\n`;
|
||||
}
|
||||
|
||||
if (formData.value.protectedFile && formData.value.htpasswdPath) {
|
||||
content += `<Files "${formData.value.protectedFile}">\nAuthType Basic\nAuthName "Restricted"\nAuthUserFile ${formData.value.htpasswdPath}\nRequire valid-user\n</Files>\n\n`;
|
||||
}
|
||||
|
||||
if (formData.value.referrer && formData.value.hotlinkExtensions) {
|
||||
content += `RewriteCond %{HTTP_REFERER} !^$\nRewriteCond %{HTTP_REFERER} !^https?://(www\.)?${formData.value.referrer}/.*$ [NC]\nRewriteRule \\.(${formData.value.hotlinkExtensions.split(',').join('|')})$ ${formData.value.nohotlinkImageHref}[R=302,L]\n\n`;
|
||||
}
|
||||
|
||||
formData.value.errorPages.forEach(({ key, value }) => {
|
||||
if (!key || !value) {
|
||||
return;
|
||||
}
|
||||
content += `ErrorDocument ${key} ${value}\n`;
|
||||
});
|
||||
|
||||
formData.value.ipRules.forEach(({ key, value }) => {
|
||||
if (!key || !value) {
|
||||
return;
|
||||
}
|
||||
content += `${key === 'Block' ? 'Deny' : 'Allow'} from ${value}\n`;
|
||||
});
|
||||
|
||||
if (formData.value.blockBots) {
|
||||
content += `//Block bad bots
|
||||
RewriteEngine On
|
||||
RewriteCond %{HTTP_USER_AGENT} ^BlackWidow [OR]
|
||||
RewriteCond %{HTTP_USER_AGENT} ^Bot\\ mailto:craftbot@yahoo.com [OR]
|
||||
RewriteCond %{HTTP_USER_AGENT} ^ChinaClaw [OR]
|
||||
RewriteCond %{HTTP_USER_AGENT} ^Custo [OR]
|
||||
RewriteCond %{HTTP_USER_AGENT} ^DISCo [OR]
|
||||
RewriteCond %{HTTP_USER_AGENT} ^Download\\ Demon [OR]
|
||||
RewriteCond %{HTTP_USER_AGENT} ^eCatch [OR]
|
||||
RewriteCond %{HTTP_USER_AGENT} ^EirGrabber [OR]
|
||||
RewriteCond %{HTTP_USER_AGENT} ^EmailSiphon [OR]
|
||||
RewriteCond %{HTTP_USER_AGENT} ^EmailWolf [OR]
|
||||
RewriteCond %{HTTP_USER_AGENT} ^Express\\ WebPictures [OR]
|
||||
RewriteCond %{HTTP_USER_AGENT} ^ExtractorPro [OR]
|
||||
RewriteCond %{HTTP_USER_AGENT} ^EyeNetIE [OR]
|
||||
RewriteCond %{HTTP_USER_AGENT} ^FlashGet [OR]
|
||||
RewriteCond %{HTTP_USER_AGENT} ^GetRight [OR]
|
||||
RewriteCond %{HTTP_USER_AGENT} ^GetWeb! [OR]
|
||||
RewriteCond %{HTTP_USER_AGENT} ^Go!Zilla [OR]
|
||||
RewriteCond %{HTTP_USER_AGENT} ^Go-Ahead-Got-It [OR]
|
||||
RewriteCond %{HTTP_USER_AGENT} ^GrabNet [OR]
|
||||
RewriteCond %{HTTP_USER_AGENT} ^Grafula [OR]
|
||||
RewriteCond %{HTTP_USER_AGENT} ^HMView [OR]
|
||||
RewriteCond %{HTTP_USER_AGENT} HTTrack [NC,OR]
|
||||
RewriteCond %{HTTP_USER_AGENT} ^Image\\ Stripper [OR]
|
||||
RewriteCond %{HTTP_USER_AGENT} ^Image\\ Sucker [OR]
|
||||
RewriteCond %{HTTP_USER_AGENT} Indy\\ Library [NC,OR]
|
||||
RewriteCond %{HTTP_USER_AGENT} ^InterGET [OR]
|
||||
RewriteCond %{HTTP_USER_AGENT} ^Internet\\ Ninja [OR]
|
||||
RewriteCond %{HTTP_USER_AGENT} ^JetCar [OR]
|
||||
RewriteCond %{HTTP_USER_AGENT} ^JOC\\ Web\\ Spider [OR]
|
||||
RewriteCond %{HTTP_USER_AGENT} ^larbin [OR]
|
||||
RewriteCond %{HTTP_USER_AGENT} ^LeechFTP [OR]
|
||||
RewriteCond %{HTTP_USER_AGENT} ^Mass\\ Downloader [OR]
|
||||
RewriteCond %{HTTP_USER_AGENT} ^MIDown\\ tool [OR]
|
||||
RewriteCond %{HTTP_USER_AGENT} ^Mister\\ PiX [OR]
|
||||
RewriteCond %{HTTP_USER_AGENT} ^Navroad [OR]
|
||||
RewriteCond %{HTTP_USER_AGENT} ^NearSite [OR]
|
||||
RewriteCond %{HTTP_USER_AGENT} ^NetAnts [OR]
|
||||
RewriteCond %{HTTP_USER_AGENT} ^NetSpider [OR]
|
||||
RewriteCond %{HTTP_USER_AGENT} ^Net\\ Vampire [OR]
|
||||
RewriteCond %{HTTP_USER_AGENT} ^NetZIP [OR]
|
||||
RewriteCond %{HTTP_USER_AGENT} ^Octopus [OR]
|
||||
RewriteCond %{HTTP_USER_AGENT} ^Offline\\ Explorer [OR]
|
||||
RewriteCond %{HTTP_USER_AGENT} ^Offline\\ Navigator [OR]
|
||||
RewriteCond %{HTTP_USER_AGENT} ^PageGrabber [OR]
|
||||
RewriteCond %{HTTP_USER_AGENT} ^Papa\\ Foto [OR]
|
||||
RewriteCond %{HTTP_USER_AGENT} ^pavuk [OR]
|
||||
RewriteCond %{HTTP_USER_AGENT} ^pcBrowser [OR]
|
||||
RewriteCond %{HTTP_USER_AGENT} ^RealDownload [OR]
|
||||
RewriteCond %{HTTP_USER_AGENT} ^ReGet [OR]
|
||||
RewriteCond %{HTTP_USER_AGENT} ^SiteSnagger [OR]
|
||||
RewriteCond %{HTTP_USER_AGENT} ^SmartDownload [OR]
|
||||
RewriteCond %{HTTP_USER_AGENT} ^SuperBot [OR]
|
||||
RewriteCond %{HTTP_USER_AGENT} ^SuperHTTP [OR]
|
||||
RewriteCond %{HTTP_USER_AGENT} ^Surfbot [OR]
|
||||
RewriteCond %{HTTP_USER_AGENT} ^tAkeOut [OR]
|
||||
RewriteCond %{HTTP_USER_AGENT} ^Teleport\\ Pro [OR]
|
||||
RewriteCond %{HTTP_USER_AGENT} ^VoidEYE [OR]
|
||||
RewriteCond %{HTTP_USER_AGENT} ^Web\\ Image\\ Collector [OR]
|
||||
RewriteCond %{HTTP_USER_AGENT} ^Web\\ Sucker [OR]
|
||||
RewriteCond %{HTTP_USER_AGENT} ^WebAuto [OR]
|
||||
RewriteCond %{HTTP_USER_AGENT} ^WebCopier [OR]
|
||||
RewriteCond %{HTTP_USER_AGENT} ^WebFetch [OR]
|
||||
RewriteCond %{HTTP_USER_AGENT} ^WebGo\\ IS [OR]
|
||||
RewriteCond %{HTTP_USER_AGENT} ^WebLeacher [OR]
|
||||
RewriteCond %{HTTP_USER_AGENT} ^WebReaper [OR]
|
||||
RewriteCond %{HTTP_USER_AGENT} ^WebSauger [OR]
|
||||
RewriteCond %{HTTP_USER_AGENT} ^Website\\ eXtractor [OR]
|
||||
RewriteCond %{HTTP_USER_AGENT} ^Website\\ Quester [OR]
|
||||
RewriteCond %{HTTP_USER_AGENT} ^WebStripper [OR]
|
||||
RewriteCond %{HTTP_USER_AGENT} ^WebWhacker [OR]
|
||||
RewriteCond %{HTTP_USER_AGENT} ^WebZIP [OR]
|
||||
RewriteCond %{HTTP_USER_AGENT} ^Wget [OR]
|
||||
RewriteCond %{HTTP_USER_AGENT} ^Widow [OR]
|
||||
RewriteCond %{HTTP_USER_AGENT} ^WWWOFFLE [OR]
|
||||
RewriteCond %{HTTP_USER_AGENT} ^Xaldon\\ WebSpider [OR]
|
||||
RewriteCond %{HTTP_USER_AGENT} ^Zeus
|
||||
RewriteRule ^.* - [F,L]\n\n`;
|
||||
}
|
||||
|
||||
if (formData.value.defaultPage) {
|
||||
content += `DirectoryIndex ${formData.value.defaultPage}\n\n`;
|
||||
}
|
||||
|
||||
if (formData.value.preventDirectoryListing) {
|
||||
content += 'Options All -Indexes\n\n';
|
||||
}
|
||||
|
||||
if (formData.value.preventViewingHtaccess) {
|
||||
content += `<Files .htaccess>
|
||||
order allow,deny
|
||||
deny from all
|
||||
</Files>\n\n`;
|
||||
}
|
||||
|
||||
return content;
|
||||
});
|
||||
|
||||
function onCreateIpRule() {
|
||||
return {
|
||||
key: 'Allow',
|
||||
value: '',
|
||||
};
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<NCard title="HTAccess Generator">
|
||||
<NForm :model="formData" label-placement="left">
|
||||
<c-card title="Rewrite to www" mb-1>
|
||||
<NFormItem label="Domain Name">
|
||||
<NInput v-model:value="formData.domainName" placeholder="example.com" />
|
||||
</NFormItem>
|
||||
</c-card>
|
||||
|
||||
<c-card title="301 Redirect File or Directory" mb-1>
|
||||
<NDynamicInput v-model:value="formData.redirects" preset="pair" key-placeholder="Old Path" value-placeholder="New Path" />
|
||||
</c-card>
|
||||
|
||||
<c-card title="Cache Settings" mb-1>
|
||||
<NFormItem label="Cache Extensions:">
|
||||
<NInput v-model:value="formData.cacheExtensions" placeholder="js, css, png" />
|
||||
</NFormItem>
|
||||
<NFormItem label="Cache Duration">
|
||||
<NInputNumber v-model:value="formData.cacheDuration" mr-1 />
|
||||
<NSelect
|
||||
v-model:value="formData.cacheDurationMultiple"
|
||||
:options="[{ label: 'Seconds', value: '1' }, { label: 'Minutes', value: '60' }, { label: 'Hours', value: '3600' }, { label: 'Days', value: '86400' }, { label: 'Weeks', value: '36288000' }, { label: 'Months', value: '160704000' }]"
|
||||
/>
|
||||
</NFormItem>
|
||||
<NFormItem label="Cache Type:">
|
||||
<NSelect v-model:value="formData.cacheType" :options="[{ label: 'Public', value: 'public' }, { label: 'Private', value: 'private' }]" />
|
||||
</NFormItem>
|
||||
<NFormItem label="Must Revalidate">
|
||||
<NSwitch v-model:value="formData.mustRevalidate" />
|
||||
</NFormItem>
|
||||
</c-card>
|
||||
|
||||
<c-card title="Password Protection" mb-1>
|
||||
<NFormItem label="Path to protect:">
|
||||
<NInput v-model:value="formData.protectedFile" label-position="left" placeholder="Path to protect" />
|
||||
</NFormItem>
|
||||
<NFormItem label=".htpasswd file path:">
|
||||
<NInput v-model:value="formData.htpasswdPath" label-position="left" placeholder=".htpasswd file path" />
|
||||
</NFormItem>
|
||||
</c-card>
|
||||
|
||||
<c-card title="Prevent Hotlinking" mb-1>
|
||||
<NFormItem label="Referring URL:">
|
||||
<NInput v-model:value="formData.referrer" placeholder="The domain that is hotlinking to you." />
|
||||
</NFormItem>
|
||||
<NFormItem label="File Extension:">
|
||||
<NInput v-model:value="formData.hotlinkExtensions" placeholder="Extensions" />
|
||||
</NFormItem>
|
||||
<NFormItem label="No hotlinking Image:">
|
||||
<NInput v-model:value="formData.nohotlinkImageHref" placeholder="Href" />
|
||||
</NFormItem>
|
||||
</c-card>
|
||||
|
||||
<c-card title="Custom Error Pages" mb-1>
|
||||
<NDynamicInput v-model:value="formData.errorPages" preset="pair" key-placeholder="Error Code" value-placeholder="File Path" />
|
||||
</c-card>
|
||||
|
||||
<c-card title="Block or Allow IP addresses" mb-1>
|
||||
<NDynamicInput v-model:value="formData.ipRules" preset="pair" :on-create="onCreateIpRule">
|
||||
<template #default="{ value }">
|
||||
<div style="display: flex; align-items: center; width: 100%">
|
||||
<n-select
|
||||
v-model:value="value.key"
|
||||
:options="[{ label: 'Allow', value: 'Allow' }, { label: 'Block', value: 'Block' }]"
|
||||
placeholder="Select authorization"
|
||||
style="width: 150px"
|
||||
mr-2
|
||||
/>
|
||||
<n-input
|
||||
v-model:value="value.value"
|
||||
placeholder="IP Address"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
</NDynamicInput>
|
||||
</c-card>
|
||||
|
||||
<c-card title="Directory Settings">
|
||||
<NFormItem label="Default Directory Page:">
|
||||
<NInput v-model:value="formData.defaultPage" placeholder="Default Directory Page" />
|
||||
</NFormItem>
|
||||
<NFormItem label="Prevent Directory Listing">
|
||||
<NSwitch v-model:value="formData.preventDirectoryListing" />
|
||||
</NFormItem>
|
||||
</c-card>
|
||||
|
||||
<c-card title="Other Settings">
|
||||
<NFormItem label="Block Bots">
|
||||
<NSwitch v-model:value="formData.blockBots" />
|
||||
</NFormItem>
|
||||
|
||||
<NFormItem label="Prevent viewing of .htaccess file">
|
||||
<NSwitch v-model:value="formData.preventViewingHtaccess" />
|
||||
</NFormItem>
|
||||
</c-card>
|
||||
</NForm>
|
||||
|
||||
<c-card title="Generated .htaccess file" mt-2>
|
||||
<textarea-copyable :value="htaccessContent" />
|
||||
</c-card>
|
||||
</NCard>
|
||||
</template>
|
||||
@@ -0,0 +1,13 @@
|
||||
import { ShieldLock } from '@vicons/tabler';
|
||||
import { defineTool } from '../tool';
|
||||
|
||||
export const tool = defineTool({
|
||||
name: 'HTAccess generator',
|
||||
path: '/htaccess-generator',
|
||||
description: 'Generate .htaccess file',
|
||||
keywords: ['htaccess'],
|
||||
component: () => import('./htaccess-generator.vue'),
|
||||
icon: ShieldLock,
|
||||
createdAt: new Date('2025-04-21'),
|
||||
category: 'Network',
|
||||
});
|
||||
@@ -1,7 +1,7 @@
|
||||
<script setup lang="ts">
|
||||
import { ImageToAsciiArt } from 'image-to-ascii-art';
|
||||
import TextareaCopyable from '@/components/TextareaCopyable.vue';
|
||||
import { languages, translateToLanguage } from '@/utils/ascii-lang-utils';
|
||||
import { languages, printToLanguage } from '@/utils/ascii-lang-utils';
|
||||
|
||||
const inputBase64 = ref('');
|
||||
const language = useStorage('image-to-ascii-art:language', 'raw');
|
||||
@@ -39,7 +39,7 @@ const output = computedAsync(async () => {
|
||||
drawHeight: scaleValue * 0.4,
|
||||
},
|
||||
});
|
||||
outputValue = translateToLanguage(await imageToAsciiArt.convert(inputBase64Value), languageValue);
|
||||
outputValue = printToLanguage(await imageToAsciiArt.convert(inputBase64Value), languageValue);
|
||||
imageToAsciiArt.destroy();
|
||||
}
|
||||
catch (e) {
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
import { Firetruck } from '@vicons/tabler';
|
||||
import { defineTool } from '../tool';
|
||||
|
||||
export const tool = defineTool({
|
||||
name: 'Iptables Generator',
|
||||
path: '/iptables-generator',
|
||||
description: 'Generate iptables command lines',
|
||||
keywords: ['iptables', 'firewall'],
|
||||
component: () => import('./iptables-generator.vue'),
|
||||
icon: Firetruck,
|
||||
createdAt: new Date('2025-04-21'),
|
||||
category: 'Network',
|
||||
});
|
||||
@@ -0,0 +1,135 @@
|
||||
<script setup lang="ts">
|
||||
const actionOptions = [
|
||||
{ label: 'ACCEPT', value: 'ACCEPT' },
|
||||
{ label: 'DROP', value: 'DROP' },
|
||||
{ label: 'REJECT', value: 'REJECT' },
|
||||
];
|
||||
|
||||
const protocolOptions = [
|
||||
{ label: 'TCP', value: 'tcp' },
|
||||
{ label: 'UDP', value: 'udp' },
|
||||
{ label: 'ICMP', value: 'icmp' },
|
||||
{ label: 'IP', value: 'ip' },
|
||||
];
|
||||
|
||||
const chainOptions = [
|
||||
{ label: 'INPUT', value: 'INPUT' },
|
||||
{ label: 'OUTPUT', value: 'OUTPUT' },
|
||||
{ label: 'FORWARD', value: 'FORWARD' },
|
||||
{ label: 'PREROUTING', value: 'PREROUTING' },
|
||||
];
|
||||
|
||||
const action = ref('ACCEPT');
|
||||
const protocol = ref('tcp');
|
||||
const sourceIP = ref('');
|
||||
const destinationIP = ref('');
|
||||
const sourcePort = ref<number | null>(null);
|
||||
const destinationPort = ref<number | null>(null);
|
||||
const ruleOrder = ref<number | null>(null);
|
||||
const chain = ref('INPUT');
|
||||
const command = computed(() => {
|
||||
let cmd = `iptables -A ${chain.value}`;
|
||||
if (ruleOrder.value) {
|
||||
cmd += ` ${ruleOrder.value}`;
|
||||
}
|
||||
if (protocol.value) {
|
||||
cmd += ` -p ${protocol.value}`;
|
||||
}
|
||||
if (sourceIP.value) {
|
||||
cmd += ` -s ${sourceIP.value}`;
|
||||
}
|
||||
if (destinationIP.value) {
|
||||
cmd += ` -d ${destinationIP.value}`;
|
||||
}
|
||||
if (sourcePort.value !== null) {
|
||||
cmd += ` --sport ${sourcePort.value}`;
|
||||
}
|
||||
if (destinationPort.value !== null) {
|
||||
cmd += ` --dport ${destinationPort.value}`;
|
||||
}
|
||||
cmd += ` -j ${action.value}`;
|
||||
return cmd;
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<NForm label-placement="left" label-width="140px">
|
||||
<NFormItem label="Action:">
|
||||
<NSelect v-model:value="action" :options="actionOptions" />
|
||||
</NFormItem>
|
||||
<NFormItem label="Protocol:">
|
||||
<NSelect v-model:value="protocol" :options="protocolOptions" />
|
||||
</NFormItem>
|
||||
<NFormItem label="Source IP:">
|
||||
<NInput v-model:value="sourceIP" />
|
||||
</NFormItem>
|
||||
<NFormItem label="Destination IP:">
|
||||
<NInput v-model:value="destinationIP" />
|
||||
</NFormItem>
|
||||
<NFormItem label="Source Port:">
|
||||
<NInputNumber v-model:value="sourcePort" />
|
||||
</NFormItem>
|
||||
<NFormItem label="Destination Port:">
|
||||
<NInputNumber v-model:value="destinationPort" />
|
||||
</NFormItem>
|
||||
<NFormItem label="Chain:">
|
||||
<NSelect v-model:value="chain" :options="chainOptions" />
|
||||
</NFormItem>
|
||||
<NFormItem label="Rule Order:">
|
||||
<NInputNumber v-model:value="ruleOrder" />
|
||||
</NFormItem>
|
||||
</NForm>
|
||||
|
||||
<c-card title="Generated iptables command">
|
||||
<textarea-copyable :value="command" />
|
||||
</c-card>
|
||||
|
||||
<n-divider />
|
||||
|
||||
<table border="1" class="w-full border-collapse text-left text-sm text-gray-500 dark:text-gray-400">
|
||||
<thead>
|
||||
<tr>
|
||||
<td><strong>Expression</strong></td>
|
||||
<td><strong>Meaning</strong></td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>iptables -L</td>
|
||||
<td>List all rules in the selected chain</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>iptables -t nat -n -L</td>
|
||||
<td>List all NAT rules</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>iptables -L -n --line-numbers</td>
|
||||
<td>List all rules including their line number</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>iptables -F</td>
|
||||
<td>Delete existing rules</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>iptables -D INPUT 2</td>
|
||||
<td>Delete the second rule in the INPUT chain</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>iptables -t nat -D PREROUTING 2</td>
|
||||
<td>Delete the second rule in the NAT table</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>iptables -A INPUT -s "<ip address>" -j DROP</td>
|
||||
<td>Block a specific IP address</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>iptables -A INPUT -p tcp --dport 80 -m limit --limit 25/minute --limit-burst 100 -j ACCEPT</td>
|
||||
<td>Limit connections to 25 per minute on port 80, after 100 connections have been reached</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>iptables -N MYCHAIN</td>
|
||||
<td>Create a new chain called "MYCHAIN"</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</template>
|
||||
@@ -6,7 +6,7 @@ export const tool = defineTool({
|
||||
name: translate('tools.javascript-to-json.title'),
|
||||
path: '/javascript-to-json',
|
||||
description: translate('tools.javascript-to-json.description'),
|
||||
keywords: ['javascript', 'to', 'json'],
|
||||
keywords: ['javascript', 'json'],
|
||||
component: () => import('./javascript-to-json.vue'),
|
||||
icon: Braces,
|
||||
createdAt: new Date('2024-03-29'),
|
||||
|
||||
@@ -4,12 +4,21 @@ import type { UseValidationRule } from '@/composable/validation';
|
||||
import { isNotThrowing } from '@/utils/boolean';
|
||||
import { withDefaultOnError } from '@/utils/defaults';
|
||||
|
||||
function parseJSON(value: string) {
|
||||
try {
|
||||
return JSON5.parse(value);
|
||||
}
|
||||
catch {
|
||||
return JSON5.parse(value.replace(/`((?:[^`]|\\`)*)`/g, (_m, s) => `"${s.replace(/"/g, '\\""').replace(/\r/g, '\\r').replace(/\n/g, '\\n')}"`));
|
||||
}
|
||||
}
|
||||
|
||||
const indentSize = useStorage('json-prettify:indent-size', 3);
|
||||
const transformer = (value: string) => withDefaultOnError(() => JSON.stringify(JSON5.parse(value), null, indentSize.value), '');
|
||||
const transformer = (value: string) => withDefaultOnError(() => JSON.stringify(parseJSON(value), null, indentSize.value), '');
|
||||
|
||||
const rules: UseValidationRule<string>[] = [
|
||||
{
|
||||
validator: (value: string) => value === '' || isNotThrowing(() => JSON.stringify(JSON5.parse(value))),
|
||||
validator: (value: string) => value === '' || isNotThrowing(() => JSON.stringify(parseJSON(value))),
|
||||
message: 'Provided JS Object is not valid.',
|
||||
},
|
||||
];
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
import { describe, expect, it } from 'vitest';
|
||||
import { jsonToGo } from './json-to-go.service';
|
||||
import testCases from './json-to-go.test.data.json';
|
||||
|
||||
describe('json-to-go', () => {
|
||||
describe('jsonToGo', () => {
|
||||
for (const includeExampleData of [true, false]) {
|
||||
it(`must return correct results (includeExampleData = ${includeExampleData})`, () => {
|
||||
for (const testCase of testCases) {
|
||||
const got = jsonToGo(testCase.input, '', false, includeExampleData);
|
||||
const expected = includeExampleData
|
||||
? testCase.expectedWithExample
|
||||
: testCase.expected;
|
||||
|
||||
expect(got.go).to.equal(expected);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
@@ -1,430 +0,0 @@
|
||||
// JSON-to-Go
|
||||
// by Matt Holt
|
||||
// https://github.com/mholt/json-to-go
|
||||
// A simple utility to translate JSON into a Go type definition.
|
||||
export function jsonToGo(json: string, typename: string | '', flatten = true, example = false, allOmitempty = false) {
|
||||
let data;
|
||||
let scope;
|
||||
let go = '';
|
||||
let tabs = 0;
|
||||
const seen: { [key: string]: any } = {};
|
||||
const stack: any[] = [];
|
||||
let accumulator = '';
|
||||
const innerTabs = 0;
|
||||
let parent = '';
|
||||
|
||||
try {
|
||||
data = JSON.parse(json.replace(/(:\s*\[?\s*-?\d*)\.0/g, '$1.1')); // NOSONAR : hack that forces floats to stay as floats
|
||||
scope = data;
|
||||
}
|
||||
catch (e) {
|
||||
return {
|
||||
go: '',
|
||||
};
|
||||
}
|
||||
|
||||
typename = format(typename || 'AutoGenerated');
|
||||
append(`type ${typename} `);
|
||||
|
||||
parseScope(scope);
|
||||
|
||||
return {
|
||||
go: flatten
|
||||
? go += accumulator
|
||||
: go,
|
||||
};
|
||||
|
||||
function parseScope(scope: string | any[] | null, depth = 0) {
|
||||
if (typeof scope === 'object' && scope !== null) {
|
||||
if (Array.isArray(scope)) {
|
||||
let sliceType;
|
||||
const scopeLength = scope.length;
|
||||
|
||||
for (let i = 0; i < scopeLength; i++) {
|
||||
const thisType = goType(scope[i]);
|
||||
if (!sliceType) {
|
||||
sliceType = thisType;
|
||||
}
|
||||
else if (sliceType !== thisType) {
|
||||
sliceType = mostSpecificPossibleGoType(thisType, sliceType);
|
||||
if (sliceType === 'any') {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const slice = flatten && ['struct', 'slice'].includes(sliceType ?? '[]')
|
||||
? `[]${parent}`
|
||||
: '[]';
|
||||
|
||||
if (flatten && depth >= 2) {
|
||||
appender(slice);
|
||||
}
|
||||
else { append(slice); };
|
||||
if (sliceType === 'struct') {
|
||||
const allFields = {} as Record<string, { value: string; count: number }>;
|
||||
|
||||
// for each field counts how many times appears
|
||||
for (let i = 0; i < scopeLength; i++) {
|
||||
const keys = Object.keys(scope[i]);
|
||||
for (const k in keys) {
|
||||
let keyname = keys[k];
|
||||
if (!(keyname in allFields)) {
|
||||
allFields[keyname] = {
|
||||
value: scope[i][keyname],
|
||||
count: 0,
|
||||
};
|
||||
}
|
||||
else {
|
||||
const existingValue = allFields[keyname].value;
|
||||
const currentValue = scope[i][keyname];
|
||||
|
||||
if (compareObjects(existingValue, currentValue)) {
|
||||
const comparisonResult = compareObjectKeys(
|
||||
Object.keys(currentValue),
|
||||
Object.keys(existingValue),
|
||||
);
|
||||
if (!comparisonResult) {
|
||||
keyname = `${keyname}_${uuidv4()}`;
|
||||
allFields[keyname] = {
|
||||
value: currentValue,
|
||||
count: 0,
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
allFields[keyname].count++;
|
||||
}
|
||||
}
|
||||
|
||||
// create a common struct with all fields found in the current array
|
||||
// omitempty dict indicates if a field is optional
|
||||
const keys = Object.keys(allFields);
|
||||
const struct = {} as Record<string, string>;
|
||||
const omitempty = {} as Record<string, boolean>;
|
||||
for (const k in keys) {
|
||||
const keyname = keys[k];
|
||||
const elem = allFields[keyname];
|
||||
|
||||
struct[keyname] = elem.value;
|
||||
omitempty[keyname] = elem.count !== scopeLength;
|
||||
}
|
||||
parseStruct(depth + 1, innerTabs, struct, omitempty); // finally parse the struct !!
|
||||
}
|
||||
else if (sliceType === 'slice') {
|
||||
parseScope(scope[0], depth);
|
||||
}
|
||||
else {
|
||||
if (flatten && depth >= 2) {
|
||||
appender(sliceType || 'any');
|
||||
}
|
||||
else {
|
||||
append(sliceType || 'any');
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (flatten) {
|
||||
if (depth >= 2) {
|
||||
appender(parent);
|
||||
}
|
||||
else {
|
||||
append(parent);
|
||||
}
|
||||
}
|
||||
parseStruct(depth + 1, innerTabs, scope, undefined);
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (flatten && depth >= 2) {
|
||||
appender(goType(scope));
|
||||
}
|
||||
else {
|
||||
append(goType(scope));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function parseStruct(depth: number | undefined, innerTabs: number, scope: { [x: string]: any }, omitempty: { [x: string]: boolean } | undefined) {
|
||||
if (flatten) {
|
||||
if (depth !== undefined) {
|
||||
stack.push(
|
||||
depth >= 2
|
||||
? '\n'
|
||||
: '',
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
const seenTypeNames = [];
|
||||
|
||||
if (flatten && depth !== undefined && depth >= 2) {
|
||||
const parentType = `type ${parent}`;
|
||||
const scopeKeys = formatScopeKeys(Object.keys(scope));
|
||||
|
||||
// this can only handle two duplicate items
|
||||
// future improvement will handle the case where there could
|
||||
// three or more duplicate keys with different values
|
||||
if (parent in seen && compareObjectKeys(scopeKeys, seen[parent])) {
|
||||
stack.pop();
|
||||
return;
|
||||
}
|
||||
seen[parent] = scopeKeys;
|
||||
|
||||
appender(`${parentType} struct {\n`);
|
||||
++innerTabs;
|
||||
const keys = Object.keys(scope);
|
||||
for (const i in keys) {
|
||||
const keyname = getOriginalName(keys[i]);
|
||||
indenter(innerTabs);
|
||||
const typename = uniqueTypeName(format(keyname), seenTypeNames);
|
||||
seenTypeNames.push(typename);
|
||||
|
||||
appender(`${typename} `);
|
||||
parent = typename;
|
||||
parseScope(scope[keys[i]], depth);
|
||||
appender(` \`json:"${keyname}`);
|
||||
if (allOmitempty || (omitempty && omitempty[keys[i]] === true)) {
|
||||
appender(',omitempty');
|
||||
}
|
||||
appender('"`\n');
|
||||
}
|
||||
indenter(--innerTabs);
|
||||
appender('}');
|
||||
}
|
||||
else {
|
||||
append('struct {\n');
|
||||
++tabs;
|
||||
const keys = Object.keys(scope);
|
||||
for (const i in keys) {
|
||||
const keyname = getOriginalName(keys[i]);
|
||||
indent(tabs);
|
||||
const typename = uniqueTypeName(format(keyname), seenTypeNames);
|
||||
seenTypeNames.push(typename);
|
||||
append(`${typename} `);
|
||||
parent = typename;
|
||||
parseScope(scope[keys[i]], depth);
|
||||
append(` \`json:"${keyname}`);
|
||||
if (allOmitempty || (omitempty && omitempty[keys[i]] === true)) {
|
||||
append(',omitempty');
|
||||
}
|
||||
if (example && scope[keys[i]] !== '' && typeof scope[keys[i]] !== 'object') {
|
||||
append(`" example:"${scope[keys[i]]}`);
|
||||
}
|
||||
append('"`\n');
|
||||
}
|
||||
indent(--tabs);
|
||||
append('}');
|
||||
}
|
||||
if (flatten) {
|
||||
accumulator += stack.pop();
|
||||
}
|
||||
}
|
||||
|
||||
function indent(tabs: number) {
|
||||
for (let i = 0; i < tabs; i++) {
|
||||
go += '\t';
|
||||
}
|
||||
}
|
||||
|
||||
function append(str: string) {
|
||||
go += str;
|
||||
}
|
||||
|
||||
function indenter(tabs: number) {
|
||||
for (let i = 0; i < tabs; i++) {
|
||||
stack[stack.length - 1] += '\t';
|
||||
}
|
||||
}
|
||||
|
||||
function appender(str: string) {
|
||||
stack[stack.length - 1] += str;
|
||||
}
|
||||
|
||||
// Generate a unique name to avoid duplicate struct field names.
|
||||
// This function appends a number at the end of the field name.
|
||||
function uniqueTypeName(name: string, seen: string | any[]) {
|
||||
if (!seen.includes(name)) {
|
||||
return name;
|
||||
}
|
||||
|
||||
let i = 0;
|
||||
while (true) {
|
||||
const newName = name + i.toString();
|
||||
if (!seen.includes(newName)) {
|
||||
return newName;
|
||||
}
|
||||
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
// Sanitizes and formats a string to make an appropriate identifier in Go
|
||||
function format(str: any) {
|
||||
str = formatNumber(str);
|
||||
|
||||
const sanitized = toProperCase(str).replace(/[^a-z0-9]/ig, '');
|
||||
if (!sanitized) {
|
||||
return 'NAMING_FAILED';
|
||||
}
|
||||
|
||||
// After sanitizing the remaining characters can start with a number.
|
||||
// Run the sanitized string again trough formatNumber to make sure the identifier is Num[0-9] or Zero_... instead of 1.
|
||||
return formatNumber(sanitized);
|
||||
}
|
||||
|
||||
// Adds a prefix to a number to make an appropriate identifier in Go
|
||||
function formatNumber(str: string) {
|
||||
if (!str) {
|
||||
return '';
|
||||
}
|
||||
else if (str.match(/^\d+$/)) {
|
||||
str = `Num${str}`;
|
||||
}
|
||||
else if (str.charAt(0).match(/\d/)) {
|
||||
const numbers: { [key: string]: string } = {
|
||||
0: 'Zero_',
|
||||
1: 'One_',
|
||||
2: 'Two_',
|
||||
3: 'Three_',
|
||||
4: 'Four_',
|
||||
5: 'Five_',
|
||||
6: 'Six_',
|
||||
7: 'Seven_',
|
||||
8: 'Eight_',
|
||||
9: 'Nine_',
|
||||
};
|
||||
str = numbers[str.charAt(0)] + str.substr(1);
|
||||
}
|
||||
|
||||
return str;
|
||||
}
|
||||
|
||||
// Determines the most appropriate Go type
|
||||
function goType(val: string | number | null) {
|
||||
if (val === null) {
|
||||
return 'any';
|
||||
}
|
||||
|
||||
switch (typeof val) {
|
||||
case 'string':
|
||||
if (/\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(\.\d+)?(\+\d\d:\d\d|Z)/.test(val)) {
|
||||
return 'time.Time';
|
||||
}
|
||||
else { return 'string'; }
|
||||
case 'number':
|
||||
if (val % 1 === 0) {
|
||||
if (val > -2147483648 && val < 2147483647) {
|
||||
return 'int';
|
||||
}
|
||||
else { return 'int64'; }
|
||||
}
|
||||
else { return 'float64'; }
|
||||
case 'boolean':
|
||||
return 'bool';
|
||||
case 'object':
|
||||
if (Array.isArray(val)) {
|
||||
return 'slice';
|
||||
}
|
||||
return 'struct';
|
||||
default:
|
||||
return 'any';
|
||||
}
|
||||
}
|
||||
|
||||
// Given two types, returns the more specific of the two
|
||||
function mostSpecificPossibleGoType(typ1: string, typ2: string) {
|
||||
if (typ1.substr(0, 5) === 'float' && typ2.substr(0, 3) === 'int') {
|
||||
return typ1;
|
||||
}
|
||||
else if (typ1.substr(0, 3) === 'int' && typ2.substr(0, 5) === 'float') {
|
||||
return typ2;
|
||||
}
|
||||
else { return 'any'; }
|
||||
}
|
||||
|
||||
// Proper cases a string according to Go conventions
|
||||
function toProperCase(str: string) {
|
||||
// ensure that the SCREAMING_SNAKE_CASE is converted to snake_case
|
||||
if (str.match(/^[_A-Z0-9]+$/)) {
|
||||
str = str.toLowerCase();
|
||||
}
|
||||
|
||||
// https://github.com/golang/lint/blob/5614ed5bae6fb75893070bdc0996a68765fdd275/lint.go#L771-L810
|
||||
const commonInitialisms = [
|
||||
'ACL', 'API', 'ASCII', 'CPU', 'CSS', 'DNS', 'EOF', 'GUID', 'HTML', 'HTTP',
|
||||
'HTTPS', 'ID', 'IP', 'JSON', 'LHS', 'QPS', 'RAM', 'RHS', 'RPC', 'SLA',
|
||||
'SMTP', 'SQL', 'SSH', 'TCP', 'TLS', 'TTL', 'UDP', 'UI', 'UID', 'UUID',
|
||||
'URI', 'URL', 'UTF8', 'VM', 'XML', 'XMPP', 'XSRF', 'XSS',
|
||||
];
|
||||
|
||||
return str.replace(/(^|[^a-zA-Z])([a-z]+)/g, (unused: any, sep: any, frag: string | string[]) => {
|
||||
if (!Array.isArray(frag) && commonInitialisms.includes(frag.toUpperCase())) {
|
||||
return sep + frag.toUpperCase();
|
||||
}
|
||||
else {
|
||||
return sep + frag[0].toUpperCase() + (frag as string).substr(1).toLowerCase();
|
||||
}
|
||||
}).replace(/([A-Z])([a-z]+)/g, (unused: any, sep: any, frag: string) => {
|
||||
if (commonInitialisms.includes(sep + frag.toUpperCase())) {
|
||||
return (sep + frag).toUpperCase();
|
||||
}
|
||||
else { return sep + frag; }
|
||||
});
|
||||
}
|
||||
|
||||
function uuidv4() {
|
||||
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, (c) => {
|
||||
const r = Math.random() * 16 | 0; // NOSONAR
|
||||
const v = c === 'x' ? r : (r & 0x3 | 0x8);
|
||||
return v.toString(16);
|
||||
});
|
||||
}
|
||||
|
||||
function getOriginalName(unique: string) {
|
||||
const reLiteralUUID = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
|
||||
const uuidLength = 36;
|
||||
|
||||
if (unique.length >= uuidLength) {
|
||||
const tail = unique.substr(-uuidLength);
|
||||
if (reLiteralUUID.test(tail)) {
|
||||
return unique.slice(0, -1 * (uuidLength + 1));
|
||||
}
|
||||
}
|
||||
return unique;
|
||||
}
|
||||
|
||||
function compareObjects(objectA: any, objectB: any) {
|
||||
const object = '[object Object]';
|
||||
return Object.prototype.toString.call(objectA) === object && Object.prototype.toString.call(objectB) === object;
|
||||
}
|
||||
|
||||
function compareObjectKeys(itemAKeys: string | any[], itemBKeys: string | any[]) {
|
||||
const lengthA = itemAKeys.length;
|
||||
const lengthB = itemBKeys.length;
|
||||
|
||||
// nothing to compare, probably identical
|
||||
if (lengthA === 0 && lengthB === 0) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// duh
|
||||
if (lengthA !== lengthB) {
|
||||
return false;
|
||||
}
|
||||
|
||||
for (const item of itemAKeys) {
|
||||
if (!itemBKeys.includes(item)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
function formatScopeKeys(keys: string[]) {
|
||||
for (const i in keys) {
|
||||
keys[i] = format(keys[i]);
|
||||
}
|
||||
return keys;
|
||||
}
|
||||
}
|
||||
@@ -1,93 +0,0 @@
|
||||
|
||||
[
|
||||
{
|
||||
"input": "{\"SourceCode\": \"exampleDataHere\"}",
|
||||
"expected": "type AutoGenerated struct {\n\tSourceCode string `json:\"SourceCode\"`\n}",
|
||||
"expectedWithExample": "type AutoGenerated struct {\n\tSourceCode string `json:\"SourceCode\" example:\"exampleDataHere\"`\n}"
|
||||
},
|
||||
{
|
||||
"input": "{\"source_code\": \"exampleDataHere\"}",
|
||||
"expected": "type AutoGenerated struct {\n\tSourceCode string `json:\"source_code\"`\n}",
|
||||
"expectedWithExample": "type AutoGenerated struct {\n\tSourceCode string `json:\"source_code\" example:\"exampleDataHere\"`\n}"
|
||||
},
|
||||
{
|
||||
"input": "{\"sourceCode\": \"exampleDataHere\"}",
|
||||
"expected": "type AutoGenerated struct {\n\tSourceCode string `json:\"sourceCode\"`\n}",
|
||||
"expectedWithExample": "type AutoGenerated struct {\n\tSourceCode string `json:\"sourceCode\" example:\"exampleDataHere\"`\n}"
|
||||
},
|
||||
{
|
||||
"input": "{\"SOURCE_CODE\": \"\"}",
|
||||
"expected": "type AutoGenerated struct {\n\tSourceCode string `json:\"SOURCE_CODE\"`\n}",
|
||||
"expectedWithExample": "type AutoGenerated struct {\n\tSourceCode string `json:\"SOURCE_CODE\"`\n}"
|
||||
},
|
||||
{
|
||||
"input": "{\"PublicIP\": \"\"}",
|
||||
"expected": "type AutoGenerated struct {\n\tPublicIP string `json:\"PublicIP\"`\n}",
|
||||
"expectedWithExample": "type AutoGenerated struct {\n\tPublicIP string `json:\"PublicIP\"`\n}"
|
||||
},
|
||||
{
|
||||
"input": "{\"public_ip\": \"\"}",
|
||||
"expected": "type AutoGenerated struct {\n\tPublicIP string `json:\"public_ip\"`\n}",
|
||||
"expectedWithExample": "type AutoGenerated struct {\n\tPublicIP string `json:\"public_ip\"`\n}"
|
||||
},
|
||||
{
|
||||
"input": "{\"publicIP\": \"\"}",
|
||||
"expected": "type AutoGenerated struct {\n\tPublicIP string `json:\"publicIP\"`\n}",
|
||||
"expectedWithExample": "type AutoGenerated struct {\n\tPublicIP string `json:\"publicIP\"`\n}"
|
||||
},
|
||||
{
|
||||
"input": "{\"PUBLIC_IP\": \"\"}",
|
||||
"expected": "type AutoGenerated struct {\n\tPublicIP string `json:\"PUBLIC_IP\"`\n}",
|
||||
"expectedWithExample": "type AutoGenerated struct {\n\tPublicIP string `json:\"PUBLIC_IP\"`\n}"
|
||||
},
|
||||
{
|
||||
"input": "{\"+1\": \"Fails\", \"-1\": \"This should not cause duplicate field name\"}",
|
||||
"expected": "type AutoGenerated struct {\n\tNum1 string `json:\"+1\"`\n\tNum10 string `json:\"-1\"`\n}",
|
||||
"expectedWithExample": "type AutoGenerated struct {\n\tNum1 string `json:\"+1\" example:\"Fails\"`\n\tNum10 string `json:\"-1\" example:\"This should not cause duplicate field name\"`\n}"
|
||||
},
|
||||
{
|
||||
"input": "{\"age\": 46}",
|
||||
"expected": "type AutoGenerated struct {\n\tAge int `json:\"age\"`\n}",
|
||||
"expectedWithExample": "type AutoGenerated struct {\n\tAge int `json:\"age\" example:\"46\"`\n}"
|
||||
},
|
||||
{
|
||||
"input": "{\"negativeFloat\": -1.00}",
|
||||
"expected": "type AutoGenerated struct {\n\tNegativeFloat float64 `json:\"negativeFloat\"`\n}",
|
||||
"expectedWithExample": "type AutoGenerated struct {\n\tNegativeFloat float64 `json:\"negativeFloat\" example:\"-1.1\"`\n}"
|
||||
},
|
||||
{
|
||||
"input": "{\"zeroFloat\": 0.00}",
|
||||
"expected": "type AutoGenerated struct {\n\tZeroFloat float64 `json:\"zeroFloat\"`\n}",
|
||||
"expectedWithExample": "type AutoGenerated struct {\n\tZeroFloat float64 `json:\"zeroFloat\" example:\"0.1\"`\n}"
|
||||
},
|
||||
{
|
||||
"input": "{\"positiveFloat\": 1.00}",
|
||||
"expected": "type AutoGenerated struct {\n\tPositiveFloat float64 `json:\"positiveFloat\"`\n}",
|
||||
"expectedWithExample": "type AutoGenerated struct {\n\tPositiveFloat float64 `json:\"positiveFloat\" example:\"1.1\"`\n}"
|
||||
},
|
||||
{
|
||||
"input": "{\"negativeFloats\": [-1.00, -2.00, -3.00]}",
|
||||
"expected": "type AutoGenerated struct {\n\tNegativeFloats []float64 `json:\"negativeFloats\"`\n}",
|
||||
"expectedWithExample": "type AutoGenerated struct {\n\tNegativeFloats []float64 `json:\"negativeFloats\"`\n}"
|
||||
},
|
||||
{
|
||||
"input": "{\"zeroFloats\": [0.00, 0.00, 0.00]}",
|
||||
"expected": "type AutoGenerated struct {\n\tZeroFloats []float64 `json:\"zeroFloats\"`\n}",
|
||||
"expectedWithExample": "type AutoGenerated struct {\n\tZeroFloats []float64 `json:\"zeroFloats\"`\n}"
|
||||
},
|
||||
{
|
||||
"input": "{\"positiveFloats\": [1.00, 2.00, 3.00]}",
|
||||
"expected": "type AutoGenerated struct {\n\tPositiveFloats []float64 `json:\"positiveFloats\"`\n}",
|
||||
"expectedWithExample": "type AutoGenerated struct {\n\tPositiveFloats []float64 `json:\"positiveFloats\"`\n}"
|
||||
},
|
||||
{
|
||||
"input": "{\"topLevel\": { \"secondLevel\": \"exampleDataHere\"} }",
|
||||
"expected": "type AutoGenerated struct {\n\tTopLevel struct {\n\t\tSecondLevel string `json:\"secondLevel\"`\n\t} `json:\"topLevel\"`\n}",
|
||||
"expectedWithExample": "type AutoGenerated struct {\n\tTopLevel struct {\n\t\tSecondLevel string `json:\"secondLevel\" example:\"exampleDataHere\"`\n\t} `json:\"topLevel\"`\n}"
|
||||
},
|
||||
{
|
||||
"input": "{\"people\": [{ \"name\": \"Frank\"}, {\"name\": \"Dennis\"}, {\"name\": \"Dee\"}, {\"name\": \"Charley\"}, {\"name\":\"Mac\"}] }",
|
||||
"expected": "type AutoGenerated struct {\n\tPeople []struct {\n\t\tName string `json:\"name\"`\n\t} `json:\"people\"`\n}",
|
||||
"expectedWithExample": "type AutoGenerated struct {\n\tPeople []struct {\n\t\tName string `json:\"name\" example:\"Frank\"`\n\t} `json:\"people\"`\n}"
|
||||
}
|
||||
]
|
||||
@@ -1,14 +1,82 @@
|
||||
<script setup lang="ts">
|
||||
import JSON5 from 'json5';
|
||||
import { jsonToGo } from './json-to-go.service';
|
||||
import { InputData, jsonInputForTargetLanguage, quicktype } from 'quicktype-core';
|
||||
import type { UseValidationRule } from '@/composable/validation';
|
||||
import TextareaCopyable from '@/components/TextareaCopyable.vue';
|
||||
import { useQueryParamOrStorage } from '@/composable/queryParams';
|
||||
|
||||
const defaultValue = `{
|
||||
a:"n",
|
||||
arr: [1, 2],
|
||||
nested: {
|
||||
a:1,
|
||||
b:"2"
|
||||
}
|
||||
}`;
|
||||
const jsonInput = ref(defaultValue);
|
||||
const rootName = useQueryParamOrStorage({ name: 'root', storageName: 'json-go:r', defaultValue: 'MyType' });
|
||||
const packageName = useQueryParamOrStorage({ name: 'package', storageName: 'json-go:p', defaultValue: 'main' });
|
||||
const tags = useQueryParamOrStorage({ name: 'tags', storageName: 'json-go:t', defaultValue: 'json' });
|
||||
const plainTypesOnly = useQueryParamOrStorage({ name: 'plainTypes', storageName: 'json-go:pt', defaultValue: false });
|
||||
const plainTypesWithPackageOnly = useQueryParamOrStorage({ name: 'plainTypesPackage', storageName: 'json-go:ptp', defaultValue: false });
|
||||
const optionalProperties = useQueryParamOrStorage({ name: 'optional', storageName: 'json-go:op', defaultValue: false });
|
||||
const omitEmpty = useQueryParamOrStorage({ name: 'omit', storageName: 'json-go:oe', defaultValue: false });
|
||||
|
||||
async function convertJsonToGo(
|
||||
json: string,
|
||||
options: {
|
||||
rootName: string
|
||||
packageName?: string
|
||||
tags?: string
|
||||
plainTypesOnly?: boolean
|
||||
plainTypesWithPackageOnly?: boolean
|
||||
optionalProperties?: boolean
|
||||
omitEmpty?: boolean
|
||||
},
|
||||
): Promise<string> {
|
||||
const targetLanguage = 'go';
|
||||
const inputData = new InputData();
|
||||
const jsonInput = jsonInputForTargetLanguage(targetLanguage);
|
||||
|
||||
await jsonInput.addSource({ name: options.rootName, samples: [JSON.stringify(JSON5.parse(json))] });
|
||||
inputData.addInput(jsonInput);
|
||||
|
||||
const result = await quicktype({
|
||||
inputData,
|
||||
lang: targetLanguage,
|
||||
topLevel: options.rootName,
|
||||
allPropertiesOptional: options.optionalProperties,
|
||||
rendererOptions: {
|
||||
'package': options.packageName ?? 'main',
|
||||
'field-tags': options.tags ?? false,
|
||||
'just-types': options.plainTypesOnly ?? false,
|
||||
'just-types-and-package': options.plainTypesWithPackageOnly ?? false,
|
||||
'omit-empty': options.optionalProperties ?? false,
|
||||
},
|
||||
} as any);
|
||||
|
||||
return result.lines.join('\n');
|
||||
}
|
||||
|
||||
const goOutput = computedAsync(async () => {
|
||||
try {
|
||||
return await convertJsonToGo(jsonInput.value,
|
||||
{
|
||||
rootName: rootName.value,
|
||||
packageName: packageName.value,
|
||||
tags: tags.value,
|
||||
plainTypesOnly: plainTypesOnly.value,
|
||||
plainTypesWithPackageOnly: plainTypesWithPackageOnly.value,
|
||||
optionalProperties: optionalProperties.value,
|
||||
omitEmpty: omitEmpty.value,
|
||||
},
|
||||
);
|
||||
}
|
||||
catch (e: any) {
|
||||
return e.toString();
|
||||
}
|
||||
});
|
||||
|
||||
const definitions = ref(true);
|
||||
const omitempty = ref(false);
|
||||
const example = ref(false);
|
||||
const jsonInput = ref('');
|
||||
const goOutput = computed(() => jsonToGo(jsonInput.value, '', !definitions.value, example.value, omitempty.value).go);
|
||||
const rules: UseValidationRule<string>[] = [
|
||||
{
|
||||
validator: (v: string) => v === '' || JSON5.parse(v),
|
||||
@@ -19,27 +87,35 @@ const rules: UseValidationRule<string>[] = [
|
||||
|
||||
<template>
|
||||
<c-card title="JSON to Go">
|
||||
<n-form-item label="Inline type definitions" label-placement="left">
|
||||
<n-switch v-model:value="definitions" />
|
||||
</n-form-item>
|
||||
<n-form-item label="Omit Empty" label-placement="left">
|
||||
<n-switch v-model:value="omitempty" />
|
||||
</n-form-item>
|
||||
<n-form-item label="Example" label-placement="left">
|
||||
<n-switch v-model:value="example" />
|
||||
</n-form-item>
|
||||
<c-input-text
|
||||
v-model:value="jsonInput"
|
||||
multiline
|
||||
placeholder="Put your json string here..."
|
||||
rows="20"
|
||||
label="JSON to GO"
|
||||
label="JSON to Go"
|
||||
:validation-rules="rules"
|
||||
raw-text
|
||||
mb-5
|
||||
/>
|
||||
<n-space justify="center">
|
||||
<c-input v-model:value="rootName" label="Root Name" />
|
||||
<c-input v-model:value="packageName" label="Package Name" />
|
||||
<c-input v-model:value="tags" label="List of tags which should be generated for fields" />
|
||||
<n-checkbox v-model:checked="plainTypesOnly">
|
||||
Plain types only
|
||||
</n-checkbox>
|
||||
<n-checkbox v-model:checked="plainTypesWithPackageOnly">
|
||||
Plain types with package only
|
||||
</n-checkbox>
|
||||
<n-checkbox v-model:checked="omitEmpty">
|
||||
Omit empty
|
||||
</n-checkbox>
|
||||
<n-checkbox v-model:checked="optionalProperties">
|
||||
Make all properties optional
|
||||
</n-checkbox>
|
||||
</n-space>
|
||||
</c-card>
|
||||
<c-card title="Your Go String">
|
||||
<c-card title="Your Go code">
|
||||
<TextareaCopyable
|
||||
:value="goOutput"
|
||||
language="go"
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
import { Braces } from '@vicons/tabler';
|
||||
import { defineTool } from '../tool';
|
||||
|
||||
export const tool = defineTool({
|
||||
name: 'Json to PHP Code',
|
||||
path: '/json-to-php',
|
||||
description: 'Generate PHP Classes from JSON',
|
||||
keywords: ['json', 'php'],
|
||||
component: () => import('./json-to-php.vue'),
|
||||
icon: Braces,
|
||||
createdAt: new Date('2025-04-21'),
|
||||
category: 'JSON',
|
||||
});
|
||||
@@ -0,0 +1,117 @@
|
||||
<script setup lang="ts">
|
||||
import JSON5 from 'json5';
|
||||
import { InputData, jsonInputForTargetLanguage, quicktype } from 'quicktype-core';
|
||||
import type { UseValidationRule } from '@/composable/validation';
|
||||
import TextareaCopyable from '@/components/TextareaCopyable.vue';
|
||||
import { useQueryParamOrStorage } from '@/composable/queryParams';
|
||||
|
||||
const defaultValue = `{
|
||||
a:"n",
|
||||
arr: [1, 2],
|
||||
nested: {
|
||||
a:1,
|
||||
b:"2"
|
||||
}
|
||||
}`;
|
||||
const jsonInput = ref(defaultValue);
|
||||
const rootName = useQueryParamOrStorage({ name: 'root', storageName: 'json-php:r', defaultValue: 'GeneratedClass' });
|
||||
const createGetter = useQueryParamOrStorage({ name: 'getter', storageName: 'json-php:pv', defaultValue: true });
|
||||
const getterWithoutValidation = useQueryParamOrStorage({ name: 'novalid', storageName: 'json-php:cl', defaultValue: false });
|
||||
const createSetter = useQueryParamOrStorage({ name: 'setter', storageName: 'json-php:pn', defaultValue: true });
|
||||
const phpClosingTag = useQueryParamOrStorage({ name: 'closing', storageName: 'json-php:pn', defaultValue: true });
|
||||
const optionalProperties = useQueryParamOrStorage({ name: 'optional', storageName: 'json-php:op', defaultValue: false });
|
||||
|
||||
async function convertJsonToPHP(json: string,
|
||||
options: {
|
||||
rootName: string
|
||||
createGetter?: boolean
|
||||
getterWithoutValidation?: boolean
|
||||
createSetter?: boolean
|
||||
phpClosingTag?: boolean
|
||||
optionalProperties?: boolean
|
||||
}): Promise<string> {
|
||||
const jsonInput = jsonInputForTargetLanguage('php');
|
||||
await jsonInput.addSource({ name: options.rootName, samples: [JSON.stringify(JSON5.parse(json))] });
|
||||
|
||||
const inputData = new InputData();
|
||||
inputData.addInput(jsonInput);
|
||||
|
||||
const { lines } = await quicktype({
|
||||
inputData,
|
||||
lang: 'php',
|
||||
topLevel: options.rootName,
|
||||
allPropertiesOptional: options.optionalProperties,
|
||||
rendererOptions: {
|
||||
'with-get': options.createGetter,
|
||||
'fast-get': options.getterWithoutValidation,
|
||||
'with-set': options.createSetter,
|
||||
'with-closing': options.phpClosingTag,
|
||||
},
|
||||
} as any);
|
||||
return lines.join('\n');
|
||||
}
|
||||
|
||||
const phpOutput = computedAsync(async () => {
|
||||
try {
|
||||
return await convertJsonToPHP(jsonInput.value,
|
||||
{
|
||||
rootName: rootName.value,
|
||||
createGetter: createGetter.value,
|
||||
getterWithoutValidation: getterWithoutValidation.value,
|
||||
createSetter: createSetter.value,
|
||||
phpClosingTag: phpClosingTag.value,
|
||||
optionalProperties: optionalProperties.value,
|
||||
},
|
||||
);
|
||||
}
|
||||
catch (e: any) {
|
||||
return e.toString();
|
||||
}
|
||||
});
|
||||
|
||||
const rules: UseValidationRule<string>[] = [
|
||||
{
|
||||
validator: (v: string) => v === '' || JSON5.parse(v),
|
||||
message: 'Provided JSON is not valid.',
|
||||
},
|
||||
];
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<c-card title="JSON to PHP">
|
||||
<c-input-text
|
||||
v-model:value="jsonInput"
|
||||
multiline
|
||||
placeholder="Put your json string here..."
|
||||
rows="20"
|
||||
label="Your JSON object:"
|
||||
:validation-rules="rules"
|
||||
raw-text
|
||||
mb-5
|
||||
/>
|
||||
<c-input-text v-model:value="rootName" label="Root Name:" label-position="left" mb-2 />
|
||||
<n-space justify="center">
|
||||
<n-checkbox v-model:checked="createGetter">
|
||||
Create Getter
|
||||
</n-checkbox>
|
||||
<n-checkbox v-model:checked="getterWithoutValidation">
|
||||
Getter without validation
|
||||
</n-checkbox>
|
||||
<n-checkbox v-model:checked="createSetter">
|
||||
Create Setter
|
||||
</n-checkbox>
|
||||
<n-checkbox v-model:checked="phpClosingTag">
|
||||
PHP Closing Tag
|
||||
</n-checkbox>
|
||||
<n-checkbox v-model:checked="optionalProperties">
|
||||
Make all properties optional
|
||||
</n-checkbox>
|
||||
</n-space>
|
||||
</c-card>
|
||||
<c-card title="Your PHP code">
|
||||
<TextareaCopyable
|
||||
:value="phpOutput"
|
||||
language="php"
|
||||
/>
|
||||
</c-card>
|
||||
</template>
|
||||
@@ -0,0 +1,13 @@
|
||||
import { DatabaseExport } from '@vicons/tabler';
|
||||
import { defineTool } from '../tool';
|
||||
|
||||
export const tool = defineTool({
|
||||
name: 'Json to Protobuf',
|
||||
path: '/json-to-protobuf',
|
||||
description: 'Generate Protobuf declaration from JSON objects',
|
||||
keywords: ['json', 'protobuf'],
|
||||
component: () => import('./json-to-protobuf.vue'),
|
||||
icon: DatabaseExport,
|
||||
createdAt: new Date('2025-01-01'),
|
||||
category: 'Development',
|
||||
});
|
||||
@@ -0,0 +1,40 @@
|
||||
<script setup lang="ts">
|
||||
import GenerateSchema from 'generate-schema';
|
||||
import JSON5 from 'json5';
|
||||
import convert from 'jsonschema-protobuf';
|
||||
import FormatTransformer from '@/components/FormatTransformer.vue';
|
||||
import type { UseValidationRule } from '@/composable/validation';
|
||||
|
||||
const rootName = ref<string>('RootName');
|
||||
|
||||
function transformer(value: string) {
|
||||
try {
|
||||
const object = JSON5.parse(value);
|
||||
const schema = JSON.stringify({ ...{ name: rootName.value }, ...GenerateSchema.json(rootName.value, object) });
|
||||
return convert(schema);
|
||||
}
|
||||
catch (e: any) {
|
||||
return e.toString();
|
||||
}
|
||||
}
|
||||
|
||||
const rules: UseValidationRule<string>[] = [
|
||||
{
|
||||
validator: (v: string) => v === '' || JSON5.parse(v),
|
||||
message: 'Provided JSON is not valid.',
|
||||
},
|
||||
];
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<c-input-text v-model:value="rootName" label="Root Name:" label-placement="left" />
|
||||
|
||||
<FormatTransformer
|
||||
input-label="Your JSON"
|
||||
input-placeholder="Paste your JSON here..."
|
||||
output-label="ProtoBuf version of your JSON objects:"
|
||||
:input-validation-rules="rules"
|
||||
:transformer="transformer"
|
||||
output-language="protobuf"
|
||||
/>
|
||||
</template>
|
||||
@@ -0,0 +1,3 @@
|
||||
declare module 'jsonschema-protobuf' {
|
||||
export default function convert(schema: any): string;
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
import { BrandPython } from '@vicons/tabler';
|
||||
import { defineTool } from '../tool';
|
||||
|
||||
export const tool = defineTool({
|
||||
name: 'Json to Python',
|
||||
path: '/json-to-python',
|
||||
description: 'Convert JSON to Python classes',
|
||||
keywords: ['json', 'to', 'python'],
|
||||
component: () => import('./json-to-python.vue'),
|
||||
icon: BrandPython,
|
||||
createdAt: new Date('2025-03-09'),
|
||||
category: 'JSON',
|
||||
});
|
||||
@@ -0,0 +1,129 @@
|
||||
<script setup lang="ts">
|
||||
import JSON5 from 'json5';
|
||||
import { InputData, jsonInputForTargetLanguage, quicktype } from 'quicktype-core';
|
||||
import type { UseValidationRule } from '@/composable/validation';
|
||||
import TextareaCopyable from '@/components/TextareaCopyable.vue';
|
||||
import { useQueryParamOrStorage } from '@/composable/queryParams';
|
||||
|
||||
const defaultValue = `{
|
||||
a:"n",
|
||||
arr: [1, 2],
|
||||
nested: {
|
||||
a:1,
|
||||
b:"2"
|
||||
}
|
||||
}`;
|
||||
const jsonInput = ref(defaultValue);
|
||||
const rootName = useQueryParamOrStorage({ name: 'root', storageName: 'json-python:r', defaultValue: 'GeneratedClass' });
|
||||
const pythonVersion = useQueryParamOrStorage({ name: 'version', storageName: 'json-python:pv', defaultValue: '3.6' });
|
||||
const classesOnly = useQueryParamOrStorage({ name: 'classes', storageName: 'json-python:cl', defaultValue: false });
|
||||
const pythonicNames = useQueryParamOrStorage({ name: 'pythonic', storageName: 'json-python:pn', defaultValue: true });
|
||||
const pydanticBaseModel = useQueryParamOrStorage({ name: 'basemodel', storageName: 'json-python:bm', defaultValue: false });
|
||||
const optionalProperties = useQueryParamOrStorage({ name: 'optional', storageName: 'json-python:op', defaultValue: false });
|
||||
|
||||
async function convertJsonToPython(json: string,
|
||||
{
|
||||
pythonVersion = '3.9',
|
||||
classesOnly = true,
|
||||
pythonicNames = true,
|
||||
optionalProperties = true,
|
||||
pydanticBaseModel = false,
|
||||
rootName = 'GeneratedClass',
|
||||
}: {
|
||||
pythonVersion?: string
|
||||
classesOnly?: boolean
|
||||
pythonicNames?: boolean
|
||||
optionalProperties?: boolean
|
||||
rootName?: string
|
||||
pydanticBaseModel?: boolean
|
||||
} = {},
|
||||
) {
|
||||
const jsonInput = jsonInputForTargetLanguage('python');
|
||||
await jsonInput.addSource({ name: rootName, samples: [JSON.stringify(JSON5.parse(json))] });
|
||||
|
||||
const inputData = new InputData();
|
||||
inputData.addInput(jsonInput);
|
||||
|
||||
const result = await quicktype({
|
||||
inputData,
|
||||
lang: 'python',
|
||||
allPropertiesOptional: optionalProperties,
|
||||
topLevel: rootName,
|
||||
rendererOptions: {
|
||||
'python-version': pythonVersion,
|
||||
'just-types': classesOnly,
|
||||
'nice-property-names': pythonicNames,
|
||||
'pydantic-base-model': pydanticBaseModel,
|
||||
},
|
||||
} as any);
|
||||
|
||||
return result.lines.join('\n');
|
||||
}
|
||||
const pythonOutput = computedAsync(async () => {
|
||||
try {
|
||||
return await convertJsonToPython(jsonInput.value,
|
||||
{
|
||||
rootName: rootName.value,
|
||||
pythonVersion: pythonVersion.value,
|
||||
classesOnly: classesOnly.value,
|
||||
pythonicNames: pythonicNames.value,
|
||||
optionalProperties: optionalProperties.value,
|
||||
pydanticBaseModel: pydanticBaseModel.value,
|
||||
},
|
||||
);
|
||||
}
|
||||
catch (e: any) {
|
||||
return e.toString();
|
||||
}
|
||||
});
|
||||
|
||||
const rules: UseValidationRule<string>[] = [
|
||||
{
|
||||
validator: (v: string) => v === '' || JSON5.parse(v),
|
||||
message: 'Provided JSON is not valid.',
|
||||
},
|
||||
];
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<c-card title="JSON to Python">
|
||||
<c-input-text
|
||||
v-model:value="jsonInput"
|
||||
multiline
|
||||
placeholder="Put your json string here..."
|
||||
rows="20"
|
||||
label="JSON Object:"
|
||||
:validation-rules="rules"
|
||||
raw-text
|
||||
mb-5
|
||||
/>
|
||||
<c-input-text v-model:value="rootName" label="Root Name:" label-position="left" mb-2 />
|
||||
<n-space justify="center" items-center>
|
||||
<c-select
|
||||
v-model:value="pythonVersion"
|
||||
:options="['3.5', '3.6', '3.7']"
|
||||
label-position="left"
|
||||
label="Python version:"
|
||||
placeholder="Python version"
|
||||
/>
|
||||
<n-checkbox v-model:checked="classesOnly">
|
||||
Classes only
|
||||
</n-checkbox>
|
||||
<n-checkbox v-model:checked="pythonicNames">
|
||||
Transform property names to be Pythonic
|
||||
</n-checkbox>
|
||||
<n-checkbox v-model:checked="pydanticBaseModel">
|
||||
Uses pydantic BaseModel
|
||||
</n-checkbox>
|
||||
<n-checkbox v-model:checked="optionalProperties">
|
||||
Make all properties optional
|
||||
</n-checkbox>
|
||||
</n-space>
|
||||
</c-card>
|
||||
<c-card title="Your Python code">
|
||||
<TextareaCopyable
|
||||
:value="pythonOutput"
|
||||
language="python"
|
||||
/>
|
||||
</c-card>
|
||||
</template>
|
||||
@@ -0,0 +1,13 @@
|
||||
import { Database } from '@vicons/tabler';
|
||||
import { defineTool } from '../tool';
|
||||
|
||||
export const tool = defineTool({
|
||||
name: 'Json to SQL DDL',
|
||||
path: '/json-to-sql-ddl',
|
||||
description: 'JSON to SQL CREATE TABLE',
|
||||
keywords: ['json', 'sql', 'ddl', 'create', 'table'],
|
||||
component: () => import('./json-to-sql-ddl.vue'),
|
||||
icon: Database,
|
||||
createdAt: new Date('2025-03-09'),
|
||||
category: 'JSON',
|
||||
});
|
||||
@@ -0,0 +1,42 @@
|
||||
<script setup lang="ts">
|
||||
import JSON5 from 'json5';
|
||||
import GenerateSchema from 'generate-schema';
|
||||
import { withDefaultOnError } from '../../utils/defaults';
|
||||
import type { UseValidationRule } from '@/composable/validation';
|
||||
|
||||
const tableName = ref('TableName');
|
||||
|
||||
function convertJsonToDDL(value: string) {
|
||||
const object = JSON5.parse(value);
|
||||
return GenerateSchema.mysql(tableName.value, object);
|
||||
}
|
||||
const transformer = (value: string) => value.trim() === '' ? '' : withDefaultOnError(() => convertJsonToDDL(value), '');
|
||||
|
||||
const rules: UseValidationRule<string>[] = [
|
||||
{
|
||||
validator: (v: string) => v === '' || JSON5.parse(v),
|
||||
message: 'Provided JSON is not valid.',
|
||||
},
|
||||
];
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<c-input-text
|
||||
v-model:value="tableName"
|
||||
label="Table Name"
|
||||
placeholder="Table Name"
|
||||
mb-2
|
||||
/>
|
||||
<n-divider />
|
||||
|
||||
<format-transformer
|
||||
input-label="Your JSON"
|
||||
input-placeholder="Paste your JSON here..."
|
||||
output-label="Your SQL DDL"
|
||||
output-language="sql"
|
||||
:input-validation-rules="rules"
|
||||
:transformer="transformer"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
@@ -0,0 +1,13 @@
|
||||
import { DatabaseExport } from '@vicons/tabler';
|
||||
import { defineTool } from '../tool';
|
||||
|
||||
export const tool = defineTool({
|
||||
name: 'Json to SQL INSERT',
|
||||
path: '/json-to-sql-insert',
|
||||
description: 'Convert JSON array to INSERT INTO',
|
||||
keywords: ['json', 'sql', 'insert'],
|
||||
component: () => import('./json-to-sql-insert.vue'),
|
||||
icon: DatabaseExport,
|
||||
createdAt: new Date('2025-05-01'),
|
||||
category: 'Development',
|
||||
});
|
||||
@@ -0,0 +1,59 @@
|
||||
<script setup lang="ts">
|
||||
import JSON5 from 'json5';
|
||||
import { flatten } from 'flatten-anything';
|
||||
import { objectArrayToData } from '@/utils/objectarray.export';
|
||||
import type { UseValidationRule } from '@/composable/validation';
|
||||
import TextareaCopyable from '@/components/TextareaCopyable.vue';
|
||||
|
||||
const defaultValue = `{
|
||||
a:"n",
|
||||
arr: [1, 2],
|
||||
nested: {
|
||||
a:1,
|
||||
b:"2"
|
||||
}
|
||||
}`;
|
||||
const jsonInput = ref(defaultValue);
|
||||
const tableName = ref<string>('TableName');
|
||||
|
||||
const sqlOutput = computed(() => {
|
||||
try {
|
||||
let arr = JSON5.parse(jsonInput.value);
|
||||
if (!Array.isArray(arr)) {
|
||||
arr = [arr];
|
||||
}
|
||||
return objectArrayToData(arr.map((o: any) => flatten(o)), 'sql', { tableName: tableName.value });
|
||||
}
|
||||
catch (e: any) {
|
||||
return e.toString();
|
||||
}
|
||||
});
|
||||
|
||||
const rules: UseValidationRule<string>[] = [
|
||||
{
|
||||
validator: (v: string) => v === '' || JSON5.parse(v),
|
||||
message: 'Provided JSON is not valid.',
|
||||
},
|
||||
];
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<c-card title="JSON to SQL INSERT">
|
||||
<c-input-text v-model:value="tableName" label="Table Name:" label-placement="left" mb-1 />
|
||||
<c-input-text
|
||||
v-model:value="jsonInput"
|
||||
multiline
|
||||
placeholder="Put your json string here..."
|
||||
rows="20"
|
||||
label="JSON:"
|
||||
:validation-rules="rules"
|
||||
raw-text
|
||||
/>
|
||||
</c-card>
|
||||
<c-card title="Your SQL INSERT code">
|
||||
<TextareaCopyable
|
||||
:value="sqlOutput"
|
||||
language="sql"
|
||||
/>
|
||||
</c-card>
|
||||
</template>
|
||||
@@ -0,0 +1,13 @@
|
||||
import { BrandJavascript } from '@vicons/tabler';
|
||||
import { defineTool } from '../tool';
|
||||
|
||||
export const tool = defineTool({
|
||||
name: 'Json to Typescript',
|
||||
path: '/json-to-typescript',
|
||||
description: 'Convert JSON to Typescript code',
|
||||
keywords: ['json', 'typescript'],
|
||||
component: () => import('./json-to-typescript.vue'),
|
||||
icon: BrandJavascript,
|
||||
createdAt: new Date('2025-05-01'),
|
||||
category: 'Development',
|
||||
});
|
||||
@@ -0,0 +1,149 @@
|
||||
<script setup lang="ts">
|
||||
import JSON5 from 'json5';
|
||||
import { InputData, jsonInputForTargetLanguage, quicktype } from 'quicktype-core';
|
||||
import type { UseValidationRule } from '@/composable/validation';
|
||||
import TextareaCopyable from '@/components/TextareaCopyable.vue';
|
||||
import { useQueryParamOrStorage } from '@/composable/queryParams';
|
||||
|
||||
const defaultValue = `{
|
||||
a:"n",
|
||||
arr: [1, 2],
|
||||
nested: {
|
||||
a:1,
|
||||
b:"2"
|
||||
}
|
||||
}`;
|
||||
const jsonInput = ref(defaultValue);
|
||||
const rootName = useQueryParamOrStorage({ name: 'root', storageName: 'json-ts:r', defaultValue: 'MyType' });
|
||||
const interfacesOnly = useQueryParamOrStorage({ name: 'interfaces', storageName: 'json-ts:i', defaultValue: false });
|
||||
const transformPropertyNames = useQueryParamOrStorage({ name: 'js', storageName: 'json-ts:t', defaultValue: false });
|
||||
const explicitlyNameUnions = useQueryParamOrStorage({ name: 'nameunion', storageName: 'json-ts:eu', defaultValue: false });
|
||||
const verifyJsonParseResults = useQueryParamOrStorage({ name: 'valid', storageName: 'json-ts:v', defaultValue: true });
|
||||
const preferUnionTypeOverEnum = useQueryParamOrStorage({ name: 'unionenum', storageName: 'json-ts:u', defaultValue: false });
|
||||
const preferTypesOverInterfaces = useQueryParamOrStorage({ name: 'types', storageName: 'json-ts:typ', defaultValue: false });
|
||||
const useStringInsteadOfEnumForSingleValueEnums = useQueryParamOrStorage({ name: 'stringenums', storageName: 'json-ts:str', defaultValue: false });
|
||||
const useReadonlyTypeMembers = useQueryParamOrStorage({ name: 'ro', storageName: 'json-ts:ro', defaultValue: false });
|
||||
const optionalProperties = useQueryParamOrStorage({ name: 'optional', storageName: 'json-ts:opt', defaultValue: false });
|
||||
|
||||
async function convertJsonToTypescript(
|
||||
json: string,
|
||||
options: {
|
||||
rootName: string
|
||||
optionalProperties?: boolean
|
||||
interfacesOnly?: boolean
|
||||
transformPropertyNames?: boolean
|
||||
explicitlyNameUnions?: boolean
|
||||
verifyJsonParseResults?: boolean
|
||||
preferUnionTypeOverEnum?: boolean
|
||||
preferTypesOverInterfaces?: boolean
|
||||
useStringInsteadOfEnumForSingleValueEnums?: boolean
|
||||
useReadonlyTypeMembers?: boolean
|
||||
},
|
||||
): Promise<string> {
|
||||
const targetLanguage = 'typescript';
|
||||
const inputData = new InputData();
|
||||
const jsonInput = jsonInputForTargetLanguage(targetLanguage);
|
||||
|
||||
await jsonInput.addSource({ name: options.rootName, samples: [JSON.stringify(JSON5.parse(json))] });
|
||||
inputData.addInput(jsonInput);
|
||||
|
||||
const { lines } = await quicktype({
|
||||
inputData,
|
||||
lang: targetLanguage,
|
||||
topLevel: options.rootName,
|
||||
allPropertiesOptional: options.optionalProperties,
|
||||
rendererOptions: {
|
||||
'just-types': options.interfacesOnly,
|
||||
'prefer-unions': options.preferUnionTypeOverEnum,
|
||||
'explicit-unions': options.explicitlyNameUnions,
|
||||
'runtime-typecheck': options.verifyJsonParseResults,
|
||||
'nice-property-names': options.transformPropertyNames,
|
||||
'prefer-const-values': options.useStringInsteadOfEnumForSingleValueEnums,
|
||||
'readonly': options.useReadonlyTypeMembers,
|
||||
'prefer-types': options.preferTypesOverInterfaces,
|
||||
},
|
||||
} as any);
|
||||
|
||||
return lines.join('\n');
|
||||
}
|
||||
|
||||
const tsOutput = computedAsync(async () => {
|
||||
try {
|
||||
return await convertJsonToTypescript(jsonInput.value,
|
||||
{
|
||||
rootName: rootName.value,
|
||||
interfacesOnly: interfacesOnly.value,
|
||||
transformPropertyNames: transformPropertyNames.value,
|
||||
explicitlyNameUnions: explicitlyNameUnions.value,
|
||||
verifyJsonParseResults: verifyJsonParseResults.value,
|
||||
preferUnionTypeOverEnum: preferUnionTypeOverEnum.value,
|
||||
preferTypesOverInterfaces: preferTypesOverInterfaces.value,
|
||||
useStringInsteadOfEnumForSingleValueEnums: useStringInsteadOfEnumForSingleValueEnums.value,
|
||||
useReadonlyTypeMembers: useReadonlyTypeMembers.value,
|
||||
optionalProperties: optionalProperties.value,
|
||||
},
|
||||
);
|
||||
}
|
||||
catch (e: any) {
|
||||
return e.toString();
|
||||
}
|
||||
});
|
||||
|
||||
const rules: UseValidationRule<string>[] = [
|
||||
{
|
||||
validator: (v: string) => v === '' || JSON5.parse(v),
|
||||
message: 'Provided JSON is not valid.',
|
||||
},
|
||||
];
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<c-card title="JSON to Typescript">
|
||||
<c-input-text
|
||||
v-model:value="jsonInput"
|
||||
multiline
|
||||
placeholder="Put your json string here..."
|
||||
rows="20"
|
||||
label="JSON to Typescript"
|
||||
:validation-rules="rules"
|
||||
raw-text
|
||||
mb-5
|
||||
/>
|
||||
<n-space justify="center">
|
||||
<c-input v-model:value="rootName" label="Root Name" />
|
||||
<n-checkbox v-model:checked="interfacesOnly">
|
||||
Use Interfaces Only
|
||||
</n-checkbox>
|
||||
<n-checkbox v-model:checked="transformPropertyNames">
|
||||
Transform Property Names to JavaScripty
|
||||
</n-checkbox>
|
||||
<n-checkbox v-model:checked="explicitlyNameUnions">
|
||||
Explicitly Name Unions
|
||||
</n-checkbox>
|
||||
<n-checkbox v-model:checked="verifyJsonParseResults">
|
||||
Verify JSON.parse results at runtime
|
||||
</n-checkbox>
|
||||
<n-checkbox v-model:checked="preferUnionTypeOverEnum">
|
||||
Use Union Type Instead of Enum
|
||||
</n-checkbox>
|
||||
<n-checkbox v-model:checked="preferTypesOverInterfaces">
|
||||
Use Types Instead of Interfaces
|
||||
</n-checkbox>
|
||||
<n-checkbox v-model:checked="useStringInsteadOfEnumForSingleValueEnums">
|
||||
Use String Instead of Enum for Single Value Enums
|
||||
</n-checkbox>
|
||||
<n-checkbox v-model:checked="useReadonlyTypeMembers">
|
||||
Use Readonly Type Members
|
||||
</n-checkbox>
|
||||
<n-checkbox v-model:checked="optionalProperties">
|
||||
Make All Properties Optional
|
||||
</n-checkbox>
|
||||
</n-space>
|
||||
</c-card>
|
||||
<c-card title="Your Typescript code">
|
||||
<TextareaCopyable
|
||||
:value="tsOutput"
|
||||
language="typescript"
|
||||
/>
|
||||
</c-card>
|
||||
</template>
|
||||
@@ -0,0 +1,13 @@
|
||||
import { Key } from '@vicons/tabler';
|
||||
import { defineTool } from '../tool';
|
||||
|
||||
export const tool = defineTool({
|
||||
name: 'Paseto/PASERK Local',
|
||||
path: '/paseto-encryption',
|
||||
description: 'Generate local keys and encrypt/decrypt payloads',
|
||||
keywords: ['paseto', 'encryption', 'paserk', 'payload'],
|
||||
component: () => import('./paseto-encryption.vue'),
|
||||
icon: Key,
|
||||
createdAt: new Date('2025-04-21'),
|
||||
category: 'Crypto',
|
||||
});
|
||||
@@ -0,0 +1,182 @@
|
||||
<script setup lang="ts">
|
||||
import JSON5 from 'json5';
|
||||
import { decrypt, encrypt, generateKeys } from 'paseto-ts/v4';
|
||||
import { useValidation } from '@/composable/validation';
|
||||
|
||||
const payload = ref(`{
|
||||
"sub": "1234567890",
|
||||
"name": "John Doe",
|
||||
"iat": "${(new Date()).toISOString()}"
|
||||
}`);
|
||||
const footer = ref('{}');
|
||||
|
||||
const localKey = ref('');
|
||||
const addExp = ref(true);
|
||||
const addIat = ref(true);
|
||||
const validatePayload = ref(true);
|
||||
|
||||
function generateLocalKey() {
|
||||
localKey.value = generateKeys('local');
|
||||
}
|
||||
generateLocalKey();
|
||||
|
||||
const encryptedToken = computedAsync(async () => {
|
||||
const localKeyValue = localKey.value;
|
||||
const payloadValue = payload.value;
|
||||
const addExpValue = addExp.value;
|
||||
const addIatValue = addIat.value;
|
||||
const footerValue = footer.value;
|
||||
const validatePayloadValue = validatePayload.value;
|
||||
try {
|
||||
const token = await encrypt(
|
||||
localKeyValue,
|
||||
payloadValue,
|
||||
{
|
||||
addExp: addExpValue,
|
||||
addIat: addIatValue,
|
||||
footer: footerValue,
|
||||
validatePayload: validatePayloadValue,
|
||||
},
|
||||
);
|
||||
return {
|
||||
token,
|
||||
error: '',
|
||||
};
|
||||
}
|
||||
catch (e: any) {
|
||||
return { error: e.toString(), token: '' };
|
||||
}
|
||||
});
|
||||
|
||||
const jsonInputValidation = useValidation({
|
||||
source: payload,
|
||||
rules: [
|
||||
{
|
||||
message: 'Invalid JSON string',
|
||||
validator: value => JSON5.parse(value),
|
||||
},
|
||||
],
|
||||
});
|
||||
const jsonFooterValidation = useValidation({
|
||||
source: footer,
|
||||
rules: [
|
||||
{
|
||||
message: 'Invalid JSON string',
|
||||
validator: value => JSON5.parse(value),
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
const token = ref('');
|
||||
const decryptedToken = computedAsync(async () => {
|
||||
const localKeyValue = localKey.value;
|
||||
const tokenValue = token.value;
|
||||
const validatePayloadValue = validatePayload.value;
|
||||
try {
|
||||
// generic type parameter is optional but will give you type safety on the payload
|
||||
const { payload, footer } = await decrypt<any>(
|
||||
localKeyValue,
|
||||
tokenValue,
|
||||
{
|
||||
validatePayload: validatePayloadValue,
|
||||
},
|
||||
);
|
||||
return {
|
||||
payload,
|
||||
footer,
|
||||
error: '',
|
||||
};
|
||||
}
|
||||
catch (e: any) {
|
||||
return { error: e.toString(), payload: '', footer: '' };
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<c-card title="Local Key" mb-2>
|
||||
<c-input-text
|
||||
v-model:value="localKey"
|
||||
label="Local Key:"
|
||||
label-position="left"
|
||||
placeholder="PASERK local key k4.local.xxxx"
|
||||
mb-2
|
||||
/>
|
||||
<div flex justify-center>
|
||||
<n-button @click="generateLocalKey()">
|
||||
Refresh Key
|
||||
</n-button>
|
||||
</div>
|
||||
</c-card>
|
||||
|
||||
<c-card title="Encryption" mb-2>
|
||||
<c-input-text
|
||||
v-model:value="payload"
|
||||
label="Payload:"
|
||||
multiline
|
||||
rows="5"
|
||||
autosize
|
||||
placeholder="JSON payload"
|
||||
:validation="jsonInputValidation"
|
||||
/>
|
||||
<n-space justify="center">
|
||||
<n-form-item label="Validate Payload" label-placement="left">
|
||||
<n-switch v-model:value="validatePayload" />
|
||||
</n-form-item>
|
||||
<n-form-item label="Add Exp" label-placement="left">
|
||||
<n-switch v-model:value="addExp" />
|
||||
</n-form-item>
|
||||
<n-form-item label="Add IAT" label-placement="left">
|
||||
<n-switch v-model:value="addIat" />
|
||||
</n-form-item>
|
||||
</n-space>
|
||||
|
||||
<c-input-text
|
||||
v-model:value="footer"
|
||||
label="Footer:"
|
||||
multiline
|
||||
rows="2"
|
||||
autosize
|
||||
placeholder="JSON footer"
|
||||
:validation="jsonFooterValidation"
|
||||
mb-2
|
||||
/>
|
||||
|
||||
<c-card v-if="encryptedToken" title="Generated PASERK Token:" mb-2>
|
||||
<textarea-copyable v-if="encryptedToken.token" :value="encryptedToken.token" word-wrap />
|
||||
<c-alert v-if="encryptedToken.error">
|
||||
{{ encryptedToken.error }}
|
||||
</c-alert>
|
||||
</c-card>
|
||||
</c-card>
|
||||
|
||||
<c-card title="Decryption" mb-2>
|
||||
<c-input-text
|
||||
v-model:value="token"
|
||||
label="Token:"
|
||||
multiline
|
||||
rows="5"
|
||||
autosize
|
||||
placeholder="PASERK token"
|
||||
/>
|
||||
<n-space justify="center">
|
||||
<n-form-item label="Validate Payload" label-placement="left">
|
||||
<n-checkbox v-model:checked="validatePayload" />
|
||||
</n-form-item>
|
||||
</n-space>
|
||||
|
||||
<c-card v-if="decryptedToken" title="Decoded PASERK:" mb-2>
|
||||
<n-form-item v-if="decryptedToken.payload" label="Payload:">
|
||||
<textarea-copyable :value="JSON.stringify(decryptedToken.payload, null, 2)" word-wrap />
|
||||
</n-form-item>
|
||||
<n-form-item v-if="decryptedToken.footer" label="Footer:">
|
||||
<textarea-copyable :value="JSON.stringify(decryptedToken.footer, null, 2)" word-wrap />
|
||||
</n-form-item>
|
||||
<c-alert v-if="decryptedToken.error">
|
||||
{{ decryptedToken.error }}
|
||||
</c-alert>
|
||||
</c-card>
|
||||
</c-card>
|
||||
</div>
|
||||
</template>
|
||||
@@ -0,0 +1,13 @@
|
||||
import { Key } from '@vicons/tabler';
|
||||
import { defineTool } from '../tool';
|
||||
|
||||
export const tool = defineTool({
|
||||
name: 'Paseto/PASERK Public/Private',
|
||||
path: '/paseto-signing',
|
||||
description: 'Generate public/private key pairs and sign/verify payload',
|
||||
keywords: ['paseto', 'signing', 'verify', 'paserk', 'payload'],
|
||||
component: () => import('./paseto-signing.vue'),
|
||||
icon: Key,
|
||||
createdAt: new Date('2025-04-21'),
|
||||
category: 'Crypto',
|
||||
});
|
||||
@@ -0,0 +1,191 @@
|
||||
<script setup lang="ts">
|
||||
import JSON5 from 'json5';
|
||||
import { generateKeys, sign, verify } from 'paseto-ts/v4';
|
||||
import { useValidation } from '@/composable/validation';
|
||||
|
||||
const payload = ref(`{
|
||||
"sub": "1234567890",
|
||||
"name": "John Doe",
|
||||
"iat": "${(new Date()).toISOString()}"
|
||||
}`);
|
||||
const footer = ref('{}');
|
||||
|
||||
const secretKey = ref('');
|
||||
const publicKey = ref('');
|
||||
const addExp = ref(true);
|
||||
const addIat = ref(true);
|
||||
const validatePayload = ref(true);
|
||||
|
||||
function generateKeyPairs() {
|
||||
const keys = generateKeys('public');
|
||||
secretKey.value = keys.secretKey;
|
||||
publicKey.value = keys.publicKey;
|
||||
}
|
||||
generateKeyPairs();
|
||||
|
||||
const signedToken = computedAsync(async () => {
|
||||
const secretKeyValue = secretKey.value;
|
||||
const payloadValue = payload.value;
|
||||
const addExpValue = addExp.value;
|
||||
const addIatValue = addIat.value;
|
||||
const footerValue = footer.value;
|
||||
const validatePayloadValue = validatePayload.value;
|
||||
try {
|
||||
const token = await sign(
|
||||
secretKeyValue,
|
||||
payloadValue,
|
||||
{
|
||||
addExp: addExpValue,
|
||||
addIat: addIatValue,
|
||||
footer: footerValue,
|
||||
validatePayload: validatePayloadValue,
|
||||
},
|
||||
);
|
||||
return {
|
||||
token,
|
||||
error: '',
|
||||
};
|
||||
}
|
||||
catch (e: any) {
|
||||
return { error: e.toString(), token: '' };
|
||||
}
|
||||
});
|
||||
|
||||
const jsonInputValidation = useValidation({
|
||||
source: payload,
|
||||
rules: [
|
||||
{
|
||||
message: 'Invalid JSON string',
|
||||
validator: value => JSON5.parse(value),
|
||||
},
|
||||
],
|
||||
});
|
||||
const jsonFooterValidation = useValidation({
|
||||
source: footer,
|
||||
rules: [
|
||||
{
|
||||
message: 'Invalid JSON string',
|
||||
validator: value => JSON5.parse(value),
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
const token = ref('');
|
||||
const verifiedToken = computedAsync(async () => {
|
||||
const publicKeyValue = publicKey.value;
|
||||
const tokenValue = token.value;
|
||||
const validatePayloadValue = validatePayload.value;
|
||||
try {
|
||||
// generic type parameter is optional but will give you type safety on the payload
|
||||
const { payload, footer } = await verify<any>(
|
||||
publicKeyValue,
|
||||
tokenValue,
|
||||
{
|
||||
validatePayload: validatePayloadValue,
|
||||
},
|
||||
);
|
||||
return {
|
||||
payload,
|
||||
footer,
|
||||
error: '',
|
||||
};
|
||||
}
|
||||
catch (e: any) {
|
||||
return { error: e.toString(), payload: '', footer: '' };
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<c-card title="Key Pairs" mb-2>
|
||||
<c-input-text
|
||||
v-model:value="secretKey"
|
||||
label="Secret Key:"
|
||||
label-position="left"
|
||||
placeholder="PASERK secret key k4.secret.xxxx"
|
||||
mb-1
|
||||
/>
|
||||
<c-input-text
|
||||
v-model:value="publicKey"
|
||||
label="Public Key:"
|
||||
label-position="left"
|
||||
placeholder="PASERK public key k4.public.xxxx"
|
||||
mb-1
|
||||
/>
|
||||
<div flex justify-center>
|
||||
<n-button @click="generateKeyPairs()">
|
||||
Refresh Key
|
||||
</n-button>
|
||||
</div>
|
||||
</c-card>
|
||||
|
||||
<c-card title="Signing" mb-2>
|
||||
<c-input-text
|
||||
v-model:value="payload"
|
||||
label="Payload:"
|
||||
multiline
|
||||
rows="5"
|
||||
autosize
|
||||
placeholder="JSON payload"
|
||||
:validation="jsonInputValidation"
|
||||
/>
|
||||
<n-space justify="center">
|
||||
<n-form-item label="Validate Payload" label-placement="left">
|
||||
<n-switch v-model:value="validatePayload" />
|
||||
</n-form-item>
|
||||
<n-form-item label="Add Exp" label-placement="left">
|
||||
<n-switch v-model:value="addExp" />
|
||||
</n-form-item>
|
||||
<n-form-item label="Add IAT" label-placement="left">
|
||||
<n-switch v-model:value="addIat" />
|
||||
</n-form-item>
|
||||
</n-space>
|
||||
|
||||
<c-input-text
|
||||
v-model:value="footer"
|
||||
label="Footer:"
|
||||
multiline
|
||||
rows="2"
|
||||
autosize
|
||||
placeholder="JSON footer"
|
||||
:validation="jsonFooterValidation"
|
||||
/>
|
||||
|
||||
<c-card v-if="signedToken" title="Signed PASERK Token:" mb-2>
|
||||
<textarea-copyable v-if="signedToken.token" :value="signedToken.token" word-wrap />
|
||||
<c-alert v-if="signedToken.error">
|
||||
{{ signedToken.error }}
|
||||
</c-alert>
|
||||
</c-card>
|
||||
</c-card>
|
||||
|
||||
<c-card title="Verifying" mb-2>
|
||||
<c-input-text
|
||||
v-model:value="token"
|
||||
label="Token:"
|
||||
multiline
|
||||
rows="5"
|
||||
autosize
|
||||
placeholder="PASERK token"
|
||||
/>
|
||||
<n-space justify="center">
|
||||
<n-form-item label="Validate Payload" label-placement="left">
|
||||
<n-switch v-model:value="validatePayload" />
|
||||
</n-form-item>
|
||||
</n-space>
|
||||
|
||||
<c-card v-if="verifiedToken" title="Verification result:" mb-2>
|
||||
<n-form-item v-if="verifiedToken.payload" label="Payload:">
|
||||
<textarea-copyable :value="JSON.stringify(verifiedToken.payload, null, 2)" word-wrap />
|
||||
</n-form-item>
|
||||
<n-form-item v-if="verifiedToken.footer" label="Footer:">
|
||||
<textarea-copyable :value="JSON.stringify(verifiedToken.footer, null, 2)" word-wrap />
|
||||
</n-form-item>
|
||||
<c-alert v-if="verifiedToken.error">
|
||||
{{ verifiedToken.error }}
|
||||
</c-alert>
|
||||
</c-card>
|
||||
</c-card>
|
||||
</div>
|
||||
</template>
|
||||
Vendored
+100
@@ -0,0 +1,100 @@
|
||||
declare module "paseto-ts/v4" {
|
||||
export type PasetoPurpose = 'local' | 'public';
|
||||
export type Assertion = {
|
||||
[key: string]: any;
|
||||
} | string | Uint8Array;
|
||||
export type Payload = {
|
||||
[key: string]: any;
|
||||
iss?: string;
|
||||
sub?: string;
|
||||
aud?: string;
|
||||
exp?: string;
|
||||
nbf?: string;
|
||||
jti?: string;
|
||||
iat?: string;
|
||||
};
|
||||
export type Footer = {
|
||||
[key: string]: any;
|
||||
kid?: string;
|
||||
wpk?: string;
|
||||
};
|
||||
export type GetRandomValues = (array: Uint8Array) => Uint8Array;
|
||||
|
||||
export interface PASERKPublicKeyPair {
|
||||
secretKey: string;
|
||||
publicKey: string;
|
||||
}
|
||||
export interface PASERKPublicKeyPairBuffer {
|
||||
secretKey: Uint8Array;
|
||||
publicKey: Uint8Array;
|
||||
}
|
||||
|
||||
export declare function generateKeys(purpose: 'local', opts?: {
|
||||
format?: 'paserk';
|
||||
getRandomValues?: GetRandomValues;
|
||||
}): string;
|
||||
export declare function generateKeys(purpose: 'local', opts?: {
|
||||
format?: 'buffer';
|
||||
getRandomValues?: GetRandomValues;
|
||||
}): Uint8Array;
|
||||
export declare function generateKeys(purpose: 'public', opts?: {
|
||||
format?: 'paserk';
|
||||
getRandomValues?: GetRandomValues;
|
||||
}): PASERKPublicKeyPair;
|
||||
export declare function generateKeys(purpose: 'public', opts?: {
|
||||
format?: 'buffer';
|
||||
getRandomValues?: GetRandomValues;
|
||||
}): PASERKPublicKeyPairBuffer;
|
||||
|
||||
export declare function decrypt<T extends {
|
||||
[key: string]: any;
|
||||
} = {
|
||||
[key: string]: any;
|
||||
}>(key: string | Uint8Array, token: string | Uint8Array, { assertion, maxDepth, maxKeys, validatePayload, }?: {
|
||||
assertion?: Assertion | string | Uint8Array;
|
||||
maxDepth?: number;
|
||||
maxKeys?: number;
|
||||
validatePayload?: boolean;
|
||||
}): {
|
||||
payload: Payload & T;
|
||||
footer: Footer | string;
|
||||
};
|
||||
|
||||
export declare function encrypt(key: string | Uint8Array, payload: Payload | string | Uint8Array, { footer, assertion, addIat, addExp, maxDepth, maxKeys, validatePayload, getRandomValues, }?: {
|
||||
footer?: Footer | string | Uint8Array;
|
||||
assertion?: Assertion | string | Uint8Array;
|
||||
addIat?: boolean;
|
||||
addExp?: boolean;
|
||||
maxDepth?: number;
|
||||
maxKeys?: number;
|
||||
validatePayload?: boolean;
|
||||
getRandomValues?: GetRandomValues;
|
||||
}): string;
|
||||
|
||||
export declare function sign(key: string | Uint8Array, payload: Payload | string | Uint8Array, { footer, assertion, addExp, // Add an exp claim if one is not provided: https://github.com/paseto-standard/paseto-spec/blob/master/docs/02-Implementation-Guide/05-API-UX.md#default-expiration-claims
|
||||
addIat, // Add an iat claim if one is not provided
|
||||
maxDepth, // Maximum depth of nested objects
|
||||
maxKeys, // Maximum number of keys in an object
|
||||
validatePayload, }?: {
|
||||
footer?: Footer | string | Uint8Array;
|
||||
assertion?: Assertion | string | Uint8Array;
|
||||
addExp?: boolean;
|
||||
addIat?: boolean;
|
||||
maxDepth?: number;
|
||||
maxKeys?: number;
|
||||
validatePayload?: boolean;
|
||||
}): string;
|
||||
export declare function verify<T extends {
|
||||
[key: string]: any;
|
||||
} = {
|
||||
[key: string]: any;
|
||||
}>(key: string | Uint8Array, token: string | Uint8Array, { assertion, maxDepth, maxKeys, validatePayload, }?: {
|
||||
assertion?: Assertion | string | Uint8Array;
|
||||
maxDepth?: number;
|
||||
maxKeys?: number;
|
||||
validatePayload?: boolean;
|
||||
}): {
|
||||
payload: Payload & T;
|
||||
footer?: Footer | string;
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
import { FileImport } from '@vicons/tabler';
|
||||
import { defineTool } from '../tool';
|
||||
|
||||
export const tool = defineTool({
|
||||
name: 'Pdf Concatener',
|
||||
path: '/pdf-concat',
|
||||
description: 'Concatenate PDF into a single one',
|
||||
keywords: ['pdf', 'concat'],
|
||||
component: () => import('./pdf-concat.vue'),
|
||||
icon: FileImport,
|
||||
createdAt: new Date('2025-03-09'),
|
||||
category: 'PDF',
|
||||
});
|
||||
Loaded 100 of 142 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user