Compare commits

...
28 Commits
Author SHA1 Message Date
Chris Tran 66cd2fe815 refactor: localize crop-image component
Add vue-i18n integration to crop-image.vue and replace hardcoded UI text with t() translation calls. Import useI18n and use t() for button labels, form labels, hints (with interpolation for zoom), and action text. Convert aspect ratio and export width option arrays into computed properties so they can use translated labels. These changes prepare the component for localization without changing functionality.
2026-06-06 15:14:05 -07:00
Chris Tran d9ad48daa5 feat: add crop-image 'texts' translations to locales
Add 'texts' translation entries for the crop-image tool across multiple locales (ar, da, de, el, en, es, fr, ga, it, ko, nl, no, pl, pt, ru, tr, uk, vi, zh). Adds UI strings such as drag/drop hints, flip/reset/fit controls, aspect ratio and custom ratio labels, background color, zoom/rotate, rule-of-thirds grid, export settings (format, quality, width), ratio presets and width options. Also fixes a small typo in the Turkish description (và → ve).
2026-06-06 15:12:54 -07:00
Chris Tran 6a95f93df2 feat: add 'crop-image' translations to locales
Add localization entries for a new 'crop-image' tool across multiple locale YAML files (ar, da, de, el, en, es, fr, ga, it, ko, nl, no, pl, pt, ru, tr, uk, vi, zh). Each file adds title and description strings for cropping, resizing, and rotating images with custom background colors.
2026-06-06 15:08:35 -07:00
Chris Tran 7e152bc831 fix(crop-image): fix crop coordinate misalignment on small viewports
Resolves an issue where exporting cropped images on small/mobile screens resulted in a different crop than shown in the preview.

- Added reactive viewport scaling tracking using `@vueuse/core` `useElementSize`.
- Wrapped the cropper viewport in a container that scales down via CSS `transform: scale()` to maintain aspect ratios and layout without shrinking coordinates.
- Scaled pointer dragging deltas (`dx`, `dy`) by the scale factor to preserve movement tracking accuracy.
- Cleaned up related ESLint warnings/errors and unused imports in the `crop-image` files."
2026-06-06 15:06:08 -07:00
Chris Tran b688eb27d0 Add crop-image sizing utilities and tests
Introduce getViewportDimensions and getBaseDimensions utility functions (src/tools/crop-image/crop-image.service.ts) to centralize viewport/base sizing logic and handle missing natural dimensions. Refactor crop-image.vue to consume these utilities for computed viewport and base dimensions. Add unit tests covering landscape/portrait calculations and cover scaling (src/tools/crop-image/crop-image.service.test.ts) and expand the e2e spec to upload a 1x1 PNG and assert presence of the cropper, sliders and control buttons (src/tools/crop-image/crop-image.e2e.spec.ts). Improves testability and keeps sizing logic consistent across the component.
2026-06-06 14:24:25 -07:00
Chris Tran a455ee0a8f Add crop-image tool
Introduce a new Crop Image tool: adds an interactive Vue cropper component (src/tools/crop-image/crop-image.vue) with drag/drop upload, viewport cropping, zoom, rotation, horizontal/vertical flip, aspect-ratio presets/custom ratio, rule-of-thirds grid, background color, and export options (PNG/JPEG/WebP, quality and width modes). Also adds tool registration (src/tools/crop-image/index.ts), a placeholder service (crop-image.service.ts), a Vitest unit test (crop-image.service.test.ts) and a Playwright e2e spec stub (crop-image.e2e.spec.ts).
2026-06-06 14:21:41 -07:00
ShareVB 102bb9926e fix(Data Storage Units Converter): fix b/iB/B conversion
Fix #398
2026-05-28 09:33:36 +02:00
ShareVB dfb92f2441 fix(Speed Converter): wrong m/h is in fact mi/h (miles)
Fix #399
2026-05-28 09:10:11 +02:00
ShareVB fb8a1eb5b1 fix(Amortization Calculator): exclude historical currencies
Fix #396
2026-05-24 23:02:41 +02:00
Shaquille_Oatmeal c5a93af9cc docs: enhance Docker cheat sheet (#397)
- Fix --no-cache flag and dockerd command
- Remove escaped underscores from placeholders
- Add Volumes, Networks, Compose, and Cleanup sections
- Add common flags reference table
2026-05-22 17:08:39 +02:00
ShareVB 3b7ddb4b8f fix: optimize Home loading
Fix part of #330
2026-05-17 16:17:04 +02:00
ShareVB d5f4dcb91c fixup! fix: node-forge patch for EcDSA 2026-05-16 16:14:22 +02:00
ShareVB 1a664fe096 feat(new tool): HTTPS Tester
Add HTTPS test tools (certificate, HSTS, 302 rewrite)

Fix #345
2026-05-16 15:53:44 +02:00
ShareVB 5fd2bb66f3 feat(new tool): Powershell Memo
Fix #1793
2026-05-16 15:47:55 +02:00
ShareVB 4100059b3a feat(new tool): DNS Propagation Tester
Fix #346
2026-05-16 15:47:55 +02:00
ShareVB d8787317a4 feat(new tool): DNS Tester
DNS Queries, Reverse DNS Queries, DNSSec test, AXFR test and Whois queries
2026-05-16 15:47:55 +02:00
ShareVB 23ede48549 feat(x509 Certificate Generator): add options for RSA bits 2026-05-11 13:59:16 +02:00
ShareVB 6cc1ad7e98 fix: node-forge patch for EcDSA
Fix #1792
2026-05-11 13:47:00 +02:00
ShareVB 7e9cf35c28 fix(Geo Coordinates Converter): fix marker display
Fix #392
2026-05-11 12:42:28 +02:00
Brian Baidalandsharevb 89975dc505 feat(new tool): Random Line Picker (#393)
Adds a new Random Line Picker tool to pick one or more random lines from user-provided text. It's a handy utility for quickly selecting random items (winners, samples, shuffled lists) inside the app.

Co-authored-by: sharevb <sharevb@gmail.com>
2026-05-11 00:28:20 +02:00
ShareVB f0e35b09ee feat(Geo Coordinates Converter): add DMS/Decimal/UTM and a interactive map
Fix #392
2026-05-11 00:11:03 +02:00
ShareVB 905de13a84 fix: remove HTTP Headers security as this broke many tools 2026-05-10 23:38:06 +02:00
ShareVB efd0b2513a i18n: translate remaining 2026-05-03 22:19:13 +02:00
ShareVB 4103bd7e6e i18n: extract more strings 2026-05-03 21:59:05 +02:00
ShareVB 92bf2b5bd7 fix(Pdf Signature Checker): not supported certificate 2026-05-03 21:48:30 +02:00
ShareVB 04c2575ab6 feat(UUID Generator): Case and hyphen options
Fix #373
2026-05-03 20:54:00 +02:00
hakimilgandShareVB b05e70d6d8 feat(new tool): JSON to .env converter (#349)
Converts a flat JSON object into a .env file. Keys are upper-cased,
values are safely quoted when they contain whitespace, quotes, or env
special characters (#, $, `, \). Nested objects and arrays are
JSON-stringified and always quoted; null/undefined become "".

Follows the existing FormatTransformer pattern used by the other
json-to-* converters, including i18n via useI18n and the built-in
.env download button.

Co-authored-by: ShareVB <sharevb@gmail.com>
2026-05-03 19:21:46 +02:00
ShareVB f7f82a57d6 chore: update dependencies 2026-05-03 19:20:25 +02:00
70 changed files with 47967 additions and 27283 deletions

No files matched your search

+1
View File
@@ -9,6 +9,7 @@ RUN apk add --update python3 make g++\
WORKDIR /app WORKDIR /app
COPY package.json pnpm-lock.yaml ./ COPY package.json pnpm-lock.yaml ./
COPY patches patches
RUN npm install -g pnpm && pnpm i --ignore-scripts --frozen-lockfile RUN npm install -g pnpm && pnpm i --ignore-scripts --frozen-lockfile
COPY . . COPY . .
ARG BASE_URL ARG BASE_URL
+2302 -1443
View File
File diff suppressed because it is too large. Load diff
+2395 -1500
View File
File diff suppressed because it is too large. Load diff
+2695 -1699
View File
File diff suppressed because it is too large. Load diff
+2742 -1751
View File
File diff suppressed because it is too large. Load diff
+1900 -1623
View File
File diff suppressed because it is too large. Load diff
+2654 -1679
View File
File diff suppressed because it is too large. Load diff
+774 -5
View File
@@ -5,6 +5,9 @@
Peut-être que le cache fait des siennes, essayez de forcer le Peut-être que le cache fait des siennes, essayez de forcer le
rafraîchissement ? rafraîchissement ?
backHome: Retour à l'accueil backHome: Retour à l'accueil
page:
text:
page-not-found-it-tools: Page introuvable - Outils informatiques
home: home:
categories: categories:
newestTools: Les nouveaux outils newestTools: Les nouveaux outils
@@ -35,6 +38,14 @@ home:
mode: Basculer le mode sombre/clair mode: Basculer le mode sombre/clair
loading-more-tools: Chargement de plus d'outils… loading-more-tools: Chargement de plus d'outils…
support: Soutenez le développement des outils iT-Tools support: Soutenez le développement des outils iT-Tools
page:
text:
collection-of-handy-online-tools-for-developers-with-great-ux-it-tools-is-a-free-and-open-source-collection-of-handy-online-tools-for-developers-and-people-working-in-it: >-
IT Tools est une collection d'outils en ligne pratiques pour
développeurs, offrant une excellente expérience utilisateur. Cette
collection gratuite et open source propose des outils en ligne pratiques
destinés aux développeurs et aux professionnels de l'informatique.
it-tools-handy-online-tools-for-developers: Outils informatiques - Outils en ligne pratiques pour les développeurs
about: about:
alltools-title: Tous les outils {outils} alltools-title: Tous les outils {outils}
tools: tools:
@@ -48,12 +59,53 @@ about:
favorites-imported-successfully: "Favoris importés avec succès\_!" favorites-imported-successfully: "Favoris importés avec succès\_!"
error-importing-favorites-e: "Erreur lors de l&#39;importation des favoris\_: {0}" error-importing-favorites-e: "Erreur lors de l&#39;importation des favoris\_: {0}"
content-fork: "# À propos d'IT-Tools\nCe superbe site web, initialement créé avec ❤ par [Corentin Thomasset](https://corentin.tech?utm_source=it-tools&utm_medium=about) et enrichi par ShareVB, regroupe des outils utiles aux développeurs et aux professionnels de l'informatique. Si vous le trouvez utile, n'hésitez pas à le partager et n'oubliez pas de l'ajouter à vos favoris\_!\nIT Tools est open source (sous licence GPL-3.0) et gratuit, et le restera toujours. Si vous souhaitez soutenir mon travail sur ce fork et m'encourager à ajouter de nouveaux outils ou fonctionnalités, n'hésitez pas à me [sponsoriser](https://www.buymeacoffee.com/sharevb).\n## Technologies\nIT Tools est développé en Vue.js (Vue 3) avec la bibliothèque de composants Naive UI et est hébergé et déployé en continu par Vercel. Des bibliothèques open source tierces sont utilisées dans certains outils. Vous trouverez la liste complète dans le fichier [package.json](https://github.com/sharevb/it-tools/blob/main/package.json) du dépôt.\n## Vous avez trouvé un bug\_? Un outil est manquant\_?\nSi vous avez besoin d'un outil actuellement absent et que vous pensez utile, n'hésitez pas à soumettre une demande de fonctionnalité dans la section [problèmes](https://github.com/sharevb/it-tools/issues/new/choose) du dépôt GitHub.\nSi vous avez trouvé un bug ou si quelque chose ne fonctionne pas comme prévu, veuillez signaler un bug dans la section [problèmes](https://github.com/sharevb/it-tools/issues/new/choose) du dépôt GitHub.\n" content-fork: "# À propos d'IT-Tools\nCe superbe site web, initialement créé avec ❤ par [Corentin Thomasset](https://corentin.tech?utm_source=it-tools&utm_medium=about) et enrichi par ShareVB, regroupe des outils utiles aux développeurs et aux professionnels de l'informatique. Si vous le trouvez utile, n'hésitez pas à le partager et n'oubliez pas de l'ajouter à vos favoris\_!\nIT Tools est open source (sous licence GPL-3.0) et gratuit, et le restera toujours. Si vous souhaitez soutenir mon travail sur ce fork et m'encourager à ajouter de nouveaux outils ou fonctionnalités, n'hésitez pas à me [sponsoriser](https://www.buymeacoffee.com/sharevb).\n## Technologies\nIT Tools est développé en Vue.js (Vue 3) avec la bibliothèque de composants Naive UI et est hébergé et déployé en continu par Vercel. Des bibliothèques open source tierces sont utilisées dans certains outils. Vous trouverez la liste complète dans le fichier [package.json](https://github.com/sharevb/it-tools/blob/main/package.json) du dépôt.\n## Vous avez trouvé un bug\_? Un outil est manquant\_?\nSi vous avez besoin d'un outil actuellement absent et que vous pensez utile, n'hésitez pas à soumettre une demande de fonctionnalité dans la section [problèmes](https://github.com/sharevb/it-tools/issues/new/choose) du dépôt GitHub.\nSi vous avez trouvé un bug ou si quelque chose ne fonctionne pas comme prévu, veuillez signaler un bug dans la section [problèmes](https://github.com/sharevb/it-tools/issues/new/choose) du dépôt GitHub.\n"
text:
collection-of-handy-online-tools-for-developers-with-great-ux-it-tools-is-a-free-and-open-source-collection-of-handy-online-tools-for-developers-and-people-working-in-it: >-
IT Tools est une collection d'outils en ligne pratiques pour développeurs,
offrant une excellente expérience utilisateur. Cette collection gratuite
et open source propose des outils en ligne pratiques destinés aux
développeurs et aux professionnels de l'informatique.
about-it-tools: À propos - Outils informatiques
toolCard: toolCard:
new: Nouveau new: Nouveau
search: search:
label: Rechercher label: Rechercher
placeholder: Tapez pour rechercher un outil ou une commande… placeholder: Tapez pour rechercher un outil ou une commande…
tools: tools:
crop-image:
title: "Rogner l'image"
description: "Rogner, redimensionner et faire pivoter des images avec des couleurs de fond personnalisées."
texts:
drag-drop: "Glissez-déposez votre image ici, ou cliquez pour parcourir"
drag-hint: "Faites glisser pour positionner • Défilez pour zoomer ({zoom}%)"
flip-h: "Retourner H"
flip-v: "Retourner V"
reset: "Réinitialiser"
fit: "Ajuster"
change-image: "Changer d'image"
aspect-ratio: "Rapport d'aspect:"
custom-ratio: "Rapport personnalisé:"
background-color: "Couleur d'arrière-plan:"
transparent: "Transparent"
zoom-image: "Zoomer l'image:"
rotate-image: "Faire pivoter l'image:"
rule-of-thirds-grid: "Grille des trois tiers:"
export-settings: "Paramètres d'exportation"
export-format: "Format d'exportation:"
image-quality: "Qualité de l'image:"
export-width: "Largeur d'exportation:"
custom-width: "Largeur personnalisée (px):"
export-download-image: "Exporter & télécharger l'image rognée"
ratio-square: "1:1 (Carré)"
ratio-widescreen: "16:9 (Écran large)"
ratio-portrait: "9:16 (Portrait)"
ratio-standard: "4:3 (Standard)"
ratio-photo: "3:2 (Photo)"
ratio-original: "Rapport d'aspect d'origine"
ratio-custom: "Rapport personnalisé"
width-original: "Taille de rognage d'origine"
width-viewport: "Taille de la fenêtre"
width-custom: "Largeur personnalisée"
categories: categories:
favorite-tools: Vos outils favoris favorite-tools: Vos outils favoris
crypto: Cryptographie crypto: Cryptographie
@@ -82,6 +134,9 @@ tools:
physics: Physique physics: Physique
xml: Xml xml: Xml
yaml: Yaml yaml: Yaml
finance: Finance
default: Défaut
toml: TOML
token-generator: token-generator:
title: Générateur de token title: Générateur de token
description: >- description: >-
@@ -354,6 +409,7 @@ tools:
Faites glisser et déposez un fichier ici, ou cliquez pour sélectionner Faites glisser et déposez un fichier ici, ou cliquez pour sélectionner
un fichier un fichier
title-file-to-base64: Fichier à la base64 title-file-to-base64: Fichier à la base64
include-data-uri-prefix: "Inclure les données\_: préfixe URI"
title: Convertisseur de fichiers Base64 title: Convertisseur de fichiers Base64
base64-hex-converter: base64-hex-converter:
description: >- description: >-
@@ -976,6 +1032,8 @@ tools:
placeholder-contact-email: Courriel de contact placeholder-contact-email: Courriel de contact
placeholder-country: Pays placeholder-country: Pays
placeholder-dns-names-emails-ip-uri: Noms DNS, e-mails, IP, URI… placeholder-dns-names-emails-ip-uri: Noms DNS, e-mails, IP, URI…
label-rsa-bits: "Bits RSA\_:"
bits-should-be-256-less-than-bits-less-than-16384-and-be-a-multiple-of-8: "Le nombre de bits doit être compris entre 256 et 16\_384, et être un multiple de 8."
title: Générateur de RSE title: Générateur de RSE
css-prettifier: css-prettifier:
description: CSS Prettify description: CSS Prettify
@@ -1351,6 +1409,9 @@ tools:
tag-regenerate: Régénérer tag-regenerate: Régénérer
text-django-secret-key-copied-to-clipboard: Django Secret Key copié dans le presse-papiers text-django-secret-key-copied-to-clipboard: Django Secret Key copié dans le presse-papiers
title: Générateur de secrets Django title: Générateur de secrets Django
service:
texts:
generating-range-is-too-large: La portée du générateur est trop grande.
dkim-dns-generator: dkim-dns-generator:
description: Générer un enregistrement DKIM DNS TXT description: Générer un enregistrement DKIM DNS TXT
texts: texts:
@@ -1848,6 +1909,7 @@ tools:
title-favicon-pack-generator: Générateur de pack Favicon title-favicon-pack-generator: Générateur de pack Favicon
title-html-head-tags: 📄 Tags de tête HTML title-html-head-tags: 📄 Tags de tête HTML
title-️-previews: 🖼️ Aperçu title-️-previews: 🖼️ Aperçu
invalid-png-file: "Fichier PNG invalide\_!"
title: Générateur de favori title: Générateur de favori
file-hasher: file-hasher:
description: Calculer le hachage des fichiers description: Calculer le hachage des fichiers
@@ -1895,6 +1957,7 @@ tools:
un fichier un fichier
title-information: Information title-information: Information
label-file-name: "Nom de fichier\_:" label-file-name: "Nom de fichier\_:"
an-error-occured-processing: Une erreur s'est produite lors du traitement.
title: Détecteur de type de fichier title: Détecteur de type de fichier
firewalld-generator: firewalld-generator:
texts: texts:
@@ -1917,7 +1980,8 @@ tools:
label-no: Non label-no: Non
placeholder-enter-the-service-port-protocol: Entrez le service / port / protocole placeholder-enter-the-service-port-protocol: Entrez le service / port / protocole
title-generated-fw-command: "Commande FW générée\_:" title-generated-fw-command: "Commande FW générée\_:"
title: '' title: générateur de ligne de commande firewalld
description: Générer des lignes de commande firewalld
floating-point-converter: floating-point-converter:
description: >- description: >-
Convertissez un numéro décimal en un numéro de point flottant binaire IEEE Convertissez un numéro décimal en un numéro de point flottant binaire IEEE
@@ -2050,6 +2114,12 @@ tools:
tag-upload-font-file: Télécharger le fichier de police tag-upload-font-file: Télécharger le fichier de police
label-comic-sans-ms: Bande dessinée sans ms label-comic-sans-ms: Bande dessinée sans ms
title: Comparer la police title: Comparer la police
text:
by-font-name: Par nom de police
by-font-url: Par URL de police
by-font-file: Par fichier de police
by-inline-css: Par CSS en ligne
by-css-url: Par URL CSS
force-converter: force-converter:
description: Convertir les valeurs entre les unités de force description: Convertir les valeurs entre les unités de force
title: Convertisseur de forces title: Convertisseur de forces
@@ -2235,6 +2305,8 @@ tools:
1gib = 1024mib; 1gib = 1024mib;
1 Go = 1000 Mo; 1 Go = 1000 Mo;
tag-see-here-for-details: Voir ici pour plus de détails tag-see-here-for-details: Voir ici pour plus de détails
column-decimal: Décimal
column-binary: Binaire
title: Calculatrice de disque dur title: Calculatrice de disque dur
heic-converter: heic-converter:
description: Convertisseur Heic en jpeg ou png description: Convertisseur Heic en jpeg ou png
@@ -2245,6 +2317,7 @@ tools:
sélectionner un fichier sélectionner un fichier
label-output-format: Format de sortie label-output-format: Format de sortie
label-png: PNG label-png: PNG
an-error-occured-processing-heic-heif-is-invalid: "Une erreur s'est produite lors du traitement\_: le format HEIC/HEIF est invalide."
title: Convertisseur Heic title: Convertisseur Heic
hex-converter: hex-converter:
service: service:
@@ -2826,6 +2899,9 @@ tools:
title-drag-and-drop-an-ico-or-png-jpeg-file-here-or-click-to-select-a-file: >- title-drag-and-drop-an-ico-or-png-jpeg-file-here-or-click-to-select-a-file: >-
Faites glisser et déposez un fichier ICO ou PNG / JPEG ici, ou cliquez Faites glisser et déposez un fichier ICO ou PNG / JPEG ici, ou cliquez
pour sélectionner un fichier pour sélectionner un fichier
an-error-occured-processing: Une erreur s'est produite lors du traitement.
invalid-ico-file: Fichier ICO invalide !
invalid-png-file: "Fichier PNG invalide\_!"
title: Convertisseur ICO / PNG title: Convertisseur ICO / PNG
ies-lighting-guidelines: ies-lighting-guidelines:
description: >- description: >-
@@ -2866,6 +2942,9 @@ tools:
label-right-image-url: "URL de l'image droite\_:" label-right-image-url: "URL de l'image droite\_:"
title: Comparateur d'images title: Comparateur d'images
description: Un outil pour Visualy comparer les images description: Un outil pour Visualy comparer les images
text:
compare-by-url: Comparer par URL
compare-by-upload: Comparer par téléchargement
image-converter: image-converter:
description: Convertir les images d'un format à un autre description: Convertir les images d'un format à un autre
texts: texts:
@@ -2880,6 +2959,8 @@ tools:
title-drag-and-drop-images-files-here-or-click-to-select-some-files: >- title-drag-and-drop-images-files-here-or-click-to-select-some-files: >-
Faites glisser et déposez les fichiers d'images ici, ou cliquez pour Faites glisser et déposez les fichiers d'images ici, ou cliquez pour
sélectionner certains fichiers sélectionner certains fichiers
invalid-image-file: "Fichier image invalide\_!"
an-error-occured-processing: Une erreur s'est produite lors du traitement.
title: Convertisseur de formats d'image title: Convertisseur de formats d'image
image-exif-reader: image-exif-reader:
description: >- description: >-
@@ -3281,6 +3362,7 @@ tools:
placeholder-search-countries-by-name-iso2-iso3: Pays de recherche par nom, ISO2, ISO3… placeholder-search-countries-by-name-iso2-iso3: Pays de recherche par nom, ISO2, ISO3…
tag-iso2-iso3: ISO2 / ISO3 tag-iso2-iso3: ISO2 / ISO3
tag-gt-see-on-openstreetmap: '&gt; Voir sur OpenStreetMap' tag-gt-see-on-openstreetmap: '&gt; Voir sur OpenStreetMap'
loading-more-results: Chargement des résultats...
title: Chercheur de codes de pays ISO 3166 title: Chercheur de codes de pays ISO 3166
javascript-prettifier: javascript-prettifier:
description: JS / JavaScript Bettificateur description: JS / JavaScript Bettificateur
@@ -4437,6 +4519,19 @@ tools:
title-conversion-result: Résultat de la conversion title-conversion-result: Résultat de la conversion
title-endian-converter: Convertisseur endian title-endian-converter: Convertisseur endian
title: Convertisseur moyen-endien title: Convertisseur moyen-endien
service:
texts:
invalid-hex-input-only-0-9-and-a-f-allowed: >-
Saisie hexadécimale invalide. Seuls les chiffres 0 à 9 et les lettres
A à F sont autorisés.
invalid-1: Invalide
invalid-0: Invalide
invalid: Invalide
unsupported-middle-endian-format: Format middle-endian non pris en charge.
failed-to-parse-bytes: Échec de l'analyse des octets.
input-must-be-bytecount-2-hex-characters-for-bitlength-bit: >-
L'entrée doit être composée de {0} caractères hexadécimaux pour
{1}-bit.
mime-converter: mime-converter:
description: Convertir du format en codé de mime (sujet de courrier) description: Convertir du format en codé de mime (sujet de courrier)
texts: texts:
@@ -4911,6 +5006,11 @@ tools:
tag-copy: Copie tag-copy: Copie
tag-refresh: Rafraîchir tag-refresh: Rafraîchir
text-passphrase-s-copied-to-clipboard: "Phrass de passe copiés dans le presse-papiers\_!" text-passphrase-s-copied-to-clipboard: "Phrass de passe copiés dans le presse-papiers\_!"
cannot-generate-a-passphrase-of-minlen-value-maxlen-value-characters-please-retry: >-
Impossible de générer une phrase de passe de [{0} - {1}] caractères avec
les paramètres actuels. Veuillez essayer de modifier le nombre de mots.
words-words: Mots ({0})
label-min-passphrase-len: "Longueur minimale du mot de passe\_:"
title: Générateur de phrase passe title: Générateur de phrase passe
password-strength-analyser: password-strength-analyser:
description: >- description: >-
@@ -5679,6 +5779,11 @@ tools:
title-resistor-converter: Convertisseur de résistance title-resistor-converter: Convertisseur de résistance
title-standard-notation: Notation standard title-standard-notation: Notation standard
title: Calculateur de résistance title: Calculateur de résistance
text:
bands-notation: Groupes → Notation
notation-bands: Notation → Bandes
number-notation: Nombre → Notation
notation-number: Notation → Nombre
rmb-numbers: rmb-numbers:
description: Outil de conversion de capitalisation RMB / Renminbi description: Outil de conversion de capitalisation RMB / Renminbi
texts: texts:
@@ -5783,6 +5888,8 @@ tools:
label-pkcs-8: PKC label-pkcs-8: PKC
label-putty: Mastic label-putty: Mastic
title: Générateur de paires de clés RSA title: Générateur de paires de clés RSA
text:
bits-should-be-256-less-than-bits-less-than-16384-and-be-a-multiple-of-8: "Le nombre de bits doit être compris entre 256 et 16\_384, et être un multiple de 8."
rsync-generator: rsync-generator:
description: Générateur de commande RSYNC description: Générateur de commande RSYNC
texts: texts:
@@ -6904,6 +7011,8 @@ tools:
tag-quantity: Quantité tag-quantity: Quantité
tag-refresh: Rafraîchir tag-refresh: Rafraîchir
text-uuids-copied-to-the-clipboard: Uuids copié dans le presse-papiers text-uuids-copied-to-the-clipboard: Uuids copié dans le presse-papiers
uppercase: Majuscule
no-hyphen: Pas de trait d'union
title: Générateur UUIDS title: Générateur UUIDS
vat-validator: vat-validator:
description: Valider les numéros de TVA description: Valider les numéros de TVA
@@ -7406,6 +7515,10 @@ tools:
tag-original-image: Image originale tag-original-image: Image originale
tag-inverted-image: Image inversée tag-inverted-image: Image inversée
tag-clear-upload-new: Effacer et télécharger un nouveau tag-clear-upload-new: Effacer et télécharger un nouveau
service:
texts:
file-must-be-an-image: Le fichier doit être une image
failed-to-process-image-err: "Échec du traitement de l'image\_:"
credit-card-checker: credit-card-checker:
title: Vérificateur de carte de crédit title: Vérificateur de carte de crédit
description: Vérifier la validité d&#39;un numéro de carte de crédit description: Vérifier la validité d&#39;un numéro de carte de crédit
@@ -7470,6 +7583,9 @@ tools:
title-mw-to-dbm: mW en dBm title-mw-to-dbm: mW en dBm
label-mw-value: 'Valeur mW :' label-mw-value: 'Valeur mW :'
label-corresponding-dbm-value: "Valeur dBm correspondante\_:" label-corresponding-dbm-value: "Valeur dBm correspondante\_:"
service:
texts:
power-in-milliwatts-must-be-greater-than-0: La puissance en milliwatts doit être supérieure à 0
diceware-generator: diceware-generator:
title: Générateur de mots de passe Diceware title: Générateur de mots de passe Diceware
description: Générer un mot de passe aléatoire à l&#39;aide de la méthode Diceware description: Générer un mot de passe aléatoire à l&#39;aide de la méthode Diceware
@@ -7713,6 +7829,9 @@ tools:
placeholder-quot-to-quot-quot-0x-quot-quot-data-quot-quot-0x-quot-or-raw-0x: >- placeholder-quot-to-quot-quot-0x-quot-quot-data-quot-quot-0x-quot-or-raw-0x: >-
{'{'}&quot;to&quot;:&quot;0x...&quot;,&quot;data&quot;:&quot;0x...&quot;{'}'} {'{'}&quot;to&quot;:&quot;0x...&quot;,&quot;data&quot;:&quot;0x...&quot;{'}'}
ou 0x brut.... ou 0x brut....
service:
texts:
transaction-data-must-start-with-0x: Les données de transaction doivent commencer par 0x
file-splitter: file-splitter:
title: Séparateur de fichiers title: Séparateur de fichiers
description: >- description: >-
@@ -7732,6 +7851,9 @@ tools:
tag-process-chunks: Traiter les blocs tag-process-chunks: Traiter les blocs
tag-download-all: Télécharger tout tag-download-all: Télécharger tout
tag-download: Télécharger tag-download: Télécharger
service:
texts:
unsupported-format-or-invalid-content: Format non pris en charge ou contenu invalide
gitignore-generator: gitignore-generator:
title: Générateur GitIgnore title: Générateur GitIgnore
description: Générer un fichier .gitignore pour un ensemble de modèles communs description: Générer un fichier .gitignore pour un ensemble de modèles communs
@@ -7852,6 +7974,8 @@ tools:
fichier. fichier.
title-logs: bûches title-logs: bûches
label-ghostscript: Ghostscript label-ghostscript: Ghostscript
process-run-failed: L'exécution du processus a échoué
an-error-occured-processing: Une erreur s'est produite lors du traitement.
serial-console: serial-console:
title: Console du port série title: Console du port série
description: Se connecter, lire et envoyer des messages au port série description: Se connecter, lire et envoyer des messages au port série
@@ -8118,6 +8242,10 @@ tools:
tag-esc: ÉCHAP tag-esc: ÉCHAP
tag-exit-dead-pixel-mode: Quitter le mode pixel mort tag-exit-dead-pixel-mode: Quitter le mode pixel mort
tag-start-dead-pixel: Pixel mort de départ tag-start-dead-pixel: Pixel mort de départ
title: Testeur de pixels morts
description: >-
Outil permettant de vérifier si un pixel de votre écran est défectueux ou
non.
UnitsConverter: UnitsConverter:
texts: texts:
exclude-si-prefixes: Exclure les préfixes SI exclude-si-prefixes: Exclure les préfixes SI
@@ -8125,9 +8253,7 @@ tools:
si-converter: Accéder au convertisseur de préfixes SI si-converter: Accéder au convertisseur de préfixes SI
geo-coordinates-converter: geo-coordinates-converter:
title: Convertisseur de coordonnées géographiques title: Convertisseur de coordonnées géographiques
description: >- description: ''
Convertir des coordonnées géographiques entre WGS84, GCJ02, BD09 et
CGCS2000
texts: texts:
label-latitude: 'Latitude:' label-latitude: 'Latitude:'
label-longitude: 'Longitude:' label-longitude: 'Longitude:'
@@ -8147,6 +8273,13 @@ tools:
tag-convert-batch: Convertir par lots tag-convert-batch: Convertir par lots
tag-longitude-east-is-positive-west-is-negative: 'Longitude : L''est est positif, l''ouest est négatif.' tag-longitude-east-is-positive-west-is-negative: 'Longitude : L''est est positif, l''ouest est négatif.'
tag-latitude-north-is-positive-south-is-negative: 'Latitude : le nord est positif, le sud est négatif.' tag-latitude-north-is-positive-south-is-negative: 'Latitude : le nord est positif, le sud est négatif.'
text:
coordinate-system: Système de coordonnées
decimal-format-lng-lat: Format décimal (longitude, latitude)
dms-format-lng-lat: Format DMS (longitude, latitude)
download-results-csv: Télécharger les résultats au format CSV
batch-lat-lng-converter: Convertisseur de latitude/longitude par lots
single-lat-lng-converter: Convertisseur simple latitude/longitude
si-prefixes-converter: si-prefixes-converter:
title: Convertisseur de préfixes SI title: Convertisseur de préfixes SI
description: Convertir entre préfixes métriques description: Convertir entre préfixes métriques
@@ -8189,6 +8322,9 @@ tools:
layout: layout:
text: text:
made-with-npmpackages: Fabriqué avec {0} made-with-npmpackages: Fabriqué avec {0}
runs-entirely-in-your-browser-no-external-requests: >-
Fonctionne intégralement dans votre navigateur. Aucune requête
externe.
acceleration-converter: acceleration-converter:
title: Convertisseur d'accélération title: Convertisseur d'accélération
description: Convertir les valeurs entre unités d'accélération description: Convertir les valeurs entre unités d'accélération
@@ -8310,7 +8446,6 @@ tools:
tag-back: Retour (←) tag-back: Retour (←)
tag-next: Suivant (→) tag-next: Suivant (→)
tag-reset: Réinitialiser tag-reset: Réinitialiser
tag-: ↓
tag-or: '- OU -' tag-or: '- OU -'
tag-control-playback-and-navigation-without-touching-the-mouse: Contrôlez la lecture et la navigation sans toucher la souris. tag-control-playback-and-navigation-without-touching-the-mouse: Contrôlez la lecture et la navigation sans toucher la souris.
tag-shortcut: Raccourci tag-shortcut: Raccourci
@@ -8329,6 +8464,16 @@ tools:
tag-jump-to-start: Aller au début tag-jump-to-start: Aller au début
tag-end: Fin tag-end: Fin
tag-jump-to-end: Aller à la fin tag-jump-to-end: Aller à la fin
text:
please-provide-some-text-first: Veuillez d'abord fournir un texte.
unsupported-file-type: Type de fichier non pris en charge.
display: Afficher
text: Texte
settings: Paramètres
keyboard-shortcuts: Raccourcis clavier
ready: Prêt
words: mots
wpm: WPM
speed-converter: speed-converter:
title: Convertisseur de vitesse title: Convertisseur de vitesse
description: Convertir les valeurs entre unités de vitesse description: Convertir les valeurs entre unités de vitesse
@@ -8379,10 +8524,628 @@ tools:
tag-apply-configuration: Appliquer la configuration tag-apply-configuration: Appliquer la configuration
tag-clear-logs: Effacer les journaux tag-clear-logs: Effacer les journaux
tag-send: Envoyer tag-send: Envoyer
already-connected: ⚠️ Déjà connecté
connected-to-websocket-bridge: ✅ Connecté au pont WebSocket
disconnected: 🔌 Déconnecté
no-active-connection: ⚠️ Aucune connexion active
sent-text: '➡️ Texte envoyé :'
configured: ⚙️ Configuré
sent-hex: '➡️ Envoyé en hexadécimal :'
disconnecting: 🔻 Déconnexion...
error: '❌ Erreur :'
end: '🛑 Fin :'
text: '📩 Texte :'
binary: '📩 Binaire :'
text:
connected: Connecté
disconnected: Déconnecté
volume-flow-rate-converter: volume-flow-rate-converter:
title: Convertisseur de débit volumique title: Convertisseur de débit volumique
description: Convertir les valeurs entre unités de débit volumique description: Convertir les valeurs entre unités de débit volumique
externalAccess: nul externalAccess: nul
tip-calculator:
title: Calculateur de pourboire
description: Calculez le pourboire et répartissez-le entre plusieurs personnes.
texts:
title-bill-details: Détails de la facture
label-bill-amount: "Montant de la facture\_:"
placeholder-total-bill: Facture totale
label-tip-percentage: "Pourcentage du pourboire\_:"
placeholder-tip: Conseil %
label-number-of-person: 'Nombre de personnes :'
placeholder-people: Personnes
title-results: Résultats
label-tip-amount: "Montant du pourboire\_:"
label-total-bill: 'Facture totale :'
label-amount-per-person: 'Montant par personne :'
title-quick-tip: Astuce rapide %
tag-const-billamount-ref: const billAmount = ref
tag-: '%'
json-to-env:
title: JSON vers .env
description: >-
Convertit un objet JSON brut en un fichier .env. Les clés sont en
majuscules et les valeurs sont correctement encadrées par des guillemets
lorsqu'elles contiennent des espaces, des guillemets ou des caractères
spéciaux d'environnement.
texts:
message-provided-json-is-not-a-valid-flat-object: Le JSON fourni n'est pas un objet plat valide.
input-label-your-json: Votre JSON
input-placeholder-paste-your-json-here: Collez votre JSON ici...
output-label-env-from-your-json: .env de votre JSON
calendar-converter:
service:
text:
sunday: Dimanche
wednesday: Mercredi
tuesday: Mardi
monday: Lundi
thursday: Jeudi
friday: Vendredi
saturday: Samedi
invalid-year-length-hebrew_year_days-hebcal-0-days: "Durée de l'année invalide\_: {0} jours."
common-deficient-353-days: Carence commune (353 jours)
common-regular-354-days: Jours ordinaires (354 jours)
common-complete-355-days: Complet commun (355 jours)
embolismic-deficient-383-days: Déficit embolique (383 jours)
embolismic-regular-384-days: Embolismique régulier (384 jours)
embolismic-complete-385-days: Embolisémie complète (385 jours)
normal-year: Année normale
leap-year: Bissextile
title: Convertisseur de calendrier
description: >-
Convertir les dates et heures entre les formats grégorien, julien, hébreu,
islamique, persan, maya, indien, républicain français, ISO-8601, Unix et
les formats de série Excel.
externalAccess: nul
texts:
label-january: Janvier
label-february: Février
label-march: Mars
label-april: Avril
label-may: Peut
label-june: Juin
label-july: Juillet
label-august: Août
label-september: Septembre
label-october: Octobre
label-november: Novembre
label-december: Décembre
label-nisan-נִיסָן: Nissan
label-iyyar-אִיָּר: Iyyar (Iyyar)
label-sivan-סִיוָן: Sivan
label-tammuz-תַּמּוּז: Tammuz
label-av-אָב: Av (Av)
label-elul-אֱלוּל: Elul
label-tishri-תִּשְׁרֵי: Tishri
label-heshvan-חֶשְׁוָן: Heshvan (Heshvan)
label-kislev-כִּסְלֵו: Kislev
label-teveth-טֵבֵת: Teveth
label-shevat-שְׁבָט: Shevat (שְׁבָט)
label-adar-adar-i-אֲדָר: Adar/Adar I (Adar)
label-veadar-adar-ii-אֲדָר-שֵׁנִי: Veadar/Adar II (Second Adar)
label-muharram-مُحَرَّم: Muharram (مُحَرَّم)
label-safar-صَفَر: Safar (صَفَر)
label-rabiʿ-al-awwal-رَبيع-الأوّل: Rabiʿ al-Awwal (رَبيع الأأول)
label-rabiʿ-ath-thani-رَبيع-الثاني: Rabiʿ ath-Thani (رَبي الثاني)
label-jumada-al-ula-جُمادى-الأولى: Jumada al-Ula (جُمادى الأولى)
label-jumada-ath-thania-جُمادى-الآخرة: Jumada ath-Thania (جُمادى الآخرة)
label-rajab-رَجَب: Rajab (رَجَب)
label-shaʿban-شَعْبان: Shaʿban (شَعْبان)
label-ramadan-رَمَضان: Ramadan
label-shawwal-شَوّال: Shawwal
label-dhu-al-qaʿda-ذو-القَعْدة: Dhu al-Qaʿda (ذو القَعْدة)
label-dhu-al-hijja-ذو-الحِجّة: Dhu al-Hijja (ذو الحِجّة)
label-farvardin-فروردین: Farvardin (Farvardin)
label-ordibehesht-اردیبهشت: Ordibehesht (Ordibehesht)
label-khordad-خرداد: Khordad (Khordad)
label-tir-تیر: Tir (Tir)
label-mordad-مرداد: Mordad (Mordad)
label-shahrivar-شهریور: Shahrivar (Shahrivar)
label-mehr-مهر: Mehr (Mehr)
label-aban-آبان: Aban (novembre)
label-azar-آذر: Azar (Azar)
label-dey-دی: Dey (Le)
label-bahman-بهمن: Bahman (Bahman)
label-esfand-اسفند: Esfand (mars)
label-caitra-चैत्र: Caitra (Chaitra)
label-vaisakha-वैशाख: Vaisakha (Vaishakh)
label-jyaistha-ज्येष्ठ: Jyaistha (Senior)
label-asadha-आषाढ़: Asadha
label-sravana-श्रावण: Sravana
label-bhadra-भाद्रपद: Bhadra (Bhadrapada)
label-asvina-आश्विन: Asvina (Ashwin)
label-kartika-कार्तिक: Kartika
label-agrahayana-अग्रहायण: Agrahayana (Agrahayana)
label-pausa-पौष: Pause
label-magha-माघ: Magha
label-phalguna-फाल्गुन: Phalguna
label-vendémiaire: Vendémiaire
label-brumaire: Brumaire
label-frimaire: Frimaire
label-nivôse: Nivôse
label-pluviôse: Pluviôse
label-ventôse: Ventôse
label-germinal: Germinal
label-floréal: Floréal
label-prairial: Prairial
label-messidor: Messidor
label-thermidor: Thermidor
label-fructidor: Fructidor
label-sans-culottides: Sans‑culottides
label-i: je
label-ii: II
label-iii: III
label-primidi-1: Primidi (1)
label-duodi-2: Donner (2)
label-tridi-3: Trois (3)
label-quartidi-4: Quartiers (4)
label-quintidi-5: Quintidius (5)
label-sextidi-6: Sextidi (6)
label-septidi-7: Septidi (7)
label-octidi-8: Octidi (8)
label-nonidi-9: En effet (9)
label-décadi-10: Décadi (10)
label-vertu-1: Vertu (1)
label-génie-2: Génie (2)
label-travail-3: Travail (3)
label-opinion-4: Avis (4)
label-récompenses-5: Récompenses (5)
label-révolution-6: Révolution (6)
tab-gregorian: grégorien
label-date: Date
label-leap: 'Saut:'
label-time: 'Temps:'
label-weekday: 'Jour de la semaine:'
tab-julian-day: Jour julien
label-julian-day: 'Jour julien :'
tab-modified-julian: Julian modifié
label-modified-julian-day: 'Jour julien modifié :'
tab-julian-calendar: Calendrier julien
tab-gregorian-serial: Série grégorienne
label-gregorian-serial-day: 'Journée sérielle grégorienne :'
tab-hebrew: hébreu
tab-islamic: islamique
tab-persian: persan
tab-persian-algorithmic: Algorithmique persan
tab-mayan: Maya
label-long-count: 'Compte long :'
label-haab: Espoir
label-tzolkin: Tzolkin
tab-indian-civil: Civil indien
tab-french-republican: Républicain français
label-day: 'Jour:'
label-month: 'Mois:'
label-décade: 'Décade:'
label-year: 'Année:'
tab-iso-8601: ISO-8601
label-day-of-week: 'Jour de la semaine :'
label-week: 'Semaine:'
label-day-of-year: 'Jour de l''année :'
tab-unix-time: Temps Unix()
label-unix-time: 'Heure Unix() :'
tab-excel-1900-windows: Excel 1900 (Windows)
label-excel-serial-day-1900: 'Journée des séries Excel (1900) :'
tab-excel-1904-macintosh: Excel 1904 (Macintosh)
label-excel-serial-day-1904: 'Journée des séries Excel (1904) :'
tag-this-is-a-port-of-wonderful: C'est un port merveilleux
tag-fourmilab-ch-calendar-converter: Fourmilab.ch Convertisseur de calendrier
tag-by-john-walker: par John Walker
tag-xa0-xa0: '&#xa0;.&#xa0;'
tag-update-other-calendars: Mettre à jour les autres calendriers
tag-today: Aujourd'hui
bech32:
title: Encodeur/décodeur Bech32
description: Encoder/Décoder/Valider betch32(m)
externalAccess: nul
texts:
label-bech32: Bech32
label-bech32m: Bech32m
tab-decode: Décoder
label-bech32-m-string: 'Chaîne Bech32(m) :'
placeholder-bech32-bech32m-string: Chaîne Bech32 / Bech32m
label-variant: 'Variante:'
label-hrp: 'HRP :'
placeholder-hrp: HRP
label-payload: 'Charge utile:'
placeholder-hex-payload: Charge utile Hex
placeholder-variant: Variante
tab-encode: Encoder
label-encoded-bech32-string: "Chaîne bech32 encodée\_:"
placeholder-bech32-string: chaîne bech32
tab-batch: Lot
label-bech32-strings-one-per-line: "Chaînes Bech32 (une par ligne)\_:"
placeholder-one-bech32-string-per-line: Une chaîne Bech32 par ligne
title-results: Résultats
tag-auto-detect: Détection automatique
tag-manual: Manuel
tag-checksum-only: Somme de contrôle uniquement
tag-full-decode: Décodage complet
tag-checksum-valid: Somme de contrôle valide
tag-checksum-invalid: Somme de contrôle invalide
tag-encode: Encoder
tag-convert: Convertir
tag-export-csv: Exporter au format CSV
invalid-hex-payload: Charge utile hexadécimale invalide
input: Saisir
variant: Variante
status: Statut
hex: Hex
hrp: HRP
docker-pangolin-labels:
title: Étiquettes Docker Pangolin
description: Convertir les étiquettes Docker Compose Pangolin en plans et vice versa
externalAccess: nul
texts:
tab-compose-blueprint: Composer → Plan
label-docker-compose-yaml: "YAML Docker Compose\_:"
placeholder-paste-full-docker-compose-yml-here: Collez ici le fichier docker-compose.yml complet…
label-generated-blueprint: "Plan généré\_:"
placeholder-blueprint-yaml-will-appear-here: Le modèle YAML apparaîtra ici…
tab-blueprint-labels: Plan directeur → Étiquettes
label-blueprint-yaml: "Plan directeur YAML\_:"
placeholder-paste-pangolin-blueprint-yaml-here: Collez ici le plan YAML du Pangolin…
label-generated-docker-labels: "Étiquettes Docker générées\_:"
placeholder-docker-labels-will-appear-here: Les étiquettes Docker apparaîtront ici...
tag-extract-pangolin-blueprint: Extrait du plan du pangolin
tag-array-key-value: Tableau (- clé=valeur)
tag-object-key-value: 'Objet (clé : valeur)'
tag-convert-to-docker-labels: Convertir en étiquettes Docker
invalid-blueprint-yaml: Modèle YAML invalide
fitness-computer:
title: Ordinateur de fitness
description: "Calcul du métabolisme basal (MB), de la dépense énergétique quotidienne totale (DEQT), de l'indice de masse corporelle (IMC), du poids idéal, du pourcentage de masse grasse et de la fréquence cardiaque maximale\_: indicateurs clés utilisés pour évaluer la condition physique générale et la santé physiologique."
externalAccess: nul
texts:
label-bmr: BMR
label-tdee-calories: Dépense énergétique totale (DET)/Calories
label-bmi: 'IMC :'
label-ideal-weight: 'Poids idéal :'
label-body-fat-us-navy: Masse grasse corporelle (Marine américaine)
label-body-fat-bmi: Masse grasse corporelle (IMC)
label-max-heart-rate: Fréquence cardiaque maximale
label-sedentary-little-or-no-exercise: 'Sédentaire : peu ou pas d''exercice'
label-light-exercise-1-3-times-week: 'Léger : exercice 1 à 3 fois par semaine'
label-moderate-exercise-4-5-times-week: 'Modéré : faire de l''exercice 4 à 5 fois par semaine'
label-active-daily-exercise-or-intense-exercise-3-4-times-week: >-
Activité physique : exercice quotidien ou exercice intense 3 à 4 fois
par semaine
label-very-active-intense-exercise-6-7-times-week: 'Très actif : exercice intense 6 à 7 fois par semaine'
label-extra-active-very-intense-exercise-daily-or-physical-job: >-
Activité physique intense : exercice physique quotidien très intense ou
travail physique
label-units: 'Unités :'
label-formula: 'Formule:'
label-gender: 'Genre:'
label-age: 'Âge:'
title-body-measurements: Mensurations corporelles
label-activity-level: 'Niveau d''activité :'
title-results: Résultats
label-bmr-kcal-day: 'BMR (kcal/jour) :'
label-tdee-calories-kcal-day: 'Dépense énergétique totale (DET) / Calories (kcal/jour) :'
label-bmi-category: 'Catégorie d''IMC :'
label-healthy-range-min: "Plage de valeurs saines (min)\_:"
label-healthy-range-max: "Plage de valeurs saines (maximum)\_:"
label-devine-1974: '— (On est en 1974) :'
label-hamwi-1964: '— (Hamwi 1964) :'
label-miller-1983: '— (Miller 1983):'
label-robinson-1983: '— (Robinson 1983) :'
label-body-fat: 'Masse grasse corporelle (%) :'
label-fat-mass: 'Masse grasse :'
label-lean-mass: 'Masse maigre :'
label-max-heart-rate-bpm: 'Fréquence cardiaque maximale (bpm) :'
tag-metric-kg-cm: Système métrique (kg, cm)
tag-us-lbs-inches: États-Unis (livres, pouces)
tag-male: Mâle
tag-female: Femelle
food-energy-converter:
title: Convertisseur d'énergie alimentaire
description: Convertir entre aliments (joules, calories)
externalAccess: nul
iso-639-searcher:
title: Recherche ISO 639
description: Recherche dans les codes de langue ISO 639-1/2T/2B/3
externalAccess: nul
texts:
placeholder-search-iso-639-language-code-by-iso-1-iso-2t-2b-iso-3-name: Recherche du code de langue ISO 639 par ISO-1, ISO-2T/2B, ISO-3, nom...
label-max-results: "Résultats maximaux\_:"
label-2b: '2B :'
label-2t: '2T :'
label-eng: 'ANGLAIS:'
tag-no-results: Aucun résultat
tag-search-results: Résultats de la recherche
tag-iso-639-1: iso-639-1
tag-iso-639-2t-2b: ISO 639-2T/2B
tag-iso-639-3: ISO 639-3
tag-english-and-local-name: Nom anglais et local
loading-more-results: Chargement des résultats...
jasypt-string-encryption:
title: Chiffrement de chaînes Jasypt
description: >-
Chiffrer et déchiffrer des chaînes de caractères à l'aide de la norme
Jasypt (Java Simplified Encryption).
externalAccess: nul
texts:
label-mode: 'Mode:'
label-password-secret-key: "Mot de passe (clé secrète)\_:"
placeholder-enter-jasypt-password-salt-secret-key: Saisissez le mot de passe Jasypt (sel / clé secrète)
title-results: Résultats
label-decoded: 'Décrypté :'
label-raw: 'Brut:'
label-enc-form: 'Formulaire ENC :'
tag-encrypt: Chiffrer
tag-decrypt: Décrypter
plain-text: "Texte brut\_:"
jasypt-encrypted-string: "Chaîne chiffrée Jasypt\_:"
text-to-encrypt-e-g-db-password: 'Texte à chiffrer (ex. : mot de passe de la base de données)'
encrypted-value-e-g-enc-or-raw-jasypt-string: Valeur chiffrée (par exemple, ENC(...)) ou chaîne Jasypt brute
k8s-rbac-generator:
title: Générateur RBAC Kubernetes
description: Générer un fichier YAML de politique RBAC Kubernetes
externalAccess: nul
texts:
label-user: Utilisateur
label-group: Groupe
label-serviceaccount: Compte de service
label-role-name: "Nom du rôle\_:"
label-role-type: Type de rôle
label-namespace: Espace de noms
title-rules: Règles
label-resources: Ressources
placeholder-select-resources-supports: Sélectionner les ressources (supporte *)
label-resource-names-optional: Noms des ressources (facultatif)
placeholder-specific-resources-names: Noms de ressources spécifiques
label-verbs: Verbes
placeholder-select-verbs-supports: Sélectionnez les verbes (prennent en charge *)
title-subjects: Sujets
label-kind: Gentil
label-name: Nom
title-output-yaml: Sortie YAML
tab-role-yaml: Rôle YAML
tab-rolebinding-yaml: Liaison de rôles YAML
tag-clusterrole-global: Rôle du cluster (global)
tag-role-namespaced: Rôle (avec espace de noms)
tag-add-rule: + Ajouter une règle
tag-remove-rule: Supprimer la règle
tag-add-subject: + Ajouter un sujet
tag-remove-subject: Supprimer le sujet
objgen-html:
title: ObjGen vers HTML
description: Générer du HTML complexe à partir d'une syntaxe de type TOML
externalAccess: nul
texts:
input-label-objgen-html-definition: Définition HTML d'ObjGen
input-placeholder-put-your-objgen-html-definition-here: Insérez ici votre définition HTML ObjGen...
output-label-generated-html: HTML généré
tag-documentation: Documentation
objgen-json:
title: ObjGen vers JSON
description: Générer du JSON complexe à partir d'une syntaxe de type TOML
externalAccess: nul
texts:
input-label-objgen-json-definition: Définition JSON d'ObjGen
input-placeholder-put-your-objgen-json-definition-here: Insérez ici votre définition JSON ObjGen...
output-label-generated-json: JSON généré
tag-documentation: Documentation
pgp-file-encryption:
title: Chiffrement de fichiers PGP
description: Chiffrez et déchiffrez des fichiers à l'aide de PGP.
externalAccess: nul
texts:
title-1-select-a-file: 1. Sélectionnez un fichier
title-drag-and-drop-a-file-or-click-to-select: Glissez-déposez un fichier ou cliquez pour le sélectionner.
title-2-public-key-for-encryption: 2. Clé publique (pour le chiffrement)
title-3-private-key-passphrase-for-decryption: 3. Clé privée + phrase secrète (pour le déchiffrement)
label-passphrase: "Phrase secrète\_:"
placeholder-passphrase: phrase de passe
tag-selected-file: "Fichier sélectionné\_:"
tag-encrypt-stream: Chiffrer (flux)
tag-decrypt-stream: Décrypter (flux)
tag-encrypting: Chiffrement…
tag-decrypting: Décryptage…
tag-encrypted-file-ready: Fichier chiffré prêt.
tag-download-encrypted: Télécharger crypté
tag-decrypted-file-ready: Fichier déchiffré prêt.
tag-download-decrypted: Télécharger décrypté
remove-background:
title: Supprimer l'arrière-plan de l'image
description: Supprimer l'arrière-plan d'une image à l'aide de l'IA
externalAccess: "Téléchargements\_: Supprimez les modèles d'arrière-plan de Hugging Face. Le traitement est effectué dans votre navigateur."
texts:
label-rmbg-1-4-cpu-wasm: RMBG‑1.4 (CPU/WASM)
label-modnet-webgpu: MODNet (WebGPU)
label-transparent: Transparent
label-solid-color: Couleur unie
label-pattern: 'Modèle:'
label-blurred-original: Original flou
label-adjust-contrast-brightness: Ajuster le contraste/la luminosité
label-diagonal-stripes: Rayures diagonales
label-dots: Points
label-checkerboard: Damier
title-drag-and-drop-an-image-or-click-to-select: Faites glisser et déposez une image ou cliquez pour la sélectionner.
label-model: 'Modèle:'
label-blur: 'Se brouiller:'
label-contrast: 'Contraste:'
label-brightness: 'Luminosité:'
title-original: Original
title-result: Résultat
tag-apply-background: Appliquer le contexte
tag-download-result: Résultat du téléchargement
shell-formatter:
title: Formateur de commandes Shell
description: >-
Formater les commandes shell sous forme de commandes shell multilignes
séparées par arguments
externalAccess: nul
texts:
input-label-shell-commands-to-format: Commandes shell pour formater
input-placeholder-put-your-shell-commands-to-format-here: Saisissez ici vos commandes shell au format souhaité...
output-label-formatted-shell-commands: Commandes shell formatées
shell-linearizer:
title: Linéariseur de commandes Shell
description: Linéariser les commandes shell multilignes
externalAccess: nul
texts:
input-label-shell-commands-to-linearize: Commandes shell pour linéariser
input-placeholder-put-your-shell-commands-to-linearize-here: Saisissez ici vos commandes shell pour linéariser...
output-label-linearized-shell-commands: Commandes shell linéarisées
ufw-generator:
title: Générateur de commandes UFW
description: Générer des lignes de commande UFW
externalAccess: nul
texts:
label-allow: Permettre
label-deny: Refuser
label-reject: Rejeter
label-limit: Limite
label-incoming: Entrant
label-outgoing: Sortant
label-tcp: TCP
label-udp: UDP
label-any: N'importe lequel
label-action: 'Action:'
label-direction: 'Direction:'
label-protocol: 'Protocole:'
label-port: 'Port:'
placeholder-80: '80'
label-port-to-range: "Port vers (plage)\_:"
placeholder-443: '443'
label-from-ip: "Depuis l'adresse IP\_:"
placeholder-192-168-1-10: 192.168.1.10
label-to-ip: "Vers l'adresse IP\_:"
placeholder-10-0-0-5: 10.0.0.5
label-interface: 'Interface:'
placeholder-eth0: eth0
label-logging: 'Enregistrement:'
label-comment: 'Commentaire:'
placeholder-optional-comment: Commentaire facultatif
title-generated-command: Commande générée
missing-port: Port disparu
visual-subnet-calculator:
title: Calculateur visuel de sous-réseau
description: >-
Un outil permettant de concevoir rapidement des réseaux et de collaborer à
leur conception. Il vise à accélérer le travail des administrateurs
réseau, et non à traiter des aspects mathématiques complexes du
sous-réseautage.
externalAccess: nul
zalgo:
title: Générateur/Bannière Zalgo
description: Générer du texte Zalgo et nettoyer le texte généré par Zalgo
externalAccess: nul
texts:
text-zalgo-text-copied: Texte Zalgo copié !
title-zalgo-text-generation: Génération de texte Zalgo
placeholder-put-your-string-here: Placez votre ficelle ici...
label-text-to-decorate-with-zalgo: Texte à décorer avec Zalgo
label-intensity: 'Intensité:'
title-zalgo-text: Texte Zalgo
title-zalgo-cleaner: Nettoyeur Zalgo
placeholder-put-zalgo-text-to-clean-here: Insérez ici le texte zalgo à nettoyer...
label-zalgo-text-to-clean: Texte Zalgo à nettoyer
label-cleaned-text: Texte nettoyé
placeholder-clean-zalgo-text-will-appear-here: Le texte zalgo propre apparaîtra ici...
tag-generate: Générer
tag-copy: Copie
tag-clean: Faire le ménage
gpt-tokens:
service:
texts:
must-set-one-of-messages-or-function: Il faut définir l'un des messages | fonction
function-must-set-messages: La fonction doit définir des messages
dead-pixel-tester:
title: Testeur de pixels morts
gif-to-mp4:
title: GIF vers MP4
description: Convertir un GIF en MP4 avec ffmpeg
externalAccess: nul
texts:
label-stream-loop: 'Boucle de flux :'
title-drag-and-drop-gif-here-or-click-to-select-a-file: Glissez-déposez le GIF ici ou cliquez pour sélectionner un fichier.
title-logs: bûches
html-to-pdf:
title: HTML vers PDF
description: >-
Générer un PDF à partir de contenu HTML ou d'une URL avec sélection du
format et masquage automatique des bannières de cookies
externalAccess: >-
Cet outil envoie des URL et du contenu HTML au service web Puppeteer
*auto-hébergé* configuré.
texts:
label-a2: A2
label-a3: A3
label-a4: A4
label-a5: A5
label-letter: Lettre
label-legal: Légal
label-html-to-pdf-service-url: "URL du service HTML vers PDF\_:"
placeholder-http-localhost-3000: http://localhost:3000
label-basic-authentication: "Authentification de base\_:"
placeholder-username-password: "nom d'utilisateur\_:mot de passe"
tab-url-pdf: URL → PDF
label-url: "URL\_:"
placeholder-https-example-com: https://exemple.com
tab-html-pdf: HTML → PDF
label-html-content: "Contenu HTML\_:"
tab-batch-url-pdf: URL du lot → PDF
label-urls-one-per-line: "URL (une par ligne)\_:"
title-results: Résultats
tab-custom-pdf-options: Options PDF personnalisées
label-format: 'Format:'
label-language: 'Langue:'
placeholder-en-us: en-US
label-landscape: 'Paysage:'
label-one-long-page: 'Une seule longue page :'
label-auto-hide-cookie-banners: "Masquer automatiquement les bannières de cookies\_:"
label-print-background: 'Fond d''impression :'
title-margins: Marges
label-top-mm: 'Haut (mm) :'
label-bottom-mm: 'Bas (mm) :'
label-left-mm: 'Gauche (mm) :'
label-right-mm: 'Droite (mm) :'
tag-html-to-pdf-service-configuration-self-hosted: Configuration du service HTML vers PDF (auto-hébergé)
tag-you-must-self-host-html-to-pdf-service-see: "Vous devez héberger vous-même le service de conversion HTML en PDF. Voir\_:"
tag-html-to-pdf-service-install: Installation du service HTML vers PDF
tag-generate-pdf: Générer un PDF
tag-generate-pdfs: Générer des PDF
tag-url: URL
tag-download: Télécharger
tag-download-pdf: Télécharger le PDF
tag-failed: Échoué
shutdown-command-generator:
title: Générateur de commandes d'arrêt
description: Générer une commande d'arrêt pour différents systèmes d'exploitation
externalAccess: nul
texts:
label-windows: Windows
label-linux: Linux
label-macos: macOS
label-delay: 'Retard:'
label-specific-time: Heure précise
label-platform: 'Plate-forme:'
label-shutdown-time: 'Heure d''arrêt :'
label-force: Forcer
label-reboot: Redémarrage
label-logoff: Déconnexion
label-cancel: Annuler
label-hibernate: Hiberner
title-generated-command: Commande générée
tag-nbsp-h-nbsp: '&nbsp;h&nbsp;'
tag-nbsp-m-nbsp: m
tag-nbsp-s: "&nbsp;s"
random-line-picker:
title: Sélecteur de lignes aléatoires
description: Sélectionnez des lignes aléatoires depuis un texte
externalAccess: "null"
texts:
label-allow-repeated-lines: Autoriser les lignes répétées
label-number-of-lines-to-pick: "Nombre de lignes à sélectionner :"
label-prefix-lines-with-line-number: Ajouter les numéros de ligne
placeholder-picked-lines: Lignes sélectionnées
placeholder-put-your-text-here: Mettez votre texte ici...
tag-copy: Copier
tag-refresh: Actualiser
text-picked-lines-copied-to-clipboard: Lignes sélectionnées copiées dans le presse-papiers !
favoriteButton: favoriteButton:
add: Ajouter aux favoris add: Ajouter aux favoris
remove: Retirer des favoris remove: Retirer des favoris
@@ -8403,3 +9166,9 @@ textareaCopyable:
download: Télécharger download: Télécharger
locale-selector: locale-selector:
select-a-language: Sélectionnez une langue select-a-language: Sélectionnez une langue
collapsibleToolMenu:
text:
expanding: En expansion...
collapsing: Effondrement...
collapse-all-tools: Réduire tous les outils
expand-all-tools: Développer tous les outils
+2572 -1625
View File
File diff suppressed because it is too large. Load diff
+2591 -1643
View File
File diff suppressed because it is too large. Load diff
+2015 -1246
View File
File diff suppressed because it is too large. Load diff
+2544 -1599
View File
File diff suppressed because it is too large. Load diff
+2398 -1501
View File
File diff suppressed because it is too large. Load diff
+2467 -1554
View File
File diff suppressed because it is too large. Load diff
+2544 -1604
View File
File diff suppressed because it is too large. Load diff
+2536 -1585
View File
File diff suppressed because it is too large. Load diff
+2536 -1602
View File
File diff suppressed because it is too large. Load diff
+2473 -1558
View File
File diff suppressed because it is too large. Load diff
+2485 -1574
View File
File diff suppressed because it is too large. Load diff
+866 -119
View File
File diff suppressed because it is too large. Load diff
+7 -7
View File
@@ -5,13 +5,13 @@ server {
root /usr/share/nginx/html; root /usr/share/nginx/html;
index index.html; index index.html;
add_header X-Frame-Options SAMEORIGIN; #add_header X-Frame-Options SAMEORIGIN;
add_header X-Content-Type-Options nosniff; #add_header X-Content-Type-Options nosniff;
add_header Referrer-Policy strict-origin-when-cross-origin; #add_header Referrer-Policy strict-origin-when-cross-origin;
add_header X-Permitted-Cross-Domain-Policies none; #add_header X-Permitted-Cross-Domain-Policies none;
add_header Cross-Origin-Resource-Policy same-site; #add_header Cross-Origin-Resource-Policy same-site;
add_header Cross-Origin-Opener-Policy same-origin; #add_header Cross-Origin-Opener-Policy same-origin;
add_header Cross-Origin-Embedder-Policy require-corp; #add_header Cross-Origin-Embedder-Policy require-corp;
#add_header Content-Security-Policy "default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval' http: https: blob:; style-src 'self' 'unsafe-inline' https: http:; img-src 'self' data: blob: https: http:; connect-src data: blob: https: http:; font-src 'self' https: http:; object-src 'none'; base-uri 'self'; form-action 'self';"; #add_header Content-Security-Policy "default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval' http: https: blob:; style-src 'self' 'unsafe-inline' https: http:; img-src 'self' data: blob: https: http:; connect-src data: blob: https: http:; font-src 'self' https: http:; object-src 'none'; base-uri 'self'; form-action 'self';";
include /etc/nginx/mime.types; include /etc/nginx/mime.types;
+7 -2
View File
@@ -238,6 +238,7 @@
"jwt-decode": "^4.0.0", "jwt-decode": "^4.0.0",
"korean-unpacker": "^1.0.3", "korean-unpacker": "^1.0.3",
"langs": "^2.0.0", "langs": "^2.0.0",
"leaflet": "^1.9.4",
"libmime": "^5.3.8", "libmime": "^5.3.8",
"libphonenumber-js": "^1.12.33", "libphonenumber-js": "^1.12.33",
"lodash": "^4.18.1", "lodash": "^4.18.1",
@@ -395,6 +396,7 @@
"@types/js-beautify": "^1.14.3", "@types/js-beautify": "^1.14.3",
"@types/jsdom": "^21.1.7", "@types/jsdom": "^21.1.7",
"@types/jsonpath": "^0.2.4", "@types/jsonpath": "^0.2.4",
"@types/leaflet": "^1.9.21",
"@types/libmime": "^5.0.3", "@types/libmime": "^5.0.3",
"@types/lodash": "^4.17.20", "@types/lodash": "^4.17.20",
"@types/lodash.defaultsdeep": "^4.6.9", "@types/lodash.defaultsdeep": "^4.6.9",
@@ -446,10 +448,10 @@
"unplugin-vue-components": "^0.25.0", "unplugin-vue-components": "^0.25.0",
"unplugin-vue-markdown": "^29.1.0", "unplugin-vue-markdown": "^29.1.0",
"vite": "^4.4.9", "vite": "^4.4.9",
"vite-plugin-node-polyfills": "^0.23.0", "vite-plugin-node-polyfills": "^0.26.0",
"vite-plugin-pwa": "^1.1.0", "vite-plugin-pwa": "^1.1.0",
"vite-plugin-splash-screen": "^0.2.0", "vite-plugin-splash-screen": "^0.2.0",
"vite-plugin-wasm": "^3.4.1", "vite-plugin-wasm": "^3.6.0",
"vite-svg-loader": "^4.0.0", "vite-svg-loader": "^4.0.0",
"vitest": "^0.34.6", "vitest": "^0.34.6",
"vue-i18n-extract": "^2.0.7", "vue-i18n-extract": "^2.0.7",
@@ -460,6 +462,9 @@
"overrides": { "overrides": {
"@vueuse/shared": "13.9.0", "@vueuse/shared": "13.9.0",
"xlsx": "https://cdn.sheetjs.com/xlsx-0.20.3/xlsx-0.20.3.tgz" "xlsx": "https://cdn.sheetjs.com/xlsx-0.20.3/xlsx-0.20.3.tgz"
},
"patchedDependencies": {
"node-forge@1.4.0": "patches/node-forge@1.4.0.patch"
} }
}, },
"scarfSettings": { "scarfSettings": {
+765
View File
@@ -0,0 +1,765 @@
diff --git a/lib/asn1-validator.js b/lib/asn1-validator.js
index 2be328501e93e5f0e38245b6ee797bfc426dfcaa..4deb9f17e77b9c1a602fc6e034012b4c1ccf7e52 100644
--- a/lib/asn1-validator.js
+++ b/lib/asn1-validator.js
@@ -17,7 +17,6 @@ exports.privateKeyValidator = {
name: 'PrivateKeyInfo.version',
tagClass: asn1.Class.UNIVERSAL,
type: asn1.Type.INTEGER,
- constructed: false,
capture: 'privateKeyVersion'
}, {
// privateKeyAlgorithm
@@ -29,7 +28,6 @@ exports.privateKeyValidator = {
name: 'AlgorithmIdentifier.algorithm',
tagClass: asn1.Class.UNIVERSAL,
type: asn1.Type.OID,
- constructed: false,
capture: 'privateKeyOid'
}]
}, {
@@ -37,12 +35,11 @@ exports.privateKeyValidator = {
name: 'PrivateKeyInfo',
tagClass: asn1.Class.UNIVERSAL,
type: asn1.Type.OCTETSTRING,
- constructed: false,
capture: 'privateKey'
}]
};
-exports.publicKeyValidator = {
+exports.publicKeyInfoValidator = {
name: 'SubjectPublicKeyInfo',
tagClass: asn1.Class.UNIVERSAL,
type: asn1.Type.SEQUENCE,
@@ -54,38 +51,24 @@ exports.publicKeyValidator = {
type: asn1.Type.SEQUENCE,
constructed: true,
value: [{
- name: 'AlgorithmIdentifier.algorithm',
- tagClass: asn1.Class.UNIVERSAL,
- type: asn1.Type.OID,
- constructed: false,
- capture: 'publicKeyOid'
- }]
- },
- // capture group for ed25519PublicKey
- {
- tagClass: asn1.Class.UNIVERSAL,
- type: asn1.Type.BITSTRING,
- constructed: false,
- composed: true,
- captureBitStringValue: 'ed25519PublicKey'
- }
- // FIXME: this is capture group for rsaPublicKey, use it in this API or
- // discard?
- /* {
+ name: 'AlgorithmIdentifier.algorithm',
+ tagClass: asn1.Class.UNIVERSAL,
+ type: asn1.Type.OID,
+ capture: 'publicKeyOid'
+ },
+ {
+ name: 'AlgorithmIdentifier.parameters',
+ tagClass: asn1.Class.UNIVERSAL,
+ optional: true,
+ captureAsn1: 'parameters',
+ }]
+ }, {
// subjectPublicKey
name: 'SubjectPublicKeyInfo.subjectPublicKey',
tagClass: asn1.Class.UNIVERSAL,
type: asn1.Type.BITSTRING,
constructed: false,
- value: [{
- // RSAPublicKey
- name: 'SubjectPublicKeyInfo.subjectPublicKey.RSAPublicKey',
- tagClass: asn1.Class.UNIVERSAL,
- type: asn1.Type.SEQUENCE,
- constructed: true,
- optional: true,
- captureAsn1: 'rsaPublicKey'
- }]
- } */
- ]
+ captureAsn1: 'subjectPublicKey', // used by RSA
+ captureBitStringValue: 'subjectPublicKeyRaw', // used by ECDSA and ED25519
+ }]
};
diff --git a/lib/ecdsa.js b/lib/ecdsa.js
new file mode 100644
index 0000000000000000000000000000000000000000..6373401341a319edcd5360d3002cab2de4b81942
--- /dev/null
+++ b/lib/ecdsa.js
@@ -0,0 +1,390 @@
+/**
+ * JavaScript implementation of ECDSA.
+ *
+ * Copyright (c) 2021 HAMANO Tsukasa <hamano@osstech.co.jp>
+ *
+ * This implementation is based on the elliptic
+ *
+ * https://github.com/indutny/elliptic/
+ */
+var forge = require('./forge');
+require('./asn1');
+require('./jsbn');
+require('./random');
+require('./sha512');
+var util = require('./util');
+var elliptic = require('elliptic');
+var asn1Validator = require('./asn1-validator');
+var publicKeyInfoValidator = asn1Validator.publicKeyInfoValidator;
+var privateKeyValidator = asn1Validator.privateKeyValidator;
+var asn1 = forge.asn1;
+
+if(typeof BigInteger === 'undefined') {
+ var BigInteger = forge.jsbn.BigInteger;
+}
+
+var ByteBuffer = util.ByteBuffer;
+var NativeBuffer = typeof Buffer === 'undefined' ? Uint8Array : Buffer;
+
+forge.pki = forge.pki || {};
+module.exports = forge.pki.ecdsa = forge.ecdsa = forge.ecdsa || {};
+var ecdsa = forge.ecdsa;
+
+ecdsa.constants = {};
+
+/*
+ * Supported namedCurve listed here:
+ * https://github.com/indutny/elliptic/blob/master/lib/elliptic/curves.js
+ */
+ecdsa.supportedCueves = [
+ 'p192', // secp192r1, prime192v1
+ 'p256', // secp256r1, prime256v1
+ 'p224', // secp224r1,
+ 'p384', // secp384r1
+ 'p521', // secp521r1
+ 'secp256k1',// secp256k1
+];
+
+/*
+ * RCF5915: Elliptic Curve Private Key Format
+ * https://datatracker.ietf.org/doc/html/rfc5915
+ *
+ * ECPrivateKey ::= SEQUENCE {
+ * version INTEGER { ecPrivkeyVer1(1) } (ecPrivkeyVer1),
+ * privateKey OCTET STRING,
+ * parameters [0] ECParameters {{ NamedCurve }} OPTIONAL,
+ * publicKey [1] BIT STRING OPTIONAL
+ * }
+ */
+var ecPrivateKeyValidator = {
+ name: 'ECPrivateKey',
+ tagClass: asn1.Class.UNIVERSAL,
+ type: asn1.Type.SEQUENCE,
+ constructed: true,
+ value: [{
+ name: 'ECPrivateKey.version',
+ tagClass: asn1.Class.UNIVERSAL,
+ type: asn1.Type.INTEGER,
+ capture: 'version',
+ }, {
+ name: 'ECPrivateKey.privateKey',
+ tagClass: asn1.Class.UNIVERSAL,
+ type: asn1.Type.OCTETSTRING,
+ capture: 'privateKey',
+ }, {
+ tagClass: asn1.Class.CONTEXT_SPECIFIC,
+ type: 0x0,
+ optional: true,
+ value: [{
+ name: 'ECPrivateKey.parameters',
+ tagClass: asn1.Class.UNIVERSAL,
+ type: asn1.Type.OID,
+ captureAsn1: 'parameters',
+ }],
+ }, {
+ tagClass: asn1.Class.CONTEXT_SPECIFIC,
+ type: 0x1,
+ optional: true,
+ value: [{
+ name: 'ECPrivateKey.publicKey',
+ type: asn1.Type.BITSTRING,
+ captureAsn1: 'publicKey',
+ }],
+ }]
+};
+
+var ecSpecifiedCurveValidator = {
+ name: 'SpecifiedCurve',
+ tagClass: asn1.Class.UNIVERSAL,
+ type: asn1.Type.SEQUENCE,
+ constructed: true,
+ value: [{
+ name: 'SpecifiedCurveVersion',
+ tagClass: asn1.Class.UNIVERSAL,
+ type: asn1.Type.INTEGER,
+ capture: 'version',
+ }, {
+ name: 'SpecifiedCurve.FieldID',
+ tagClass: asn1.Class.UNIVERSAL,
+ type: asn1.Type.SEQUENCE,
+ constructed: true,
+ value: [{
+ name: 'SpecifiedCurve.FieldID.fieldType',
+ tagClass: asn1.Class.UNIVERSAL,
+ type: asn1.Type.OID,
+ capture: 'fieldType',
+ }, {
+ name: 'SpecifiedCurve.FieldID.prime',
+ tagClass: asn1.Class.UNIVERSAL,
+ type: asn1.Type.INTEGER,
+ capture: 'p',
+ }]
+ }, {
+ name: 'SpecifiedCurve.Curve',
+ tagClass: asn1.Class.UNIVERSAL,
+ type: asn1.Type.SEQUENCE,
+ constructed: true,
+ value: [{
+ name: 'SpecifiedCurve.Curve.a',
+ tagClass: asn1.Class.UNIVERSAL,
+ type: asn1.Type.OCTETSTRING,
+ capture: 'a',
+ }, {
+ name: 'SpecifiedCurve.Curve.b',
+ tagClass: asn1.Class.UNIVERSAL,
+ type: asn1.Type.OCTETSTRING,
+ capture: 'b',
+ }]
+ }, {
+ name: 'SpecifiedCurve.Generator',
+ tagClass: asn1.Class.UNIVERSAL,
+ type: asn1.Type.OCTETSTRING,
+ capture: 'g',
+ }, {
+ name: 'SpecifiedCurve.Order',
+ tagClass: asn1.Class.UNIVERSAL,
+ type: asn1.Type.INTEGER,
+ capture: 'n',
+ }, {
+ name: 'SpecifiedCurve.Confactor',
+ tagClass: asn1.Class.UNIVERSAL,
+ type: asn1.Type.INTEGER,
+ capture: 'c',
+ optional: true
+ }]
+};
+
+ecdsa.generateKeyPair = function(options) {
+ options = options || {};
+ var curveName = options.name || 'p256';
+ var seed = options.seed;
+ var errors = [];
+
+ if (!(ecdsa.supportedCueves.includes(curveName))) {
+ var error = new Error('unsupported curveName: ' + curveName);
+ error.errors = errors;
+ throw error;
+ }
+ var curve = elliptic.curves[curveName];
+ var ec = new elliptic.ec(curve);
+ ec.curveName = curveName;
+ var kp = ec.genKeyPair({
+ entropy: seed,
+ });
+ var privateKey = kp.getPrivate();
+ var publicKey = kp.getPublic();
+ return {
+ publicKey: new ecdsa.ECPublicKey(kp.ec, publicKey),
+ privateKey: new ecdsa.ECPrivateKey(kp.ec, privateKey)
+ };
+};
+
+/**
+ * Converts a ECPrivateKey to an ASN.1 representation.
+ *
+ * @param key the ECPrivateKey.
+ *
+ * @return the ASN.1 representation of an ECPrivateKey.
+ */
+ecdsa.privateKeyToAsn1 = function(key, options) {
+ return key.toAsn1(options);
+};
+
+var ECPublicKey = function(ec, publicKey) {
+ this._ec = ec;
+ this._publicKey = publicKey;
+};
+
+ecdsa.ECPublicKey = ECPublicKey;
+
+/**
+ * Converts a public key from a RFC8410 ASN.1 encoding.
+ *
+ * @param obj - The asn1 representation of a public key.
+ *
+ * @return {ECPublicKey} - ECPublicKey object.
+ */
+ECPublicKey.fromAsn1 = function(obj) {
+ var capture = {};
+ var errors = [];
+ if(!forge.asn1.validate(obj, publicKeyInfoValidator, capture, errors)) {
+ var error = new Error('Cannot read PublicKeyInfo ASN.1 object.');
+ error.errors = errors;
+ throw error;
+ }
+ var publicKey = capture.subjectPublicKeyRaw;
+ var params = capture.parameters;
+ var curve;
+ var curveName;
+ if(params && params.type === forge.asn1.Type.OID) {
+ var oid = forge.asn1.derToOid(params.value);
+ curveName = forge.oids[oid];
+ if(!ecdsa.supportedCueves.includes(curveName)) {
+ var error = new Error('Unsupported curveName: ' + curveName);
+ error.errors = errors;
+ throw error;
+ }
+ curve = elliptic.curves[curveName];
+ } else if(params && params.type === forge.asn1.Type.SEQUENCE) {
+ var capture = {};
+ if(!forge.asn1.validate(params, ecSpecifiedCurveValidator, capture, errors)) {
+ var error = new Error('Cannot read specified curve ASN.1 object.');
+ error.errors = errors;
+ throw error;
+ }
+ var options = {
+ p: util.bytesToHex(capture.p),
+ a: util.bytesToHex(capture.a),
+ b: util.bytesToHex(capture.b),
+ n: util.bytesToHex(capture.n),
+ };
+ var _curve = new elliptic.curve.short(options);
+ var g = _curve.decodePoint(util.bytesToHex(capture.g), 'hex');
+ curve = {
+ curve: _curve,
+ n: _curve.n,
+ g: g
+ };
+ } else {
+ var error = new Error('no ECParameters');
+ error.errors = errors;
+ throw error;
+ }
+ var ec = new elliptic.ec({curve: curve});
+ ec.curveName = curveName;
+ var kp = ec.keyFromPublic(publicKey);
+ return new ECPublicKey(ec, kp.getPublic());
+};
+
+ECPublicKey.prototype.verify = function(msg, signature) {
+ var hexMsg = util.bytesToHex(msg);
+ var hexSignature = util.bytesToHex(signature);
+ return this._ec.verify(hexMsg, hexSignature, this._publicKey, 'hex');
+};
+
+ECPublicKey.prototype.toString = function() {
+ return this._publicKey.encode('hex');
+};
+
+ECPublicKey.prototype.getBytes = function() {
+ return String.fromCharCode.apply(null, this._publicKey.encode());
+};
+
+ECPublicKey.prototype.toAsn1 = function(options) {
+ var curveOID = forge.oids[this._ec.curveName];
+ if (!curveOID) {
+ var error = new Error('unsupported namedCurve or specifiedCurve.');
+ error.errors = errors;
+ throw error;
+ }
+
+ var obj = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, []);
+ var aid = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [
+ asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false,
+ asn1.oidToDer(forge.oids['ecPublicKey']).getBytes()),
+ asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false,
+ asn1.oidToDer(curveOID).getBytes())]);
+ obj.value.push(aid);
+ obj.value.push(
+ asn1.create(asn1.Class.UNIVERSAL, asn1.Type.BITSTRING, false,
+ "\0" + this.getBytes()));
+ return obj;
+};
+
+ECPublicKey.prototype.toDer = function() {
+ return asn1.toDer(this.toAsn1()).getBytes();
+};
+
+ECPublicKey.prototype.toPem = function() {
+ return '-----BEGIN PUBLIC KEY-----\n' +
+ util.encode64(this.toDer(), 64) +
+ '\n-----END PUBLIC KEY-----\n';
+};
+
+
+var ECPrivateKey = function(ec, privateKey) {
+ this._ec = ec;
+ this._privateKey = privateKey;
+};
+ecdsa.ECPrivateKey = ECPrivateKey;
+
+/**
+ * Converts a private key from a RFC5915 ASN.1 Object.
+ *
+ * @param obj - The asn1 representation of a private key.
+ *
+ * @returns {Object} obj - The ASN.1 key object.
+ * @returns {ECPrivateKey} ECPrivateKey object.
+ */
+ECPrivateKey.fromAsn1 = function(obj) {
+ var capture = {};
+ var errors = [];
+ var valid = forge.asn1.validate(obj, ecPrivateKeyValidator, capture, errors);
+ if(!valid) {
+ var error = new Error('Invalid ECPrivateKey object.');
+ error.errors = errors;
+ throw error;
+ }
+ var params;
+ if (!capture.parameters) {
+ var error = new Error('no ECPrivateKey.parameters.');
+ error.errors = errors;
+ throw error;
+ }
+ var oid = asn1.derToOid(capture.parameters.value)
+ var curveName = forge.oids[oid];
+ if (!ecdsa.supportedCueves.includes(curveName)) {
+ var error = new Error('unsupported curveName: ' + curveName);
+ error.errors = errors;
+ throw error;
+ }
+ curve = elliptic.curves[curveName];
+ var ec = new elliptic.ec({curve: curve});
+ ec.curveName = curveName;
+ var kp = ec.keyFromPrivate(util.bytesToHex(capture.privateKey));
+ return new ECPrivateKey(ec, kp.getPrivate());
+};
+
+ECPrivateKey.prototype.sign = function(msg) {
+ var hexMsg = util.bytesToHex(msg);
+ var signature = this._ec.sign(hexMsg, this._privateKey);
+ return String.fromCharCode.apply(null, signature.toDER());
+};
+
+ECPrivateKey.prototype.toString = function() {
+ return this._privateKey.toString('hex');
+};
+
+ECPrivateKey.prototype.getBytes = function() {
+ return String.fromCharCode.apply(null, this._privateKey.toArray());
+};
+
+ECPrivateKey.prototype.toAsn1 = function(options) {
+ var curveOID = forge.oids[this._ec.curveName];
+ if (!curveOID) {
+ var error = new Error('unsupported namedCurve');
+ error.errors = errors;
+ throw error;
+ }
+ return asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [
+ asn1.create(asn1.Class.UNIVERSAL,
+ asn1.Type.INTEGER, false,
+ asn1.integerToDer(1).getBytes()),
+ asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false,
+ this.getBytes()),
+ asn1.create(asn1.Class.CONTEXT_SPECIFIC, 0x0, true, [
+ asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false,
+ asn1.oidToDer(curveOID).getBytes())
+ ]),
+ ]);
+};
+
+ECPrivateKey.prototype.toDer = function(options) {
+ return asn1.toDer(this.toAsn1(options)).getBytes();
+};
+
+ECPrivateKey.prototype.toPem = function(options) {
+ return '-----BEGIN EC PRIVATE KEY-----\n' +
+ util.encode64(this.toDer(options), 64) +
+ '\n-----END EC PRIVATE KEY-----\n';
+};
diff --git a/lib/ed25519.js b/lib/ed25519.js
index 87eb7097aff14b2a26103c10ce6777a672e0a0e8..31c48254c6112625a581945029f541269e74b46e 100644
--- a/lib/ed25519.js
+++ b/lib/ed25519.js
@@ -114,7 +114,7 @@ ed25519.publicKeyFromAsn1 = function(obj) {
// get SubjectPublicKeyInfo
var capture = {};
var errors = [];
- var valid = forge.asn1.validate(obj, publicKeyValidator, capture, errors);
+ var valid = forge.asn1.validate(obj, publicKeyInfoValidator, capture, errors);
if(!valid) {
var error = new Error('Invalid Key.');
error.errors = errors;
@@ -126,7 +126,7 @@ ed25519.publicKeyFromAsn1 = function(obj) {
throw new Error('Invalid OID "' + oid + '"; OID must be "' +
ed25519Oid + '".');
}
- var publicKeyBytes = capture.ed25519PublicKey;
+ var publicKeyBytes = capture.ed25519PublicKeyRaw;
if(publicKeyBytes.length !== ed25519.constants.PUBLIC_KEY_BYTE_LENGTH) {
throw new Error('Key length is invalid.');
}
diff --git a/lib/oids.js b/lib/oids.js
index 817ed1be2001cf1640df2b59cc4822cb01877cce..6ead3acf140269037eba6e1e0bd047fccc95167b 100644
--- a/lib/oids.js
+++ b/lib/oids.js
@@ -39,6 +39,18 @@ _IN('1.3.101.112', 'EdDSA25519');
_IN('1.2.840.10040.4.3', 'dsa-with-sha1');
+_IN('1.2.840.10045.2.1', 'ecPublicKey');
+_IN('1.2.840.10045.4.3.2', 'ecdsa-with-SHA256');
+_IN('1.2.840.10045.4.3.3', 'ecdsa-with-SHA384');
+_IN('1.2.840.10045.4.3.4', 'ecdsa-with-SHA512');
+
+_IN('1.2.840.10045.3.1.1', 'p192');
+_IN('1.2.840.10045.3.1.7', 'p256');
+_IN('1.3.132.0.33', 'p224');
+_IN('1.3.132.0.34', 'p384');
+_IN('1.3.132.0.35', 'p521');
+_IN('1.3.132.0.10', 'secp256k1');
+
_IN('1.3.14.3.2.7', 'desCBC');
_IN('1.3.14.3.2.26', 'sha1');
@@ -60,6 +72,7 @@ _IN('1.2.840.113549.1.7.3', 'envelopedData');
_IN('1.2.840.113549.1.7.4', 'signedAndEnvelopedData');
_IN('1.2.840.113549.1.7.5', 'digestedData');
_IN('1.2.840.113549.1.7.6', 'encryptedData');
+_IN('2.23.136.1.1.1', 'mrtdSignatureData');
// pkcs#9 oids
_IN('1.2.840.113549.1.9.1', 'emailAddress');
diff --git a/lib/pkcs7.js b/lib/pkcs7.js
index 3a5d845c5d6d62ac9fc6195ee6ef4155ecc0619c..5a773bcce033d69ebdc73d8586c0c2258eb9419b 100644
--- a/lib/pkcs7.js
+++ b/lib/pkcs7.js
@@ -1167,7 +1167,7 @@ function _fromAsn1(msg, obj, validator) {
// Check contentType, so far we only support (raw) Data.
var contentType = asn1.derToOid(capture.contentType);
- if(contentType !== forge.pki.oids.data) {
+ if(![forge.pki.oids.data, forge.pki.oids.mrtdSignatureData].includes(contentType)) {
throw new Error('Unsupported PKCS#7 message. ' +
'Only wrapped ContentType Data supported.');
}
diff --git a/lib/rsa.js b/lib/rsa.js
index a4264822b4dcd6dca44ca3e59e410c982eed7183..8cab56a1b776e808f550ded9ef14395fa6304da1 100644
--- a/lib/rsa.js
+++ b/lib/rsa.js
@@ -70,6 +70,10 @@ require('./prime');
require('./random');
require('./util');
+var asn1Validator = require('./asn1-validator');
+var publicKeyInfoValidator = asn1Validator.publicKeyInfoValidator;
+var ecdsa = require('./ecdsa');
+
if(typeof BigInteger === 'undefined') {
var BigInteger = forge.jsbn.BigInteger;
}
@@ -226,44 +230,6 @@ var rsaPublicKeyValidator = {
}]
};
-// validator for an SubjectPublicKeyInfo structure
-// Note: Currently only works with an RSA public key
-var publicKeyValidator = forge.pki.rsa.publicKeyValidator = {
- name: 'SubjectPublicKeyInfo',
- tagClass: asn1.Class.UNIVERSAL,
- type: asn1.Type.SEQUENCE,
- constructed: true,
- captureAsn1: 'subjectPublicKeyInfo',
- value: [{
- name: 'SubjectPublicKeyInfo.AlgorithmIdentifier',
- tagClass: asn1.Class.UNIVERSAL,
- type: asn1.Type.SEQUENCE,
- constructed: true,
- value: [{
- name: 'AlgorithmIdentifier.algorithm',
- tagClass: asn1.Class.UNIVERSAL,
- type: asn1.Type.OID,
- constructed: false,
- capture: 'publicKeyOid'
- }]
- }, {
- // subjectPublicKey
- name: 'SubjectPublicKeyInfo.subjectPublicKey',
- tagClass: asn1.Class.UNIVERSAL,
- type: asn1.Type.BITSTRING,
- constructed: false,
- value: [{
- // RSAPublicKey
- name: 'SubjectPublicKeyInfo.subjectPublicKey.RSAPublicKey',
- tagClass: asn1.Class.UNIVERSAL,
- type: asn1.Type.SEQUENCE,
- constructed: true,
- optional: true,
- captureAsn1: 'rsaPublicKey'
- }]
- }]
-};
-
// validator for a DigestInfo structure
var digestInfoValidator = {
name: 'DigestInfo',
@@ -1465,36 +1431,29 @@ pki.privateKeyToAsn1 = pki.privateKeyToRSAPrivateKey = function(key) {
};
/**
- * Converts a public key from an ASN.1 SubjectPublicKeyInfo or RSAPublicKey.
+ * Converts a RSA public key from an ASN.1 SubjectPublicKeyInfo.
*
- * @param obj the asn1 representation of a SubjectPublicKeyInfo or RSAPublicKey.
+ * @param obj the asn1 representation of a SubjectPublicKeyInfo.
*
* @return the public key.
*/
-pki.publicKeyFromAsn1 = function(obj) {
- // get SubjectPublicKeyInfo
+pki.rsa.publicKeyFromAsn1 = function(obj) {
+ //var subjectPublicKey = obj.value[1].value[0];
var capture = {};
var errors = [];
- if(asn1.validate(obj, publicKeyValidator, capture, errors)) {
- // get oid
- var oid = asn1.derToOid(capture.publicKeyOid);
- if(oid !== pki.oids.rsaEncryption) {
- var error = new Error('Cannot read public key. Unknown OID.');
- error.oid = oid;
- throw error;
- }
- obj = capture.rsaPublicKey;
+ if(!asn1.validate(obj, publicKeyInfoValidator, capture, errors)) {
+ var error = new Error('Cannot read public key. ' +
+ 'ASN.1 object does not contain an PublicKeyInfo.');
+ error.errors = errors;
+ throw error;
}
-
- // get RSA params
- errors = [];
+ obj = capture.subjectPublicKey.value[0];
if(!asn1.validate(obj, rsaPublicKeyValidator, capture, errors)) {
var error = new Error('Cannot read public key. ' +
- 'ASN.1 object does not contain an RSAPublicKey.');
+ 'ASN.1 object does not contain an RSAPublicKey.');
error.errors = errors;
throw error;
}
-
// FIXME: inefficient, get a BigInteger that uses byte strings
var n = forge.util.createBuffer(capture.publicKeyModulus).toHex();
var e = forge.util.createBuffer(capture.publicKeyExponent).toHex();
@@ -1503,6 +1462,31 @@ pki.publicKeyFromAsn1 = function(obj) {
return pki.setRsaPublicKey(
new BigInteger(n, 16),
new BigInteger(e, 16));
+}
+
+/**
+ * Converts a public key from an ASN.1 SubjectPublicKeyInfo or RSAPublicKey.
+ *
+ * @param obj the asn1 representation of a SubjectPublicKeyInfo or RSAPublicKey.
+ *
+ * @return the public key.
+ */
+pki.publicKeyFromAsn1 = function(obj) {
+ // get SubjectPublicKeyInfo
+ var capture = {};
+ var errors = [];
+ // get oid
+ var oid = asn1.derToOid(obj.value[0].value[0].value);
+ switch (oid) {
+ case pki.oids.rsaEncryption:
+ return pki.rsa.publicKeyFromAsn1(obj);
+ case pki.oids.ecPublicKey:
+ return ecdsa.ECPublicKey.fromAsn1(obj);
+ default:
+ var error = new Error('Cannot read public key. Unknown OID.');
+ error.oid = oid;
+ throw error;
+ }
};
/**
diff --git a/lib/x509.js b/lib/x509.js
index b4a4f6d7a4c57bea6d986a733f360a299bd15f5f..ce83d6dec9140d7df79c0e61bfc754df44f907a8 100644
--- a/lib/x509.js
+++ b/lib/x509.js
@@ -144,8 +144,8 @@ _shortNames['E'] = oids['emailAddress'];
_shortNames['emailAddress'] = 'E';
// validator for an SubjectPublicKeyInfo structure
-// Note: Currently only works with an RSA public key
-var publicKeyValidator = forge.pki.rsa.publicKeyValidator;
+var asn1Validator = require('./asn1-validator');
+var publicKeyInfoValidator = asn1Validator.publicKeyInfoValidator;
// validator for an X.509v3 certificate
var x509CertificateValidator = {
@@ -252,7 +252,7 @@ var x509CertificateValidator = {
captureAsn1: 'certSubject'
},
// SubjectPublicKeyInfo
- publicKeyValidator,
+ publicKeyInfoValidator,
{
// issuerUniqueID (optional)
name: 'Certificate.TBSCertificate.issuerUniqueID',
@@ -427,7 +427,7 @@ var certificationRequestInfoValidator = {
captureAsn1: 'certificationRequestInfoSubject'
},
// SubjectPublicKeyInfo
- publicKeyValidator,
+ publicKeyInfoValidator,
{
name: 'CertificationRequestInfo.attributes',
tagClass: asn1.Class.CONTEXT_SPECIFIC,
@@ -706,13 +706,15 @@ var _createSignatureDigest = function(options) {
case 'md5WithRSAEncryption':
return forge.md.md5.create();
case 'sha256WithRSAEncryption':
+ case 'RSASSA-PSS':
+ case 'ecdsa-with-SHA256':
return forge.md.sha256.create();
case 'sha384WithRSAEncryption':
+ case 'ecdsa-with-SHA384':
return forge.md.sha384.create();
case 'sha512WithRSAEncryption':
+ case 'ecdsa-with-SHA512':
return forge.md.sha512.create();
- case 'RSASSA-PSS':
- return forge.md.sha256.create();
default:
var error = new Error(
'Could not compute ' + options.type + ' digest. ' +
@@ -1312,8 +1314,8 @@ pki.certificateFromAsn1 = function(obj, computeHash) {
// get oid
var oid = asn1.derToOid(capture.publicKeyOid);
- if(oid !== pki.oids.rsaEncryption) {
- throw new Error('Cannot read public key. OID is not RSA.');
+ if(![pki.oids.rsaEncryption, pki.oids.ecPublicKey].includes(oid)) {
+ throw new Error('Cannot read public key. publicKeyOid: ' + oid);
}
// create certificate
diff --git a/package.json b/package.json
index a78076c0f5020f48af7d9bf0b88ef39883374d08..b4d0074930f08c206c6071167cf43e2db0fc477e 100644
--- a/package.json
+++ b/package.json
@@ -119,5 +119,8 @@
"buffer": false,
"crypto": false,
"process": false
+ },
+ "dependencies": {
+ "elliptic": "^6.5.4"
}
}
+43 -20
View File
@@ -8,6 +8,11 @@ overrides:
'@vueuse/shared': 13.9.0 '@vueuse/shared': 13.9.0
xlsx: https://cdn.sheetjs.com/xlsx-0.20.3/xlsx-0.20.3.tgz xlsx: https://cdn.sheetjs.com/xlsx-0.20.3/xlsx-0.20.3.tgz
patchedDependencies:
node-forge@1.4.0:
hash: be4w4shpo4tldv77tcysxrioha
path: patches/node-forge@1.4.0.patch
importers: importers:
.: .:
@@ -600,6 +605,9 @@ importers:
langs: langs:
specifier: ^2.0.0 specifier: ^2.0.0
version: 2.0.0 version: 2.0.0
leaflet:
specifier: ^1.9.4
version: 1.9.4
libmime: libmime:
specifier: ^5.3.8 specifier: ^5.3.8
version: 5.3.8 version: 5.3.8
@@ -719,7 +727,7 @@ importers:
version: 1.0.23 version: 1.0.23
node-forge: node-forge:
specifier: ^1.4.0 specifier: ^1.4.0
version: 1.4.0 version: 1.4.0(patch_hash=be4w4shpo4tldv77tcysxrioha)
openai-chat-tokens: openai-chat-tokens:
specifier: ^0.2.8 specifier: ^0.2.8
version: 0.2.8 version: 0.2.8
@@ -1066,6 +1074,9 @@ importers:
'@types/jsonpath': '@types/jsonpath':
specifier: ^0.2.4 specifier: ^0.2.4
version: 0.2.4 version: 0.2.4
'@types/leaflet':
specifier: ^1.9.21
version: 1.9.21
'@types/libmime': '@types/libmime':
specifier: ^5.0.3 specifier: ^5.0.3
version: 5.0.3 version: 5.0.3
@@ -1220,8 +1231,8 @@ importers:
specifier: ^4.4.9 specifier: ^4.4.9
version: 4.4.9(@types/node@24.10.1)(less@4.2.2)(lightningcss@1.30.1)(sass@1.83.4)(terser@5.39.0) version: 4.4.9(@types/node@24.10.1)(less@4.2.2)(lightningcss@1.30.1)(sass@1.83.4)(terser@5.39.0)
vite-plugin-node-polyfills: vite-plugin-node-polyfills:
specifier: ^0.23.0 specifier: ^0.26.0
version: 0.23.0(rollup@2.79.2)(vite@4.4.9(@types/node@24.10.1)(less@4.2.2)(lightningcss@1.30.1)(sass@1.83.4)(terser@5.39.0)) version: 0.26.0(rollup@2.79.2)(vite@4.4.9(@types/node@24.10.1)(less@4.2.2)(lightningcss@1.30.1)(sass@1.83.4)(terser@5.39.0))
vite-plugin-pwa: vite-plugin-pwa:
specifier: ^1.1.0 specifier: ^1.1.0
version: 1.1.0(vite@4.4.9(@types/node@24.10.1)(less@4.2.2)(lightningcss@1.30.1)(sass@1.83.4)(terser@5.39.0))(workbox-build@7.3.0)(workbox-window@7.3.0) version: 1.1.0(vite@4.4.9(@types/node@24.10.1)(less@4.2.2)(lightningcss@1.30.1)(sass@1.83.4)(terser@5.39.0))(workbox-build@7.3.0)(workbox-window@7.3.0)
@@ -1229,8 +1240,8 @@ importers:
specifier: ^0.2.0 specifier: ^0.2.0
version: 0.2.0 version: 0.2.0
vite-plugin-wasm: vite-plugin-wasm:
specifier: ^3.4.1 specifier: ^3.6.0
version: 3.4.1(vite@4.4.9(@types/node@24.10.1)(less@4.2.2)(lightningcss@1.30.1)(sass@1.83.4)(terser@5.39.0)) version: 3.6.0(vite@4.4.9(@types/node@24.10.1)(less@4.2.2)(lightningcss@1.30.1)(sass@1.83.4)(terser@5.39.0))
vite-svg-loader: vite-svg-loader:
specifier: ^4.0.0 specifier: ^4.0.0
version: 4.0.0 version: 4.0.0
@@ -4284,6 +4295,9 @@ packages:
'@types/katex@0.16.5': '@types/katex@0.16.5':
resolution: {integrity: sha512-DD2Y3xMlTQvAnN6d8803xdgnOeYZ+HwMglb7/9YCf49J9RkJL53azf9qKa40MkEYhqVwxZ1GS2+VlShnz4Z1Bw==} resolution: {integrity: sha512-DD2Y3xMlTQvAnN6d8803xdgnOeYZ+HwMglb7/9YCf49J9RkJL53azf9qKa40MkEYhqVwxZ1GS2+VlShnz4Z1Bw==}
'@types/leaflet@1.9.21':
resolution: {integrity: sha512-TbAd9DaPGSnzp6QvtYngntMZgcRk+igFELwR2N99XZn7RXUdKgsXMR+28bUO0rPsWp8MIu/f47luLIQuSLYv/w==}
'@types/libmime@5.0.3': '@types/libmime@5.0.3':
resolution: {integrity: sha512-fJ4ISAOqnWpnojw5+Ya1Fu1lPWf3PTK9E8KwJoUnJvtTXYepuFwzE4EI4lMhbAshCVu8jLdQrWLjBZyEcFgADQ==} resolution: {integrity: sha512-fJ4ISAOqnWpnojw5+Ya1Fu1lPWf3PTK9E8KwJoUnJvtTXYepuFwzE4EI4lMhbAshCVu8jLdQrWLjBZyEcFgADQ==}
@@ -8360,6 +8374,9 @@ packages:
resolution: {integrity: sha512-DpMa59o5uGUWWjruMp71e6knmwKU3jRBBn1kjuLWN9EeIOxNeSAwvHf03WIl8g/ZMR2oSQC9ej3yeLBwdDc/pg==} resolution: {integrity: sha512-DpMa59o5uGUWWjruMp71e6knmwKU3jRBBn1kjuLWN9EeIOxNeSAwvHf03WIl8g/ZMR2oSQC9ej3yeLBwdDc/pg==}
engines: {node: '>=10.13.0'} engines: {node: '>=10.13.0'}
leaflet@1.9.4:
resolution: {integrity: sha512-nxS1ynzJOmOlHp+iL3FyWqK89GtNL8U8rvlMOsQdTTssxZwCXh8N2NB3GDQOL+YR3XnWyZAxwQixURb+FA74PA==}
less@4.2.2: less@4.2.2:
resolution: {integrity: sha512-tkuLHQlvWUTeQ3doAqnHbNn8T6WX1KA8yvbKG9x4VtKtIjHsVKQZCH11zRgAfbDAXC2UNIg/K9BYAAcEzUIrNg==} resolution: {integrity: sha512-tkuLHQlvWUTeQ3doAqnHbNn8T6WX1KA8yvbKG9x4VtKtIjHsVKQZCH11zRgAfbDAXC2UNIg/K9BYAAcEzUIrNg==}
engines: {node: '>=6'} engines: {node: '>=6'}
@@ -9081,8 +9098,8 @@ packages:
node-rsa@1.1.1: node-rsa@1.1.1:
resolution: {integrity: sha512-Jd4cvbJMryN21r5HgxQOpMEqv+ooke/korixNNK3mGqfGJmy0M77WDDzo/05969+OkMy3XW1UuZsSmW9KQm7Fw==} resolution: {integrity: sha512-Jd4cvbJMryN21r5HgxQOpMEqv+ooke/korixNNK3mGqfGJmy0M77WDDzo/05969+OkMy3XW1UuZsSmW9KQm7Fw==}
node-stdlib-browser@1.3.0: node-stdlib-browser@1.3.1:
resolution: {integrity: sha512-g/koYzOr9Fb1Jc+tHUHlFd5gODjGn48tHexUK8q6iqOVriEgSnd3/1T7myBYc+0KBVze/7F7n65ec9rW6OD7xw==} resolution: {integrity: sha512-X75ZN8DCLftGM5iKwoYLA3rjnrAEs97MkzvSd4q2746Tgpg8b8XWiBGiBG4ZpgcAqBgtgPHTiAc8ZMCvZuikDw==}
engines: {node: '>=10'} engines: {node: '>=10'}
nodemailer@6.9.16: nodemailer@6.9.16:
@@ -11278,10 +11295,10 @@ packages:
engines: {node: '>=v14.18.0'} engines: {node: '>=v14.18.0'}
hasBin: true hasBin: true
vite-plugin-node-polyfills@0.23.0: vite-plugin-node-polyfills@0.26.0:
resolution: {integrity: sha512-4n+Ys+2bKHQohPBKigFlndwWQ5fFKwaGY6muNDMTb0fSQLyBzS+jjUNRZG9sKF0S/Go4ApG6LFnUGopjkILg3w==} resolution: {integrity: sha512-BAe5YzJf368XGev02hDvioidx4uVH8dqEJlG73bjQSxM26/AQnGcKFomq9n3vGq5yqpSHKN4h1XQNxx9l98mBg==}
peerDependencies: peerDependencies:
vite: ^2.0.0 || ^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 vite: ^2.0.0 || ^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0
vite-plugin-pwa@1.1.0: vite-plugin-pwa@1.1.0:
resolution: {integrity: sha512-VsSpdubPzXhHWVINcSx6uHRMpOHVHQcHsef1QgkOlEoaIDAlssFEW88LBq1a59BuokAhsh2kUDJbaX1bZv4Bjw==} resolution: {integrity: sha512-VsSpdubPzXhHWVINcSx6uHRMpOHVHQcHsef1QgkOlEoaIDAlssFEW88LBq1a59BuokAhsh2kUDJbaX1bZv4Bjw==}
@@ -11298,10 +11315,10 @@ packages:
vite-plugin-splash-screen@0.2.0: vite-plugin-splash-screen@0.2.0:
resolution: {integrity: sha512-PCUiVq8wjx7dHMa9vOqnB+bewKp60VFbhPJJjQOA8UdwmPdf9ChBGuxh+sku4szrnJFsriB0gIDAURAmOqBcUQ==} resolution: {integrity: sha512-PCUiVq8wjx7dHMa9vOqnB+bewKp60VFbhPJJjQOA8UdwmPdf9ChBGuxh+sku4szrnJFsriB0gIDAURAmOqBcUQ==}
vite-plugin-wasm@3.4.1: vite-plugin-wasm@3.6.0:
resolution: {integrity: sha512-ja3nSo2UCkVeitltJGkS3pfQHAanHv/DqGatdI39ja6McgABlpsZ5hVgl6wuR8Qx5etY3T5qgDQhOWzc5RReZA==} resolution: {integrity: sha512-mL/QPziiIA4RAA6DkaZZzOstdwbW5jO4Vz7Zenj0wieKWBlNvIvX5L5ljum9lcUX0ShNfBgCNLKTjNkRVVqcsw==}
peerDependencies: peerDependencies:
vite: ^2 || ^3 || ^4 || ^5 || ^6 vite: ^2 || ^3 || ^4 || ^5 || ^6 || ^7 || ^8
vite-svg-loader@4.0.0: vite-svg-loader@4.0.0:
resolution: {integrity: sha512-0MMf1yzzSYlV4MGePsLVAOqXsbF5IVxbn4EEzqRnWxTQl8BJg/cfwIzfQNmNQxZp5XXwd4kyRKF1LytuHZTnqA==} resolution: {integrity: sha512-0MMf1yzzSYlV4MGePsLVAOqXsbF5IVxbn4EEzqRnWxTQl8BJg/cfwIzfQNmNQxZp5XXwd4kyRKF1LytuHZTnqA==}
@@ -15482,6 +15499,10 @@ snapshots:
'@types/katex@0.16.5': {} '@types/katex@0.16.5': {}
'@types/leaflet@1.9.21':
dependencies:
'@types/geojson': 7946.0.16
'@types/libmime@5.0.3': '@types/libmime@5.0.3':
dependencies: dependencies:
'@types/node': 24.10.1 '@types/node': 24.10.1
@@ -19848,7 +19869,7 @@ snapshots:
jks-js@1.1.4: jks-js@1.1.4:
dependencies: dependencies:
node-forge: 1.4.0 node-forge: 1.4.0(patch_hash=be4w4shpo4tldv77tcysxrioha)
node-int64: 0.4.0 node-int64: 0.4.0
node-rsa: 1.1.1 node-rsa: 1.1.1
@@ -20102,6 +20123,8 @@ snapshots:
lead@4.0.0: {} lead@4.0.0: {}
leaflet@1.9.4: {}
less@4.2.2: less@4.2.2:
dependencies: dependencies:
copy-anything: 2.0.6 copy-anything: 2.0.6
@@ -20871,7 +20894,7 @@ snapshots:
fetch-blob: 3.2.0 fetch-blob: 3.2.0
formdata-polyfill: 4.0.10 formdata-polyfill: 4.0.10
node-forge@1.4.0: {} node-forge@1.4.0(patch_hash=be4w4shpo4tldv77tcysxrioha): {}
node-gyp-build-optional-packages@5.2.2: node-gyp-build-optional-packages@5.2.2:
dependencies: dependencies:
@@ -20890,7 +20913,7 @@ snapshots:
dependencies: dependencies:
asn1: 0.2.6 asn1: 0.2.6
node-stdlib-browser@1.3.0: node-stdlib-browser@1.3.1:
dependencies: dependencies:
assert: 2.1.0 assert: 2.1.0
browser-resolve: 2.0.0 browser-resolve: 2.0.0
@@ -21298,7 +21321,7 @@ snapshots:
dependencies: dependencies:
base64-js: 1.5.1 base64-js: 1.5.1
ieee754: 1.2.1 ieee754: 1.2.1
node-forge: 1.4.0 node-forge: 1.4.0(patch_hash=be4w4shpo4tldv77tcysxrioha)
pdfjs-dist@4.10.38: pdfjs-dist@4.10.38:
optionalDependencies: optionalDependencies:
@@ -23460,10 +23483,10 @@ snapshots:
- supports-color - supports-color
- terser - terser
vite-plugin-node-polyfills@0.23.0(rollup@2.79.2)(vite@4.4.9(@types/node@24.10.1)(less@4.2.2)(lightningcss@1.30.1)(sass@1.83.4)(terser@5.39.0)): vite-plugin-node-polyfills@0.26.0(rollup@2.79.2)(vite@4.4.9(@types/node@24.10.1)(less@4.2.2)(lightningcss@1.30.1)(sass@1.83.4)(terser@5.39.0)):
dependencies: dependencies:
'@rollup/plugin-inject': 5.0.5(rollup@2.79.2) '@rollup/plugin-inject': 5.0.5(rollup@2.79.2)
node-stdlib-browser: 1.3.0 node-stdlib-browser: 1.3.1
vite: 4.4.9(@types/node@24.10.1)(less@4.2.2)(lightningcss@1.30.1)(sass@1.83.4)(terser@5.39.0) vite: 4.4.9(@types/node@24.10.1)(less@4.2.2)(lightningcss@1.30.1)(sass@1.83.4)(terser@5.39.0)
transitivePeerDependencies: transitivePeerDependencies:
- rollup - rollup
@@ -23481,7 +23504,7 @@ snapshots:
vite-plugin-splash-screen@0.2.0: {} vite-plugin-splash-screen@0.2.0: {}
vite-plugin-wasm@3.4.1(vite@4.4.9(@types/node@24.10.1)(less@4.2.2)(lightningcss@1.30.1)(sass@1.83.4)(terser@5.39.0)): vite-plugin-wasm@3.6.0(vite@4.4.9(@types/node@24.10.1)(less@4.2.2)(lightningcss@1.30.1)(sass@1.83.4)(terser@5.39.0)):
dependencies: dependencies:
vite: 4.4.9(@types/node@24.10.1)(less@4.2.2)(lightningcss@1.30.1)(sass@1.83.4)(terser@5.39.0) vite: 4.4.9(@types/node@24.10.1)(less@4.2.2)(lightningcss@1.30.1)(sass@1.83.4)(terser@5.39.0)
-1
View File
@@ -182,7 +182,6 @@ const themeVars = useThemeVars();
:collapsed-icon-size="22" :collapsed-icon-size="22"
:options="tools" :options="tools"
:indent="8" :indent="8"
:default-expand-all="true"
/> />
</div> </div>
</div> </div>
+10 -3
View File
@@ -92,13 +92,20 @@ function update(key: string) {
.value(); .value();
} }
else { else {
const converter = unitsconverter[converterType.value](value).from(key); const mapUnit = (unit: string) => {
// npm units-converter uses wrong symbol for miles per hour, so we need to fix it
if (converterType.value === 'speed' && unit === 'mi/h') {
return 'm/h';
}
return unit;
};
const converter = unitsconverter[converterType.value](value).from(mapUnit(key));
_.chain(units) _.chain(units)
.omit(key) .omit(mapUnit(key))
.forEach(({ unit }) => { .forEach(({ unit }) => {
try { try {
units[unit].ref = converter.to(unit).value; units[unit].ref = converter.to(mapUnit(unit)).value;
} }
catch (e: any) { catch (e: any) {
units[unit].ref = 0; units[unit].ref = 0;
+49
View File
@@ -0,0 +1,49 @@
<script setup lang="ts">
import VueMarkdown from 'vue-markdown-render';
import { useTheme } from '../ui/c-link/c-link.theme';
const linkTheme = useTheme();
const homeCustomMarkdown = ref('');
const base = import.meta.env.BASE_URL ?? '/';
const res = await fetch(`${base}home.custom.md`);
if (res.ok) {
homeCustomMarkdown.value = await res.text();
}
</script>
<template>
<div v-if="homeCustomMarkdown" class="home-custom-md">
<VueMarkdown :source="homeCustomMarkdown" />
</div>
</template>
<style scoped lang="less">
::v-deep(.home-custom-md) 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>
+4 -49
View File
@@ -3,16 +3,11 @@ import { IconDragDrop, IconHeart } from '@tabler/icons-vue';
import { useHead } from '@vueuse/head'; import { useHead } from '@vueuse/head';
import { computed, nextTick, onMounted, onUnmounted, ref } from 'vue'; import { computed, nextTick, onMounted, onUnmounted, ref } from 'vue';
import Draggable from 'vuedraggable'; import Draggable from 'vuedraggable';
import VueMarkdown from 'vue-markdown-render';
import ColoredCard from '../components/ColoredCard.vue'; import ColoredCard from '../components/ColoredCard.vue';
import ToolCard from '../components/ToolCard.vue'; import ToolCard from '../components/ToolCard.vue';
import HomeCustom from './Home.custom.vue';
import { useToolStore } from '@/tools/tools.store'; import { useToolStore } from '@/tools/tools.store';
import { config } from '@/config'; import { config } from '@/config';
import { useTheme } from '../ui/c-link/c-link.theme';
const base = import.meta.env.BASE_URL ?? '/';
const homeCustomMarkdown = ref('');
const { t } = useI18n(); const { t } = useI18n();
@@ -55,9 +50,6 @@ useHead({
}); });
const favoriteTools = computed(() => toolStore.favoriteTools); const favoriteTools = computed(() => toolStore.favoriteTools);
const linkTheme = useTheme();
const isOrderingFavorites = ref(false); const isOrderingFavorites = ref(false);
window.addEventListener('contextmenu', (e) => { window.addEventListener('contextmenu', (e) => {
@@ -121,16 +113,6 @@ onMounted(() => {
); );
loadingObserver.observe(loadingIndicator); loadingObserver.observe(loadingIndicator);
} }
fetch(`${base}home.custom.md`).then((r) => {
if (r.ok) {
r.text().then((t) => {
if (t) {
homeCustomMarkdown.value = t;
}
});
}
});
}); });
}); });
@@ -193,9 +175,9 @@ onUnmounted(() => {
</div> </div>
</div> </div>
<div v-if="homeCustomMarkdown" class="home-custom-md"> <Suspense>
<VueMarkdown :source="homeCustomMarkdown" /> <HomeCustom />
</div> </Suspense>
<h3 class="mb-5px mt-25px font-500 text-neutral-400"> <h3 class="mb-5px mt-25px font-500 text-neutral-400">
{{ $t('home.categories.allTools') }} {{ $t('home.categories.allTools') }}
@@ -249,31 +231,4 @@ onUnmounted(() => {
transform: scale(1.0); transform: scale(1.0);
} }
} }
::v-deep(.home-custom-md) 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> </style>
@@ -11,11 +11,26 @@ const amortizationCalculator = ref(new StandardAmortizationCalculator());
const currencyDisplayNames = computed(() => new Intl.DisplayNames(locale.value, { type: 'currency' })); const currencyDisplayNames = computed(() => new Intl.DisplayNames(locale.value, { type: 'currency' }));
const historicalCodes = ['AFA', 'FIM', 'ALK', 'ADP', 'ESP', 'FRF', 'AOK', 'AON', 'AOR', 'ARA', 'ARP', 'ARY',
'RUR', 'ATS', 'AYM', 'AZM', 'RUR', 'BYB', 'BYR', 'RUR', 'BEC', 'BEF', 'BEL', 'BOP', 'BAD', 'BRB', 'BRC',
'BRE', 'BRN', 'BRR', 'BGJ', 'BGK', 'BGL', 'BGN', 'BUK', 'HRD', 'HRK', 'HRK', 'CUC', 'ANG', 'CYP', 'CSJ',
'CSK', 'ECS', 'ECV', 'GQE', 'EEK', 'XEU', 'FIM', 'FRF', 'FRF', 'FRF', 'GEK', 'RUR', 'DDM', 'DEM', 'GHC',
'GHP', 'GRD', 'FRF', 'GNE', 'GNS', 'GWE', 'GWP', 'ITL', 'ISJ', 'IEP', 'ILP', 'ILR', 'ITL', 'RUR', 'RUR',
'LAJ', 'LVL', 'LVR', 'LSM', 'ZAL', 'LTL', 'LTT', 'LUC', 'LUF', 'LUL', 'MGF', 'MWK', 'MVQ', 'MLF', 'MTL',
'MTP', 'FRF', 'MRO', 'FRF', 'MXP', 'RUR', 'FRF', 'MZE', 'MZM', 'NLG', 'ANG', 'NIC', 'PEH', 'PEI', 'PEN',
'PES', 'PLZ', 'PTE', 'FRF', 'ROK', 'ROL', 'RON', 'RUR', 'FRF', 'FRF', 'FRF', 'ITL', 'STD', 'CSD', 'EUR',
'SLL', 'ANG', 'SKK', 'SIT', 'ZAL', 'SDG', 'RHD', 'ESA', 'ESB', 'ESP', 'SDD', 'SDP', 'SRG', 'SZL', 'CHC',
'RUR', 'TJR', 'IDR', 'TPE', 'TRL', 'TRY', 'RUR', 'TMM', 'UGS', 'UGW', 'UAK', 'SUR', 'USS', 'UYN', 'UYP',
'RUR', 'VEB', 'VEF', 'VEF', 'VEF', 'VNC', 'YDD', 'YUD', 'YUM', 'YUN', 'ZRN', 'ZRZ', 'ZMK', 'ZWC', 'ZWD',
'ZWD', 'ZWN', 'ZWR', 'ZWL', 'XFO', 'XRE', 'XFU'];
const supportedCurrencies = ref( const supportedCurrencies = ref(
Intl.supportedValuesOf('currency').map(value => ({ Intl.supportedValuesOf('currency')
value, .filter(value => !historicalCodes.includes(value))
label: currencyDisplayNames.value.of(value), .map(value => ({
})), value,
label: currencyDisplayNames.value.of(value),
})),
); );
const selectedCurrency = useQueryParamOrStorage({ const selectedCurrency = useQueryParamOrStorage({
@@ -141,7 +141,7 @@ async function onUpload(file: File) {
<n-space justify="center" mb-1> <n-space justify="center" mb-1>
<n-checkbox v-model:checked="includeDataUri"> <n-checkbox v-model:checked="includeDataUri">
Include data: URI prefix {{ $t('tools.base64-file-converter.texts.include-data-uri-prefix') }}
</n-checkbox> </n-checkbox>
</n-space> </n-space>
@@ -0,0 +1,55 @@
import { Buffer } from 'node:buffer';
import { expect, test } from '@playwright/test';
test.describe('Tool - Crop image', () => {
test.beforeEach(async ({ page }) => {
page.on('console', (msg) => {
// eslint-disable-next-line no-console
console.log(`[BROWSER CONSOLE] ${msg.type()}: ${msg.text()}`);
});
page.on('pageerror', (err) => {
// eslint-disable-next-line no-console
console.log(`[BROWSER ERROR] ${err.message}`);
});
await page.goto('/crop-image');
});
test('Has correct title', async ({ page }) => {
await expect(page).toHaveTitle('Crop image - IT Tools');
});
test('Upload an image and interact with crop controls', async ({ page }) => {
// Check that we start in upload mode
const fileInput = page.locator('input[type="file"]');
await expect(fileInput).toBeAttached();
// 1x1 transparent PNG buffer
const pixelPng = Buffer.from(
'iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg==',
'base64',
);
// Upload the file
await fileInput.setInputFiles({
name: 'test.png',
mimeType: 'image/png',
buffer: pixelPng,
});
// Interactive cropper grid should now be visible
const viewportBox = page.locator('.viewport-box');
await expect(viewportBox).toBeVisible();
// Check sliders exist for zooming and rotation
const sliders = page.locator('.n-slider');
await expect(sliders).toHaveCount(2);
// Export button should be visible
const exportButton = page.getByRole('button', { name: /Export & Download Cropped Image/i });
await expect(exportButton).toBeVisible();
// Change image button should be visible
const changeImageButton = page.getByRole('button', { name: /Change Image/i });
await expect(changeImageButton).toBeVisible();
});
});
@@ -0,0 +1,47 @@
import { describe, expect, it } from 'vitest';
import { getBaseDimensions, getViewportDimensions } from './crop-image.service';
describe('crop-image service utilities', () => {
describe('getViewportDimensions', () => {
it('calculates landscape/square ratios correctly', () => {
// 1:1 ratio
const sq = getViewportDimensions(1, 400, 400);
expect(sq).toEqual({ width: 400, height: 400 });
// 2:1 ratio (landscape)
const ls = getViewportDimensions(2, 400, 400);
expect(ls).toEqual({ width: 400, height: 200 });
});
it('calculates portrait ratios correctly', () => {
// 1:2 ratio (portrait)
const pt = getViewportDimensions(0.5, 400, 400);
expect(pt).toEqual({ width: 200, height: 400 });
});
});
describe('getBaseDimensions', () => {
it('returns viewport dimensions when natural dimensions are zero or missing', () => {
const fallback = getBaseDimensions(300, 200, 0, 0);
expect(fallback).toEqual({ width: 300, height: 200 });
});
it('calculates cover dimensions for landscape image in portrait viewport', () => {
// Image: 800x600 (4:3 landscape, ratio 1.33)
// Viewport: 300x400 (3:4 portrait, ratio 0.75)
// Image should fit to height (400) and scale width to 400 * 1.3333 = 533.33
const cover = getBaseDimensions(300, 400, 800, 600);
expect(cover.height).toBe(400);
expect(cover.width).toBeCloseTo(533.33, 1);
});
it('calculates cover dimensions for portrait image in landscape viewport', () => {
// Image: 600x800 (3:4 portrait, ratio 0.75)
// Viewport: 400x300 (4:3 landscape, ratio 1.33)
// Image should fit to width (400) and scale height to 400 / 0.75 = 533.33
const cover = getBaseDimensions(400, 300, 600, 800);
expect(cover.width).toBe(400);
expect(cover.height).toBeCloseTo(533.33, 1);
});
});
});
@@ -0,0 +1,52 @@
/**
* Calculates viewport dimensions bounded by max width and height.
*/
export function getViewportDimensions(
ratio: number,
maxWidth: number = 450,
maxHeight: number = 450,
): { width: number; height: number } {
if (ratio >= 1) {
return {
width: maxWidth,
height: maxWidth / ratio,
};
}
else {
return {
width: maxHeight * ratio,
height: maxHeight,
};
}
}
/**
* Calculates base dimensions of the image when fit to cover the viewport.
*/
export function getBaseDimensions(
vW: number,
vH: number,
naturalWidth: number,
naturalHeight: number,
): { width: number; height: number } {
if (!naturalWidth || !naturalHeight) {
return { width: vW, height: vH };
}
const vRatio = vW / vH;
const iRatio = naturalWidth / naturalHeight;
if (iRatio > vRatio) {
// Landscape relative to viewport
return {
width: vH * iRatio,
height: vH,
};
}
else {
// Portrait relative to viewport
return {
width: vW,
height: vW / iRatio,
};
}
}
+608
View File
@@ -0,0 +1,608 @@
<script setup lang="ts">
import { computed, nextTick, ref, watch } from 'vue';
import { useI18n } from 'vue-i18n';
import { useElementSize } from '@vueuse/core';
import {
Download,
FlipHorizontal,
FlipVertical,
Focus,
Maximize,
Refresh,
Rotate,
RotateClockwise,
} from '@vicons/tabler';
import { getBaseDimensions, getViewportDimensions } from './crop-image.service';
const { t } = useI18n();
// Image references
const imageSrc = ref<string | null>(null);
const fileName = ref<string>('image');
const fileType = ref<string>('image/png');
// Image dimensions and position
const imgNaturalWidth = ref(0);
const imgNaturalHeight = ref(0);
const zoom = ref(1.0);
const rotation = ref(0); // in degrees
const offsetX = ref(0);
const offsetY = ref(0);
const flipH = ref(false);
const flipV = ref(false);
// Background and UI settings
const backgroundColor = ref('#00000000'); // hex or rgba/hsla
const aspectRatio = ref<string>('1'); // presets: '1', '1.777777778' (16:9), '0.5625' (9:16), '1.333333333' (4:3), '1.5' (3:2), 'original', 'free'
const customRatioWidth = ref(4);
const customRatioHeight = ref(3);
const showGrid = ref(true);
// Export settings
const exportFormat = ref<'png' | 'jpeg' | 'webp'>('png');
const exportQuality = ref(0.9);
const exportWidthMode = ref<'original' | 'viewport' | 'custom'>('original');
const customExportWidth = ref(1024);
// Dragging state
const isDragging = ref(false);
let startPointerX = 0;
let startPointerY = 0;
let startOffsetX = 0;
let startOffsetY = 0;
// Presets for aspect ratios
const aspectRatioOptions = computed(() => [
{ label: t('tools.crop-image.texts.ratio-square'), value: '1' },
{ label: t('tools.crop-image.texts.ratio-widescreen'), value: '1.777777778' },
{ label: t('tools.crop-image.texts.ratio-portrait'), value: '0.5625' },
{ label: t('tools.crop-image.texts.ratio-standard'), value: '1.333333333' },
{ label: t('tools.crop-image.texts.ratio-photo'), value: '1.5' },
{ label: t('tools.crop-image.texts.ratio-original'), value: 'original' },
{ label: t('tools.crop-image.texts.ratio-custom'), value: 'free' },
]);
const exportFormatOptions = [
{ label: 'PNG', value: 'png' },
{ label: 'JPEG', value: 'jpeg' },
{ label: 'WebP', value: 'webp' },
];
const exportWidthOptions = computed(() => [
{ label: t('tools.crop-image.texts.width-original'), value: 'original' },
{ label: t('tools.crop-image.texts.width-viewport'), value: 'viewport' },
{ label: t('tools.crop-image.texts.width-custom'), value: 'custom' },
]);
// Computed aspect ratio value
const currentRatio = computed(() => {
if (aspectRatio.value === 'original') {
if (imgNaturalWidth.value && imgNaturalHeight.value) {
return imgNaturalWidth.value / imgNaturalHeight.value;
}
return 1;
}
if (aspectRatio.value === 'free') {
const w = customRatioWidth.value || 1;
const h = customRatioHeight.value || 1;
return w / h;
}
return Number.parseFloat(aspectRatio.value);
});
// Viewport width and height (max bounded inside 450x450 box)
const maxViewportWidth = 450;
const maxViewportHeight = 450;
const viewportDimensions = computed(() => {
return getViewportDimensions(currentRatio.value, maxViewportWidth, maxViewportHeight);
});
// Container ref and scale calculations for small viewports
const containerRef = ref<HTMLElement | null>(null);
const { width: containerWidth } = useElementSize(containerRef);
const scale = computed(() => {
if (!containerWidth.value || !viewportDimensions.value.width) {
return 1;
}
const maxWidth = Math.max(0, containerWidth.value - 8);
return Math.min(1, maxWidth / viewportDimensions.value.width);
});
// Image base dimensions when fitting cover
const baseDimensions = computed(() => {
return getBaseDimensions(
viewportDimensions.value.width,
viewportDimensions.value.height,
imgNaturalWidth.value,
imgNaturalHeight.value,
);
});
// Reset image to center with cover scale
function resetPosition() {
zoom.value = 1.0;
rotation.value = 0;
flipH.value = false;
flipV.value = false;
const vW = viewportDimensions.value.width;
const vH = viewportDimensions.value.height;
const bW = baseDimensions.value.width;
offsetX.value = (vW - bW) / 2;
offsetY.value = (vH - baseDimensions.value.height) / 2;
}
// Fit image entirely inside viewport
function fitToViewport() {
if (!imgNaturalWidth.value || !imgNaturalHeight.value) {
return;
}
rotation.value = 0;
flipH.value = false;
flipV.value = false;
const vW = viewportDimensions.value.width;
const vH = viewportDimensions.value.height;
const iRatio = imgNaturalWidth.value / imgNaturalHeight.value;
const vRatio = vW / vH;
let bW = 0;
if (iRatio > vRatio) {
// Fit width
bW = vW;
}
else {
// Fit height
bW = vH * iRatio;
}
zoom.value = bW / baseDimensions.value.width;
offsetX.value = (vW - baseDimensions.value.width * zoom.value) / 2;
offsetY.value = (vH - baseDimensions.value.height * zoom.value) / 2;
}
// Reset when image changes or viewport ratio changes
watch([imageSrc, aspectRatio], () => {
nextTick(() => {
resetPosition();
});
});
// Drag and drop image upload
function onUpload(file: File) {
if (!file) {
return;
}
fileName.value = file.name;
fileType.value = file.type;
const reader = new FileReader();
reader.onload = (e) => {
if (e.target?.result) {
const img = new Image();
img.onload = () => {
imgNaturalWidth.value = img.naturalWidth;
imgNaturalHeight.value = img.naturalHeight;
imageSrc.value = e.target!.result as string;
};
img.src = e.target.result as string;
}
};
reader.readAsDataURL(file);
}
// Handle mouse/touch drag events
function handlePointerDown(e: MouseEvent | TouchEvent) {
if (!imageSrc.value) {
return;
}
e.preventDefault();
isDragging.value = true;
const clientX = 'touches' in e ? e.touches[0].clientX : e.clientX;
const clientY = 'touches' in e ? e.touches[0].clientY : e.clientY;
startPointerX = clientX;
startPointerY = clientY;
startOffsetX = offsetX.value;
startOffsetY = offsetY.value;
window.addEventListener('mousemove', handlePointerMove);
window.addEventListener('mouseup', handlePointerUp);
window.addEventListener('touchmove', handlePointerMove, { passive: false });
window.addEventListener('touchend', handlePointerUp);
}
function handlePointerMove(e: MouseEvent | TouchEvent) {
if (!isDragging.value) {
return;
}
const clientX = 'touches' in e ? e.touches[0].clientX : e.clientX;
const clientY = 'touches' in e ? e.touches[0].clientY : e.clientY;
const dx = (clientX - startPointerX) / scale.value;
const dy = (clientY - startPointerY) / scale.value;
offsetX.value = startOffsetX + dx;
offsetY.value = startOffsetY + dy;
}
function handlePointerUp() {
isDragging.value = false;
window.removeEventListener('mousemove', handlePointerMove);
window.removeEventListener('mouseup', handlePointerUp);
window.removeEventListener('touchmove', handlePointerMove);
window.removeEventListener('touchend', handlePointerUp);
}
// Mouse wheel zoom
function handleWheel(e: WheelEvent) {
if (!imageSrc.value) {
return;
}
e.preventDefault();
const zoomStep = 0.05;
let newZoom = zoom.value;
if (e.deltaY < 0) {
newZoom = Math.min(zoom.value + zoomStep, 10.0);
}
else {
newZoom = Math.max(zoom.value - zoomStep, 0.05);
}
zoom.value = newZoom;
}
// Draw to Canvas & Trigger Download
function exportImage() {
if (!imageSrc.value) {
return;
}
const img = new Image();
img.onload = () => {
const vW = viewportDimensions.value.width;
const vH = viewportDimensions.value.height;
let canvasWidth = vW;
let canvasHeight = vH;
if (exportWidthMode.value === 'original') {
const bW = baseDimensions.value.width;
const scaleFactor = imgNaturalWidth.value / bW;
canvasWidth = vW * scaleFactor;
canvasHeight = vH * scaleFactor;
}
else if (exportWidthMode.value === 'custom') {
canvasWidth = customExportWidth.value;
canvasHeight = customExportWidth.value / currentRatio.value;
}
const canvas = document.createElement('canvas');
canvas.width = canvasWidth;
canvas.height = canvasHeight;
const ctx = canvas.getContext('2d');
if (!ctx) {
return;
}
// Background color
if (backgroundColor.value !== '#00000000') {
ctx.fillStyle = backgroundColor.value;
ctx.fillRect(0, 0, canvasWidth, canvasHeight);
}
else {
ctx.clearRect(0, 0, canvasWidth, canvasHeight);
}
// Replicate CSS: transform-origin center center on an element of size (bW x bH)
// CSS computes: T(origin) · translate(ox, oy) · rotate(r) · scale(sx, sy) · T(-origin)
// We scale from viewport coordinates to canvas coordinates first.
const scaleFactor = canvasWidth / vW;
const bW = baseDimensions.value.width;
const bH = baseDimensions.value.height;
const ox = offsetX.value;
const oy = offsetY.value;
const r = rotation.value * Math.PI / 180;
const sx = zoom.value * (flipH.value ? -1 : 1);
const sy = zoom.value * (flipV.value ? -1 : 1);
ctx.save();
ctx.scale(scaleFactor, scaleFactor); // viewport → canvas coords
ctx.translate(bW / 2, bH / 2); // T(origin)
ctx.translate(ox, oy); // CSS translate
ctx.rotate(r); // CSS rotate
ctx.scale(sx, sy); // CSS scale (includes flip)
ctx.translate(-bW / 2, -bH / 2); // T(-origin)
ctx.drawImage(img, 0, 0, bW, bH); // draw at element's natural position
ctx.restore();
// Trigger Download
const mime = exportFormat.value === 'jpeg' ? 'image/jpeg' : exportFormat.value === 'webp' ? 'image/webp' : 'image/png';
const extension = exportFormat.value;
const dataUrl = canvas.toDataURL(mime, exportQuality.value);
const link = document.createElement('a');
link.href = dataUrl;
let baseName = fileName.value || 'image';
if (baseName.includes('.')) {
baseName = baseName.substring(0, baseName.lastIndexOf('.'));
}
link.download = `${baseName}_cropped.${extension}`;
link.click();
};
img.src = imageSrc.value;
}
</script>
<template>
<div>
<!-- Drop Zone Mode -->
<c-card v-if="!imageSrc">
<div flex flex-col items-center justify-center gap-6 py-12>
<c-file-upload
accept="image/*"
:title="t('tools.crop-image.texts.drag-drop')"
w-full
@file-upload="onUpload"
/>
</div>
</c-card>
<!-- Interactive Cropper Mode -->
<n-grid v-else cols="1 900:12" x-gap="24" y-gap="24">
<!-- Left Column: Viewport & Canvas transformations -->
<n-gi span="1 900:5">
<c-card>
<div w-full flex flex-col items-center>
<div ref="containerRef" w-full flex items-center justify-center>
<div
class="viewport-box-wrapper"
:style="{
width: `${viewportDimensions.width * scale}px`,
height: `${viewportDimensions.height * scale}px`,
display: 'flex',
justifyContent: 'center',
alignItems: 'center',
}"
>
<div
class="viewport-box relative cursor-move select-none overflow-hidden border-2 border-gray-300 rounded-lg shadow-lg transition-all duration-200 dark:border-gray-600"
:style="{
width: `${viewportDimensions.width}px`,
height: `${viewportDimensions.height}px`,
transform: `scale(${scale})`,
transformOrigin: 'center center',
flexShrink: 0,
backgroundColor,
}"
@mousedown="handlePointerDown"
@touchstart="handlePointerDown"
@wheel="handleWheel"
>
<!-- Transparent checkerboard background -->
<div
v-if="backgroundColor === '#00000000' || backgroundColor.includes('rgba(') && backgroundColor.endsWith(', 0)')"
class="checkerboard-bg pointer-events-none absolute inset-0"
/>
<!-- The transformable image -->
<img
:src="imageSrc"
class="pointer-events-none absolute"
:style="{
width: `${baseDimensions.width}px`,
height: `${baseDimensions.height}px`,
transform: `translate(${offsetX}px, ${offsetY}px) rotate(${rotation}deg) scale(${zoom * (flipH ? -1 : 1)}, ${zoom * (flipV ? -1 : 1)})`,
transformOrigin: 'center center',
}"
>
<!-- 3x3 rule of thirds grid overlay -->
<div
v-if="showGrid"
class="grid-overlay pointer-events-none absolute inset-0 grid grid-cols-3 grid-rows-3 border border-white/20"
>
<div class="border-b border-r border-white/20 border-dashed" />
<div class="border-b border-r border-white/20 border-dashed" />
<div class="border-b border-white/20 border-dashed" />
<div class="border-b border-r border-white/20 border-dashed" />
<div class="border-b border-r border-white/20 border-dashed" />
<div class="border-b border-white/20 border-dashed" />
<div class="border-r border-white/20 border-dashed" />
<div class="border-r border-white/20 border-dashed" />
<div />
</div>
</div>
</div>
</div>
<!-- Viewport Hint -->
<div mt-3 text-center text-xs text-gray-400>
{{ t('tools.crop-image.texts.drag-hint', { zoom: Math.round(zoom * 100) }) }}
</div>
<!-- Quick Action Transform Buttons -->
<div mt-5 flex flex-wrap justify-center gap-2>
<c-button size="small" @click="rotation -= 90">
<n-icon :component="Rotate" class="mr-1" />
-90°
</c-button>
<c-button size="small" @click="rotation += 90">
<n-icon :component="RotateClockwise" class="mr-1" />
+90°
</c-button>
<c-button size="small" @click="flipH = !flipH">
<n-icon :component="FlipHorizontal" class="mr-1" />
{{ t('tools.crop-image.texts.flip-h') }}
</c-button>
<c-button size="small" @click="flipV = !flipV">
<n-icon :component="FlipVertical" class="mr-1" />
{{ t('tools.crop-image.texts.flip-v') }}
</c-button>
<c-button size="small" @click="resetPosition">
<n-icon :component="Focus" class="mr-1" />
{{ t('tools.crop-image.texts.reset') }}
</c-button>
<c-button size="small" @click="fitToViewport">
<n-icon :component="Maximize" class="mr-1" />
{{ t('tools.crop-image.texts.fit') }}
</c-button>
</div>
</div>
</c-card>
</n-gi>
<!-- Right Column: Settings, Customizer and Download actions -->
<n-gi span="1 900:7">
<c-card>
<div flex flex-col gap-6>
<!-- Header actions -->
<div flex items-center justify-between border-b border-gray-200 pb-4 dark:border-gray-700>
<div text-lg font-bold class="max-w-220px truncate">
{{ fileName }}
</div>
<c-button type="warning" size="small" @click="imageSrc = null">
<n-icon :component="Refresh" class="mr-1" />
{{ t('tools.crop-image.texts.change-image') }}
</c-button>
</div>
<n-form label-placement="left" label-width="140" label-align="right">
<!-- Aspect Ratio Presets -->
<n-form-item :label="t('tools.crop-image.texts.aspect-ratio')">
<c-select
v-model:value="aspectRatio"
:options="aspectRatioOptions"
w-full
/>
</n-form-item>
<!-- Custom Aspect Ratio Inputs -->
<n-form-item v-if="aspectRatio === 'free'" :label="t('tools.crop-image.texts.custom-ratio')">
<div w-full flex items-center gap-3>
<n-input-number v-model:value="customRatioWidth" :min="1" placeholder="W" class="flex-1" />
<span font-bold text-gray-400>:</span>
<n-input-number v-model:value="customRatioHeight" :min="1" placeholder="H" class="flex-1" />
</div>
</n-form-item>
<!-- Background Color Picker -->
<n-form-item :label="t('tools.crop-image.texts.background-color')">
<div w-full flex items-center gap-4>
<n-color-picker v-model:value="backgroundColor" :modes="['hex', 'rgba']" class="flex-1" />
<c-button size="small" @click="backgroundColor = '#00000000'">
{{ t('tools.crop-image.texts.transparent') }}
</c-button>
</div>
</n-form-item>
<!-- Interactive Zoom Slider -->
<n-form-item :label="t('tools.crop-image.texts.zoom-image')">
<div w-full flex items-center gap-4>
<n-slider v-model:value="zoom" :min="0.1" :max="5" :step="0.01" class="flex-1" />
<span w-50px text-right font-mono>{{ Math.round(zoom * 100) }}%</span>
</div>
</n-form-item>
<!-- Interactive Rotation Slider -->
<n-form-item :label="t('tools.crop-image.texts.rotate-image')">
<div w-full flex items-center gap-4>
<n-slider v-model:value="rotation" :min="-180" :max="180" :step="1" class="flex-1" />
<span w-50px text-right font-mono>{{ rotation }}°</span>
</div>
</n-form-item>
<!-- Toggle Grid lines -->
<n-form-item :label="t('tools.crop-image.texts.rule-of-thirds-grid')">
<n-switch v-model:value="showGrid" />
</n-form-item>
</n-form>
<n-divider class="my-2" />
<div text-md mb-2 font-bold>
{{ t('tools.crop-image.texts.export-settings') }}
</div>
<n-form label-placement="left" label-width="140" label-align="right">
<!-- Export Format select -->
<n-form-item :label="t('tools.crop-image.texts.export-format')">
<c-select
v-model:value="exportFormat"
:options="exportFormatOptions"
w-full
/>
</n-form-item>
<!-- Quality slider for lossy formats -->
<n-form-item v-if="exportFormat === 'jpeg' || exportFormat === 'webp'" :label="t('tools.crop-image.texts.image-quality')">
<div w-full flex items-center gap-4>
<n-slider v-model:value="exportQuality" :min="0.1" :max="1" :step="0.05" class="flex-1" />
<span w-50px text-right font-mono>{{ Math.round(exportQuality * 100) }}%</span>
</div>
</n-form-item>
<!-- Export width options -->
<n-form-item :label="t('tools.crop-image.texts.export-width')">
<c-select
v-model:value="exportWidthMode"
:options="exportWidthOptions"
w-full
/>
</n-form-item>
<!-- Custom Export Width Input -->
<n-form-item v-if="exportWidthMode === 'custom'" :label="t('tools.crop-image.texts.custom-width')">
<n-input-number v-model:value="customExportWidth" :min="10" :max="10000" w-full />
</n-form-item>
</n-form>
<!-- Big Download/Cropped Image Button -->
<c-button type="primary" size="large" class="mt-4 w-full" @click="exportImage">
<n-icon :component="Download" class="mr-2 text-lg" />
{{ t('tools.crop-image.texts.export-download-image') }}
</c-button>
</div>
</c-card>
</n-gi>
</n-grid>
</div>
</template>
<style lang="less" scoped>
.viewport-box {
background-color: #f3f4f6;
}
.checkerboard-bg {
background-image:
linear-gradient(45deg, #e5e7eb 25%, transparent 25%),
linear-gradient(-45deg, #e5e7eb 25%, transparent 25%),
linear-gradient(45deg, transparent 75%, #e5e7eb 75%),
linear-gradient(-45deg, transparent 75%, #e5e7eb 75%);
background-size: 16px 16px;
background-position: 0 0, 0 8px, 8px -8px, -8px 0px;
:deep(.dark) &, .dark & {
background-image:
linear-gradient(45deg, #374151 25%, transparent 25%),
linear-gradient(-45deg, #374151 25%, transparent 25%),
linear-gradient(45deg, transparent 75%, #374151 75%),
linear-gradient(-45deg, transparent 75%, #374151 75%);
}
}
.grid-overlay {
& > div {
box-sizing: border-box;
}
}
</style>
+14
View File
@@ -0,0 +1,14 @@
import { Crop } from '@vicons/tabler';
import { defineTool } from '../tool';
import { translate } from '@/plugins/i18n.plugin';
export const tool = defineTool({
name: translate('tools.crop-image.title'),
path: '/crop-image',
description: translate('tools.crop-image.description'),
keywords: ['crop', 'image', 'resize', 'canvas'],
component: () => import('./crop-image.vue'),
icon: Crop,
createdAt: new Date('2026-06-06'),
category: 'Images',
});
@@ -29,6 +29,13 @@ describe('data-storage-unit-converter', () => {
expect(convertStorageAndRateUnitsDisplay({ value: 1, fromUnit: 'Mb', toUnit: 'KB', precision: 0 })).toBe('125'); 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: 125, fromUnit: 'KB', toUnit: 'Mb', precision: 0 })).toBe('1');
expect(convertStorageAndRateUnitsDisplay({ value: 8, fromUnit: 'b', toUnit: 'B' })).toBe('1.000');
expect(convertStorageAndRateUnitsDisplay({ value: 1, fromUnit: 'B', toUnit: 'b' })).toBe('8.000');
expect(convertStorageAndRateUnitsDisplay({ value: 8000, fromUnit: 'b', toUnit: 'KB' })).toBe('1.000');
expect(convertStorageAndRateUnitsDisplay({ value: 1000, fromUnit: 'iB', toUnit: 'b' })).toBe('8000.000');
expect(convertStorageAndRateUnitsDisplay({ value: 1, fromUnit: 'KiB', toUnit: 'b' })).toBe('8192.000');
expect(convertStorageAndRateUnitsDisplay({ value: 1, fromUnit: 'KB', toUnit: 'iB' })).toBe('1000.000');
expect(convertStorageAndRateUnitsDisplay({ value: 1, fromUnit: 'MiB', toUnit: 'Kb' })).toBe('8388.608'); expect(convertStorageAndRateUnitsDisplay({ value: 1, fromUnit: 'MiB', toUnit: 'Kb' })).toBe('8388.608');
expect(convertStorageAndRateUnitsDisplay({ value: 8388.608, fromUnit: 'Kb', toUnit: 'MiB', precision: 0 })).toBe('1'); expect(convertStorageAndRateUnitsDisplay({ value: 8388.608, fromUnit: 'Kb', toUnit: 'MiB', precision: 0 })).toBe('1');
}); });
@@ -32,11 +32,11 @@ export function convertStorageAndRateUnits(
]; ];
const fromIndex = units.indexOf(fromUnit); const fromIndex = units.indexOf(fromUnit);
const fromFactor = fromIndex / 9 > 1 ? 1000 : 1024; const fromFactor = fromIndex / 9 >= 1 ? 1000 : 1024;
const fromDivisor = fromIndex / 9 > 2 ? 8 : 1; const fromDivisor = fromIndex / 9 >= 2 ? 8 : 1;
const toIndex = units.indexOf(toUnit); const toIndex = units.indexOf(toUnit);
const toFactor = toIndex / 9 > 1 ? 1000 : 1024; const toFactor = toIndex / 9 >= 1 ? 1000 : 1024;
const toDivisor = toIndex / 9 > 2 ? 8 : 1; const toDivisor = toIndex / 9 >= 2 ? 8 : 1;
const fromBase = (fromFactor ** (fromIndex % 9)) / fromDivisor; const fromBase = (fromFactor ** (fromIndex % 9)) / fromDivisor;
const toBase = (toFactor ** (toIndex % 9)) / toDivisor; const toBase = (toFactor ** (toIndex % 9)) / toDivisor;
@@ -0,0 +1,306 @@
<script setup lang="ts">
import { useITStorage, useQueryParamOrStorage } from '@/composable/queryParams';
import { Base64 } from 'js-base64';
const serverHost = useITStorage('dns-prop:url', 'http://localhost:8000');
const serverAuth = useITStorage('dns-prop:auth', '');
const loading = ref(false);
async function api(path: string, params: Record<string, string | number | boolean> = {}) {
const pathParams = new URLSearchParams();
Object.entries(params).forEach(([k, v]) => pathParams.append(k, v?.toString() || ''));
const url = `${serverHost.value}${path}?${pathParams.toString()}`;
const response = await fetch(url,
serverAuth.value
? {
method: 'GET',
headers: { Authorization: `Basic ${Base64.encode(serverAuth.value)}` },
}
: undefined);
if (!response.ok) {
const text = await response.text();
throw new Error(text || 'Server error');
}
return await response.json();
}
const builtinResolvers = [
{ name: 'Google', ip: '8.8.8.8' },
{ name: 'Google', ip: '8.8.4.4' },
{ name: 'Cloudflare', ip: '1.1.1.1' },
{ name: 'Cloudflare', ip: '1.0.0.1' },
{ name: 'Quad9', ip: '9.9.9.9' },
{ name: 'Quad9', ip: '149.112.112.112' },
{ name: 'OpenDNS', ip: '208.67.222.222' },
{ name: 'OpenDNS', ip: '208.67.220.220' },
{ name: 'CleanBrowsing', ip: '185.228.168.9' },
{ name: 'CleanBrowsing', ip: '185.228.169.9' },
// Europe
{ name: 'DNS.Watch', ip: '84.200.69.80' },
{ name: 'DNS.Watch', ip: '84.200.70.40' },
{ name: 'FreeDNS', ip: '37.235.1.174' },
{ name: 'FreeDNS', ip: '37.235.1.177' },
{ name: 'FDN France', ip: '80.67.169.12' },
{ name: 'FDN France', ip: '80.67.169.40' },
{ name: 'Neustar EU', ip: '156.154.70.1' },
{ name: 'Neustar EU', ip: '156.154.71.1' },
// North America
{ name: 'Level3', ip: '209.244.0.3' },
{ name: 'Level3', ip: '209.244.0.4' },
{ name: 'Comodo', ip: '8.26.56.26' },
{ name: 'Comodo', ip: '8.20.247.20' },
{ name: 'CenturyLink', ip: '205.171.3.65' },
{ name: 'CenturyLink', ip: '205.171.2.65' },
// Asia-Pacific
{ name: 'DNSPod', ip: '119.29.29.29' },
{ name: 'AliDNS', ip: '223.5.5.5' },
{ name: 'AliDNS', ip: '223.6.6.6' },
{ name: 'Yandex', ip: '77.88.8.8' },
{ name: 'Yandex', ip: '77.88.8.1' },
{ name: 'Naver Korea', ip: '125.209.222.141' },
{ name: 'Naver Korea', ip: '125.209.249.1' },
// South America
{ name: 'GigaDNS Brazil', ip: '189.38.95.95' },
{ name: 'GigaDNS Brazil', ip: '189.38.95.96' },
// Africa
{ name: 'OpenDNS Africa', ip: '196.3.132.153' },
{ name: 'OpenDNS Africa', ip: '196.3.132.154' },
];
interface Resolver {
ip: string
name: string
}
const customResolvers = useITStorage<Resolver[]>('dns-prop:cust', []);
const resolvers = computed(() => [
...builtinResolvers,
...customResolvers.value,
]);
const propDomain = useQueryParamOrStorage({ name: 'domain', storageName: 'dns-prop:d', defaultValue: '' });
const propType = useQueryParamOrStorage({ name: 'type', storageName: 'dns-prop:t', defaultValue: 'A' });
const selectedResolvers = ref<string[]>([]);
interface DNSQueryResult {
ok: boolean
domain: string
record_type: string
answers?: string[] | null
error?: string | null
}
type Result = Record<string, { status: 'checking' | 'success' | 'error'; result?: DNSQueryResult }>;
const propResults = reactive<Result>({});
// -------------------- Custom DNS Resolvers --------------------
const newResolverName = ref('');
const newResolverIp = ref('');
function addCustomResolver() {
if (!newResolverName.value || !newResolverIp.value) {
return;
}
customResolvers.value.push({
name: newResolverName.value,
ip: newResolverIp.value,
});
newResolverName.value = '';
newResolverIp.value = '';
}
function removeCustomResolver(ip: string) {
customResolvers.value = customResolvers.value.filter(r => r.ip !== ip);
}
async function runPropagation() {
Object.assign(propResults, {});
for (const ip of selectedResolvers.value) {
propResults[ip] = {
status: 'checking',
};
}
loading.value = true;
const allPromises: Promise<void>[] = [];
for (const ip of selectedResolvers.value) {
allPromises.push((async () => {
try {
const dnsResult = await api('/dns-query', {
domain: propDomain.value,
record_type: propType.value,
resolver_ip: ip,
});
propResults[ip] = {
status: dnsResult.ok ? 'success' : 'error',
result: dnsResult,
};
}
catch (err: any) {
propResults[ip] = {
status: 'error',
result: {
ok: false,
domain: propDomain.value,
record_type: propType.value,
error: err.toString(),
},
};
}
})());
}
Promise.all(allPromises).then(() => {
loading.value = false;
});
}
</script>
<template>
<div>
<details mb-2>
<summary>Network Utilities Service Configuration (self hosted)</summary>
<n-card>
<NFormItem label="Network Utilities Service Url:" label-placement="top">
<NInput v-model:value="serverHost" placeholder="http://localhost:3000" />
</NFormItem>
<NFormItem label="Basic Authentication:" label-placement="left" label-width="auto">
<NInput v-model:value="serverAuth" placeholder="username:password" />
</NFormItem>
<n-p>
You must self host Network Utilities Service. See:
<c-link href="https://github.com/sharevb/network-utils-ws#running-in-docker" target="_blank">
Network Utilities Service docker install
</c-link>
</n-p>
</n-card>
</details>
<n-tabs type="line" animated>
<n-tab-pane name="propagation" tab="DNS Propagation">
<n-form>
<c-input-text v-model:value="propDomain" label="Domain:" label-position="left" placeholder="example.com" mb-1 />
<c-select
v-model:value="propType" label="Record Type:"
mb-1
label-position="left"
:options="['A', 'AAAA', 'CNAME', 'MX', 'NS', 'TXT', 'SRV', 'SOA', 'CAA', 'DS', 'DNSKEY'].map(x => ({ label: x, value: x }))"
/>
<n-card title="Resolvers to Check" mb-2>
<n-space justify="center" mb-1 gap-1>
<n-button size="tiny" @click="selectedResolvers = resolvers.map(r => r.ip)">
Select All
</n-button>
<n-button size="tiny" @click="selectedResolvers = []">
Deselect All
</n-button>
</n-space>
<n-checkbox-group v-model:value="selectedResolvers">
<n-space wrap>
<n-checkbox
v-for="r in resolvers"
:key="r.ip"
:value="r.ip"
>
{{ r.name }} <em>({{ r.ip }})</em>
</n-checkbox>
</n-space>
</n-checkbox-group>
</n-card>
<n-space justify="center" mb-1>
<n-button type="primary" :disabled="!propDomain || !propType || !selectedResolvers.length || loading" :loading="loading" @click="runPropagation">
Check Propagation
</n-button>
</n-space>
</n-form>
<n-card v-if="Object.keys(propResults).length" title="Results">
<table>
<thead>
<tr>
<th>Resolver</th>
<th>Resolver IP</th>
<th>Status</th>
<th>Answers</th>
</tr>
</thead>
<tbody>
<tr v-for="(res, ip) in propResults" :key="ip">
<td>{{ resolvers.find(r => r.ip === ip)?.name || ip }}</td>
<td>{{ ip }}</td>
<td>
<n-tag :type="res.status === 'success' ? 'success' : res.status === 'error' ? 'error' : 'default'">
{{ res.status }}
</n-tag>
</td>
<td>
<div v-if="res.result?.error" style="color: red;">
{{ res.result.error }}
</div>
<div v-else-if="res.status === 'checking'">
Checking...
</div>
<ul v-else-if="res.result?.answers">
<li v-for="(a, idx) in res.result.answers" :key="idx">
{{ a }}
</li>
</ul>
<div v-else>
No answers
</div>
</td>
</tr>
</tbody>
</table>
</n-card>
</n-tab-pane>
<n-tab-pane name="custom-resolvers" tab="Custom Resolvers">
<n-card title="Add Custom Resolver">
<c-input-text v-model:value="newResolverName" label="Resolver Name:" label-width="120px" label-position="left" placeholder="Resolver name (e.g. My DNS)" mb-1 />
<c-input-text v-model:value="newResolverIp" label="Resolver IP:" label-width="120px" label-position="left" placeholder="Resolver IP (e.g. 10.0.0.1)" mb-1 />
<n-space justify="center" mb-1>
<n-button type="primary" @click="addCustomResolver">
Add Resolver
</n-button>
</n-space>
</n-card>
<n-card v-if="customResolvers.length" title="Your Custom Resolvers">
<div
v-for="r in customResolvers"
:key="r.ip"
>
<div style="display:flex; justify-content:space-between; align-items:center;">
<div>{{ r.name }} — {{ r.ip }}</div>
<n-button type="error" size="tiny" @click="removeCustomResolver(r.ip)">
Remove
</n-button>
</div>
</div>
</n-card>
<n-card v-else>
No custom resolvers added yet.
</n-card>
</n-tab-pane>
</n-tabs>
</div>
</template>
+14
View File
@@ -0,0 +1,14 @@
import { World } from '@vicons/tabler';
import { defineTool } from '../tool';
export const tool = defineTool({
name: 'DNS Propagation Tester',
path: '/dns-propagation-tester',
description: 'A simple tool for testing DNS propagation across different servers.',
keywords: ['dns', 'propagation', 'tester'],
component: () => import('./dns-propagation-tester.vue'),
icon: World,
createdAt: new Date('2026-05-11'),
category: 'Forensic',
externAccessDescription: 'This tool calls your Self Host Network Utilities Service to perform DNS queries.',
});
+478
View File
@@ -0,0 +1,478 @@
<script setup lang="ts">
import { useITStorage } from '@/composable/queryParams';
import { Base64 } from 'js-base64';
const serverHost = useITStorage('https-tester:url', 'http://localhost:8000');
const serverAuth = useITStorage('https-tester:auth', '');
const loading = ref(false);
const error = ref<string | null>(null);
async function api(path: string, params: Record<string, string | number | boolean> = {}) {
error.value = null;
loading.value = true;
try {
const pathParams = new URLSearchParams();
Object.entries(params).forEach(([k, v]) => pathParams.append(k, v?.toString() || ''));
const url = `${serverHost.value}${path}?${pathParams.toString()}`;
const response = await fetch(url,
serverAuth.value
? {
method: 'GET',
headers: { Authorization: `Basic ${Base64.encode(serverAuth.value)}` },
}
: undefined);
if (!response.ok) {
const text = await response.text();
throw new Error(text || 'Server error');
}
return await response.json();
}
catch (err: any) {
error.value = err.toString();
}
finally {
loading.value = false;
}
}
type AnyDict = Record<string, any>;
interface DNSQueryResult {
ok: boolean
domain: string
record_type: string
answers?: string[] | null
error?: string | null
}
interface WhoisResult {
ok: boolean
domain: string
raw?: string | null
parsed?: AnyDict | null
error?: string | null
}
interface DNSSECResult {
ok: boolean
domain: string
validated: boolean
dnskey?: string | null
rrsig?: string | null
error?: string | null
}
interface ReverseDNSResult {
ok: boolean
ip: string
ptr?: string | null
error?: string | null
}
interface AXFRResult {
ok: boolean
domain: string
soa?: string | null
axfr_allowed: boolean
records?: string[] | null
error?: string | null
}
function prettyJSON(value: unknown): string {
try {
return JSON.stringify(value, null, 2);
}
catch {
return String(value);
}
}
const dnsTypes = [
{ value: 'A', label: 'A — IPv4 address' },
{ value: 'AAAA', label: 'AAAA — IPv6 address' },
{ value: 'AFSDB', label: 'AFSDB — AFS database location' },
{ value: 'APL', label: 'APL — Address prefix list' },
{ value: 'CAA', label: 'CAA — Certificate Authority Authorization' },
{ value: 'CDNSKEY', label: 'CDNSKEY — Child DNSKEY' },
{ value: 'CDS', label: 'CDS — Child DS' },
{ value: 'CERT', label: 'CERT — Certificate storage' },
{ value: 'CNAME', label: 'CNAME — Canonical name' },
{ value: 'CSYNC', label: 'CSYNC — Child-to-parent sync' },
{ value: 'DHCID', label: 'DHCID — DHCP identifier' },
{ value: 'DLV', label: 'DLV — DNSSEC Lookaside Validation (obsolete)' },
{ value: 'DNAME', label: 'DNAME — Non-terminal rename' },
{ value: 'DNSKEY', label: 'DNSKEY — DNSSEC public key' },
{ value: 'DS', label: 'DS — Delegation signer' },
{ value: 'EUI48', label: 'EUI48 — MAC address (48-bit)' },
{ value: 'EUI64', label: 'EUI64 — MAC address (64-bit)' },
{ value: 'HINFO', label: 'HINFO — Host information' },
{ value: 'HIP', label: 'HIP — Host identity protocol' },
{ value: 'HTTPS', label: 'HTTPS — HTTPS service binding' },
{ value: 'IPSECKEY', label: 'IPSECKEY — IPsec key' },
{ value: 'KEY', label: 'KEY — Security key (obsolete)' },
{ value: 'KX', label: 'KX — Key exchanger' },
{ value: 'LOC', label: 'LOC — Geographic location' },
{ value: 'MX', label: 'MX — Mail exchanger' },
{ value: 'NAPTR', label: 'NAPTR — Regex-based rewrite' },
{ value: 'NS', label: 'NS — Name server' },
{ value: 'NSEC', label: 'NSEC — DNSSEC denial of existence' },
{ value: 'NSEC3', label: 'NSEC3 — Hashed denial of existence' },
{ value: 'NSEC3PARAM', label: 'NSEC3PARAM — NSEC3 parameters' },
{ value: 'OPENPGPKEY', label: 'OPENPGPKEY — OpenPGP public key' },
{ value: 'PTR', label: 'PTR — Reverse lookup pointer' },
{ value: 'RRSIG', label: 'RRSIG — DNSSEC signature' },
{ value: 'RP', label: 'RP — Responsible person' },
{ value: 'SIG', label: 'SIG — Signature (obsolete)' },
{ value: 'SMIMEA', label: 'SMIMEA — S/MIME cert association' },
{ value: 'SOA', label: 'SOA — Start of authority' },
{ value: 'SPF', label: 'SPF — Sender Policy Framework (deprecated)' },
{ value: 'SRV', label: 'SRV — Service locator' },
{ value: 'SSHFP', label: 'SSHFP — SSH public key fingerprint' },
{ value: 'SVCB', label: 'SVCB — Service binding' },
{ value: 'TA', label: 'TA — Trust anchor (experimental)' },
{ value: 'TKEY', label: 'TKEY — Secret key agreement' },
{ value: 'TLSA', label: 'TLSA — DANE TLS association' },
{ value: 'TSIG', label: 'TSIG — Transaction signature' },
{ value: 'TXT', label: 'TXT — Text record' },
{ value: 'URI', label: 'URI — URI template' },
{ value: 'ZONEMD', label: 'ZONEMD — Zone message digest' },
];
const resolverIP = ref('');
const dnsDomain = ref('');
const dnsType = ref('A');
const dnsResult = ref<DNSQueryResult | null>(null);
const whoisDomain = ref('');
const whoisResult = ref<WhoisResult | null>(null);
const dnssecDomain = ref('');
const dnssecResult = ref<DNSSECResult | null>(null);
const reverseIp = ref('');
const reverseResult = ref<ReverseDNSResult | null>(null);
const axfrDomain = ref('');
const axfrResult = ref<AXFRResult | null>(null);
async function runDns() {
dnsResult.value = await api('/dns-query', {
domain: dnsDomain.value,
record_type: dnsType.value,
resolver_ip: resolverIP.value,
});
}
async function runWhois() {
whoisResult.value = await api('/whois', { domain: whoisDomain.value });
}
async function runDnssec() {
dnssecResult.value = await api('/dnssec', {
domain: dnssecDomain.value,
resolver_ip: resolverIP.value,
});
}
async function runReverse() {
reverseResult.value = await api('/reverse-dns', {
ip: reverseIp.value,
resolver_ip: resolverIP.value,
});
}
async function runAxfr() {
axfrResult.value = await api('/soa-axfr', {
domain: axfrDomain.value,
resolver_ip: resolverIP.value,
});
}
const labelProps = {
'label-position': 'left',
'label-width': '150px',
};
</script>
<template>
<div style="min-height: 80vh;">
<details mb-2>
<summary>Network Utilities Service Configuration (self hosted)</summary>
<n-card>
<NFormItem label="Network Utilities Service Url:" label-placement="top">
<NInput v-model:value="serverHost" placeholder="http://localhost:3000" />
</NFormItem>
<NFormItem label="Basic Authentication:" label-placement="left" label-width="auto">
<NInput v-model:value="serverAuth" placeholder="username:password" />
</NFormItem>
<n-p>
You must self host Network Utilities Service. See:
<c-link href="https://github.com/sharevb/network-utils-ws#running-in-docker" target="_blank">
Network Utilities Service docker install
</c-link>
</n-p>
</n-card>
</details>
<NFormItem label="Target DNS Resolver IP:" label-placement="left">
<NInput v-model:value="resolverIP" placeholder="8.8.8.8 or leave empty for default /etc/resolv.conf DNS configuration" />
</NFormItem>
<n-tabs type="line" animated>
<!-- DNS QUERY -->
<n-tab-pane name="dns" tab="DNS Query" style="min-height: 80vh;">
<c-input-text v-model:value="dnsDomain" label="Domain:" v-bind="labelProps" placeholder="example.com" mb-1 />
<c-select
v-model:value="dnsType"
label="DNS Record type:"
v-bind="labelProps"
:options="dnsTypes"
mb-1
/>
<div mb-2 flex justify-center>
<n-button :loading="loading" @click="runDns">
Query DNS
</n-button>
</div>
<n-card v-if="dnsResult" title="Result">
<n-space justify="center" mb-1>
<n-tag :type="dnsResult.ok ? 'success' : 'error'" size="small">
{{ dnsResult.ok ? 'OK' : 'FAILED' }}
</n-tag>
</n-space>
<input-copyable label="Domain" v-bind="labelProps" :value="dnsResult.domain" mb-1 />
<input-copyable label="Record type" v-bind="labelProps" :value="dnsResult.record_type" mb-1 />
<n-card v-if="dnsResult.answers" title="Answers" mb-1>
<textarea-copyable
v-if="dnsResult.answers"
:value="dnsResult.answers.join('\n')"
mb-1
/>
</n-card>
<n-alert
v-if="dnsResult.error"
type="error"
:bordered="false"
show-icon
>
{{ dnsResult.error }}
</n-alert>
</n-card>
<c-alert v-if="error">
{{ error }}
</c-alert>
</n-tab-pane>
<!-- WHOIS -->
<n-tab-pane name="whois" tab="WHOIS">
<c-input-text v-model:value="whoisDomain" label="Domain:" v-bind="labelProps" placeholder="example.com" mb-1 />
<div mb-2 flex justify-center>
<n-button type="primary" :loading="loading" @click="runWhois">
Lookup WHOIS
</n-button>
</div>
<n-card v-if="whoisResult" title="Result">
<n-space justify="center" mb-1>
<n-tag :type="whoisResult.ok ? 'success' : 'error'" size="small" mb-1>
{{ whoisResult.ok ? 'OK' : 'FAILED' }}
</n-tag>
</n-space>
<input-copyable label="Domain" v-bind="labelProps" :value="whoisResult.domain" mb-1 />
<textarea-copyable
v-if="whoisResult.raw"
label="Raw WHOIS"
:value="whoisResult.raw"
mb-1
/>
<textarea-copyable
v-if="whoisResult.parsed"
label="Parsed"
:value="prettyJSON(whoisResult.parsed)"
language="json"
mb-1
/>
<n-alert
v-if="whoisResult.error"
type="error"
:bordered="false"
show-icon
>
{{ whoisResult.error }}
</n-alert>
</n-card>
<c-alert v-if="error">
{{ error }}
</c-alert>
</n-tab-pane>
<!-- DNSSEC -->
<n-tab-pane name="dnssec" tab="DNSSEC Validation">
<c-input-text v-model:value="dnssecDomain" label="Domain:" v-bind="labelProps" placeholder="example.com" mb-1 />
<div mb-2 flex justify-center>
<n-button type="primary" :loading="loading" @click="runDnssec">
Validate DNSSEC
</n-button>
</div>
<n-card v-if="dnssecResult" title="Result">
<n-space justify="center" mb-1>
<n-tag :type="dnssecResult.ok ? 'success' : 'error'" size="small" mb-1>
{{ dnssecResult.ok ? 'OK' : 'FAILED' }}
</n-tag>
</n-space>
<input-copyable label="Domain" v-bind="labelProps" :value="dnssecResult.domain" mb-1 />
<input-copyable
label="Validated"
v-bind="labelProps"
:value="dnssecResult.validated ? 'Yes' : 'No'"
mb-1
/>
<input-copyable
v-if="dnssecResult.dnskey"
label="DNSKEY"
v-bind="labelProps"
:value="dnssecResult.dnskey"
mb-1
/>
<input-copyable
v-if="dnssecResult.rrsig"
label="RRSIG"
v-bind="labelProps"
:value="dnssecResult.rrsig"
mb-1
/>
<n-alert
v-if="dnssecResult.error"
type="error"
:bordered="false"
show-icon
>
{{ dnssecResult.error }}
</n-alert>
</n-card>
<c-alert v-if="error">
{{ error }}
</c-alert>
</n-tab-pane>
<!-- REVERSE DNS -->
<n-tab-pane name="reverse" tab="Reverse DNS (PTR)">
<c-input-text v-model:value="reverseIp" label="IP Address:" v-bind="labelProps" placeholder="8.8.8.8" mb-1 />
<div mb-2 flex justify-center>
<n-button type="primary" :loading="loading" @click="runReverse">
Reverse Lookup
</n-button>
</div>
<n-card v-if="reverseResult" title="Result">
<n-space justify="center" mb-1>
<n-tag :type="reverseResult.ok ? 'success' : 'error'" size="small" mb-1>
{{ reverseResult.ok ? 'OK' : 'FAILED' }}
</n-tag>
</n-space>
<input-copyable label="IP" v-bind="labelProps" :value="reverseResult.ip" mb-1 />
<input-copyable
v-if="reverseResult.ptr"
label="PTR"
v-bind="labelProps"
:value="reverseResult.ptr"
mb-1
/>
<n-alert
v-if="reverseResult.error"
type="error"
:bordered="false"
show-icon
>
{{ reverseResult.error }}
</n-alert>
</n-card>
<c-alert v-if="error">
{{ error }}
</c-alert>
</n-tab-pane>
<!-- SOA + AXFR -->
<n-tab-pane name="axfr" tab="SOA + AXFR Test">
<c-input-text v-model:value="axfrDomain" label="Domain:" v-bind="labelProps" placeholder="example.com" mb-1 />
<div mb-2 flex justify-center>
<n-button type="primary" :loading="loading" @click="runAxfr">
Run SOA + AXFR
</n-button>
</div>
<n-card v-if="axfrResult" title="Result">
<n-space justify="center" mb-1>
<n-tag :type="axfrResult.ok ? 'success' : 'error'" size="small" mb-1>
{{ axfrResult.ok ? 'OK' : 'FAILED' }}
</n-tag>
</n-space>
<input-copyable label="Domain" v-bind="labelProps" :value="axfrResult.domain" mb-1 />
<textarea-copyable
v-if="axfrResult.soa"
label="SOA"
:value="axfrResult.soa"
mb-1
/>
<input-copyable
label="AXFR allowed"
v-bind="labelProps"
:value="axfrResult.axfr_allowed ? 'Yes' : 'No'"
mb-1
/>
<textarea-copyable
v-if="axfrResult.records"
label="Records"
:value="axfrResult.records.join('\n')"
mb-1
/>
<n-alert
v-if="axfrResult.error"
type="error"
:bordered="false"
show-icon
>
{{ axfrResult.error }}
</n-alert>
</n-card>
<c-alert v-if="error">
{{ error }}
</c-alert>
</n-tab-pane>
</n-tabs>
</div>
</template>
+14
View File
@@ -0,0 +1,14 @@
import { World } from '@vicons/tabler';
import { defineTool } from '../tool';
export const tool = defineTool({
name: 'DNS Tester',
path: '/dns-tester',
description: 'A simple tool for testing DNS resolution, whois queries, and other DNS-related tasks.',
keywords: ['dns', 'tester', 'resolution', 'whois', 'lookup', 'query', 'axfr', 'zone', 'dnssec'],
component: () => import('./dns-tester.vue'),
icon: World,
createdAt: new Date('2026-05-11'),
category: 'Forensic',
externAccessDescription: 'This tool calls your Self Host Network Utilities Service to perform DNS/Whois queries and related tasks.',
});
+431 -112
View File
@@ -1,163 +1,482 @@
Docker provides the ability to package and run an application in a loosely isolated environment called a container. The isolation and security allows you to run many containers simultaneously on a given host. Containers are lightweight and contain everything needed to run the application, so you do not need to rely on what is currently installed on the host. You can easily share containers while you work, and be sure that everyone you share with gets the same container that works in the same way. Docker provides the ability to package and run an application in a loosely isolated environment called a container. The isolation and security allows you to run many containers simultaneously on a given host. Containers are lightweight and contain everything needed to run the application, so you do not need to rely on what is currently installed on the host. You can easily share containers while you work, and be sure that everyone you share with gets the same container that works in the same way.
## INSTALLATION ## Installation & Resources
## GENERAL COMMANDS - Docker Desktop (Mac, Linux, Windows): https://docs.docker.com/desktop
- Example projects using Docker: https://github.com/docker/awesome-compose
- Official documentation: https://docs.docker.com
Docker Desktop is available for Mac, Linux and Windows https://docs.docker.com/desktop ## General Commands
View example projects that use Docker
https://github.com/docker/awesome-compose
Check out our docs for information on using Docker https://docs.docker.com
## IMAGES
Docker images are a lightweight, standalone, executable package of software that includes everything needed to run an application: code, runtime, system tools, system libraries and settings.
Build an Image from a Dockerfile
Start the Docker daemon:
```bash ```bash
docker build -t <image_name> . dockerd
``` ```
Build an Image from a Dockerfile without the cache Get help with Docker (works on all subcommands, e.g. `docker run --help`):
```bash
docker build -t <image\_name> . -no-cache
```
List local images
```bash
docker images
```
Delete an Image
```bash
docker rmi <image\_name>
```
Remove all unused images
```bash
docker image prune
```
## DOCKER HUB
Docker Hub is a service provided by Docker for finding and sharing container images with your team. Learn more and find images at https://hub.docker.com
Login into Docker
```bash
docker login -u <username>
```
Publish an image to Docker Hub
```bash
docker push <username>/<image\_name>
```
Search Hub for an image
```bash
docker search <image\_name>
```
Pull an image from a Docker Hub
```bash
docker pull <image\_name>
```
Start the docker daemon
```bash
docker -d
```
Get help with Docker. Can also use -help on all subcommands
```bash ```bash
docker --help docker --help
``` ```
Display system-wide information Display system-wide information:
```bash ```bash
docker info docker info
``` ```
## CONTAINERS Show Docker version (client and server):
A container is a runtime instance of a docker image. A container will always run the same, regardless of the infrastructure. Containers isolate software from its environment and ensure that it works uniformly despite differences for instance between development and staging.
Create and run a container from an image, with a custom name:
```bash ```bash
docker run --name <container\_name> <image\_name> docker version
``` ```
Run a container with and publish a container's port(s) to the host. ## Images
Docker images are a lightweight, standalone, executable package of software that includes everything needed to run an application: code, runtime, system tools, system libraries, and settings.
Build an image from a Dockerfile in the current directory:
```bash ```bash
docker run -p <host\_port>:<container\_port> <image\_name> docker build -t <image_name> .
``` ```
Run a container in the background Build an image without using the cache:
```bash ```bash
docker run -d <image\_name> docker build -t <image_name> . --no-cache
``` ```
Start or stop an existing container: Build with a specific tag (e.g. `myapp:v1.2`):
```bash ```bash
docker start|stop <container\_name> (or <container-id>) docker build -t <image_name>:<tag> .
``` ```
Remove a stopped container: List local images:
```bash ```bash
docker rm <container\_name> docker images
``` ```
Open a shell inside a running container: Tag an image for pushing to a registry:
```bash ```bash
docker exec -it <container\_name> sh docker tag <image> <username>/<image>:<tag>
``` ```
Fetch and follow the logs of a container: Delete an image:
```bash ```bash
docker logs -f <container\_name> docker rmi <image_name>
``` ```
To inspect a running container: Remove dangling (unused) images:
```bash ```bash
docker inspect <container\_name> (or <container\_id>) docker image prune
``` ```
To list currently running containers: Remove all unused images, not just dangling:
```bash
docker image prune -a
```
Show the layers of an image:
```bash
docker history <image_name>
```
## Docker Hub
Docker Hub is a service for finding and sharing container images. Learn more at https://hub.docker.com
Log in to Docker Hub:
```bash
docker login -u <username>
```
Log out:
```bash
docker logout
```
Search Docker Hub for an image:
```bash
docker search <image_name>
```
Pull an image from Docker Hub:
```bash
docker pull <image_name>
```
Pull a specific tagged version:
```bash
docker pull <image_name>:<tag>
```
Publish an image to Docker Hub:
```bash
docker push <username>/<image_name>
```
## Containers
A container is a runtime instance of a Docker image. A container will always run the same, regardless of the infrastructure. Containers isolate software from its environment and ensure it works uniformly across development, staging, and production.
### Running containers
Create and run a container from an image:
```bash
docker run <image_name>
```
Run with a custom name:
```bash
docker run --name <container_name> <image_name>
```
Run in the background (detached):
```bash
docker run -d <image_name>
```
Run interactively with a shell:
```bash
docker run -it <image_name> bash
```
Auto-remove the container when it exits:
```bash
docker run --rm <image_name>
```
Publish a container's port to the host:
```bash
docker run -p <host_port>:<container_port> <image_name>
```
Set an environment variable:
```bash
docker run -e KEY=value <image_name>
```
Load environment variables from a file:
```bash
docker run --env-file ./env.list <image_name>
```
Mount a named volume:
```bash
docker run -v <volume_name>:/path/in/container <image_name>
```
Bind-mount the current directory:
```bash
docker run -v $(pwd):/app <image_name>
```
Set a restart policy (options: `no`, `on-failure`, `always`, `unless-stopped`):
```bash
docker run --restart unless-stopped <image_name>
```
Attach to a specific network:
```bash
docker run --network <network_name> <image_name>
```
### Managing containers
List currently running containers:
```bash ```bash
docker ps docker ps
``` ```
List all docker containers (running and stopped): List all containers (running and stopped):
```bash ```bash
docker ps --all docker ps -a
``` ```
View resource usage stats Start a stopped container:
```bash ```bash
docker container stats docker start <container_name>
``` ```
Stop a running container:
```bash
docker stop <container_name>
```
Restart a container:
```bash
docker restart <container_name>
```
Remove a stopped container:
```bash
docker rm <container_name>
```
Force-remove a running container:
```bash
docker rm -f <container_name>
```
Remove all stopped containers:
```bash
docker container prune
```
Rename a container:
```bash
docker rename <old_name> <new_name>
```
### Inspecting and interacting
Open a shell inside a running container:
```bash
docker exec -it <container_name> bash
```
Use `sh` for minimal images (e.g. alpine) that don't ship bash:
```bash
docker exec -it <container_name> sh
```
Fetch logs:
```bash
docker logs <container_name>
```
Follow logs (like `tail -f`):
```bash
docker logs -f <container_name>
```
Show only the last 100 lines:
```bash
docker logs --tail 100 <container_name>
```
Show low-level container details (JSON):
```bash
docker inspect <container_name>
```
Live resource usage stats for all containers:
```bash
docker stats
```
Show running processes inside a container:
```bash
docker top <container_name>
```
Copy a file out of a container:
```bash
docker cp <container_name>:/path/in/container ./
```
Copy a file into a container:
```bash
docker cp ./local_file <container_name>:/path/
```
Show filesystem changes since container start:
```bash
docker diff <container_name>
```
## Volumes
Volumes persist data outside the container's writable layer, so data survives container removal.
Create a named volume:
```bash
docker volume create <volume_name>
```
List volumes:
```bash
docker volume ls
```
Show details about a volume:
```bash
docker volume inspect <volume_name>
```
Remove a volume:
```bash
docker volume rm <volume_name>
```
Remove all unused volumes:
```bash
docker volume prune
```
Attach a named volume to a container (managed by Docker):
```bash
docker run -v <volume_name>:/data <image_name>
```
Bind-mount a host path into a container:
```bash
docker run -v $(pwd):/app <image_name>
```
Equivalent bind mount using the `--mount` syntax:
```bash
docker run --mount type=bind,src=$(pwd),dst=/app <image_name>
```
## Networks
Containers on the same network can reach each other by container name.
List networks:
```bash
docker network ls
```
Create a network:
```bash
docker network create <network_name>
```
Show network details:
```bash
docker network inspect <network_name>
```
Attach a running container to a network:
```bash
docker network connect <network_name> <container_name>
```
Detach a container from a network:
```bash
docker network disconnect <network_name> <container_name>
```
Remove a network:
```bash
docker network rm <network_name>
```
Remove all unused networks:
```bash
docker network prune
```
## Docker Compose
Compose runs multi-container apps from a single `compose.yaml` (or `docker-compose.yml`) file.
Start all services (foreground):
```bash
docker compose up
```
Start all services (detached):
```bash
docker compose up -d
```
Rebuild images before starting:
```bash
docker compose up --build
```
Stop and remove containers and networks:
```bash
docker compose down
```
Also remove named volumes:
```bash
docker compose down -v
```
List services in the project:
```bash
docker compose ps
```
Follow logs for all services:
```bash
docker compose logs -f
```
Follow logs for one service:
```bash
docker compose logs -f <service>
```
Build (or rebuild) services:
```bash
docker compose build
```
Pull service images:
```bash
docker compose pull
```
Open a shell in a running service:
```bash
docker compose exec <service> bash
```
Run a one-off command in a new container:
```bash
docker compose run --rm <service> <command>
```
Restart a single service:
```bash
docker compose restart <service>
```
Validate and view the resolved compose file:
```bash
docker compose config
```
## System & Cleanup
Disk usage adds up fast. These commands reclaim space.
Show disk usage (images, containers, volumes, build cache):
```bash
docker system df
```
Remove stopped containers, dangling images, and unused networks:
```bash
docker system prune
```
Also remove all unused images (not just dangling):
```bash
docker system prune -a
```
Also remove unused volumes (destructive — double-check before running):
```bash
docker system prune -a --volumes
```
Clean the build cache:
```bash
docker builder prune
```
## Quick Reference: Common Flags
| Flag | Meaning |
|------|---------|
| `-d` | Detached (run in background) |
| `-it` | Interactive + TTY (for shells) |
| `--rm` | Remove container when it exits |
| `-p host:container` | Publish a port |
| `-v src:dst` | Mount volume or bind mount |
| `-e KEY=value` | Environment variable |
| `--name` | Assign a container name |
| `--network` | Attach to a network |
| `--restart` | Restart policy (`no`, `on-failure`, `always`, `unless-stopped`) |
@@ -5,12 +5,34 @@ import { flatten } from 'flatten-anything';
import { convertFrom } from './geo-coordinates-converter.service'; import { convertFrom } from './geo-coordinates-converter.service';
import { objectArrayToData } from '@/utils/objectarray.export'; import { objectArrayToData } from '@/utils/objectarray.export';
import { useQueryParam, useQueryParamOrStorage } from '@/composable/queryParams'; import { useQueryParam, useQueryParamOrStorage } from '@/composable/queryParams';
import proj4 from 'proj4';
import L from 'leaflet';
import 'leaflet/dist/leaflet.css';
import markerIconUrl from 'leaflet/dist/images/marker-icon.png';
import markerIconRetinaUrl from 'leaflet/dist/images/marker-icon-2x.png';
import markerShadowUrl from 'leaflet/dist/images/marker-shadow.png';
L.Icon.Default.prototype.options.iconUrl = markerIconUrl;
L.Icon.Default.prototype.options.iconRetinaUrl = markerIconRetinaUrl;
L.Icon.Default.prototype.options.shadowUrl = markerShadowUrl;
L.Icon.Default.imagePath = '';
const { t } = useI18n(); const { t } = useI18n();
const decimal = reactive({
lat: 48.8566,
lng: 2.3522,
latDir: 'N',
lngDir: 'E',
});
const sourceSystem = useQueryParamOrStorage({ name: 'type', storageName: 'geo-coord-conv:t', defaultValue: 'BD09' }); const sourceSystem = useQueryParamOrStorage({ name: 'type', storageName: 'geo-coord-conv:t', defaultValue: 'BD09' });
const inputLatitude = useQueryParam({ tool: 'geo-coord-conv', name: 'lat', defaultValue: 39.915 }); const inputLatitude = useQueryParam({ tool: 'geo-coord-conv', name: 'lat', defaultValue: 48.8566 });
const inputLongitude = useQueryParam({ tool: 'geo-coord-conv', name: 'lng', defaultValue: 116.404 }); watch(inputLatitude, v => decimal.lat = v);
const inputLongitude = useQueryParam({ tool: 'geo-coord-conv', name: 'lng', defaultValue: 2.3522 });
watch(inputLongitude, v => decimal.lng = v);
const inputCSV = ref(''); const inputCSV = ref('');
const batchRows = ref<string[][]>([]); const batchRows = ref<string[][]>([]);
const resultsData = ref<Record<string, { lat: number; lng: number }>[]>([]); const resultsData = ref<Record<string, { lat: number; lng: number }>[]>([]);
@@ -24,7 +46,7 @@ const resultsDisplay = computed(() => {
output.push({ output.push({
system, system,
decimal: `${x.toFixed(6)}, ${y.toFixed(6)}`, decimal: `${x.toFixed(6)}, ${y.toFixed(6)}`,
dms: `${toDMS(x)}, ${toDMS(y)}`, dms: `${toDMSString(x)}, ${toDMSString(y)}`,
}); });
} }
return output; return output;
@@ -78,92 +100,315 @@ function downloadCsv() {
URL.revokeObjectURL(url); URL.revokeObjectURL(url);
} }
function toDMS(deg: number) { function toDMSString(deg: number) {
const d = Math.floor(deg); const d = Math.floor(deg);
const m = Math.floor((deg - d) * 60); const m = Math.floor((deg - d) * 60);
const s = (((deg - d) * 60 - m) * 60).toFixed(2); const s = (((deg - d) * 60 - m) * 60).toFixed(2);
return `${d}°${m}′${s}″`; return `${d}°${m}′${s}″`;
} }
// -----------------------------
// CONSTANTS
// -----------------------------
const latDirOptions = [
{ label: 'N', value: 'N' },
{ label: 'S', value: 'S' },
];
const lngDirOptions = [
{ label: 'E', value: 'E' },
{ label: 'W', value: 'W' },
];
const hemisphereOptions = [
{ label: t('tools.geo-coordinates-converter.texts.north'), value: 'N' },
{ label: t('tools.geo-coordinates-converter.texts.south'), value: 'S' },
];
const degree = reactive({
lat: { d: 48, m: 51, s: 23.76 },
lng: { d: 2, m: 21, s: 7.92 },
latDir: 'N',
lngDir: 'E',
});
const utm = reactive({
zone: 31,
hemisphere: 'N',
easting: 448251,
northing: 5411932,
});
const mapRef = ref<HTMLElement | null>(null);
watch(mapRef, () => initMap());
let map: L.Map;
let marker: L.Marker;
// -----------------------------
// HELPERS
// -----------------------------
function applyDir(value: number, dir: string) {
return dir === 'S' || dir === 'W' ? -Math.abs(value) : Math.abs(value);
}
function dmsToDecimal(d: number, m: number, s: number, dir: string) {
const val = d + m / 60 + s / 3600;
return applyDir(val, dir);
}
function decimalToDms(value: number) {
const abs = Math.abs(value);
const d = Math.floor(abs);
const minFloat = (abs - d) * 60;
const m = Math.floor(minFloat);
const s = (minFloat - m) * 60;
return { d, m, s };
}
function getUtmProjection(zone: number, hemisphere: string) {
return `+proj=utm +zone=${zone} ${hemisphere === 'S' ? '+south' : ''} +datum=WGS84 +units=m +no_defs`;
}
// -----------------------------
// UPDATE HANDLERS
// -----------------------------
function onDecimalChange() {
const lat = applyDir(decimal.lat, decimal.latDir);
const lng = applyDir(decimal.lng, decimal.lngDir);
inputLatitude.value = lat;
inputLongitude.value = lng;
// Update DMS
const dLat = decimalToDms(lat);
const dLng = decimalToDms(lng);
degree.lat = dLat;
degree.lng = dLng;
degree.latDir = lat >= 0 ? 'N' : 'S';
degree.lngDir = lng >= 0 ? 'E' : 'W';
// Update UTM
const zone = Math.floor((lng + 180) / 6) + 1;
const proj = getUtmProjection(zone, lat >= 0 ? 'N' : 'S');
const [easting, northing] = proj4('EPSG:4326', proj, [lng, lat]);
utm.zone = zone;
utm.hemisphere = lat >= 0 ? 'N' : 'S';
utm.easting = Math.round(easting);
utm.northing = Math.round(northing);
updateMarker();
}
function onDegreeChange() {
decimal.lat = dmsToDecimal(degree.lat.d, degree.lat.m, degree.lat.s, degree.latDir);
decimal.lng = dmsToDecimal(degree.lng.d, degree.lng.m, degree.lng.s, degree.lngDir);
decimal.latDir = degree.latDir;
decimal.lngDir = degree.lngDir;
onDecimalChange();
}
function onUtmChange() {
const proj = getUtmProjection(utm.zone, utm.hemisphere);
const [lng, lat] = proj4(proj, 'EPSG:4326', [utm.easting, utm.northing]);
decimal.lat = Number.parseFloat(lat.toFixed(6));
decimal.lng = Number.parseFloat(lng.toFixed(6));
decimal.latDir = lat >= 0 ? 'N' : 'S';
decimal.lngDir = lng >= 0 ? 'E' : 'W';
onDecimalChange();
}
function initMap() {
try {
if (!mapRef.value) {
return;
}
map = L.map(mapRef.value).setView([decimal.lat, decimal.lng], 13);
L.tileLayer('https://tile.openstreetmap.org/{z}/{x}/{y}.png', {
attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',
referrerPolicy: 'strict-origin-when-cross-origin',
}).addTo(map);
marker = L.marker([decimal.lat, decimal.lng], { draggable: true }).addTo(map);
marker.on('dragend', () => {
const pos = marker.getLatLng();
decimal.lat = Number.parseFloat(pos.lat.toFixed(6));
decimal.lng = Number.parseFloat(pos.lng.toFixed(6));
decimal.latDir = pos.lat >= 0 ? 'N' : 'S';
decimal.lngDir = pos.lng >= 0 ? 'E' : 'W';
onDecimalChange();
});
map.on('click', (e: L.LeafletMouseEvent) => {
decimal.lat = Number.parseFloat(e.latlng.lat.toFixed(6));
decimal.lng = Number.parseFloat(e.latlng.lng.toFixed(6));
decimal.latDir = e.latlng.lat >= 0 ? 'N' : 'S';
decimal.lngDir = e.latlng.lng >= 0 ? 'E' : 'W';
onDecimalChange();
});
}
catch {}
}
onMounted(() => {
initMap();
});
function updateMarker() {
marker.setLatLng([decimal.lat, decimal.lng]);
map.setView([decimal.lat, decimal.lng]);
}
</script> </script>
<template> <template>
<div> <div>
<n-radio-group v-model:value="sourceSystem" mb-2>
<n-space justify="center">
<n-radio value="WGS84">
{{ t('tools.geo-coordinates-converter.texts.tag-wgs84-wsg1984-epsg4326-global-standard') }}
</n-radio>
<n-radio value="GCJ02">
{{ t('tools.geo-coordinates-converter.texts.tag-gcj02-amap-gaode-qq-maps') }}
</n-radio>
<n-radio value="BD09">
{{ t('tools.geo-coordinates-converter.texts.tag-bd09-bd09ll-bmap-baidu-maps') }}
</n-radio>
<n-radio value="BD09MC">
{{ t('tools.geo-coordinates-converter.texts.tag-bd09mc-bd09meter-baidu-meter') }}
</n-radio>
<n-radio value="CGCS2000">
{{ t('tools.geo-coordinates-converter.texts.tag-cgcs2000-china-geodetic-system-2000') }}
</n-radio>
<n-radio value="WebMercator">
{{ t('tools.geo-coordinates-converter.texts.tag-webmercator-epsg3857-epsg900913') }}
</n-radio>
</n-space>
</n-radio-group>
<n-tabs type="card" mb-1> <n-tabs type="card" mb-1>
<n-tab-pane name="single" :tab="t('tools.geo-coordinates-converter.text.single-lat-lng-converter')"> <n-tab-pane name="coords" :tab="t('tools.geo-coordinates-converter.texts.coordinates-notations')">
<n-space justify="center"> <n-card :title="t('tools.geo-coordinates-converter.texts.decimal-notation')" mb-2>
<n-form-item :label="t('tools.geo-coordinates-converter.texts.label-latitude')" label-placement="left"> <n-form :model="decimal" label-placement="left" label-width="140">
<n-input-number-i18n v-model:value="inputLatitude" /> <n-form-item :label="t('tools.geo-coordinates-converter.texts.latitude-decimal')">
</n-form-item> <n-input-group gap-1>
<n-form-item :label="t('tools.geo-coordinates-converter.texts.label-longitude')" label-placement="left"> <n-input-number v-model:value="decimal.lat" :precision="6" @update:value="onDecimalChange" />
<n-input-number-i18n v-model:value="inputLongitude" /> <n-select v-model:value="decimal.latDir" :options="latDirOptions" style="width: 80px" @update:value="onDecimalChange" />
</n-form-item> </n-input-group>
</n-space> </n-form-item>
<n-space justify="center">
<n-button type="primary" @click="convertSingle">
{{ t('tools.geo-coordinates-converter.texts.tag-convert-single') }}
</n-button>
</n-space>
</n-tab-pane>
<n-tab-pane name="batch" :tab="t('tools.geo-coordinates-converter.text.batch-lat-lng-converter')">
<c-input-text
v-model:value="inputCSV"
:label="t('tools.geo-coordinates-converter.texts.label-csv-content-lng-lat')"
:placeholder="t('tools.geo-coordinates-converter.texts.placeholder-put-your-longitude-and-latitude-in-this-order-csv-to-convert')"
multiline
rows="5"
mb-2
/>
<n-space justify="center"> <n-form-item :label="t('tools.geo-coordinates-converter.texts.longitude-decimal')">
<n-button <n-input-group gap-1>
type="primary" <n-input-number v-model:value="decimal.lng" :precision="6" @update:value="onDecimalChange" />
@click="convertBatch" <n-select v-model:value="decimal.lngDir" :options="lngDirOptions" style="width: 80px" @update:value="onDecimalChange" />
> </n-input-group>
{{ t('tools.geo-coordinates-converter.texts.tag-convert-batch') }} </n-form-item>
</n-button> </n-form>
</n-space> </n-card>
<n-card :title="t('tools.geo-coordinates-converter.texts.dms-notation')" mb-2>
<n-form :model="degree" label-placement="left" label-width="140">
<n-form-item :label="t('tools.geo-coordinates-converter.texts.latitude-dms')">
<n-input-group gap-1>
<n-input-number v-model:value="degree.lat.d" placeholder="°" @update:value="onDegreeChange" />
<n-input-number v-model:value="degree.lat.m" placeholder="′" @update:value="onDegreeChange" />
<n-input-number v-model:value="degree.lat.s" placeholder="″" @update:value="onDegreeChange" />
<n-select v-model:value="degree.latDir" :options="latDirOptions" style="width: 80px" @update:value="onDegreeChange" />
</n-input-group>
</n-form-item>
<n-form-item :label="t('tools.geo-coordinates-converter.texts.longitude-dms')">
<n-input-group gap-1>
<n-input-number v-model:value="degree.lng.d" placeholder="°" @update:value="onDegreeChange" />
<n-input-number v-model:value="degree.lng.m" placeholder="′" @update:value="onDegreeChange" />
<n-input-number v-model:value="degree.lng.s" placeholder="″" @update:value="onDegreeChange" />
<n-select v-model:value="degree.lngDir" :options="lngDirOptions" style="width: 80px" @update:value="onDegreeChange" />
</n-input-group>
</n-form-item>
</n-form>
</n-card>
<n-card :title="t('tools.geo-coordinates-converter.texts.utm-notation')" mb-2>
<n-form :model="utm" label-placement="left" label-width="140">
<n-form-item :label="t('tools.geo-coordinates-converter.texts.utm-zone')">
<n-input-number v-model:value="utm.zone" @update:value="onUtmChange" />
</n-form-item>
<n-form-item :label="t('tools.geo-coordinates-converter.texts.hemisphere')">
<n-select v-model:value="utm.hemisphere" :options="hemisphereOptions" @update:value="onUtmChange" />
</n-form-item>
<n-form-item :label="t('tools.geo-coordinates-converter.texts.easting')">
<n-input-number v-model:value="utm.easting" @update:value="onUtmChange" />
</n-form-item>
<n-form-item :label="t('tools.geo-coordinates-converter.texts.northing')">
<n-input-number v-model:value="utm.northing" @update:value="onUtmChange" />
</n-form-item>
</n-form>
</n-card>
<div ref="mapRef" style="height: 400px; width: 100%; border-radius: 8px; overflow: hidden" />
</n-tab-pane>
<n-tab-pane name="proj" :tab="t('tools.geo-coordinates-converter.texts.decimal-projections')">
<n-radio-group v-model:value="sourceSystem" mb-2>
<n-space justify="center">
<n-radio value="WGS84">
{{ t('tools.geo-coordinates-converter.texts.tag-wgs84-wsg1984-epsg4326-global-standard') }}
</n-radio>
<n-radio value="GCJ02">
{{ t('tools.geo-coordinates-converter.texts.tag-gcj02-amap-gaode-qq-maps') }}
</n-radio>
<n-radio value="BD09">
{{ t('tools.geo-coordinates-converter.texts.tag-bd09-bd09ll-bmap-baidu-maps') }}
</n-radio>
<n-radio value="BD09MC">
{{ t('tools.geo-coordinates-converter.texts.tag-bd09mc-bd09meter-baidu-meter') }}
</n-radio>
<n-radio value="CGCS2000">
{{ t('tools.geo-coordinates-converter.texts.tag-cgcs2000-china-geodetic-system-2000') }}
</n-radio>
<n-radio value="WebMercator">
{{ t('tools.geo-coordinates-converter.texts.tag-webmercator-epsg3857-epsg900913') }}
</n-radio>
</n-space>
</n-radio-group>
<n-tabs type="card" mb-1>
<n-tab-pane name="single" :tab="t('tools.geo-coordinates-converter.text.single-lat-lng-converter')">
<n-space justify="center">
<n-form-item :label="t('tools.geo-coordinates-converter.texts.label-latitude')" label-placement="left">
<n-input-number-i18n v-model:value="inputLatitude" />
</n-form-item>
<n-form-item :label="t('tools.geo-coordinates-converter.texts.label-longitude')" label-placement="left">
<n-input-number-i18n v-model:value="inputLongitude" />
</n-form-item>
</n-space>
<n-space justify="center">
<n-button type="primary" @click="convertSingle">
{{ t('tools.geo-coordinates-converter.texts.tag-convert-single') }}
</n-button>
</n-space>
</n-tab-pane>
<n-tab-pane name="batch" :tab="t('tools.geo-coordinates-converter.text.batch-lat-lng-converter')">
<c-input-text
v-model:value="inputCSV"
:label="t('tools.geo-coordinates-converter.texts.label-csv-content-lng-lat')"
:placeholder="t('tools.geo-coordinates-converter.texts.placeholder-put-your-longitude-and-latitude-in-this-order-csv-to-convert')"
multiline
rows="5"
mb-2
/>
<n-space justify="center">
<n-button
type="primary"
@click="convertBatch"
>
{{ t('tools.geo-coordinates-converter.texts.tag-convert-batch') }}
</n-button>
</n-space>
</n-tab-pane>
</n-tabs>
<c-card v-if="resultsData?.length" :title="t('tools.geo-coordinates-converter.texts.title-conversion-results')" mb-2>
<n-data-table v-if="resultsDisplay?.length" :columns="columns" :data="resultsDisplay" bordered mb-2 />
<n-space justify="center">
<n-button
type="success"
:disabled="resultsData.length === 0"
@click="downloadCsv"
>
{{ $t('tools.geo-coordinates-converter.text.download-results-csv') }}
</n-button>
</n-space>
</c-card>
<n-alert type="info" :title="t('tools.geo-coordinates-converter.texts.title-notes')" mt-3>
{{ t('tools.geo-coordinates-converter.texts.tag-longitude-east-is-positive-west-is-negative') }}<br>{{ t('tools.geo-coordinates-converter.texts.tag-latitude-north-is-positive-south-is-negative') }}
</n-alert>
</n-tab-pane> </n-tab-pane>
</n-tabs> </n-tabs>
<c-card v-if="resultsData?.length" :title="t('tools.geo-coordinates-converter.texts.title-conversion-results')" mb-2>
<n-data-table v-if="resultsDisplay?.length" :columns="columns" :data="resultsDisplay" bordered mb-2 />
<n-space justify="center">
<n-button
type="success"
:disabled="resultsData.length === 0"
@click="downloadCsv"
>
{{ $t('tools.geo-coordinates-converter.text.download-results-csv') }}
</n-button>
</n-space>
</c-card>
<n-alert type="info" :title="t('tools.geo-coordinates-converter.texts.title-notes')" mt-3>
{{ t('tools.geo-coordinates-converter.texts.tag-longitude-east-is-positive-west-is-negative') }}<br>{{ t('tools.geo-coordinates-converter.texts.tag-latitude-north-is-positive-south-is-negative') }}
</n-alert>
</div> </div>
</template> </template>
@@ -11,4 +11,5 @@ export const tool = defineTool({
icon: IconWorldPin, icon: IconWorldPin,
createdAt: new Date('2026-01-09'), createdAt: new Date('2026-01-09'),
category: 'Converters', category: 'Converters',
externAccessDescription: 'This tool access OpenStreetMap to display the World map using the Leaflet library.',
}); });
+44 -42
View File
@@ -1,7 +1,10 @@
<script setup lang="ts"> <script setup lang="ts">
import { useI18n } from 'vue-i18n';
import { useITStorage } from '@/composable/queryParams'; import { useITStorage } from '@/composable/queryParams';
import { Base64 } from 'js-base64'; import { Base64 } from 'js-base64';
const { t } = useI18n();
const url = ref(''); const url = ref('');
const html = ref(''); const html = ref('');
const error = ref(''); const error = ref('');
@@ -26,12 +29,12 @@ const options = useITStorage('html-to-pdf:opts', {
}); });
const pdfFormats = [ const pdfFormats = [
{ label: 'A2', value: 'A2' }, { label: t('tools.html-to-pdf.texts.label-a2'), value: 'A2' },
{ label: 'A3', value: 'A3' }, { label: t('tools.html-to-pdf.texts.label-a3'), value: 'A3' },
{ label: 'A4', value: 'A4' }, { label: t('tools.html-to-pdf.texts.label-a4'), value: 'A4' },
{ label: 'A5', value: 'A5' }, { label: t('tools.html-to-pdf.texts.label-a5'), value: 'A5' },
{ label: 'Letter', value: 'Letter' }, { label: t('tools.html-to-pdf.texts.label-letter'), value: 'Letter' },
{ label: 'Legal', value: 'Legal' }, { label: t('tools.html-to-pdf.texts.label-legal'), value: 'Legal' },
]; ];
function downloadURL(data: string, fileName: string) { function downloadURL(data: string, fileName: string) {
@@ -186,28 +189,27 @@ async function generateBatch() {
<template> <template>
<div> <div>
<details mb-2> <details mb-2>
<summary>HTML to PDF Service Configuration (self hosted)</summary> <summary>{{ t('tools.html-to-pdf.texts.tag-html-to-pdf-service-configuration-self-hosted') }}</summary>
<n-card> <n-card>
<NFormItem label="HTML to PDF Service Url:" label-placement="top"> <NFormItem :label="t('tools.html-to-pdf.texts.label-html-to-pdf-service-url')" label-placement="top">
<NInput v-model:value="serverHost" placeholder="http://localhost:3000" /> <NInput v-model:value="serverHost" :placeholder="t('tools.html-to-pdf.texts.placeholder-http-localhost-3000')" />
</NFormItem> </NFormItem>
<NFormItem label="Basic Authentication:" label-placement="left" label-width="auto"> <NFormItem :label="t('tools.html-to-pdf.texts.label-basic-authentication')" label-placement="left" label-width="auto">
<NInput v-model:value="serverAuth" placeholder="username:password" /> <NInput v-model:value="serverAuth" :placeholder="t('tools.html-to-pdf.texts.placeholder-username-password')" />
</NFormItem> </NFormItem>
<n-p> <n-p>
You must self host HTML to PDF Service. See: {{ t('tools.html-to-pdf.texts.tag-you-must-self-host-html-to-pdf-service-see') }}<c-link href="https://github.com/sharevb/puppeteer-htmltopdf?tab=readme-ov-file#running-in-docker" target="_blank">
<c-link href="https://github.com/sharevb/puppeteer-htmltopdf?tab=readme-ov-file#running-in-docker" target="_blank"> {{ t('tools.html-to-pdf.texts.tag-html-to-pdf-service-install') }}
HTML to PDF Service install
</c-link> </c-link>
</n-p> </n-p>
</n-card> </n-card>
</details> </details>
<NTabs type="line"> <NTabs type="line">
<NTabPane name="url" tab="URL → PDF"> <NTabPane name="url" :tab="t('tools.html-to-pdf.texts.tab-url-pdf')">
<NForm label-placement="left"> <NForm label-placement="left">
<NFormItem label="URL:"> <NFormItem :label="t('tools.html-to-pdf.texts.label-url')">
<NInput v-model:value="url" placeholder="https://example.com" /> <NInput v-model:value="url" :placeholder="t('tools.html-to-pdf.texts.placeholder-https-example-com')" />
</NFormItem> </NFormItem>
<n-space mb-2 justify="center"> <n-space mb-2 justify="center">
@@ -217,7 +219,7 @@ async function generateBatch() {
:disabled="isRunning" :disabled="isRunning"
@click="generateFromUrl" @click="generateFromUrl"
> >
Generate PDF {{ t('tools.html-to-pdf.texts.tag-generate-pdf') }}
</NButton> </NButton>
</n-space> </n-space>
@@ -227,9 +229,9 @@ async function generateBatch() {
</NForm> </NForm>
</NTabPane> </NTabPane>
<NTabPane name="html" tab="HTML → PDF"> <NTabPane name="html" :tab="t('tools.html-to-pdf.texts.tab-html-pdf')">
<NForm label-placement="top"> <NForm label-placement="top">
<NFormItem label="HTML Content:"> <NFormItem :label="t('tools.html-to-pdf.texts.label-html-content')">
<NInput <NInput
v-model:value="html" v-model:value="html"
type="textarea" type="textarea"
@@ -244,7 +246,7 @@ async function generateBatch() {
:disabled="isRunning" :disabled="isRunning"
@click="generateFromHtml" @click="generateFromHtml"
> >
Generate PDF {{ t('tools.html-to-pdf.texts.tag-generate-pdf') }}
</NButton> </NButton>
</n-space> </n-space>
@@ -254,9 +256,9 @@ async function generateBatch() {
</NForm> </NForm>
</NTabPane> </NTabPane>
<NTabPane name="batch" tab="Batch URL → PDF"> <NTabPane name="batch" :tab="t('tools.html-to-pdf.texts.tab-batch-url-pdf')">
<NForm label-placement="top"> <NForm label-placement="top">
<NFormItem label="URLs (one per line):"> <NFormItem :label="t('tools.html-to-pdf.texts.label-urls-one-per-line')">
<NInput <NInput
v-model:value="batchUrls" v-model:value="batchUrls"
type="textarea" type="textarea"
@@ -271,7 +273,7 @@ async function generateBatch() {
:disabled="isBatchRunning" :disabled="isBatchRunning"
@click="generateBatch" @click="generateBatch"
> >
Generate PDFs {{ t('tools.html-to-pdf.texts.tag-generate-pdfs') }}
</NButton> </NButton>
</n-space> </n-space>
</NForm> </NForm>
@@ -289,11 +291,11 @@ async function generateBatch() {
</div> </div>
<!-- Results --> <!-- Results -->
<NCard v-if="batchResults.length > 0" title="Results"> <NCard v-if="batchResults.length > 0" :title="t('tools.html-to-pdf.texts.title-results')">
<n-table> <n-table>
<thead> <thead>
<th>Url</th> <th>{{ t('tools.html-to-pdf.texts.tag-url') }}</th>
<th>Download</th> <th>{{ t('tools.html-to-pdf.texts.tag-download') }}</th>
</thead> </thead>
<tbody> <tbody>
<tr <tr
@@ -311,13 +313,13 @@ async function generateBatch() {
type="success" type="success"
@click="downloadBlob(item.pdfBlob!, `${urlToFilename(item.url)}.pdf`)" @click="downloadBlob(item.pdfBlob!, `${urlToFilename(item.url)}.pdf`)"
> >
Download PDF {{ t('tools.html-to-pdf.texts.tag-download-pdf') }}
</NButton> </NButton>
</template> </template>
<template v-else> <template v-else>
<NButton size="small" type="error" disabled> <NButton size="small" type="error" disabled>
Failed {{ t('tools.html-to-pdf.texts.tag-failed') }}
</NButton> </NButton>
<div style="color: red; font-size: 12px"> <div style="color: red; font-size: 12px">
{{ item.error }} {{ item.error }}
@@ -331,52 +333,52 @@ async function generateBatch() {
</NTabPane> </NTabPane>
<!-- Custom PDF Options --> <!-- Custom PDF Options -->
<NTabPane name="custom-options" tab="Custom PDF Options"> <NTabPane name="custom-options" :tab="t('tools.html-to-pdf.texts.tab-custom-pdf-options')">
<NForm label-placement="left"> <NForm label-placement="left">
<NFormItem label="Format:"> <NFormItem :label="t('tools.html-to-pdf.texts.label-format')">
<NSelect <NSelect
v-model:value="options.format" v-model:value="options.format"
:options="pdfFormats" :options="pdfFormats"
/> />
</NFormItem> </NFormItem>
<NFormItem label="Language:"> <NFormItem :label="t('tools.html-to-pdf.texts.label-language')">
<NInput v-model:value="options.language" placeholder="en-US" /> <NInput v-model:value="options.language" :placeholder="t('tools.html-to-pdf.texts.placeholder-en-us')" />
</NFormItem> </NFormItem>
<n-space justify="center"> <n-space justify="center">
<NFormItem label="Landscape:"> <NFormItem :label="t('tools.html-to-pdf.texts.label-landscape')">
<NSwitch v-model:value="options.landscape" /> <NSwitch v-model:value="options.landscape" />
</NFormItem> </NFormItem>
<NFormItem label="One Long Page:"> <NFormItem :label="t('tools.html-to-pdf.texts.label-one-long-page')">
<NSwitch v-model:value="options.onePage" /> <NSwitch v-model:value="options.onePage" />
</NFormItem> </NFormItem>
<NFormItem label="Auto-Hide Cookie Banners:"> <NFormItem :label="t('tools.html-to-pdf.texts.label-auto-hide-cookie-banners')">
<NSwitch v-model:value="options.autoHideCookies" /> <NSwitch v-model:value="options.autoHideCookies" />
</NFormItem> </NFormItem>
<NFormItem label="Print Background:"> <NFormItem :label="t('tools.html-to-pdf.texts.label-print-background')">
<NSwitch v-model:value="options.printBackground" /> <NSwitch v-model:value="options.printBackground" />
</NFormItem> </NFormItem>
</n-space> </n-space>
<c-card title="Margins"> <c-card :title="t('tools.html-to-pdf.texts.title-margins')">
<NSpace justify="center"> <NSpace justify="center">
<NFormItem label="Top (mm):" style="width: 200px"> <NFormItem :label="t('tools.html-to-pdf.texts.label-top-mm')" style="width: 200px">
<NInputNumber v-model:value="options.margin.top" /> <NInputNumber v-model:value="options.margin.top" />
</NFormItem> </NFormItem>
<NFormItem label="Bottom (mm):" style="width: 200px"> <NFormItem :label="t('tools.html-to-pdf.texts.label-bottom-mm')" style="width: 200px">
<NInputNumber v-model:value="options.margin.bottom" /> <NInputNumber v-model:value="options.margin.bottom" />
</NFormItem> </NFormItem>
<NFormItem label="Left (mm):" style="width: 200px"> <NFormItem :label="t('tools.html-to-pdf.texts.label-left-mm')" style="width: 200px">
<NInputNumber v-model:value="options.margin.left" /> <NInputNumber v-model:value="options.margin.left" />
</NFormItem> </NFormItem>
<NFormItem label="Right (mm):" style="width: 200px"> <NFormItem :label="t('tools.html-to-pdf.texts.label-right-mm')" style="width: 200px">
<NInputNumber v-model:value="options.margin.right" /> <NInputNumber v-model:value="options.margin.right" />
</NFormItem> </NFormItem>
</NSpace> </NSpace>
+4 -3
View File
@@ -1,14 +1,15 @@
import { translate as t } from '@/plugins/i18n.plugin';
import { Printer } from '@vicons/tabler'; import { Printer } from '@vicons/tabler';
import { defineTool } from '../tool'; import { defineTool } from '../tool';
export const tool = defineTool({ export const tool = defineTool({
name: 'HTML to PDF', name: t('tools.html-to-pdf.title'),
path: '/html-to-pdf', path: '/html-to-pdf',
description: 'Generate PDF from HTML content or URL with format selection and auto hide cookie banners', description: t('tools.html-to-pdf.description'),
keywords: ['html', 'url', 'pdf'], keywords: ['html', 'url', 'pdf'],
component: () => import('./html-to-pdf.vue'), component: () => import('./html-to-pdf.vue'),
icon: Printer, icon: Printer,
createdAt: new Date('2026-04-07'), createdAt: new Date('2026-04-07'),
category: 'PDF', category: 'PDF',
externAccessDescription: 'This tool sends URLs and HTML content to the *self hosted* Puppeteer webservice configured.', externAccessDescription: t('tools.html-to-pdf.externalAccess'),
}); });
+366
View File
@@ -0,0 +1,366 @@
<script setup lang="ts">
import { useITStorage } from '@/composable/queryParams';
import { Base64 } from 'js-base64';
const serverHost = useITStorage('https-tester:url', 'http://localhost:8000');
const serverAuth = useITStorage('https-tester:auth', '');
const loading = ref(false);
const error = ref<string | null>(null);
async function api(path: string, params: Record<string, string | number | boolean> = {}) {
error.value = null;
loading.value = true;
try {
const pathParams = new URLSearchParams();
Object.entries(params).forEach(([k, v]) => pathParams.append(k, v?.toString() || ''));
const url = `${serverHost.value}${path}?${pathParams.toString()}`;
const response = await fetch(url,
serverAuth.value
? {
method: 'GET',
headers: { Authorization: `Basic ${Base64.encode(serverAuth.value)}` },
}
: undefined);
if (!response.ok) {
const text = await response.text();
throw new Error(text || 'Server error');
}
return await response.json();
}
catch (err: any) {
error.value = err.toString();
}
finally {
loading.value = false;
}
}
type AnyDict = Record<string, any>;
interface CertificateCheckResult {
ok: boolean
hostname: string
port: number
not_before?: string | null
not_after?: string | null
days_until_expiry?: number | null
subject?: AnyDict | null
issuer?: AnyDict | null
san?: any[] | null
error?: string | null
}
interface HSTSCheckResult {
ok: boolean
url: string
hsts_present: boolean
max_age?: number | null
include_subdomains: boolean
preload: boolean
raw_header?: string | null
error?: string | null
}
interface RedirectCheckResult {
ok: boolean
http_url: string
redirected: boolean
final_url?: string | null
status_code?: number | null
redirect_chain?: { status_code: number; url: string; headers: Record<string, string> }[] | null
error?: string | null
}
function prettyJSON(value: unknown): string {
try {
return JSON.stringify(value, null, 2);
}
catch {
return String(value);
}
}
function formatDate(value: string | null | undefined): string {
if (!value) {
return '';
}
const d = new Date(value);
return Number.isNaN(d.getTime()) ? value : d.toISOString();
}
const certHost = ref('');
const certPort = ref(443);
const certResult = ref<CertificateCheckResult | null>(null);
const hstsUrl = ref('');
const hstsResult = ref<HSTSCheckResult | null>(null);
const redirectDomain = ref('');
const redirectResult = ref<RedirectCheckResult | null>(null);
// -------------------- Actions --------------------
async function runCertificate() {
certResult.value = await api('/check-certificate', {
host: certHost.value,
port: certPort.value,
});
}
async function runHsts() {
hstsResult.value = await api('/check-hsts', { url: hstsUrl.value });
}
async function runRedirect() {
redirectResult.value = await api('/check-redirect', { domain: redirectDomain.value });
}
const labelProps = {
'label-position': 'left',
'label-width': '120px',
};
</script>
<template>
<div>
<details mb-2>
<summary>Network Utilities Service Configuration (self hosted)</summary>
<n-card>
<NFormItem label="Network Utilities Service Url:" label-placement="top">
<NInput v-model:value="serverHost" placeholder="http://localhost:3000" />
</NFormItem>
<NFormItem label="Basic Authentication:" label-placement="left" label-width="auto">
<NInput v-model:value="serverAuth" placeholder="username:password" />
</NFormItem>
<n-p>
You must self host Network Utilities Service. See:
<c-link href="https://github.com/sharevb/network-utils-ws#running-in-docker" target="_blank">
Network Utilities Service docker install
</c-link>
</n-p>
</n-card>
</details>
<n-tabs type="line" animated>
<n-tab-pane name="cert" tab="Certificate">
<c-input-text v-model:value="certHost" label="Host:" v-bind="labelProps" placeholder="example.com" mb-1 />
<c-input-text v-model:value="certPort" label="Port:" v-bind="labelProps" placeholder="443" mb-1 />
<div mb-2 flex justify-center>
<n-button type="primary" :loading="loading" @click="runCertificate">
Check Certificate
</n-button>
</div>
<n-card v-if="certResult" title="Result">
<n-space justify="center" mb-1>
<n-tag :type="certResult.ok ? 'success' : 'error'" size="small">
{{ certResult.ok ? 'OK' : 'FAILED' }}
</n-tag>
</n-space>
<input-copyable label="Hostname:" v-bind="labelProps" :value="certResult.hostname" mb-1 />
<input-copyable label="Port:" v-bind="labelProps" :value="certResult.port" mb-1 />
<input-copyable
label="Not before:"
v-bind="labelProps"
:value="formatDate(certResult.not_before)" mb-1
/>
<input-copyable
label="Not after:"
v-bind="labelProps"
:value="formatDate(certResult.not_after)" mb-1
/>
<input-copyable
label="Days until expiry:"
v-bind="labelProps"
:value="String(certResult.days_until_expiry)" mb-1
/>
<input-copyable
label="Subject:"
v-bind="labelProps"
:value="prettyJSON(certResult.subject)" mb-1
/>
<input-copyable
label="Issuer:"
v-bind="labelProps"
:value="prettyJSON(certResult.issuer)" mb-1
/>
<input-copyable
v-for="(san, index) in certResult.san"
:key="index"
label="Sub. Alt. Name:"
v-bind="labelProps"
:value="prettyJSON(san)" mb-1
/>
<n-alert
v-if="certResult.error"
type="error"
:bordered="false"
show-icon
>
{{ certResult.error }}
</n-alert>
</n-card>
<c-alert v-if="error">
{{ error }}
</c-alert>
</n-tab-pane>
<!-- HSTS -->
<n-tab-pane name="hsts" tab="HSTS">
<c-input-text v-model:value="hstsUrl" label="URL:" v-bind="labelProps" placeholder="https://example.com" mb-1 />
<div mb-2 flex justify-center>
<n-button type="primary" :loading="loading" @click="runHsts">
Check HSTS
</n-button>
</div>
<n-card v-if="hstsResult" title="Result">
<n-space justify="center" mb-1>
<n-tag :type="hstsResult.ok ? 'success' : 'error'" size="small" mb-1>
{{ hstsResult.ok ? 'OK' : 'FAILED' }}
</n-tag>
</n-space>
<input-copyable label="URL" v-bind="labelProps" :value="hstsResult.url" mb-1 />
<input-copyable
label="HSTS present"
v-bind="labelProps"
:value="hstsResult.hsts_present ? 'Yes' : 'No'"
mb-1
/>
<input-copyable
v-if="hstsResult.max_age"
label="Max-Age"
v-bind="labelProps"
:value="String(hstsResult.max_age)"
mb-1
/>
<input-copyable
label="Inc. subdomains"
v-bind="labelProps"
:value="hstsResult.include_subdomains ? 'Yes' : 'No'"
mb-1
/>
<input-copyable
label="Preload"
v-bind="labelProps"
:value="hstsResult.preload ? 'Yes' : 'No'"
mb-1
/>
<input-copyable
v-if="hstsResult.raw_header"
label="Raw header"
v-bind="labelProps"
:value="hstsResult.raw_header"
mb-1
/>
<n-alert
v-if="hstsResult.error"
type="error"
:bordered="false"
show-icon
>
{{ hstsResult.error }}
</n-alert>
</n-card>
<c-alert v-if="error">
{{ error }}
</c-alert>
</n-tab-pane>
<!-- REDIRECT -->
<n-tab-pane name="redirect" tab="HTTP → HTTPS Redirect">
<n-form>
<c-input-text v-model:value="redirectDomain" label="Domain:" v-bind="labelProps" placeholder="example.com" mb-1 />
<div mb-2 flex justify-center>
<n-button type="primary" :loading="loading" @click="runRedirect">
Check Redirect
</n-button>
</div>
</n-form>
<n-card v-if="redirectResult" title="Result">
<n-space justify="center" mb-1>
<n-tag :type="redirectResult.ok ? 'success' : 'error'" size="small" mb-1>
{{ redirectResult.ok ? 'OK' : 'FAILED' }}
</n-tag>
</n-space>
<input-copyable label="HTTP URL" v-bind="labelProps" :value="redirectResult.http_url" mb-1 />
<input-copyable
label="Redirected"
v-bind="labelProps"
:value="redirectResult.redirected ? 'Yes' : 'No'"
mb-1
/>
<input-copyable
label="Final URL"
v-bind="labelProps"
:value="redirectResult.final_url"
mb-1
/>
<input-copyable
label="Status code"
v-bind="labelProps"
:value="String(redirectResult.status_code)"
mb-1
/>
<input-copyable
v-if="redirectResult.redirect_chain"
label="Redirect chain:"
v-bind="labelProps"
:value="redirectResult.redirect_chain.map(r => r.url).join(' → ')"
mb-1
/>
<n-card title="Redirect chain details">
<textarea-copyable
v-if="redirectResult.redirect_chain"
label="Redirect chain"
:value="prettyJSON(redirectResult.redirect_chain)"
mb-1
/>
</n-card>
<n-alert
v-if="redirectResult.error"
type="error"
:bordered="false"
show-icon
>
{{ redirectResult.error }}
</n-alert>
</n-card>
<c-alert v-if="error">
{{ error }}
</c-alert>
</n-tab-pane>
</n-tabs>
</div>
</template>
+14
View File
@@ -0,0 +1,14 @@
import { ShieldCheck } from '@vicons/tabler';
import { defineTool } from '../tool';
export const tool = defineTool({
name: 'HTTPS Tester',
path: '/https-tester',
description: 'Validate HTTPS certificate, HSTS and 302 redirection',
keywords: ['https', 'hsts', 'redirection', 'certificate', 'tester'],
component: () => import('./https-tester.vue'),
icon: ShieldCheck,
createdAt: new Date('2026-05-11'),
category: 'Forensic',
externAccessDescription: 'This tool calls your Self Host Network Utilities Service to perform HTTPS/HSTS related tasks.',
});
+15
View File
@@ -0,0 +1,15 @@
import { Braces } from '@vicons/tabler';
import { defineTool } from '../tool';
import { translate as t } from '@/plugins/i18n.plugin';
export const tool = defineTool({
name: t('tools.json-to-env.title'),
path: '/json-to-env',
description: t('tools.json-to-env.description'),
keywords: ['json', 'to', 'env', 'dotenv', 'convert', 'environment', 'variables'],
component: () => import('./json-to-env.vue'),
icon: Braces,
createdAt: new Date('2026-04-17'),
npmPackages: ['json5'],
category: 'JSON',
});
@@ -0,0 +1,27 @@
import { expect, test } from '@playwright/test';
test.describe('Tool - JSON to .env', () => {
test.beforeEach(async ({ page }) => {
await page.goto('/json-to-env');
});
test('Has correct title', async ({ page }) => {
await expect(page).toHaveTitle('JSON to .env - IT Tools');
});
test('Provided JSON is converted to .env', async ({ page }) => {
await page.getByTestId('input').fill(`{
"ACCESS_KEY": "mySecretAccessKey",
"AMQP_DNS": "amqp://a:b@rabbit/po",
"APP_ENV": "prod"
}`);
const generated = await page.getByTestId('area-content').innerText();
expect(generated.trim()).toEqual(
`ACCESS_KEY=mySecretAccessKey
AMQP_DNS=amqp://a:b@rabbit/po
APP_ENV=prod`.trim(),
);
});
});
@@ -0,0 +1,82 @@
import { describe, expect, it } from 'vitest';
import { convertJsonToEnv } from './json-to-env.service';
describe('json-to-env service', () => {
describe('convertJsonToEnv', () => {
it('converts a flat JSON object to .env lines', () => {
const json = JSON.stringify({
ACCESS_KEY: 'mySecretAccessKey',
APP_ENV: 'prod',
});
expect(convertJsonToEnv({ json })).toMatchInlineSnapshot(`
"ACCESS_KEY=mySecretAccessKey
APP_ENV=prod"
`);
});
it('uppercases keys by default', () => {
expect(convertJsonToEnv({ json: '{"app_env": "prod"}' })).toBe('APP_ENV=prod');
});
it('keeps original case when uppercaseKeys is false', () => {
expect(convertJsonToEnv({ json: '{"appEnv": "prod"}', uppercaseKeys: false })).toBe('appEnv=prod');
});
it('quotes values that contain spaces', () => {
expect(convertJsonToEnv({ json: '{"greeting": "hello world"}' })).toBe('GREETING="hello world"');
});
it('quotes values that contain double quotes and escapes them', () => {
expect(convertJsonToEnv({ json: '{"q": "he said \\"hi\\""}' })).toBe('Q="he said \\"hi\\""');
});
it('quotes values that contain # so they are not read as comments', () => {
expect(convertJsonToEnv({ json: '{"color": "#ff0000"}' })).toBe('COLOR="#ff0000"');
});
it('quotes empty string values', () => {
expect(convertJsonToEnv({ json: '{"empty": ""}' })).toBe('EMPTY=""');
});
it('converts null and undefined to empty values', () => {
expect(convertJsonToEnv({ json: '{"a": null}' })).toBe('A=""');
});
it('stringifies numbers and booleans', () => {
expect(convertJsonToEnv({ json: '{"port": 8080, "debug": true}' })).toMatchInlineSnapshot(`
"PORT=8080
DEBUG=true"
`);
});
it('serializes nested objects and arrays as JSON strings', () => {
const result = convertJsonToEnv({ json: '{"list": [1, 2, 3], "obj": {"a": 1}}' });
expect(result).toMatchInlineSnapshot(`
"LIST=\\"[1,2,3]\\"
OBJ=\\"{\\\\\\"a\\\\\\":1}\\""
`);
});
it('escapes newlines in values', () => {
expect(convertJsonToEnv({ json: '{"multi": "line1\\nline2"}' })).toBe('MULTI="line1\\nline2"');
});
it('returns empty string on empty input', () => {
expect(convertJsonToEnv({ json: '' })).toBe('');
expect(convertJsonToEnv({ json: ' ' })).toBe('');
});
it('throws when JSON is an array', () => {
expect(() => convertJsonToEnv({ json: '[1, 2, 3]' })).toThrow();
});
it('throws when JSON is a primitive', () => {
expect(() => convertJsonToEnv({ json: '"just a string"' })).toThrow();
});
it('throws on invalid JSON', () => {
expect(() => convertJsonToEnv({ json: '{not json}' })).toThrow();
});
});
});
@@ -0,0 +1,49 @@
import JSON5 from 'json5';
export { convertJsonToEnv };
function serializeValue(value: unknown): { value: string; forceQuote: boolean } {
if (value === null || value === undefined) {
return { value: '', forceQuote: true };
}
if (typeof value === 'object') {
return { value: JSON.stringify(value), forceQuote: true };
}
return { value: String(value), forceQuote: false };
}
function formatEnvValue({ value, forceQuote }: { value: string; forceQuote: boolean }): string {
const needsQuoting = forceQuote || value === '' || /[\s"'#`$\\]/.test(value);
if (!needsQuoting) {
return value;
}
const escaped = value.replace(/\\/g, '\\\\').replace(/"/g, '\\"').replace(/\n/g, '\\n').replace(/\r/g, '\\r');
return `"${escaped}"`;
}
function convertJsonToEnv({ json, uppercaseKeys = true }: { json: string; uppercaseKeys?: boolean }): string {
const trimmed = json.trim();
if (trimmed === '') {
return '';
}
const parsed = JSON5.parse(trimmed);
if (typeof parsed !== 'object' || parsed === null || Array.isArray(parsed)) {
throw new TypeError('JSON must be an object, not an array or primitive.');
}
return Object.entries(parsed)
.map(([key, value]) => {
const envKey = uppercaseKeys ? key.toUpperCase() : key;
const envValue = formatEnvValue(serializeValue(value));
return `${envKey}=${envValue}`;
})
.join('\n');
}
+46
View File
@@ -0,0 +1,46 @@
<script setup lang="ts">
import { useI18n } from 'vue-i18n';
import JSON5 from 'json5';
import { convertJsonToEnv } from './json-to-env.service';
import type { UseValidationRule } from '@/composable/validation';
import { withDefaultOnError } from '@/utils/defaults';
const { t } = useI18n();
const defaultValue = '{\n "ACCESS_KEY": "mySecretAccessKey",\n "AMQP_DNS": "amqp://a:b@rabbit/po",\n "APP_ENV": "prod"\n}';
function transformer(value: string) {
return withDefaultOnError(() => {
if (value === '') {
return '';
}
return convertJsonToEnv({ json: value });
}, '');
}
const rules: UseValidationRule<string>[] = [
{
validator: (v: string) => {
if (v === '') {
return true;
}
const parsed = JSON5.parse(v);
return typeof parsed === 'object' && parsed !== null && !Array.isArray(parsed);
},
message: t('tools.json-to-env.texts.message-provided-json-is-not-a-valid-flat-object'),
},
];
</script>
<template>
<format-transformer
:input-label="t('tools.json-to-env.texts.input-label-your-json')"
:input-default="defaultValue"
:input-placeholder="t('tools.json-to-env.texts.input-placeholder-paste-your-json-here')"
:output-label="t('tools.json-to-env.texts.output-label-env-from-your-json')"
output-language="bash"
:input-validation-rules="rules"
:transformer="transformer"
download-file-name=".env"
/>
</template>
@@ -17,7 +17,7 @@ async function onVerifyClicked(uploadedFile: File) {
status.value = 'loading'; status.value = 'loading';
try { try {
const { signatures: parsedSignatures } = verifyPDF(fileBuffer); const { signatures: parsedSignatures } = verifyPDF(fileBuffer);
signatures.value = parsedSignatures; signatures.value = parsedSignatures || [];
status.value = 'parsed'; status.value = 'parsed';
} }
catch (e) { catch (e) {
+13
View File
@@ -0,0 +1,13 @@
import { Command } from '@vicons/tabler';
import { defineTool } from '../tool';
export const tool = defineTool({
name: 'Powershell Cheatsheet',
path: '/powershell-memo',
description: 'Powershell is a powerful scripting language and command-line shell designed for system administration and automation. It provides a wide range of cmdlets and features that allow users to manage and automate tasks on Windows systems efficiently.',
keywords: ['powershell', 'memo', 'cheatsheet', 'shell'],
component: () => import('./powershell-memo.vue'),
icon: Command,
createdAt: new Date('2026-05-11'),
category: 'Cheatsheets',
});
@@ -0,0 +1,220 @@
## Variables
| Syntax | Description |
|-------|-------------|
| `$var = "string"` | Assign variable |
| `[Type]$var="typedVar"` | Assign strong typed variable |
| `[ValidateRange(1,9)][int]$x=1` | Strong typed attribute‑controlled variable |
| `$a,$b,$c = 0` or `$a,$b = 'a','b'` | Assign multiple variables |
| `$a,$b = $b,$a` | Flip variables |
| *Scopes* | global, local, private, script |
| `$global:var = "var"` | Assign global scoped variable |
## Arrays
| Syntax | Description |
|--------|-------------|
| `"a","b","c"` | Array of strings |
| `@()` | Empty array |
| `1,(2,3),4` | Array within array |
| `,"hi"` | Array of one element |
| `$arr[5]` | Sixth element |
| `$arr[2..20]` | Elements 3–21 |
| `$arr[-1]` | Last element |
| `$arr[-3..-1]` | Last three elements |
| `$arr[1,4+6..9]` | Elements at positions 1,4,6–9 |
| `@(Get-Process)` | Force result to array |
| `$arr[($arr.length-1)..0]` | Reverse array |
| `$arr[1] += 200` | Add to existing item |
| `$b = $arr[0,1 + 3..6]` | New array from elements |
| `$z = $arrA + $arrB` | Combine arrays |
## Hash Tables (Associative Arrays)
| Syntax | Description |
|--------|-------------|
| `$hash = @{}` | Empty hash table |
| `@{foo=1; bar='value2'}` | Initialize hash |
| `[ordered]@{a=1; b=2; c=3}` | Ordered dictionary |
| `$hash.key1 = 1` | Assign value |
| `$hash.key1` | Get value |
| `$hash["key1"]` | Get value |
| `$hash.GetEnumerator \| sort Key` | Sort by key |
| `[pscustomobject]@{x=1;z="z"}` | Custom object |
## Strings
| Syntax | Description |
|--------|-------------|
| `"$var expand"` | Expand variables |
| `'$var no expand'` | No expansion |
| `@" ... "@` | Here‑string (double quotes allow expressions) |
## Comments & Escape Characters
| Syntax | Description |
|--------|-------------|
| `# Comment` | Comment |
| `<# comment #>` | Multiline comment |
| `"A '\"test`\""` | Escape `'` |
| `` `t `` | Tab |
| `` `n `` | New line |
| `` ` `` | Line continuation |
## Basics of Text & Files
| Command | Description |
|---------|-------------|
| `Get-Location` | Current directory |
| `Set-Location` | Change directory |
| `Get-Content` | Read file |
| `Add-Content` | Append |
| `Set-Content` | Overwrite |
| `Out-File` | Formatted output |
| `Out-Null` | Discard output |
| `Out-String` | Convert to string |
| `Copy-Item` | Copy |
| `Remove-Item` | Delete |
| `Move-Item` | Move |
| `Rename-Item` | Rename |
| `Set-Item` | Set file contents |
| `Clear-Item` | Clear file |
| `New-Item` | New file/dir |
## Flow Control
| Syntax | Description |
|--------|-------------|
| `If($x -eq 5){ } elseif($x -gt 5){ } else{ }` | If |
| `$x=1; while($x -lt 10){$x;$x++}` | While |
| `for($i=0; $i -lt 10; $i++){ $i }` | For |
| `foreach($file in dir C:\){$file.Name}` | Foreach |
| `1..10 \| foreach{$_}` | Foreach pipeline |
| `Switch -options (...) { Pattern { } Default { } }` | Switch |
## Operators
### Assignment, Logical, Comparison
| Syntax | Description |
|--------|-------------|
| `= += == *= /= %= ++ --` | Assignment |
| `-and -or -xor -not !` | Logical |
| `-eq -ne` | Equal / not equal |
| `-gt -ge` | Greater than / ≥ |
| `-lt -le` | Less than / ≤ |
| `-replace` | Replace text |
| `-match -notmatch` | Regex |
| `-like -notlike` | Wildcards |
| `-contains -notcontains` | Array contains |
| `-in -notin` | Reverse contains |
## Other Operators
| Syntax | Description |
|--------|-------------|
| `-split` | Split string |
| `-join` | Join strings |
| `..` | Range |
| `-is -isnot` | Type check |
| `-as` | Cast |
| `-f` | Format strings |
| `[type]` | Cast operator |
| `$( )` | Subexpression |
| `@()` | Array subexpression |
| `&` | Invocation |
## Objects
| Syntax | Description |
|--------|-------------|
| `(Get-Date).Date` | Date property |
| `Get-Date \| Get-Member` | List members |
| `[DateTime]::Now` | Static property |
| `"string".ToUpper()` | Method call |
| `[system.Net.Dns]::GetHostByAddress("127.0.0.1")` | Static method |
| `new-object -com excel.application` | Excel COM object |
## Filter, Sort, Group, Format
| Command | Description |
|---------|-------------|
| `dir C:\pub \| where LastWriteTime -gt (Get-Date).AddDays(-1)` | Files modified yesterday |
| `ps \| where { $_.path -like "C:\windows\system32*" -and $_.company -notlike "Microsoft*" }` | Filter processes |
| `ps Explorer \| select ProcessName -ExpandProperty Modules \| format-list` | Expand modules |
| `ps \| sort WorkingSet \| select -Last 5` | Top 5 memory |
| `"a","b","a" \| select -Unique` | Unique values |
| `Get-Service \| Group-Object Status` | Group by status |
| `dir \| Group-Object { $_.Length -gt 100KB }` | Group by size |
| `Get-Content pcs.txt \| Select-String "q-" \| sls "win7"` | Search text |
| `ps \| Format-Table Name,StartTime -AutoSize` | Format table |
| `ps \| Format-Table ProcessName, @{Label="Total Run Time"; Expression={(Get-Date)-$_.StartTime}}` | Custom column |
| `Get-EventLog -Log System \| select -First 5 \| ft -wrap` | First 5 events |
| `gi C:\Users \| fl *` | All properties |
| `"{0}``t{1}``n" -f $a,5` | Format operator |
## Common Commands
- `Get-EventLog`
- `Get-WinEvent`
- `Get-CimInstance`
- `Get-Date`
- `Start-Sleep`
- `Compare-Object`
- `Start-Job`
- `Get-Credential`
- `Test-Connection`
- `New-PSSession`
- `Test-Path`
- `Split-Path`
## Importing, Exporting, Converting
- `Export-Clixml`
- `Import-Clixml`
- `ConvertTo-Xml`
- `ConvertTo-Html`
- `Export-Csv`
- `Import-Csv`
- `ConvertTo-Csv`
- `ConvertFrom-Csv`
## Automatic Variables
| Variable | Description |
|----------|-------------|
| `$_` / `$PSItem` | Pipeline object |
| `$Args` | Script args |
| `$Error` | Errors |
| `$True` / `$False` | Boolean |
| `$null` | Null |
| `$profile` | Profile paths |
## PSDrives
| Drive | Description |
|-------|-------------|
| `Alias:` | Aliases |
| `Cert:` | Certificates |
| `Env:` | Environment variables |
| `Function:` | Functions |
| `HKLM:` | Registry (Local Machine) |
| `HKCU:` | Registry (Current User) |
| `Variable:` | Variables |
| `WSMan:` | WinRM |
| `AD:` | Active Directory |
| `Set-Location HKLM:` | Navigate registry |
| `gci variable:` | List variables |
## Regular Expressions
| Pattern | Meaning |
|---------|---------|
| `\w` | Word char `[a-zA-Z0-9]` |
| `\W` | Non‑word char |
| `\s` | Whitespace |
| `\S` | Non‑whitespace |
| `\d` / `\D` | Digit / non‑digit |
| `{n} {n,} {n,m}` | Quantifiers |
| More | Google .NET Regex |
@@ -0,0 +1,32 @@
<script setup lang="ts">
import { useThemeVars } from 'naive-ui';
import Memo from './powershell-memo.content.md';
const themeVars = useThemeVars();
</script>
<template>
<div>
<Memo />
</div>
</template>
<style lang="less" scoped>
::v-deep(pre) {
margin: 0;
padding: 15px 22px;
background-color: v-bind('themeVars.cardColor');
border-radius: 4px;
overflow: auto;
}
::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>
+14
View File
@@ -0,0 +1,14 @@
import { ArrowsShuffle } from '@vicons/tabler';
import { defineTool } from '../tool';
import { translate as t } from '@/plugins/i18n.plugin';
export const tool = defineTool({
name: t('tools.random-line-picker.title'),
path: '/random-line-picker',
description: t('tools.random-line-picker.description'),
keywords: ['text', 'random', 'line', 'picker', 'shuffle'],
component: () => import('./random-line-picker.vue'),
icon: ArrowsShuffle,
createdAt: new Date('2026-05-08'),
category: 'Text',
});
@@ -0,0 +1,27 @@
import { expect, test } from '@playwright/test';
test.describe('Tool - Random Line Picker', () => {
test.beforeEach(async ({ page }) => {
await page.goto('/random-line-picker');
await expect(page.getByTestId('input')).toBeVisible();
await expect(page.getByTestId('count')).toBeVisible();
});
test('Has correct title', async ({ page }) => {
await expect(page).toHaveTitle('Random Line Picker - IT Tools');
});
test('Picks random lines without repeats', async ({ page }) => {
await page.getByTestId('input').fill('one\ntwo\nthree\nfour');
const countInput = page.getByTestId('count').locator('input');
await countInput.fill('2');
await countInput.press('Enter');
const picked = (await page.getByTestId('output').inputValue()).split('\n');
expect(picked.length).toBe(2);
expect(new Set(picked).size).toBe(2);
});
});
@@ -0,0 +1,73 @@
import { describe, expect, it } from 'vitest';
import { getLines, pickLines } from './random-line-picker.models';
import type { Config } from './random-line-picker.types';
describe('random-line-picker', () => {
describe('getLines', () => {
it('should split input into lines', () => {
const config: Config = { input: 'a\nb\nc', count: 1, repeat: false, prefix: false };
expect(getLines(config)).toEqual(['a', 'b', 'c']);
});
it('should return an empty array for empty input', () => {
const config: Config = { input: '', count: 1, repeat: false, prefix: false };
expect(getLines(config)).toEqual([]);
});
});
describe('pickLines', () => {
it('should return the correct number of lines', () => {
const config: Config = { input: 'a\nb\nc\nd\ne', count: 3, repeat: false, prefix: false };
const result = pickLines(config).split('\n');
expect(result).toHaveLength(3);
});
it('should not exceed the number of available lines when repeat is false', () => {
const config: Config = { input: 'a\nb\nc', count: 10, repeat: false, prefix: false };
const result = pickLines(config).split('\n');
expect(result).toHaveLength(3);
});
it('should allow picking more lines than available when repeat is true', () => {
const config: Config = { input: 'a\nb', count: 5, repeat: true, prefix: false };
const result = pickLines(config).split('\n');
expect(result).toHaveLength(5);
});
it('should only return lines from the input', () => {
const config: Config = { input: 'foo\nbar\nbaz', count: 3, repeat: false, prefix: false };
const result = pickLines(config).split('\n');
expect(result.every(line => ['foo', 'bar', 'baz'].includes(line))).toBe(true);
});
it('should not repeat lines when repeat is false', () => {
const config: Config = { input: 'a\nb\nc', count: 3, repeat: false, prefix: false };
const result = pickLines(config).split('\n');
expect(new Set(result).size).toBe(result.length);
});
it('should add numeric prefix when prefix is true', () => {
const config: Config = { input: 'a\nb\nc', count: 3, repeat: false, prefix: true };
const result = pickLines(config).split('\n');
expect(result[0]).toMatch(/^1\. /);
expect(result[1]).toMatch(/^2\. /);
expect(result[2]).toMatch(/^3\. /);
});
it('should not add prefix when prefix is false', () => {
const config: Config = { input: 'a\nb\nc', count: 3, repeat: false, prefix: false };
const result = pickLines(config).split('\n');
expect(result.every(line => !/^\d+\. /.test(line))).toBe(true);
});
it('should return an empty string for empty input', () => {
const config: Config = { input: '', count: 3, repeat: false, prefix: false };
expect(pickLines(config)).toBe('');
});
it('should return a single line when count is 1', () => {
const config: Config = { input: 'only', count: 1, repeat: false, prefix: false };
expect(pickLines(config)).toBe('only');
});
});
});
@@ -0,0 +1,24 @@
import type { Config } from './random-line-picker.types';
function getRandomInt(min: number, max: number) {
min = Math.ceil(min);
max = Math.floor(max);
return Math.floor(Math.random() * (max - min + 1)) + min;
}
export function getLines(config: Config) {
return config.input ? config.input.split(/\n/) : [];
}
export function pickLines(config: Config) {
const lines = getLines(config);
const length = config.repeat ? config.count : Math.min(config.count, lines.length);
return Array.from({ length }, (_, i) => {
const index = getRandomInt(0, lines.length - 1);
const line = config.repeat ? lines[index] : lines.splice(index, 1)[0];
return line && config.prefix ? `${i + 1}. ${line}` : line;
}).join('\n');
}
@@ -0,0 +1,6 @@
export interface Config {
input: string
count: number
repeat: boolean
prefix: boolean
}
@@ -0,0 +1,75 @@
<script setup lang="ts">
import { useI18n } from 'vue-i18n';
import { computedRefreshable } from '@/composable/computedRefreshable';
import { useCopy } from '@/composable/copy';
import { useStorage } from '@vueuse/core';
import { getLines, pickLines } from './random-line-picker.models';
const { t } = useI18n();
const config = useStorage('random-line-picker:config', {
input: '',
count: 1,
repeat: false,
prefix: false,
});
const [pickedLines, refreshPickedLines] = computedRefreshable(() => pickLines(config.value));
const { copy } = useCopy({ source: pickedLines, text: t('tools.random-line-picker.texts.text-picked-lines-copied-to-clipboard') });
const maxCount = ref<number | undefined>(undefined);
watch([() => config.value.repeat, () => config.value.input], () => {
maxCount.value = config.value.repeat ? undefined : getLines(config.value).length;
if (!config.value.repeat && maxCount.value && config.value.count > maxCount.value) {
config.value.count = maxCount.value;
}
}, { immediate: true });
</script>
<template>
<div>
<c-card>
<c-input-text v-model:value="config.input" test-id="input" multiline :placeholder="t('tools.random-line-picker.texts.placeholder-put-your-text-here')" rows="10" />
<n-space mt-5>
<n-form-item :label="t('tools.random-line-picker.texts.label-number-of-lines-to-pick')" label-placement="left">
<n-input-number-i18n v-model:value="config.count" data-test-id="count" min="1" :max="maxCount" size="small" />
</n-form-item>
<n-form-item :label="t('tools.random-line-picker.texts.label-allow-repeated-lines')" label-placement="left">
<n-switch v-model:value="config.repeat" />
</n-form-item>
<n-form-item :label="t('tools.random-line-picker.texts.label-prefix-lines-with-line-number')" label-placement="left">
<n-switch v-model:value="config.prefix" />
</n-form-item>
</n-space>
</c-card>
<c-card mt-5>
<c-input-text
v-model:value="pickedLines"
test-id="output"
multiline
:placeholder="t('tools.random-line-picker.texts.placeholder-picked-lines')"
readonly
rows="3"
autosize
class="passphrase-display"
word-wrap
/>
<div mt-5 flex justify-center gap-3>
<c-button @click="copy()">
{{ t('tools.random-line-picker.texts.tag-copy') }}
</c-button>
<c-button @click="refreshPickedLines">
{{ t('tools.random-line-picker.texts.tag-refresh') }}
</c-button>
</div>
</c-card>
</div>
</template>
@@ -1,10 +1,11 @@
import { translate as t } from '@/plugins/i18n.plugin';
import { SunOff } from '@vicons/tabler'; import { SunOff } from '@vicons/tabler';
import { defineTool } from '../tool'; import { defineTool } from '../tool';
export const tool = defineTool({ export const tool = defineTool({
name: 'Shutdown Command Generator', name: t('tools.shutdown-command-generator.title'),
path: '/shutdown-command-generator', path: '/shutdown-command-generator',
description: 'Generate shutdown command for various OS', description: t('tools.shutdown-command-generator.description'),
keywords: ['shutdown', 'command'], keywords: ['shutdown', 'command'],
component: () => import('./shutdown-command-generator.vue'), component: () => import('./shutdown-command-generator.vue'),
icon: SunOff, icon: SunOff,
@@ -1,4 +1,7 @@
<script setup lang="ts"> <script setup lang="ts">
import { useI18n } from 'vue-i18n';
const { t } = useI18n();
type Platform = 'windows' | 'linux' | 'macos'; type Platform = 'windows' | 'linux' | 'macos';
type Mode = 'delay' | 'time'; type Mode = 'delay' | 'time';
@@ -22,14 +25,14 @@ const cancel = ref(false);
const hibernate = ref(false); const hibernate = ref(false);
const platformOptions = [ const platformOptions = [
{ label: 'Windows', value: 'windows' }, { label: t('tools.shutdown-command-generator.texts.label-windows'), value: 'windows' },
{ label: 'Linux', value: 'linux' }, { label: t('tools.shutdown-command-generator.texts.label-linux'), value: 'linux' },
{ label: 'macOS', value: 'macos' }, { label: t('tools.shutdown-command-generator.texts.label-macos'), value: 'macos' },
]; ];
const modeOptions = [ const modeOptions = [
{ label: 'Delay', value: 'delay' }, { label: t('tools.shutdown-command-generator.texts.label-delay'), value: 'delay' },
{ label: 'Specific Time', value: 'time' }, { label: t('tools.shutdown-command-generator.texts.label-specific-time'), value: 'time' },
]; ];
// --- Command Builders ------------------------------------------------------- // --- Command Builders -------------------------------------------------------
@@ -167,7 +170,7 @@ const command = computed(() => {
<c-select <c-select
v-model:value="platform" v-model:value="platform"
:options="platformOptions" :options="platformOptions"
label="Platform:" :label="t('tools.shutdown-command-generator.texts.label-platform')"
label-position="left" label-position="left"
mb-1 mb-1
/> />
@@ -185,27 +188,22 @@ const command = computed(() => {
</NSpace> </NSpace>
<NSpace v-if="mode === 'delay'" justify="center" mb-1> <NSpace v-if="mode === 'delay'" justify="center" mb-1>
<NFormItem label="Delay:" label-placement="left" mb-1> <NFormItem :label="t('tools.shutdown-command-generator.texts.label-delay')" label-placement="left" mb-1>
<NInputNumber <NInputNumber
v-model:value="delayHours" v-model:value="delayHours"
:min="0" :min="0"
/> />{{ t('tools.shutdown-command-generator.texts.tag-nbsp-h-nbsp') }}<NInputNumber
&nbsp;h&nbsp;
<NInputNumber
v-model:value="delayMinutes" v-model:value="delayMinutes"
:min="0" :min="0"
/> />{{ t('tools.shutdown-command-generator.texts.tag-nbsp-m-nbsp') }}<NInputNumber
&nbsp;m&nbsp;
<NInputNumber
v-model:value="delaySeconds" v-model:value="delaySeconds"
:min="0" :min="0"
/> />{{ t('tools.shutdown-command-generator.texts.tag-nbsp-s') }}
&nbsp;s
</NFormItem> </NFormItem>
</NSpace> </NSpace>
<NSpace v-if="mode === 'time'" justify="center" mb-1> <NSpace v-if="mode === 'time'" justify="center" mb-1>
<NFormItem label="Shutdown time:" label-placement="left"> <NFormItem :label="t('tools.shutdown-command-generator.texts.label-shutdown-time')" label-placement="left">
<NDatePicker <NDatePicker
v-model:value="timeValue" v-model:value="timeValue"
type="datetime" type="datetime"
@@ -214,14 +212,14 @@ const command = computed(() => {
</NSpace> </NSpace>
<NSpace justify="center" mb-1> <NSpace justify="center" mb-1>
<NCheckbox v-model:checked="force" label="Force" /> <NCheckbox v-model:checked="force" :label="t('tools.shutdown-command-generator.texts.label-force')" />
<NCheckbox v-model:checked="reboot" label="Reboot" /> <NCheckbox v-model:checked="reboot" :label="t('tools.shutdown-command-generator.texts.label-reboot')" />
<NCheckbox v-model:checked="logoff" label="Logoff" /> <NCheckbox v-model:checked="logoff" :label="t('tools.shutdown-command-generator.texts.label-logoff')" />
<NCheckbox v-model:checked="cancel" label="Cancel" /> <NCheckbox v-model:checked="cancel" :label="t('tools.shutdown-command-generator.texts.label-cancel')" />
<NCheckbox v-model:checked="hibernate" label="Hibernate" /> <NCheckbox v-model:checked="hibernate" :label="t('tools.shutdown-command-generator.texts.label-hibernate')" />
</NSpace> </NSpace>
<c-card title="Generated command"> <c-card :title="t('tools.shutdown-command-generator.texts.title-generated-command')">
<textarea-copyable :value="command" language="bash" /> <textarea-copyable :value="command" language="bash" />
</c-card> </c-card>
</div> </div>
@@ -4,10 +4,10 @@ import UnitsConverter from '@/components/UnitsConverter.vue';
const supportedUnits = { const supportedUnits = {
'm/s': 'meter per second', 'm/s': 'meter per second',
'km/h': 'kilometer per hour', 'km/h': 'kilometer per hour',
'm/h': 'meter per hour', 'mi/h': 'miles per hour',
'knot': 'knot', 'knot': 'knot',
'ft/s': 'feet per second', 'ft/s': 'feet per second',
}; ; };
</script> </script>
<template> <template>
+17 -13
View File
@@ -1,4 +1,8 @@
<script setup lang="ts"> <script setup lang="ts">
import { useI18n } from 'vue-i18n';
const { t } = useI18n();
const billAmount = ref<number>(); const billAmount = ref<number>();
const tipPercentage = ref<number>(15); const tipPercentage = ref<number>(15);
const numberOfPeople = ref<number>(1); const numberOfPeople = ref<number>(1);
@@ -35,33 +39,33 @@ const amountPerPersonFormatted = computed(() => formatCurrency(amountPerPerson.v
<template> <template>
<div style="margin: 0 auto; max-width: 600px"> <div style="margin: 0 auto; max-width: 600px">
<c-card mb-3 title="Bill Details"> <c-card mb-3 :title="t('tools.tip-calculator.texts.title-bill-details')">
<n-form label-placement="left" label-width="150px" label-align="left"> <n-form label-placement="left" label-width="150px" label-align="left">
<n-form-item label="Bill Amount:"> <n-form-item :label="t('tools.tip-calculator.texts.label-bill-amount')">
<n-input-number v-model:value="billAmount" :min="0" placeholder="Total Bill" /> <n-input-number v-model:value="billAmount" :min="0" :placeholder="t('tools.tip-calculator.texts.placeholder-total-bill')" />
</n-form-item> </n-form-item>
<n-form-item label="Tip Percentage:"> <n-form-item :label="t('tools.tip-calculator.texts.label-tip-percentage')">
<n-input-number v-model:value="tipPercentage" :min="0" placeholder="Tip %"> <n-input-number v-model:value="tipPercentage" :min="0" :placeholder="t('tools.tip-calculator.texts.placeholder-tip')">
<template #suffix> <template #suffix>
% {{ t('tools.tip-calculator.texts.tag-') }}
</template> </template>
</n-input-number> </n-input-number>
</n-form-item> </n-form-item>
<n-form-item label="Number of person:"> <n-form-item :label="t('tools.tip-calculator.texts.label-number-of-person')">
<n-input-number v-model:value="numberOfPeople" :min="1" placeholder="People" /> <n-input-number v-model:value="numberOfPeople" :min="1" :placeholder="t('tools.tip-calculator.texts.placeholder-people')" />
</n-form-item> </n-form-item>
</n-form> </n-form>
</c-card> </c-card>
<c-card mb-3 title="Results"> <c-card mb-3 :title="t('tools.tip-calculator.texts.title-results')">
<input-copyable label="Tip Amount:" :value="tipAmountFormatted" readonly label-position="left" label-width="150px" mb-1 /> <input-copyable :label="t('tools.tip-calculator.texts.label-tip-amount')" :value="tipAmountFormatted" readonly label-position="left" label-width="150px" mb-1 />
<input-copyable label="Total Bill:" :value="totalAmountFormatted" readonly label-position="left" label-width="150px" mb-1 /> <input-copyable :label="t('tools.tip-calculator.texts.label-total-bill')" :value="totalAmountFormatted" readonly label-position="left" label-width="150px" mb-1 />
<input-copyable label="Amount Per Person:" :value="amountPerPersonFormatted" readonly label-position="left" label-width="150px" mb-1 /> <input-copyable :label="t('tools.tip-calculator.texts.label-amount-per-person')" :value="amountPerPersonFormatted" readonly label-position="left" label-width="150px" mb-1 />
</c-card> </c-card>
<c-card title="Quick Tip %"> <c-card :title="t('tools.tip-calculator.texts.title-quick-tip')">
<n-space justify="center"> <n-space justify="center">
<n-button v-for="tip in [10, 15, 18, 20, 25]" :key="tip" size="small" @click="tipPercentage = tip"> <n-button v-for="tip in [10, 15, 18, 20, 25]" :key="tip" size="small" @click="tipPercentage = tip">
{{ tip }}% {{ tip }}%
+19 -2
View File
@@ -13,6 +13,8 @@ const versions = ['NIL', 'v1', 'v3', 'v4', 'v5', 'v6', 'v7'] as const;
const version = useQueryParamOrStorage<typeof versions[number]>({ name: 'version', storageName: 'uuid-generator:version', defaultValue: 'v4' }); const version = useQueryParamOrStorage<typeof versions[number]>({ name: 'version', storageName: 'uuid-generator:version', defaultValue: 'v4' });
const count = useQueryParamOrStorage({ name: 'amount', storageName: 'uuid-generator:quantity', defaultValue: 1 }); const count = useQueryParamOrStorage({ name: 'amount', storageName: 'uuid-generator:quantity', defaultValue: 1 });
const bare = useQueryParamOrStorage({ name: 'bare', storageName: 'uuid-generator:bare', defaultValue: false });
const upperCase = useQueryParamOrStorage({ name: 'upper', storageName: 'uuid-generator:upper', defaultValue: false });
const v35Args = ref({ namespace: '6ba7b811-9dad-11d1-80b4-00c04fd430c8', name: '' }); const v35Args = ref({ namespace: '6ba7b811-9dad-11d1-80b4-00c04fd430c8', name: '' });
const validUuidRules = [ const validUuidRules = [
@@ -46,7 +48,13 @@ const generators = {
const [uuids, refreshUUIDs] = computedRefreshable(() => withDefaultOnError(() => const [uuids, refreshUUIDs] = computedRefreshable(() => withDefaultOnError(() =>
Array.from({ length: count.value }, (_ignored, index) => { Array.from({ length: count.value }, (_ignored, index) => {
const generator = generators[version.value] ?? generators.NIL; const generator = generators[version.value] ?? generators.NIL;
return generator(index); let uuid = generator(index);
if (bare.value) {
uuid = uuid.replace(/-/g, '');
}
return upperCase.value ? uuid.toUpperCase() : uuid.toLowerCase();
}).join('\n'), '')); }).join('\n'), ''));
const { copy } = useCopy({ source: uuids, text: t('tools.uuid-generator.texts.text-uuids-copied-to-the-clipboard') }); const { copy } = useCopy({ source: uuids, text: t('tools.uuid-generator.texts.text-uuids-copied-to-the-clipboard') });
@@ -61,7 +69,7 @@ const { copy } = useCopy({ source: uuids, text: t('tools.uuid-generator.texts.te
<n-input-number-i18n v-model:value="count" flex-1 :min="1" :max="50" :placeholder="t('tools.uuid-generator.texts.placeholder-uuid-quantity')" /> <n-input-number-i18n v-model:value="count" flex-1 :min="1" :max="50" :placeholder="t('tools.uuid-generator.texts.placeholder-uuid-quantity')" />
</div> </div>
<div v-if="version === 'v3' || version === 'v5'"> <div v-if="version === 'v3' || version === 'v5'" mb-2>
<div> <div>
<c-buttons-select <c-buttons-select
v-model:value="v35Args.namespace" v-model:value="v35Args.namespace"
@@ -98,6 +106,15 @@ const { copy } = useCopy({ source: uuids, text: t('tools.uuid-generator.texts.te
/> />
</div> </div>
<n-space justify="center" mb-2>
<n-checkbox v-model:checked="upperCase">
{{ $t('tools.uuid-generator.texts.uppercase') }}
</n-checkbox>
<n-checkbox v-model:checked="bare">
{{ $t('tools.uuid-generator.texts.no-hyphen') }}
</n-checkbox>
</n-space>
<c-input-text <c-input-text
style="text-align: center; font-family: monospace" style="text-align: center; font-family: monospace"
:value="uuids" :value="uuids"
@@ -5,6 +5,7 @@ import TextareaCopyable from '@/components/TextareaCopyable.vue';
import { withDefaultOnErrorAsync } from '@/utils/defaults'; import { withDefaultOnErrorAsync } from '@/utils/defaults';
import { computedRefreshableAsync } from '@/composable/computedRefreshable'; import { computedRefreshableAsync } from '@/composable/computedRefreshable';
import { useValidation } from '@/composable/validation'; import { useValidation } from '@/composable/validation';
import { useQueryParamOrStorage } from '@/composable/queryParams';
const { t } = useI18n(); const { t } = useI18n();
@@ -29,6 +30,17 @@ const country = ref('France');
const contactEmail = ref(''); const contactEmail = ref('');
const subjectAlternativeNames = ref(''); const subjectAlternativeNames = ref('');
const emptyCSR = { certificatePem: '', privateKeyPem: '', publicKeyPem: '', fingerprint: '' }; const emptyCSR = { certificatePem: '', privateKeyPem: '', publicKeyPem: '', fingerprint: '' };
const bits = useQueryParamOrStorage({ name: 'bits', storageName: 'cert-gen:b', defaultValue: 2048 });
const { attrs: bitsValidationAttrs } = useValidation({
source: bits,
rules: [
{
message: t('tools.csr-generator.texts.bits-should-be-256-less-than-bits-less-than-16384-and-be-a-multiple-of-8'),
validator: value => value >= 256 && value <= 16384 && value % 8 === 0,
},
],
});
const [certs, refreshCerts] = computedRefreshableAsync( const [certs, refreshCerts] = computedRefreshableAsync(
() => withDefaultOnErrorAsync(() => { () => withDefaultOnErrorAsync(() => {
@@ -38,6 +50,7 @@ const [certs, refreshCerts] = computedRefreshableAsync(
return generateSSLCertificate({ return generateSSLCertificate({
password: password.value, password: password.value,
bits: bits.value,
commonName: commonName.value, commonName: commonName.value,
countryName: country.value, countryName: country.value,
city: city.value, city: city.value,
@@ -181,6 +194,12 @@ const [certs, refreshCerts] = computedRefreshableAsync(
</n-form-item> </n-form-item>
</div> </div>
<div>
<n-form-item :label="t('tools.x509-certificate-generator.texts.rsa-bits')" v-bind="bitsValidationAttrs as any" label-placement="left">
<n-input-number v-model:value="bits" min="256" max="16384" step="8" />
</n-form-item>
</div>
<div flex justify-center> <div flex justify-center>
<c-button @click="refreshCerts"> <c-button @click="refreshCerts">
{{ t('tools.x509-certificate-generator.texts.tag-refresh-certificate') }} {{ t('tools.x509-certificate-generator.texts.tag-refresh-certificate') }}
+7 -6
View File
@@ -193,10 +193,11 @@ export default defineConfig({
}, },
}, },
}, },
server: { // server: {
headers: { // headers: {
'Cross-Origin-Opener-Policy': 'same-origin', // 'Cross-Origin-Resource-Policy': 'same-site',
'Cross-Origin-Embedder-Policy': 'require-corp', // 'Cross-Origin-Opener-Policy': 'same-origin',
}, // 'Cross-Origin-Embedder-Policy': 'require-corp',
}, // },
// },
}); });