mirror of
https://github.com/sharevb/it-tools.git
synced 2026-11-24 14:50:17 +03:00
Compare commits
84
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
262bb109f2 | ||
|
|
c133a76c49 | ||
|
|
5ed43a0a2b | ||
|
|
a87559696c | ||
|
|
2b9f4f84da | ||
|
|
5943dc4ec5 | ||
|
|
617bd37ee3 | ||
|
|
342399ce45 | ||
|
|
6fd3c6b695 | ||
|
|
e6cbe0884d | ||
|
|
ac08813407 | ||
|
|
8fad71868a | ||
|
|
cb0725dc7c | ||
|
|
801e3d52d1 | ||
|
|
6e525b92c7 | ||
|
|
9e2eca25c4 | ||
|
|
acaa5d7ccd | ||
|
|
057999596d | ||
|
|
f0d2347ee2 | ||
|
|
99f4be60ec | ||
|
|
7955f5013d | ||
|
|
f811b996dd | ||
|
|
811e52f5bd | ||
|
|
27818151e7 | ||
|
|
2461cba237 | ||
|
|
6e901196fe | ||
|
|
484729cdbe | ||
|
|
835ff8d428 | ||
|
|
86683d81d6 | ||
|
|
ecb81ec535 | ||
|
|
fb9ddb02c4 | ||
|
|
a4af330721 | ||
|
|
6737df4be1 | ||
|
|
4db9743221 | ||
|
|
c25ec86546 | ||
|
|
6af606be55 | ||
|
|
3763f9e076 | ||
|
|
23581a34b0 | ||
|
|
b24021771b | ||
|
|
504cbe1c23 | ||
|
|
475a86ab52 | ||
|
|
461dabf362 | ||
|
|
a3161e9afe | ||
|
|
c7d77e1b6b | ||
|
|
8c97e191f4 | ||
|
|
102cfce37b | ||
|
|
58db3b3397 | ||
|
|
6aa69eb39d | ||
|
|
4df614eeec | ||
|
|
5d8b28d36b | ||
|
|
3fc1614ce0 | ||
|
|
b7a28dbfaa | ||
|
|
29c14837b6 | ||
|
|
5dd16d4b49 | ||
|
|
bc7166324a | ||
|
|
4a148b5cf2 | ||
|
|
73483fa736 | ||
|
|
b3fb940d20 | ||
|
|
c156222e52 | ||
|
|
20f484c561 | ||
|
|
814bae2897 | ||
|
|
ba5c95024c | ||
|
|
a18259595e | ||
|
|
935600c969 | ||
|
|
8873b9d0a1 | ||
|
|
c8f0d53821 | ||
|
|
c1b0694097 | ||
|
|
9f52df1197 | ||
|
|
75637340a2 | ||
|
|
01928b3ad9 | ||
|
|
fb99fb24c7 | ||
|
|
8a89a78830 | ||
|
|
3ba3b222ad | ||
|
|
7516aae2c1 | ||
|
|
aab0e2eb18 | ||
|
|
c1d962c9b9 | ||
|
|
c30d598d77 | ||
|
|
3f8d2db9b9 | ||
|
|
20251116c3 | ||
|
|
a7776baa1a | ||
|
|
f6411f862c | ||
|
|
2c2643b14c | ||
|
|
087860c472 | ||
|
|
de2de50769 |
No files matched your search
@@ -24,7 +24,7 @@ jobs:
|
||||
cache: 'pnpm'
|
||||
|
||||
- name: Install dependencies
|
||||
run: pnpm i
|
||||
run: pnpm i --ignore-scripts
|
||||
|
||||
- name: Run linters
|
||||
run: pnpm lint
|
||||
|
||||
@@ -44,7 +44,7 @@ jobs:
|
||||
cache: 'pnpm'
|
||||
|
||||
- name: Install dependencies
|
||||
run: pnpm i
|
||||
run: pnpm i --ignore-scripts
|
||||
|
||||
- name: Run linters
|
||||
run: pnpm lint
|
||||
|
||||
@@ -26,7 +26,7 @@ jobs:
|
||||
cache: 'pnpm'
|
||||
|
||||
- name: Install dependencies
|
||||
run: pnpm i
|
||||
run: pnpm i --ignore-scripts
|
||||
|
||||
- name: Run linters
|
||||
run: pnpm lint
|
||||
|
||||
@@ -26,7 +26,7 @@ jobs:
|
||||
cache: 'pnpm'
|
||||
|
||||
- name: Install dependencies
|
||||
run: pnpm i
|
||||
run: pnpm i --ignore-scripts
|
||||
|
||||
- name: Run linters
|
||||
run: pnpm lint
|
||||
|
||||
@@ -31,7 +31,7 @@ jobs:
|
||||
run: echo "PLAYWRIGHT_VERSION=$(jq -r .dependencies.playwright package.json)" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Install dependencies
|
||||
run: pnpm install
|
||||
run: pnpm install --ignore-scripts
|
||||
|
||||
- name: Build app
|
||||
run: pnpm build
|
||||
|
||||
@@ -48,8 +48,10 @@ jobs:
|
||||
push: true
|
||||
tags: |
|
||||
sharevb/it-tools:baseurl-it-tools
|
||||
sharevb/it-tools:stable-baseurl-it-tools
|
||||
sharevb/it-tools:${{ env.RELEASE_VERSION}}-baseurl-it-tools
|
||||
ghcr.io/sharevb/it-tools:baseurl-it-tools
|
||||
ghcr.io/sharevb/it-tools:stable-baseurl-it-tools
|
||||
ghcr.io/sharevb/it-tools:${{ env.RELEASE_VERSION}}-baseurl-it-tools
|
||||
|
||||
- name: Build and push
|
||||
@@ -61,8 +63,10 @@ jobs:
|
||||
push: true
|
||||
tags: |
|
||||
sharevb/it-tools:latest
|
||||
sharevb/it-tools:stable
|
||||
sharevb/it-tools:${{ env.RELEASE_VERSION}}
|
||||
ghcr.io/sharevb/it-tools:latest
|
||||
ghcr.io/sharevb/it-tools:stable
|
||||
ghcr.io/sharevb/it-tools:${{ env.RELEASE_VERSION}}
|
||||
|
||||
github-release:
|
||||
@@ -88,7 +92,7 @@ jobs:
|
||||
cache: 'pnpm'
|
||||
|
||||
- name: Install dependencies
|
||||
run: pnpm i
|
||||
run: pnpm i --ignore-scripts
|
||||
|
||||
- name: Build the app
|
||||
run: pnpm build
|
||||
@@ -117,10 +121,12 @@ jobs:
|
||||
|
||||
- Docker Hub Registry
|
||||
- `sharevb/it-tools:latest`
|
||||
- `sharevb/it-tools:stable`
|
||||
- `sharevb/it-tools:${{ env.RELEASE_VERSION}}`
|
||||
|
||||
- GitHub Container Registry
|
||||
- `ghcr.io/sharevb/it-tools:latest`
|
||||
- `ghcr.io/sharevb/it-tools:stable`
|
||||
- `ghcr.io/sharevb/it-tools:${{ env.RELEASE_VERSION}}`
|
||||
|
||||
## Changelog
|
||||
|
||||
@@ -3,6 +3,7 @@ env:
|
||||
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
|
||||
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
|
||||
VITE_VERCEL_ENV: preview
|
||||
VITE_VERCEL_DEPLOY: true
|
||||
on:
|
||||
push:
|
||||
branches-ignore:
|
||||
|
||||
@@ -3,6 +3,7 @@ env:
|
||||
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
|
||||
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
|
||||
VITE_VERCEL_ENV: production
|
||||
VITE_VERCEL_DEPLOY: true
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
|
||||
+106
@@ -2,6 +2,112 @@
|
||||
|
||||
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
||||
|
||||
## Version 2025.12.07
|
||||
|
||||
### Features
|
||||
- Custom External Tools (801e3d5)
|
||||
- **new tool**: Argon2 Hasher (6e525b9)
|
||||
- **new tool**: GitIgnore Generator (9e2eca2)
|
||||
- **Url Parser**: add Open URL button for url params that contains xxx:// (acaa5d7)
|
||||
- **JSON Viewer**: add repair search keyword (0579995)
|
||||
- **JSON Linter**: add auto repair option (f0d2347)
|
||||
- **new tool**: IP Subnets Lister (99f4be6)
|
||||
- **Lorem Ipsum Generators**: add a Print to PDF button (7955f50)
|
||||
- **unicode-search**: Added ability to search using unicode characters (#213) (2781815)
|
||||
- **new tool**: Shamir's Secret Sharing (2461cba)
|
||||
- **new tool**: Short Urls expander (6e90119)
|
||||
- **new tool**: Markdown Lorem Ipsum generator (484729c)
|
||||
- **new tool**: CSS Units Converter (835ff8d)
|
||||
- **new tool**: CSS Gradient Generator (86683d8)
|
||||
- **HTML to Markdown**: heading and emphasis variants (fb9ddb0)
|
||||
- **new tool**: Pdf Compressor (4db9743)
|
||||
- **Docker Compose to Docker Run**: add multiline options (6af606b)
|
||||
- **JWT Generator**: allow to paste an existing token to edit (23581a3)
|
||||
- **new tools**: JSON to TOON, TOON to JSON (b240217)
|
||||
- **JWT Parser**: secret encoding (text, hex array or base64) (504cbe1)
|
||||
- **JWT Generator**: handle secret encodings (base64, hex array or text) (475a86a)
|
||||
- **Many Units Converter**: references other units conversion (6aa69eb)
|
||||
- **new tool**: Binary Calculator (4df614e)
|
||||
- **new tool**: EMV TLV Parser (5d8b28d)
|
||||
- **new tool**: ETH Transaction Decoder (3fc1614)
|
||||
- **new tool**: JSON <> Message Pack (b7a28db)
|
||||
- **new tool**: File Splitter (json, txt, xml) (29c1483)
|
||||
- **new tool**: Serial Terminal (5dd16d4)
|
||||
- **new tool**: Docker Compose to .env file (bc71663)
|
||||
- **JSON Linter**: add copyable formatted json (4a148b5)
|
||||
- **Keycode Info**: add scancodes (73483fa)
|
||||
- **Chmod Calculator**: add a cheatsheet (b3fb940)
|
||||
- **new tool**: I or L checker (c156222)
|
||||
- **Base64 File Converter**: add paste-image (935600c)
|
||||
|
||||
### Bug fixes
|
||||
- **Text Statistics**: word counts for only spaces (e6cbe08)
|
||||
- **token-generator**: add the missing character 'N' & 'n' (#221) (ac08813)
|
||||
- **JSON DIff**: wrap and indent diffs (8fad718)
|
||||
- remove sponsor banner (cb0725d)
|
||||
- **dBm mW Converter**: change category (ecb81ec)
|
||||
- **Text Diff**: sticky overlap fix (a4af330)
|
||||
- **Port Numbers**: unknown port throws (3763f9e)
|
||||
- invalid watch callback (461dabf)
|
||||
- **CRC Calculator**: input text watcher was wrong (a3161e9)
|
||||
- router-link color contrast (c7d77e1)
|
||||
- **Translate Missings Script**: ensure format of en.yml (8c97e19)
|
||||
- remove Credit Card Generator as usage could be malicious (814bae2)
|
||||
- **Image Formats Converter**: add SVG in keywords (ba5c950)
|
||||
- **Vite/PWA**: on vite preload error, reload (a182595)
|
||||
- **Data Storage Converter**: make precision even for 1.00 (c8f0d53)
|
||||
|
||||
### Chores
|
||||
- overrides @vueuse/shared (811e52f)
|
||||
- **Vercel**: ensure no cache for index.html (6737df4)
|
||||
- clean qpdf (c25ec86)
|
||||
- **Vercel**: limit PWA precaching to avoid Fast Data Transfer exceed (20f484c)
|
||||
- **Build**: ignore scripts (8873b9d)
|
||||
|
||||
### Other
|
||||
- Use async versions of bcrypt methods to avoid freezing browser tab (#204) (102cfce)
|
||||
|
||||
### I18n
|
||||
- translate all (6fd3c6b)
|
||||
|
||||
### Merge branch 'chore/all-my-stuffs' of https
|
||||
- //github.com/sharevb/it-tools into chore/all-my-stuffs (f811b99)
|
||||
|
||||
### Documentation
|
||||
- spelling updates and quadlet instructions (#203) (58db3b3)
|
||||
|
||||
### Fixup! chore
|
||||
- optimize unit test memory use (c1b0694)
|
||||
|
||||
## Version 2025.10.19
|
||||
|
||||
### Features
|
||||
- **Script**: add a translation script for missing translations (a7776ba)
|
||||
|
||||
### Bug fixes
|
||||
- **Scripts**: remove target languages unused + keep line break (8a89a78)
|
||||
- **Scripts**: translate only if missing + handle ' (7516aae)
|
||||
- **Scripts**: extract string, avoid if has already t() + /* NO EXTRACT SCRIPT */ (c30d598)
|
||||
- **i18n**: wrong input-label,... text extractions (2025111)
|
||||
- **Tools Filtering**: filter tools everywhere (2c2643b)
|
||||
- **JSON Diff**: display removed original text (de2de50)
|
||||
|
||||
### Chores
|
||||
- update some deps (01928b3)
|
||||
- optimize unit test memory use (fb99fb2)
|
||||
- add script:translate-missing (3f8d2db)
|
||||
- add a stable tag on release (f6411f8)
|
||||
- add buymeacoffee (087860c)
|
||||
|
||||
### Other
|
||||
- Update fr.yml fix few punctuations (#201) (c1d962c)
|
||||
|
||||
### I18n
|
||||
- auto translatte missing + add da, it, nl, tr, kr (3ba3b22)
|
||||
|
||||
### Merge branch 'chore/all-my-stuffs' of https
|
||||
- //github.com/sharevb/it-tools into chore/all-my-stuffs (aab0e2e)
|
||||
|
||||
## Version 2025.10.12
|
||||
|
||||
### Features
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@ RUN apk add --update python3 make g++\
|
||||
|
||||
WORKDIR /app
|
||||
COPY package.json pnpm-lock.yaml ./
|
||||
RUN npm install -g pnpm && pnpm i --frozen-lockfile
|
||||
RUN npm install -g pnpm && pnpm i --ignore-scripts --frozen-lockfile
|
||||
COPY . .
|
||||
ARG BASE_URL
|
||||
ENV BASE_URL=${BASE_URL}
|
||||
|
||||
@@ -1,18 +1,20 @@
|
||||
## BREAKING CHANGE for Docker Image
|
||||
## BREAKING CHANGE for Container Image
|
||||
|
||||
Since *Docker base image* is now `nginx-unpriviledged`, docker image now listen to **8080** and no more 80. So you need to update your port mapping, ie from `8080:80` to `8080:8080`.
|
||||
Since the *base image* is now `nginx-unpriviledged` the container will now listen to port **8080** and not 80. So you need to update your port mapping, i.e. from `8080:80` to `8080:8080`.
|
||||
|
||||
Docker image listen to IPv6, so it needs to be enabled: https://serverfault.com/questions/1147296/how-to-enable-ipv6-on-ubuntu-20-04. Alternatively, you can mount your own `nginx.conf` own using docker option `-v "./nginx.conf:/etc/nginx/conf.d/nginx.conf"` (with `listen [::]:8080;` removed)
|
||||
If the container needs to listen to IPv6, it needs to be enabled: https://serverfault.com/questions/1147296/how-to-enable-ipv6-on-ubuntu-20-04. Alternatively, you can mount your own `nginx.conf` own using docker option `-v "./nginx.conf:/etc/nginx/conf.d/nginx.conf"` (with `listen [::]:8080;` removed)
|
||||
|
||||
## PR Welcome
|
||||
|
||||
Especially for UI improvements and translation. And for anything else.
|
||||
|
||||
## HTTPS is recommanded
|
||||
Want to support this fork of IT Tools: [Buy me a coffee](https://www.buymeacoffee.com/sharevb)
|
||||
|
||||
## HTTPS is recommended
|
||||
|
||||
Some tools like PGP encryption rely on WebCrypto API that is only available in HTTPS/SSL. Also, if you want to use PWA, HTTPS is required.
|
||||
|
||||
So even on internal installations, you can enable HTTPS using Let's Encrypt using DNS Challenge
|
||||
So even on internal installations, you should enable HTTPS using Let's Encrypt using DNS Challenge
|
||||
|
||||
Some docs about DNS Challenge:
|
||||
- https://medium.com/@life-is-short-so-enjoy-it/homelab-nginx-proxy-manager-setup-ssl-certificate-with-domain-name-in-cloudflare-dns-732af64ddc0b
|
||||
@@ -23,7 +25,7 @@ Related doc for CyberPanel: https://community.cyberpanel.net/t/reverse-proxy-tra
|
||||
|
||||
### Check out these change here: <https://sharevb-it-tools.vercel.app/> or <https://sharevb.github.io/it-tools/>
|
||||
|
||||
You can use my image in your docker-compose file if you want an update to date version of it-tools (with my PR and some of others) until the main branch has been updated.
|
||||
You can use my image in your docker-compose/quadlet file if you want an up-to-date version of it-tools (with my PR and some of others) until the main branch has been updated.
|
||||
|
||||
- github action triggers on every push to this branch - [view package here](https://github.com/sharevb/it-tools/pkgs/container/it-tools)
|
||||
|
||||
@@ -37,13 +39,13 @@ Big thanks to all the people who have already contributed!
|
||||
|
||||
## Development under Windows
|
||||
|
||||
Use of WSL2 is recommanded to develop using VSCode on Windows. Direct development is tricky (because of some dependencies)
|
||||
Use of WSL2 is recommended to develop using VSCode on Windows. Direct development is tricky (because of some dependencies)
|
||||
|
||||
## Added features
|
||||
|
||||
Almost [all tools PR of it-tools](https://github.com/sharevb/it-tools/pulls).
|
||||
|
||||
## Docker images
|
||||
## Container images
|
||||
|
||||
[GitHub Container Registry](https://github.com/sharevb/it-tools/pkgs/container/it-tools): `ghcr.io/sharevb/it-tools:latest`
|
||||
|
||||
@@ -62,6 +64,27 @@ services:
|
||||
- 8080:8080
|
||||
```
|
||||
|
||||
## Use in Podman Quadlet file
|
||||
|
||||
```
|
||||
[Unit]
|
||||
Description=IT Tools container
|
||||
After=network-online.target
|
||||
|
||||
[Container]
|
||||
AutoUpdate=registry
|
||||
Image=ghcr.io/sharevb/it-tools:latest
|
||||
PublishPort=8080:8080
|
||||
Label=io.containers.autoupdate=registry
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target default.target
|
||||
|
||||
[Service]
|
||||
Restart=always
|
||||
```
|
||||
|
||||
|
||||
## Filter tools and add home custom content
|
||||
|
||||
You can add custom content in Home page by mounting a `home.custom.md` in `/usr/share/nginx/html`.
|
||||
@@ -79,11 +102,38 @@ 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]
|
||||
|
||||
## Add custom external tools
|
||||
|
||||
You can add custom external tools (href or markdownContent) by mounting a `external-tools.json` in `/usr/share/nginx/html` with the following structure:
|
||||
|
||||
```json
|
||||
[
|
||||
{
|
||||
"name": "GitHub",
|
||||
"path": "/github",
|
||||
"description": "Link to Github",
|
||||
"keywords": ["github"],
|
||||
"category": "Links",
|
||||
"href": "https://github.com"
|
||||
},
|
||||
{
|
||||
"name": "Some text",
|
||||
"path": "/some-text",
|
||||
"description": "Some description",
|
||||
"keywords": ["some"],
|
||||
"category": "Links",
|
||||
"markdownContent": "Some useful **text**\n\nin *markdown*"
|
||||
}
|
||||
]
|
||||
```
|
||||
|
||||
See (docker-tools-filter-and-home-content)[https://github.com/sharevb/it-tools]
|
||||
|
||||
## Setting default tools parameters / default UI language at runtime
|
||||
|
||||
You can set default tools parameters by mounting a `tools-setting.json` in `/usr/share/nginx/html`.
|
||||
You can set default tool parameters by mounting a `tools-setting.json` in `/usr/share/nginx/html`.
|
||||
|
||||
It is a two level json, first level for `tool name`, second level for `parameter name`:
|
||||
It is a two level json, with the first level being for `tool name` and the second level for `parameter name`:
|
||||
```json
|
||||
{
|
||||
"regex-tester": {
|
||||
@@ -95,7 +145,7 @@ It is a two level json, first level for `tool name`, second level for `parameter
|
||||
```
|
||||
|
||||
You can find `tool name` and `parameter name` in the tools source code `src/tools` subfolder :
|
||||
- for pattern like `const global = useQueryParamOrStorage({ storageName: 'regex-tester:g', name: 'global', defaultValue: true });`:
|
||||
- example pattern for `const global = useQueryParamOrStorage({ storageName: 'regex-tester:g', name: 'global', defaultValue: true });`:
|
||||
```json
|
||||
{
|
||||
"regex-tester": {
|
||||
@@ -103,7 +153,7 @@ You can find `tool name` and `parameter name` in the tools source code `src/tool
|
||||
}
|
||||
}
|
||||
```
|
||||
- for pattern like `const value = useQueryParam({ tool: 'barcode-gen', name: 'text', defaultValue: '123456789' });`:
|
||||
- example pattern for `const value = useQueryParam({ tool: 'barcode-gen', name: 'text', defaultValue: '123456789' });`:
|
||||
```json
|
||||
{
|
||||
"barcode-gen": {
|
||||
@@ -111,7 +161,7 @@ You can find `tool name` and `parameter name` in the tools source code `src/tool
|
||||
}
|
||||
}
|
||||
```
|
||||
- for pattern like `const width = useITStorage('ascii-text-drawer:width', 80);`:
|
||||
- example pattern for `const width = useITStorage('ascii-text-drawer:width', 80);`:
|
||||
```json
|
||||
{
|
||||
"ascii-text-drawer": {
|
||||
@@ -120,7 +170,7 @@ You can find `tool name` and `parameter name` in the tools source code `src/tool
|
||||
}
|
||||
```
|
||||
|
||||
To define default UI language, add a `default_locale` key to json:
|
||||
To define the default UI language, add a `default_locale` key to json:
|
||||
```json
|
||||
{
|
||||
"default_locale": "fr"
|
||||
@@ -134,7 +184,7 @@ 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
|
||||
```
|
||||
|
||||
## Build docker image for a custom subfolder
|
||||
## Build container image for a custom subfolder
|
||||
|
||||
According to https://github.com/sharevb/it-tools/pull/461#issuecomment-1602506049 and https://github.com/CorentinTh/it-tools/pull/461:
|
||||
```
|
||||
@@ -150,10 +200,12 @@ So you would need to put another server in front of it, like [Nginx Proxy Manage
|
||||
|
||||
For `/it-tools/` subfolder, you can use `baseurl-it-tools` tag.
|
||||
|
||||
See [sample of docker-compose.yml and nginx.conf](https://github.com/sharevb/it-tools/docker-subfolder-sample), this docker image needs to have another reverse proxy in front of it, like [Nginx Proxy Manager](https://nginxproxymanager.com/), [Traefik](https://traefik.io/traefik/), [caddy](https://caddyserver.com/) etc.
|
||||
See [sample of docker-compose.yml and nginx.conf](https://github.com/sharevb/it-tools/tree/chore/all-my-stuffs/docker-subfolder-sample), this docker image needs to have another reverse proxy in front of it, like [Nginx Proxy Manager](https://nginxproxymanager.com/), [Traefik](https://traefik.io/traefik/), [caddy](https://caddyserver.com/) etc.
|
||||
|
||||
Setup a reverse proxy pass using `/it-tools/`. And you should be able to access it-tools in `/it-tools/` of your server.
|
||||
|
||||
An example of nginx reverse proxy configuration is available at: https://github.com/sharevb/it-tools/tree/chore/all-my-stuffs/docker-subfolder-sample
|
||||
|
||||
To run the sample:
|
||||
|
||||
```bash
|
||||
@@ -172,7 +224,7 @@ Then navigate to http://localhost:8080/it-tools/
|
||||
## To build for GitHub Pages:
|
||||
|
||||
1. Enable GitHub Pages build and deployment option in your fork, under **Settings** > **Pages** and select **GitHub Actions** as the source
|
||||
2. Add the following GitHub action to your repo: https://github.com/sharevb/it-tools/.github/workflows/sharevb-github-pages-publish.yml
|
||||
2. Add the following GitHub action to your repo: https://github.com/sharevb/it-tools/tree/chore/all-my-stuffs/.github/workflows/sharevb-github-pages-publish.yml
|
||||
|
||||
## To add authentication
|
||||
|
||||
@@ -221,7 +273,7 @@ If the standalone TypeScript plugin doesn't feel fast enough to you, Volar has a
|
||||
### Project Setup
|
||||
|
||||
```sh
|
||||
pnpm install
|
||||
pnpm install --ignore-scripts
|
||||
```
|
||||
|
||||
### Compile and Hot-Reload for Development
|
||||
@@ -262,9 +314,9 @@ It will create a directory in `src/tools` with the correct files, and a the impo
|
||||
|
||||
Local installation required installing first: `python3 make g++`
|
||||
|
||||
| Docker Image | Local Installation |
|
||||
| Container Image | Local Installation |
|
||||
|-----------------------------------------|-----------------------------------------------------------------------------------------------------------------------------|
|
||||
| GitHub Container Registry: <span title="triple click me!">`ghcr.io/sharevb/it-tools:latest`</span><br/>Docker Hub: <span title="triple click me!">`sharevb/it-tools:latest`</span> | <span title="triple click me!">`sudo apt-get install python3 make g++ && git clone -b chore/all-my-stuffs https://github.com/sharevb/it-tools.git && cd it-tools/ && pnpm i && pnpm dev`</span> |
|
||||
| GitHub Container Registry: <span title="triple click me!">`ghcr.io/sharevb/it-tools:latest`</span><br/>Docker Hub: <span title="triple click me!">`sharevb/it-tools:latest`</span> | <span title="triple click me!">`sudo apt-get install python3 make g++ && git clone -b chore/all-my-stuffs https://github.com/sharevb/it-tools.git && cd it-tools/ && pnpm i --ignore-scripts && pnpm dev`</span> |
|
||||
| replace your current image with this image | copy & paste oneliner (from github repo) |
|
||||
| You may need to clear cache and hard reload to get new features loading | Installing packages for the first time may take some time; please wait until it finishes |
|
||||
|
||||
|
||||
Vendored
+34
-1
@@ -5,7 +5,7 @@
|
||||
// Read more: https://github.com/vuejs/core/pull/3399
|
||||
import '@vue/runtime-core'
|
||||
|
||||
export {}
|
||||
export { }
|
||||
|
||||
declare module '@vue/runtime-core' {
|
||||
export interface GlobalComponents {
|
||||
@@ -36,6 +36,7 @@ declare module '@vue/runtime-core' {
|
||||
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']
|
||||
BinaryCalculator: typeof import('./src/tools/binary-calculator/binary-calculator.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']
|
||||
@@ -57,7 +58,9 @@ declare module '@vue/runtime-core' {
|
||||
CFileUpload: typeof import('./src/ui/c-file-upload/c-file-upload.vue')['default']
|
||||
'CFileUpload.demo': typeof import('./src/ui/c-file-upload/c-file-upload.demo.vue')['default']
|
||||
CharsetDetector: typeof import('./src/tools/charset-detector/charset-detector.vue')['default']
|
||||
Chmod: typeof import('./src/tools/chmod-memo/chmod.md')['default']
|
||||
ChmodCalculator: typeof import('./src/tools/chmod-calculator/chmod-calculator.vue')['default']
|
||||
ChmodMemo: typeof import('./src/tools/chmod-memo/chmod-memo.vue')['default']
|
||||
Chronometer: typeof import('./src/tools/chronometer/chronometer.vue')['default']
|
||||
CidrInCidr: typeof import('./src/tools/cidr-in-cidr/cidr-in-cidr.vue')['default']
|
||||
CInputText: typeof import('./src/ui/c-input-text/c-input-text.vue')['default']
|
||||
@@ -91,6 +94,8 @@ declare module '@vue/runtime-core' {
|
||||
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']
|
||||
CreditCardChecker: typeof import('./src/tools/credit-card-checker/credit-card-checker.vue')['default']
|
||||
CreditCardGenerator: typeof import('./src/tools/credit-card-generator/credit-card-generator.vue')['default']
|
||||
CronAlarm: typeof import('./src/tools/cron-alarm/cron-alarm.vue')['default']
|
||||
CrontabGenerator: typeof import('./src/tools/crontab-generator/crontab-generator.vue')['default']
|
||||
CSelect: typeof import('./src/ui/c-select/c-select.vue')['default']
|
||||
@@ -111,16 +116,19 @@ declare module '@vue/runtime-core' {
|
||||
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']
|
||||
DatabaseConnectionStringBuilder: typeof import('./src/tools/database-connection-string-builder/database-connection-string-builder.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']
|
||||
DateTimeConverter: typeof import('./src/tools/date-time-converter/date-time-converter.vue')['default']
|
||||
DaysCalculator: typeof import('./src/tools/days-calculator/days-calculator.vue')['default']
|
||||
DbmMwConverter: typeof import('./src/tools/dbm-mw-converter/dbm-mw-converter.vue')['default']
|
||||
'DemoHome.page': typeof import('./src/ui/demo/demo-home.page.vue')['default']
|
||||
DemoWrapper: typeof import('./src/ui/demo/demo-wrapper.vue')['default']
|
||||
DeviceInformation: typeof import('./src/tools/device-information/device-information.vue')['default']
|
||||
DiceRoller: typeof import('./src/tools/dice-roller/dice-roller.vue')['default']
|
||||
DicewareGenerator: typeof import('./src/tools/diceware-generator/diceware-generator.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']
|
||||
DjangoSecretGenerator: typeof import('./src/tools/django-secret-generator/django-secret-generator.vue')['default']
|
||||
@@ -134,6 +142,7 @@ declare module '@vue/runtime-core' {
|
||||
DockerComposeConverter: typeof import('./src/tools/docker-compose-converter/docker-compose-converter.vue')['default']
|
||||
DockerComposeMemo: typeof import('./src/tools/docker-compose-memo/docker-compose-memo.vue')['default']
|
||||
DockerComposeToDockerRunConverter: typeof import('./src/tools/docker-compose-to-docker-run-converter/docker-compose-to-docker-run-converter.vue')['default']
|
||||
DockerComposeToEnvFile: typeof import('./src/tools/docker-compose-to-env-file/docker-compose-to-env-file.vue')['default']
|
||||
DockerComposeToKubernetes: typeof import('./src/tools/docker-compose-to-kubernetes/docker-compose-to-kubernetes.vue')['default']
|
||||
DockerComposeToQuadlets: typeof import('./src/tools/docker-compose-to-quadlets/docker-compose-to-quadlets.vue')['default']
|
||||
DockerComposeValidator: typeof import('./src/tools/docker-compose-validator/docker-compose-validator.vue')['default']
|
||||
@@ -157,16 +166,20 @@ declare module '@vue/runtime-core' {
|
||||
EmojiCard: typeof import('./src/tools/emoji-picker/emoji-card.vue')['default']
|
||||
EmojiGrid: typeof import('./src/tools/emoji-picker/emoji-grid.vue')['default']
|
||||
EmojiPicker: typeof import('./src/tools/emoji-picker/emoji-picker.vue')['default']
|
||||
EmvTlvDecoder: typeof import('./src/tools/emv-tlv-decoder/emv-tlv-decoder.vue')['default']
|
||||
Encryption: typeof import('./src/tools/encryption/encryption.vue')['default']
|
||||
EnergyComputer: typeof import('./src/tools/energy-computer/energy-computer.vue')['default']
|
||||
EnergyConverter: typeof import('./src/tools/energy-converter/energy-converter.vue')['default']
|
||||
EnvVariablesConverter: typeof import('./src/tools/env-variables-converter/env-variables-converter.vue')['default']
|
||||
EtaCalculator: typeof import('./src/tools/eta-calculator/eta-calculator.vue')['default']
|
||||
EthTransactionDecoder: typeof import('./src/tools/eth-transaction-decoder/eth-transaction-decoder.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']
|
||||
FamilyTreeCalculator: typeof import('./src/tools/family-tree-calculator/family-tree-calculator.vue')['default']
|
||||
FaviconGenerator: typeof import('./src/tools/favicon-generator/favicon-generator.vue')['default']
|
||||
FavoriteButton: typeof import('./src/components/FavoriteButton.vue')['default']
|
||||
FileHasher: typeof import('./src/tools/file-hasher/file-hasher.vue')['default']
|
||||
FileSplitter: typeof import('./src/tools/file-splitter/file-splitter.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']
|
||||
@@ -184,8 +197,11 @@ declare module '@vue/runtime-core' {
|
||||
'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']
|
||||
GoTemplateRunner: typeof import('./src/tools/go-template-runner/go-template-runner.vue')['default']
|
||||
GptTokenEncoder: typeof import('./src/tools/gpt-token-encoder/gpt-token-encoder.vue')['default']
|
||||
GptTokenEstimator: typeof import('./src/tools/gpt-token-estimator/gpt-token-estimator.vue')['default']
|
||||
GraphqlBuilder: typeof import('./src/tools/graphql-builder/graphql-builder.vue')['default']
|
||||
GtinValidator: typeof import('./src/tools/gtin-validator/gtin-validator.vue')['default']
|
||||
GzipConverter: typeof import('./src/tools/gzip-converter/gzip-converter.vue')['default']
|
||||
HarSanitizer: typeof import('./src/tools/har-sanitizer/har-sanitizer.vue')['default']
|
||||
HashText: typeof import('./src/tools/hash-text/hash-text.vue')['default']
|
||||
@@ -206,6 +222,8 @@ declare module '@vue/runtime-core' {
|
||||
HtmlWysiwygEditor: typeof import('./src/tools/html-wysiwyg-editor/html-wysiwyg-editor.vue')['default']
|
||||
HtpasswdGenerator: typeof import('./src/tools/htpasswd-generator/htpasswd-generator.vue')['default']
|
||||
HttpStatusCodes: typeof import('./src/tools/http-status-codes/http-status-codes.vue')['default']
|
||||
IanaWhoisChecker: typeof import('./src/tools/iana-whois-checker/iana-whois-checker.vue')['default']
|
||||
IAndLChecker: typeof import('./src/tools/i-and-l-checker/i-and-l-checker.vue')['default']
|
||||
IbanValidatorAndParser: typeof import('./src/tools/iban-validator-and-parser/iban-validator-and-parser.vue')['default']
|
||||
IcalGenerator: typeof import('./src/tools/ical-generator/ical-generator.vue')['default']
|
||||
IcalMerger: typeof import('./src/tools/ical-merger/ical-merger.vue')['default']
|
||||
@@ -274,6 +292,7 @@ declare module '@vue/runtime-core' {
|
||||
JsonToGo: typeof import('./src/tools/json-to-go/json-to-go.vue')['default']
|
||||
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']
|
||||
JsonToMsgpack: typeof import('./src/tools/json-to-msgpack/json-to-msgpack.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']
|
||||
@@ -293,6 +312,7 @@ declare module '@vue/runtime-core' {
|
||||
JwtParser: typeof import('./src/tools/jwt-parser/jwt-parser.vue')['default']
|
||||
K8sMemo: typeof import('./src/tools/k8s-memo/k8s-memo.vue')['default']
|
||||
'K8sMemo.content': typeof import('./src/tools/k8s-memo/k8s-memo.content.md')['default']
|
||||
KeyboardLayoutConverter: typeof import('./src/tools/keyboard-layout-converter/keyboard-layout-converter.vue')['default']
|
||||
KeycodeInfo: typeof import('./src/tools/keycode-info/keycode-info.vue')['default']
|
||||
LengthConverter: typeof import('./src/tools/length-converter/length-converter.vue')['default']
|
||||
LevenshteinCalculator: typeof import('./src/tools/levenshtein-calculator/levenshtein-calculator.vue')['default']
|
||||
@@ -301,6 +321,7 @@ declare module '@vue/runtime-core' {
|
||||
LocaleSelector: typeof import('./src/modules/i18n/components/locale-selector.vue')['default']
|
||||
LogrotateGenerator: typeof import('./src/tools/logrotate-generator/logrotate-generator.vue')['default']
|
||||
LoremIpsumGenerator: typeof import('./src/tools/lorem-ipsum-generator/lorem-ipsum-generator.vue')['default']
|
||||
LtoLabelGenerator: typeof import('./src/tools/lto-label-generator/lto-label-generator.vue')['default']
|
||||
LuhnValidator: typeof import('./src/tools/luhn-validator/luhn-validator.vue')['default']
|
||||
MacAddressConverter: typeof import('./src/tools/mac-address-converter/mac-address-converter.vue')['default']
|
||||
MacAddressGenerator: typeof import('./src/tools/mac-address-generator/mac-address-generator.vue')['default']
|
||||
@@ -332,13 +353,16 @@ declare module '@vue/runtime-core' {
|
||||
ModeIconBar: typeof import('./src/tools/pomodoro-timer/app/components/ModeIconBar.vue')['default']
|
||||
MongoObjectidConverter: typeof import('./src/tools/mongo-objectid-converter/mongo-objectid-converter.vue')['default']
|
||||
MorseConverter: typeof import('./src/tools/morse-converter/morse-converter.vue')['default']
|
||||
MsgpackToJson: typeof import('./src/tools/msgpack-to-json/msgpack-to-json.vue')['default']
|
||||
MttdlCalculator: typeof import('./src/tools/mttdl-calculator/mttdl-calculator.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']
|
||||
NCheckbox: typeof import('naive-ui')['NCheckbox']
|
||||
NCode: typeof import('naive-ui')['NCode']
|
||||
NColorPicker: typeof import('naive-ui')['NColorPicker']
|
||||
@@ -354,6 +378,7 @@ declare module '@vue/runtime-core' {
|
||||
NGrid: typeof import('naive-ui')['NGrid']
|
||||
NH1: typeof import('naive-ui')['NH1']
|
||||
NH3: typeof import('naive-ui')['NH3']
|
||||
NicewareBytesToPassphrase: typeof import('./src/tools/niceware-bytes-to-passphrase/niceware-bytes-to-passphrase.vue')['default']
|
||||
NIcon: typeof import('naive-ui')['NIcon']
|
||||
NImage: typeof import('naive-ui')['NImage']
|
||||
NInputNumberI18n: typeof import('./src/ui/n-input-number-i18n/n-input-number-i18n.vue')['default']
|
||||
@@ -361,7 +386,12 @@ declare module '@vue/runtime-core' {
|
||||
NLayout: typeof import('naive-ui')['NLayout']
|
||||
NLayoutSider: typeof import('naive-ui')['NLayoutSider']
|
||||
NMenu: typeof import('naive-ui')['NMenu']
|
||||
NP: typeof import('naive-ui')['NP']
|
||||
NScrollbar: typeof import('naive-ui')['NScrollbar']
|
||||
NSelect: typeof import('naive-ui')['NSelect']
|
||||
NSpace: typeof import('naive-ui')['NSpace']
|
||||
NTable: typeof import('naive-ui')['NTable']
|
||||
NTag: typeof import('naive-ui')['NTag']
|
||||
NTooltip: typeof import('naive-ui')['NTooltip']
|
||||
NumberInput: typeof import('./src/tools/pomodoro-timer/app/components/NumberInput.vue')['default']
|
||||
NumeronymGenerator: typeof import('./src/tools/numeronym-generator/numeronym-generator.vue')['default']
|
||||
@@ -376,6 +406,7 @@ declare module '@vue/runtime-core' {
|
||||
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']
|
||||
PdfCompressor: typeof import('./src/tools/pdf-compressor/pdf-compressor.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']
|
||||
@@ -430,6 +461,7 @@ declare module '@vue/runtime-core' {
|
||||
SedCommandGenerator: typeof import('./src/tools/sed-command-generator/sed-command-generator.vue')['default']
|
||||
SedMemo: typeof import('./src/tools/sed-memo/sed-memo.vue')['default']
|
||||
SensitiveDataMasker: typeof import('./src/tools/sensitive-data-masker/sensitive-data-masker.vue')['default']
|
||||
SerialConsole: typeof import('./src/tools/serial-console/serial-console.vue')['default']
|
||||
Settings: typeof import('./src/tools/pomodoro-timer/app/views/Settings.vue')['default']
|
||||
SharepointDecoder: typeof import('./src/tools/sharepoint-decoder/sharepoint-decoder.vue')['default']
|
||||
SipAuth: typeof import('./src/tools/sip-auth/sip-auth.vue')['default']
|
||||
@@ -463,6 +495,7 @@ declare module '@vue/runtime-core' {
|
||||
TextToUnicodeNames: typeof import('./src/tools/text-to-unicode-names/text-to-unicode-names.vue')['default']
|
||||
TimeAlarm: typeof import('./src/tools/time-alarm/time-alarm.vue')['default']
|
||||
TimezoneConverter: typeof import('./src/tools/timezone-converter/timezone-converter.vue')['default']
|
||||
TLVTagTree: typeof import('./src/tools/emv-tlv-decoder/TLVTagTree.vue')['default']
|
||||
TokenDisplay: typeof import('./src/tools/otp-code-generator-and-validator/token-display.vue')['default']
|
||||
'TokenGenerator.tool': typeof import('./src/tools/token-generator/token-generator.tool.vue')['default']
|
||||
TomlLinter: typeof import('./src/tools/toml-linter/toml-linter.vue')['default']
|
||||
|
||||
@@ -9,6 +9,6 @@ services:
|
||||
depends_on:
|
||||
- it-tools
|
||||
volumes:
|
||||
- "./nginx.conf:/etc/nginx/conf.d/nginx.conf"
|
||||
- "./nginx.conf:/etc/nginx/conf.d/default.conf"
|
||||
ports:
|
||||
- 8080:8080
|
||||
- 80:80
|
||||
@@ -1,8 +1,11 @@
|
||||
server {
|
||||
listen 8080;
|
||||
listen 80;
|
||||
server_name _;
|
||||
|
||||
location /it-tools/ {
|
||||
proxy_pass http://it-tools-subfolder:8080/;
|
||||
}
|
||||
location /it-tools {
|
||||
return 301 /it-tools/;
|
||||
}
|
||||
}
|
||||
@@ -5,6 +5,7 @@ services:
|
||||
restart: unless-stopped
|
||||
volumes:
|
||||
- ./tools-filter.json:/usr/share/nginx/html/tools-filter.json
|
||||
- ./external-tools.json:/usr/share/nginx/html/external-tools.json
|
||||
- ./home.custom.md:/usr/share/nginx/html/home.custom.md
|
||||
ports:
|
||||
- 8080:8080
|
||||
@@ -0,0 +1,18 @@
|
||||
[
|
||||
{
|
||||
"name": "GitHub",
|
||||
"path": "/github",
|
||||
"description": "Link to Github",
|
||||
"keywords": ["github"],
|
||||
"category": "Links",
|
||||
"href": "https://github.com"
|
||||
},
|
||||
{
|
||||
"name": "Some text",
|
||||
"path": "/some-text",
|
||||
"description": "Some description",
|
||||
"keywords": ["some"],
|
||||
"category": "Links",
|
||||
"markdownContent": "Some useful **text**\n\nin *markdown*"
|
||||
}
|
||||
]
|
||||
+7013
-188
File diff suppressed because it is too large.
Load diff
+7430
File diff suppressed because it is too large.
Load diff
+7262
-215
File diff suppressed because it is too large.
Load diff
+402
-179
@@ -4,39 +4,6 @@
|
||||
maybe: Maybe the cache is doing tricky things, try force-refreshing?
|
||||
backHome: Back home
|
||||
about:
|
||||
content: >
|
||||
# About IT-Tools
|
||||
|
||||
This wonderful website, made with ❤ by [Corentin
|
||||
Thomasset](https://corentin.tech?utm_source=it-tools&utm_medium=about) ,
|
||||
aggregates useful tools for developer and people working in IT. If you find
|
||||
it useful, please feel free to share it to people you think may find it
|
||||
useful too and don't forget to bookmark it in your shortcut bar!
|
||||
|
||||
IT Tools is open-source (under the GPL-3.0 license) and free, and will
|
||||
always be, but it costs me money to host and renew the domain name. If you
|
||||
want to support my work, and encourage me to add more tools, please consider
|
||||
supporting by [sponsoring me](https://www.buymeacoffee.com/sharevb).
|
||||
|
||||
## Technologies
|
||||
|
||||
IT Tools is made in Vue.js (Vue 3) with the the Naive UI component library
|
||||
and is hosted and continuously deployed by Vercel. Third-party open-source
|
||||
libraries are used in some tools, you may find the complete list in the
|
||||
[package.json](https://github.com/sharevb/it-tools/blob/main/package.json)
|
||||
file of the repository.
|
||||
|
||||
## Found a bug? A tool is missing?
|
||||
|
||||
If you need a tool that is currently not present here, and you think can be
|
||||
useful, you are welcome to submit a feature request in the [issues
|
||||
section](https://github.com/sharevb/it-tools/issues/new/choose) in the
|
||||
GitHub repository.
|
||||
|
||||
And if you found a bug, or something doesn't work as expected, please file a
|
||||
bug report in the [issues
|
||||
section](https://github.com/sharevb/it-tools/issues/new/choose) in the
|
||||
GitHub repository.
|
||||
alltools-title: All {toolsCount} Tools
|
||||
tools:
|
||||
name: Name
|
||||
@@ -53,7 +20,9 @@ about:
|
||||
shortcut bar!
|
||||
|
||||
IT Tools is open-source (under the GPL-3.0 license) and free, and will
|
||||
always be, but it costs me money to host and renew the domain name.
|
||||
always be. If you want to support my work on this fork, and encourage me to
|
||||
add more tools or functionalities, please consider supporting by [sponsoring
|
||||
me](https://www.buymeacoffee.com/sharevb).
|
||||
|
||||
## Technologies
|
||||
|
||||
@@ -204,9 +173,6 @@ tools:
|
||||
input-label-your-raw-json: Your raw JSON
|
||||
input-placeholder-paste-your-raw-json-here: Paste your raw JSON here...
|
||||
output-label-csv-version-of-your-json: CSV version of your JSON
|
||||
label-t-tools-json-to-csv-texts-input-label-your-raw-json: t('tools.json-to-csv.texts.input-label-your-raw-json')
|
||||
placeholder-t-tools-json-to-csv-texts-input-placeholder-paste-your-raw-json-here: t('tools.json-to-csv.texts.input-placeholder-paste-your-raw-json-here')
|
||||
label-t-tools-json-to-csv-texts-output-label-csv-version-of-your-json: t('tools.json-to-csv.texts.output-label-csv-version-of-your-json')
|
||||
csv-to-json:
|
||||
title: CSV to JSON
|
||||
description: Convert CSV to JSON with automatic header detection.
|
||||
@@ -216,9 +182,6 @@ tools:
|
||||
input-label-your-raw-csv: Your raw CSV
|
||||
input-placeholder-paste-your-raw-csv-here: Paste your raw CSV here...
|
||||
output-label-json-version-of-your-csv: JSON version of your CSV
|
||||
label-t-tools-csv-to-json-texts-input-label-your-raw-csv: t('tools.csv-to-json.texts.input-label-your-raw-csv')
|
||||
placeholder-t-tools-csv-to-json-texts-input-placeholder-paste-your-raw-csv-here: t('tools.csv-to-json.texts.input-placeholder-paste-your-raw-csv-here')
|
||||
label-t-tools-csv-to-json-texts-output-label-json-version-of-your-csv: t('tools.csv-to-json.texts.output-label-json-version-of-your-csv')
|
||||
camera-recorder:
|
||||
title: Camera recorder
|
||||
description: Take a picture or record a video from your webcam or camera.
|
||||
@@ -248,6 +211,8 @@ tools:
|
||||
label-location: "Location :"
|
||||
label-modifiers: "Modifiers :"
|
||||
tag-press-the-key-on-your-keyboard-you-want-to-get-info-about-this-key: Press the key on your keyboard you want to get info about this key
|
||||
label-scancode: "Scancode (hex) :"
|
||||
label-scancode-dec: "Scancode (dec) :"
|
||||
bcrypt:
|
||||
title: Bcrypt
|
||||
description: Hash and compare text string using bcrypt. Bcrypt is a
|
||||
@@ -263,8 +228,14 @@ tools:
|
||||
placeholder-your-string-to-compare: Your string to compare...
|
||||
label-your-hash: "Your hash: "
|
||||
placeholder-your-hash-to-compare: Your hash to compare...
|
||||
label-do-they-match: "Do they match ? "
|
||||
tag-copy-hash: Copy hash
|
||||
hashed-string: Hashed string
|
||||
comparison-result: Comparison result
|
||||
matched: Matched
|
||||
no-match: No match
|
||||
timed-out-after-timeout-period: Timed out after {timeoutPeriod}
|
||||
hashed-in-elapsed-period: Hashed in {elapsedPeriod}
|
||||
compared-in-elapsed-period: Compared in {elapsedPeriod}
|
||||
crontab-generator:
|
||||
title: Crontab generator
|
||||
description: Validate and generate crontab and get the human-readable
|
||||
@@ -511,10 +482,6 @@ tools:
|
||||
input-label-your-input-data: Your input data
|
||||
input-placeholder-paste-your-input-data-here: Paste your input data here...
|
||||
output-label-your-transformed-data: Your transformed data
|
||||
label-t-tools-list-converter-texts-input-label-your-input-data: t('tools.list-converter.texts.input-label-your-input-data')
|
||||
placeholder-t-tools-list-converter-texts-input-placeholder-paste-your-input-data-here:
|
||||
t('tools.list-converter.texts.input-placeholder-paste-your-input-data-here')
|
||||
label-t-tools-list-converter-texts-output-label-your-transformed-data: t('tools.list-converter.texts.output-label-your-transformed-data')
|
||||
label-filter-item: Filter items by Regex
|
||||
placeholder-remove-item-filter-regex: Filter Regex
|
||||
placeholder-remove-item-not-filter-regex: Not Filter Regex
|
||||
@@ -547,9 +514,6 @@ tools:
|
||||
input-label-your-toml: Your TOML
|
||||
input-placeholder-paste-your-toml-here: Paste your TOML here...
|
||||
output-label-yaml-from-your-toml: YAML from your TOML
|
||||
label-t-tools-toml-to-yaml-texts-input-label-your-toml: t('tools.toml-to-yaml.texts.input-label-your-toml')
|
||||
placeholder-t-tools-toml-to-yaml-texts-input-placeholder-paste-your-toml-here: t('tools.toml-to-yaml.texts.input-placeholder-paste-your-toml-here')
|
||||
label-t-tools-toml-to-yaml-texts-output-label-yaml-from-your-toml: t('tools.toml-to-yaml.texts.output-label-yaml-from-your-toml')
|
||||
math-evaluator:
|
||||
title: Math evaluator
|
||||
description: A calculator for evaluating mathematical expressions. You can use
|
||||
@@ -565,10 +529,6 @@ tools:
|
||||
input-label-your-json: Your JSON
|
||||
input-placeholder-paste-your-json-here: Paste your JSON here...
|
||||
output-label-yaml-from-your-json: YAML from your JSON
|
||||
label-t-tools-json-to-yaml-converter-texts-input-label-your-json: t('tools.json-to-yaml-converter.texts.input-label-your-json')
|
||||
placeholder-t-tools-json-to-yaml-converter-texts-input-placeholder-paste-your-json-here:
|
||||
t('tools.json-to-yaml-converter.texts.input-placeholder-paste-your-json-here')
|
||||
label-t-tools-json-to-yaml-converter-texts-output-label-yaml-from-your-json: t('tools.json-to-yaml-converter.texts.output-label-yaml-from-your-json')
|
||||
json-to-javascript:
|
||||
title: JSON to JS converter
|
||||
description: Simply convert JSON to Javascript object with this live online converter.
|
||||
@@ -578,11 +538,6 @@ tools:
|
||||
input-label-your-json: Your JSON
|
||||
input-placeholder-paste-your-json-here: Paste your JSON here...
|
||||
output-label-javascript-object-from-your-json: JavaScript Object from your JSON
|
||||
label-t-tools-json-to-javascript-texts-input-label-your-json: t('tools.json-to-javascript.texts.input-label-your-json')
|
||||
placeholder-t-tools-json-to-javascript-texts-input-placeholder-paste-your-json-here:
|
||||
t('tools.json-to-javascript.texts.input-placeholder-paste-your-json-here')
|
||||
label-t-tools-json-to-javascript-texts-output-label-javascript-object-from-your-json:
|
||||
t('tools.json-to-javascript.texts.output-label-javascript-object-from-your-json')
|
||||
javascript-to-json:
|
||||
title: JS to JSON converter
|
||||
description: Simply convert Javascript object to JSON with this live online converter.
|
||||
@@ -592,11 +547,6 @@ tools:
|
||||
input-label-your-javascript-object: Your JavaScript Object
|
||||
input-placeholder-paste-your-js-object-here: Paste your JS Object here...
|
||||
output-label-json-from-your-javascript-object: JSON from your JavaScript Object
|
||||
label-t-tools-javascript-to-json-texts-input-label-your-javascript-object: t('tools.javascript-to-json.texts.input-label-your-javascript-object')
|
||||
placeholder-t-tools-javascript-to-json-texts-input-placeholder-paste-your-js-object-here:
|
||||
t('tools.javascript-to-json.texts.input-placeholder-paste-your-js-object-here')
|
||||
label-t-tools-javascript-to-json-texts-output-label-json-from-your-javascript-object:
|
||||
t('tools.javascript-to-json.texts.output-label-json-from-your-javascript-object')
|
||||
numeronym-generator:
|
||||
title: Numeronym generator
|
||||
description: A numeronym is a word where a number is used to form an
|
||||
@@ -696,9 +646,6 @@ tools:
|
||||
input-label-your-toml: Your TOML
|
||||
input-placeholder-paste-your-toml-here: Paste your TOML here...
|
||||
output-label-json-from-your-toml: JSON from your TOML
|
||||
label-t-tools-toml-to-json-texts-input-label-your-toml: t('tools.toml-to-json.texts.input-label-your-toml')
|
||||
placeholder-t-tools-toml-to-json-texts-input-placeholder-paste-your-toml-here: t('tools.toml-to-json.texts.input-placeholder-paste-your-toml-here')
|
||||
label-t-tools-toml-to-json-texts-output-label-json-from-your-toml: t('tools.toml-to-json.texts.output-label-json-from-your-toml')
|
||||
lorem-ipsum-generator:
|
||||
title: Lorem ipsum generator
|
||||
description: Lorem ipsum is a placeholder text commonly used to demonstrate the
|
||||
@@ -715,6 +662,7 @@ tools:
|
||||
placeholder-your-lorem-ipsum: Your lorem ipsum...
|
||||
tag-copy: Copy
|
||||
tag-refresh: Refresh
|
||||
tag-print-ie-use-a-pdf-printer-to-get-a-pdf-file: Print (ie, use a PDF Printer to get a PDF file)
|
||||
qrcode-generator:
|
||||
title: QR Code generator
|
||||
description: Generate and download a QR code for a URL (or just plain text), and
|
||||
@@ -741,9 +689,6 @@ tools:
|
||||
output-label-formatted-xml-from-your-xml: Formatted XML from your XML
|
||||
tag-foo: foo
|
||||
tag-bar: bar
|
||||
label-t-tools-xml-formatter-texts-input-label-your-xml: t('tools.xml-formatter.texts.input-label-your-xml')
|
||||
placeholder-t-tools-xml-formatter-texts-input-placeholder-paste-your-xml-here: t('tools.xml-formatter.texts.input-placeholder-paste-your-xml-here')
|
||||
label-t-tools-xml-formatter-texts-output-label-formatted-xml-from-your-xml: t('tools.xml-formatter.texts.output-label-formatted-xml-from-your-xml')
|
||||
temperature-converter:
|
||||
title: Temperature converter
|
||||
description: Degrees temperature conversions for Kelvin, Celsius, Fahrenheit,
|
||||
@@ -789,9 +734,6 @@ tools:
|
||||
input-label-your-yaml: Your YAML
|
||||
input-placeholder-paste-your-yaml-here: Paste your YAML here...
|
||||
output-label-toml-from-your-yaml: TOML from your YAML
|
||||
label-t-tools-yaml-to-toml-texts-input-label-your-yaml: t('tools.yaml-to-toml.texts.input-label-your-yaml')
|
||||
placeholder-t-tools-yaml-to-toml-texts-input-placeholder-paste-your-yaml-here: t('tools.yaml-to-toml.texts.input-placeholder-paste-your-yaml-here')
|
||||
label-t-tools-yaml-to-toml-texts-output-label-toml-from-your-yaml: t('tools.yaml-to-toml.texts.output-label-toml-from-your-yaml')
|
||||
json-diff:
|
||||
title: JSON diff
|
||||
description: Compare two JSON objects and get the differences between them.
|
||||
@@ -870,9 +812,6 @@ tools:
|
||||
input-label-your-json: Your JSON
|
||||
input-placeholder-paste-your-json-here: Paste your JSON here...
|
||||
output-label-toml-from-your-json: TOML from your JSON
|
||||
label-t-tools-json-to-toml-texts-input-label-your-json: t('tools.json-to-toml.texts.input-label-your-json')
|
||||
placeholder-t-tools-json-to-toml-texts-input-placeholder-paste-your-json-here: t('tools.json-to-toml.texts.input-placeholder-paste-your-json-here')
|
||||
label-t-tools-json-to-toml-texts-output-label-toml-from-your-json: t('tools.json-to-toml.texts.output-label-toml-from-your-json')
|
||||
json-to-ts:
|
||||
title: JSON to TS
|
||||
description: Parse and convert JSON to TS.
|
||||
@@ -881,9 +820,6 @@ tools:
|
||||
input-label-your-json: Your JSON
|
||||
input-placeholder-paste-your-json-here: Paste your JSON here...
|
||||
output-label-ts-from-your-json: TS from your JSON
|
||||
label-t-tools-json-to-ts-texts-input-label-your-json: t('tools.json-to-ts.texts.input-label-your-json')
|
||||
placeholder-t-tools-json-to-ts-texts-input-placeholder-paste-your-json-here: t('tools.json-to-ts.texts.input-placeholder-paste-your-json-here')
|
||||
label-t-tools-json-to-ts-texts-output-label-ts-from-your-json: t('tools.json-to-ts.texts.output-label-ts-from-your-json')
|
||||
device-information:
|
||||
title: Device information
|
||||
description: Get information about your current device (screen size,
|
||||
@@ -931,9 +867,6 @@ tools:
|
||||
input-label-your-raw-json: Your raw JSON
|
||||
input-placeholder-paste-your-raw-json-here: Paste your raw JSON here...
|
||||
output-label-minified-version-of-your-json: Minified version of your JSON
|
||||
label-t-tools-json-minify-texts-input-label-your-raw-json: t('tools.json-minify.texts.input-label-your-raw-json')
|
||||
placeholder-t-tools-json-minify-texts-input-placeholder-paste-your-raw-json-here: t('tools.json-minify.texts.input-placeholder-paste-your-raw-json-here')
|
||||
label-t-tools-json-minify-texts-output-label-minified-version-of-your-json: t('tools.json-minify.texts.output-label-minified-version-of-your-json')
|
||||
json-string-converter:
|
||||
title: Json string converter
|
||||
description: Convert your text or JavaScript objects to JSON string format and
|
||||
@@ -946,11 +879,6 @@ tools:
|
||||
input-label-your-text-json-string: Your text / JSON string
|
||||
input-placeholder-paste-your-text-here: Paste your text here...
|
||||
output-label-json-string-conversion-of-your-input: JSON string conversion of your input
|
||||
label-t-tools-json-string-converter-texts-input-label-your-text-json-string: t('tools.json-string-converter.texts.input-label-your-text-json-string')
|
||||
placeholder-t-tools-json-string-converter-texts-input-placeholder-paste-your-text-here:
|
||||
t('tools.json-string-converter.texts.input-placeholder-paste-your-text-here')
|
||||
label-t-tools-json-string-converter-texts-output-label-json-string-conversion-of-your-input:
|
||||
t('tools.json-string-converter.texts.output-label-json-string-conversion-of-your-input')
|
||||
ulid-generator:
|
||||
title: ULID generator
|
||||
description: Generate random Universally Unique Lexicographically Sortable
|
||||
@@ -990,10 +918,6 @@ tools:
|
||||
input-placeholder-paste-your-yaml-here: Paste your yaml here...
|
||||
output-label-json-from-your-yaml: JSON from your YAML
|
||||
label-nestify-a-b-c-to-nested-objects: Nestify ('a.b.c' to nested objects)
|
||||
label-t-tools-yaml-to-json-converter-texts-input-label-your-yaml: t('tools.yaml-to-json-converter.texts.input-label-your-yaml')
|
||||
placeholder-t-tools-yaml-to-json-converter-texts-input-placeholder-paste-your-yaml-here:
|
||||
t('tools.yaml-to-json-converter.texts.input-placeholder-paste-your-yaml-here')
|
||||
label-t-tools-yaml-to-json-converter-texts-output-label-json-from-your-yaml: t('tools.yaml-to-json-converter.texts.output-label-json-from-your-yaml')
|
||||
uuid-generator:
|
||||
title: UUIDs generator
|
||||
description: A Universally Unique Identifier (UUID) is a 128-bit number used to
|
||||
@@ -1211,9 +1135,6 @@ tools:
|
||||
input-label-your-json: Your JSON
|
||||
input-placeholder-paste-your-json-here: Paste your JSON here...
|
||||
output-label-object-from-your-json: Object from your JSON
|
||||
label-t-tools-json-to-object-texts-input-label-your-json: t('tools.json-to-object.texts.input-label-your-json')
|
||||
placeholder-t-tools-json-to-object-texts-input-placeholder-paste-your-json-here: t('tools.json-to-object.texts.input-placeholder-paste-your-json-here')
|
||||
label-t-tools-json-to-object-texts-output-label-object-from-your-json: t('tools.json-to-object.texts.output-label-object-from-your-json')
|
||||
unicode-to-java-entities:
|
||||
title: Unicode Characters to Java Entities Converter
|
||||
description: Unicode Characters to Java Entities Converter and vice-versa
|
||||
@@ -1248,6 +1169,30 @@ tools:
|
||||
placeholder-put-your-full-prompt-here: Put your full prompt here...
|
||||
label-character-length-for-each-chunk: Character length for each chunk
|
||||
title-divided-prompts: Divided prompts
|
||||
amortization-calculator:
|
||||
title: Amortization Calculator
|
||||
description: Calculate loan amortization schedules with monthly payment breakdowns
|
||||
footer: Amortization Calculator
|
||||
texts:
|
||||
title-loan-parameters: Loan Parameters
|
||||
title-overview: Overview
|
||||
title-amortization-schedule: Amortization Schedule
|
||||
label-loan-amount: Loan Amount
|
||||
label-loan-term: Loan Term
|
||||
label-interest-rate: Interest Rate
|
||||
label-displayed-currency: Displayed Currency
|
||||
label-end-of-year: "End of Year {year}"
|
||||
label-year: Year
|
||||
label-month: Month
|
||||
label-interest: Interest
|
||||
label-principal: Principal
|
||||
label-ending-balance: Ending Balance
|
||||
label-monthly-payment: Monthly Payment
|
||||
label-total-of-payments: Total of Payments
|
||||
label-total-interest: Total Interest
|
||||
message-loan-amount-must-be-positive: Loan amount must be a positive value
|
||||
message-loan-term-must-be-positive-integer: Loan term must be a positive integer
|
||||
message-interest-rate-must-be-between-1-and-100: Interest rate must be a positive value between 0 and 100
|
||||
angle-converter:
|
||||
title: Angle Units Converter
|
||||
description: Convert values between angle units
|
||||
@@ -1820,9 +1765,8 @@ tools:
|
||||
tag-detach-d: Detach (-d)
|
||||
tag-remove-rm: Remove (--rm)
|
||||
tag-long-arguments: Long Arguments
|
||||
tag-: "?"
|
||||
tag-arg: arg
|
||||
tag-value: value
|
||||
tag-multiline: Multiline
|
||||
tag-equal-sep: --arg=value
|
||||
docker-compose-to-kubernetes:
|
||||
title: Docker compose to kubernetes
|
||||
description: Docker Compose to Kubernetes manifests
|
||||
@@ -2132,6 +2076,14 @@ tools:
|
||||
placeholder-your-html-content: Your Html content...
|
||||
label-your-html-to-convert-can-paste-from-clipboard: "Your Html to convert (can paste from clipboard):"
|
||||
label-output-markdown: "Output markdown:"
|
||||
label-heading-style: "Headings Style:"
|
||||
label-emphasis-style: "Emphasis Style:"
|
||||
label-hash: Hash (#)
|
||||
label-underline: Underline (=/-)
|
||||
label-surround-heading: Surround (= Heading =)
|
||||
label-asterisk: Asterisk (*)
|
||||
label-underscore: Underscore (_)
|
||||
label-tilde: Tilde (~)
|
||||
ical-parser:
|
||||
title: ICAL File Parser
|
||||
description: Parse ICAL/ICS file to event display
|
||||
@@ -2431,6 +2383,10 @@ tools:
|
||||
label-json-schema: "JSON schema:"
|
||||
placeholder-paste-your-json-schema-here: Paste your JSON Schema here...
|
||||
title-schema-validation-errors: Schema Validation Errors
|
||||
title-formatted-version: Formatted version
|
||||
label-indent-size-0-compact: "Indent size (0 = Compact):"
|
||||
title-repaired-version: Auto Repaired and Formatted version
|
||||
label-auto-repair-json: "Auto Repair JSON:"
|
||||
json-size-analyzer:
|
||||
title: Json Size Analyzer
|
||||
description: Measure JSON nodes relative weights
|
||||
@@ -2499,9 +2455,6 @@ tools:
|
||||
input-label-your-json: Your JSON
|
||||
input-placeholder-paste-your-json-here: Paste your JSON here...
|
||||
output-label-php-array-version: PHP Array version
|
||||
label-t-tools-json-to-php-array-texts-input-label-your-json: t('tools.json-to-php-array.texts.input-label-your-json')
|
||||
placeholder-t-tools-json-to-php-array-texts-input-placeholder-paste-your-json-here: t('tools.json-to-php-array.texts.input-placeholder-paste-your-json-here')
|
||||
label-t-tools-json-to-php-array-texts-output-label-php-array-version: t('tools.json-to-php-array.texts.output-label-php-array-version')
|
||||
json-to-schema:
|
||||
title: Json to Schema
|
||||
description: Convert JSON data to JSON Schema, MySQL DDL, Mongoose Schema,
|
||||
@@ -2520,9 +2473,6 @@ tools:
|
||||
input-label-your-json: Your JSON
|
||||
input-placeholder-paste-your-json-here: Paste your JSON here...
|
||||
output-label-your-schema: Your schema
|
||||
label-t-tools-json-to-schema-texts-input-label-your-json: t('tools.json-to-schema.texts.input-label-your-json')
|
||||
placeholder-t-tools-json-to-schema-texts-input-placeholder-paste-your-json-here: t('tools.json-to-schema.texts.input-placeholder-paste-your-json-here')
|
||||
label-t-tools-json-to-schema-texts-output-label-your-schema: t('tools.json-to-schema.texts.output-label-your-schema')
|
||||
jsonpath-memo:
|
||||
title: JSONPath Syntax Cheatsheet
|
||||
description: JSONPath Syntax Cheatsheet
|
||||
@@ -2542,6 +2492,17 @@ tools:
|
||||
label-public-key-jwk: "Public Key (JWK):"
|
||||
label-private-key-jwk: "Private Key (JWK):"
|
||||
title-generated-jwt-token: "Generated JWT Token:"
|
||||
label-secret-encoding: "Secret Encoding:"
|
||||
label-raw-text: Raw Text
|
||||
label-hex-array: Hex Array
|
||||
verify-description: "{0}: {1} (verify with {2})"
|
||||
token-secret: Token Secret
|
||||
token-keys: Token Keys
|
||||
cannot-parse-secret-as-encoding: "Cannot parse '{0}' as '{1}': {2}"
|
||||
invalid-base64-string: Invalid Base64 string
|
||||
placeholder-input-token: Paste your JWT token to edit...
|
||||
click-to-input-a-existing-jwt-token-to-modify: Click to input a existing JWT token to modify
|
||||
label-base64: Base64
|
||||
length-converter:
|
||||
title: Length Units Converter
|
||||
description: Convert values from length units
|
||||
@@ -2599,6 +2560,8 @@ tools:
|
||||
placeholder-select-the-target-unit: Select the target unit
|
||||
title-result: Result
|
||||
label-best-target-unit: Best Target Unit
|
||||
label-selected-target-unit-outputunit: Selected Target Unit ({0})
|
||||
title-other-units-conversion-tools: Other Units Conversion Tools
|
||||
markdown-cheatsheet:
|
||||
title: Markdown Cheat Sheet
|
||||
description: Markdown Cheat Sheet
|
||||
@@ -2736,10 +2699,6 @@ tools:
|
||||
input-label-your-nginx-config: Your Nginx config
|
||||
input-placeholder-paste-your-nginx-config-here: Paste your Nginx config here...
|
||||
output-label-prettified-nginx-config: Prettified Nginx config
|
||||
label-t-tools-nginx-formatter-texts-input-label-your-nginx-config: t('tools.nginx-formatter.texts.input-label-your-nginx-config')
|
||||
placeholder-t-tools-nginx-formatter-texts-input-placeholder-paste-your-nginx-config-here:
|
||||
t('tools.nginx-formatter.texts.input-placeholder-paste-your-nginx-config-here')
|
||||
label-t-tools-nginx-formatter-texts-output-label-prettified-nginx-config: t('tools.nginx-formatter.texts.output-label-prettified-nginx-config')
|
||||
ocr-image:
|
||||
title: OCRize image and PDF
|
||||
description: Perform OCR (Tesseract) on an image or PDF
|
||||
@@ -2941,10 +2900,6 @@ tools:
|
||||
input-label-your-php-array: Your PHP Array
|
||||
input-placeholder-paste-your-php-array-here: Paste your PHP Array here...
|
||||
output-label-json-version: JSON version
|
||||
label-t-tools-php-array-to-json-texts-input-label-your-php-array: t('tools.php-array-to-json.texts.input-label-your-php-array')
|
||||
placeholder-t-tools-php-array-to-json-texts-input-placeholder-paste-your-php-array-here:
|
||||
t('tools.php-array-to-json.texts.input-placeholder-paste-your-php-array-here')
|
||||
label-t-tools-php-array-to-json-texts-output-label-json-version: t('tools.php-array-to-json.texts.output-label-json-version')
|
||||
pin-code-generator:
|
||||
title: Pin Code Generator
|
||||
description: Generate Unique PIN (digits) codes
|
||||
@@ -3088,10 +3043,6 @@ tools:
|
||||
input-label-your-log-textual-data: "Your log/textual data:"
|
||||
input-placeholder-paste-your-log-textual-data-here: Paste your log/textual data here...
|
||||
output-label-cleaned-version: "Cleaned version:"
|
||||
label-t-tools-sensitive-data-masker-texts-input-label-your-log-textual-data: t('tools.sensitive-data-masker.texts.input-label-your-log-textual-data')
|
||||
placeholder-t-tools-sensitive-data-masker-texts-input-placeholder-paste-your-log-textual-data-here:
|
||||
t('tools.sensitive-data-masker.texts.input-placeholder-paste-your-log-textual-data-here')
|
||||
label-t-tools-sensitive-data-masker-texts-output-label-cleaned-version: t('tools.sensitive-data-masker.texts.output-label-cleaned-version')
|
||||
sla-calculator:
|
||||
title: SLA calculator
|
||||
description: Service Level Agreement Calcultator
|
||||
@@ -3262,7 +3213,7 @@ tools:
|
||||
tag-category: Category
|
||||
tag-html: Html
|
||||
tag-name: Name
|
||||
tag-gt-more-info: "> More info"
|
||||
tag-gt-more-info: More info about this character
|
||||
url-cleaner:
|
||||
title: Url Cleaner
|
||||
description: Clean Ads tracker, UTM, Facebook and other ads provider parameters
|
||||
@@ -3443,11 +3394,6 @@ tools:
|
||||
generate the command with
|
||||
command: Command
|
||||
placeholder: Paste command here
|
||||
texts:
|
||||
label-t-tools-cli-command-editor-command: $t('tools.cli-command-editor.command')
|
||||
placeholder-t-tools-cli-command-editor-placeholder: $t('tools.cli-command-editor.placeholder')
|
||||
label-service-sanitizeoption-option: service.sanitizeOption(option)
|
||||
placeholder-service-sanitizeoption-option: service.sanitizeOption(option)
|
||||
safelink-decoder:
|
||||
title: Outlook Safelink decoder
|
||||
description: Decode Outlook SafeLink links
|
||||
@@ -3474,10 +3420,6 @@ tools:
|
||||
input-placeholder: Paste your JSON content here...
|
||||
output: Converted XML
|
||||
error: Provided JSON is not valid.
|
||||
texts:
|
||||
label-t-tools-json-to-xml-input: t('tools.json-to-xml.input')
|
||||
placeholder-t-tools-json-to-xml-input-placeholder: t('tools.json-to-xml.input-placeholder')
|
||||
label-t-tools-json-to-xml-output: t('tools.json-to-xml.output')
|
||||
xml-to-json:
|
||||
title: XML to JSON
|
||||
description: Convert XML to JSON
|
||||
@@ -3485,10 +3427,6 @@ tools:
|
||||
input-placeholder: Paste your XML content here...
|
||||
output: Converted JSON
|
||||
error: Provided XML is not valid.
|
||||
texts:
|
||||
label-t-tools-xml-to-json-input: t('tools.xml-to-json.input')
|
||||
placeholder-t-tools-xml-to-json-input-placeholder: t('tools.xml-to-json.input-placeholder')
|
||||
label-t-tools-xml-to-json-output: t('tools.xml-to-json.output')
|
||||
email-normalizer:
|
||||
title: Email normalizer
|
||||
description: Normalize email addresses to a standard format for easier
|
||||
@@ -4030,10 +3968,6 @@ tools:
|
||||
input-label-your-json: Your JSON
|
||||
input-placeholder-paste-your-json-here: Paste your JSON here...
|
||||
output-label-protobuf-version-of-your-json-objects: "ProtoBuf version of your JSON objects:"
|
||||
label-t-tools-json-to-protobuf-texts-input-label-your-json: t('tools.json-to-protobuf.texts.input-label-your-json')
|
||||
placeholder-t-tools-json-to-protobuf-texts-input-placeholder-paste-your-json-here: t('tools.json-to-protobuf.texts.input-placeholder-paste-your-json-here')
|
||||
label-t-tools-json-to-protobuf-texts-output-label-protobuf-version-of-your-json-objects:
|
||||
t('tools.json-to-protobuf.texts.output-label-protobuf-version-of-your-json-objects')
|
||||
json-to-python:
|
||||
title: Json to Python
|
||||
description: Convert JSON to Python classes
|
||||
@@ -4060,9 +3994,6 @@ tools:
|
||||
input-label-your-json: Your JSON
|
||||
input-placeholder-paste-your-json-here: Paste your JSON here...
|
||||
output-label-your-sql-ddl: Your SQL DDL
|
||||
label-t-tools-json-to-sql-ddl-texts-input-label-your-json: t('tools.json-to-sql-ddl.texts.input-label-your-json')
|
||||
placeholder-t-tools-json-to-sql-ddl-texts-input-placeholder-paste-your-json-here: t('tools.json-to-sql-ddl.texts.input-placeholder-paste-your-json-here')
|
||||
label-t-tools-json-to-sql-ddl-texts-output-label-your-sql-ddl: t('tools.json-to-sql-ddl.texts.output-label-your-sql-ddl')
|
||||
json-to-sql-insert:
|
||||
title: Json to SQL INSERT
|
||||
description: Convert JSON array to INSERT INTO
|
||||
@@ -4218,14 +4149,6 @@ tools:
|
||||
input-label-your-yaml-content: "Your YAML content:"
|
||||
input-placeholder-paste-your-yaml-content-here: Paste your YAML content here...
|
||||
output-label-properties-version: ".properties version:"
|
||||
label-t-tools-properties-converter-texts-input-label-your-properties-content: t('tools.properties-converter.texts.input-label-your-properties-content')
|
||||
placeholder-t-tools-properties-converter-texts-input-placeholder-paste-your-properties-content-here:
|
||||
t('tools.properties-converter.texts.input-placeholder-paste-your-properties-content-here')
|
||||
label-t-tools-properties-converter-texts-output-label-yaml-version: t('tools.properties-converter.texts.output-label-yaml-version')
|
||||
label-t-tools-properties-converter-texts-input-label-your-yaml-content: t('tools.properties-converter.texts.input-label-your-yaml-content')
|
||||
placeholder-t-tools-properties-converter-texts-input-placeholder-paste-your-yaml-content-here:
|
||||
t('tools.properties-converter.texts.input-placeholder-paste-your-yaml-content-here')
|
||||
label-t-tools-properties-converter-texts-output-label-properties-version: t('tools.properties-converter.texts.output-label-properties-version')
|
||||
punycode-converter:
|
||||
title: Punycode Converter
|
||||
description: Convert international unicode domain names or emails from/to ASCII
|
||||
@@ -4250,14 +4173,6 @@ tools:
|
||||
input-label-double-quoted-string: Double quoted string
|
||||
input-placeholder-paste-your-double-quoted-string-here: Paste your double quoted string here...
|
||||
output-label-single-quoted-string: Single quoted string
|
||||
label-t-tools-quote-converter-texts-input-label-single-quoted-string: t('tools.quote-converter.texts.input-label-single-quoted-string')
|
||||
placeholder-t-tools-quote-converter-texts-input-placeholder-paste-your-single-quoted-string-here:
|
||||
t('tools.quote-converter.texts.input-placeholder-paste-your-single-quoted-string-here')
|
||||
label-t-tools-quote-converter-texts-output-label-double-quoted-string: t('tools.quote-converter.texts.output-label-double-quoted-string')
|
||||
label-t-tools-quote-converter-texts-input-label-double-quoted-string: t('tools.quote-converter.texts.input-label-double-quoted-string')
|
||||
placeholder-t-tools-quote-converter-texts-input-placeholder-paste-your-double-quoted-string-here:
|
||||
t('tools.quote-converter.texts.input-placeholder-paste-your-double-quoted-string-here')
|
||||
label-t-tools-quote-converter-texts-output-label-single-quoted-string: t('tools.quote-converter.texts.output-label-single-quoted-string')
|
||||
rsync-generator:
|
||||
title: Rsync Generator
|
||||
description: Rsync command generator
|
||||
@@ -4446,10 +4361,6 @@ tools:
|
||||
input-label-your-raw-html: Your raw HTML
|
||||
input-placeholder-paste-your-raw-html-here: Paste your raw HTML here...
|
||||
output-label-text-from-your-html: Text from your HTML
|
||||
label-t-tools-extract-text-from-html-texts-input-label-your-raw-html: t('tools.extract-text-from-html.texts.input-label-your-raw-html')
|
||||
placeholder-t-tools-extract-text-from-html-texts-input-placeholder-paste-your-raw-html-here:
|
||||
t('tools.extract-text-from-html.texts.input-placeholder-paste-your-raw-html-here')
|
||||
label-t-tools-extract-text-from-html-texts-output-label-text-from-your-html: t('tools.extract-text-from-html.texts.output-label-text-from-your-html')
|
||||
title: Extract text from HTML
|
||||
description: 'Paste your HTML in the input form on the left and you will get
|
||||
text instantly. Occasionally, you may need to extract plain text from an
|
||||
@@ -4526,6 +4437,7 @@ tools:
|
||||
label-your-url-to-parse: "Your url to parse:"
|
||||
placeholder-your-url-to-parse: Your url to parse...
|
||||
url-must-have-http-or-https-prefix: Url must have http:// or https:// prefix
|
||||
button-open-url: Open URL
|
||||
text-to-binary:
|
||||
title: Text to UTF-8 binary
|
||||
description: Convert text to its UTF-8 binary representation and vice-versa.
|
||||
@@ -4584,10 +4496,6 @@ tools:
|
||||
result: Result
|
||||
sucess: Success
|
||||
failure: Failure
|
||||
texts:
|
||||
label-t-tools-sip-auth-message: $t('tools.sip-auth.message')
|
||||
placeholder-t-tools-sip-auth-message-tips: $t('tools.sip-auth.message-tips')
|
||||
label-t-tools-sip-auth-result: $t('tools.sip-auth.result')
|
||||
text:
|
||||
not-found: Not Found
|
||||
sharepoint-decoder:
|
||||
@@ -5368,6 +5276,13 @@ tools:
|
||||
label-secret-or-public-key-spki-or-jwk: Secret or Public Key (SPKI or JWK)
|
||||
placeholder-put-your-secret-or-public-key-here: Put your secret or Public key here...
|
||||
tag-signature-verified: Signature verified
|
||||
label-jwk: JWK Key
|
||||
label-pub-key: PEM Public Key
|
||||
label-secret-raw-text: Secret - Raw Text
|
||||
label-secret-hex-array: Secret - Hex Array
|
||||
label-secret-base64: Secret - Base64
|
||||
label-secret-encoding: "Secret Encoding/Type:"
|
||||
key-or-secret-or-verification-error-e-tostring: "Key or secret or verification error: {0}"
|
||||
constants:
|
||||
text:
|
||||
token-introspection-response: Token introspection response
|
||||
@@ -6149,10 +6064,6 @@ tools:
|
||||
output-label-transformed-json: "Transformed JSON:"
|
||||
tag-flatten: Flatten
|
||||
tag-unflatten-nestify: Unflatten/Nestify
|
||||
label-t-tools-json-flatten-nestify-texts-input-label-your-json-content: t('tools.json-flatten-nestify.texts.input-label-your-json-content')
|
||||
placeholder-t-tools-json-flatten-nestify-texts-input-placeholder-paste-your-json-content-here:
|
||||
t('tools.json-flatten-nestify.texts.input-placeholder-paste-your-json-content-here')
|
||||
label-t-tools-json-flatten-nestify-texts-output-label-transformed-json: t('tools.json-flatten-nestify.texts.output-label-transformed-json')
|
||||
json-merger:
|
||||
title: JSON Merger
|
||||
description: Merge deeply two JSON content
|
||||
@@ -6194,10 +6105,6 @@ tools:
|
||||
output-label-transformed-yaml: "Transformed YAML:"
|
||||
tag-flatten: Flatten
|
||||
tag-unflatten-nestify: Unflatten/Nestify
|
||||
label-t-tools-yaml-flatten-nestify-texts-input-label-your-yaml-content: t('tools.yaml-flatten-nestify.texts.input-label-your-yaml-content')
|
||||
placeholder-t-tools-yaml-flatten-nestify-texts-input-placeholder-paste-your-yaml-content-here:
|
||||
t('tools.yaml-flatten-nestify.texts.input-placeholder-paste-your-yaml-content-here')
|
||||
label-t-tools-yaml-flatten-nestify-texts-output-label-transformed-yaml: t('tools.yaml-flatten-nestify.texts.output-label-transformed-yaml')
|
||||
yaml-merger:
|
||||
title: YAML Merger
|
||||
description: Merge deeply two YAML content
|
||||
@@ -6859,9 +6766,6 @@ tools:
|
||||
label-total-size: "Total size:"
|
||||
label-segments-count: "Segments count:"
|
||||
label-non-gsm-7-characters: "Non GSM-7 characters:"
|
||||
label-t-tools-unicode-to-gsm7-texts-input-label-your-text-to-encode-to-gsm-7: t('tools.unicode-to-gsm7.texts.input-label-your-text-to-encode-to-gsm-7')
|
||||
placeholder-t-tools-unicode-to-gsm7-texts-input-placeholder-put-your-text-here: t('tools.unicode-to-gsm7.texts.input-placeholder-put-your-text-here')
|
||||
label-t-tools-unicode-to-gsm7-texts-output-label-gsm-7-encoded-version: t('tools.unicode-to-gsm7.texts.output-label-gsm-7-encoded-version')
|
||||
which-day:
|
||||
title: Which Day?
|
||||
description: Given a day and month, and years range, list all day of week a
|
||||
@@ -7030,16 +6934,6 @@ tools:
|
||||
label-issuer-identifier-number: "Issuer Identifier Number:"
|
||||
label-cvv-length: "CVV Length:"
|
||||
tag-invlid-credit-card-number: Invlid Credit Card Number
|
||||
credit-card-generator:
|
||||
title: Credit Card Number Generator
|
||||
description: Generate Random Credit Card Number
|
||||
texts:
|
||||
label-credit-card-scheme: "Credit Card Scheme:"
|
||||
placeholder-select-scheme: Select Scheme
|
||||
label-number-of-credit-card-to-generate: "Number of Credit Card to generate:"
|
||||
placeholder-number-of-cards: Number of cards
|
||||
title-generated-credit-card-numbers: Generated Credit Card numbers
|
||||
tag-generate-random-credit-card-numbers: Generate Random Credit Card numbers
|
||||
database-connection-string-builder:
|
||||
title: Database Connection String Builder
|
||||
description: Build connection string for common database
|
||||
@@ -7174,3 +7068,332 @@ tools:
|
||||
label-converted-to-hex-array: "Converted to Hex array:"
|
||||
tag-digit-0-no-grouping: (Digit 0 = No grouping)
|
||||
tag-digit-0-no-row: (Digit 0 = No row)
|
||||
toon-to-json:
|
||||
texts:
|
||||
message-provided-json-is-not-valid: Provided TOON is not valid
|
||||
output-label-json-version: "JSON version of your TOON content:"
|
||||
input-placeholder-paste-your-raw-toon-here: Paste your raw TOON content here...
|
||||
input-label-your-raw-toon: "Your raw TOON content:"
|
||||
title: TOON to JSON
|
||||
description: Convert TOON representation to JSON object for LLM usage
|
||||
json-to-toon:
|
||||
texts:
|
||||
message-provided-json-is-not-valid: Provided JSON is not valid.
|
||||
input-placeholder-paste-your-raw-json-here: Paste your raw JSON here...
|
||||
input-label-your-raw-json: "Your raw JSON:"
|
||||
output-label-toon-version-of-your-json: "TOON version of your JSON:"
|
||||
title: JSON to TOON
|
||||
description: Convert JSON object to TOON representation for LLM/GPT usage
|
||||
external-link-goto: "To open this tool, follow this link: "
|
||||
argon2-hash:
|
||||
title: Argon2 Hasher
|
||||
description: Compute Argon2 hashes with parameters
|
||||
texts:
|
||||
label-argon2id: Argon2id
|
||||
label-argon2i: Argon2i
|
||||
label-argon2d: Argon2d
|
||||
label-hex: Hex
|
||||
label-encoded: Encoded
|
||||
label-binary: Binary
|
||||
label-algorithm: "Algorithm:"
|
||||
label-password: "Password:"
|
||||
placeholder-enter-password: Enter password
|
||||
label-salt-hex: "Salt (hex):"
|
||||
placeholder-optional-hex-salt: Optional hex salt
|
||||
label-iterations: "Iterations:"
|
||||
label-memory-kib: "Memory (KiB):"
|
||||
label-parallelism: "Parallelism:"
|
||||
label-hash-length: "Hash length:"
|
||||
label-output-type: "Output type:"
|
||||
title-argon2-hash: Argon2 Hash
|
||||
tag-generate: Generate
|
||||
binary-calculator:
|
||||
title: Binary Calculator
|
||||
description: Calculate bitwise/binary operations (AND, OR, XOR, NOT, shifts)
|
||||
between two numbers
|
||||
texts:
|
||||
label-decimal: Decimal
|
||||
label-hexadecimal: "Hexadecimal:"
|
||||
label-octal: "Octal:"
|
||||
label-binary: "Binary:"
|
||||
label-a-and-b: A AND B
|
||||
label-a-or-b: A OR B
|
||||
label-a-xor-b: A XOR B
|
||||
label-not-a: NOT A
|
||||
label-a-b-left-shift: A << B (Left Shift)
|
||||
label-a-b-right-shift: A >> B (Right Shift)
|
||||
message-number-is-invalid: Number is invalid
|
||||
label-a: A=
|
||||
placeholder-enter-a: Enter A
|
||||
label-b: B=
|
||||
placeholder-enter-b: Enter B
|
||||
label-operation: "Operation:"
|
||||
placeholder-select-operation: Select Operation
|
||||
title-result: Result
|
||||
label-decimal-signed: "Decimal (Signed):"
|
||||
label-decimal-unigned: "Decimal (Unigned):"
|
||||
title-bitmask: Bitmask
|
||||
chmod-memo:
|
||||
title: chmod Command Cheatsheet
|
||||
description: Cheatsheets for Linux permissions changes
|
||||
css-gradient-generator:
|
||||
title: CSS Gradient Generator
|
||||
description: Generate CSS Gradient css code for a given set of steps and colors
|
||||
texts:
|
||||
label-gradient-type: "Gradient Type:"
|
||||
label-angle-degrees: "Angle (degrees):"
|
||||
title-color-stops: Color Stops
|
||||
title-preview: Preview
|
||||
title-generated-css: Generated CSS
|
||||
tag-linear: Linear
|
||||
tag-radial: Radial
|
||||
tag-remove: Remove
|
||||
tag-add-color-stop: Add Color Stop
|
||||
css-units-converter:
|
||||
title: CSS Units Converter
|
||||
description: Convert values from common CSS units (em, rem, px, vw, vh, %)
|
||||
texts:
|
||||
label-pixels-px: Pixels (px)
|
||||
label-ems-em: Ems (em)
|
||||
label-rems-rem: Rems (rem)
|
||||
label-percent: Percent (%)
|
||||
label-viewport-width-vw: Viewport Width (vw)
|
||||
label-viewport-height-vh: Viewport Height (vh)
|
||||
label-value-to-convert: "Value to convert:"
|
||||
label-from-unit: "From Unit:"
|
||||
label-to-unit: "To Unit:"
|
||||
label-base-font-size-px: Base Font Size (px)
|
||||
label-viewport-width-px: Viewport Width (px)
|
||||
label-viewport-height-px: Viewport Height (px)
|
||||
title-conversion: Conversion
|
||||
label-converted-value: "Converted value:"
|
||||
docker-compose-to-env-file:
|
||||
title: Docker Compose to .env file
|
||||
description: Extract .env file from an existing Docker Compose file
|
||||
texts:
|
||||
label-docker-compose-file: "Docker Compose file:"
|
||||
placeholder-paste-your-docker-compose-yaml-here: Paste your docker-compose YAML here...
|
||||
title-extract-env: Extract .env
|
||||
emv-tlv-decoder:
|
||||
title: EMV TLV decoder
|
||||
description: Decodes the EMV TLV (tag-length-value) data and its individual tags
|
||||
having extended meaning (such as TVR (Tag 95), Terminal Capabilities (Tag
|
||||
9F33), etc.)
|
||||
texts:
|
||||
tag-: —
|
||||
tag-tag: Tag
|
||||
tag-length: Length
|
||||
tag-value: Value
|
||||
tag-description: Description
|
||||
tag-bit-level-interpretation: Bit-Level Interpretation
|
||||
label-tlv-hex-input: TLV Hex Input
|
||||
placeholder-paste-emv-tlv-hex-string-e-g-6f1a8407a0000000031010a50f500b5649534120435245444954:
|
||||
Paste EMV TLV hex string (e.g.
|
||||
6F1A8407A0000000031010A50F500B5649534120435245444954)
|
||||
label-kernel-type: "Kernel Type:"
|
||||
title-decoded-emv-tags: Decoded EMV Tags
|
||||
tag-parse-tlv: Parse TLV
|
||||
eth-transaction-decoder:
|
||||
title: ETH Transaction Decoder
|
||||
description: Ethereum transaction decoder with Smart Contract ABI
|
||||
texts:
|
||||
label-smart-contract-abi: "Smart Contract ABI:"
|
||||
placeholder-paste-abi-json-here: Paste ABI JSON here
|
||||
label-raw-transaction-0x-or-json-transaction: "Raw Transaction (0x...) or JSON Transaction:"
|
||||
placeholder-quot-to-quot-quot-0x-quot-quot-data-quot-quot-0x-quot-or-raw-0x:
|
||||
"{'{'}"to":"0x...","data":"0x..."{'}'}
|
||||
or raw 0x...."
|
||||
title-decoded-transaction: Decoded Transaction
|
||||
label-from: From
|
||||
label-to: To
|
||||
label-value: Value
|
||||
label-gas: Gas
|
||||
label-gas-price: Gas Price
|
||||
label-nonce: Nonce
|
||||
label-method: Method
|
||||
label-signature: Signature
|
||||
label-arguments: Arguments
|
||||
title-structured-output-json: Structured Output JSON
|
||||
file-splitter:
|
||||
title: File Splitter
|
||||
description: Split JSON, XML or text file either by group of nodes or by group of lines
|
||||
texts:
|
||||
placeholder-strategy-value: Strategy value...
|
||||
title-drag-and-drop-a-txt-json-or-xml-file-here-or-click-to-select-a-file: Drag and drop a TXT, JSON or XML file here, or click to select a file
|
||||
tag-split-by-lines: Split by Lines
|
||||
tag-split-by-nodes: Split by Nodes
|
||||
tag-max-chunk-size-kb: "Max Chunk size (KB):"
|
||||
tag-fixed-count: "Fixed Count:"
|
||||
tag-chunk-count: "Chunk Count:"
|
||||
tag-preview-chunks: Preview chunks?
|
||||
tag-process-chunks: Process chunks
|
||||
tag-download-all: Download all
|
||||
tag-download: Download
|
||||
gitignore-generator:
|
||||
title: GitIgnore Generator
|
||||
description: Generate .gitignore for a set of common templates
|
||||
texts:
|
||||
placeholder-select-templates-e-g-node-python-vue: Select templates (e.g. node, python, vue)
|
||||
title-gitignore: .gitignore
|
||||
tag-const-availabletemplates-ref: const availableTemplates = ref
|
||||
tag-this-tool-use: "This tool use:"
|
||||
tag-https-www-toptal-com-developers-gitignore: https://www.toptal.com/developers/gitignore
|
||||
tag-generate: Generate
|
||||
i-and-l-checker:
|
||||
title: I and L Checker
|
||||
description: Check a password or text with highlighting of 1, l, I, 0, O
|
||||
texts:
|
||||
label-text-to-check: "Text to check:"
|
||||
placeholder-paste-your-text-here: Paste your text here...
|
||||
title-legend: Legend
|
||||
tag-i: I
|
||||
tag-uppercase-letter-i: "- Uppercase letter i"
|
||||
tag-l: l
|
||||
tag-lowercase-letter-l: "- Lowercase letter L"
|
||||
tag-1: "1"
|
||||
tag-number-1: "- Number 1"
|
||||
tag-0: "0"
|
||||
tag-number-0: "- Number 0"
|
||||
tag-o: O
|
||||
tag-uppercase-letter-o: "- Uppercase letter O"
|
||||
ipv4-subnets-list:
|
||||
title: IPv4 Subnets Lister
|
||||
description: List all possible subnets of a given CIDR
|
||||
texts:
|
||||
message-we-cannot-parse-this-address-check-the-format: We cannot parse this address, check the format
|
||||
label-an-ipv4-address-with-or-without-mask-cidr-ip-range-wildcard-ip-ip-mask: An IPv4 address with or without mask (CIDR/IP Range/Wildcard IP/IP Mask)
|
||||
placeholder-ipv4-or-cidr: IPv4 or cidr...
|
||||
tag-network: Network
|
||||
tag-first-ip: First IP
|
||||
tag-last-ip: Last IP
|
||||
tag-broadcast: Broadcast
|
||||
json-to-msgpack:
|
||||
title: JSON to MessagePack
|
||||
description: Convert JSON to MessagePack
|
||||
texts:
|
||||
message-json-is-invalid: JSON is invalid
|
||||
label-output-filename: "Output filename:"
|
||||
placeholder-enter-output-filename: Enter output filename
|
||||
label-json-to-convert: "JSON to convert:"
|
||||
placeholder-enter-json-to-convert: Enter JSON to convert...
|
||||
title-msgpack-binary: "MsgPack Binary:"
|
||||
tag-convert: Convert
|
||||
tag-download-msgpack-file: Download MsgPack file
|
||||
markdown-lorem-ipsum:
|
||||
title: Markdown Lorem Ipsum
|
||||
description: Generate Lorem Ipsum in markdown
|
||||
texts:
|
||||
label-atx: "ATX (#, ##, ###)"
|
||||
label-setext: Setext (====, ----)
|
||||
label-unordered: Unordered (-, *, +)
|
||||
label-ordered-1-2-3: Ordered (1., 2., 3.)
|
||||
label-language: "Language:"
|
||||
label-blocks: "Blocks:"
|
||||
label-sentences-per-paragraph: "Sentences per paragraph:"
|
||||
title-styles: Styles
|
||||
label-block-types: "Block types:"
|
||||
label-inline-styles: Inline styles
|
||||
label-header-style: "Header style:"
|
||||
label-list-style: "List style:"
|
||||
title-block-frequencies: Block frequencies
|
||||
label-headers: "Headers:"
|
||||
label-lists: "Lists:"
|
||||
label-code: "Code:"
|
||||
label-quotes: "Quotes:"
|
||||
title-generated-markdown: Generated Markdown
|
||||
tag-headers: Headers
|
||||
tag-lists: Lists
|
||||
tag-code: Code
|
||||
tag-quotes: Quotes
|
||||
tag-emphasis: Emphasis
|
||||
tag-strong: Strong
|
||||
tag-links: Links
|
||||
tag-inline-code: Inline code
|
||||
tag-generate: Generate
|
||||
tag-print-ie-use-a-pdf-printer-to-get-a-pdf-file: Print (ie, use a PDF Printer to get a PDF file)
|
||||
msgpack-to-json:
|
||||
title: Message Pack to JSON
|
||||
description: Convert MessagePack file to JSON
|
||||
texts:
|
||||
title-input-message-pack-file-or-content: Input Message Pack file or content
|
||||
label-file: File
|
||||
label-hex-content: "Hex Content:"
|
||||
title-drag-and-drop-msgpack-file-here-or-click-to-select-a-file: Drag and drop MsgPack file here, or click to select a file
|
||||
title-json-content: JSON Content
|
||||
pdf-compressor:
|
||||
title: PDF Compressor
|
||||
description: Optimize and compress PDF using Ghostscript
|
||||
texts:
|
||||
label-screen-smallest: Screen (smallest)
|
||||
label-ebook-balanced: eBook (balanced)
|
||||
label-printer-high-quality: Printer (high quality)
|
||||
label-prepress-best-quality: Prepress (best quality)
|
||||
label-pdf-1-4: PDF 1.4
|
||||
label-pdf-1-5: PDF 1.5
|
||||
label-pdf-1-6: PDF 1.6
|
||||
label-pdf-1-7: PDF 1.7
|
||||
label-compression-quality: "Compression quality:"
|
||||
placeholder-select-compression-quality: Select compression quality
|
||||
label-compatibility-level: "Compatibility level:"
|
||||
placeholder-select-compatibility-level: Select compatibility level
|
||||
title-drag-and-drop-a-pdf-file-here-or-click-to-select-a-file: Drag and drop a PDF file here, or click to select a file
|
||||
title-logs: Logs
|
||||
label-ghostscript: Ghostscript
|
||||
serial-console:
|
||||
title: Serial Port Console
|
||||
description: Connect, read and send message to Serial Port
|
||||
texts:
|
||||
label-9600: "9600"
|
||||
label-19200: "19200"
|
||||
label-38400: "38400"
|
||||
label-57600: "57600"
|
||||
label-115200: "115200"
|
||||
label-lf-n: LF (\\n)
|
||||
label-cr-r: CR (\\r)
|
||||
label-crlf-r-n: CRLF (\\r\\n)
|
||||
title-serial-terminal: Serial Terminal
|
||||
placeholder-baud-rate: Baud Rate
|
||||
placeholder-line-ending: Line Ending
|
||||
placeholder-select-port: Select Port
|
||||
placeholder-type-a-command: Type a command...
|
||||
tag-connect: Connect
|
||||
tag-disconnect: Disconnect
|
||||
tag-send: Send
|
||||
shamirs-secret-sharing:
|
||||
title: Shamirs Secret Sharing
|
||||
description: Allow to share and recompose a secret using Shamir\
|
||||
texts:
|
||||
label-text: Text
|
||||
label-hexadecimal: Hexadecimal
|
||||
label-base64: Base64
|
||||
label-secret-mode: "Secret Mode:"
|
||||
title-share-a-secret-split: Share a secret (split)
|
||||
label-secret: "Secret:"
|
||||
placeholder-enter-secret-text: Enter secret text
|
||||
label-threshold-minimum-shares-to-recover: "Threshold (minimum shares to recover):"
|
||||
label-number-of-shares: "Number of shares:"
|
||||
title-generated-shares: Generated Shares
|
||||
title-recombine-a-secret: Recombine a secret
|
||||
label-your-shares: "Your shares:"
|
||||
placeholder-paste-your-shares-here: Paste your shares here...
|
||||
title-recombined-secret: Recombined secret
|
||||
tag-split-secret: Split Secret
|
||||
tag-recombine: Recombine
|
||||
short-urls-expander:
|
||||
title: Short Urls Expander
|
||||
description: Expand short urls to target full urls
|
||||
texts:
|
||||
label-short-urls-to-expand: "Short URLs to expand:"
|
||||
placeholder-enter-short-urls-one-per-line: Enter short URLs (one per line)
|
||||
title-result: Result
|
||||
tag-this-tool-make-use-of-https-cors-anywhere-com-to-bypass-cors-this-is-a-community-driven-server:
|
||||
This tool make use of https://cors-anywhere.com to bypass CORS. This is
|
||||
a community driven server.
|
||||
tag-see-here-for-more-information: See here for more information
|
||||
tag-expand-all: Expand All
|
||||
tag-download-resuls-as-csv: Download resuls as CSV
|
||||
tag-short-url: Short Url
|
||||
tag-expanded-url: Expanded Url
|
||||
tag-link: Link
|
||||
tag-status: Status
|
||||
tag-open-url: Open Url
|
||||
+7558
-52
File diff suppressed because it is too large.
Load diff
+2364
-2066
File diff suppressed because it is too large.
Load diff
+6497
-319
File diff suppressed because it is too large.
Load diff
+7576
File diff suppressed because it is too large.
Load diff
+7081
File diff suppressed because it is too large.
Load diff
+7504
File diff suppressed because it is too large.
Load diff
+7204
-179
File diff suppressed because it is too large.
Load diff
+7423
-44
File diff suppressed because it is too large.
Load diff
+7475
-59
File diff suppressed because it is too large.
Load diff
+6697
-405
File diff suppressed because it is too large.
Load diff
+7494
File diff suppressed because it is too large.
Load diff
+6654
-397
File diff suppressed because it is too large.
Load diff
+7173
-159
File diff suppressed because it is too large.
Load diff
+2495
-1276
File diff suppressed because it is too large.
Load diff
+42
-30
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "it-tools",
|
||||
"type": "module",
|
||||
"version": "2025.10.12",
|
||||
"version": "2025.12.7",
|
||||
"packageManager": "pnpm@9.11.0",
|
||||
"description": "Collection of handy online tools for developers, with great UX. ",
|
||||
"author": "Corentin Th <corentin.thomasset74+it-tools@gmail.com> (https://corentin.tech)",
|
||||
@@ -26,8 +26,8 @@
|
||||
"build": "vue-tsc --noEmit && . ./set_node_mem.sh && vite build",
|
||||
"preview": "vite preview --port 5050",
|
||||
"test": "TZ=UTC npm run test:unit",
|
||||
"test:unit": "TZ=UTC vitest --environment jsdom",
|
||||
"test:e2e": "TZ=UTC playwright test",
|
||||
"test:unit": "TZ=UTC . ./set_node_mem.sh && vitest --environment jsdom",
|
||||
"test:e2e": "TZ=UTC . ./set_node_mem.sh && playwright test",
|
||||
"test:e2e:dev": "TZ=UTC BASE_URL=http://localhost:5173 NO_WEB_SERVER=true playwright test",
|
||||
"coverage": "vitest run --coverage",
|
||||
"typecheck": "vue-tsc --noEmit -p tsconfig.vitest.json --composite false",
|
||||
@@ -37,6 +37,7 @@
|
||||
"release": "node ./scripts/release.mjs",
|
||||
"script:extract:desc": "node ./scripts/extract-tools-desc.mjs",
|
||||
"script:extract:strings": "node ./scripts/extract-tools-strings.mjs",
|
||||
"script:translate-missing": "node ./scripts/translate-missings.mjs -e ./locales/en.yml -t ./locales/*.yml",
|
||||
"vue-i18n-extract": "vue-i18n-extract report --vueFiles 'src/**/*.?(ts|vue)' --languageFiles 'locales/*.yml'"
|
||||
},
|
||||
"dependencies": {
|
||||
@@ -76,6 +77,7 @@
|
||||
"@tiptap/pm": "2.26.1",
|
||||
"@tiptap/starter-kit": "2.26.1",
|
||||
"@tiptap/vue-3": "2.26.1",
|
||||
"@toon-format/toon": "^1.3.0",
|
||||
"@types/haversine": "^1.1.8",
|
||||
"@types/html-to-text": "^9.0.4",
|
||||
"@types/swagger-ui-dist": "^3.30.6",
|
||||
@@ -93,6 +95,7 @@
|
||||
"@zxcvbn-ts/language-en": "^3.0.2",
|
||||
"@zxing/library": "^0.21.3",
|
||||
"a11y-color-contrast": "^0.2.0",
|
||||
"abort-signal-polyfill": "^1.0.0",
|
||||
"aircodes": "^1.3.16",
|
||||
"ajv": "^8.17.1",
|
||||
"ajv-errors": "^3.0.0",
|
||||
@@ -100,7 +103,7 @@
|
||||
"ansible-vault": "^1.3.0",
|
||||
"apache-md5": "^1.1.8",
|
||||
"arr-diff": "^4.0.0",
|
||||
"bcryptjs": "^2.4.3",
|
||||
"bcryptjs": "^3.0.3",
|
||||
"big.js": "^6.2.2",
|
||||
"braces": "^3.0.3",
|
||||
"bwip-js": "^4.5.1",
|
||||
@@ -151,6 +154,7 @@
|
||||
"email-bounce-parser-browser": "^1.1.0",
|
||||
"email-normalizer": "^1.0.0",
|
||||
"emojilib": "^4.0.2",
|
||||
"ethers": "^6.15.0",
|
||||
"event-cron-parser": "^1.0.35",
|
||||
"exif-be-gone": "^1.5.1",
|
||||
"exifreader": "^4.26.1",
|
||||
@@ -166,6 +170,7 @@
|
||||
"fuse.js": "^7.1.0",
|
||||
"generate-schema": "^2.6.0",
|
||||
"get-timezone-offset": "^1.0.5",
|
||||
"ghostscript-wasm-esm": "^1.0.1",
|
||||
"gtin-validator": "^1.0.0",
|
||||
"hash-wasm": "^4.12.0",
|
||||
"haversine": "^1.1.1",
|
||||
@@ -173,13 +178,13 @@
|
||||
"hex-array": "^1.0.0",
|
||||
"highlight.js": "^11.11.1",
|
||||
"html-to-text": "^9.0.5",
|
||||
"htmlfy": "^0.8.1",
|
||||
"htmlfy": "^1.0.0",
|
||||
"hyparquet": "^1.9.0",
|
||||
"hyparquet-compressors": "^1.0.0",
|
||||
"ibantools": "^4.5.1",
|
||||
"ical-generator": "^8.1.1",
|
||||
"ical.js": "^2.2.0",
|
||||
"iconv-lite": "^0.6.3",
|
||||
"iconv-lite": "^0.7.0",
|
||||
"image-compare-viewer": "^1.6.2",
|
||||
"image-in-browser": "^3.2.3",
|
||||
"image-to-ascii-art": "^0.0.4",
|
||||
@@ -188,7 +193,7 @@
|
||||
"ip-cidr": "^4.0.2",
|
||||
"ip-matching": "^2.1.2",
|
||||
"ip-regex": "^5.0.0",
|
||||
"is-cidr": "^5.1.1",
|
||||
"is-cidr": "^6.0.1",
|
||||
"is-ip": "^5.0.1",
|
||||
"isbn3": "^1.2.12",
|
||||
"iso-639-1": "^3.1.5",
|
||||
@@ -196,14 +201,14 @@
|
||||
"jks-js": "^1.1.4",
|
||||
"jose": "^5.10.0",
|
||||
"jpeg-quality-estimator": "^1.0.1",
|
||||
"jq-wasm": "^1.0.0",
|
||||
"jq-wasm": "^1.0.1",
|
||||
"js-base64": "^3.7.7",
|
||||
"js-beautify": "^1.15.4",
|
||||
"js-tiktoken": "^1.0.21",
|
||||
"jsbarcode": "^3.12.1",
|
||||
"json-analyzer": "^1.2.2",
|
||||
"json-editor-vue": "^0.18.0",
|
||||
"json-to-ts": "^1.7.0",
|
||||
"json-editor-vue": "^0.18.1",
|
||||
"json-to-ts": "^2.1.0",
|
||||
"json5": "^2.2.3",
|
||||
"jsonar-mod": "^1.9.0",
|
||||
"jsonlint-mod": "^1.7.6",
|
||||
@@ -235,24 +240,26 @@
|
||||
"markdown-it-sup": "^2.0.0",
|
||||
"markdown-table-prettify": "^3.6.0",
|
||||
"marked": "^10.0.0",
|
||||
"mathjs": "^14.5.3",
|
||||
"mathjs": "^15.0.0",
|
||||
"md-editor-v3": "^4.21.3",
|
||||
"memorystream": "^0.3.1",
|
||||
"merge-anything": "^6.0.6",
|
||||
"mermaid": "^11.9.0",
|
||||
"mime-types": "^2.1.35",
|
||||
"mime-types": "^3.0.1",
|
||||
"mitex-wasm": "^0.2.5",
|
||||
"moment": "^2.30.1",
|
||||
"monaco-editor": "^0.43.0",
|
||||
"monaco-editor": "^0.54.0",
|
||||
"morsee": "^1.0.10",
|
||||
"msgpackr": "^1.11.5",
|
||||
"naive-ui": "^2.35.0",
|
||||
"nanoid": "^5.1.5",
|
||||
"nanoid-dictionary": "^4.3.0",
|
||||
"nestify-anything": "^3.0.3",
|
||||
"nanoid": "^5.1.6",
|
||||
"nanoid-dictionary": "^5.0.0",
|
||||
"nestify-anything": "^4.0.1",
|
||||
"netmask": "^2.0.2",
|
||||
"netstack.js": "^2.1.2",
|
||||
"nginx-config-formatter": "^1.4.5",
|
||||
"niceware": "^4.0.0",
|
||||
"node-emv": "^1.0.23",
|
||||
"node-forge": "^1.3.1",
|
||||
"openai-chat-tokens": "^0.2.8",
|
||||
"openpgp": "^6.2.0",
|
||||
@@ -281,7 +288,7 @@
|
||||
"qrcode-vue3": "^1.7.1",
|
||||
"quicktype-core": "^23.1.3",
|
||||
"randexp": "^0.5.3",
|
||||
"regex": "^4.4.0",
|
||||
"regex": "^6.0.1",
|
||||
"rekcod": "^3.0.0",
|
||||
"resistor-data": "^1.1.1",
|
||||
"riimut": "^0.9.1",
|
||||
@@ -290,16 +297,17 @@
|
||||
"safe-license-list": "^0.1.2",
|
||||
"sandybox": "^1.1.2",
|
||||
"sanitize-html": "^2.14.0",
|
||||
"shamirs-secret-sharing": "^2.0.1",
|
||||
"shiki": "1.29.2",
|
||||
"silly-password-generator": "^1.0.29",
|
||||
"slashes": "^3.0.12",
|
||||
"smol-toml": "^1.4.2",
|
||||
"sms-segments-calculator": "^1.2.0",
|
||||
"spdx-satisfies": "^5.0.1",
|
||||
"spdx-satisfies": "^6.0.0",
|
||||
"sql-formatter": "^15.6.6",
|
||||
"sshpk": "^1.18.0",
|
||||
"staveless-futhark": "^0.6.1",
|
||||
"stringify-object": "^5.0.0",
|
||||
"stringify-object": "^6.0.0",
|
||||
"svg2png-wasm": "^1.4.1",
|
||||
"svgo": "^3.3.2",
|
||||
"swagger-ui-dist": "^5.27.0",
|
||||
@@ -311,15 +319,15 @@
|
||||
"to-single-quotes": "^4.0.0",
|
||||
"turndown": "^7.2.0",
|
||||
"ua-parser-js": "^2.0.4",
|
||||
"ulid": "^2.4.0",
|
||||
"ulid": "^3.0.1",
|
||||
"unicode-emoji-json": "^0.8.0",
|
||||
"unique-random": "^4.0.0",
|
||||
"unixcrypt-browser": "^2.0.4",
|
||||
"unpdf": "^1.1.0",
|
||||
"unplugin-auto-import": "^0.16.4",
|
||||
"utf8": "^3.0.0",
|
||||
"uuid": "^11.1.0",
|
||||
"vanilla-jsoneditor": "^0.23.8",
|
||||
"uuid": "^13.0.0",
|
||||
"vanilla-jsoneditor": "^3.10.0",
|
||||
"vue": "^3.3.4",
|
||||
"vue-color-wheel": "^0.1.1",
|
||||
"vue-i18n": "^11.1.9",
|
||||
@@ -342,7 +350,7 @@
|
||||
"xpath": "^0.0.34",
|
||||
"xpath-to-css": "^1.2.0",
|
||||
"xslt-processor": "^3.3.1",
|
||||
"yaml": "^2.8.0"
|
||||
"yaml": "^2.8.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@antfu/eslint-config": "^0.41.0",
|
||||
@@ -372,24 +380,24 @@
|
||||
"@types/luxon": "^3.4.2",
|
||||
"@types/markdown-it": "^13.0.9",
|
||||
"@types/memorystream": "^0.3.4",
|
||||
"@types/mime-types": "^2.1.4",
|
||||
"@types/mime-types": "^3.0.1",
|
||||
"@types/morsee": "^1.0.2",
|
||||
"@types/nanoid-dictionary": "^4.2.3",
|
||||
"@types/netmask": "^2.0.5",
|
||||
"@types/node": "^22.0.0",
|
||||
"@types/node-forge": "^1.3.13",
|
||||
"@types/node": "^24.10.1",
|
||||
"@types/node-forge": "^1.3.14",
|
||||
"@types/potrace": "^2.1.5",
|
||||
"@types/punycode": "^2.1.4",
|
||||
"@types/qrcode": "^1.5.5",
|
||||
"@types/sanitize-html": "^2.13.0",
|
||||
"@types/spdx-satisfies": "^0.1.2",
|
||||
"@types/spdx-satisfies": "^6.0.0",
|
||||
"@types/sshpk": "^1.17.4",
|
||||
"@types/stringify-object": "^4.0.5",
|
||||
"@types/text-encoding-utf-8": "^1.0.5",
|
||||
"@types/turndown": "^5.0.5",
|
||||
"@types/ua-parser-js": "^0.7.39",
|
||||
"@types/utf8": "^3.0.3",
|
||||
"@types/uuid": "^9.0.8",
|
||||
"@types/uuid": "^10.0.0",
|
||||
"@unocss/eslint-config": "^0.57.1",
|
||||
"@vitejs/plugin-vue": "^4.3.4",
|
||||
"@vitejs/plugin-vue-jsx": "^3.0.2",
|
||||
@@ -397,7 +405,10 @@
|
||||
"@vue/runtime-dom": "^3.3.4",
|
||||
"@vue/test-utils": "^2.3.2",
|
||||
"@vue/tsconfig": "^0.4.0",
|
||||
"axios": "^1.12.2",
|
||||
"commander": "^14.0.1",
|
||||
"consola": "^3.0.2",
|
||||
"dotenv": "^17.2.3",
|
||||
"eslint": "^8.47.0",
|
||||
"hygen": "^6.2.11",
|
||||
"jsdom": "^22.0.0",
|
||||
@@ -412,17 +423,18 @@
|
||||
"unplugin-vue-markdown": "^29.1.0",
|
||||
"vite": "^4.4.9",
|
||||
"vite-plugin-node-polyfills": "^0.23.0",
|
||||
"vite-plugin-pwa": "^1.0.1",
|
||||
"vite-plugin-pwa": "^1.1.0",
|
||||
"vite-plugin-splash-screen": "^0.2.0",
|
||||
"vite-plugin-wasm": "^3.4.1",
|
||||
"vite-svg-loader": "^4.0.0",
|
||||
"vitest": "^0.34.6",
|
||||
"vue-i18n-extract": "^2.0.7",
|
||||
"workbox-window": "^7.3.0",
|
||||
"zx": "^7.2.3"
|
||||
"zx": "^7.2.4"
|
||||
},
|
||||
"pnpm": {
|
||||
"overrides": {
|
||||
"@vueuse/shared": "13.9.0",
|
||||
"xlsx": "https://cdn.sheetjs.com/xlsx-0.20.2/xlsx-0.20.2.tgz"
|
||||
}
|
||||
},
|
||||
|
||||
Generated
+613
-726
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1 @@
|
||||
[]
|
||||
Binary file not shown.
Binary file not shown.
@@ -48,9 +48,22 @@ function processVueComponent(filePath, toolName) {
|
||||
return `${attr}: t('tools.${toolName}.texts.${key}')`;
|
||||
});
|
||||
|
||||
if (content.includes("/* NO EXTRACT SCRIPT */")) {
|
||||
console.log(`Marked to not extract: ${filePath}`);
|
||||
return;
|
||||
}
|
||||
|
||||
const hasAlreayI18n = filePath.endsWith('.vue')
|
||||
? /const\s+\{.*?\bt\b.*?\}\s+=\s+useI18n\(.*?\)/s.test(content)
|
||||
: /import\s+\{.*?\btranslate\b.*?\}\s+from\s+(['"])@\/plugins\/i18n\.plugin\1/s.test(content);
|
||||
if (hasAlreayI18n) {
|
||||
console.log(`Already extracted: ${filePath}`);
|
||||
return;
|
||||
}
|
||||
|
||||
if (filePath.endsWith('.vue')) {
|
||||
// Regex to find label or placeholder attributes
|
||||
regex = /(?<!:)((?:input-|output-)?(?:label|placeholder|title))="([^"]+)"/g;
|
||||
regex = /(?<!:)((?:[a-z]+-)?(?:label|placeholder|title))="([^"]+)"/g;
|
||||
content = content.replace(regex, (match, attr, text) => {
|
||||
if (!text?.trim()) {
|
||||
return match;
|
||||
@@ -88,13 +101,13 @@ function processVueComponent(filePath, toolName) {
|
||||
|
||||
if (filePath.endsWith('.vue')) {
|
||||
// Ensure the useI18n import exists
|
||||
if (!content.includes("const { t } = useI18n();")) {
|
||||
if (!hasAlreayI18n) {
|
||||
content = content.replace(/\<script setup( lang="ts")?\>/, "<script setup lang=\"ts\">\nimport { useI18n } from 'vue-i18n';\nconst { t } = useI18n();");
|
||||
}
|
||||
}
|
||||
else {
|
||||
// Ensure the useI18n import exists
|
||||
if (!content.includes("import { translate as t } from '@/plugins/i18n.plugin';")) {
|
||||
if (!hasAlreayI18n) {
|
||||
content = 'import { translate as t } from "@/plugins/i18n.plugin";\n' + content;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,131 @@
|
||||
import { promises as fs } from "fs";
|
||||
import path from 'node:path';
|
||||
import yaml from 'yaml';
|
||||
import dotenv from 'dotenv';
|
||||
import axios from 'axios';
|
||||
import { Command } from 'commander';
|
||||
|
||||
dotenv.config();
|
||||
|
||||
const program = new Command();
|
||||
const GOOGLE_TRANSLATE_API_KEY = process.env.GOOGLE_TRANSLATE_API_KEY;
|
||||
const TRANSLATE_ENDPOINT = 'https://translation.googleapis.com/language/translate/v2';
|
||||
|
||||
if (!GOOGLE_TRANSLATE_API_KEY) {
|
||||
console.error('❌ Missing GOOGLE_TRANSLATE_API_KEY environment variable');
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
program
|
||||
.name('translate-yaml')
|
||||
.description('Sync and translate YAML files using Google Translate')
|
||||
.requiredOption('-e, --english <file>', 'English YAML file')
|
||||
.requiredOption('-t, --targets <files...>', 'Target language YAML files')
|
||||
.option('--dry-run', 'Count characters to translate without sending API requests')
|
||||
.parse(process.argv);
|
||||
|
||||
const options = program.opts();
|
||||
|
||||
function removeUnusedKeys(targetFlat, englishFlat) {
|
||||
const cleaned = {};
|
||||
for (const key of Object.keys(targetFlat)) {
|
||||
if (englishFlat[key] !== undefined) {
|
||||
cleaned[key] = targetFlat[key];
|
||||
} else {
|
||||
console.log(`Removed unused key: ${key}`);
|
||||
}
|
||||
}
|
||||
return cleaned;
|
||||
}
|
||||
|
||||
async function translateText(text, targetLang) {
|
||||
const response = await axios.post(TRANSLATE_ENDPOINT, null, {
|
||||
params: {
|
||||
q: text,
|
||||
target: targetLang,
|
||||
key: GOOGLE_TRANSLATE_API_KEY,
|
||||
format: 'text',
|
||||
},
|
||||
});
|
||||
return response.data.data.translations[0].translatedText
|
||||
.replace(/\{'/, '{\'').replace(/'\}/, '}\'');
|
||||
}
|
||||
|
||||
function flattenYaml(obj, prefix = '') {
|
||||
const result = {};
|
||||
for (const [key, value] of Object.entries(obj)) {
|
||||
const fullKey = prefix ? `${prefix}.${key}` : key;
|
||||
if (typeof value === 'object' && value !== null) {
|
||||
Object.assign(result, flattenYaml(value, fullKey));
|
||||
} else {
|
||||
result[fullKey] = String(value);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
function unflattenYaml(flat) {
|
||||
const result = {};
|
||||
for (const [key, value] of Object.entries(flat)) {
|
||||
const keys = key.split('.');
|
||||
let current = result;
|
||||
keys.forEach((k, i) => {
|
||||
if (i === keys.length - 1) {
|
||||
current[k] = value;
|
||||
} else {
|
||||
current[k] = current[k] || {};
|
||||
current = current[k];
|
||||
}
|
||||
});
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
async function syncTranslations(englishFile, targetFiles, dryRun = false) {
|
||||
const englishYaml = yaml.parse(await fs.readFile(englishFile, 'utf8'));
|
||||
const englishFlat = flattenYaml(englishYaml);
|
||||
await fs.writeFile(englishFile, yaml.stringify(unflattenYaml(englishFlat)), 'utf8');
|
||||
|
||||
let totalChars = 0;
|
||||
|
||||
for (const file of targetFiles) {
|
||||
const langCode = path.basename(file, '.yml');
|
||||
if (langCode === 'en') {
|
||||
continue;
|
||||
}
|
||||
const targetYaml = yaml.parse(await fs.readFile(file, 'utf8')) || {};
|
||||
const targetFlat = removeUnusedKeys(flattenYaml(targetYaml), englishFlat);
|
||||
|
||||
const updatedFlat = { ...targetFlat };
|
||||
let langCharCount = 0;
|
||||
|
||||
for (const [key, englishText] of Object.entries(englishFlat)) {
|
||||
const needsTranslation = !targetFlat[key];
|
||||
if (needsTranslation) {
|
||||
if (dryRun) {
|
||||
langCharCount += englishText.length;
|
||||
} else {
|
||||
const translated = await translateText(englishText, langCode);
|
||||
updatedFlat[key] = translated;
|
||||
console.log(`Translated [${key}] to ${langCode}: ${translated}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (dryRun) {
|
||||
console.log(`Dry run for ${langCode}: ${langCharCount} characters to translate.`);
|
||||
totalChars += langCharCount;
|
||||
} else {
|
||||
const updatedYaml = unflattenYaml(updatedFlat);
|
||||
await fs.writeFile(file, yaml.stringify(updatedYaml), 'utf8');
|
||||
}
|
||||
}
|
||||
|
||||
if (dryRun) {
|
||||
console.log(`Total characters across all languages: ${totalChars}`);
|
||||
}
|
||||
}
|
||||
|
||||
syncTranslations(options.english, options.targets, options.dryRun)
|
||||
.then(() => console.log(options.dryRun ? 'Dry run complete.' : 'Translation sync complete.'))
|
||||
.catch(console.error);
|
||||
@@ -1,5 +1,5 @@
|
||||
<script lang="ts" setup>
|
||||
import { Home2, Menu2 } from '@vicons/tabler';
|
||||
import { Coffee, Home2, Menu2 } from '@vicons/tabler';
|
||||
import { NIcon, useThemeVars } from 'naive-ui';
|
||||
import { storeToRefs } from 'pinia';
|
||||
import { RouterLink } from 'vue-router';
|
||||
@@ -115,6 +115,20 @@ const tools = computed<ToolCategory[]>(() => [
|
||||
<div>
|
||||
<NavbarButtons v-if="!styleStore.isSmallScreen" />
|
||||
</div>
|
||||
|
||||
<c-tooltip position="bottom" :tooltip="$t('home.support')">
|
||||
<c-button
|
||||
round
|
||||
href="https://www.buymeacoffee.com/sharevb"
|
||||
rel="noopener"
|
||||
target="_blank"
|
||||
class="support-button"
|
||||
:bordered="false"
|
||||
>
|
||||
<span v-if="!styleStore.isSmallScreen" mr-2>{{ $t('home.buyMeACoffee') }}</span>
|
||||
<NIcon :component="Coffee" />
|
||||
</c-button>
|
||||
</c-tooltip>
|
||||
</div>
|
||||
<slot />
|
||||
</template>
|
||||
|
||||
@@ -5,6 +5,7 @@ import type { HeadObject } from '@vueuse/head';
|
||||
import VueMarkdown from 'vue-markdown-render';
|
||||
|
||||
import { useThemeVars } from 'naive-ui';
|
||||
import { useTheme } from '../ui/c-link/c-link.theme';
|
||||
import BaseLayout from './base.layout.vue';
|
||||
import FavoriteButton from '@/components/FavoriteButton.vue';
|
||||
import type { Tool } from '@/tools/tools.types';
|
||||
@@ -71,6 +72,8 @@ const toolFooter = computed<string>(() => {
|
||||
return ((npmPackages.length > 0 ? t('tools.tool.layout.text.made-with-npmpackages-join-n', [npmPackages.join(', ')]) : '') + footer).trim();
|
||||
});
|
||||
const themeVars = useThemeVars();
|
||||
|
||||
const linkTheme = useTheme();
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -166,4 +169,30 @@ const themeVars = useThemeVars();
|
||||
font-style: italic;
|
||||
}
|
||||
}
|
||||
::v-deep(.external-tool) a {
|
||||
line-height: inherit;
|
||||
font-family: inherit;
|
||||
font-size: inherit;
|
||||
border: none;
|
||||
cursor: pointer;
|
||||
text-decoration: none;
|
||||
font-weight: 400;
|
||||
color: v-bind('linkTheme.default.textColor');
|
||||
border-radius: 4px;
|
||||
transition: color cubic-bezier(0.4, 0, 0.2, 1) 0.3s;
|
||||
|
||||
outline-offset: 1px;
|
||||
|
||||
&:hover {
|
||||
color: v-bind('linkTheme.default.hover.textColor');
|
||||
}
|
||||
|
||||
&:active {
|
||||
color: v-bind('linkTheme.default.textColor');
|
||||
}
|
||||
|
||||
&:focus {
|
||||
color: v-bind('linkTheme.default.outline.color');
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Vendored
-2
@@ -1,2 +0,0 @@
|
||||
const createModule: EmscriptenModuleFactory;
|
||||
export default createModule;
|
||||
@@ -1,127 +0,0 @@
|
||||
|
||||
var Module = (() => {
|
||||
var _scriptDir = typeof document !== 'undefined' && document.currentScript ? document.currentScript.src : undefined;
|
||||
if (typeof __filename !== 'undefined') _scriptDir = _scriptDir || __filename;
|
||||
return (
|
||||
function(Module) {
|
||||
Module = Module || {};
|
||||
|
||||
|
||||
var d;d||(d=typeof Module !== 'undefined' ? Module : {});var aa,ba;d.ready=new Promise(function(a,b){aa=a;ba=b});d.noInitialRun=!0;var ca=Object.assign({},d),da=[],ea="./this.program",fa=(a,b)=>{throw b;},ha="object"==typeof window,m="function"==typeof importScripts,ia="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,q="",ja,ka,la,fs,t,ma;
|
||||
if(ia)q=m?require("path").dirname(q)+"/":__dirname+"/",ma=()=>{t||(fs=require("fs"),t=require("path"))},ja=function(a,b){ma();a=t.normalize(a);return fs.readFileSync(a,b?void 0:"utf8")},la=a=>{a=ja(a,!0);a.buffer||(a=new Uint8Array(a));return a},ka=(a,b,c)=>{ma();a=t.normalize(a);fs.readFile(a,function(e,f){e?c(e):b(f.buffer)})},1<process.argv.length&&(ea=process.argv[1].replace(/\\/g,"/")),da=process.argv.slice(2),process.on("uncaughtException",function(a){if(!(a instanceof na))throw a;}),process.on("unhandledRejection",
|
||||
function(a){throw a;}),fa=(a,b)=>{if(noExitRuntime)throw process.exitCode=a,b;b instanceof na||v("exiting due to exception: "+b);process.exit(a)},d.inspect=function(){return"[Emscripten Module object]"};else if(ha||m)m?q=self.location.href:"undefined"!=typeof document&&document.currentScript&&(q=document.currentScript.src),_scriptDir&&(q=_scriptDir),0!==q.indexOf("blob:")?q=q.substr(0,q.replace(/[?#].*/,"").lastIndexOf("/")+1):q="",ja=a=>{var b=new XMLHttpRequest;b.open("GET",a,!1);b.send(null);return b.responseText},
|
||||
m&&(la=a=>{var b=new XMLHttpRequest;b.open("GET",a,!1);b.responseType="arraybuffer";b.send(null);return new Uint8Array(b.response)}),ka=(a,b,c)=>{var e=new XMLHttpRequest;e.open("GET",a,!0);e.responseType="arraybuffer";e.onload=()=>{200==e.status||0==e.status&&e.response?b(e.response):c()};e.onerror=c;e.send(null)};var oa=console.log.bind(console),v=console.warn.bind(console);Object.assign(d,ca);ca=null;var z=0,noExitRuntime=!0;"object"!=typeof WebAssembly&&A("no native wasm support detected");
|
||||
var pa,qa=!1,ra,sa="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;
|
||||
function B(a,b){for(var c=b+NaN,e=b;a[e]&&!(e>=c);)++e;if(16<e-b&&a.buffer&&sa)return sa.decode(a.subarray(b,e));for(c="";b<e;){var f=a[b++];if(f&128){var g=a[b++]&63;if(192==(f&224))c+=String.fromCharCode((f&31)<<6|g);else{var k=a[b++]&63;f=224==(f&240)?(f&15)<<12|g<<6|k:(f&7)<<18|g<<12|k<<6|a[b++]&63;65536>f?c+=String.fromCharCode(f):(f-=65536,c+=String.fromCharCode(55296|f>>10,56320|f&1023))}}else c+=String.fromCharCode(f)}return c}function C(a){return a?B(ta,a):""}
|
||||
function ua(a,b,c,e){if(!(0<e))return 0;var f=c;e=c+e-1;for(var g=0;g<a.length;++g){var k=a.charCodeAt(g);if(55296<=k&&57343>=k){var l=a.charCodeAt(++g);k=65536+((k&1023)<<10)|l&1023}if(127>=k){if(c>=e)break;b[c++]=k}else{if(2047>=k){if(c+1>=e)break;b[c++]=192|k>>6}else{if(65535>=k){if(c+2>=e)break;b[c++]=224|k>>12}else{if(c+3>=e)break;b[c++]=240|k>>18;b[c++]=128|k>>12&63}b[c++]=128|k>>6&63}b[c++]=128|k&63}}b[c]=0;return c-f}
|
||||
function va(a){for(var b=0,c=0;c<a.length;++c){var e=a.charCodeAt(c);55296<=e&&57343>=e&&(e=65536+((e&1023)<<10)|a.charCodeAt(++c)&1023);127>=e?++b:b=2047>=e?b+2:65535>=e?b+3:b+4}return b}function wa(a){var b=va(a)+1,c=xa(b);c&&ua(a,D,c,b);return c}function ya(a){var b=va(a)+1,c=za(b);ua(a,D,c,b);return c}var Aa,D,ta,Ba,E,G,Ca;
|
||||
function Da(){var a=pa.buffer;Aa=a;d.HEAP8=D=new Int8Array(a);d.HEAP16=Ba=new Int16Array(a);d.HEAP32=E=new Int32Array(a);d.HEAPU8=ta=new Uint8Array(a);d.HEAPU16=new Uint16Array(a);d.HEAPU32=G=new Uint32Array(a);d.HEAPF32=new Float32Array(a);d.HEAPF64=new Float64Array(a);d.HEAP64=Ca=new BigInt64Array(a);d.HEAPU64=new BigUint64Array(a)}var Ea,Fa=[],Ga=[],Ha=[],Ia=[],H=0,Ja=null,Ka=null;function La(){H--;if(0==H&&(null!==Ja&&(clearInterval(Ja),Ja=null),Ka)){var a=Ka;Ka=null;a()}}
|
||||
function A(a){a="Aborted("+a+")";v(a);qa=!0;ra=1;a=new WebAssembly.RuntimeError(a+". Build with -sASSERTIONS for more info.");ba(a);throw a;}function Ma(){return K.startsWith("data:application/octet-stream;base64,")}var K;K="qpdf.wasm";if(!Ma()){var Na=K;K=d.locateFile?d.locateFile(Na,q):q+Na}function Oa(){var a=K;try{if(la)return la(a);throw"both async and sync fetching of the wasm failed";}catch(b){A(b)}}
|
||||
function Pa(){if(ha||m){if("function"==typeof fetch&&!K.startsWith("file://"))return fetch(K,{credentials:"same-origin"}).then(function(a){if(!a.ok)throw"failed to load wasm binary file at '"+K+"'";return a.arrayBuffer()}).catch(function(){return Oa()});if(ka)return new Promise(function(a,b){ka(K,function(c){a(new Uint8Array(c))},b)})}return Promise.resolve().then(function(){return Oa()})}
|
||||
function Qa(a){for(;0<a.length;){var b=a.shift();if("function"==typeof b)b(d);else{var c=b.ld;"number"==typeof c?void 0===b.vb?L(c)():L(c)(b.vb):c(void 0===b.vb?null:b.vb)}}}function L(a){return Ea.get(a)}var Ra=[],Sa=0,M=0;
|
||||
function N(a){this.eb=a;this.ta=a-24;this.ed=function(b){G[this.ta+4>>2]=b};this.Ia=function(){return G[this.ta+4>>2]};this.Yc=function(b){G[this.ta+8>>2]=b};this.Gc=function(){return G[this.ta+8>>2]};this.cd=function(){E[this.ta>>2]=0};this.Nb=function(b){D[this.ta+12>>0]=b?1:0};this.Tc=function(){return 0!=D[this.ta+12>>0]};this.Ob=function(b){D[this.ta+13>>0]=b?1:0};this.fc=function(){return 0!=D[this.ta+13>>0]};this.Ma=function(b,c){this.Ya(0);this.ed(b);this.Yc(c);this.cd();this.Nb(!1);this.Ob(!1)};
|
||||
this.Oc=function(){E[this.ta>>2]+=1};this.Uc=function(){var b=E[this.ta>>2];E[this.ta>>2]=b-1;return 1===b};this.Ya=function(b){G[this.ta+16>>2]=b};this.Sc=function(){return G[this.ta+16>>2]};this.Wc=function(){if(Ta(this.Ia()))return G[this.eb>>2];var b=this.Sc();return 0!==b?b:this.eb}}function Ua(a){return Va((new N(a)).ta)}
|
||||
var Wa=(a,b)=>{for(var c=0,e=a.length-1;0<=e;e--){var f=a[e];"."===f?a.splice(e,1):".."===f?(a.splice(e,1),c++):c&&(a.splice(e,1),c--)}if(b)for(;c;c--)a.unshift("..");return a},O=a=>{var b="/"===a.charAt(0),c="/"===a.substr(-1);(a=Wa(a.split("/").filter(e=>!!e),!b).join("/"))||b||(a=".");a&&c&&(a+="/");return(b?"/":"")+a},Xa=a=>{var b=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(a).slice(1);a=b[0];b=b[1];if(!a&&!b)return".";b&&(b=b.substr(0,b.length-1));return a+b},P=a=>{if("/"===
|
||||
a)return"/";a=O(a);a=a.replace(/\/$/,"");var b=a.lastIndexOf("/");return-1===b?a:a.substr(b+1)};function Ya(){var a=Array.prototype.slice.call(arguments,0);return O(a.join("/"))}var Q=(a,b)=>O(a+"/"+b);function Za(){if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues){var a=new Uint8Array(1);return function(){crypto.getRandomValues(a);return a[0]}}if(ia)try{var b=require("crypto");return function(){return b.randomBytes(1)[0]}}catch(c){}return function(){A("randomDevice")}}
|
||||
function R(){for(var a="",b=!1,c=arguments.length-1;-1<=c&&!b;c--){b=0<=c?arguments[c]:S.cwd();if("string"!=typeof b)throw new TypeError("Arguments to path.resolve must be strings");if(!b)return"";a=b+"/"+a;b="/"===b.charAt(0)}a=Wa(a.split("/").filter(e=>!!e),!b).join("/");return(b?"/":"")+a||"."}
|
||||
var $a=(a,b)=>{function c(k){for(var l=0;l<k.length&&""===k[l];l++);for(var p=k.length-1;0<=p&&""===k[p];p--);return l>p?[]:k.slice(l,p-l+1)}a=R(a).substr(1);b=R(b).substr(1);a=c(a.split("/"));b=c(b.split("/"));for(var e=Math.min(a.length,b.length),f=e,g=0;g<e;g++)if(a[g]!==b[g]){f=g;break}e=[];for(g=f;g<a.length;g++)e.push("..");e=e.concat(b.slice(f));return e.join("/")},ab=[];function bb(a,b){ab[a]={input:[],output:[],Za:b};S.Mb(a,cb)}
|
||||
var cb={open:function(a){var b=ab[a.node.rdev];if(!b)throw new S.na(43);a.tty=b;a.seekable=!1},close:function(a){a.tty.Za.flush(a.tty)},flush:function(a){a.tty.Za.flush(a.tty)},read:function(a,b,c,e){if(!a.tty||!a.tty.Za.ec)throw new S.na(60);for(var f=0,g=0;g<e;g++){try{var k=a.tty.Za.ec(a.tty)}catch(l){throw new S.na(29);}if(void 0===k&&0===f)throw new S.na(6);if(null===k||void 0===k)break;f++;b[c+g]=k}f&&(a.node.timestamp=Date.now());return f},write:function(a,b,c,e){if(!a.tty||!a.tty.Za.Ib)throw new S.na(60);
|
||||
try{for(var f=0;f<e;f++)a.tty.Za.Ib(a.tty,b[c+f])}catch(g){throw new S.na(29);}e&&(a.node.timestamp=Date.now());return f}},eb={ec:function(a){if(!a.input.length){var b=null;if(ia){var c=Buffer.alloc(256),e=0;try{e=fs.readSync(process.stdin.fd,c,0,256,-1)}catch(f){if(f.toString().includes("EOF"))e=0;else throw f;}0<e?b=c.slice(0,e).toString("utf-8"):b=null}else"undefined"!=typeof window&&"function"==typeof window.prompt?(b=window.prompt("Input: "),null!==b&&(b+="\n")):"function"==typeof readline&&
|
||||
(b=readline(),null!==b&&(b+="\n"));if(!b)return null;a.input=db(b,!0)}return a.input.shift()},Ib:function(a,b){null===b||10===b?(oa(B(a.output,0)),a.output=[]):0!=b&&a.output.push(b)},flush:function(a){a.output&&0<a.output.length&&(oa(B(a.output,0)),a.output=[])}},fb={Ib:function(a,b){null===b||10===b?(v(B(a.output,0)),a.output=[]):0!=b&&a.output.push(b)},flush:function(a){a.output&&0<a.output.length&&(v(B(a.output,0)),a.output=[])}},T={Fa:null,ra:function(){return T.createNode(null,"/",16895,0)},
|
||||
createNode:function(a,b,c,e){if(S.Hc(c)||S.isFIFO(c))throw new S.na(63);T.Fa||(T.Fa={dir:{node:{za:T.oa.za,wa:T.oa.wa,lookup:T.oa.lookup,Ca:T.oa.Ca,rename:T.oa.rename,unlink:T.oa.unlink,rmdir:T.oa.rmdir,readdir:T.oa.readdir,symlink:T.oa.symlink},stream:{Aa:T.qa.Aa}},file:{node:{za:T.oa.za,wa:T.oa.wa},stream:{Aa:T.qa.Aa,read:T.qa.read,write:T.qa.write,cb:T.qa.cb,Wa:T.qa.Wa,Xa:T.qa.Xa}},link:{node:{za:T.oa.za,wa:T.oa.wa,readlink:T.oa.readlink},stream:{}},Ub:{node:{za:T.oa.za,wa:T.oa.wa},stream:S.tc}});
|
||||
c=S.createNode(a,b,c,e);S.va(c.mode)?(c.oa=T.Fa.dir.node,c.qa=T.Fa.dir.stream,c.pa={}):S.isFile(c.mode)?(c.oa=T.Fa.file.node,c.qa=T.Fa.file.stream,c.ua=0,c.pa=null):S.Va(c.mode)?(c.oa=T.Fa.link.node,c.qa=T.Fa.link.stream):S.jb(c.mode)&&(c.oa=T.Fa.Ub.node,c.qa=T.Fa.Ub.stream);c.timestamp=Date.now();a&&(a.pa[b]=c,a.timestamp=c.timestamp);return c},nd:function(a){return a.pa?a.pa.subarray?a.pa.subarray(0,a.ua):new Uint8Array(a.pa):new Uint8Array(0)},$b:function(a,b){var c=a.pa?a.pa.length:0;c>=b||(b=
|
||||
Math.max(b,c*(1048576>c?2:1.125)>>>0),0!=c&&(b=Math.max(b,256)),c=a.pa,a.pa=new Uint8Array(b),0<a.ua&&a.pa.set(c.subarray(0,a.ua),0))},Vc:function(a,b){if(a.ua!=b)if(0==b)a.pa=null,a.ua=0;else{var c=a.pa;a.pa=new Uint8Array(b);c&&a.pa.set(c.subarray(0,Math.min(b,a.ua)));a.ua=b}},oa:{za:function(a){var b={};b.dev=S.jb(a.mode)?a.id:1;b.ino=a.id;b.mode=a.mode;b.nlink=1;b.uid=0;b.gid=0;b.rdev=a.rdev;S.va(a.mode)?b.size=4096:S.isFile(a.mode)?b.size=a.ua:S.Va(a.mode)?b.size=a.link.length:b.size=0;b.atime=
|
||||
new Date(a.timestamp);b.mtime=new Date(a.timestamp);b.ctime=new Date(a.timestamp);b.Ja=4096;b.blocks=Math.ceil(b.size/b.Ja);return b},wa:function(a,b){void 0!==b.mode&&(a.mode=b.mode);void 0!==b.timestamp&&(a.timestamp=b.timestamp);void 0!==b.size&&T.Vc(a,b.size)},lookup:function(){throw S.yb[44];},Ca:function(a,b,c,e){return T.createNode(a,b,c,e)},rename:function(a,b,c){if(S.va(a.mode)){try{var e=S.Ha(b,c)}catch(g){}if(e)for(var f in e.pa)throw new S.na(55);}delete a.parent.pa[a.name];a.parent.timestamp=
|
||||
Date.now();a.name=c;b.pa[c]=a;b.timestamp=a.parent.timestamp;a.parent=b},unlink:function(a,b){delete a.pa[b];a.timestamp=Date.now()},rmdir:function(a,b){var c=S.Ha(a,b),e;for(e in c.pa)throw new S.na(55);delete a.pa[b];a.timestamp=Date.now()},readdir:function(a){var b=[".",".."],c;for(c in a.pa)a.pa.hasOwnProperty(c)&&b.push(c);return b},symlink:function(a,b,c){a=T.createNode(a,b,41471,0);a.link=c;return a},readlink:function(a){if(!S.Va(a.mode))throw new S.na(28);return a.link}},qa:{read:function(a,
|
||||
b,c,e,f){var g=a.node.pa;if(f>=a.node.ua)return 0;a=Math.min(a.node.ua-f,e);if(8<a&&g.subarray)b.set(g.subarray(f,f+a),c);else for(e=0;e<a;e++)b[c+e]=g[f+e];return a},write:function(a,b,c,e,f,g){b.buffer===D.buffer&&(g=!1);if(!e)return 0;a=a.node;a.timestamp=Date.now();if(b.subarray&&(!a.pa||a.pa.subarray)){if(g)return a.pa=b.subarray(c,c+e),a.ua=e;if(0===a.ua&&0===f)return a.pa=b.slice(c,c+e),a.ua=e;if(f+e<=a.ua)return a.pa.set(b.subarray(c,c+e),f),e}T.$b(a,f+e);if(a.pa.subarray&&b.subarray)a.pa.set(b.subarray(c,
|
||||
c+e),f);else for(g=0;g<e;g++)a.pa[f+g]=b[c+g];a.ua=Math.max(a.ua,f+e);return e},Aa:function(a,b,c){1===c?b+=a.position:2===c&&S.isFile(a.node.mode)&&(b+=a.node.ua);if(0>b)throw new S.na(28);return b},cb:function(a,b,c){T.$b(a.node,b+c);a.node.ua=Math.max(a.node.ua,b+c)},Wa:function(a,b,c,e,f,g){if(0!==b)throw new S.na(28);if(!S.isFile(a.node.mode))throw new S.na(43);a=a.node.pa;if(g&2||a.buffer!==Aa){if(0<e||e+c<a.length)a.subarray?a=a.subarray(e,e+c):a=Array.prototype.slice.call(a,e,e+c);e=!0;A();
|
||||
c=void 0;if(!c)throw new S.na(48);D.set(a,c)}else e=!1,c=a.byteOffset;return{ta:c,qc:e}},Xa:function(a,b,c,e,f){if(!S.isFile(a.node.mode))throw new S.na(43);if(f&2)return 0;T.qa.write(a,b,0,e,c,!1);return 0}}};function gb(a,b,c){var e="al "+a;ka(a,function(f){f||A('Loading data file "'+a+'" failed (no arrayBuffer).');b(new Uint8Array(f));e&&La()},function(){if(c)c();else throw'Loading data file "'+a+'" failed.';});e&&H++}
|
||||
var hb={},U={lb:!1,Pb:()=>{U.lb=!!process.platform.match(/^win/);var a=process.binding("constants");a.fs&&(a=a.fs);U.ac={1024:a.O_APPEND,64:a.O_CREAT,128:a.O_EXCL,256:a.O_NOCTTY,0:a.O_RDONLY,2:a.O_RDWR,4096:a.O_SYNC,512:a.O_TRUNC,1:a.O_WRONLY,131072:a.O_NOFOLLOW}},xa:a=>hb[a.code],ra:a=>U.createNode(null,"/",U.Ta(a.$a.root),0),createNode:(a,b,c)=>{if(!S.va(c)&&!S.isFile(c)&&!S.Va(c))throw new S.na(28);a=S.createNode(a,b,c);a.oa=U.oa;a.qa=U.qa;return a},Ta:a=>{try{var b=fs.lstatSync(a);U.lb&&(b.mode=
|
||||
b.mode|(b.mode&292)>>2)}catch(c){if(!c.code)throw c;throw new S.na(U.xa(c));}return b.mode},Ba:a=>{for(var b=[];a.parent!==a;)b.push(a.name),a=a.parent;b.push(a.ra.$a.root);b.reverse();return Ya.apply(null,b)},Ec:a=>{a&=-2721793;var b=0,c;for(c in U.ac)a&c&&(b|=U.ac[c],a^=c);if(a)throw new S.na(28);return b},oa:{za:a=>{a=U.Ba(a);try{var b=fs.lstatSync(a)}catch(c){if(!c.code)throw c;throw new S.na(U.xa(c));}U.lb&&!b.Ja&&(b.Ja=4096);U.lb&&!b.blocks&&(b.blocks=(b.size+b.Ja-1)/b.Ja|0);return{dev:b.dev,
|
||||
ino:b.ino,mode:b.mode,nlink:b.nlink,uid:b.uid,gid:b.gid,rdev:b.rdev,size:b.size,atime:b.atime,mtime:b.mtime,ctime:b.ctime,Ja:b.Ja,blocks:b.blocks}},wa:(a,b)=>{var c=U.Ba(a);try{void 0!==b.mode&&(fs.chmodSync(c,b.mode),a.mode=b.mode),void 0!==b.size&&fs.truncateSync(c,b.size)}catch(e){if(!e.code)throw e;throw new S.na(U.xa(e));}},lookup:(a,b)=>{var c=Q(U.Ba(a),b);c=U.Ta(c);return U.createNode(a,b,c)},Ca:(a,b,c,e)=>{a=U.createNode(a,b,c,e);b=U.Ba(a);try{S.va(a.mode)?fs.mkdirSync(b,a.mode):fs.writeFileSync(b,
|
||||
"",{mode:a.mode})}catch(f){if(!f.code)throw f;throw new S.na(U.xa(f));}return a},rename:(a,b,c)=>{var e=U.Ba(a);b=Q(U.Ba(b),c);try{fs.renameSync(e,b)}catch(f){if(!f.code)throw f;throw new S.na(U.xa(f));}a.name=c},unlink:(a,b)=>{a=Q(U.Ba(a),b);try{fs.unlinkSync(a)}catch(c){if(!c.code)throw c;throw new S.na(U.xa(c));}},rmdir:(a,b)=>{a=Q(U.Ba(a),b);try{fs.rmdirSync(a)}catch(c){if(!c.code)throw c;throw new S.na(U.xa(c));}},readdir:a=>{a=U.Ba(a);try{return fs.readdirSync(a)}catch(b){if(!b.code)throw b;
|
||||
throw new S.na(U.xa(b));}},symlink:(a,b,c)=>{a=Q(U.Ba(a),b);try{fs.symlinkSync(c,a)}catch(e){if(!e.code)throw e;throw new S.na(U.xa(e));}},readlink:a=>{var b=U.Ba(a);try{return b=fs.readlinkSync(b),b=t.relative(t.resolve(a.ra.$a.root),b)}catch(c){if(!c.code)throw c;if("UNKNOWN"===c.code)throw new S.na(28);throw new S.na(U.xa(c));}}},qa:{open:a=>{var b=U.Ba(a.node);try{S.isFile(a.node.mode)&&(a.ib=fs.openSync(b,U.Ec(a.flags)))}catch(c){if(!c.code)throw c;throw new S.na(U.xa(c));}},close:a=>{try{S.isFile(a.node.mode)&&
|
||||
a.ib&&fs.closeSync(a.ib)}catch(b){if(!b.code)throw b;throw new S.na(U.xa(b));}},read:(a,b,c,e,f)=>{if(0===e)return 0;try{return fs.readSync(a.ib,Buffer.from(b.buffer),c,e,f)}catch(g){throw new S.na(U.xa(g));}},write:(a,b,c,e,f)=>{try{return fs.writeSync(a.ib,Buffer.from(b.buffer),c,e,f)}catch(g){throw new S.na(U.xa(g));}},Aa:(a,b,c)=>{if(1===c)b+=a.position;else if(2===c&&S.isFile(a.node.mode))try{b+=fs.fstatSync(a.ib).size}catch(e){throw new S.na(U.xa(e));}if(0>b)throw new S.na(28);return b},Wa:(a,
|
||||
b,c,e)=>{if(0!==b)throw new S.na(28);if(!S.isFile(a.node.mode))throw new S.na(43);A();U.qa.read(a,D,void 0,c,e);return{ta:void 0,qc:!0}},Xa:(a,b,c,e,f)=>{if(!S.isFile(a.node.mode))throw new S.na(43);if(f&2)return 0;U.qa.write(a,b,0,e,c,!1);return 0}}},V={sb:16895,bb:33279,Kb:null,ra:function(a){function b(g){g=g.split("/");for(var k=e,l=0;l<g.length-1;l++){var p=g.slice(0,l+1).join("/");f[p]||(f[p]=V.createNode(k,g[l],V.sb,0));k=f[p]}return k}function c(g){g=g.split("/");return g[g.length-1]}m||A();
|
||||
V.Kb||(V.Kb=new FileReaderSync);var e=V.createNode(null,"/",V.sb,0),f={};Array.prototype.forEach.call(a.$a.files||[],function(g){V.createNode(b(g.name),c(g.name),V.bb,0,g,g.lastModifiedDate)});(a.$a.blobs||[]).forEach(function(g){V.createNode(b(g.name),c(g.name),V.bb,0,g.data)});(a.$a.packages||[]).forEach(function(g){g.metadata.files.forEach(function(k){var l=k.filename.substr(1);V.createNode(b(l),c(l),V.bb,0,g.blob.slice(k.start,k.end))})});return e},createNode:function(a,b,c,e,f,g){e=S.createNode(a,
|
||||
b,c);e.mode=c;e.oa=V.oa;e.qa=V.qa;e.timestamp=(g||new Date).getTime();V.bb!==V.sb||A();c===V.bb?(e.size=f.size,e.pa=f):(e.size=4096,e.pa={});a&&(a.pa[b]=e);return e},oa:{za:function(a){return{dev:1,ino:a.id,mode:a.mode,nlink:1,uid:0,gid:0,rdev:void 0,size:a.size,atime:new Date(a.timestamp),mtime:new Date(a.timestamp),ctime:new Date(a.timestamp),Ja:4096,blocks:Math.ceil(a.size/4096)}},wa:function(a,b){void 0!==b.mode&&(a.mode=b.mode);void 0!==b.timestamp&&(a.timestamp=b.timestamp)},lookup:function(){throw new S.na(44);
|
||||
},Ca:function(){throw new S.na(63);},rename:function(){throw new S.na(63);},unlink:function(){throw new S.na(63);},rmdir:function(){throw new S.na(63);},readdir:function(a){var b=[".",".."],c;for(c in a.pa)a.pa.hasOwnProperty(c)&&b.push(c);return b},symlink:function(){throw new S.na(63);},readlink:function(){throw new S.na(63);}},qa:{read:function(a,b,c,e,f){if(f>=a.node.size)return 0;a=a.node.pa.slice(f,f+e);e=V.Kb.readAsArrayBuffer(a);b.set(new Uint8Array(e),c);return a.size},write:function(){throw new S.na(29);
|
||||
},Aa:function(a,b,c){1===c?b+=a.position:2===c&&S.isFile(a.node.mode)&&(b+=a.node.size);if(0>b)throw new S.na(28);return b}}},S={root:null,hb:[],Yb:{},streams:[],Mc:1,Ea:null,Xb:"/",Cb:!1,Bb:!0,na:null,yb:{},Cc:null,pb:0,sa:(a,b={})=>{a=R(S.cwd(),a);if(!a)return{path:"",node:null};b=Object.assign({xb:!0,Lb:0},b);if(8<b.Lb)throw new S.na(32);a=Wa(a.split("/").filter(k=>!!k),!1);for(var c=S.root,e="/",f=0;f<a.length;f++){var g=f===a.length-1;if(g&&b.parent)break;c=S.Ha(c,a[f]);e=O(e+"/"+a[f]);S.Na(c)&&
|
||||
(!g||g&&b.xb)&&(c=c.gb.root);if(!g||b.Da)for(g=0;S.Va(c.mode);)if(c=S.readlink(e),e=R(Xa(e),c),c=S.sa(e,{Lb:b.Lb+1}).node,40<g++)throw new S.na(32);}return{path:e,node:c}},La:a=>{for(var b;;){if(S.kb(a))return a=a.ra.kc,b?"/"!==a[a.length-1]?a+"/"+b:a+b:a;b=b?a.name+"/"+b:a.name;a=a.parent}},Ab:(a,b)=>{for(var c=0,e=0;e<b.length;e++)c=(c<<5)-c+b.charCodeAt(e)|0;return(a+c>>>0)%S.Ea.length},ic:a=>{var b=S.Ab(a.parent.id,a.name);a.Pa=S.Ea[b];S.Ea[b]=a},jc:a=>{var b=S.Ab(a.parent.id,a.name);if(S.Ea[b]===
|
||||
a)S.Ea[b]=a.Pa;else for(b=S.Ea[b];b;){if(b.Pa===a){b.Pa=a.Pa;break}b=b.Pa}},Ha:(a,b)=>{var c=S.Jc(a);if(c)throw new S.na(c,a);for(c=S.Ea[S.Ab(a.id,b)];c;c=c.Pa){var e=c.name;if(c.parent.id===a.id&&e===b)return c}return S.lookup(a,b)},createNode:(a,b,c,e)=>{a=new S.mc(a,b,c,e);S.ic(a);return a},wb:a=>{S.jc(a)},kb:a=>a===a.parent,Na:a=>!!a.gb,isFile:a=>32768===(a&61440),va:a=>16384===(a&61440),Va:a=>40960===(a&61440),jb:a=>8192===(a&61440),Hc:a=>24576===(a&61440),isFIFO:a=>4096===(a&61440),isSocket:a=>
|
||||
49152===(a&49152),Dc:{r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090},Lc:a=>{var b=S.Dc[a];if("undefined"==typeof b)throw Error("Unknown file open mode: "+a);return b},bc:a=>{var b=["r","w","rw"][a&3];a&512&&(b+="w");return b},Qa:(a,b)=>{if(S.Bb)return 0;if(!b.includes("r")||a.mode&292){if(b.includes("w")&&!(a.mode&146)||b.includes("x")&&!(a.mode&73))return 2}else return 2;return 0},Jc:a=>{var b=S.Qa(a,"x");return b?b:a.oa.lookup?0:2},Hb:(a,b)=>{try{return S.Ha(a,b),20}catch(c){}return S.Qa(a,"wx")},
|
||||
mb:(a,b,c)=>{try{var e=S.Ha(a,b)}catch(f){return f.ya}if(a=S.Qa(a,"wx"))return a;if(c){if(!S.va(e.mode))return 54;if(S.kb(e)||S.La(e)===S.cwd())return 10}else if(S.va(e.mode))return 31;return 0},Kc:(a,b)=>a?S.Va(a.mode)?32:S.va(a.mode)&&("r"!==S.bc(b)||b&512)?31:S.Qa(a,S.bc(b)):44,nc:4096,Nc:(a=0,b=S.nc)=>{for(;a<=b;a++)if(!S.streams[a])return a;throw new S.na(33);},Ua:a=>S.streams[a],Wb:(a,b,c)=>{S.tb||(S.tb=function(){this.ob={}},S.tb.prototype={object:{get:function(){return this.node},set:function(e){this.node=
|
||||
e}},flags:{get:function(){return this.ob.flags},set:function(e){this.ob.flags=e}},position:{get md(){return this.ob.position},set:function(e){this.ob.position=e}}});a=Object.assign(new S.tb,a);b=S.Nc(b,c);a.fd=b;return S.streams[b]=a},uc:a=>{S.streams[a]=null},tc:{open:a=>{a.qa=S.Fc(a.node.rdev).qa;a.qa.open&&a.qa.open(a)},Aa:()=>{throw new S.na(70);}},Gb:a=>a>>8,qd:a=>a&255,Oa:(a,b)=>a<<8|b,Mb:(a,b)=>{S.Yb[a]={qa:b}},Fc:a=>S.Yb[a],dc:a=>{var b=[];for(a=[a];a.length;){var c=a.pop();b.push(c);a.push.apply(a,
|
||||
c.hb)}return b},lc:(a,b)=>{function c(k){S.pb--;return b(k)}function e(k){if(k){if(!e.Bc)return e.Bc=!0,c(k)}else++g>=f.length&&c(null)}"function"==typeof a&&(b=a,a=!1);S.pb++;1<S.pb&&v("warning: "+S.pb+" FS.syncfs operations in flight at once, probably just doing extra work");var f=S.dc(S.root.ra),g=0;f.forEach(k=>{if(!k.type.lc)return e(null);k.type.lc(k,a,e)})},ra:(a,b,c)=>{var e="/"===c,f=!c;if(e&&S.root)throw new S.na(10);if(!e&&!f){var g=S.sa(c,{xb:!1});c=g.path;g=g.node;if(S.Na(g))throw new S.na(10);
|
||||
if(!S.va(g.mode))throw new S.na(54);}b={type:a,$a:b,kc:c,hb:[]};a=a.ra(b);a.ra=b;b.root=a;e?S.root=a:g&&(g.gb=b,g.ra&&g.ra.hb.push(b));return a},wd:a=>{a=S.sa(a,{xb:!1});if(!S.Na(a.node))throw new S.na(28);a=a.node;var b=a.gb,c=S.dc(b);Object.keys(S.Ea).forEach(e=>{for(e=S.Ea[e];e;){var f=e.Pa;c.includes(e.ra)&&S.wb(e);e=f}});a.gb=null;a.ra.hb.splice(a.ra.hb.indexOf(b),1)},lookup:(a,b)=>a.oa.lookup(a,b),Ca:(a,b,c)=>{var e=S.sa(a,{parent:!0}).node;a=P(a);if(!a||"."===a||".."===a)throw new S.na(28);
|
||||
var f=S.Hb(e,a);if(f)throw new S.na(f);if(!e.oa.Ca)throw new S.na(63);return e.oa.Ca(e,a,b,c)},create:(a,b)=>S.Ca(a,(void 0!==b?b:438)&4095|32768,0),mkdir:(a,b)=>S.Ca(a,(void 0!==b?b:511)&1023|16384,0),rd:(a,b)=>{a=a.split("/");for(var c="",e=0;e<a.length;++e)if(a[e]){c+="/"+a[e];try{S.mkdir(c,b)}catch(f){if(20!=f.ya)throw f;}}},nb:(a,b,c)=>{"undefined"==typeof c&&(c=b,b=438);return S.Ca(a,b|8192,c)},symlink:(a,b)=>{if(!R(a))throw new S.na(44);var c=S.sa(b,{parent:!0}).node;if(!c)throw new S.na(44);
|
||||
b=P(b);var e=S.Hb(c,b);if(e)throw new S.na(e);if(!c.oa.symlink)throw new S.na(63);return c.oa.symlink(c,b,a)},rename:(a,b)=>{var c=Xa(a),e=Xa(b),f=P(a),g=P(b);var k=S.sa(a,{parent:!0});var l=k.node;k=S.sa(b,{parent:!0});k=k.node;if(!l||!k)throw new S.na(44);if(l.ra!==k.ra)throw new S.na(75);var p=S.Ha(l,f);a=$a(a,e);if("."!==a.charAt(0))throw new S.na(28);a=$a(b,c);if("."!==a.charAt(0))throw new S.na(55);try{var n=S.Ha(k,g)}catch(r){}if(p!==n){b=S.va(p.mode);if(f=S.mb(l,f,b))throw new S.na(f);if(f=
|
||||
n?S.mb(k,g,b):S.Hb(k,g))throw new S.na(f);if(!l.oa.rename)throw new S.na(63);if(S.Na(p)||n&&S.Na(n))throw new S.na(10);if(k!==l&&(f=S.Qa(l,"w")))throw new S.na(f);S.jc(p);try{l.oa.rename(p,k,g)}catch(r){throw r;}finally{S.ic(p)}}},rmdir:a=>{var b=S.sa(a,{parent:!0}).node;a=P(a);var c=S.Ha(b,a),e=S.mb(b,a,!0);if(e)throw new S.na(e);if(!b.oa.rmdir)throw new S.na(63);if(S.Na(c))throw new S.na(10);b.oa.rmdir(b,a);S.wb(c)},readdir:a=>{a=S.sa(a,{Da:!0}).node;if(!a.oa.readdir)throw new S.na(54);return a.oa.readdir(a)},
|
||||
unlink:a=>{var b=S.sa(a,{parent:!0}).node;if(!b)throw new S.na(44);a=P(a);var c=S.Ha(b,a),e=S.mb(b,a,!1);if(e)throw new S.na(e);if(!b.oa.unlink)throw new S.na(63);if(S.Na(c))throw new S.na(10);b.oa.unlink(b,a);S.wb(c)},readlink:a=>{a=S.sa(a).node;if(!a)throw new S.na(44);if(!a.oa.readlink)throw new S.na(28);return R(S.La(a.parent),a.oa.readlink(a))},stat:(a,b)=>{a=S.sa(a,{Da:!b}).node;if(!a)throw new S.na(44);if(!a.oa.za)throw new S.na(63);return a.oa.za(a)},lstat:a=>S.stat(a,!0),chmod:(a,b,c)=>{a=
|
||||
"string"==typeof a?S.sa(a,{Da:!c}).node:a;if(!a.oa.wa)throw new S.na(63);a.oa.wa(a,{mode:b&4095|a.mode&-4096,timestamp:Date.now()})},lchmod:(a,b)=>{S.chmod(a,b,!0)},fchmod:(a,b)=>{a=S.Ua(a);if(!a)throw new S.na(8);S.chmod(a.node,b)},chown:(a,b,c,e)=>{a="string"==typeof a?S.sa(a,{Da:!e}).node:a;if(!a.oa.wa)throw new S.na(63);a.oa.wa(a,{timestamp:Date.now()})},lchown:(a,b,c)=>{S.chown(a,b,c,!0)},fchown:(a,b,c)=>{a=S.Ua(a);if(!a)throw new S.na(8);S.chown(a.node,b,c)},truncate:(a,b)=>{if(0>b)throw new S.na(28);
|
||||
a="string"==typeof a?S.sa(a,{Da:!0}).node:a;if(!a.oa.wa)throw new S.na(63);if(S.va(a.mode))throw new S.na(31);if(!S.isFile(a.mode))throw new S.na(28);var c=S.Qa(a,"w");if(c)throw new S.na(c);a.oa.wa(a,{size:b,timestamp:Date.now()})},kd:(a,b)=>{a=S.Ua(a);if(!a)throw new S.na(8);if(0===(a.flags&2097155))throw new S.na(28);S.truncate(a.node,b)},xd:(a,b,c)=>{a=S.sa(a,{Da:!0}).node;a.oa.wa(a,{timestamp:Math.max(b,c)})},open:(a,b,c)=>{if(""===a)throw new S.na(44);b="string"==typeof b?S.Lc(b):b;c=b&64?("undefined"==
|
||||
typeof c?438:c)&4095|32768:0;if("object"==typeof a)var e=a;else{a=O(a);try{e=S.sa(a,{Da:!(b&131072)}).node}catch(g){}}var f=!1;if(b&64)if(e){if(b&128)throw new S.na(20);}else e=S.Ca(a,c,0),f=!0;if(!e)throw new S.na(44);S.jb(e.mode)&&(b&=-513);if(b&65536&&!S.va(e.mode))throw new S.na(54);if(!f&&(c=S.Kc(e,b)))throw new S.na(c);b&512&&!f&&S.truncate(e,0);b&=-131713;e=S.Wb({node:e,path:S.La(e),flags:b,seekable:!0,position:0,qa:e.qa,dd:[],error:!1});e.qa.open&&e.qa.open(e);!d.logReadFiles||b&1||(S.Jb||
|
||||
(S.Jb={}),a in S.Jb||(S.Jb[a]=1));return e},close:a=>{if(S.fb(a))throw new S.na(8);a.zb&&(a.zb=null);try{a.qa.close&&a.qa.close(a)}catch(b){throw b;}finally{S.uc(a.fd)}a.fd=null},fb:a=>null===a.fd,Aa:(a,b,c)=>{if(S.fb(a))throw new S.na(8);if(!a.seekable||!a.qa.Aa)throw new S.na(70);if(0!=c&&1!=c&&2!=c)throw new S.na(28);a.position=a.qa.Aa(a,b,c);a.dd=[];return a.position},read:(a,b,c,e,f)=>{if(0>e||0>f)throw new S.na(28);if(S.fb(a))throw new S.na(8);if(1===(a.flags&2097155))throw new S.na(8);if(S.va(a.node.mode))throw new S.na(31);
|
||||
if(!a.qa.read)throw new S.na(28);var g="undefined"!=typeof f;if(!g)f=a.position;else if(!a.seekable)throw new S.na(70);b=a.qa.read(a,b,c,e,f);g||(a.position+=b);return b},write:(a,b,c,e,f,g)=>{if(0>e||0>f)throw new S.na(28);if(S.fb(a))throw new S.na(8);if(0===(a.flags&2097155))throw new S.na(8);if(S.va(a.node.mode))throw new S.na(31);if(!a.qa.write)throw new S.na(28);a.seekable&&a.flags&1024&&S.Aa(a,0,2);var k="undefined"!=typeof f;if(!k)f=a.position;else if(!a.seekable)throw new S.na(70);b=a.qa.write(a,
|
||||
b,c,e,f,g);k||(a.position+=b);return b},cb:(a,b,c)=>{if(S.fb(a))throw new S.na(8);if(0>b||0>=c)throw new S.na(28);if(0===(a.flags&2097155))throw new S.na(8);if(!S.isFile(a.node.mode)&&!S.va(a.node.mode))throw new S.na(43);if(!a.qa.cb)throw new S.na(138);a.qa.cb(a,b,c)},Wa:(a,b,c,e,f,g)=>{if(0!==(f&2)&&0===(g&2)&&2!==(a.flags&2097155))throw new S.na(2);if(1===(a.flags&2097155))throw new S.na(2);if(!a.qa.Wa)throw new S.na(43);return a.qa.Wa(a,b,c,e,f,g)},Xa:(a,b,c,e,f)=>a&&a.qa.Xa?a.qa.Xa(a,b,c,e,f):
|
||||
0,sd:()=>0,Db:(a,b,c)=>{if(!a.qa.Db)throw new S.na(59);return a.qa.Db(a,b,c)},readFile:(a,b={})=>{b.flags=b.flags||0;b.encoding=b.encoding||"binary";if("utf8"!==b.encoding&&"binary"!==b.encoding)throw Error('Invalid encoding type "'+b.encoding+'"');var c,e=S.open(a,b.flags);a=S.stat(a).size;var f=new Uint8Array(a);S.read(e,f,0,a,0);"utf8"===b.encoding?c=B(f,0):"binary"===b.encoding&&(c=f);S.close(e);return c},writeFile:(a,b,c={})=>{c.flags=c.flags||577;a=S.open(a,c.flags,c.mode);if("string"==typeof b){var e=
|
||||
new Uint8Array(va(b)+1);b=ua(b,e,0,e.length);S.write(a,e,0,b,void 0,c.sc)}else if(ArrayBuffer.isView(b))S.write(a,b,0,b.byteLength,void 0,c.sc);else throw Error("Unsupported data type");S.close(a)},cwd:()=>S.Xb,chdir:a=>{a=S.sa(a,{Da:!0});if(null===a.node)throw new S.na(44);if(!S.va(a.node.mode))throw new S.na(54);var b=S.Qa(a.node,"x");if(b)throw new S.na(b);S.Xb=a.path},wc:()=>{S.mkdir("/tmp");S.mkdir("/home");S.mkdir("/home/web_user")},vc:()=>{S.mkdir("/dev");S.Mb(S.Oa(1,3),{read:()=>0,write:(b,
|
||||
c,e,f)=>f});S.nb("/dev/null",S.Oa(1,3));bb(S.Oa(5,0),eb);bb(S.Oa(6,0),fb);S.nb("/dev/tty",S.Oa(5,0));S.nb("/dev/tty1",S.Oa(6,0));var a=Za();S.Ka("/dev","random",a);S.Ka("/dev","urandom",a);S.mkdir("/dev/shm");S.mkdir("/dev/shm/tmp")},zc:()=>{S.mkdir("/proc");var a=S.mkdir("/proc/self");S.mkdir("/proc/self/fd");S.ra({ra:()=>{var b=S.createNode(a,"fd",16895,73);b.oa={lookup:(c,e)=>{var f=S.Ua(+e);if(!f)throw new S.na(8);c={parent:null,ra:{kc:"fake"},oa:{readlink:()=>f.path}};return c.parent=c}};return b}},
|
||||
{},"/proc/self/fd")},Ac:()=>{d.stdin?S.Ka("/dev","stdin",d.stdin):S.symlink("/dev/tty","/dev/stdin");d.stdout?S.Ka("/dev","stdout",null,d.stdout):S.symlink("/dev/tty","/dev/stdout");d.stderr?S.Ka("/dev","stderr",null,d.stderr):S.symlink("/dev/tty1","/dev/stderr");S.open("/dev/stdin",0);S.open("/dev/stdout",1);S.open("/dev/stderr",1)},Zb:()=>{S.na||(S.na=function(a,b){this.node=b;this.Xc=function(c){this.ya=c};this.Xc(a);this.message="FS error"},S.na.prototype=Error(),S.na.prototype.constructor=S.na,
|
||||
[44].forEach(a=>{S.yb[a]=new S.na(a);S.yb[a].stack="<generic error, no stack>"}))},Pb:()=>{S.Zb();S.Ea=Array(4096);S.ra(T,{},"/");S.wc();S.vc();S.zc();S.Cc={MEMFS:T,NODEFS:U,WORKERFS:V}},Ma:(a,b,c)=>{S.Ma.Cb=!0;S.Zb();d.stdin=a||d.stdin;d.stdout=b||d.stdout;d.stderr=c||d.stderr;S.Ac()},td:()=>{S.Ma.Cb=!1;for(var a=0;a<S.streams.length;a++){var b=S.streams[a];b&&S.close(b)}},Ta:(a,b)=>{var c=0;a&&(c|=365);b&&(c|=146);return c},jd:(a,b)=>{a=S.ub(a,b);return a.exists?a.object:null},ub:(a,b)=>{try{var c=
|
||||
S.sa(a,{Da:!b});a=c.path}catch(f){}var e={kb:!1,exists:!1,error:0,name:null,path:null,object:null,Pc:!1,Rc:null,Qc:null};try{c=S.sa(a,{parent:!0}),e.Pc=!0,e.Rc=c.path,e.Qc=c.node,e.name=P(a),c=S.sa(a,{Da:!b}),e.exists=!0,e.path=c.path,e.object=c.node,e.name=c.node.name,e.kb="/"===c.path}catch(f){e.error=f.ya}return e},gd:(a,b)=>{a="string"==typeof a?a:S.La(a);for(b=b.split("/").reverse();b.length;){var c=b.pop();if(c){var e=O(a+"/"+c);try{S.mkdir(e)}catch(f){}a=e}}return e},xc:(a,b,c,e,f)=>{a=Q("string"==
|
||||
typeof a?a:S.La(a),b);e=S.Ta(e,f);return S.create(a,e)},Vb:(a,b,c,e,f,g)=>{var k=b;a&&(a="string"==typeof a?a:S.La(a),k=b?O(a+"/"+b):a);a=S.Ta(e,f);k=S.create(k,a);if(c){if("string"==typeof c){b=Array(c.length);e=0;for(f=c.length;e<f;++e)b[e]=c.charCodeAt(e);c=b}S.chmod(k,a|146);b=S.open(k,577);S.write(b,c,0,c.length,0,g);S.close(b);S.chmod(k,a)}return k},Ka:(a,b,c,e)=>{a=Q("string"==typeof a?a:S.La(a),b);b=S.Ta(!!c,!!e);S.Ka.Gb||(S.Ka.Gb=64);var f=S.Oa(S.Ka.Gb++,0);S.Mb(f,{open:g=>{g.seekable=!1},
|
||||
close:()=>{e&&e.buffer&&e.buffer.length&&e(10)},read:(g,k,l,p)=>{for(var n=0,r=0;r<p;r++){try{var w=c()}catch(y){throw new S.na(29);}if(void 0===w&&0===n)throw new S.na(6);if(null===w||void 0===w)break;n++;k[l+r]=w}n&&(g.node.timestamp=Date.now());return n},write:(g,k,l,p)=>{for(var n=0;n<p;n++)try{e(k[l+n])}catch(r){throw new S.na(29);}p&&(g.node.timestamp=Date.now());return n}});return S.nb(a,b,f)},cc:a=>{if(a.Eb||a.Ic||a.link||a.pa)return!0;if("undefined"!=typeof XMLHttpRequest)throw Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");
|
||||
if(ja)try{a.pa=db(ja(a.url),!0),a.ua=a.pa.length}catch(b){throw new S.na(29);}else throw Error("Cannot load without read() or XMLHttpRequest.");},yc:(a,b,c,e,f)=>{function g(){this.Fb=!1;this.Ia=[]}g.prototype.get=function(n){if(!(n>this.length-1||0>n)){var r=n%this.chunkSize;return this.hc(n/this.chunkSize|0)[r]}};g.prototype.Ya=function(n){this.hc=n};g.prototype.Tb=function(){var n=new XMLHttpRequest;n.open("HEAD",c,!1);n.send(null);if(!(200<=n.status&&300>n.status||304===n.status))throw Error("Couldn't load "+
|
||||
c+". Status: "+n.status);var r=Number(n.getResponseHeader("Content-length")),w,y=(w=n.getResponseHeader("Accept-Ranges"))&&"bytes"===w;n=(w=n.getResponseHeader("Content-Encoding"))&&"gzip"===w;var h=1048576;y||(h=r);var u=this;u.Ya(x=>{var F=x*h,I=(x+1)*h-1;I=Math.min(I,r-1);if("undefined"==typeof u.Ia[x]){var Ab=u.Ia;if(F>I)throw Error("invalid range ("+F+", "+I+") or no bytes requested!");if(I>r-1)throw Error("only "+r+" bytes available! programmer error!");var J=new XMLHttpRequest;J.open("GET",
|
||||
c,!1);r!==h&&J.setRequestHeader("Range","bytes="+F+"-"+I);J.responseType="arraybuffer";J.overrideMimeType&&J.overrideMimeType("text/plain; charset=x-user-defined");J.send(null);if(!(200<=J.status&&300>J.status||304===J.status))throw Error("Couldn't load "+c+". Status: "+J.status);F=void 0!==J.response?new Uint8Array(J.response||[]):db(J.responseText||"",!0);Ab[x]=F}if("undefined"==typeof u.Ia[x])throw Error("doXHR failed!");return u.Ia[x]});if(n||!r)h=r=1,h=r=this.hc(0).length,oa("LazyFiles on gzip forces download of the whole file when length is accessed");
|
||||
this.pc=r;this.oc=h;this.Fb=!0};if("undefined"!=typeof XMLHttpRequest){if(!m)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var k=new g;Object.defineProperties(k,{length:{get:function(){this.Fb||this.Tb();return this.pc}},chunkSize:{get:function(){this.Fb||this.Tb();return this.oc}}});k={Eb:!1,pa:k}}else k={Eb:!1,url:c};var l=S.xc(a,b,k,e,f);k.pa?l.pa=k.pa:k.url&&(l.pa=null,l.url=k.url);Object.defineProperties(l,{ua:{get:function(){return this.pa.length}}});
|
||||
var p={};Object.keys(l.qa).forEach(n=>{var r=l.qa[n];p[n]=function(){S.cc(l);return r.apply(null,arguments)}});p.read=(n,r,w,y,h)=>{S.cc(l);n=n.node.pa;if(h>=n.length)return 0;y=Math.min(n.length-h,y);if(n.slice)for(var u=0;u<y;u++)r[w+u]=n[h+u];else for(u=0;u<y;u++)r[w+u]=n.get(h+u);return y};l.qa=p;return l},hd:(a,b,c,e,f,g,k,l,p,n)=>{function r(y){function h(u){n&&n();l||S.Vb(a,b,u,e,f,p);g&&g();La()}ib.od(y,w,h,()=>{k&&k();La()})||h(y)}var w=b?R(O(a+"/"+b)):a;H++;"string"==typeof c?gb(c,y=>r(y),
|
||||
k):r(c)},indexedDB:()=>window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB,Rb:()=>"EM_FS_"+window.location.pathname,Sb:20,ab:"FILE_DATA",ud:(a,b,c)=>{b=b||(()=>{});c=c||(()=>{});var e=S.indexedDB();try{var f=e.open(S.Rb(),S.Sb)}catch(g){return c(g)}f.onupgradeneeded=()=>{oa("creating db");f.result.createObjectStore(S.ab)};f.onsuccess=()=>{var g=f.result.transaction([S.ab],"readwrite"),k=g.objectStore(S.ab),l=0,p=0,n=a.length;a.forEach(r=>{r=k.put(S.ub(r).object.pa,r);
|
||||
r.onsuccess=()=>{l++;l+p==n&&(0==p?b():c())};r.onerror=()=>{p++;l+p==n&&(0==p?b():c())}});g.onerror=c};f.onerror=c},pd:(a,b,c)=>{b=b||(()=>{});c=c||(()=>{});var e=S.indexedDB();try{var f=e.open(S.Rb(),S.Sb)}catch(g){return c(g)}f.onupgradeneeded=c;f.onsuccess=()=>{var g=f.result;try{var k=g.transaction([S.ab],"readonly")}catch(w){c(w);return}var l=k.objectStore(S.ab),p=0,n=0,r=a.length;a.forEach(w=>{var y=l.get(w);y.onsuccess=()=>{S.ub(w).exists&&S.unlink(w);S.Vb(Xa(w),P(w),y.result,!0,!0,!0);p++;
|
||||
p+n==r&&(0==n?b():c())};y.onerror=()=>{n++;p+n==r&&(0==n?b():c())}});k.onerror=c};f.onerror=c}};function jb(a,b){if("/"===b.charAt(0))return b;if(-100===a)a=S.cwd();else{a=S.Ua(a);if(!a)throw new S.na(8);a=a.path}if(0==b.length)throw new S.na(44);return O(a+"/"+b)}var kb=void 0;function W(){kb+=4;return E[kb-4>>2]}function lb(a){a=S.Ua(a);if(!a)throw new S.na(8);return a}
|
||||
function mb(a,b,c){function e(p){return(p=p.toTimeString().match(/\(([A-Za-z ]+)\)$/))?p[1]:"GMT"}var f=(new Date).getFullYear(),g=new Date(f,0,1),k=new Date(f,6,1);f=g.getTimezoneOffset();var l=k.getTimezoneOffset();E[a>>2]=60*Math.max(f,l);E[b>>2]=Number(f!=l);a=e(g);b=e(k);a=wa(a);b=wa(b);l<f?(E[c>>2]=a,E[c+4>>2]=b):(E[c>>2]=b,E[c+4>>2]=a)}function nb(a,b,c){nb.rc||(nb.rc=!0,mb(a,b,c))}var ob={};
|
||||
function pb(){if(!qb){var a={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:ea||"./this.program"},b;for(b in ob)void 0===ob[b]?delete a[b]:a[b]=ob[b];var c=[];for(b in a)c.push(b+"="+a[b]);qb=c}return qb}var qb;function rb(a){return 0===a%4&&(0!==a%100||0===a%400)}var sb=[31,29,31,30,31,30,31,31,30,31,30,31],tb=[31,28,31,30,31,30,31,31,30,31,30,31];
|
||||
function ub(a,b,c,e){function f(h,u,x){for(h="number"==typeof h?h.toString():h||"";h.length<u;)h=x[0]+h;return h}function g(h,u){return f(h,u,"0")}function k(h,u){function x(I){return 0>I?-1:0<I?1:0}var F;0===(F=x(h.getFullYear()-u.getFullYear()))&&0===(F=x(h.getMonth()-u.getMonth()))&&(F=x(h.getDate()-u.getDate()));return F}function l(h){switch(h.getDay()){case 0:return new Date(h.getFullYear()-1,11,29);case 1:return h;case 2:return new Date(h.getFullYear(),0,3);case 3:return new Date(h.getFullYear(),
|
||||
0,2);case 4:return new Date(h.getFullYear(),0,1);case 5:return new Date(h.getFullYear()-1,11,31);case 6:return new Date(h.getFullYear()-1,11,30)}}function p(h){var u=h.Ra;for(h=new Date((new Date(h.Sa+1900,0,1)).getTime());0<u;){var x=h.getMonth(),F=(rb(h.getFullYear())?sb:tb)[x];if(u>F-h.getDate())u-=F-h.getDate()+1,h.setDate(1),11>x?h.setMonth(x+1):(h.setMonth(0),h.setFullYear(h.getFullYear()+1));else{h.setDate(h.getDate()+u);break}}x=new Date(h.getFullYear()+1,0,4);u=l(new Date(h.getFullYear(),
|
||||
0,4));x=l(x);return 0>=k(u,h)?0>=k(x,h)?h.getFullYear()+1:h.getFullYear():h.getFullYear()-1}var n=E[e+40>>2];e={ad:E[e>>2],$c:E[e+4>>2],qb:E[e+8>>2],Qb:E[e+12>>2],rb:E[e+16>>2],Sa:E[e+20>>2],Ga:E[e+24>>2],Ra:E[e+28>>2],vd:E[e+32>>2],Zc:E[e+36>>2],bd:n?C(n):""};c=C(c);n={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d",
|
||||
"%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var r in n)c=c.replace(new RegExp(r,"g"),n[r]);var w="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),y="January February March April May June July August September October November December".split(" ");n={"%a":function(h){return w[h.Ga].substring(0,3)},"%A":function(h){return w[h.Ga]},"%b":function(h){return y[h.rb].substring(0,3)},"%B":function(h){return y[h.rb]},
|
||||
"%C":function(h){return g((h.Sa+1900)/100|0,2)},"%d":function(h){return g(h.Qb,2)},"%e":function(h){return f(h.Qb,2," ")},"%g":function(h){return p(h).toString().substring(2)},"%G":function(h){return p(h)},"%H":function(h){return g(h.qb,2)},"%I":function(h){h=h.qb;0==h?h=12:12<h&&(h-=12);return g(h,2)},"%j":function(h){for(var u=0,x=0;x<=h.rb-1;u+=(rb(h.Sa+1900)?sb:tb)[x++]);return g(h.Qb+u,3)},"%m":function(h){return g(h.rb+1,2)},"%M":function(h){return g(h.$c,2)},"%n":function(){return"\n"},"%p":function(h){return 0<=
|
||||
h.qb&&12>h.qb?"AM":"PM"},"%S":function(h){return g(h.ad,2)},"%t":function(){return"\t"},"%u":function(h){return h.Ga||7},"%U":function(h){return g(Math.floor((h.Ra+7-h.Ga)/7),2)},"%V":function(h){var u=Math.floor((h.Ra+7-(h.Ga+6)%7)/7);2>=(h.Ga+371-h.Ra-2)%7&&u++;if(u)53==u&&(x=(h.Ga+371-h.Ra)%7,4==x||3==x&&rb(h.Sa)||(u=1));else{u=52;var x=(h.Ga+7-h.Ra-1)%7;(4==x||5==x&&rb(h.Sa%400-1))&&u++}return g(u,2)},"%w":function(h){return h.Ga},"%W":function(h){return g(Math.floor((h.Ra+7-(h.Ga+6)%7)/7),2)},
|
||||
"%y":function(h){return(h.Sa+1900).toString().substring(2)},"%Y":function(h){return h.Sa+1900},"%z":function(h){h=h.Zc;var u=0<=h;h=Math.abs(h)/60;return(u?"+":"-")+String("0000"+(h/60*100+h%60)).slice(-4)},"%Z":function(h){return h.bd},"%%":function(){return"%"}};c=c.replace(/%%/g,"\x00\x00");for(r in n)c.includes(r)&&(c=c.replace(new RegExp(r,"g"),n[r](e)));c=c.replace(/\0\0/g,"%");r=db(c,!1);if(r.length>b)return 0;D.set(r,a);return r.length-1}
|
||||
function vb(a,b,c,e){a||(a=this);this.parent=a;this.ra=a.ra;this.gb=null;this.id=S.Mc++;this.name=b;this.mode=c;this.oa={};this.qa={};this.rdev=e}Object.defineProperties(vb.prototype,{read:{get:function(){return 365===(this.mode&365)},set:function(a){a?this.mode|=365:this.mode&=-366}},write:{get:function(){return 146===(this.mode&146)},set:function(a){a?this.mode|=146:this.mode&=-147}},Ic:{get:function(){return S.va(this.mode)}},Eb:{get:function(){return S.jb(this.mode)}}});S.mc=vb;S.Pb();var ib;
|
||||
ia&&(ma(),U.Pb());
|
||||
hb={EPERM:63,ENOENT:44,ESRCH:71,EINTR:27,EIO:29,ENXIO:60,E2BIG:1,ENOEXEC:45,EBADF:8,ECHILD:12,EAGAIN:6,EWOULDBLOCK:6,ENOMEM:48,EACCES:2,EFAULT:21,ENOTBLK:105,EBUSY:10,EEXIST:20,EXDEV:75,ENODEV:43,ENOTDIR:54,EISDIR:31,EINVAL:28,ENFILE:41,EMFILE:33,ENOTTY:59,ETXTBSY:74,EFBIG:22,ENOSPC:51,ESPIPE:70,EROFS:69,EMLINK:34,EPIPE:64,EDOM:18,ERANGE:68,ENOMSG:49,EIDRM:24,ECHRNG:106,EL2NSYNC:156,EL3HLT:107,EL3RST:108,ELNRNG:109,EUNATCH:110,ENOCSI:111,EL2HLT:112,EDEADLK:16,ENOLCK:46,EBADE:113,EBADR:114,EXFULL:115,
|
||||
ENOANO:104,EBADRQC:103,EBADSLT:102,EDEADLOCK:16,EBFONT:101,ENOSTR:100,ENODATA:116,ETIME:117,ENOSR:118,ENONET:119,ENOPKG:120,EREMOTE:121,ENOLINK:47,EADV:122,ESRMNT:123,ECOMM:124,EPROTO:65,EMULTIHOP:36,EDOTDOT:125,EBADMSG:9,ENOTUNIQ:126,EBADFD:127,EREMCHG:128,ELIBACC:129,ELIBBAD:130,ELIBSCN:131,ELIBMAX:132,ELIBEXEC:133,ENOSYS:52,ENOTEMPTY:55,ENAMETOOLONG:37,ELOOP:32,EOPNOTSUPP:138,EPFNOSUPPORT:139,ECONNRESET:15,ENOBUFS:42,EAFNOSUPPORT:5,EPROTOTYPE:67,ENOTSOCK:57,ENOPROTOOPT:50,ESHUTDOWN:140,ECONNREFUSED:14,
|
||||
EADDRINUSE:3,ECONNABORTED:13,ENETUNREACH:40,ENETDOWN:38,ETIMEDOUT:73,EHOSTDOWN:142,EHOSTUNREACH:23,EINPROGRESS:26,EALREADY:7,EDESTADDRREQ:17,EMSGSIZE:35,EPROTONOSUPPORT:66,ESOCKTNOSUPPORT:137,EADDRNOTAVAIL:4,ENETRESET:39,EISCONN:30,ENOTCONN:53,ETOOMANYREFS:141,EUSERS:136,EDQUOT:19,ESTALE:72,ENOTSUP:138,ENOMEDIUM:148,EILSEQ:25,EOVERFLOW:61,ECANCELED:11,ENOTRECOVERABLE:56,EOWNERDEAD:62,ESTRPIPE:135};function db(a,b){var c=Array(va(a)+1);a=ua(a,c,0,c.length);b&&(c.length=a);return c}
|
||||
var Tb={n:function(a,b,c,e){A("Assertion failed: "+C(a)+", at: "+[b?C(b):"unknown filename",c,e?C(e):"unknown function"])},a:function(a){return xa(a+24)+24},o:function(a){a=new N(a);a.Tc()||(a.Nb(!0),Sa--);a.Ob(!1);Ra.push(a);a.Oc();return a.Wc()},q:function(){X(0);var a=Ra.pop();if(a.Uc()&&!a.fc()){var b=a.Gc();b&&L(b)(a.eb);Ua(a.eb)}M=0},d:function(){var a=M;if(!a)return z=0;var b=new N(a);b.Ya(a);var c=b.Ia();if(!c)return z=0,a;for(var e=Array.prototype.slice.call(arguments),f=0;f<e.length;f++){var g=
|
||||
e[f];if(0===g||g===c)break;if(wb(g,c,b.ta+16))return z=g,a}z=c;return a},j:function(){var a=M;if(!a)return z=0;var b=new N(a);b.Ya(a);var c=b.Ia();if(!c)return z=0,a;for(var e=Array.prototype.slice.call(arguments),f=0;f<e.length;f++){var g=e[f];if(0===g||g===c)break;if(wb(g,c,b.ta+16))return z=g,a}z=c;return a},O:function(){var a=M;if(!a)return z=0;var b=new N(a);b.Ya(a);var c=b.Ia();if(!c)return z=0,a;for(var e=Array.prototype.slice.call(arguments),f=0;f<e.length;f++){var g=e[f];if(0===g||g===c)break;
|
||||
if(wb(g,c,b.ta+16))return z=g,a}z=c;return a},y:Ua,D:function(){var a=Ra.pop();a||A("no exception to throw");var b=a.eb;a.fc()||(Ra.push(a),a.Ob(!0),a.Nb(!1),Sa++);M=b;throw b;},b:function(a,b,c){(new N(a)).Ma(b,c);M=a;Sa++;throw a;},R:function(){return Sa},g:function(a){M||(M=a);throw a;},F:function(a,b,c){kb=c;try{var e=lb(a);switch(b){case 0:var f=W();return 0>f?-28:S.Wb(e,f).fd;case 1:case 2:return 0;case 3:return e.flags;case 4:return f=W(),e.flags|=f,0;case 5:return f=W(),Ba[f+0>>1]=2,0;case 6:case 7:return 0;
|
||||
case 16:case 8:return-28;case 9:return E[xb()>>2]=28,-1;default:return-28}}catch(g){if("undefined"==typeof S||!(g instanceof S.na))throw g;return-g.ya}},_:function(a,b,c){kb=c;try{var e=lb(a);switch(b){case 21509:case 21505:return e.tty?0:-59;case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:return e.tty?0:-59;case 21519:if(!e.tty)return-59;var f=W();return E[f>>2]=0;case 21520:return e.tty?-28:-59;case 21531:return f=W(),S.Db(e,b,f);case 21523:return e.tty?0:-59;case 21524:return e.tty?
|
||||
0:-59;default:A("bad ioctl syscall "+b)}}catch(g){if("undefined"==typeof S||!(g instanceof S.na))throw g;return-g.ya}},$:function(a,b,c,e){kb=e;try{b=C(b);b=jb(a,b);var f=e?W():0;return S.open(b,c,f).fd}catch(g){if("undefined"==typeof S||!(g instanceof S.na))throw g;return-g.ya}},U:function(a,b,c,e){try{return b=C(b),e=C(e),b=jb(a,b),e=jb(c,e),S.rename(b,e),0}catch(f){if("undefined"==typeof S||!(f instanceof S.na))throw f;return-f.ya}},T:function(a,b){try{a=C(a);a:{var c=S.stat;try{var e=c(a)}catch(g){if(g&&
|
||||
g.node&&O(a)!==O(S.La(g.node))){var f=-54;break a}throw g;}E[b>>2]=e.dev;E[b+4>>2]=0;E[b+8>>2]=e.ino;E[b+12>>2]=e.mode;E[b+16>>2]=e.nlink;E[b+20>>2]=e.uid;E[b+24>>2]=e.gid;E[b+28>>2]=e.rdev;E[b+32>>2]=0;Ca[b+40>>3]=BigInt(e.size);E[b+48>>2]=4096;E[b+52>>2]=e.blocks;E[b+56>>2]=e.atime.getTime()/1E3|0;E[b+60>>2]=0;E[b+64>>2]=e.mtime.getTime()/1E3|0;E[b+68>>2]=0;E[b+72>>2]=e.ctime.getTime()/1E3|0;E[b+76>>2]=0;Ca[b+80>>3]=BigInt(e.ino);f=0}return f}catch(g){if("undefined"==typeof S||!(g instanceof S.na))throw g;
|
||||
return-g.ya}},S:function(a,b,c){try{return b=C(b),b=jb(a,b),0===c?S.unlink(b):512===c?S.rmdir(b):A("Invalid flags passed to unlinkat"),0}catch(e){if("undefined"==typeof S||!(e instanceof S.na))throw e;return-e.ya}},G:function(){return Date.now()},P:function(){throw Infinity;},H:function(a,b){a=new Date(1E3*E[a>>2]);E[b>>2]=a.getSeconds();E[b+4>>2]=a.getMinutes();E[b+8>>2]=a.getHours();E[b+12>>2]=a.getDate();E[b+16>>2]=a.getMonth();E[b+20>>2]=a.getFullYear()-1900;E[b+24>>2]=a.getDay();var c=new Date(a.getFullYear(),
|
||||
0,1);E[b+28>>2]=(a.getTime()-c.getTime())/864E5|0;E[b+36>>2]=-(60*a.getTimezoneOffset());var e=(new Date(a.getFullYear(),6,1)).getTimezoneOffset();c=c.getTimezoneOffset();E[b+32>>2]=(e!=c&&a.getTimezoneOffset()==Math.min(c,e))|0},I:nb,z:function(){A("")},A:function(a){var b=ta.length;a>>>=0;if(2147483648<a)return!1;for(var c=1;4>=c;c*=2){var e=b*(1+.2/c);e=Math.min(e,a+100663296);var f=Math;e=Math.max(a,e);f=f.min.call(f,2147483648,e+(65536-e%65536)%65536);a:{try{pa.grow(f-Aa.byteLength+65535>>>16);
|
||||
Da();var g=1;break a}catch(k){}g=void 0}if(g)return!0}return!1},W:function(a,b){var c=0;pb().forEach(function(e,f){var g=b+c;f=E[a+4*f>>2]=g;for(g=0;g<e.length;++g)D[f++>>0]=e.charCodeAt(g);D[f>>0]=0;c+=e.length+1});return 0},X:function(a,b){var c=pb();E[a>>2]=c.length;var e=0;c.forEach(function(f){e+=f.length+1});E[b>>2]=e;return 0},v:function(a){ra=a;yb(a)},E:function(a){try{var b=lb(a);S.close(b);return 0}catch(c){if("undefined"==typeof S||!(c instanceof S.na))throw c;return c.ya}},Z:function(a,
|
||||
b,c,e){try{a:{var f=lb(a);a=b;for(var g=b=0;g<c;g++){var k=G[a>>2],l=G[a+4>>2];a+=8;var p=S.read(f,D,k,l,void 0);if(0>p){var n=-1;break a}b+=p;if(p<l)break}n=b}E[e>>2]=n;return 0}catch(r){if("undefined"==typeof S||!(r instanceof S.na))throw r;return r.ya}},V:function(a,b,c,e){try{var f=Number(b&BigInt(4294967295))|0,g=Number(b>>BigInt(32))|0,k=lb(a);a=4294967296*g+(f>>>0);if(-9007199254740992>=a||9007199254740992<=a)return 61;S.Aa(k,a,c);Ca[e>>3]=BigInt(k.position);k.zb&&0===a&&0===c&&(k.zb=null);
|
||||
return 0}catch(l){if("undefined"==typeof S||!(l instanceof S.na))throw l;return l.ya}},Y:function(a,b,c,e){try{a:{var f=lb(a);a=b;for(var g=b=0;g<c;g++){var k=G[a>>2],l=G[a+4>>2];a+=8;var p=S.write(f,D,k,l,void 0);if(0>p){var n=-1;break a}b+=p}n=b}E[e>>2]=n;return 0}catch(r){if("undefined"==typeof S||!(r instanceof S.na))throw r;return r.ya}},c:function(){return z},J:zb,e:Bb,f:Cb,p:Db,L:Eb,N:Fb,s:Gb,B:Hb,x:Ib,M:Jb,K:Kb,k:Lb,i:Mb,h:Nb,r:Ob,m:Pb,t:Qb,u:Rb,w:Sb,C:function(a){return a},l:function(a){z=
|
||||
a},Q:function(a,b,c,e){return ub(a,b,c,e)}};
|
||||
(function(){function a(f){d.asm=f.exports;pa=d.asm.aa;Da();Ea=d.asm.ga;Ga.unshift(d.asm.ba);La()}function b(f){a(f.instance)}function c(f){return Pa().then(function(g){return WebAssembly.instantiate(g,e)}).then(function(g){return g}).then(f,function(g){v("failed to asynchronously prepare wasm: "+g);A(g)})}var e={a:Tb};H++;if(d.instantiateWasm)try{return d.instantiateWasm(e,a)}catch(f){return v("Module.instantiateWasm callback failed with error: "+f),!1}(function(){return"function"!=typeof WebAssembly.instantiateStreaming||
|
||||
Ma()||K.startsWith("file://")||"function"!=typeof fetch?c(b):fetch(K,{credentials:"same-origin"}).then(function(f){return WebAssembly.instantiateStreaming(f,e).then(b,function(g){v("wasm streaming compile failed: "+g);v("falling back to ArrayBuffer instantiation");return c(b)})})})().catch(ba);return{}})();d.___wasm_call_ctors=function(){return(d.___wasm_call_ctors=d.asm.ba).apply(null,arguments)};
|
||||
var xb=d.___errno_location=function(){return(xb=d.___errno_location=d.asm.ca).apply(null,arguments)},xa=d._malloc=function(){return(xa=d._malloc=d.asm.da).apply(null,arguments)};d._main=function(){return(d._main=d.asm.ea).apply(null,arguments)};
|
||||
var Va=d._free=function(){return(Va=d._free=d.asm.fa).apply(null,arguments)},X=d._setThrew=function(){return(X=d._setThrew=d.asm.ha).apply(null,arguments)},Y=d.stackSave=function(){return(Y=d.stackSave=d.asm.ia).apply(null,arguments)},Z=d.stackRestore=function(){return(Z=d.stackRestore=d.asm.ja).apply(null,arguments)},za=d.stackAlloc=function(){return(za=d.stackAlloc=d.asm.ka).apply(null,arguments)},wb=d.___cxa_can_catch=function(){return(wb=d.___cxa_can_catch=d.asm.la).apply(null,arguments)},Ta=
|
||||
d.___cxa_is_pointer_type=function(){return(Ta=d.___cxa_is_pointer_type=d.asm.ma).apply(null,arguments)};function Mb(a,b){var c=Y();try{L(a)(b)}catch(e){Z(c);if(e!==e+0)throw e;X(1,0)}}function Bb(a,b){var c=Y();try{return L(a)(b)}catch(e){Z(c);if(e!==e+0)throw e;X(1,0)}}function Cb(a,b,c){var e=Y();try{return L(a)(b,c)}catch(f){Z(e);if(f!==f+0)throw f;X(1,0)}}function Ob(a,b,c,e){var f=Y();try{L(a)(b,c,e)}catch(g){Z(f);if(g!==g+0)throw g;X(1,0)}}
|
||||
function Nb(a,b,c){var e=Y();try{L(a)(b,c)}catch(f){Z(e);if(f!==f+0)throw f;X(1,0)}}function Lb(a){var b=Y();try{L(a)()}catch(c){Z(b);if(c!==c+0)throw c;X(1,0)}}function Gb(a,b,c,e,f,g,k){var l=Y();try{return L(a)(b,c,e,f,g,k)}catch(p){Z(l);if(p!==p+0)throw p;X(1,0)}}function Db(a,b,c,e){var f=Y();try{return L(a)(b,c,e)}catch(g){Z(f);if(g!==g+0)throw g;X(1,0)}}function Fb(a,b,c,e,f,g){var k=Y();try{return L(a)(b,c,e,f,g)}catch(l){Z(k);if(l!==l+0)throw l;X(1,0)}}
|
||||
function Jb(a,b,c,e,f,g){var k=Y();try{return L(a)(b,c,e,f,g)}catch(l){Z(k);if(l!==l+0)throw l;X(1,0)}}function Eb(a,b,c,e,f,g){var k=Y();try{return L(a)(b,c,e,f,g)}catch(l){Z(k);if(l!==l+0)throw l;X(1,0)}}function Kb(a,b,c,e){var f=Y();try{return L(a)(b,c,e)}catch(g){Z(f);if(g!==g+0)throw g;X(1,0)}}function Hb(a,b,c,e,f,g,k,l){var p=Y();try{return L(a)(b,c,e,f,g,k,l)}catch(n){Z(p);if(n!==n+0)throw n;X(1,0)}}
|
||||
function Pb(a,b,c,e,f){var g=Y();try{L(a)(b,c,e,f)}catch(k){Z(g);if(k!==k+0)throw k;X(1,0)}}function Qb(a,b,c,e,f,g,k,l){var p=Y();try{L(a)(b,c,e,f,g,k,l)}catch(n){Z(p);if(n!==n+0)throw n;X(1,0)}}function Ib(a,b,c,e,f,g,k,l,p,n,r,w){var y=Y();try{return L(a)(b,c,e,f,g,k,l,p,n,r,w)}catch(h){Z(y);if(h!==h+0)throw h;X(1,0)}}function Rb(a,b,c,e,f,g,k,l,p,n,r){var w=Y();try{L(a)(b,c,e,f,g,k,l,p,n,r)}catch(y){Z(w);if(y!==y+0)throw y;X(1,0)}}
|
||||
function Sb(a,b,c,e,f,g,k,l,p,n,r,w,y,h,u,x){var F=Y();try{L(a)(b,c,e,f,g,k,l,p,n,r,w,y,h,u,x)}catch(I){Z(F);if(I!==I+0)throw I;X(1,0)}}function zb(a){var b=Y();try{return L(a)()}catch(c){Z(b);if(c!==c+0)throw c;X(1,0)}}d.callMain=Ub;d.ENV=ob;d.FS=S;d.NODEFS=U;d.WORKERFS=V;var Vb;function na(a){this.name="ExitStatus";this.message="Program terminated with exit("+a+")";this.status=a}Ka=function Wb(){Vb||Xb();Vb||(Ka=Wb)};
|
||||
function Ub(a){var b=d._main;a=a||[];var c=a.length+1,e=za(4*(c+1));E[e>>2]=ya(ea);for(var f=1;f<c;f++)E[(e>>2)+f]=ya(a[f-1]);E[(e>>2)+c]=0;try{var g=b(c,e);ra=g;yb(g);return g}catch(l){if(l instanceof na||"unwind"==l)var k=ra;else fa(1,l),k=void 0;return k}finally{}}
|
||||
function Xb(a){a=a||da;if(!(0<H)){if(d.preRun)for("function"==typeof d.preRun&&(d.preRun=[d.preRun]);d.preRun.length;){var b=d.preRun.shift();Fa.unshift(b)}Qa(Fa);0<H||Vb||(Vb=!0,d.calledRun=!0,qa||(d.noFSInit||S.Ma.Cb||S.Ma(),S.Bb=!1,Qa(Ga),Qa(Ha),aa(d),Yb&&Ub(a),Qa(Ia)))}}d.run=Xb;function yb(a){ra=a;noExitRuntime||(qa=!0);fa(a,new na(a))}var Yb=!0;d.noInitialRun&&(Yb=!1);Xb();
|
||||
Object.assign(S,{init:S.Ma,mkdir:S.mkdir,mount:S.ra,chdir:S.chdir,writeFile:S.writeFile,readFile:S.readFile,createLazyFile:S.yc,setIgnorePermissions:function(a){S.Bb=a}});
|
||||
|
||||
|
||||
return Module.ready
|
||||
}
|
||||
);
|
||||
})();
|
||||
export default Module;
|
||||
+10
@@ -5,6 +5,8 @@ import { library } from '@fortawesome/fontawesome-svg-core';
|
||||
import { fas } from '@fortawesome/free-solid-svg-icons';
|
||||
import { LoadingPlugin } from 'vue-loading-overlay';
|
||||
|
||||
import { installAbortSignalPolyfill } from 'abort-signal-polyfill';
|
||||
|
||||
import { registerSW } from 'virtual:pwa-register';
|
||||
import shadow from 'vue-shadow-dom';
|
||||
import { hideSplashScreen } from 'vite-plugin-splash-screen/runtime';
|
||||
@@ -21,6 +23,14 @@ import { i18nPlugin } from './plugins/i18n.plugin';
|
||||
|
||||
import store from './tools/pomodoro-timer/app/store';
|
||||
|
||||
window.addEventListener('vite:preloadError', (event: Event) => {
|
||||
console.error('Vite preload error, forcing page reload:', event);
|
||||
event.preventDefault(); // Prevent the original error from being thrown again
|
||||
window.location.reload();
|
||||
});
|
||||
|
||||
installAbortSignalPolyfill();
|
||||
|
||||
// eslint-disable-next-line no-extend-native
|
||||
BigInt.prototype.toJSON = function () {
|
||||
return JSON.rawJSON ? JSON.rawJSON(this.toString()) : this.toString();
|
||||
|
||||
@@ -4,14 +4,19 @@ const { availableLocales, locale, t } = useI18n();
|
||||
const localesLong: Record<string, string> = {
|
||||
en: 'English',
|
||||
de: 'Deutsch',
|
||||
da: 'Dansk',
|
||||
es: 'Español',
|
||||
fr: 'Français',
|
||||
ga: 'Gaeilge',
|
||||
it: 'Italiano',
|
||||
nl: 'Nederlands',
|
||||
no: 'Norwegian',
|
||||
pl: 'Polski',
|
||||
pt: 'Português',
|
||||
ru: 'Русский',
|
||||
tr: 'Türkçe',
|
||||
uk: 'Українська',
|
||||
ko: '한국인',
|
||||
zh: '中文',
|
||||
vi: 'Tiếng Việt',
|
||||
ar: 'عربي',
|
||||
|
||||
+1
-12
@@ -1,5 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { IconDragDrop, IconFileDescription, IconHeart } from '@tabler/icons-vue';
|
||||
import { IconDragDrop, IconHeart } from '@tabler/icons-vue';
|
||||
import { useHead } from '@vueuse/head';
|
||||
import { computed, nextTick, onMounted, onUnmounted, ref } from 'vue';
|
||||
import Draggable from 'vuedraggable';
|
||||
@@ -154,17 +154,6 @@ onUnmounted(() => {
|
||||
{{ $t('home.follow.thankYou') }}
|
||||
<n-icon :component="IconHeart" />
|
||||
</ColoredCard>
|
||||
|
||||
<a href="https://renderize.tech?utm_source=it-tools&utm_medium=banner" target="_blank" rel="noopener" class="text-current decoration-none">
|
||||
<c-card v-if="config.showSponsorBanner" class="cursor-pointer !border-2px !hover:border-primary">
|
||||
<div class="flex items-center justify-between">
|
||||
<n-icon :component="IconFileDescription" class="text-neutral-400 dark:text-neutral-600" size="40" />
|
||||
<div class="rounded-full bg-#eeeeee px-10px py-2px text-xs text-black dark:bg-#333333 dark:text-white">
|
||||
Sponsor
|
||||
</div>
|
||||
</div>
|
||||
</c-card>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<transition name="height">
|
||||
|
||||
@@ -3,9 +3,11 @@ import { get } from '@vueuse/core';
|
||||
import type { Plugin } from 'vue';
|
||||
import { createI18n } from 'vue-i18n';
|
||||
|
||||
const DEFAULT_LOCALE = String(import.meta.env.VITE_LANGUAGE || 'en');
|
||||
|
||||
const i18n = createI18n({
|
||||
legacy: false,
|
||||
locale: import.meta.env.VITE_LANGUAGE || 'en',
|
||||
locale: DEFAULT_LOCALE,
|
||||
messages,
|
||||
});
|
||||
|
||||
@@ -15,7 +17,8 @@ export const i18nPlugin: Plugin = {
|
||||
},
|
||||
};
|
||||
|
||||
export const translate = function (localeKey: string, list: unknown[] = []) {
|
||||
const hasKey = i18n.global.te(localeKey, get(i18n.global.locale));
|
||||
return hasKey ? i18n.global.t(localeKey, list) : localeKey;
|
||||
};
|
||||
export function getCurrentLocale(): string {
|
||||
return get(i18n.global.locale);
|
||||
}
|
||||
|
||||
export const translate = i18n.global.t as typeof i18n.global.t;
|
||||
Vendored
+9
@@ -55,3 +55,12 @@ interface Navigator {
|
||||
interface FontFaceSet {
|
||||
add(fontFace: FontFace)
|
||||
}
|
||||
|
||||
// TODO remove once https://github.com/microsoft/TypeScript/issues/60608 is resolved
|
||||
// eslint-disable-next-line @typescript-eslint/no-namespace
|
||||
namespace Intl {
|
||||
class DurationFormat {
|
||||
constructor(locale?: Intl.LocalesArgument, options?: { style?: 'long' });
|
||||
format(duration: { seconds?: number; milliseconds?: number }): string;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,192 @@
|
||||
import { expect, test } from '@playwright/test';
|
||||
|
||||
test.describe('Tool - Amortization Calculator', () => {
|
||||
test.beforeEach(async ({ page }) => {
|
||||
await page.goto('/amortization-calculator');
|
||||
});
|
||||
|
||||
test('Has correct title', async ({ page }) => {
|
||||
await expect(page).toHaveTitle('Amortization Calculator - IT Tools');
|
||||
});
|
||||
|
||||
test('Calculates amortization schedule with default values', async ({ page }) => {
|
||||
const loanAmountInput = page.getByLabel('Loan Amount');
|
||||
const loanTermInput = page.getByLabel('Loan Term');
|
||||
const interestRateInput = page.getByLabel('Interest Rate');
|
||||
|
||||
await expect(loanAmountInput).toHaveValue('200000');
|
||||
await expect(loanTermInput).toHaveValue('360');
|
||||
await expect(interestRateInput).toHaveValue('6');
|
||||
|
||||
const monthlyPaymentCell = page.locator('tbody tr td').first();
|
||||
await expect(monthlyPaymentCell).toContainText('$1,199.10');
|
||||
|
||||
const totalPaymentsCell = page.locator('tbody tr td').nth(1);
|
||||
await expect(totalPaymentsCell).toContainText('$431,676.38');
|
||||
});
|
||||
|
||||
test('Updates calculation when loan amount changes', async ({ page }) => {
|
||||
const loanAmountInput = page.getByLabel('Loan Amount');
|
||||
|
||||
await loanAmountInput.clear();
|
||||
await loanAmountInput.fill('100000');
|
||||
|
||||
const monthlyPaymentCell = page.locator('tbody tr td').first();
|
||||
await expect(monthlyPaymentCell).toContainText('$599.55');
|
||||
|
||||
const totalPaymentsCell = page.locator('tbody tr td').nth(1);
|
||||
await expect(totalPaymentsCell).toContainText('$215,838.19');
|
||||
});
|
||||
|
||||
test('Updates calculation when loan term changes', async ({ page }) => {
|
||||
const loanTermInput = page.getByLabel('Loan Term');
|
||||
|
||||
await loanTermInput.clear();
|
||||
await loanTermInput.fill('180');
|
||||
|
||||
const monthlyPaymentCell = page.locator('tbody tr td').first();
|
||||
await expect(monthlyPaymentCell).toContainText('$1,687.71');
|
||||
});
|
||||
|
||||
test('Updates calculation when interest rate changes', async ({ page }) => {
|
||||
const interestRateInput = page.getByLabel('Interest Rate');
|
||||
|
||||
await interestRateInput.clear();
|
||||
await interestRateInput.fill('4.5');
|
||||
|
||||
const monthlyPaymentCell = page.locator('tbody tr td').first();
|
||||
await expect(monthlyPaymentCell).toContainText('$1,013.37');
|
||||
});
|
||||
|
||||
test('Displays amortization schedule table', async ({ page }) => {
|
||||
const scheduleTable = page.locator('table').nth(1);
|
||||
|
||||
await expect(scheduleTable.locator('thead th').nth(0)).toContainText('Month');
|
||||
await expect(scheduleTable.locator('thead th').nth(1)).toContainText('Interest');
|
||||
await expect(scheduleTable.locator('thead th').nth(2)).toContainText('Principal');
|
||||
await expect(scheduleTable.locator('thead th').nth(3)).toContainText('Ending Balance');
|
||||
|
||||
const firstMonthRow = scheduleTable.locator('tbody tr').first();
|
||||
await expect(firstMonthRow.locator('td').nth(0)).toContainText('1');
|
||||
await expect(firstMonthRow.locator('td').nth(1)).toContainText('$1,000.00');
|
||||
await expect(firstMonthRow.locator('td').nth(2)).toContainText('$199.10');
|
||||
await expect(firstMonthRow.locator('td').nth(3)).toContainText('$199,800.90');
|
||||
});
|
||||
|
||||
test('Shows validation error for invalid loan amount', async ({ page }) => {
|
||||
const loanAmountInput = page.getByLabel('Loan Amount');
|
||||
|
||||
await loanAmountInput.clear();
|
||||
await loanAmountInput.fill('-1000');
|
||||
await loanAmountInput.blur();
|
||||
|
||||
await expect(page.locator('text=Loan amount must be a positive value')).toBeVisible();
|
||||
});
|
||||
|
||||
test('Shows validation error for zero loan amount', async ({ page }) => {
|
||||
const loanAmountInput = page.getByLabel('Loan Amount');
|
||||
|
||||
await loanAmountInput.clear();
|
||||
await loanAmountInput.fill('0');
|
||||
await loanAmountInput.blur();
|
||||
|
||||
await expect(page.locator('text=Loan amount must be a positive value')).toBeVisible();
|
||||
});
|
||||
|
||||
test('Shows validation error for non-integer loan term', async ({ page }) => {
|
||||
const loanTermInput = page.getByLabel('Loan Term');
|
||||
|
||||
await loanTermInput.clear();
|
||||
await loanTermInput.fill('12.5');
|
||||
await loanTermInput.blur();
|
||||
|
||||
await expect(page.locator('text=Loan term must be a positive integer')).toBeVisible();
|
||||
});
|
||||
|
||||
test('Shows validation error for negative loan term', async ({ page }) => {
|
||||
const loanTermInput = page.getByLabel('Loan Term');
|
||||
|
||||
await loanTermInput.clear();
|
||||
await loanTermInput.fill('-12');
|
||||
await loanTermInput.blur();
|
||||
|
||||
await expect(page.locator('text=Loan term must be a positive integer')).toBeVisible();
|
||||
});
|
||||
|
||||
test('Shows validation error for interest rate above 100', async ({ page }) => {
|
||||
const interestRateInput = page.getByLabel('Interest Rate');
|
||||
|
||||
await interestRateInput.clear();
|
||||
await interestRateInput.fill('101');
|
||||
await interestRateInput.blur();
|
||||
|
||||
await expect(page.locator('text=Interest rate must be a positive value between 0 and 100')).toBeVisible();
|
||||
});
|
||||
|
||||
test('Shows validation error for zero interest rate', async ({ page }) => {
|
||||
const interestRateInput = page.getByLabel('Interest Rate');
|
||||
|
||||
await interestRateInput.clear();
|
||||
await interestRateInput.fill('0');
|
||||
await interestRateInput.blur();
|
||||
|
||||
await expect(page.locator('text=Interest rate must be a positive value between 0 and 100')).toBeVisible();
|
||||
});
|
||||
|
||||
test('Hides results when inputs are invalid', async ({ page }) => {
|
||||
const loanAmountInput = page.getByLabel('Loan Amount');
|
||||
|
||||
await loanAmountInput.clear();
|
||||
await loanAmountInput.fill('invalid');
|
||||
|
||||
const resultsTable = page.locator('table').first();
|
||||
await expect(resultsTable).not.toBeVisible();
|
||||
});
|
||||
|
||||
test('Calculates correctly for short-term loan', async ({ page }) => {
|
||||
const loanAmountInput = page.getByLabel('Loan Amount');
|
||||
const loanTermInput = page.getByLabel('Loan Term');
|
||||
const interestRateInput = page.getByLabel('Interest Rate');
|
||||
|
||||
await loanAmountInput.clear();
|
||||
await loanAmountInput.fill('10000');
|
||||
await loanTermInput.clear();
|
||||
await loanTermInput.fill('12');
|
||||
await interestRateInput.clear();
|
||||
await interestRateInput.fill('12');
|
||||
|
||||
const monthlyPaymentCell = page.locator('tbody tr td').first();
|
||||
await expect(monthlyPaymentCell).toContainText('$888.49');
|
||||
|
||||
const scheduleTable = page.locator('table').nth(1);
|
||||
// Find the last month row (before the year summary row)
|
||||
const lastMonthRow = scheduleTable.locator('tbody tr').nth(11); // 12th month (0-indexed)
|
||||
await expect(lastMonthRow.locator('td').nth(0)).toContainText('12');
|
||||
await expect(lastMonthRow.locator('td').nth(3)).toContainText('$0.00');
|
||||
});
|
||||
|
||||
test('Schedule shows decreasing balance over time', async ({ page }) => {
|
||||
const loanAmountInput = page.getByLabel('Loan Amount');
|
||||
const loanTermInput = page.getByLabel('Loan Term');
|
||||
|
||||
await loanAmountInput.clear();
|
||||
await loanAmountInput.fill('50000');
|
||||
await loanTermInput.clear();
|
||||
await loanTermInput.fill('12');
|
||||
|
||||
const scheduleTable = page.locator('table').nth(1);
|
||||
const firstBalance = await scheduleTable.locator('tbody tr').nth(0).locator('td').nth(3).textContent();
|
||||
const sixthBalance = await scheduleTable.locator('tbody tr').nth(5).locator('td').nth(3).textContent();
|
||||
// Get the last month row (12th month, index 11) before the year summary row
|
||||
const lastMonthBalance = await scheduleTable.locator('tbody tr').nth(11).locator('td').nth(3).textContent();
|
||||
|
||||
// The values may contain country code in e2e tests
|
||||
const firstBalanceValue = Number.parseFloat(firstBalance!.replace(/[A-Za-z$,]/g, ''));
|
||||
const sixthBalanceValue = Number.parseFloat(sixthBalance!.replace(/[A-Za-z$,]/g, ''));
|
||||
const lastBalanceValue = Number.parseFloat(lastMonthBalance!.replace(/[A-Za-z$,]/g, ''));
|
||||
|
||||
expect(firstBalanceValue).toBeGreaterThan(sixthBalanceValue);
|
||||
expect(sixthBalanceValue).toBeGreaterThan(lastBalanceValue);
|
||||
expect(lastBalanceValue).toBeCloseTo(0, 0);
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,487 @@
|
||||
import { beforeEach, describe, expect, it } from 'vitest';
|
||||
import {
|
||||
AmortizationCalculator,
|
||||
type AmortizationParams,
|
||||
StandardAmortizationCalculator,
|
||||
} from './amortization-calculator.service';
|
||||
|
||||
describe('AmortizationCalculator', () => {
|
||||
describe('validation methods', () => {
|
||||
describe('validateLoanAmount', () => {
|
||||
it('validates positive numbers', () => {
|
||||
expect(AmortizationCalculator.validateLoanAmount('100000')).toBe(true);
|
||||
expect(AmortizationCalculator.validateLoanAmount('1.5')).toBe(true);
|
||||
expect(AmortizationCalculator.validateLoanAmount('0.01')).toBe(true);
|
||||
});
|
||||
|
||||
it('rejects zero and negative numbers', () => {
|
||||
expect(AmortizationCalculator.validateLoanAmount('0')).toBe(false);
|
||||
expect(AmortizationCalculator.validateLoanAmount('-100')).toBe(false);
|
||||
});
|
||||
|
||||
it('rejects invalid inputs', () => {
|
||||
expect(AmortizationCalculator.validateLoanAmount('')).toBe(false);
|
||||
expect(AmortizationCalculator.validateLoanAmount('abc')).toBe(false);
|
||||
expect(AmortizationCalculator.validateLoanAmount('NaN')).toBe(false);
|
||||
});
|
||||
|
||||
it('rejects infinity', () => {
|
||||
expect(AmortizationCalculator.validateLoanAmount('Infinity')).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
describe('validateLoanMonths', () => {
|
||||
it('validates positive integers', () => {
|
||||
expect(AmortizationCalculator.validateLoanMonths('12')).toBe(true);
|
||||
expect(AmortizationCalculator.validateLoanMonths('360')).toBe(true);
|
||||
expect(AmortizationCalculator.validateLoanMonths('1')).toBe(true);
|
||||
});
|
||||
|
||||
it('rejects non-integers', () => {
|
||||
expect(AmortizationCalculator.validateLoanMonths('12.5')).toBe(false);
|
||||
expect(AmortizationCalculator.validateLoanMonths('1.1')).toBe(false);
|
||||
});
|
||||
|
||||
it('rejects zero and negative numbers', () => {
|
||||
expect(AmortizationCalculator.validateLoanMonths('0')).toBe(false);
|
||||
expect(AmortizationCalculator.validateLoanMonths('-12')).toBe(false);
|
||||
});
|
||||
|
||||
it('rejects invalid inputs', () => {
|
||||
expect(AmortizationCalculator.validateLoanMonths('')).toBe(false);
|
||||
expect(AmortizationCalculator.validateLoanMonths('abc')).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
describe('validateInterestRate', () => {
|
||||
it('validates fractional interest rates between 0 and 100', () => {
|
||||
expect(AmortizationCalculator.validateInterestRate('5.5')).toBe(true);
|
||||
expect(AmortizationCalculator.validateInterestRate('0.01')).toBe(true);
|
||||
expect(AmortizationCalculator.validateInterestRate('100')).toBe(true);
|
||||
expect(AmortizationCalculator.validateInterestRate('12.75')).toBe(true);
|
||||
});
|
||||
|
||||
it('rejects rates above 100', () => {
|
||||
expect(AmortizationCalculator.validateInterestRate('100.01')).toBe(false);
|
||||
expect(AmortizationCalculator.validateInterestRate('200')).toBe(false);
|
||||
});
|
||||
|
||||
it('rejects zero and negative rates', () => {
|
||||
expect(AmortizationCalculator.validateInterestRate('0')).toBe(false);
|
||||
expect(AmortizationCalculator.validateInterestRate('-5')).toBe(false);
|
||||
});
|
||||
|
||||
it('rejects invalid inputs', () => {
|
||||
expect(AmortizationCalculator.validateInterestRate('')).toBe(false);
|
||||
expect(AmortizationCalculator.validateInterestRate('abc')).toBe(false);
|
||||
});
|
||||
|
||||
it('rejects infinity', () => {
|
||||
expect(AmortizationCalculator.validateInterestRate('Infinity')).toBe(false);
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('StandardAmortizationCalculator', () => {
|
||||
let calculator: StandardAmortizationCalculator;
|
||||
|
||||
beforeEach(() => {
|
||||
calculator = new StandardAmortizationCalculator();
|
||||
});
|
||||
|
||||
describe('getPayment', () => {
|
||||
it('calculates correct payment for standard loan parameters', () => {
|
||||
const params: AmortizationParams = {
|
||||
principal: 100000,
|
||||
periodInterestRate: 0.005, // 0.5% monthly (6% annual)
|
||||
numberOfPayments: 360, // 30 years
|
||||
};
|
||||
|
||||
const result = calculator.getPayment(params);
|
||||
|
||||
// Expected payment using standard amortization formula
|
||||
// P = L[c(1 + c)^n]/[(1 + c)^n - 1]
|
||||
// Where P is payment, L is loan amount, c is interest rate per period, n is number of periods
|
||||
expect(result.payment).toBeCloseTo(599.55, 2);
|
||||
expect(result.totalPayments).toBeCloseTo(215838, 0);
|
||||
});
|
||||
|
||||
it('calculates correct payment for short-term loan', () => {
|
||||
const params: AmortizationParams = {
|
||||
principal: 10000,
|
||||
periodInterestRate: 0.01, // 1% monthly
|
||||
numberOfPayments: 12,
|
||||
};
|
||||
|
||||
const result = calculator.getPayment(params);
|
||||
|
||||
expect(result.payment).toBeCloseTo(888.49, 2);
|
||||
expect(result.totalPayments).toBeCloseTo(10661.85, 2);
|
||||
});
|
||||
|
||||
it('calculates correct payment with zero interest rate', () => {
|
||||
const params: AmortizationParams = {
|
||||
principal: 12000,
|
||||
periodInterestRate: 0,
|
||||
numberOfPayments: 12,
|
||||
};
|
||||
|
||||
const result = calculator.getPayment(params);
|
||||
|
||||
// With 0% interest, payment should be principal / numberOfPayments
|
||||
expect(result.payment).toBe(1000);
|
||||
expect(result.totalPayments).toBe(12000);
|
||||
});
|
||||
|
||||
it('caches payment calculations', () => {
|
||||
const params: AmortizationParams = {
|
||||
principal: 50000,
|
||||
periodInterestRate: 0.004,
|
||||
numberOfPayments: 180,
|
||||
};
|
||||
|
||||
const result1 = calculator.getPayment(params);
|
||||
const result2 = calculator.getPayment(params);
|
||||
|
||||
// Should return the same object reference from cache
|
||||
expect(result1).toBe(result2);
|
||||
expect(result1.payment).toBeCloseTo(390.21, 2);
|
||||
});
|
||||
|
||||
it('calculates different payments for different parameters', () => {
|
||||
const params1: AmortizationParams = {
|
||||
principal: 100000,
|
||||
periodInterestRate: 0.005,
|
||||
numberOfPayments: 360,
|
||||
};
|
||||
|
||||
const params2: AmortizationParams = {
|
||||
principal: 100000,
|
||||
periodInterestRate: 0.004,
|
||||
numberOfPayments: 360,
|
||||
};
|
||||
|
||||
const result1 = calculator.getPayment(params1);
|
||||
const result2 = calculator.getPayment(params2);
|
||||
|
||||
expect(result1.payment).not.toBe(result2.payment);
|
||||
expect(result1.payment).toBeGreaterThan(result2.payment);
|
||||
});
|
||||
});
|
||||
|
||||
describe('getNth', () => {
|
||||
it('calculates correct values for first payment', () => {
|
||||
const params: AmortizationParams = {
|
||||
principal: 100000,
|
||||
periodInterestRate: 0.005,
|
||||
numberOfPayments: 360,
|
||||
};
|
||||
|
||||
const result = calculator.getNth(params, 1);
|
||||
|
||||
expect(result.paymentIndex).toBe(1);
|
||||
expect(result.payment).toBeCloseTo(599.55, 2);
|
||||
|
||||
// First payment: more interest, less principal in standard amortization
|
||||
expect(result.interestPayment).toBeCloseTo(500, 2); // 100000 * 0.005
|
||||
expect(result.principalPayment).toBeCloseTo(99.55, 2); // 599.55 - 500
|
||||
expect(result.remainingBalance).toBeCloseTo(99900.45, 2); // 100000 - 99.55
|
||||
|
||||
// Payment should equal principal + interest
|
||||
expect(result.principalPayment + result.interestPayment).toBeCloseTo(result.payment, 2);
|
||||
});
|
||||
|
||||
it('calculates correct values for middle payment', () => {
|
||||
const params: AmortizationParams = {
|
||||
principal: 100000,
|
||||
periodInterestRate: 0.005,
|
||||
numberOfPayments: 360,
|
||||
};
|
||||
|
||||
const result = calculator.getNth(params, 180);
|
||||
|
||||
expect(result.paymentIndex).toBe(180);
|
||||
expect(result.remainingBalance).toBeGreaterThan(0);
|
||||
expect(result.remainingBalance).toBeLessThan(params.principal);
|
||||
expect(result.principalPayment + result.interestPayment).toBeCloseTo(result.payment, 2);
|
||||
});
|
||||
|
||||
it('calculates correct values for final payment', () => {
|
||||
const params: AmortizationParams = {
|
||||
principal: 100000,
|
||||
periodInterestRate: 0.005,
|
||||
numberOfPayments: 360,
|
||||
};
|
||||
|
||||
const result = calculator.getNth(params, 360);
|
||||
|
||||
expect(result.paymentIndex).toBe(360);
|
||||
// Last payment should have remaining balance close to 0
|
||||
expect(result.remainingBalance).toBeCloseTo(0, 0);
|
||||
expect(result.principalPayment + result.interestPayment).toBeCloseTo(result.payment, 2);
|
||||
});
|
||||
|
||||
it('shows increasing principal payment over time for standard amortization', () => {
|
||||
const params: AmortizationParams = {
|
||||
principal: 100000,
|
||||
periodInterestRate: 0.005,
|
||||
numberOfPayments: 360,
|
||||
};
|
||||
|
||||
const payment1 = calculator.getNth(params, 1);
|
||||
const payment180 = calculator.getNth(params, 180);
|
||||
const payment360 = calculator.getNth(params, 360);
|
||||
|
||||
// In standard amortization, principal payment increases as balance decreases
|
||||
expect(payment1.principalPayment).toBeLessThan(payment180.principalPayment);
|
||||
expect(payment180.principalPayment).toBeLessThan(payment360.principalPayment);
|
||||
});
|
||||
|
||||
it('shows decreasing interest payment over time', () => {
|
||||
const params: AmortizationParams = {
|
||||
principal: 100000,
|
||||
periodInterestRate: 0.005,
|
||||
numberOfPayments: 360,
|
||||
};
|
||||
|
||||
const payment1 = calculator.getNth(params, 1);
|
||||
const payment180 = calculator.getNth(params, 180);
|
||||
const payment360 = calculator.getNth(params, 360);
|
||||
|
||||
// Interest payment should decrease over time
|
||||
expect(payment1.interestPayment).toBeGreaterThan(payment180.interestPayment);
|
||||
expect(payment180.interestPayment).toBeGreaterThan(payment360.interestPayment);
|
||||
});
|
||||
|
||||
it('handles zero interest rate correctly', () => {
|
||||
const params: AmortizationParams = {
|
||||
principal: 12000,
|
||||
periodInterestRate: 0,
|
||||
numberOfPayments: 12,
|
||||
};
|
||||
|
||||
const result = calculator.getNth(params, 1);
|
||||
|
||||
expect(result.payment).toBe(1000);
|
||||
expect(result.interestPayment).toBe(0);
|
||||
expect(result.principalPayment).toBeGreaterThan(0);
|
||||
});
|
||||
});
|
||||
|
||||
describe('getAmortizationSchedule', () => {
|
||||
it('generates complete amortization schedule with month and year rows', () => {
|
||||
const params: AmortizationParams = {
|
||||
principal: 10000,
|
||||
periodInterestRate: 0.01,
|
||||
numberOfPayments: 12,
|
||||
};
|
||||
|
||||
const schedule = Array.from(calculator.getAmortizationSchedule(params));
|
||||
|
||||
// 12 months + 1 year summary row = 13 total
|
||||
expect(schedule).toHaveLength(13);
|
||||
expect(schedule[0].paymentIndex).toBe(1);
|
||||
expect(schedule[0].type).toBe('month');
|
||||
expect(schedule[11].paymentIndex).toBe(12);
|
||||
expect(schedule[11].type).toBe('month');
|
||||
expect(schedule[12].type).toBe('year');
|
||||
expect(schedule[12].paymentIndex).toBe(1); // Year 1
|
||||
});
|
||||
|
||||
it('ensures each payment has consistent structure', () => {
|
||||
const params: AmortizationParams = {
|
||||
principal: 50000,
|
||||
periodInterestRate: 0.004,
|
||||
numberOfPayments: 60,
|
||||
};
|
||||
|
||||
const schedule = Array.from(calculator.getAmortizationSchedule(params));
|
||||
|
||||
// 60 months + 5 year summary rows = 65 total
|
||||
expect(schedule).toHaveLength(65);
|
||||
|
||||
const monthRows = schedule.filter(row => row.type === 'month');
|
||||
const yearRows = schedule.filter(row => row.type === 'year');
|
||||
|
||||
expect(monthRows).toHaveLength(60);
|
||||
expect(yearRows).toHaveLength(5);
|
||||
|
||||
monthRows.forEach((payment, index) => {
|
||||
expect(payment).toHaveProperty('paymentIndex');
|
||||
expect(payment).toHaveProperty('payment');
|
||||
expect(payment).toHaveProperty('principalPayment');
|
||||
expect(payment).toHaveProperty('interestPayment');
|
||||
expect(payment).toHaveProperty('remainingBalance');
|
||||
expect(payment).toHaveProperty('totalPayments');
|
||||
expect(payment).toHaveProperty('type');
|
||||
|
||||
expect(payment.paymentIndex).toBe(index + 1);
|
||||
expect(payment.principalPayment + payment.interestPayment).toBeCloseTo(payment.payment, 2);
|
||||
});
|
||||
});
|
||||
|
||||
it('shows decreasing remaining balance over time', () => {
|
||||
const params: AmortizationParams = {
|
||||
principal: 20000,
|
||||
periodInterestRate: 0.005,
|
||||
numberOfPayments: 24,
|
||||
};
|
||||
|
||||
const schedule = Array.from(calculator.getAmortizationSchedule(params));
|
||||
|
||||
// Filter to only month rows for balance comparison
|
||||
const monthRows = schedule.filter(row => row.type === 'month');
|
||||
|
||||
for (let i = 1; i < monthRows.length; i++) {
|
||||
expect(monthRows[i].remainingBalance).toBeLessThan(monthRows[i - 1].remainingBalance);
|
||||
}
|
||||
});
|
||||
|
||||
it('ends with near-zero remaining balance', () => {
|
||||
const params: AmortizationParams = {
|
||||
principal: 15000,
|
||||
periodInterestRate: 0.0075,
|
||||
numberOfPayments: 36,
|
||||
};
|
||||
|
||||
const schedule = Array.from(calculator.getAmortizationSchedule(params));
|
||||
const monthRows = schedule.filter(row => row.type === 'month');
|
||||
const lastMonthPayment = monthRows[monthRows.length - 1];
|
||||
|
||||
expect(lastMonthPayment.remainingBalance).toBeCloseTo(0, 0);
|
||||
});
|
||||
|
||||
it('handles single payment loan', () => {
|
||||
const params: AmortizationParams = {
|
||||
principal: 1000,
|
||||
periodInterestRate: 0.05,
|
||||
numberOfPayments: 1,
|
||||
};
|
||||
|
||||
const schedule = Array.from(calculator.getAmortizationSchedule(params));
|
||||
|
||||
// Single payment with no year summary (< 12 months)
|
||||
expect(schedule).toHaveLength(1);
|
||||
expect(schedule[0].paymentIndex).toBe(1);
|
||||
expect(schedule[0].type).toBe('month');
|
||||
expect(schedule[0].payment).toBeCloseTo(1050, 2);
|
||||
});
|
||||
|
||||
it('maintains consistent payment amount throughout schedule', () => {
|
||||
const params: AmortizationParams = {
|
||||
principal: 25000,
|
||||
periodInterestRate: 0.006,
|
||||
numberOfPayments: 48,
|
||||
};
|
||||
|
||||
const schedule = Array.from(calculator.getAmortizationSchedule(params));
|
||||
const monthRows = schedule.filter(row => row.type === 'month');
|
||||
const firstPayment = monthRows[0].payment;
|
||||
|
||||
monthRows.forEach((payment) => {
|
||||
expect(payment.payment).toBeCloseTo(firstPayment, 2);
|
||||
});
|
||||
});
|
||||
|
||||
it('includes year summary rows after every 12 months', () => {
|
||||
const params: AmortizationParams = {
|
||||
principal: 100000,
|
||||
periodInterestRate: 0.005,
|
||||
numberOfPayments: 24,
|
||||
};
|
||||
|
||||
const schedule = Array.from(calculator.getAmortizationSchedule(params));
|
||||
const yearRows = schedule.filter(row => row.type === 'year');
|
||||
|
||||
expect(yearRows).toHaveLength(2); // 2 years
|
||||
expect(yearRows[0].paymentIndex).toBe(1); // Year 1
|
||||
expect(yearRows[1].paymentIndex).toBe(2); // Year 2
|
||||
});
|
||||
|
||||
it('year summary rows contain cumulative totals', () => {
|
||||
const params: AmortizationParams = {
|
||||
principal: 10000,
|
||||
periodInterestRate: 0.01,
|
||||
numberOfPayments: 12,
|
||||
};
|
||||
|
||||
const schedule = Array.from(calculator.getAmortizationSchedule(params));
|
||||
const monthRows = schedule.filter(row => row.type === 'month');
|
||||
const yearRows = schedule.filter(row => row.type === 'year');
|
||||
|
||||
// Calculate cumulative totals for the year
|
||||
const totalPrincipal = monthRows.reduce((sum, row) => sum + row.principalPayment, 0);
|
||||
const totalInterest = monthRows.reduce((sum, row) => sum + row.interestPayment, 0);
|
||||
|
||||
expect(yearRows[0].principalPayment).toBeCloseTo(totalPrincipal, 2);
|
||||
expect(yearRows[0].interestPayment).toBeCloseTo(totalInterest, 2);
|
||||
});
|
||||
});
|
||||
|
||||
describe('edge cases', () => {
|
||||
it('handles very small loan amounts', () => {
|
||||
const params: AmortizationParams = {
|
||||
principal: 100,
|
||||
periodInterestRate: 0.01,
|
||||
numberOfPayments: 12,
|
||||
};
|
||||
|
||||
const result = calculator.getPayment(params);
|
||||
expect(result.payment).toBeGreaterThan(0);
|
||||
expect(result.totalPayments).toBeGreaterThan(params.principal);
|
||||
});
|
||||
|
||||
it('handles very large loan amounts', () => {
|
||||
const params: AmortizationParams = {
|
||||
principal: 10000000,
|
||||
periodInterestRate: 0.003,
|
||||
numberOfPayments: 360,
|
||||
};
|
||||
|
||||
const result = calculator.getPayment(params);
|
||||
expect(result.payment).toBeGreaterThan(0);
|
||||
expect(Number.isFinite(result.payment)).toBe(true);
|
||||
});
|
||||
|
||||
it('handles very low interest rates', () => {
|
||||
const params: AmortizationParams = {
|
||||
principal: 50000,
|
||||
periodInterestRate: 0.0001,
|
||||
numberOfPayments: 60,
|
||||
};
|
||||
|
||||
const result = calculator.getPayment(params);
|
||||
expect(result.payment).toBeGreaterThan(params.principal / params.numberOfPayments);
|
||||
});
|
||||
|
||||
it('handles short loan terms', () => {
|
||||
const params: AmortizationParams = {
|
||||
principal: 5000,
|
||||
periodInterestRate: 0.02,
|
||||
numberOfPayments: 3,
|
||||
};
|
||||
|
||||
const schedule = Array.from(calculator.getAmortizationSchedule(params));
|
||||
// 3 months, no year summary (< 12 months)
|
||||
expect(schedule).toHaveLength(3);
|
||||
const monthRows = schedule.filter(row => row.type === 'month');
|
||||
expect(monthRows[2].remainingBalance).toBeCloseTo(0, 0);
|
||||
});
|
||||
|
||||
it('handles long loan terms', () => {
|
||||
const params: AmortizationParams = {
|
||||
principal: 200000,
|
||||
periodInterestRate: 0.004,
|
||||
numberOfPayments: 480, // 40 years
|
||||
};
|
||||
|
||||
const schedule = Array.from(calculator.getAmortizationSchedule(params));
|
||||
// 480 months + 40 year summary rows = 520 total
|
||||
expect(schedule).toHaveLength(520);
|
||||
const monthRows = schedule.filter(row => row.type === 'month');
|
||||
expect(monthRows).toHaveLength(480);
|
||||
expect(monthRows[479].remainingBalance).toBeCloseTo(0, 0);
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,183 @@
|
||||
export interface AmortizationParams {
|
||||
readonly principal: number
|
||||
readonly periodInterestRate: number
|
||||
readonly numberOfPayments: number
|
||||
}
|
||||
|
||||
export interface CachedPaymentResults {
|
||||
readonly payment: number
|
||||
readonly totalPayments: number
|
||||
}
|
||||
|
||||
export interface GetNthResult extends CachedPaymentResults {
|
||||
readonly paymentIndex: number
|
||||
readonly principalPayment: number
|
||||
readonly interestPayment: number
|
||||
readonly remainingBalance: number
|
||||
}
|
||||
|
||||
export interface AmortizationScheduleItem extends GetNthResult {
|
||||
readonly type: 'month' | 'year'
|
||||
}
|
||||
|
||||
type AmortizationPaymentCacheKey = `principal:${number};interest-rate:${number};number-of-payments:${number}`;
|
||||
|
||||
export abstract class AmortizationCalculator {
|
||||
public static validateLoanAmount(str: string): boolean {
|
||||
return AmortizationCalculator.validatePositive(str);
|
||||
}
|
||||
|
||||
public static validateLoanMonths(str: string): boolean {
|
||||
return AmortizationCalculator.validatePositiveInteger(str);
|
||||
}
|
||||
|
||||
public static validateInterestRate(str: string): boolean {
|
||||
return AmortizationCalculator.validateFractional(str);
|
||||
}
|
||||
|
||||
abstract getNth(params: AmortizationParams, paymentIndex: number): GetNthResult;
|
||||
|
||||
public *getAmortizationSchedule(params: AmortizationParams): Generator<AmortizationScheduleItem> {
|
||||
let period = 0;
|
||||
let periodTotalPrincipal = 0;
|
||||
let periodTotalInterest = 0;
|
||||
|
||||
while (period < params.numberOfPayments) {
|
||||
const periodResults = this.getNth(params, ++period);
|
||||
|
||||
periodTotalPrincipal += periodResults.principalPayment;
|
||||
periodTotalInterest += periodResults.interestPayment;
|
||||
|
||||
yield {
|
||||
...periodResults,
|
||||
type: 'month',
|
||||
};
|
||||
|
||||
// Yield yearly totals at end of year
|
||||
if (period % 12 === 0) {
|
||||
yield {
|
||||
...periodResults,
|
||||
paymentIndex: period / 12,
|
||||
principalPayment: periodTotalPrincipal,
|
||||
interestPayment: periodTotalInterest,
|
||||
type: 'year',
|
||||
};
|
||||
|
||||
periodTotalPrincipal = 0;
|
||||
periodTotalInterest = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public getPayment(params: AmortizationParams): CachedPaymentResults {
|
||||
const cacheKey = this.getCacheString(params);
|
||||
const cache = this.paymentCache.get(cacheKey);
|
||||
|
||||
if (!cache) {
|
||||
const payment = this.calculatePayment(params);
|
||||
const totalPayments = this.calculateTotalPayments(params, payment);
|
||||
|
||||
const paymentResult = {
|
||||
payment,
|
||||
totalPayments,
|
||||
};
|
||||
|
||||
this.paymentCache.set(cacheKey, paymentResult);
|
||||
|
||||
return paymentResult;
|
||||
}
|
||||
|
||||
return cache;
|
||||
}
|
||||
|
||||
/** Private Methods */
|
||||
private paymentCache: Map<AmortizationPaymentCacheKey, CachedPaymentResults> = new Map();
|
||||
|
||||
private calculatePayment({ principal, periodInterestRate, numberOfPayments }: AmortizationParams): number {
|
||||
if (periodInterestRate === 0) {
|
||||
return principal / numberOfPayments;
|
||||
}
|
||||
|
||||
const numerator = periodInterestRate * (1 + periodInterestRate) ** numberOfPayments;
|
||||
const denominator = (1 + periodInterestRate) ** numberOfPayments - 1;
|
||||
|
||||
return principal * (numerator / denominator);
|
||||
}
|
||||
|
||||
private calculateTotalPayments({ numberOfPayments }: AmortizationParams, payment: number): number {
|
||||
return payment * numberOfPayments;
|
||||
}
|
||||
|
||||
private getCacheString({
|
||||
principal,
|
||||
periodInterestRate,
|
||||
numberOfPayments,
|
||||
}: AmortizationParams): AmortizationPaymentCacheKey {
|
||||
return `principal:${principal};interest-rate:${periodInterestRate};number-of-payments:${numberOfPayments}`;
|
||||
}
|
||||
|
||||
private static validatePositiveInteger(str: string): boolean {
|
||||
const parsed = Number(str);
|
||||
|
||||
return !Number.isNaN(parsed) && Number.isSafeInteger(parsed) && parsed > 0;
|
||||
}
|
||||
|
||||
private static validateFractional(str: string): boolean {
|
||||
const parsed = Number(str);
|
||||
|
||||
return !Number.isNaN(parsed) && Number.isFinite(parsed) && parsed <= 100 && parsed > 0;
|
||||
}
|
||||
|
||||
private static validatePositive(str: string): boolean {
|
||||
const parsed = Number(str);
|
||||
|
||||
return !Number.isNaN(parsed) && Number.isFinite(parsed) && parsed > 0;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* An amortization calculator that uses the standard amortization formula
|
||||
* where interest is calculated on the remaining balance and principal
|
||||
* payment is the difference between the fixed payment and interest
|
||||
*/
|
||||
export class StandardAmortizationCalculator extends AmortizationCalculator {
|
||||
getNth(params: AmortizationParams, paymentIndex: number): GetNthResult {
|
||||
const { payment, totalPayments } = this.getPayment(params);
|
||||
|
||||
const { principal, periodInterestRate, numberOfPayments } = params;
|
||||
|
||||
if (periodInterestRate === 0) {
|
||||
const principalPayment = principal / numberOfPayments;
|
||||
const remainingBalance = principal - principalPayment * paymentIndex;
|
||||
|
||||
return {
|
||||
payment,
|
||||
totalPayments,
|
||||
remainingBalance: Math.max(0, remainingBalance),
|
||||
interestPayment: 0,
|
||||
principalPayment,
|
||||
paymentIndex,
|
||||
};
|
||||
}
|
||||
|
||||
const r = 1 + periodInterestRate;
|
||||
|
||||
const balanceBeforePayment
|
||||
= principal * r ** (paymentIndex - 1) - payment * ((r ** (paymentIndex - 1) - 1) / periodInterestRate);
|
||||
|
||||
const interestPayment = balanceBeforePayment * periodInterestRate;
|
||||
|
||||
const principalPayment = payment - interestPayment;
|
||||
|
||||
const remainingBalance = balanceBeforePayment - principalPayment;
|
||||
|
||||
return {
|
||||
payment,
|
||||
totalPayments,
|
||||
remainingBalance,
|
||||
interestPayment,
|
||||
principalPayment,
|
||||
paymentIndex,
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,188 @@
|
||||
<script setup lang="ts">
|
||||
import { useI18n } from 'vue-i18n';
|
||||
|
||||
import { AmortizationCalculator, StandardAmortizationCalculator } from './amortization-calculator.service';
|
||||
import { useQueryParamOrStorage } from '@/composable/queryParams';
|
||||
import { useValidation } from '@/composable/validation';
|
||||
|
||||
const { t, locale } = useI18n();
|
||||
|
||||
const amortizationCalculator = ref(new StandardAmortizationCalculator());
|
||||
|
||||
const currencyDisplayNames = computed(() => new Intl.DisplayNames(locale.value, { type: 'currency' }));
|
||||
|
||||
const supportedCurrencies = ref(
|
||||
Intl.supportedValuesOf('currency').map(value => ({
|
||||
value,
|
||||
label: currencyDisplayNames.value.of(value),
|
||||
})),
|
||||
);
|
||||
|
||||
const selectedCurrency = useQueryParamOrStorage({
|
||||
name: 'selectedCurrency',
|
||||
storageName: 'amortization-calculator:selectedCurrency',
|
||||
defaultValue: 'USD',
|
||||
});
|
||||
|
||||
const loanAmount = useQueryParamOrStorage({
|
||||
name: 'amount',
|
||||
storageName: 'amortization-calculator:amount',
|
||||
defaultValue: '200000',
|
||||
});
|
||||
const loanAmountValidation = useValidation({
|
||||
source: loanAmount,
|
||||
rules: [
|
||||
{
|
||||
message: t('tools.amortization-calculator.texts.message-loan-amount-must-be-positive'),
|
||||
validator: AmortizationCalculator.validateLoanAmount,
|
||||
},
|
||||
],
|
||||
});
|
||||
const parsedLoanAmount = computed(() => Number(loanAmount.value));
|
||||
|
||||
const loanMonths = useQueryParamOrStorage({
|
||||
name: 'months',
|
||||
storageName: 'amortization-calculator:months',
|
||||
defaultValue: '360',
|
||||
});
|
||||
const loanMonthsValidation = useValidation({
|
||||
source: loanMonths,
|
||||
rules: [
|
||||
{
|
||||
message: t('tools.amortization-calculator.texts.message-loan-term-must-be-positive-integer'),
|
||||
validator: AmortizationCalculator.validateLoanMonths,
|
||||
},
|
||||
],
|
||||
});
|
||||
const parsedLoanMonths = computed(() => Number(loanMonths.value));
|
||||
|
||||
const interestRate = useQueryParamOrStorage({
|
||||
name: 'interestRate',
|
||||
storageName: 'amortization-calculator:interestRate',
|
||||
defaultValue: '6',
|
||||
});
|
||||
const interestRateValidation = useValidation({
|
||||
source: interestRate,
|
||||
rules: [
|
||||
{
|
||||
message: t('tools.amortization-calculator.texts.message-interest-rate-must-be-between-1-and-100'),
|
||||
validator: AmortizationCalculator.validateInterestRate,
|
||||
},
|
||||
],
|
||||
});
|
||||
const parsedInterestRate = computed(() => Number(interestRate.value));
|
||||
|
||||
const allValid = computed(
|
||||
() => interestRateValidation.isValid && loanMonthsValidation.isValid && loanAmountValidation.isValid,
|
||||
);
|
||||
|
||||
const payment = computed(() =>
|
||||
amortizationCalculator.value.getPayment({
|
||||
principal: parsedLoanAmount.value,
|
||||
periodInterestRate: parsedInterestRate.value / 1200,
|
||||
numberOfPayments: parsedLoanMonths.value,
|
||||
}),
|
||||
);
|
||||
|
||||
const amortizationSchedule = computed(() => {
|
||||
// Force re-render on currency changes
|
||||
// i.e. redeclare generator
|
||||
// eslint-disable-next-line no-unused-expressions
|
||||
selectedCurrency.value;
|
||||
return amortizationCalculator.value.getAmortizationSchedule({
|
||||
principal: parsedLoanAmount.value,
|
||||
periodInterestRate: parsedInterestRate.value / 1200,
|
||||
numberOfPayments: parsedLoanMonths.value,
|
||||
});
|
||||
});
|
||||
|
||||
function formatCurrency(num: number): string {
|
||||
return num.toLocaleString(undefined, {
|
||||
style: 'currency',
|
||||
currency: selectedCurrency.value,
|
||||
// "negative" is a valid value for signDisplay and supported by all major browsers:
|
||||
// https://caniuse.com/mdn-javascript_builtins_intl_numberformat_numberformat_options_parameter_options_signdisplay_parameter_negative
|
||||
signDisplay: 'negative' as any,
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<c-card :title="t('tools.amortization-calculator.texts.title-loan-parameters')" mb-5>
|
||||
<c-input-text
|
||||
v-model:value="loanAmount"
|
||||
placeholder="e.g. 200000"
|
||||
:label="t('tools.amortization-calculator.texts.label-loan-amount')"
|
||||
raw-text
|
||||
mb-5
|
||||
:validation="loanAmountValidation"
|
||||
/>
|
||||
|
||||
<c-input-text
|
||||
v-model:value="loanMonths"
|
||||
placeholder="e.g. 360"
|
||||
:label="t('tools.amortization-calculator.texts.label-loan-term')"
|
||||
raw-text
|
||||
mb-5
|
||||
:validation="loanMonthsValidation"
|
||||
/>
|
||||
|
||||
<c-input-text
|
||||
v-model:value="interestRate"
|
||||
placeholder="e.g. 6.0"
|
||||
:label="t('tools.amortization-calculator.texts.label-interest-rate')"
|
||||
raw-text
|
||||
mb-5
|
||||
:validation="interestRateValidation"
|
||||
/>
|
||||
|
||||
<c-select v-model:value="selectedCurrency" :options="supportedCurrencies" :label="t('tools.amortization-calculator.texts.label-displayed-currency')" mb-5 />
|
||||
</c-card>
|
||||
|
||||
<div v-if="allValid">
|
||||
<n-table mb-5>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{{ t('tools.amortization-calculator.texts.label-monthly-payment') }}</th>
|
||||
<th>{{ t('tools.amortization-calculator.texts.label-total-of-payments') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
{{ formatCurrency(payment.payment) }}
|
||||
</td>
|
||||
<td>
|
||||
{{ formatCurrency(payment.totalPayments) }}
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</n-table>
|
||||
<n-table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{{ t('tools.amortization-calculator.texts.label-month') }}</th>
|
||||
<th>{{ t('tools.amortization-calculator.texts.label-interest') }}</th>
|
||||
<th>{{ t('tools.amortization-calculator.texts.label-principal') }}</th>
|
||||
<th>{{ t('tools.amortization-calculator.texts.label-ending-balance') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="period in amortizationSchedule" :key="period.type + period.paymentIndex">
|
||||
<template v-if="period.type === 'month'">
|
||||
<td>{{ period.paymentIndex }}</td>
|
||||
<td>{{ formatCurrency(period.interestPayment) }}</td>
|
||||
<td>{{ formatCurrency(period.principalPayment) }}</td>
|
||||
<td>{{ formatCurrency(period.remainingBalance) }}</td>
|
||||
</template>
|
||||
<template v-else>
|
||||
<th>{{ t('tools.amortization-calculator.texts.label-end-of-year', { year: period.paymentIndex }) }}</th>
|
||||
<th>{{ formatCurrency(period.interestPayment) }}</th>
|
||||
<th>{{ formatCurrency(period.principalPayment) }}</th>
|
||||
<th>{{ formatCurrency(period.remainingBalance) }}</th>
|
||||
</template>
|
||||
</tr>
|
||||
</tbody>
|
||||
</n-table>
|
||||
</div>
|
||||
</template>
|
||||
@@ -0,0 +1,14 @@
|
||||
import { ReportMoney } from '@vicons/tabler';
|
||||
import { defineTool } from '../tool';
|
||||
import { translate as t } from '@/plugins/i18n.plugin';
|
||||
|
||||
export const tool = defineTool({
|
||||
name: t('tools.amortization-calculator.title'),
|
||||
path: '/amortization-calculator',
|
||||
description: t('tools.amortization-calculator.description'),
|
||||
keywords: ['amortization', 'calculator'],
|
||||
component: () => import('./amortization-calculator.vue'),
|
||||
icon: ReportMoney,
|
||||
createdAt: new Date('2025-11-22'),
|
||||
category: 'Finance',
|
||||
});
|
||||
@@ -6,7 +6,9 @@ export const tool = defineTool({
|
||||
name: t('tools.angle-converter.title'),
|
||||
path: '/angle-converter',
|
||||
description: t('tools.angle-converter.description'),
|
||||
keywords: ['angle', 'converter'],
|
||||
keywords: ['angle', 'converter',
|
||||
'units', 'degree', 'radian', 'turn', 'grad',
|
||||
],
|
||||
component: () => import('./angle-converter.vue'),
|
||||
icon: Angle,
|
||||
createdAt: new Date('2024-08-15'),
|
||||
|
||||
@@ -6,7 +6,9 @@ export const tool = defineTool({
|
||||
name: t('tools.area-converter.title'),
|
||||
path: '/area-converter',
|
||||
description: t('tools.area-converter.description'),
|
||||
keywords: ['area', 'converter'],
|
||||
keywords: ['area', 'converter',
|
||||
'units', 'square meter', 'are', 'square',
|
||||
],
|
||||
component: () => import('./area-converter.vue'),
|
||||
icon: SquaresDiagonal,
|
||||
createdAt: new Date('2024-08-15'),
|
||||
|
||||
@@ -0,0 +1,126 @@
|
||||
<script setup lang="ts">
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { argon2d, argon2i, argon2id } from 'hash-wasm';
|
||||
import { useQueryParamOrStorage } from '@/composable/queryParams';
|
||||
|
||||
const { t } = useI18n();
|
||||
|
||||
// Inputs
|
||||
const password = ref('');
|
||||
const algorithm = useQueryParamOrStorage<'argon2id' | 'argon2i' | 'argon2d'>({ name: 'algo', storageName: 'argon2:a', defaultValue: 'argon2id' });
|
||||
|
||||
// Parameters
|
||||
const salt = useQueryParamOrStorage({ name: 'salt', storageName: 'argon2:s', defaultValue: '' });
|
||||
const iterations = useQueryParamOrStorage({ name: 'iter', storageName: 'argon2:i', defaultValue: 3 });
|
||||
const memorySizeKB = useQueryParamOrStorage({ name: 'memory', storageName: 'argon2:m', defaultValue: 512 });
|
||||
const parallelism = useQueryParamOrStorage({ name: 'paral', storageName: 'argon2:p', defaultValue: 1 });
|
||||
const hashLength = useQueryParamOrStorage({ name: 'len', storageName: 'argon2:l', defaultValue: 32 });
|
||||
const outputType = useQueryParamOrStorage<'hex' | 'encoded' | 'binary'>({ name: 'output', storageName: 'argon2:o', defaultValue: 'encoded' });
|
||||
|
||||
// Result
|
||||
const result = ref('');
|
||||
const error = ref('');
|
||||
|
||||
// Helpers
|
||||
function hexToBytes(hex: string): Uint8Array {
|
||||
const clean = hex.trim().replace(/^0x/, '');
|
||||
const bytes = new Uint8Array(clean.length / 2);
|
||||
for (let i = 0; i < clean.length; i += 2) {
|
||||
bytes[i / 2] = Number.parseInt(clean.slice(i, i + 2), 16);
|
||||
}
|
||||
return bytes;
|
||||
}
|
||||
|
||||
async function generateHash() {
|
||||
error.value = '';
|
||||
try {
|
||||
const saltBytes = salt.value ? hexToBytes(salt.value) : crypto?.getRandomValues(new Uint8Array(16));
|
||||
const options = {
|
||||
password: password.value,
|
||||
salt: saltBytes,
|
||||
iterations: iterations.value,
|
||||
memorySize: memorySizeKB.value,
|
||||
parallelism: parallelism.value,
|
||||
hashLength: hashLength.value,
|
||||
outputType: outputType.value,
|
||||
} as const;
|
||||
|
||||
const fn
|
||||
= algorithm.value === 'argon2id'
|
||||
? argon2id
|
||||
: algorithm.value === 'argon2i'
|
||||
? argon2i
|
||||
: argon2d;
|
||||
|
||||
result.value = await fn(options);
|
||||
}
|
||||
catch (err: any) {
|
||||
error.value = err.toString();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<NForm label-width="120" label-placement="left">
|
||||
<NFormItem :label="t('tools.argon2-hash.texts.label-algorithm')">
|
||||
<NSelect
|
||||
v-model:value="algorithm" :options="[
|
||||
{ label: t('tools.argon2-hash.texts.label-argon2id'), value: 'argon2id' },
|
||||
{ label: t('tools.argon2-hash.texts.label-argon2i'), value: 'argon2i' },
|
||||
{ label: t('tools.argon2-hash.texts.label-argon2d'), value: 'argon2d' },
|
||||
]"
|
||||
/>
|
||||
</NFormItem>
|
||||
|
||||
<NFormItem :label="t('tools.argon2-hash.texts.label-password')">
|
||||
<NInput v-model:value="password" :placeholder="t('tools.argon2-hash.texts.placeholder-enter-password')" />
|
||||
</NFormItem>
|
||||
|
||||
<NFormItem :label="t('tools.argon2-hash.texts.label-salt-hex')">
|
||||
<NInput v-model:value="salt" :placeholder="t('tools.argon2-hash.texts.placeholder-optional-hex-salt')" />
|
||||
</NFormItem>
|
||||
|
||||
<n-space justify="space-evenly">
|
||||
<NFormItem :label="t('tools.argon2-hash.texts.label-iterations')">
|
||||
<NInputNumber v-model:value="iterations" :min="1" style="width: 100px" />
|
||||
</NFormItem>
|
||||
|
||||
<NFormItem :label="t('tools.argon2-hash.texts.label-memory-kib')">
|
||||
<NInputNumber v-model:value="memorySizeKB" :min="1" style="width: 100px" />
|
||||
</NFormItem>
|
||||
|
||||
<NFormItem :label="t('tools.argon2-hash.texts.label-parallelism')">
|
||||
<NInputNumber v-model:value="parallelism" :min="1" style="width: 100px" />
|
||||
</NFormItem>
|
||||
|
||||
<NFormItem :label="t('tools.argon2-hash.texts.label-hash-length')">
|
||||
<NInputNumber v-model:value="hashLength" :min="16" style="width: 100px" />
|
||||
</NFormItem>
|
||||
</n-space>
|
||||
|
||||
<NFormItem :label="t('tools.argon2-hash.texts.label-output-type')">
|
||||
<NSelect
|
||||
v-model:value="outputType" :options="[
|
||||
{ label: t('tools.argon2-hash.texts.label-hex'), value: 'hex' },
|
||||
{ label: t('tools.argon2-hash.texts.label-encoded'), value: 'encoded' },
|
||||
{ label: t('tools.argon2-hash.texts.label-binary'), value: 'binary' },
|
||||
]"
|
||||
/>
|
||||
</NFormItem>
|
||||
|
||||
<n-space justify="center">
|
||||
<NButton type="primary" @click="generateHash">
|
||||
{{ t('tools.argon2-hash.texts.tag-generate') }}
|
||||
</NButton>
|
||||
</n-space>
|
||||
</NForm>
|
||||
|
||||
<c-alert v-if="error" mt-2>
|
||||
{{ error }}
|
||||
</c-alert>
|
||||
<c-card v-if="result" :title="t('tools.argon2-hash.texts.title-argon2-hash')" mt-2>
|
||||
<textarea-copyable :value="result" />
|
||||
</c-card>
|
||||
</div>
|
||||
</template>
|
||||
@@ -0,0 +1,14 @@
|
||||
import { EyeOff } from '@vicons/tabler';
|
||||
import { defineTool } from '../tool';
|
||||
import { translate as t } from '@/plugins/i18n.plugin';
|
||||
|
||||
export const tool = defineTool({
|
||||
name: t('tools.argon2-hash.title'),
|
||||
path: '/argon2-hash',
|
||||
description: t('tools.argon2-hash.description'),
|
||||
keywords: ['argon2', 'argon2i', 'argon2d', 'argon2id', 'hash'],
|
||||
component: () => import('./argon2-hash.vue'),
|
||||
icon: EyeOff,
|
||||
createdAt: new Date('2025-12-07'),
|
||||
category: 'Crypto',
|
||||
});
|
||||
@@ -59,72 +59,74 @@ const barcodeSVG = computed(() => {
|
||||
|
||||
const { download: downloadPNG } = useDownloadFileFromBase64({ source: barcodePNG, filename: 'barcode.png' });
|
||||
const { download: downloadSVG } = useDownloadFileFromBase64({ source: barcodeSVG, filename: 'barcode.svg' });
|
||||
|
||||
const barcodeFormats = formats as { value: string; label: string }[];
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<c-card>
|
||||
<n-grid x-gap="12" y-gap="12" cols="1 600:3">
|
||||
<n-gi span="2">
|
||||
<c-input-text
|
||||
v-model:value="value"
|
||||
label-position="left"
|
||||
label-width="130px"
|
||||
label-align="right"
|
||||
:label="t('tools.barcode-generator.texts.label-text')"
|
||||
multiline
|
||||
rows="1"
|
||||
autosize
|
||||
:placeholder="t('tools.barcode-generator.texts.placeholder-your-barcode')"
|
||||
mb-6
|
||||
/>
|
||||
<n-form label-width="130" label-placement="left">
|
||||
<c-select
|
||||
v-model:value="format"
|
||||
:label="t('tools.barcode-generator.texts.label-format')"
|
||||
label-position="left"
|
||||
label-width="130px"
|
||||
label-align="right"
|
||||
:options="formats"
|
||||
searchable
|
||||
mb-4
|
||||
/>
|
||||
<div>
|
||||
<c-input-text
|
||||
v-model:value="value"
|
||||
label-position="left"
|
||||
label-width="130px"
|
||||
label-align="right"
|
||||
:label="t('tools.barcode-generator.texts.label-text')"
|
||||
multiline
|
||||
rows="1"
|
||||
autosize
|
||||
:placeholder="t('tools.barcode-generator.texts.placeholder-your-barcode')"
|
||||
mb-6
|
||||
/>
|
||||
<n-form label-width="130" label-placement="left">
|
||||
<c-select
|
||||
v-model:value="format"
|
||||
:label="t('tools.barcode-generator.texts.label-format')"
|
||||
label-position="left"
|
||||
label-width="130px"
|
||||
label-align="right"
|
||||
:options="barcodeFormats"
|
||||
searchable
|
||||
mb-4
|
||||
/>
|
||||
|
||||
<n-form-item :label="t('tools.barcode-generator.texts.label-foreground-color')">
|
||||
<n-color-picker v-model:value="foreground" :modes="['hex']" :show-alpha="false" />
|
||||
</n-form-item>
|
||||
<n-form-item :label="t('tools.barcode-generator.texts.label-background-color')">
|
||||
<n-color-picker v-model:value="background" :modes="['hex']" :show-alpha="false" />
|
||||
</n-form-item>
|
||||
<n-form-item :label="t('tools.barcode-generator.texts.label-scale')">
|
||||
<n-input-number-i18n v-model:value="scale" :min="0" />
|
||||
</n-form-item>
|
||||
<n-form-item :label="t('tools.barcode-generator.texts.label-height-mm')">
|
||||
<n-input-number-i18n v-model:value="height" :min="0" />
|
||||
</n-form-item>
|
||||
<n-form-item :label="t('tools.barcode-generator.texts.label-margin')">
|
||||
<n-input-number-i18n v-model:value="margin" :min="0" />
|
||||
</n-form-item>
|
||||
<n-form-item :label="t('tools.barcode-generator.texts.label-display-text')">
|
||||
<n-checkbox v-model:checked="displayValue" />
|
||||
</n-form-item>
|
||||
</n-form>
|
||||
</n-gi>
|
||||
<n-gi>
|
||||
<div flex flex-col items-center gap-3>
|
||||
<c-alert v-if="error">
|
||||
{{ error }}
|
||||
</c-alert>
|
||||
<canvas ref="barcodeCanvas" />
|
||||
<div flex justify-center>
|
||||
<c-button mr-2 @click="downloadPNG">
|
||||
{{ t('tools.barcode-generator.texts.tag-download-png-barcode') }}
|
||||
</c-button>
|
||||
<c-button @click="downloadSVG">
|
||||
{{ t('tools.barcode-generator.texts.tag-download-svg-barcode') }}
|
||||
</c-button>
|
||||
</div>
|
||||
</div>
|
||||
</n-gi>
|
||||
</n-grid>
|
||||
</c-card>
|
||||
<n-form-item :label="t('tools.barcode-generator.texts.label-foreground-color')">
|
||||
<n-color-picker v-model:value="foreground" :modes="['hex']" :show-alpha="false" />
|
||||
</n-form-item>
|
||||
<n-form-item :label="t('tools.barcode-generator.texts.label-background-color')">
|
||||
<n-color-picker v-model:value="background" :modes="['hex']" :show-alpha="false" />
|
||||
</n-form-item>
|
||||
<n-space justify="center">
|
||||
<n-form-item :label="t('tools.barcode-generator.texts.label-scale')">
|
||||
<n-input-number-i18n v-model:value="scale" :min="0" />
|
||||
</n-form-item>
|
||||
<n-form-item :label="t('tools.barcode-generator.texts.label-height-mm')">
|
||||
<n-input-number-i18n v-model:value="height" :min="0" />
|
||||
</n-form-item>
|
||||
<n-form-item :label="t('tools.barcode-generator.texts.label-margin')">
|
||||
<n-input-number-i18n v-model:value="margin" :min="0" />
|
||||
</n-form-item>
|
||||
<n-form-item :label="t('tools.barcode-generator.texts.label-display-text')">
|
||||
<n-checkbox v-model:checked="displayValue" />
|
||||
</n-form-item>
|
||||
</n-space>
|
||||
</n-form>
|
||||
|
||||
<div v-if="error" mb-1 flex justify-center>
|
||||
<c-alert>
|
||||
{{ error }}
|
||||
</c-alert>
|
||||
</div>
|
||||
|
||||
<div mb-1 flex justify-center>
|
||||
<canvas ref="barcodeCanvas" />
|
||||
</div>
|
||||
<div mb-1 flex justify-center>
|
||||
<c-button mr-2 @click="downloadPNG">
|
||||
{{ t('tools.barcode-generator.texts.tag-download-png-barcode') }}
|
||||
</c-button>
|
||||
<c-button @click="downloadSVG">
|
||||
{{ t('tools.barcode-generator.texts.tag-download-svg-barcode') }}
|
||||
</c-button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -125,7 +125,11 @@ async function onUpload(file: File) {
|
||||
</c-card>
|
||||
|
||||
<c-card :title="t('tools.base64-file-converter.texts.title-file-to-base64')">
|
||||
<c-file-upload :title="t('tools.base64-file-converter.texts.title-drag-and-drop-a-file-here-or-click-to-select-a-file')" @file-upload="onUpload" />
|
||||
<c-file-upload
|
||||
:title="t('tools.base64-file-converter.texts.title-drag-and-drop-a-file-here-or-click-to-select-a-file')"
|
||||
:paste-image="true"
|
||||
@file-upload="onUpload"
|
||||
/>
|
||||
<c-input-text :value="fileBase64" multiline readonly :placeholder="t('tools.base64-file-converter.texts.placeholder-file-in-base64-will-be-here')" rows="5" my-2 />
|
||||
|
||||
<div flex justify-center>
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
import { compare, hash } from 'bcryptjs';
|
||||
import { assert, describe, expect, test } from 'vitest';
|
||||
import { installAbortSignalPolyfill } from 'abort-signal-polyfill';
|
||||
import { type Update, bcryptWithProgressUpdates } from './bcrypt.models';
|
||||
|
||||
// Install the polyfill
|
||||
installAbortSignalPolyfill();
|
||||
|
||||
// simplified polyfill for https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/fromAsync
|
||||
async function fromAsync<T>(iter: AsyncIterable<T>) {
|
||||
const out: T[] = [];
|
||||
for await (const val of iter) {
|
||||
out.push(val);
|
||||
}
|
||||
return out;
|
||||
}
|
||||
|
||||
function checkProgressAndGetResult<T>(updates: Update<T>[]) {
|
||||
const first = updates.at(0);
|
||||
const penultimate = updates.at(-2);
|
||||
const last = updates.at(-1);
|
||||
const allExceptLast = updates.slice(0, -1);
|
||||
|
||||
expect(allExceptLast.every(x => x.kind === 'progress')).toBeTruthy();
|
||||
expect(first).toEqual({ kind: 'progress', progress: 0 });
|
||||
expect(penultimate).toEqual({ kind: 'progress', progress: 1 });
|
||||
|
||||
assert(last != null && last.kind === 'success');
|
||||
|
||||
return last;
|
||||
}
|
||||
|
||||
describe('bcrypt models', () => {
|
||||
describe(bcryptWithProgressUpdates.name, () => {
|
||||
test('with bcrypt hash function', async () => {
|
||||
const updates = await fromAsync(bcryptWithProgressUpdates(hash, ['abc', 5]));
|
||||
const result = checkProgressAndGetResult(updates);
|
||||
|
||||
expect(result.value).toMatch(/^\$2[ab]\$05\$.{53}$/);
|
||||
expect(result.timeTakenMs).toBeGreaterThan(0);
|
||||
});
|
||||
|
||||
test('with bcrypt compare function', async () => {
|
||||
const updates = await fromAsync(
|
||||
bcryptWithProgressUpdates(compare, ['abc', '$2a$05$FHzYelm8Qn.IhGP.N8V1TOWFlRTK.8cphbxZSvSFo9B6HGscnQdhy']),
|
||||
);
|
||||
const result = checkProgressAndGetResult(updates);
|
||||
|
||||
expect(result.value).toBe(true);
|
||||
expect(result.timeTakenMs).toBeGreaterThan(0);
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,100 @@
|
||||
import { getCurrentLocale, translate as t } from '@/plugins/i18n.plugin';
|
||||
|
||||
Intl.DurationFormat ??= class DurationFormat {
|
||||
format(duration: { seconds?: number; milliseconds?: number }): string {
|
||||
return 'seconds' in duration
|
||||
? `${duration.seconds} seconds`
|
||||
: `${duration.milliseconds} milliseconds`;
|
||||
}
|
||||
};
|
||||
|
||||
export type Update<Result> =
|
||||
| {
|
||||
kind: 'progress'
|
||||
progress: number
|
||||
}
|
||||
| {
|
||||
kind: 'success'
|
||||
value: Result
|
||||
timeTakenMs: number
|
||||
}
|
||||
| {
|
||||
kind: 'error'
|
||||
message: string
|
||||
};
|
||||
|
||||
// generic type for the callback versions of bcryptjs's `hash` and `compare`
|
||||
export type BcryptFn<Param, Result> = (
|
||||
arg1: string,
|
||||
arg2: Param,
|
||||
callback: (err: Error | null, hash: Result) => void,
|
||||
progressCallback: (percent: number) => void,
|
||||
) => void;
|
||||
|
||||
interface BcryptWithProgressOptions {
|
||||
signal: AbortSignal
|
||||
timeoutMs: number
|
||||
}
|
||||
|
||||
export async function* bcryptWithProgressUpdates<Param, Result>(
|
||||
fn: BcryptFn<Param, Result>,
|
||||
args: [string, Param],
|
||||
options?: Partial<BcryptWithProgressOptions>,
|
||||
): AsyncGenerator<Update<Result>, undefined, undefined> {
|
||||
const { timeoutMs = 10_000 } = options ?? {};
|
||||
// eslint-disable-next-line @typescript-eslint/prefer-ts-expect-error
|
||||
// @ts-ignore: AbortSignal.any breaks typecheck
|
||||
const signal: AbortSignal = AbortSignal.any([
|
||||
AbortSignal.timeout(timeoutMs),
|
||||
options?.signal,
|
||||
].filter(x => x != null));
|
||||
|
||||
let res = (_: Update<Result>) => {};
|
||||
const nextPromise = () => new Promise<Update<Result>>(resolve => res = resolve);
|
||||
const promises = [nextPromise()];
|
||||
const nextValue = (value: Update<Result>) => {
|
||||
res(value);
|
||||
promises.push(nextPromise());
|
||||
};
|
||||
|
||||
const start = Date.now();
|
||||
|
||||
fn(
|
||||
args[0],
|
||||
args[1],
|
||||
(err, result) => {
|
||||
nextValue(
|
||||
err == null
|
||||
? { kind: 'success', value: result, timeTakenMs: Date.now() - start }
|
||||
: { kind: 'error', message: err.message },
|
||||
);
|
||||
},
|
||||
(progress) => {
|
||||
if (signal.aborted) {
|
||||
nextValue({ kind: 'progress', progress: 0 });
|
||||
if (signal.reason instanceof DOMException && signal.reason.name === 'TimeoutError') {
|
||||
const message = t('tools.bcrypt.texts.timed-out-after-timeout-period', {
|
||||
timeoutPeriod: new Intl.DurationFormat(getCurrentLocale(), { style: 'long' })
|
||||
.format({ seconds: Math.round(timeoutMs / 1000) }),
|
||||
});
|
||||
|
||||
nextValue({ kind: 'error', message });
|
||||
}
|
||||
|
||||
// throw inside callback to cancel execution of hashing/comparing
|
||||
throw signal.reason;
|
||||
}
|
||||
else {
|
||||
nextValue({ kind: 'progress', progress });
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
for await (const value of promises) {
|
||||
yield value;
|
||||
|
||||
if (value.kind === 'success' || value.kind === 'error') {
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
+103
-16
@@ -1,21 +1,79 @@
|
||||
<script setup lang="ts">
|
||||
import { compare, hash } from 'bcryptjs';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { compareSync, hashSync } from 'bcryptjs';
|
||||
import { useThemeVars } from 'naive-ui';
|
||||
import { type BcryptFn, bcryptWithProgressUpdates } from './bcrypt.models';
|
||||
import { useCopy } from '@/composable/copy';
|
||||
|
||||
const { t } = useI18n();
|
||||
const { t, locale } = useI18n();
|
||||
|
||||
const themeVars = useThemeVars();
|
||||
|
||||
interface ExecutionState<T> {
|
||||
result: T | null
|
||||
percentage: number
|
||||
error: string | null
|
||||
timeTakenMs: number | null
|
||||
}
|
||||
|
||||
const blankState = () => ({ result: null, percentage: 0, error: null, timeTakenMs: null });
|
||||
|
||||
async function exec<Param, Result>(
|
||||
fn: BcryptFn<Param, Result>,
|
||||
args: [string | null, Param | null],
|
||||
signal: AbortSignal,
|
||||
state: ExecutionState<Result>,
|
||||
) {
|
||||
const [arg0, arg1] = args;
|
||||
if (arg0 == null || arg1 == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
for await (const update of bcryptWithProgressUpdates(fn, [arg0, arg1], { signal, timeoutMs: 10_000 })) {
|
||||
switch (update.kind) {
|
||||
case 'progress': {
|
||||
state.percentage = Math.round(update.progress * 100);
|
||||
break;
|
||||
}
|
||||
case 'success': {
|
||||
state.result = update.value;
|
||||
state.timeTakenMs = update.timeTakenMs;
|
||||
break;
|
||||
}
|
||||
case 'error': {
|
||||
state.error = update.message;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function initWatcher<Param, Result>(
|
||||
fn: BcryptFn<Param, Result>,
|
||||
inputs: [Ref<string | null>, Ref<Param | null>],
|
||||
state: Ref<ExecutionState<Result>>,
|
||||
) {
|
||||
let controller = new AbortController();
|
||||
watch(inputs, (inputs) => {
|
||||
controller.abort();
|
||||
controller = new AbortController();
|
||||
state.value = blankState();
|
||||
exec(fn, inputs, controller.signal, state.value);
|
||||
});
|
||||
}
|
||||
|
||||
const hashState = ref<ExecutionState<string>>(blankState());
|
||||
const input = ref('');
|
||||
const saltCount = ref(10);
|
||||
const hashed = computed(() => hashSync(input.value, saltCount.value || 10));
|
||||
const { copy } = useCopy({ source: hashed, text: t('tools.bcrypt.texts.text-hashed-string-copied-to-the-clipboard') });
|
||||
initWatcher(hash, [input, saltCount], hashState);
|
||||
|
||||
const source = computed(() => hashState.value.result ?? '');
|
||||
const { copy } = useCopy({ source, text: t('tools.bcrypt.texts.text-hashed-string-copied-to-the-clipboard') });
|
||||
|
||||
const compareState = ref<ExecutionState<boolean>>(blankState());
|
||||
const compareString = ref('');
|
||||
const compareHash = ref('');
|
||||
const compareMatch = computed(() => compareSync(compareString.value, compareHash.value));
|
||||
initWatcher(compare, [compareString, compareHash], compareState);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -31,10 +89,21 @@ const compareMatch = computed(() => compareSync(compareString.value, compareHash
|
||||
mb-2
|
||||
/>
|
||||
<n-form-item :label="t('tools.bcrypt.texts.label-salt-count')" label-placement="left" label-width="120">
|
||||
<n-input-number-i18n v-model:value="saltCount" :placeholder="t('tools.bcrypt.texts.placeholder-salt-rounds')" :max="100" :min="0" w-full />
|
||||
<n-input-number v-model:value="saltCount" :placeholder="t('tools.bcrypt.texts.placeholder-salt-rounds')" :max="20" :min="4" w-full />
|
||||
</n-form-item>
|
||||
|
||||
<c-input-text :value="hashed" readonly text-center />
|
||||
<n-progress :percentage="hashState.percentage" :show-indicator="false" />
|
||||
<c-input-text
|
||||
:value="hashState.result ?? undefined"
|
||||
:placeholder="hashState.error ?? t('tools.bcrypt.texts.hashed-string')"
|
||||
readonly
|
||||
text-center
|
||||
/>
|
||||
<div mt-1 h-3 op-60>
|
||||
{{ hashState.timeTakenMs == null ? '' : t('tools.bcrypt.texts.hashed-in-elapsed-period', {
|
||||
elapsedPeriod: new Intl.DurationFormat(locale, { style: "long" }).format({ milliseconds: hashState.timeTakenMs }),
|
||||
}) }}
|
||||
</div>
|
||||
|
||||
<div mt-5 flex justify-center>
|
||||
<c-button @click="copy()">
|
||||
@@ -51,21 +120,39 @@ const compareMatch = computed(() => compareSync(compareString.value, compareHash
|
||||
<n-form-item :label="t('tools.bcrypt.texts.label-your-hash')" label-placement="left">
|
||||
<c-input-text v-model:value="compareHash" :placeholder="t('tools.bcrypt.texts.placeholder-your-hash-to-compare')" raw-text />
|
||||
</n-form-item>
|
||||
<n-form-item :label="t('tools.bcrypt.texts.label-do-they-match')" label-placement="left" :show-feedback="false">
|
||||
<div class="compare-result" :class="{ positive: compareMatch }">
|
||||
{{ compareMatch ? 'Yes' : 'No' }}
|
||||
</div>
|
||||
</n-form-item>
|
||||
|
||||
<n-progress :percentage="compareState.percentage" :show-indicator="false" />
|
||||
<div>
|
||||
<c-input-text
|
||||
id="bcrypt-compare-result"
|
||||
:value="compareState.result == null ? undefined : compareState.result ? t('tools.bcrypt.texts.matched') : t('tools.bcrypt.texts.no-match')"
|
||||
:placeholder="compareState.error ?? t('tools.bcrypt.texts.comparison-result')"
|
||||
readonly
|
||||
text-center
|
||||
class="compare-result"
|
||||
:class="compareState.result == null ? undefined : compareState.result ? 'positive' : 'negative'"
|
||||
/>
|
||||
</div>
|
||||
<div mb-1 mt-1 h-3 op-60>
|
||||
{{ compareState.timeTakenMs == null ? '' : t('tools.bcrypt.texts.compared-in-elapsed-period', {
|
||||
elapsedPeriod: new Intl.DurationFormat(locale, { style: 'long' }).format({ milliseconds: compareState.timeTakenMs }),
|
||||
}) }}
|
||||
</div>
|
||||
</n-form>
|
||||
</c-card>
|
||||
</template>
|
||||
|
||||
<style lang="less" scoped>
|
||||
<style lang="less">
|
||||
.compare-result {
|
||||
color: v-bind('themeVars.errorColor');
|
||||
|
||||
&.negative {
|
||||
input#bcrypt-compare-result {
|
||||
color: v-bind('themeVars.errorColor');
|
||||
}
|
||||
}
|
||||
&.positive {
|
||||
color: v-bind('themeVars.successColor');
|
||||
input#bcrypt-compare-result {
|
||||
color: v-bind('themeVars.successColor');
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,166 @@
|
||||
<script setup lang="ts">
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { useQueryParamOrStorage } from '@/composable/queryParams';
|
||||
import { useValidation } from '@/composable/validation';
|
||||
|
||||
const { t } = useI18n();
|
||||
|
||||
type NumberFormat = 'dec' | 'hex' | 'oct' | 'bin';
|
||||
|
||||
const inputFormatA = useQueryParamOrStorage<NumberFormat>({ name: 'text', storageName: 'bin-calc:fa', defaultValue: 'dec' });
|
||||
const inputFormatB = useQueryParamOrStorage<NumberFormat>({ name: 'text', storageName: 'bin-calc:fb', defaultValue: 'dec' });
|
||||
const operation = useQueryParamOrStorage({ name: 'op', storageName: 'bin-calc:o', defaultValue: 'AND' });
|
||||
const inputA = ref('');
|
||||
const inputB = ref('');
|
||||
|
||||
const formatOptions = [
|
||||
{ label: t('tools.binary-calculator.texts.label-decimal'), value: 'dec' },
|
||||
{ label: t('tools.binary-calculator.texts.label-hexadecimal'), value: 'hex' },
|
||||
{ label: t('tools.binary-calculator.texts.label-octal'), value: 'oct' },
|
||||
{ label: t('tools.binary-calculator.texts.label-binary'), value: 'bin' },
|
||||
];
|
||||
|
||||
const operations = [
|
||||
{ label: t('tools.binary-calculator.texts.label-a-and-b'), value: 'AND' },
|
||||
{ label: t('tools.binary-calculator.texts.label-a-or-b'), value: 'OR' },
|
||||
{ label: t('tools.binary-calculator.texts.label-a-xor-b'), value: 'XOR' },
|
||||
{ label: t('tools.binary-calculator.texts.label-not-a'), value: 'NOT' },
|
||||
{ label: t('tools.binary-calculator.texts.label-a-b-left-shift'), value: 'LSHIFT' },
|
||||
{ label: t('tools.binary-calculator.texts.label-a-b-right-shift'), value: 'RSHIFT' },
|
||||
];
|
||||
|
||||
const inputAValidation = useValidation({
|
||||
source: inputA,
|
||||
watch: [inputFormatA],
|
||||
rules: [
|
||||
{
|
||||
validator: v => parseInputA(v) !== null,
|
||||
message: t('tools.binary-calculator.texts.message-number-is-invalid'),
|
||||
},
|
||||
],
|
||||
});
|
||||
const inputBValidation = useValidation({
|
||||
source: inputB,
|
||||
watch: [inputFormatB],
|
||||
rules: [
|
||||
{
|
||||
validator: v => parseInputB(v) !== null,
|
||||
message: t('tools.binary-calculator.texts.message-number-is-invalid'),
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
const isUnary = computed(() => operation.value === 'NOT');
|
||||
|
||||
function parseInput(value: string, format: NumberFormat): number | null {
|
||||
if (value === '') {
|
||||
return null;
|
||||
}
|
||||
|
||||
try {
|
||||
let num: number;
|
||||
switch (format) {
|
||||
case 'dec':
|
||||
num = Number.parseInt(value, 10);
|
||||
break;
|
||||
case 'hex':
|
||||
num = Number.parseInt(value.replace(/^0x/i, ''), 16);
|
||||
break;
|
||||
case 'oct':
|
||||
num = Number.parseInt(value.replace(/^0o/i, ''), 8);
|
||||
break;
|
||||
case 'bin':
|
||||
num = Number.parseInt(value.replace(/^0b/i, ''), 2);
|
||||
break;
|
||||
}
|
||||
if (Number.isNaN(num)) {
|
||||
return null;
|
||||
}
|
||||
return num;
|
||||
}
|
||||
catch {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
function parseInputA(value: string) {
|
||||
return parseInput(value, inputFormatA.value);
|
||||
}
|
||||
function parseInputB(value: string) {
|
||||
return parseInput(value, inputFormatA.value);
|
||||
}
|
||||
|
||||
const result = computed(() => {
|
||||
const a = parseInputA(inputA.value);
|
||||
const b = parseInputB(inputB.value);
|
||||
|
||||
if (a === null || (!isUnary.value && b === null)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
switch (operation.value) {
|
||||
case 'AND':
|
||||
return a & b!;
|
||||
case 'OR':
|
||||
return a | b!;
|
||||
case 'XOR':
|
||||
return a ^ b!;
|
||||
case 'NOT':
|
||||
return ~a;
|
||||
case 'LSHIFT':
|
||||
return a << b!;
|
||||
case 'RSHIFT':
|
||||
return a >> b!;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
});
|
||||
|
||||
const signedResult = computed(() => result.value !== null ? (result.value | 0).toString() : '');
|
||||
const unsignedResult = computed(() => result.value !== null ? (result.value >>> 0).toString() : '');
|
||||
const bitmask = computed(() =>
|
||||
result.value !== null
|
||||
? (result.value >>> 0).toString(2).padStart(32, '0').split('')
|
||||
: [],
|
||||
);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div style="min-height: 50vh; max-width: 800px;">
|
||||
<n-space justify="space-evenly" mb-2>
|
||||
<NSelect v-model:value="inputFormatA" :options="formatOptions" style="width: 130px" />
|
||||
<c-input-text v-model:value="inputA" style="width: 150px" :validation="inputAValidation" label-position="left" :label="t('tools.binary-calculator.texts.label-a')" :placeholder="t('tools.binary-calculator.texts.placeholder-enter-a')" />
|
||||
<NSelect v-model:value="inputFormatB" :options="formatOptions" style="width: 130px" />
|
||||
<c-input-text v-model:value="inputB" style="width: 150px" :validation="inputBValidation" label-position="left" :label="t('tools.binary-calculator.texts.label-b')" :placeholder="t('tools.binary-calculator.texts.placeholder-enter-b')" :disabled="isUnary" />
|
||||
</n-space>
|
||||
|
||||
<c-select
|
||||
v-model:value="operation"
|
||||
:label="t('tools.binary-calculator.texts.label-operation')"
|
||||
label-position="left"
|
||||
:options="operations"
|
||||
:placeholder="t('tools.binary-calculator.texts.placeholder-select-operation')"
|
||||
mb-2
|
||||
/>
|
||||
|
||||
<c-card v-if="result !== null" :title="t('tools.binary-calculator.texts.title-result')" mb-1>
|
||||
<input-copyable label-width="130px" mb-1 :label="t('tools.binary-calculator.texts.label-decimal-signed')" label-position="left" :value="signedResult" />
|
||||
<input-copyable label-width="130px" mb-1 :label="t('tools.binary-calculator.texts.label-decimal-unigned')" label-position="left" :value="unsignedResult" />
|
||||
<input-copyable label-width="130px" mb-1 :label="t('tools.binary-calculator.texts.label-binary')" label-position="left" :value="`0b${result.toString(2).padStart(32, '0')}`" />
|
||||
<input-copyable label-width="130px" mb-1 :label="t('tools.binary-calculator.texts.label-hexadecimal')" label-position="left" :value="`0x${result.toString(16).toUpperCase()}`" />
|
||||
<input-copyable label-width="130px" mb-1 :label="t('tools.binary-calculator.texts.label-octal')" label-position="left" :value="`0o${result.toString(8)}`" />
|
||||
</c-card>
|
||||
|
||||
<c-card v-if="result !== null" :title="t('tools.binary-calculator.texts.title-bitmask')">
|
||||
<NSpace justify="center" wrap>
|
||||
<NTag
|
||||
v-for="(bit, index) in bitmask"
|
||||
:key="index"
|
||||
:type="bit === '1' ? 'success' : 'default'"
|
||||
size="small"
|
||||
>
|
||||
{{ bit }}
|
||||
</NTag>
|
||||
</NSpace>
|
||||
</c-card>
|
||||
</div>
|
||||
</template>
|
||||
@@ -0,0 +1,14 @@
|
||||
import { Calculator } from '@vicons/tabler';
|
||||
import { defineTool } from '../tool';
|
||||
import { translate as t } from '@/plugins/i18n.plugin';
|
||||
|
||||
export const tool = defineTool({
|
||||
name: t('tools.binary-calculator.title'),
|
||||
path: '/binary-calculator',
|
||||
description: t('tools.binary-calculator.description'),
|
||||
keywords: ['binary', 'and', 'or', 'xor', 'not', 'bitwise', 'calculator'],
|
||||
component: () => import('./binary-calculator.vue'),
|
||||
icon: Calculator,
|
||||
createdAt: new Date('2025-11-11'),
|
||||
category: 'Maths',
|
||||
});
|
||||
@@ -89,6 +89,12 @@ const umask = computed(() => computeUmaskRepresentation({ permissions: permissio
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<div mb-2 flex justify-center>
|
||||
<c-link target="_blank" to="/chmod-memo">
|
||||
See <code>chmod</code> command cheatsheet.
|
||||
</c-link>
|
||||
</div>
|
||||
|
||||
<n-space justify="center">
|
||||
<c-input-text
|
||||
v-model:value="octalPermissionsInput"
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
<script setup lang="ts">
|
||||
import { useThemeVars } from 'naive-ui';
|
||||
import Memo from './chmod.md';
|
||||
|
||||
const themeVars = useThemeVars();
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<Memo style="overflow-x: auto;" />
|
||||
</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;
|
||||
}
|
||||
::v-deep(table) {
|
||||
border-collapse: collapse;
|
||||
}
|
||||
::v-deep(table), ::v-deep(td), ::v-deep(th) {
|
||||
border: 1px solid v-bind('themeVars.textColor1');
|
||||
padding: 5px;
|
||||
}
|
||||
::v-deep(a) {
|
||||
color: v-bind('themeVars.textColor1');
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,119 @@
|
||||
The `chmod` command changes file and directory permissions in Unix/Linux.
|
||||
|
||||
## 🧑 User Classes
|
||||
|
||||
| Symbol | Meaning |
|
||||
|--------|----------------|
|
||||
| `u` | User (owner) |
|
||||
| `g` | Group |
|
||||
| `o` | Others |
|
||||
| `a` | All (u+g+o) |
|
||||
|
||||
## 🔐 Permission Types
|
||||
|
||||
| Symbol | Meaning | Numeric |
|
||||
|--------|----------|---------|
|
||||
| `r` | Read | 4 |
|
||||
| `w` | Write | 2 |
|
||||
| `x` | Execute | 1 |
|
||||
|
||||
## 📝 Symbolic Mode
|
||||
|
||||
Use `+`, `-`, or `=` to modify permissions:
|
||||
|
||||
```bash
|
||||
chmod u+x file # Add execute to user
|
||||
chmod go-w file # Remove write from group and others
|
||||
chmod a=r file # Set read-only for all
|
||||
```
|
||||
|
||||
## 🔢 Numeric (Octal) Mode
|
||||
|
||||
Combine values for user, group, and others:
|
||||
|
||||
| Mode | Permissions | Meaning |
|
||||
|------|-------------|---------------|
|
||||
| 777 | rwxrwxrwx | Full access |
|
||||
| 755 | rwxr-xr-x | Common for scripts |
|
||||
| 644 | rw-r--r-- | Common for text files |
|
||||
|
||||
|
||||
```bash
|
||||
chmod 755 script.sh
|
||||
chmod 644 notes.txt
|
||||
```
|
||||
|
||||
## 🧪 Special Permission Flags
|
||||
|
||||
These flags go beyond basic read/write/execute and control execution context and deletion behavior.
|
||||
|
||||
### 🔸 `setuid` (Set User ID on Execution)
|
||||
|
||||
- **Octal prefix**: `4`
|
||||
- **Applies to**: Executable files
|
||||
- **Effect**: When executed, the process runs with the file owner's privileges (not the user's).
|
||||
- **Use case**: Programs like `passwd` need elevated privileges to modify system files.
|
||||
|
||||
```bash
|
||||
chmod 4755 /usr/bin/somebinary
|
||||
# -rwsr-xr-x → 's' replaces 'x' in user field
|
||||
```
|
||||
|
||||
> ⚠️ Security risk if misused — avoid setting on scripts or user-controlled binaries.
|
||||
|
||||
### 🔸 `setgid` (Set Group ID)
|
||||
|
||||
- **Octal prefix**: `2`
|
||||
- **Applies to**:
|
||||
- **Files**: Runs with the file group’s privileges.
|
||||
- **Directories**: New files inherit the directory’s group.
|
||||
- **Use case**: Shared project folders where all files should belong to the same group.
|
||||
|
||||
```bash
|
||||
chmod 2755 /shared/folder
|
||||
# drwxr-sr-x → 's' in group field
|
||||
```
|
||||
|
||||
> 📁 On directories, this ensures group consistency for collaborative environments.
|
||||
|
||||
### 🔸 `sticky` Bit
|
||||
|
||||
- **Octal prefix**: `1`
|
||||
- **Applies to**: Directories only
|
||||
- **Effect**: Only the file owner (or root) can delete or rename files inside.
|
||||
- **Use case**: `/tmp` directory — prevents users from deleting each other’s files.
|
||||
|
||||
```bash
|
||||
chmod 1777 /tmp
|
||||
# drwxrwxrwt → 't' in others field
|
||||
```
|
||||
|
||||
> 🧷 Think of it as a “delete lock” for shared spaces.
|
||||
|
||||
## 📂 Execute (`x`) Flag: Files vs Directories
|
||||
|
||||
| Context | Effect of `x` Permission |
|
||||
|-------------|----------------------------------------|
|
||||
| **File** | Allows execution as a program/script |
|
||||
| **Directory** | Allows entering the directory (`cd`) and accessing contents by name |
|
||||
|
||||
### 🔍 Directory Access Matrix
|
||||
|
||||
| Permission | Can List (`ls`) | Can Enter (`cd`) | Can Access Files |
|
||||
|------------|------------------|------------------|------------------|
|
||||
| `r` | ✅ | ❌ | ✅ (if name known) |
|
||||
| `x` | ❌ | ✅ | ✅ (if name known) |
|
||||
| `r+x` | ✅ | ✅ | ✅ |
|
||||
|
||||
> 🧠 Without `x` on a directory, you can't `cd` into it — even if you can list its contents.
|
||||
|
||||
## 🔍 Quick Reference
|
||||
|
||||
| Command | Description |
|
||||
|---------------------|--------------------------------------|
|
||||
| `chmod +x file` | Make file executable |
|
||||
| `chmod -R 755 dir` | Recursively set permissions |
|
||||
| `chmod u=rwx file` | Set user to rwx only |
|
||||
| `chmod a-x file` | Remove execute from all |
|
||||
|
||||
💡 Tip: Use `ls -l` to view current permissions.
|
||||
@@ -0,0 +1,14 @@
|
||||
import { FileInvoice } from '@vicons/tabler';
|
||||
import { defineTool } from '../tool';
|
||||
import { translate as t } from '@/plugins/i18n.plugin';
|
||||
|
||||
export const tool = defineTool({
|
||||
name: t('tools.chmod-memo.title'),
|
||||
path: '/chmod-memo',
|
||||
description: t('tools.chmod-memo.description'),
|
||||
keywords: ['chmod', 'permissions', 'memo', 'cheatsheet'],
|
||||
component: () => import('./chmod-memo.vue'),
|
||||
icon: FileInvoice,
|
||||
createdAt: new Date('2025-11-11'),
|
||||
category: 'Cheatsheets',
|
||||
});
|
||||
@@ -21,9 +21,9 @@ const command = ref('');
|
||||
label-position="left"
|
||||
label-width="130px"
|
||||
:label="$t('tools.cli-command-editor.command')"
|
||||
:aria-:label="t('tools.cli-command-editor.texts.label-t-tools-cli-command-editor-command')"
|
||||
:aria-label="t('tools.cli-command-editor.command')"
|
||||
:placeholder="$t('tools.cli-command-editor.placeholder')"
|
||||
:aria-:placeholder="t('tools.cli-command-editor.texts.placeholder-t-tools-cli-command-editor-placeholder')"
|
||||
:aria-placeholder="t('tools.cli-command-editor.placeholder')"
|
||||
raw-text
|
||||
@update:value="() => { command = inputCommand }"
|
||||
/>
|
||||
@@ -34,9 +34,9 @@ const command = ref('');
|
||||
label-width="130px"
|
||||
label-align="left"
|
||||
:label="service.sanitizeOption(option)"
|
||||
:aria-:label="t('tools.cli-command-editor.texts.label-service-sanitizeoption-option')"
|
||||
:aria-label="service.sanitizeOption(option)"
|
||||
:placeholder="service.sanitizeOption(option)"
|
||||
:aria-:placeholder="t('tools.cli-command-editor.texts.placeholder-service-sanitizeoption-option')"
|
||||
:aria-placeholder="service.sanitizeOption(option)"
|
||||
mt-6
|
||||
@update:value="() => { command = service.buildEditedCommand(optionsInput, optionsObject, inputCommand) }"
|
||||
/>
|
||||
|
||||
@@ -91,11 +91,7 @@ const CRCValues = computed(() => withDefaultOnError(() => {
|
||||
}, defaultCRCValues));
|
||||
|
||||
watch(text,
|
||||
(_, newValue) => {
|
||||
if (newValue === '') {
|
||||
return;
|
||||
}
|
||||
|
||||
(newValue) => {
|
||||
file.value = null;
|
||||
hashes.value = getCRCs(newValue);
|
||||
status.value = 'done';
|
||||
|
||||
@@ -1,48 +0,0 @@
|
||||
<script setup lang="ts">
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { GenCC, Schemes } from 'creditcard-generator';
|
||||
import { useQueryParamOrStorage } from '@/composable/queryParams';
|
||||
|
||||
const { t } = useI18n();
|
||||
|
||||
const schemes = Object.keys(Schemes);
|
||||
|
||||
const selectedScheme = useQueryParamOrStorage({ name: 'type', storageName: 'credit-card-gen:t', defaultValue: 'VISA' });
|
||||
const count = useQueryParamOrStorage({ name: 'count', storageName: 'credit-card-gen:c', defaultValue: 5 });
|
||||
|
||||
const cards = ref('');
|
||||
|
||||
function generateCards() {
|
||||
cards.value = GenCC(selectedScheme.value, count.value).join('\n');
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div style="max-width: 600px;">
|
||||
<c-select
|
||||
v-model:value="selectedScheme"
|
||||
:options="schemes"
|
||||
:label="t('tools.credit-card-generator.texts.label-credit-card-scheme')"
|
||||
label-position="left"
|
||||
:placeholder="t('tools.credit-card-generator.texts.placeholder-select-scheme')"
|
||||
mb-1
|
||||
/>
|
||||
<n-form-item :label="t('tools.credit-card-generator.texts.label-number-of-credit-card-to-generate')" label-placement="left">
|
||||
<n-input-number
|
||||
v-model:value="count"
|
||||
:min="1"
|
||||
:max="50"
|
||||
:placeholder="t('tools.credit-card-generator.texts.placeholder-number-of-cards')"
|
||||
/>
|
||||
</n-form-item>
|
||||
<n-space justify="center">
|
||||
<n-button type="primary" mb-3 @click="generateCards">
|
||||
{{ t('tools.credit-card-generator.texts.tag-generate-random-credit-card-numbers') }}
|
||||
</n-button>
|
||||
</n-space>
|
||||
|
||||
<c-card v-if="cards" :title="t('tools.credit-card-generator.texts.title-generated-credit-card-numbers')">
|
||||
<textarea-copyable :value="cards" />
|
||||
</c-card>
|
||||
</div>
|
||||
</template>
|
||||
@@ -1,4 +0,0 @@
|
||||
declare module 'creditcard-generator' {
|
||||
export const Schemes: Record<string, string>;
|
||||
export function GenCC(scheme: string, count: number): string[];
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
import { CreditCard } from '@vicons/tabler';
|
||||
import { defineTool } from '../tool';
|
||||
import { translate as t } from '@/plugins/i18n.plugin';
|
||||
|
||||
export const tool = defineTool({
|
||||
name: t('tools.credit-card-generator.title'),
|
||||
path: '/credit-card-generator',
|
||||
description: t('tools.credit-card-generator.description'),
|
||||
keywords: ['credit', 'card', 'generator'],
|
||||
component: () => import('./credit-card-generator.vue'),
|
||||
icon: CreditCard,
|
||||
createdAt: new Date('2025-10-03'),
|
||||
category: 'Data',
|
||||
});
|
||||
@@ -0,0 +1,114 @@
|
||||
<script setup lang="ts">
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import _ from 'lodash';
|
||||
import { useITStorage, useQueryParamOrStorage } from '@/composable/queryParams';
|
||||
|
||||
const { t } = useI18n();
|
||||
|
||||
const gradientType = useQueryParamOrStorage({ name: 'type', storageName: 'css-gradients:t', defaultValue: 'linear' });
|
||||
const angle = useQueryParamOrStorage({ name: 'angle', storageName: 'css-gradients:a', defaultValue: 90 });
|
||||
|
||||
const colorStops = useITStorage('css-gradients:s', [
|
||||
{ color: '#ff0000', position: 0 },
|
||||
{ color: '#0000ff', position: 100 },
|
||||
]);
|
||||
|
||||
const gradientCSS = computed(() => {
|
||||
const stops = _.orderBy(colorStops.value, 'position')
|
||||
.map(({ color, position }) => `${color} ${position}%`)
|
||||
.join(', ');
|
||||
return gradientType.value === 'linear'
|
||||
? `linear-gradient(${angle.value}deg, ${stops})`
|
||||
: `radial-gradient(${stops})`;
|
||||
});
|
||||
|
||||
function addStop() {
|
||||
colorStops.value.push({ color: '#ffffff', position: 50 });
|
||||
}
|
||||
|
||||
function removeStop(index: number) {
|
||||
colorStops.value.splice(index, 1);
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<NForm label-placement="left">
|
||||
<n-space justify="center">
|
||||
<NFormItem :label="t('tools.css-gradient-generator.texts.label-gradient-type')">
|
||||
<NRadioGroup v-model:value="gradientType">
|
||||
<NRadioButton value="linear">
|
||||
{{ t('tools.css-gradient-generator.texts.tag-linear') }}
|
||||
</NRadioButton>
|
||||
<NRadioButton value="radial">
|
||||
{{ t('tools.css-gradient-generator.texts.tag-radial') }}
|
||||
</NRadioButton>
|
||||
</NRadioGroup>
|
||||
</NFormItem>
|
||||
|
||||
<NFormItem v-if="gradientType === 'linear'" :label="t('tools.css-gradient-generator.texts.label-angle-degrees')">
|
||||
<NSlider v-model:value="angle" :min="0" :max="360" :step="1" mr-1 />
|
||||
<n-input-number :value="angle" />
|
||||
</NFormItem>
|
||||
</n-space>
|
||||
|
||||
<c-card :title="t('tools.css-gradient-generator.texts.title-color-stops')">
|
||||
<div class="color-stop-list" w-full>
|
||||
<div
|
||||
v-for="(stop, index) in colorStops"
|
||||
:key="index"
|
||||
class="color-stop-item"
|
||||
>
|
||||
<NColorPicker v-model:value="stop.color" />
|
||||
<NInputNumber
|
||||
v-model:value="stop.position"
|
||||
:min="0"
|
||||
:max="100"
|
||||
:step="1"
|
||||
style="width: 150px"
|
||||
/>
|
||||
<NButton size="small" type="error" @click="removeStop(index)">
|
||||
{{ t('tools.css-gradient-generator.texts.tag-remove') }}
|
||||
</NButton>
|
||||
</div>
|
||||
</div>
|
||||
<n-space justify="center">
|
||||
<NButton type="primary" size="small" @click="addStop">
|
||||
{{ t('tools.css-gradient-generator.texts.tag-add-color-stop') }}
|
||||
</NButton>
|
||||
</n-space>
|
||||
</c-card>
|
||||
|
||||
<c-card :title="t('tools.css-gradient-generator.texts.title-preview')" mt-1>
|
||||
<div class="preview" :style="{ background: gradientCSS }" />
|
||||
</c-card>
|
||||
|
||||
<c-card :title="t('tools.css-gradient-generator.texts.title-generated-css')" mt-1>
|
||||
<textarea-copyable :value="gradientCSS" language="css" />
|
||||
</c-card>
|
||||
</NForm>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.color-stop-list {
|
||||
max-height: 300px;
|
||||
overflow-y: auto;
|
||||
border: 1px solid #ddd;
|
||||
padding: 8px;
|
||||
border-radius: 6px;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
.color-stop-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
.preview {
|
||||
height: 150px;
|
||||
border-radius: 8px;
|
||||
margin: 16px 0;
|
||||
border: 1px solid #ccc;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,14 @@
|
||||
import { Rainbow } from '@vicons/tabler';
|
||||
import { defineTool } from '../tool';
|
||||
import { translate as t } from '@/plugins/i18n.plugin';
|
||||
|
||||
export const tool = defineTool({
|
||||
name: t('tools.css-gradient-generator.title'),
|
||||
path: '/css-gradient-generator',
|
||||
description: t('tools.css-gradient-generator.description'),
|
||||
keywords: ['css', 'gradient', 'generator'],
|
||||
component: () => import('./css-gradient-generator.vue'),
|
||||
icon: Rainbow,
|
||||
createdAt: new Date('2025-11-29'),
|
||||
category: 'Web',
|
||||
});
|
||||
@@ -0,0 +1,102 @@
|
||||
<script setup lang="ts">
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { useQueryParamOrStorage } from '@/composable/queryParams';
|
||||
|
||||
const { t } = useI18n();
|
||||
|
||||
const inputValue = ref(16);
|
||||
const baseFontSize = ref(16);
|
||||
const viewportWidth = useQueryParamOrStorage({ name: 'vw', storageName: 'css-units-conv:w', defaultValue: 1440 });
|
||||
const viewportHeight = useQueryParamOrStorage({ name: 'vh', storageName: 'css-units-conv:h', defaultValue: 900 });
|
||||
const fromUnit = useQueryParamOrStorage({ name: 'from', storageName: 'css-units-conv:f', defaultValue: 'px' });
|
||||
const toUnit = useQueryParamOrStorage({ name: 'to', storageName: 'css-units-conv:t', defaultValue: 'em' });
|
||||
|
||||
const unitOptions = [
|
||||
{ label: t('tools.css-units-converter.texts.label-pixels-px'), value: 'px' },
|
||||
{ label: t('tools.css-units-converter.texts.label-ems-em'), value: 'em' },
|
||||
{ label: t('tools.css-units-converter.texts.label-rems-rem'), value: 'rem' },
|
||||
{ label: t('tools.css-units-converter.texts.label-percent'), value: '%' },
|
||||
{ label: t('tools.css-units-converter.texts.label-viewport-width-vw'), value: 'vw' },
|
||||
{ label: t('tools.css-units-converter.texts.label-viewport-height-vh'), value: 'vh' },
|
||||
];
|
||||
|
||||
const usesRelativeUnits = computed(() =>
|
||||
['em', 'rem', '%'].includes(fromUnit.value) || ['em', 'rem', '%'].includes(toUnit.value),
|
||||
);
|
||||
|
||||
const usesViewportUnits = computed(() =>
|
||||
['vw', 'vh'].includes(fromUnit.value) || ['vw', 'vh'].includes(toUnit.value),
|
||||
);
|
||||
|
||||
function toPx(value: number, unit: string) {
|
||||
switch (unit) {
|
||||
case 'px': return value;
|
||||
case 'em':
|
||||
case 'rem': return value * baseFontSize.value;
|
||||
case '%': return (value / 100) * baseFontSize.value;
|
||||
case 'vw': return (value / 100) * viewportWidth.value;
|
||||
case 'vh': return (value / 100) * viewportHeight.value;
|
||||
default: return value;
|
||||
}
|
||||
}
|
||||
|
||||
function fromPx(pxValue: number, unit: string) {
|
||||
switch (unit) {
|
||||
case 'px': return pxValue;
|
||||
case 'em':
|
||||
case 'rem': return pxValue / baseFontSize.value;
|
||||
case '%': return (pxValue / baseFontSize.value) * 100;
|
||||
case 'vw': return (pxValue / viewportWidth.value) * 100;
|
||||
case 'vh': return (pxValue / viewportHeight.value) * 100;
|
||||
default: return pxValue;
|
||||
}
|
||||
}
|
||||
|
||||
const convertedValue = computed(() => {
|
||||
const px = toPx(inputValue.value, fromUnit.value);
|
||||
return fromPx(px, toUnit.value).toFixed(2);
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<NForm label-placement="left">
|
||||
<n-space justify="center">
|
||||
<NFormItem :label="t('tools.css-units-converter.texts.label-value-to-convert')">
|
||||
<NInputNumber v-model:value="inputValue" />
|
||||
</NFormItem>
|
||||
|
||||
<NFormItem :label="t('tools.css-units-converter.texts.label-from-unit')">
|
||||
<NSelect v-model:value="fromUnit" :options="unitOptions" style="width: 200px" />
|
||||
</NFormItem>
|
||||
|
||||
<NFormItem :label="t('tools.css-units-converter.texts.label-to-unit')">
|
||||
<NSelect v-model:value="toUnit" :options="unitOptions" style="width: 200px" />
|
||||
</NFormItem>
|
||||
</n-space>
|
||||
|
||||
<n-space justify="center">
|
||||
<NFormItem v-if="usesRelativeUnits" :label="t('tools.css-units-converter.texts.label-base-font-size-px')">
|
||||
<NInputNumber v-model:value="baseFontSize" :min="1" />
|
||||
</NFormItem>
|
||||
|
||||
<NFormItem v-if="usesViewportUnits" :label="t('tools.css-units-converter.texts.label-viewport-width-px')">
|
||||
<NInputNumber v-model:value="viewportWidth" :min="1" />
|
||||
</NFormItem>
|
||||
|
||||
<NFormItem v-if="usesViewportUnits" :label="t('tools.css-units-converter.texts.label-viewport-height-px')">
|
||||
<NInputNumber v-model:value="viewportHeight" :min="1" />
|
||||
</NFormItem>
|
||||
</n-space>
|
||||
|
||||
<c-card :title="t('tools.css-units-converter.texts.title-conversion')">
|
||||
<n-p>
|
||||
{{ inputValue }}{{ fromUnit }} = {{ convertedValue }}{{ toUnit }}
|
||||
<span v-if="usesRelativeUnits">(for base font size of {{ baseFontSize }}px)</span>
|
||||
<span v-if="usesViewportUnits">(for viewport of {{ viewportWidth }}x{{ viewportHeight }})</span>
|
||||
</n-p>
|
||||
<input-copyable :label="t('tools.css-units-converter.texts.label-converted-value')" label-position="left" :value="convertedValue" />
|
||||
</c-card>
|
||||
</NForm>
|
||||
</div>
|
||||
</template>
|
||||
@@ -0,0 +1,14 @@
|
||||
import { Dimensions } from '@vicons/tabler';
|
||||
import { defineTool } from '../tool';
|
||||
import { translate as t } from '@/plugins/i18n.plugin';
|
||||
|
||||
export const tool = defineTool({
|
||||
name: t('tools.css-units-converter.title'),
|
||||
path: '/css-units-converter',
|
||||
description: t('tools.css-units-converter.description'),
|
||||
keywords: ['css', 'units', 'converter'],
|
||||
component: () => import('./css-units-converter.vue'),
|
||||
icon: Dimensions,
|
||||
createdAt: new Date('2025-11-29'),
|
||||
category: 'Web',
|
||||
});
|
||||
@@ -43,9 +43,9 @@ const cssOutput = computed(
|
||||
mb-5
|
||||
/>
|
||||
|
||||
<router-link target="_blank" to="/css-selectors-memo" mb-1 mt-1>
|
||||
<c-link target="_blank" to="/css-selectors-memo" mb-1 mt-1>
|
||||
{{ t('tools.css-xpath-converter.texts.tag-see-css-selectors-cheatsheet') }}
|
||||
</router-link>
|
||||
</c-link>
|
||||
|
||||
<n-divider />
|
||||
|
||||
@@ -66,9 +66,9 @@ const cssOutput = computed(
|
||||
mb-5
|
||||
/>
|
||||
|
||||
<router-link target="_blank" to="/xpath-memo" mb-1 mt-1>
|
||||
<c-link target="_blank" to="/xpath-memo" mb-1 mt-1>
|
||||
{{ t('tools.css-xpath-converter.texts.tag-see-xpath-cheatsheet') }}
|
||||
</router-link>
|
||||
</c-link>
|
||||
|
||||
<n-divider />
|
||||
|
||||
|
||||
@@ -31,9 +31,9 @@ const rules: UseValidationRule<string>[] = [
|
||||
<n-checkbox v-model:checked="typedValues" />
|
||||
</n-form-item>
|
||||
<FormatTransformer
|
||||
:input-:label="t('tools.csv-to-json.texts.label-t-tools-csv-to-json-texts-input-label-your-raw-csv')"
|
||||
:input-:placeholder="t('tools.csv-to-json.texts.placeholder-t-tools-csv-to-json-texts-input-placeholder-paste-your-raw-csv-here')"
|
||||
:output-:label="t('tools.csv-to-json.texts.label-t-tools-csv-to-json-texts-output-label-json-version-of-your-csv')"
|
||||
:input-label="t('tools.csv-to-json.texts.input-label-your-raw-csv')"
|
||||
:input-placeholder="t('tools.csv-to-json.texts.input-placeholder-paste-your-raw-csv-here')"
|
||||
:output-label="t('tools.csv-to-json.texts.output-label-json-version-of-your-csv')"
|
||||
:input-validation-rules="rules"
|
||||
:transformer="transformer"
|
||||
/>
|
||||
|
||||
@@ -105,11 +105,11 @@ const jsonBodyValidation = useValidation({
|
||||
</c-card>
|
||||
|
||||
<c-card v-else :title="t('tools.curl-generator.texts.title-form-entries')" mb-2>
|
||||
<NDynamicInput v-model:value="formData" preset="pair" key-:placeholder="t('tools.curl-generator.texts.placeholder-key')" value-:placeholder="t('tools.curl-generator.texts.placeholder-value')" />
|
||||
<NDynamicInput v-model:value="formData" preset="pair" :key-placeholder="t('tools.curl-generator.texts.placeholder-key')" :value-placeholder="t('tools.curl-generator.texts.placeholder-value')" />
|
||||
</c-card>
|
||||
|
||||
<c-card :title="t('tools.curl-generator.texts.title-http-headers')" mb-2>
|
||||
<NDynamicInput v-model:value="headers" preset="pair" key-:placeholder="t('tools.curl-generator.texts.placeholder-header')" value-:placeholder="t('tools.curl-generator.texts.placeholder-value')" />
|
||||
<NDynamicInput v-model:value="headers" preset="pair" :key-placeholder="t('tools.curl-generator.texts.placeholder-header')" :value-placeholder="t('tools.curl-generator.texts.placeholder-value')" />
|
||||
</c-card>
|
||||
|
||||
<c-card :title="t('tools.curl-generator.texts.title-options')" mb-2>
|
||||
|
||||
@@ -6,7 +6,7 @@ export const tool = defineTool({
|
||||
name: t('tools.currency-converter.title'),
|
||||
path: '/currency-converter',
|
||||
description: t('tools.currency-converter.description'),
|
||||
keywords: ['currency', 'converter'],
|
||||
keywords: ['currency', 'converter', 'units'],
|
||||
component: () => import('./currency-converter.vue'),
|
||||
icon: Currency,
|
||||
createdAt: new Date('2024-08-15'),
|
||||
|
||||
@@ -4,15 +4,15 @@ import { convertStorageAndRateUnitsDisplay, displayStorageAndRateUnits } from '.
|
||||
describe('data-storage-unit-converter', () => {
|
||||
describe('convertStorageAndRateUnitsDisplay', () => {
|
||||
it('convert from same base units', () => {
|
||||
expect(convertStorageAndRateUnitsDisplay({ value: 1024 * 1024, fromUnit: 'B', toUnit: 'MiB' })).toBe('1');
|
||||
expect(convertStorageAndRateUnitsDisplay({ value: 1024, fromUnit: 'KiB', toUnit: 'MiB' })).toBe('1');
|
||||
expect(convertStorageAndRateUnitsDisplay({ value: 1, fromUnit: 'MiB', toUnit: 'KiB' })).toBe('1024');
|
||||
expect(convertStorageAndRateUnitsDisplay({ value: 1000, fromUnit: 'MB', toUnit: 'GB' })).toBe('1');
|
||||
expect(convertStorageAndRateUnitsDisplay({ value: 1024, fromUnit: 'MB', toUnit: 'MB' })).toBe('1024');
|
||||
expect(convertStorageAndRateUnitsDisplay({ value: 1, fromUnit: 'MB', toUnit: 'KB' })).toBe('1000');
|
||||
expect(convertStorageAndRateUnitsDisplay({ value: 1024, fromUnit: 'MiB', toUnit: 'GiB' })).toBe('1');
|
||||
expect(convertStorageAndRateUnitsDisplay({ value: 1000, fromUnit: 'MB', toUnit: 'GB' })).toBe('1');
|
||||
expect(convertStorageAndRateUnitsDisplay({ value: 1000, fromUnit: 'Mb', toUnit: 'Gb' })).toBe('1');
|
||||
expect(convertStorageAndRateUnitsDisplay({ value: 1024 * 1024, fromUnit: 'B', toUnit: 'MiB', precision: 0 })).toBe('1');
|
||||
expect(convertStorageAndRateUnitsDisplay({ value: 1024, fromUnit: 'KiB', toUnit: 'MiB', precision: 0 })).toBe('1');
|
||||
expect(convertStorageAndRateUnitsDisplay({ value: 1, fromUnit: 'MiB', toUnit: 'KiB', precision: 0 })).toBe('1024');
|
||||
expect(convertStorageAndRateUnitsDisplay({ value: 1000, fromUnit: 'MB', toUnit: 'GB', precision: 0 })).toBe('1');
|
||||
expect(convertStorageAndRateUnitsDisplay({ value: 1024, fromUnit: 'MB', toUnit: 'MB', precision: 0 })).toBe('1024');
|
||||
expect(convertStorageAndRateUnitsDisplay({ value: 1, fromUnit: 'MB', toUnit: 'KB', precision: 0 })).toBe('1000');
|
||||
expect(convertStorageAndRateUnitsDisplay({ value: 1024, fromUnit: 'MiB', toUnit: 'GiB', precision: 0 })).toBe('1');
|
||||
expect(convertStorageAndRateUnitsDisplay({ value: 1000, fromUnit: 'MB', toUnit: 'GB', precision: 0 })).toBe('1');
|
||||
expect(convertStorageAndRateUnitsDisplay({ value: 1000, fromUnit: 'Mb', toUnit: 'Gb', precision: 0 })).toBe('1');
|
||||
});
|
||||
|
||||
it('convert between base units', () => {
|
||||
@@ -21,19 +21,19 @@ describe('data-storage-unit-converter', () => {
|
||||
expect(convertStorageAndRateUnitsDisplay({ value: 1000 * 1000, fromUnit: 'B', toUnit: 'MiB' })).toBe('0.954');
|
||||
expect(convertStorageAndRateUnitsDisplay({ value: 1024, fromUnit: 'KB', toUnit: 'MiB' })).toBe('0.977');
|
||||
expect(convertStorageAndRateUnitsDisplay({ value: 1000, fromUnit: 'MiB', toUnit: 'MB' })).toBe('1048.576');
|
||||
expect(convertStorageAndRateUnitsDisplay({ value: 1, fromUnit: 'MB', toUnit: 'Mb' })).toBe('8');
|
||||
expect(convertStorageAndRateUnitsDisplay({ value: 1000, fromUnit: 'KB', toUnit: 'Kb' })).toBe('8000');
|
||||
expect(convertStorageAndRateUnitsDisplay({ value: 1000, fromUnit: 'KiB', toUnit: 'Kb' })).toBe('8192');
|
||||
expect(convertStorageAndRateUnitsDisplay({ value: 8, fromUnit: 'Mb', toUnit: 'MB' })).toBe('1');
|
||||
expect(convertStorageAndRateUnitsDisplay({ value: 1, fromUnit: 'MB', toUnit: 'Mb', precision: 0 })).toBe('8');
|
||||
expect(convertStorageAndRateUnitsDisplay({ value: 1000, fromUnit: 'KB', toUnit: 'Kb', precision: 0 })).toBe('8000');
|
||||
expect(convertStorageAndRateUnitsDisplay({ value: 1000, fromUnit: 'KiB', toUnit: 'Kb', precision: 0 })).toBe('8192');
|
||||
expect(convertStorageAndRateUnitsDisplay({ value: 8, fromUnit: 'Mb', toUnit: 'MB', precision: 0 })).toBe('1');
|
||||
|
||||
expect(convertStorageAndRateUnitsDisplay({ value: 1, fromUnit: 'Mb', toUnit: 'KB' })).toBe('125');
|
||||
expect(convertStorageAndRateUnitsDisplay({ value: 125, fromUnit: 'KB', toUnit: 'Mb' })).toBe('1');
|
||||
expect(convertStorageAndRateUnitsDisplay({ value: 1, fromUnit: 'Mb', toUnit: 'KB', precision: 0 })).toBe('125');
|
||||
expect(convertStorageAndRateUnitsDisplay({ value: 125, fromUnit: 'KB', toUnit: 'Mb', precision: 0 })).toBe('1');
|
||||
|
||||
expect(convertStorageAndRateUnitsDisplay({ value: 1, fromUnit: 'MiB', toUnit: 'Kb' })).toBe('8388.608');
|
||||
expect(convertStorageAndRateUnitsDisplay({ value: 8388.608, fromUnit: 'Kb', toUnit: 'MiB' })).toBe('1');
|
||||
expect(convertStorageAndRateUnitsDisplay({ value: 8388.608, fromUnit: 'Kb', toUnit: 'MiB', precision: 0 })).toBe('1');
|
||||
});
|
||||
it('convert with unit display', () => {
|
||||
expect(convertStorageAndRateUnitsDisplay({ value: 1024 * 1024, fromUnit: 'B', toUnit: 'MiB', appendUnit: true })).toBe('1MiB');
|
||||
expect(convertStorageAndRateUnitsDisplay({ value: 1024 * 1024, fromUnit: 'B', toUnit: 'MiB', appendUnit: true, precision: 2 })).toBe('1.00MiB');
|
||||
});
|
||||
|
||||
//
|
||||
|
||||
@@ -6,7 +6,7 @@ export type AllSupportedUnits = BibytesUnits | BytesUnits | BitsUnits;
|
||||
export function displayStorageAndRateUnits(
|
||||
{ value, unit, precision = 3, appendUnit = false }:
|
||||
{ value: number; unit: AllSupportedUnits; precision?: number ; appendUnit?: boolean }): string {
|
||||
return value.toFixed(precision).replace(/0+$/, '').replace(/\.$/, '') + (appendUnit ? unit : ''); // NOSONAR
|
||||
return value.toFixed(precision) + (appendUnit ? unit : ''); // NOSONAR
|
||||
}
|
||||
|
||||
export function convertStorageAndRateUnitsDisplay(
|
||||
|
||||
@@ -10,7 +10,8 @@ export const tool = defineTool({
|
||||
'bits', 'bytes', 'bibytes', 'binary',
|
||||
'KiB', 'MiB', 'GiB', 'TiB', 'PiB', 'EiB', 'ZiB', 'YiB',
|
||||
'B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB',
|
||||
'b', 'Kb', 'Mb', 'Gb', 'Tb', 'Pb', 'Eb', 'Zb', 'Yb'],
|
||||
'b', 'Kb', 'Mb', 'Gb', 'Tb', 'Pb', 'Eb', 'Zb', 'Yb',
|
||||
'units'],
|
||||
component: () => import('./data-storage-unit-converter.vue'),
|
||||
icon: ArrowsLeftRight,
|
||||
createdAt: new Date('2024-08-15'),
|
||||
|
||||
@@ -6,7 +6,7 @@ export const tool = defineTool({
|
||||
name: t('tools.data-transfer-rate-converter.title'),
|
||||
path: '/data-transfer-rate-converter',
|
||||
description: t('tools.data-transfer-rate-converter.description'),
|
||||
keywords: ['data', 'transfer', 'rate', 'convert', 'time'],
|
||||
keywords: ['data', 'transfer', 'rate', 'convert', 'time', 'units'],
|
||||
component: () => import('./data-transfer-rate-converter.vue'),
|
||||
icon: TransferIn,
|
||||
createdAt: new Date('2024-08-15'),
|
||||
|
||||
@@ -6,7 +6,7 @@ export const tool = defineTool({
|
||||
name: t('tools.date-duration-calculator.title'),
|
||||
path: '/date-duration-calculator',
|
||||
description: t('tools.date-duration-calculator.description'),
|
||||
keywords: ['date', 'duration', 'addition', 'calculator'],
|
||||
keywords: ['date', 'duration', 'addition', 'calculator', 'units'],
|
||||
component: () => import('./date-duration-calculator.vue'),
|
||||
icon: Calendar,
|
||||
createdAt: new Date('2024-08-15'),
|
||||
|
||||
@@ -6,7 +6,8 @@ export const tool = defineTool({
|
||||
name: t('tools.date-converter.title'),
|
||||
path: '/date-converter',
|
||||
description: t('tools.date-converter.description'),
|
||||
keywords: ['date', 'time', 'converter', 'iso', 'utc', 'unix', 'epoch', 'timezone', 'year', 'month', 'day', 'minute', 'seconde', 'filetime', 'ldap', 'win32'],
|
||||
keywords: ['date', 'time', 'converter', 'iso', 'utc', 'unix', 'epoch', 'timezone',
|
||||
'year', 'month', 'day', 'minute', 'seconde', 'filetime', 'ldap', 'win32', 'units'],
|
||||
component: () => import('./date-time-converter.vue'),
|
||||
icon: Calendar,
|
||||
npmPackages: ['date-fns'],
|
||||
|
||||
@@ -6,9 +6,9 @@ export const tool = defineTool({
|
||||
name: t('tools.dbm-mw-converter.title'),
|
||||
path: '/dbm-mw-converter',
|
||||
description: t('tools.dbm-mw-converter.description'),
|
||||
keywords: ['dbm', 'mw', 'converter'],
|
||||
keywords: ['dbm', 'mw', 'converter', 'units'],
|
||||
component: () => import('./dbm-mw-converter.vue'),
|
||||
icon: DeviceAudioTape,
|
||||
createdAt: new Date('2025-10-03'),
|
||||
category: 'Default',
|
||||
category: 'Converters',
|
||||
});
|
||||
+9
-3
@@ -2,13 +2,15 @@
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import decomposerize from 'decomposerize';
|
||||
import TextareaCopyable from '@/components/TextareaCopyable.vue';
|
||||
import { useQueryParamOrStorage } from '@/composable/queryParams';
|
||||
|
||||
const { t } = useI18n();
|
||||
|
||||
const detachOption = ref<boolean>(false);
|
||||
const removeOption = ref<boolean>(false);
|
||||
const longArgsOption = ref<boolean>(false);
|
||||
const equalAsSepOption = ref<boolean>(false);
|
||||
const longArgsOption = useQueryParamOrStorage({ name: 'long', storageName: 'compose-to-run:l', defaultValue: false });
|
||||
const equalAsSepOption = useQueryParamOrStorage({ name: 'sepequal', storageName: 'compose-to-run:e', defaultValue: false });
|
||||
const multiline = useQueryParamOrStorage({ name: 'multiline', storageName: 'compose-to-run:m', defaultValue: false });
|
||||
|
||||
const dockerCompose = ref(
|
||||
`version: '3.3'
|
||||
@@ -32,6 +34,7 @@ const conversionResult = computed(() => {
|
||||
'rm': removeOption.value,
|
||||
'long-args': longArgsOption.value,
|
||||
'arg-value-separator': equalAsSepOption.value ? '=' : ' ',
|
||||
'multiline': multiline.value,
|
||||
};
|
||||
return { commands: decomposerize(dockerCompose.value.trim(), config), errors: [] };
|
||||
}
|
||||
@@ -86,8 +89,11 @@ const MONACO_EDITOR_OPTIONS = {
|
||||
<n-checkbox v-model:checked="longArgsOption">
|
||||
{{ t('tools.docker-compose-to-docker-run-converter.texts.tag-long-arguments') }}
|
||||
</n-checkbox>
|
||||
<n-checkbox v-model:checked="multiline">
|
||||
{{ t('tools.docker-compose-to-docker-run-converter.texts.tag-multiline') }}
|
||||
</n-checkbox>
|
||||
<n-checkbox v-model:checked="equalAsSepOption">
|
||||
{{ t('tools.docker-compose-to-docker-run-converter.texts.tag-') }}<i>{{ t('tools.docker-compose-to-docker-run-converter.texts.tag-arg') }}</i>{{ t('tools.docker-compose-to-docker-run-converter.texts.tag-') }}<i>{{ t('tools.docker-compose-to-docker-run-converter.texts.tag-value') }}</i>{{ t('tools.docker-compose-to-docker-run-converter.texts.tag-') }}
|
||||
{{ t('tools.docker-compose-to-docker-run-converter.texts.tag-equal-sep') }}
|
||||
</n-checkbox>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -0,0 +1,77 @@
|
||||
import { describe, expect, it } from 'vitest';
|
||||
import { extractEnvFromCompose } from './docker-compose-to-env-file.service';
|
||||
|
||||
describe('extractEnvFromCompose', () => {
|
||||
it('handles array format', () => {
|
||||
const yaml = `
|
||||
services:
|
||||
web:
|
||||
environment:
|
||||
- PORT=3000
|
||||
- DEBUG=true
|
||||
db:
|
||||
environment:
|
||||
- POSTGRES_USER=admin
|
||||
- POSTGRES_PASSWORD=secret
|
||||
`;
|
||||
const result = extractEnvFromCompose(yaml);
|
||||
expect(result).toContain('# web');
|
||||
expect(result).toContain('PORT=3000');
|
||||
expect(result).toContain('DEBUG=true');
|
||||
expect(result).toContain('# db');
|
||||
expect(result).toContain('POSTGRES_USER=admin');
|
||||
expect(result).toContain('POSTGRES_PASSWORD=secret');
|
||||
});
|
||||
|
||||
it('handles object format', () => {
|
||||
const yaml = `
|
||||
services:
|
||||
api:
|
||||
environment:
|
||||
NODE_ENV: production
|
||||
API_KEY: abc123
|
||||
`;
|
||||
const result = extractEnvFromCompose(yaml);
|
||||
expect(result).toContain('# api');
|
||||
expect(result).toContain('NODE_ENV=production');
|
||||
expect(result).toContain('API_KEY=abc123');
|
||||
});
|
||||
|
||||
it('handles mixed formats and null values', () => {
|
||||
const yaml = `
|
||||
services:
|
||||
mixed:
|
||||
environment:
|
||||
- FOO=bar
|
||||
- EMPTY=
|
||||
- FOO3=null
|
||||
obj:
|
||||
environment:
|
||||
BAR: baz
|
||||
FOO2: null
|
||||
`;
|
||||
const result = extractEnvFromCompose(yaml);
|
||||
expect(result).toContain('# mixed');
|
||||
expect(result).toContain('FOO=bar');
|
||||
expect(result).toContain('EMPTY=');
|
||||
expect(result).toContain('# obj');
|
||||
expect(result).toContain('BAR=baz');
|
||||
expect(result).toContain('FOO2=');
|
||||
expect(result).toContain('FOO3=');
|
||||
});
|
||||
|
||||
it('returns empty string if no env vars', () => {
|
||||
const yaml = `
|
||||
services:
|
||||
noenv:
|
||||
image: nginx
|
||||
`;
|
||||
const result = extractEnvFromCompose(yaml);
|
||||
expect(result).toBe('');
|
||||
});
|
||||
|
||||
it('handles empty input gracefully', () => {
|
||||
const result = extractEnvFromCompose('');
|
||||
expect(result).toBe('');
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,35 @@
|
||||
import yaml from 'yaml';
|
||||
|
||||
export function extractEnvFromCompose(yamlInput: string) {
|
||||
const doc = yaml.parse(yamlInput);
|
||||
const envLines: string[] = [];
|
||||
|
||||
for (const [serviceName, service] of Object.entries(doc?.services || {})) {
|
||||
const env = (service as { environment: any }).environment;
|
||||
if (env === null) {
|
||||
continue;
|
||||
}
|
||||
|
||||
const serviceVars: string[] = [];
|
||||
|
||||
if (Array.isArray(env)) {
|
||||
for (const entry of env) {
|
||||
const [key, value = ''] = entry.split('=');
|
||||
serviceVars.push(`${key.trim()}=${value.trim()}`);
|
||||
}
|
||||
}
|
||||
else if (typeof env === 'object') {
|
||||
for (const [key, value] of Object.entries(env)) {
|
||||
serviceVars.push(`${key.trim()}=${(value ?? '').toString().trim()}`);
|
||||
}
|
||||
}
|
||||
|
||||
if (serviceVars.length) {
|
||||
envLines.push(`# ${serviceName}`);
|
||||
envLines.push(...serviceVars);
|
||||
envLines.push(''); // Add spacing between services
|
||||
}
|
||||
}
|
||||
|
||||
return envLines.join('\n');
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
<script setup lang="ts">
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { extractEnvFromCompose } from './docker-compose-to-env-file.service';
|
||||
|
||||
const { t } = useI18n();
|
||||
|
||||
const yamlInput = ref(`services:
|
||||
web:
|
||||
environment:
|
||||
PORT: 3000
|
||||
DEBUG: true
|
||||
db:
|
||||
environment:
|
||||
- POSTGRES_USER=admin
|
||||
- POSTGRES_PASSWORD=secret
|
||||
`);
|
||||
const envOutput = computed(() => {
|
||||
try {
|
||||
return extractEnvFromCompose(yamlInput.value);
|
||||
}
|
||||
catch (e: any) {
|
||||
return e.toString();
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<c-input-text
|
||||
v-model:value="yamlInput"
|
||||
:label="t('tools.docker-compose-to-env-file.texts.label-docker-compose-file')"
|
||||
multiline
|
||||
:placeholder="t('tools.docker-compose-to-env-file.texts.placeholder-paste-your-docker-compose-yaml-here')"
|
||||
rows="10"
|
||||
mb-2
|
||||
/>
|
||||
|
||||
<n-card :title="t('tools.docker-compose-to-env-file.texts.title-extract-env')">
|
||||
<textarea-copyable
|
||||
v-model:value="envOutput"
|
||||
rows="3"
|
||||
multiline
|
||||
/>
|
||||
</n-card>
|
||||
</div>
|
||||
</template>
|
||||
@@ -0,0 +1,14 @@
|
||||
import { BrandDocker } from '@vicons/tabler';
|
||||
import { defineTool } from '../tool';
|
||||
import { translate as t } from '@/plugins/i18n.plugin';
|
||||
|
||||
export const tool = defineTool({
|
||||
name: t('tools.docker-compose-to-env-file.title'),
|
||||
path: '/docker-compose-to-env-file',
|
||||
description: t('tools.docker-compose-to-env-file.description'),
|
||||
keywords: ['docker', 'compose', 'env', 'environment'],
|
||||
component: () => import('./docker-compose-to-env-file.vue'),
|
||||
icon: BrandDocker,
|
||||
createdAt: new Date('2025-11-11'),
|
||||
category: 'Docker',
|
||||
});
|
||||
@@ -6,7 +6,7 @@ export const tool = defineTool({
|
||||
name: t('tools.duration-calculator.title'),
|
||||
path: '/duration-calculator',
|
||||
description: t('tools.duration-calculator.description'),
|
||||
keywords: ['duration', 'iso', '8601', 'time', 'calculator'],
|
||||
keywords: ['duration', 'iso', '8601', 'time', 'calculator', 'units'],
|
||||
component: () => import('./duration-calculator.vue'),
|
||||
icon: CalendarTime,
|
||||
createdAt: new Date('2024-08-15'),
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
<script setup lang="ts">
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import type { EmvTag } from 'node-emv';
|
||||
|
||||
defineProps<{
|
||||
tags: EmvTag[]
|
||||
title?: string
|
||||
}>();
|
||||
|
||||
const { t } = useI18n();
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<NCollapse :default-expanded-names="['root']">
|
||||
<NCollapseItem :title="title" name="root">
|
||||
<NTable :bordered="true" :single-line="false">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{{ t('tools.emv-tlv-decoder.texts.tag-tag') }}</th>
|
||||
<th>{{ t('tools.emv-tlv-decoder.texts.tag-length') }}</th>
|
||||
<th>{{ t('tools.emv-tlv-decoder.texts.tag-value') }}</th>
|
||||
<th>{{ t('tools.emv-tlv-decoder.texts.tag-description') }}</th>
|
||||
<th>{{ t('tools.emv-tlv-decoder.texts.tag-bit-level-interpretation') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<template v-for="(tag, index) in tags" :key="index">
|
||||
<tr>
|
||||
<td>{{ tag.tag }}</td>
|
||||
<td>{{ tag.length }}</td>
|
||||
<td>{{ Array.isArray(tag.value) ? 'has nested tags' : tag.value }}</td>
|
||||
<td>{{ tag.description }}</td>
|
||||
<td>
|
||||
<ul v-if="tag.bitDetails?.length">
|
||||
<li v-for="(bitDesc, i) in tag.bitDetails" :key="i">
|
||||
{{ bitDesc }}
|
||||
</li>
|
||||
</ul>
|
||||
<span v-else>—</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr v-if="Array.isArray(tag.value)">
|
||||
<td colspan="5" style="padding-left: 2em;">
|
||||
<TLVTagTree :tags="tag.value" :title="`Nested in ${tag.tag}`" />
|
||||
</td>
|
||||
</tr>
|
||||
</template>
|
||||
</tbody>
|
||||
</NTable>
|
||||
</NCollapseItem>
|
||||
</NCollapse>
|
||||
</template>
|
||||
@@ -0,0 +1,254 @@
|
||||
/* eslint-disable max-statements-per-line */
|
||||
import emv, { type EmvBitDescription, type EmvTag } from 'node-emv';
|
||||
|
||||
/**
|
||||
* Utility functions
|
||||
*/
|
||||
function hexToBytes(hex: string): number[] {
|
||||
const clean = hex.replace(/\s+/g, '');
|
||||
if (clean.length % 2 !== 0) {
|
||||
throw new Error(`Invalid hex length: ${clean.length}`);
|
||||
}
|
||||
const out: number[] = [];
|
||||
for (let i = 0; i < clean.length; i += 2) {
|
||||
out.push(Number.parseInt(clean.slice(i, i + 2), 16));
|
||||
}
|
||||
return out;
|
||||
}
|
||||
|
||||
function hasBit(byte: number, bitIndex: number): boolean {
|
||||
return (byte & (1 << bitIndex)) !== 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Tag 9F10 – Issuer Application Data (IAD)
|
||||
*/
|
||||
export function parse9F10_IAD(hex: string): string[] {
|
||||
const bytes = hexToBytes(hex);
|
||||
const results: string[] = [];
|
||||
results.push(`IAD length: ${bytes.length} bytes`);
|
||||
results.push(`Raw IAD: ${hex}`);
|
||||
|
||||
// Heuristic scheme hint
|
||||
if (bytes.length === 22 || bytes.length === 24) { results.push('Likely Visa profile'); }
|
||||
else if (bytes.length === 32 || bytes.length === 34) { results.push('Likely Mastercard profile'); }
|
||||
else { results.push('Scheme unknown'); }
|
||||
|
||||
results.push(`First byte (ARC/IAD version): 0x${bytes[0].toString(16).padStart(2, '0')}`);
|
||||
|
||||
// Heuristic CVR extraction
|
||||
if (bytes.length >= 12) {
|
||||
const cvrBytes = bytes.slice(2, 6);
|
||||
results.push(`CVR (heuristic): ${cvrBytes.map(b => b.toString(16).padStart(2, '0')).join('')}`);
|
||||
}
|
||||
|
||||
return results;
|
||||
}
|
||||
|
||||
/**
|
||||
* Tag 9F33 – Terminal Capabilities
|
||||
*/
|
||||
export function parse9F33_TerminalCapabilities(hex: string): string[] {
|
||||
const bytes = hexToBytes(hex);
|
||||
if (bytes.length !== 3) { throw new Error('9F33 must be 3 bytes'); }
|
||||
const results: string[] = [];
|
||||
|
||||
if (hasBit(bytes[0], 7)) { results.push('Cash transaction supported'); }
|
||||
if (hasBit(bytes[0], 6)) { results.push('Goods purchase supported'); }
|
||||
if (hasBit(bytes[0], 5)) { results.push('Services purchase supported'); }
|
||||
if (hasBit(bytes[0], 4)) { results.push('Cashback supported'); }
|
||||
|
||||
if (hasBit(bytes[1], 7)) { results.push('Plaintext PIN for ICC supported'); }
|
||||
if (hasBit(bytes[1], 6)) { results.push('Enciphered PIN (online) supported'); }
|
||||
if (hasBit(bytes[1], 5)) { results.push('Signature supported'); }
|
||||
if (hasBit(bytes[1], 4)) { results.push('No CVM supported'); }
|
||||
|
||||
if (hasBit(bytes[2], 7)) { results.push('Terminal risk management supported'); }
|
||||
if (hasBit(bytes[2], 6)) { results.push('Issuer authentication supported'); }
|
||||
if (hasBit(bytes[2], 5)) { results.push('CDA supported'); }
|
||||
|
||||
return results;
|
||||
}
|
||||
|
||||
/**
|
||||
* Tag 9F34 – CVM Results
|
||||
*/
|
||||
export function parse9F34_CVMResults(hex: string): string[] {
|
||||
const bytes = hexToBytes(hex);
|
||||
if (bytes.length !== 3) { throw new Error('9F34 must be 3 bytes'); }
|
||||
const results: string[] = [];
|
||||
|
||||
results.push(`CVM Method Code: ${bytes[0]}`);
|
||||
results.push(`Condition Code: ${bytes[1]}`);
|
||||
|
||||
if (hasBit(bytes[2], 7)) { results.push('CVM performed'); }
|
||||
if (hasBit(bytes[2], 6)) { results.push('CVM failed'); }
|
||||
if (hasBit(bytes[2], 5)) { results.push('Bypass attested'); }
|
||||
|
||||
return results;
|
||||
}
|
||||
|
||||
/**
|
||||
* Tag 9F40 – Additional Terminal Capabilities
|
||||
*/
|
||||
export function parse9F40_AdditionalTerminalCapabilities(hex: string): string[] {
|
||||
const bytes = hexToBytes(hex);
|
||||
if (bytes.length < 4) { throw new Error('9F40 must be at least 4 bytes'); }
|
||||
const results: string[] = [];
|
||||
|
||||
if (hasBit(bytes[0], 7)) { results.push('Cash supported'); }
|
||||
if (hasBit(bytes[0], 6)) { results.push('Cashback supported'); }
|
||||
if (hasBit(bytes[0], 5)) { results.push('Purchase with cashback supported'); }
|
||||
if (hasBit(bytes[0], 4)) { results.push('Refund supported'); }
|
||||
|
||||
if (hasBit(bytes[1], 7)) { results.push('Offline plaintext PIN supported'); }
|
||||
if (hasBit(bytes[1], 6)) { results.push('Offline enciphered PIN supported'); }
|
||||
if (hasBit(bytes[1], 5)) { results.push('Online PIN supported'); }
|
||||
if (hasBit(bytes[1], 4)) { results.push('Signature supported'); }
|
||||
|
||||
if (hasBit(bytes[2], 7)) { results.push('SDA supported'); }
|
||||
if (hasBit(bytes[2], 6)) { results.push('DDA supported'); }
|
||||
if (hasBit(bytes[2], 5)) { results.push('CDA supported'); }
|
||||
if (hasBit(bytes[2], 4)) { results.push('Combined data authentication supported'); }
|
||||
|
||||
return results;
|
||||
}
|
||||
|
||||
/**
|
||||
* Tag 9F66 – TTQ (Terminal Transaction Qualifiers)
|
||||
*/
|
||||
export function parse9F66_TTQ(hex: string): string[] {
|
||||
const bytes = hexToBytes(hex);
|
||||
if (bytes.length < 4) { throw new Error('9F66 must be at least 4 bytes'); }
|
||||
const results: string[] = [];
|
||||
|
||||
if (hasBit(bytes[0], 7)) { results.push('Contactless EMV mode supported'); }
|
||||
if (hasBit(bytes[0], 6)) { results.push('Contactless MSD mode supported'); }
|
||||
if (hasBit(bytes[0], 5)) { results.push('Contact EMV supported'); }
|
||||
if (hasBit(bytes[0], 4)) { results.push('Offline data authentication supported'); }
|
||||
|
||||
if (hasBit(bytes[1], 7)) { results.push('No signature (QPS) supported'); }
|
||||
if (hasBit(bytes[1], 6)) { results.push('CVM required'); }
|
||||
if (hasBit(bytes[1], 5)) { results.push('Online PIN supported'); }
|
||||
if (hasBit(bytes[1], 4)) { results.push('Signature supported'); }
|
||||
|
||||
if (hasBit(bytes[2], 7)) { results.push('Online cryptogram required'); }
|
||||
if (hasBit(bytes[2], 6)) { results.push('Issuer update processing supported'); }
|
||||
|
||||
return results;
|
||||
}
|
||||
|
||||
/**
|
||||
* Tag 9F6C – CTQ (Card Transaction Qualifiers)
|
||||
*/
|
||||
export function parse9F6C_CTQ(hex: string): string[] {
|
||||
const bytes = hexToBytes(hex);
|
||||
if (bytes.length < 2) { throw new Error('9F6C must be at least 2 bytes'); }
|
||||
const results: string[] = [];
|
||||
|
||||
if (hasBit(bytes[0], 7)) { results.push('CVM required'); }
|
||||
if (hasBit(bytes[0], 6)) { results.push('Online PIN supported'); }
|
||||
if (hasBit(bytes[0], 5)) { results.push('Signature supported'); }
|
||||
if (hasBit(bytes[0], 4)) { results.push('No CVM supported'); }
|
||||
|
||||
if (hasBit(bytes[1], 7)) { results.push('Offline approval possible'); }
|
||||
if (hasBit(bytes[1], 6)) { results.push('Online processing possible'); }
|
||||
if (hasBit(bytes[1], 5)) { results.push('CVM performed by card'); }
|
||||
|
||||
return results;
|
||||
}
|
||||
|
||||
/**
|
||||
* Tag 9F6E – FFI (Form Factor Indicator)
|
||||
*/
|
||||
export function parse9F6E_FFI(hex: string): string[] {
|
||||
const bytes = hexToBytes(hex);
|
||||
if (bytes.length < 1) { throw new Error('9F6E must be at least 1 byte'); }
|
||||
const results: string[] = [];
|
||||
|
||||
const code = bytes[0];
|
||||
let description = 'Reserved/Other';
|
||||
if (code === 0x01) { description = 'Plastic card'; }
|
||||
else if (code === 0x02) { description = 'Mobile device'; }
|
||||
else if (code === 0x03) { description = 'Wearable'; }
|
||||
else if (code === 0x04) { description = 'Tokenized device'; }
|
||||
|
||||
results.push(`Form Factor Code: ${code} (${description})`);
|
||||
|
||||
if (bytes.length > 1) {
|
||||
results.push(`Extra bytes: ${bytes.slice(1).map(b => b.toString(16).padStart(2, '0')).join('')}`);
|
||||
}
|
||||
|
||||
return results;
|
||||
}
|
||||
|
||||
export function parseEmvData(tlvData: string, kernel: string) {
|
||||
let parsed: EmvTag[] = [];
|
||||
emv.describeKernel(tlvData, kernel, data => parsed = data);
|
||||
if (!parsed) {
|
||||
throw new Error('Invalid EMV TLV data');
|
||||
}
|
||||
|
||||
const describeItem = (item: EmvTag): EmvTag => {
|
||||
if (Array.isArray(item.value)) {
|
||||
return {
|
||||
tag: item.tag,
|
||||
length: item.length,
|
||||
description: item.description,
|
||||
value: item.value.map(sub_item => describeItem(sub_item)),
|
||||
};
|
||||
}
|
||||
|
||||
let bitDetails: string[] = [];
|
||||
|
||||
const getActiveBitsDescriptions = (bits: EmvBitDescription[][]) => bits.flat().filter(b => b.description !== 'RFU').map(b => `${b.description}: ${(b.value === '1' ? 'yes' : 'no')}`);
|
||||
|
||||
switch (item.tag) {
|
||||
case '95': // TVR
|
||||
emv.tvr(item.value, data => bitDetails = getActiveBitsDescriptions(data));
|
||||
break;
|
||||
case '9B': // TSI
|
||||
emv.tsi(item.value, data => bitDetails = getActiveBitsDescriptions(data));
|
||||
break;
|
||||
case '82': // AIP
|
||||
emv.aip(item.value, data => bitDetails = getActiveBitsDescriptions(data));
|
||||
break;
|
||||
case '8E': // CVM List
|
||||
emv.cvm(item.value, data => bitDetails = data);
|
||||
break;
|
||||
case '9F07': // AUC
|
||||
emv.auc(item.value, data => bitDetails = getActiveBitsDescriptions(data));
|
||||
break;
|
||||
case '9F10': // IAD
|
||||
bitDetails = parse9F10_IAD(item.value);
|
||||
break;
|
||||
case '9F33': // Terminal Capabilities
|
||||
bitDetails = parse9F33_TerminalCapabilities(item.value);
|
||||
break;
|
||||
case '9F34': // CVM Results
|
||||
bitDetails = parse9F34_CVMResults(item.value);
|
||||
break;
|
||||
case '9F40': // Additional Terminal Capabilities
|
||||
bitDetails = parse9F40_AdditionalTerminalCapabilities(item.value);
|
||||
break;
|
||||
case '9F66': // TTQ
|
||||
bitDetails = parse9F66_TTQ(item.value);
|
||||
break;
|
||||
case '9F6C': // CTQ
|
||||
bitDetails = parse9F6C_CTQ(item.value);
|
||||
break;
|
||||
case '9F6E': // FFI
|
||||
bitDetails = parse9F6E_FFI(item.value);
|
||||
break;
|
||||
}
|
||||
|
||||
return {
|
||||
tag: item.tag,
|
||||
length: item.length,
|
||||
description: item.description,
|
||||
value: item.value,
|
||||
bitDetails,
|
||||
};
|
||||
};
|
||||
return parsed.map(describeItem);
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
<script setup lang="ts">
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { parseEmvData } from './emv-tlv-decoder.service';
|
||||
import TLVTagTree from './TLVTagTree.vue';
|
||||
|
||||
const { t } = useI18n();
|
||||
|
||||
const tlvInput = ref('4F07A00000000430605F2A02097882025C008407A0000000043060950500800080009A031508069C01009F02060000000001019F080200009F090200009F10120114000100000000000000E0DB2E438900FF');
|
||||
const parsedTags = ref<any[]>([]);
|
||||
const error = ref('');
|
||||
const kernel = ref('Generic');
|
||||
|
||||
function parseTlv() {
|
||||
try {
|
||||
const hex = tlvInput.value.replace(/\s+/g, '').toUpperCase();
|
||||
parsedTags.value = parseEmvData(hex, kernel.value);
|
||||
}
|
||||
catch (err: any) {
|
||||
error.value = err.toString();
|
||||
parsedTags.value = [];
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<NFormItem :label="t('tools.emv-tlv-decoder.texts.label-tlv-hex-input')" mb-2>
|
||||
<NInput
|
||||
v-model:value="tlvInput"
|
||||
type="textarea"
|
||||
:placeholder="t('tools.emv-tlv-decoder.texts.placeholder-paste-emv-tlv-hex-string-e-g-6f1a8407a0000000031010a50f500b5649534120435245444954')"
|
||||
rows="4"
|
||||
/>
|
||||
</NFormItem>
|
||||
<c-select
|
||||
v-model:value="kernel"
|
||||
:options="['Generic', 'Visa', 'Mastercard', 'JCB', 'AMEX']"
|
||||
:label="t('tools.emv-tlv-decoder.texts.label-kernel-type')"
|
||||
label-position="left"
|
||||
mb-2
|
||||
/>
|
||||
<div mb-2 flex justify-center>
|
||||
<NButton type="primary" @click="parseTlv">
|
||||
{{ t('tools.emv-tlv-decoder.texts.tag-parse-tlv') }}
|
||||
</NButton>
|
||||
</div>
|
||||
|
||||
<c-alert v-if="error">
|
||||
{{ error }}
|
||||
</c-alert>
|
||||
|
||||
<c-card v-if="parsedTags" :title="t('tools.emv-tlv-decoder.texts.title-decoded-emv-tags')">
|
||||
<TLVTagTree :tags="parsedTags" />
|
||||
</c-card>
|
||||
</div>
|
||||
</template>
|
||||
@@ -0,0 +1,14 @@
|
||||
import { CreditCard } from '@vicons/tabler';
|
||||
import { defineTool } from '../tool';
|
||||
import { translate as t } from '@/plugins/i18n.plugin';
|
||||
|
||||
export const tool = defineTool({
|
||||
name: t('tools.emv-tlv-decoder.title'),
|
||||
path: '/emv-tlv-decoder',
|
||||
description: t('tools.emv-tlv-decoder.description'),
|
||||
keywords: ['emv', 'tag', 'payment', 'card', 'tlv', 'decoder'],
|
||||
component: () => import('./emv-tlv-decoder.vue'),
|
||||
icon: CreditCard,
|
||||
createdAt: new Date('2025-11-01'),
|
||||
category: 'Forensic',
|
||||
});
|
||||
Loaded 100 of 221 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user