Compare commits

...
Author SHA1 Message Date
ShareVB 99393d2683 chore(version): release 2025.07.20-3ccbd853 2025-07-20 22:48:13 +02:00
ShareVB b612eed948 docs(changelog): update changelog for 2025.07.20-3ccbd853 2025-07-20 22:48:12 +02:00
ShareVB 3ccbd85342 fix: use t for translate in tools name/description 2025-07-20 22:45:56 +02:00
ShareVB a26f2a2cf9 fix(Regex Tester): remove shadow root on unmount
Fix #1502
2025-07-20 22:36:50 +02:00
ShareVB 0bb259c734 fix(iCal Merger): fix name and desc + regenerate UIDs 2025-07-20 22:27:35 +02:00
ShareVB b434ad7246 chore: update deps 2025-07-20 21:47:56 +02:00
ShareVB 1202011926 chore: update playwright 2025-07-20 21:01:18 +02:00
ShareVB babff364d6 chore: update deps 2025-07-20 21:01:18 +02:00
ShareVB cfe5b4fece feat: prepare new tools for translation 2025-07-20 21:01:18 +02:00
ShareVB 504aff98d0 fix: remove stub @types + update podletjs + use @xterm/xterm 2025-07-20 21:01:18 +02:00
ShareVB a4576e040c feat: translation scripts enhancements
extract-tools-desc: use t() to make recognizable
extract-tools-string: search for attributes only in .vue + handle single directory/file from command line + useI18n only in .vue
2025-07-20 21:01:18 +02:00
ShareVB 9cb58fccf3 feat(new tool): Levenshtein Distance Calculator
Fix #1610
2025-07-20 21:01:17 +02:00
ShareVB 521d0bf638 feat(new tools): YAML/JSON Flattener/Unflattener 2025-07-20 21:01:17 +02:00
ShareVB 1d02e32486 feat(new tools): YAML/JSON Merger 2025-07-20 21:01:17 +02:00
ShareVB d28f275168 feat(new tools): Docker Run/Compose to Quadlets
Fix #122
2025-07-20 21:01:17 +02:00
ShareVB eafc6f87fc fix(nginx.conf): allow image-src to blob and http(s)
Fix #136
2025-07-20 21:01:17 +02:00
renovate[bot] 5bdbaa920e fix(deps): update dependency @iplookup/country-extra to v1.0.20250717 (#115)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-07-20 21:01:17 +02:00
Dark_Phoenix_andsharevb aabbfca763 Additions for responsive sidebar pull request (#131)
* - Made the sidebar responsive
- Edited the hero-gradient svg to fix an issue where it would never scale to the full width of the sidebar
- Fixed a bug on Chrome where you'd need to click twice on a category element in the sidebar to see its tools

* - Added hover effect for category button
- Disabled transition built into the n-menu element to display the hover effect for tools items directly instead of after a slight delay

* - Added a tooltip which shows when the title of the tool is truncated

* - Increased sidebar width from 10% to 12.5%
- Changed check truncation calculation for container width to a more accurate variant to fix a bug where a tooltip was shown without the text being truncated

* fixed merge conflicts

* Fixed merge conflict in pnpm lock file

* Another fix for merge conflixt pnpm lock file

---------

Co-authored-by: sharevb <sharevb@gmail.com>
2025-07-20 21:01:17 +02:00
Dark_Phoenix_andsharevb be9d659763 Fix: Massive website slowdown after visiting the Unicode Search page (#132)
* - Fixed a performance issue where visiting the Unicode Search page would significantly slow down the website because of the constant unintentional reinitialization of the flexSearch index

* Removed unnecessary leftover code

---------

Co-authored-by: sharevb <sharevb@gmail.com>
2025-07-20 21:01:17 +02:00
oleole39 96ad3ebba0 add yunohost install option (#133) 2025-07-20 21:01:17 +02:00
ShareVB c46e65fe3c feat(Git Memo): add git pull 2025-07-20 21:01:17 +02:00
ShareVB 79e0db7ef6 fix: allow connect-src any https: and http:
Fix #135
2025-07-20 21:01:17 +02:00
ShareVB b0c43e2bdb feat(XPath Tester): handle namespaces
Fix #134
2025-07-20 21:01:17 +02:00
ShareVB ad312d788f fix: JSON stringify/parse BigInt
Fix #1615
2025-07-20 21:01:01 +02:00
sharevb a8c6ebc81b Feat/translate all content (#121)
* feat: add script to extract strings

* feat: extract many strings (html, attr, label)

* feat(extract string): extract html only for .vue and single file mode

* fix: __i18n_ally_root__

* feat: nestify en.yml + extract tab attributes

* feat: add script to extract strings

* feat: extract many strings (html, attr, label)

* feat(extract string): extract html only for .vue and single file mode

* fix: __i18n_ally_root__

* feat: nestify en.yml + extract tab attributes

* fix: lint

* feat: add vue-i18n-extract to check missing keys

* fix: unit tests

* fix: update vue i18n plugin
2025-07-20 21:01:01 +02:00
ShareVB 0d4267e356 fix: read yaml with intAsBigInt 2025-07-18 18:45:39 +02:00
ShareVB e5d842571b feat(new tool): Swagger UI Tester
Fix #123
2025-07-15 21:38:15 +02:00
704 changed files with 12982 additions and 6200 deletions

No files matched your search

+74
View File
@@ -2,6 +2,80 @@
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
## Version 2025.07.20-3ccbd853
### Features
- prepare new tools for translation (cfe5b4f)
- translation scripts enhancements (a4576e0)
- **new tool**: Levenshtein Distance Calculator (9cb58fc)
- **new tools**: YAML/JSON Flattener/Unflattener (521d0bf)
- **new tools**: YAML/JSON Merger (1d02e32)
- **new tools**: Docker Run/Compose to Quadlets (d28f275)
- **Git Memo**: add git pull (c46e65f)
- **XPath Tester**: handle namespaces (b0c43e2)
- **new tool**: Swagger UI Tester (e5d8425)
- **yaml-to-json**: add nestify options (e9dbf1f)
- **i18n**: extract some more (1a2e152)
- **i18n**: extract some more (7527853)
- **i18n**: extract all tools name and description (a9d6b86)
- add script to extract tools name and description (cca32ba)
- **HTML Editor**: add raw html editor (d625f62)
- **new tool**: Citation Generator (APA/MLA) (700cc2a)
- **new tool**: JSON Query (lang) (c53a8cb)
- **JQ Tester**: add some keywords and move to JSON category (ea0a99e)
- **new tool**: ANSI Escape Tester (241dd13)
- **new tool**: HTML Minifier (9f5f7d8)
- **HTML Editor**: option to minify output (5e3648e)
- **Watermarker**: add options for repeated tile spacing and single watermark positioning (a78201b)
- **new tool**: Image Watermarker (e00b78b)
- **Unicode Search**: improve unicode search loading speed (#97) (f868b97)
- **Folder Structure**: Add backwards converter for Folder Structure Page (#105) (9186038)
### Bug fixes
- use t for translate in tools name/description (3ccbd85)
- **Regex Tester**: remove shadow root on unmount (a26f2a2)
- **iCal Merger**: fix name and desc + regenerate UIDs (0bb259c)
- remove stub @types + update podletjs + use @xterm/xterm (504aff9)
- **nginx.conf**: allow image-src to blob and http(s) (eafc6f8)
- **deps**: update dependency @iplookup/country-extra to v1.0.20250717 (#115) (5bdbaa9)
- allow connect-src any https: and http: (79e0db7)
- JSON stringify/parse BigInt (ad312d7)
- read yaml with intAsBigInt (0d4267e)
- **HTML Editor**: remove <p> from <li> (2be6d4d)
- **IPv4 Address Converter**: error handling (05d25da)
### Chores
- update deps (b434ad7)
- update playwright (1202011)
- update deps (babff36)
- force base url / for latest and default build (91564e0)
- fix github issue template typo (5904fa7)
### Other
- Additions for responsive sidebar pull request (#131) (aabbfca)
- add yunohost install option (#133) (96ad3eb)
- Feat/translate all content (#121) (a8c6ebc)
- Made sidebar responsive (#130) (e811a5b)
- Updated Irish translation (#127) (7824f48)
- feat(i18n) Added Irish/Gaeilge translation (#124) (4ea4420)
- Squashed commit of the following: (207b2ab)
### Fix
- Massive website slowdown after visiting the Unicode Search page (#132) (be9d659)
### Merge branch 'chore/all-my-stuffs' of https
- //github.com/sharevb/it-tools into chore/all-my-stuffs (3ffb805)
### Feature
- Improve menu bar animation smoothness (#109) (7fd60b0)
### New tool
- CLI Command Editor (#108) (3b921e6)
### Doc
- add info for authentication (a12c43b)
- add info about ipv6, cyberpanel, https, PWA, dev under WSL2 (de76ee5)
## Version 2025.06.15-20a26514
### Features
+2 -1
View File
@@ -178,6 +178,7 @@ docker run -d --name it-tools --restart unless-stopped -p 8080:8080 ghcr.io/core
- [Cloudron](https://www.cloudron.io/store/tech.ittools.cloudron.html)
- [Tipi](https://www.runtipi.io/docs/apps-available)
- [Unraid](https://unraid.net/community/apps?q=it-tools)
- [YunoHost](https://apps.yunohost.org/app/it-tools)
## Contribute
@@ -275,4 +276,4 @@ Contributor graph is generated using [contrib.rocks](https://contrib.rocks/previ
This project is under the [GNU GPLv3](LICENSE).
</details>
</details>
+15 -18
View File
@@ -130,10 +130,12 @@ declare module '@vue/runtime-core' {
DockerComposeConverter: typeof import('./src/tools/docker-compose-converter/docker-compose-converter.vue')['default']
DockerComposeToDockerRunConverter: typeof import('./src/tools/docker-compose-to-docker-run-converter/docker-compose-to-docker-run-converter.vue')['default']
DockerComposeToKubernetes: typeof import('./src/tools/docker-compose-to-kubernetes/docker-compose-to-kubernetes.vue')['default']
DockerComposeToQuadlets: typeof import('./src/tools/docker-compose-to-quadlets/docker-compose-to-quadlets.vue')['default']
DockerComposeValidator: typeof import('./src/tools/docker-compose-validator/docker-compose-validator.vue')['default']
DockerMemo: typeof import('./src/tools/docker-memo/docker-memo.vue')['default']
DockerRunToDockerComposeConverter: typeof import('./src/tools/docker-run-to-docker-compose-converter/docker-run-to-docker-compose-converter.vue')['default']
DockerRunToKubernetes: typeof import('./src/tools/docker-run-to-kubernetes/docker-run-to-kubernetes.vue')['default']
DockerRunToQuadlets: typeof import('./src/tools/docker-run-to-quadlets/docker-run-to-quadlets.vue')['default']
DuplicateLineFinder: typeof import('./src/tools/duplicate-line-finder/duplicate-line-finder.vue')['default']
DurationCalculator: typeof import('./src/tools/duration-calculator/duration-calculator.vue')['default']
DynamicValues: typeof import('./src/tools/benchmark-builder/dynamic-values.vue')['default']
@@ -196,23 +198,16 @@ declare module '@vue/runtime-core' {
IcoConverter: typeof import('./src/tools/ico-converter/ico-converter.vue')['default']
'IconMdi:brushVariant': typeof import('~icons/mdi/brush-variant')['default']
'IconMdi:kettleSteamOutline': typeof import('~icons/mdi/kettle-steam-outline')['default']
IconMdiCamera: typeof import('~icons/mdi/camera')['default']
IconMdiChevronDown: typeof import('~icons/mdi/chevron-down')['default']
IconMdiChevronRight: typeof import('~icons/mdi/chevron-right')['default']
IconMdiClose: typeof import('~icons/mdi/close')['default']
IconMdiContentCopy: typeof import('~icons/mdi/content-copy')['default']
IconMdiDeleteOutline: typeof import('~icons/mdi/delete-outline')['default']
IconMdiDownload: typeof import('~icons/mdi/download')['default']
IconMdiEye: typeof import('~icons/mdi/eye')['default']
IconMdiEyeOff: typeof import('~icons/mdi/eye-off')['default']
IconMdiHeart: typeof import('~icons/mdi/heart')['default']
IconMdiPause: typeof import('~icons/mdi/pause')['default']
IconMdiPlay: typeof import('~icons/mdi/play')['default']
IconMdiRecord: typeof import('~icons/mdi/record')['default']
IconMdiSearch: typeof import('~icons/mdi/search')['default']
IconMdiTranslate: typeof import('~icons/mdi/translate')['default']
IconMdiTriangleDown: typeof import('~icons/mdi/triangle-down')['default']
IconMdiVideo: typeof import('~icons/mdi/video')['default']
IesLightingGuidelines: typeof import('./src/tools/ies-lighting-guidelines/ies-lighting-guidelines.vue')['default']
IlluminanceConverter: typeof import('./src/tools/illuminance-converter/illuminance-converter.vue')['default']
ImageConverter: typeof import('./src/tools/image-converter/image-converter.vue')['default']
@@ -244,7 +239,9 @@ declare module '@vue/runtime-core' {
JsonDiff: typeof import('./src/tools/json-diff/json-diff.vue')['default']
JsonEditor: typeof import('./src/tools/json-editor/json-editor.vue')['default']
JsonEscaper: typeof import('./src/tools/json-escaper/json-escaper.vue')['default']
JsonFlattenNestify: typeof import('./src/tools/json-flatten-nestify/json-flatten-nestify.vue')['default']
JsonLinter: typeof import('./src/tools/json-linter/json-linter.vue')['default']
JsonMerger: typeof import('./src/tools/json-merger/json-merger.vue')['default']
JsonMinify: typeof import('./src/tools/json-minify/json-minify.vue')['default']
Jsonpath: typeof import('./src/tools/jsonpath-memo/jsonpath.md')['default']
JsonpathMemo: typeof import('./src/tools/jsonpath-memo/jsonpath-memo.vue')['default']
@@ -278,6 +275,7 @@ declare module '@vue/runtime-core' {
'K8sMemo.content': typeof import('./src/tools/k8s-memo/k8s-memo.content.md')['default']
KeycodeInfo: typeof import('./src/tools/keycode-info/keycode-info.vue')['default']
LengthConverter: typeof import('./src/tools/length-converter/length-converter.vue')['default']
LevenshteinCalculator: typeof import('./src/tools/levenshtein-calculator/levenshtein-calculator.vue')['default']
ListComparer: typeof import('./src/tools/list-comparer/list-comparer.vue')['default']
ListConverter: typeof import('./src/tools/list-converter/list-converter.vue')['default']
LocaleSelector: typeof import('./src/modules/i18n/components/locale-selector.vue')['default']
@@ -300,7 +298,6 @@ declare module '@vue/runtime-core' {
MenuBarItem: typeof import('./src/tools/html-wysiwyg-editor/editor/menu-bar-item.vue')['default']
MenuIconItem: typeof import('./src/components/MenuIconItem.vue')['default']
MenuItemTooltip: typeof import('./src/components/MenuItemTooltip.vue')['default']
MenuItemWithTooltip: typeof import('./src/components/MenuItemWithTooltip.vue')['default']
MenuLayout: typeof import('./src/components/MenuLayout.vue')['default']
MermaidExporter: typeof import('./src/tools/mermaid-exporter/mermaid-exporter.vue')['default']
MetaTagGenerator: typeof import('./src/tools/meta-tag-generator/meta-tag-generator.vue')['default']
@@ -312,40 +309,37 @@ declare module '@vue/runtime-core' {
MorseConverter: typeof import('./src/tools/morse-converter/morse-converter.vue')['default']
MultiLinkDownloader: typeof import('./src/tools/multi-link-downloader/multi-link-downloader.vue')['default']
MyIp: typeof import('./src/tools/my-ip/my-ip.vue')['default']
NAlert: typeof import('naive-ui')['NAlert']
NanoidGenerator: typeof import('./src/tools/nanoid-generator/nanoid-generator.vue')['default']
NanoMemo: typeof import('./src/tools/nano-memo/nano-memo.vue')['default']
'NanoMemo.content': typeof import('./src/tools/nano-memo/nano-memo.content.md')['default']
NavbarButtons: typeof import('./src/components/NavbarButtons.vue')['default']
NButton: typeof import('naive-ui')['NButton']
NCard: typeof import('naive-ui')['NCard']
NCheckbox: typeof import('naive-ui')['NCheckbox']
NCode: typeof import('naive-ui')['NCode']
NColorPicker: typeof import('naive-ui')['NColorPicker']
NConfigProvider: typeof import('naive-ui')['NConfigProvider']
NDivider: typeof import('naive-ui')['NDivider']
NDynamicTags: typeof import('naive-ui')['NDynamicTags']
NEllipsis: typeof import('naive-ui')['NEllipsis']
NForm: typeof import('naive-ui')['NForm']
NFormItem: typeof import('naive-ui')['NFormItem']
NGi: typeof import('naive-ui')['NGi']
NginxFormatter: typeof import('./src/tools/nginx-formatter/nginx-formatter.vue')['default']
NginxMemo: typeof import('./src/tools/nginx-memo/nginx-memo.vue')['default']
'NginxMemo.content': typeof import('./src/tools/nginx-memo/nginx-memo.content.md')['default']
NGrid: typeof import('naive-ui')['NGrid']
NH1: typeof import('naive-ui')['NH1']
NH3: typeof import('naive-ui')['NH3']
NIcon: typeof import('naive-ui')['NIcon']
NImage: typeof import('naive-ui')['NImage']
NInput: typeof import('naive-ui')['NInput']
NInputNumber: typeof import('naive-ui')['NInputNumber']
NLayout: typeof import('naive-ui')['NLayout']
NLayoutSider: typeof import('naive-ui')['NLayoutSider']
NMenu: typeof import('naive-ui')['NMenu']
NRadio: typeof import('naive-ui')['NRadio']
NRadioGroup: typeof import('naive-ui')['NRadioGroup']
NScrollbar: typeof import('naive-ui')['NScrollbar']
NSelect: typeof import('naive-ui')['NSelect']
NSpace: typeof import('naive-ui')['NSpace']
NSpin: typeof import('naive-ui')['NSpin']
NSwitch: typeof import('naive-ui')['NSwitch']
NTabPane: typeof import('naive-ui')['NTabPane']
NTabs: typeof import('naive-ui')['NTabs']
NTable: typeof import('naive-ui')['NTable']
NTagGroup: typeof import('naive-ui')['NTagGroup']
NTooltip: typeof import('naive-ui')['NTooltip']
NumberInput: typeof import('./src/tools/pomodoro-timer/app/components/NumberInput.vue')['default']
NumeronymGenerator: typeof import('./src/tools/numeronym-generator/numeronym-generator.vue')['default']
@@ -427,6 +421,7 @@ declare module '@vue/runtime-core' {
StringEscaper: typeof import('./src/tools/string-escaper/string-escaper.vue')['default']
StringObfuscator: typeof import('./src/tools/string-obfuscator/string-obfuscator.vue')['default']
SvgPlaceholderGenerator: typeof import('./src/tools/svg-placeholder-generator/svg-placeholder-generator.vue')['default']
SwaggerUiTester: typeof import('./src/tools/swagger-ui-tester/swagger-ui-tester.vue')['default']
TcpdumpGenerator: typeof import('./src/tools/tcpdump-generator/tcpdump-generator.vue')['default']
TemperatureConverter: typeof import('./src/tools/temperature-converter/temperature-converter.vue')['default']
TextareaCopyable: typeof import('./src/components/TextareaCopyable.vue')['default']
@@ -479,6 +474,8 @@ declare module '@vue/runtime-core' {
XpathTester: typeof import('./src/tools/xpath-tester/xpath-tester.vue')['default']
XsltTester: typeof import('./src/tools/xslt-tester/xslt-tester.vue')['default']
XVrSpamcauseDecoder: typeof import('./src/tools/x-vr-spamcause-decoder/x-vr-spamcause-decoder.vue')['default']
YamlFlattenNestify: typeof import('./src/tools/yaml-flatten-nestify/yaml-flatten-nestify.vue')['default']
YamlMerger: typeof import('./src/tools/yaml-merger/yaml-merger.vue')['default']
YamlToJson: typeof import('./src/tools/yaml-to-json-converter/yaml-to-json.vue')['default']
YamlToToml: typeof import('./src/tools/yaml-to-toml/yaml-to-toml.vue')['default']
YamlViewer: typeof import('./src/tools/yaml-viewer/yaml-viewer.vue')['default']
+5094 -348
View File
File diff suppressed because it is too large. Load diff
+1 -1
View File
@@ -11,7 +11,7 @@ server {
add_header X-Permitted-Cross-Domain-Policies none;
add_header Cross-Origin-Resource-Policy same-site;
add_header Cross-Origin-Opener-Policy same-origin;
add_header Content-Security-Policy "default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'; img-src 'self' data:; connect-src 'self'; font-src 'self'; object-src 'none'; base-uri 'self'; form-action 'self';";
add_header Content-Security-Policy "default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'; img-src 'self' data: blob: https: http:; connect-src https: http:; font-src 'self'; object-src 'none'; base-uri 'self'; form-action 'self';";
location / {
rewrite ^/it-tools/(.*) /$1 break;
try_files $uri $uri/ /index.html;
+68 -58
View File
@@ -1,7 +1,7 @@
{
"name": "it-tools",
"type": "module",
"version": "2025.6.15-20a26514",
"version": "2025.7.20-3ccbd853",
"packageManager": "pnpm@9.11.0",
"description": "Collection of handy online tools for developers, with great UX. ",
"author": "Corentin Th <corentin.thomasset74+it-tools@gmail.com> (https://corentin.tech)",
@@ -35,18 +35,20 @@
"script:create:tool": "node scripts/create-tool.mjs",
"script:create:ui": "hygen generator ui-component",
"release": "node ./scripts/release.mjs",
"script:extract:desc": "node ./scripts/extract-tools-desc.mjs"
"script:extract:desc": "node ./scripts/extract-tools-desc.mjs",
"script:extract:strings": "node ./scripts/extract-tools-strings.mjs",
"vue-i18n-extract": "vue-i18n-extract report --vueFiles 'src/**/*.?(ts|vue)' --languageFiles 'locales/*.yml'"
},
"dependencies": {
"@chenfengyuan/vue-barcode": "^2.0.2",
"@date-fns/utc": "^1.2.0",
"@date-fns/utc": "^2.0.0",
"@dice-roller/rpg-dice-roller": "^5.5.1",
"@faker-js/faker": "^9.7.0",
"@fortawesome/fontawesome-svg-core": "^6.7.2",
"@fortawesome/free-solid-svg-icons": "^6.7.2",
"@fortawesome/vue-fontawesome": "^3.0.8",
"@github/paste-markdown": "^1.5.3",
"@guolao/vue-monaco-editor": "^1.5.4",
"@guolao/vue-monaco-editor": "^1.5.5",
"@guyplusplus/turndown-plugin-gfm": "^1.0.7",
"@huggingface/transformers": "3.0.0-alpha.14",
"@iplookup/country-extra": "^1.0.20250317",
@@ -73,14 +75,15 @@
"@tiptap/starter-kit": "2.9.1",
"@tiptap/vue-3": "2.9.1",
"@types/haversine": "^1.1.8",
"@types/moment": "^2.13.0",
"@unicode/unicode-15.1.0": "^1.6.5",
"@types/swagger-ui-dist": "^3.30.6",
"@unicode/unicode-15.1.0": "^1.6.6",
"@vicons/material": "^0.12.0",
"@vicons/tabler": "^0.12.0",
"@vueuse/core": "^10.11.1",
"@vueuse/head": "^1.0.0",
"@vueuse/router": "^10.0.0",
"@xmldom/xmldom": "^0.8.10",
"@xterm/xterm": "^5.5.0",
"@younestouati/playing-cards-standard-deck": "^6.0.1",
"@zxing/library": "^0.21.3",
"a11y-color-contrast": "^0.2.0",
@@ -97,11 +100,11 @@
"change-case": "^5.4.4",
"chatgpt-prompt-splitter": "^1.0.5",
"chinesegen": "^0.3.3",
"cidr-tools": "^11.0.2",
"cidr-tools": "^11.0.3",
"citation-formatter": "^1.0.1",
"colord": "^2.9.3",
"composerize": "^1.7.2",
"composeverter": "^1.7.4",
"composerize": "^1.7.5",
"composeverter": "^1.7.5",
"convert": "^5.7.0",
"countries-and-timezones": "^3.7.2",
"countries-db": "^1.2.0",
@@ -109,15 +112,16 @@
"crc": "^4.3.2",
"cron-parser": "^4.9.0",
"cron-validator": "^1.3.1",
"cronstrue": "^2.54.0",
"cronstrue": "^3.0.0",
"cross-spawn": "^7.0.6",
"crypto-js": "^4.2.0",
"csstoxpath": "^2.0.0",
"curlconverter": "^4.12.0",
"currency-codes-ts": "^3.0.0",
"currency-exchanger-js": "^1.0.4",
"damerau-levenshtein": "^1.0.8",
"data-guardian": "^1.1.3",
"date-fns": "^2.30.0",
"date-fns": "^4.0.0",
"date-holidays": "^3.23.21",
"decomposerize": "^1.4.4",
"detect-csv": "^1.1.0",
@@ -125,7 +129,7 @@
"dns-query": "^0.11.2",
"docker2kube": "^0.0.14",
"dom-to-image-more": "^3.5.0",
"dompurify": "^3.2.4",
"dompurify": "^3.2.6",
"duration-fns": "^3.0.2",
"email-bounce-parser-browser": "^1.1.0",
"email-normalizer": "^1.0.0",
@@ -136,11 +140,11 @@
"fanger": "^0.3.1",
"fast_array_intersect": "^1.1.0",
"fflate": "^0.8.2",
"figlet": "^1.8.0",
"figlet": "^1.8.2",
"figue": "^1.2.0",
"file-type": "^20.1.0",
"flatten-anything": "^4.0.1",
"flexsearch": "^0.8.167",
"file-type": "^21.0.0",
"flatten-anything": "^4.0.2",
"flexsearch": "^0.8.205",
"fuse.js": "^7.1.0",
"generate-schema": "^2.6.0",
"get-timezone-offset": "^1.0.5",
@@ -156,43 +160,43 @@
"iarna-toml-esm": "^3.0.5",
"ibantools": "^4.5.1",
"ical-generator": "^8.1.1",
"ical.js": "^2.1.0",
"ical.js": "^2.2.0",
"iconv-lite": "^0.6.3",
"image-in-browser": "^3.2.1",
"image-in-browser": "^3.2.3",
"image-to-ascii-art": "^0.0.4",
"ip-address": "^9.0.5",
"ip-bigint": "^8.2.0",
"ip-address": "^10.0.0",
"ip-bigint": "^8.2.1",
"ip-cidr": "^4.0.2",
"ip-matching": "^2.1.2",
"ip-regex": "^5.0.0",
"is-cidr": "^5.1.0",
"is-cidr": "^5.1.1",
"is-ip": "^5.0.1",
"isbn3": "^1.2.7",
"isbn3": "^1.2.12",
"iso-639-1": "^3.1.5",
"javastack.js": "^1.0.3",
"jks-js": "^1.1.4",
"jose": "^5.9.6",
"jose": "^5.10.0",
"jpeg-quality-estimator": "^1.0.1",
"jq-wasm": "^1.0.0",
"js-base64": "^3.7.7",
"js-beautify": "^1.15.2",
"jsbarcode": "^3.11.6",
"js-beautify": "^1.15.4",
"jsbarcode": "^3.12.1",
"json-analyzer": "^1.2.2",
"json-editor-vue": "^0.16.0",
"json-editor-vue": "^0.18.0",
"json-to-ts": "^1.7.0",
"json5": "^2.2.3",
"jsonar-mod": "^1.9.0",
"jsonlint-mod": "^1.7.6",
"jsonpath": "^1.1.1",
"jsonrepair": "^3.12.0",
"jsonrepair": "^3.13.0",
"jsonschema-protobuf": "^1.0.2",
"jsstack.js": "^2.0.0",
"jsvat-next": "^3.0.4",
"jszip": "^3.10.1",
"jwt-decode": "^4.0.0",
"korean-unpacker": "^1.0.3",
"libmime": "^5.3.6",
"libphonenumber-js": "^1.11.19",
"libmime": "^5.3.7",
"libphonenumber-js": "^1.12.10",
"lodash": "^4.17.21",
"lodash.defaultsdeep": "^4.6.1",
"lodash.flattendeep": "^4.4.0",
@@ -207,25 +211,26 @@
"markdown-it-sub": "^2.0.0",
"markdown-it-sup": "^2.0.0",
"marked": "^10.0.0",
"mathjs": "^14.2.1",
"mathjs": "^14.5.3",
"md-editor-v3": "^4.21.3",
"memorystream": "^0.3.1",
"mermaid": "^11.6.0",
"merge-anything": "^6.0.6",
"mermaid": "^11.9.0",
"mime-types": "^2.1.35",
"mitex-wasm": "^0.2.5",
"moment": "^2.30.1",
"monaco-editor": "^0.43.0",
"morsee": "^1.0.10",
"naive-ui": "^2.35.0",
"nanoid": "^5.0.9",
"nanoid": "^5.1.5",
"nanoid-dictionary": "^4.3.0",
"nestify-anything": "^3.0.3",
"netmask": "^2.0.2",
"netstack.js": "^2.1.1",
"netstack.js": "^2.1.2",
"nginx-config-formatter": "^1.4.5",
"node-forge": "^1.3.1",
"openpgp": "^6.1.1",
"oui-data": "^1.1.281",
"openpgp": "^6.2.0",
"oui-data": "^1.1.391",
"parse-duration": "^2.1.2",
"parse-torrent": "^11.0.18",
"paseto-ts": "^2.0.5",
@@ -234,8 +239,9 @@
"pdfjs-dist": "^4.8.69",
"pinia": "^2.0.34",
"plausible-tracker": "^0.3.9",
"port-numbers": "^8.0.22",
"postal-mime": "^2.4.3",
"podletjs": "^1.0.2",
"port-numbers": "^8.0.28",
"postal-mime": "^2.4.4",
"potrace": "^2.1.8",
"pp-qr-code": "^0.6.4",
"pretty-ms": "^9.2.0",
@@ -255,16 +261,17 @@
"safe-license-list": "^0.1.2",
"sandybox": "^1.1.2",
"sanitize-html": "^2.14.0",
"shiki": "1.22.2",
"silly-password-generator": "^1.0.28",
"shiki": "1.29.2",
"silly-password-generator": "^1.0.29",
"slashes": "^3.0.12",
"spdx-satisfies": "^5.0.1",
"sql-formatter": "^15.5.1",
"sql-formatter": "^15.6.6",
"sshpk": "^1.18.0",
"staveless-futhark": "^0.6.1",
"stringify-object": "^5.0.0",
"svg2png-wasm": "^1.4.1",
"svgo": "^3.3.2",
"swagger-ui-dist": "^5.27.0",
"tesseract.js": "^5.1.1",
"text-encoding-utf-8": "^1.0.2",
"tick-time": "^1.0.1",
@@ -272,19 +279,19 @@
"to-double-quotes": "^4.0.0",
"to-single-quotes": "^4.0.0",
"turndown": "^7.2.0",
"ua-parser-js": "^2.0.1",
"ulid": "^2.3.0",
"ua-parser-js": "^2.0.4",
"ulid": "^2.4.0",
"unicode-emoji-json": "^0.8.0",
"unique-random": "^4.0.0",
"unixcrypt-browser": "^2.0.4",
"unpdf": "^1.0.5",
"unpdf": "^1.1.0",
"unplugin-auto-import": "^0.16.4",
"utf8": "^3.0.0",
"uuid": "^11.0.5",
"uuid": "^11.1.0",
"vanilla-jsoneditor": "^0.23.8",
"vue": "^3.3.4",
"vue-color-wheel": "^0.1.1",
"vue-i18n": "^9.14.3",
"vue-i18n": "^11.1.9",
"vue-loading-overlay": "^6.0",
"vue-markdown-render": "^2.2.1",
"vue-mathjax-next": "^0.0.6",
@@ -299,27 +306,26 @@
"webcrypto-liner-shim": "^1.4.8",
"webp-converter-browser": "^1.0.4",
"xlsx": "https://cdn.sheetjs.com/xlsx-0.20.2/xlsx-0.20.2.tgz",
"xml-formatter": "^3.6.4",
"xml-formatter": "^3.6.6",
"xml-js": "^1.6.11",
"xpath": "^0.0.34",
"xpath-to-css": "^1.2.0",
"xslt-processor": "^3.3.1",
"xterm": "^5.3.0",
"yaml": "^2.7.0"
"yaml": "^2.8.0"
},
"devDependencies": {
"@antfu/eslint-config": "^0.41.0",
"@iconify-json/mdi": "^1.1.50",
"@intlify/unplugin-vue-i18n": "^0.13.0",
"@playwright/test": "^1.50.1",
"@intlify/unplugin-vue-i18n": "^6.0.8",
"@playwright/test": "^1.54.1",
"@rushstack/eslint-patch": "^1.2.0",
"@tsconfig/node18": "^18.2.0",
"@types/arr-diff": "^4.0.3",
"@types/bcryptjs": "^2.4.6",
"@types/big.js": "^6.2.2",
"@types/crypto-js": "^4.2.2",
"@types/dompurify": "^3.2.0",
"@types/emscripten": "^1.40.0",
"@types/damerau-levenshtein": "^1.0.2",
"@types/emscripten": "^1.40.1",
"@types/figlet": "^1.7.0",
"@types/har-format": "^1.2.16",
"@types/hex-array": "^1.0.2",
@@ -327,7 +333,7 @@
"@types/jsdom": "^21.1.7",
"@types/jsonpath": "^0.2.4",
"@types/libmime": "^5.0.3",
"@types/lodash": "^4.14.192",
"@types/lodash": "^4.17.20",
"@types/lodash.defaultsdeep": "^4.6.9",
"@types/lodash.flattendeep": "^4.4.9",
"@types/lodash.last": "^3.0.9",
@@ -338,8 +344,8 @@
"@types/morsee": "^1.0.2",
"@types/nanoid-dictionary": "^4.2.3",
"@types/netmask": "^2.0.5",
"@types/node": "^18.19.75",
"@types/node-forge": "^1.3.11",
"@types/node": "^18.19.120",
"@types/node-forge": "^1.3.13",
"@types/potrace": "^2.1.5",
"@types/punycode": "^2.1.4",
"@types/qrcode": "^1.5.5",
@@ -353,7 +359,7 @@
"@types/utf8": "^3.0.3",
"@types/uuid": "^9.0.8",
"@unocss/eslint-config": "^0.57.1",
"@vitejs/plugin-vue": "^4.3.2",
"@vitejs/plugin-vue": "^4.3.4",
"@vitejs/plugin-vue-jsx": "^3.0.2",
"@vue/compiler-sfc": "^3.2.47",
"@vue/runtime-dom": "^3.3.4",
@@ -373,12 +379,13 @@
"unplugin-vue-components": "^0.25.0",
"vite": "^4.4.9",
"vite-plugin-node-polyfills": "^0.23.0",
"vite-plugin-pwa": "^1.0.0",
"vite-plugin-pwa": "^1.0.1",
"vite-plugin-splash-screen": "^0.2.0",
"vite-plugin-vue-markdown": "^0.23.5",
"unplugin-vue-markdown": "^29.1.0",
"vite-plugin-wasm": "^3.4.1",
"vite-svg-loader": "^4.0.0",
"vitest": "^0.34.6",
"vue-i18n-extract": "^2.0.7",
"workbox-window": "^7.3.0",
"zx": "^7.2.3"
},
@@ -386,5 +393,8 @@
"overrides": {
"xlsx": "https://cdn.sheetjs.com/xlsx-0.20.2/xlsx-0.20.2.tgz"
}
},
"scarfSettings": {
"enabled": false
}
}
+875 -644
View File
File diff suppressed because it is too large. Load diff
+3 -3
View File
@@ -29,10 +29,10 @@ function processFile(filePath) {
// Modify name and description to use the translate function
const transformedContent = originalContent
.replace(/name: '((?:[^']+|(?<=\\)')+)'/, `name: translate('tools.${parentDir}.title')`)
.replace(/description: '((?:[^']+|(?<=\\)')+)'/, `description: translate('tools.${parentDir}.description')`);
.replace(/name: '((?:[^']+|(?<=\\)')+)'/, `name: t('tools.${parentDir}.title')`)
.replace(/description: '((?:[^']+|(?<=\\)')+)'/, `description: t('tools.${parentDir}.description')`);
fs.writeFileSync(filePath, `import { translate } from '@/plugins/i18n.plugin';\n${transformedContent}`, 'utf-8');
fs.writeFileSync(filePath, `import { translate as t } from '@/plugins/i18n.plugin';\n${transformedContent}`, 'utf-8');
console.log(`Transformed: ${filePath}`);
// Update locales file with extracted name and description
+136
View File
@@ -0,0 +1,136 @@
import fs from 'node:fs';
import path, { basename } from 'node:path';
import process from 'node:process';
import yaml from 'yaml';
const toolsDir = 'src/tools';
const localesFile = 'locales/en.yml';
// Load existing locales file or initialize an empty object
let localesData = {};
if (fs.existsSync(localesFile)) {
localesData = yaml.parse(fs.readFileSync(localesFile, 'utf-8')) || {};
}
// Function to process Vue components in a directory
function processVueComponents(toolDir, toolName) {
fs.readdirSync(toolDir)
.filter(file => file.endsWith('.vue'))
.forEach(file => processVueComponent(path.join(toolDir, file), toolName));
}
// Function to process a Vue component file
function processVueComponent(filePath, toolName) {
console.log(`Processing ${filePath} in ${toolName}`);
let content = fs.readFileSync(filePath, 'utf8');
const origContent = content;
// Update locales file with extracted name and description
if (!localesData.tools) {
localesData.tools = {};
}
if (!localesData.tools[toolName]) {
localesData.tools[toolName] = {};
}
// Regex to find label or placeholder attributes
let regex = /\b(label|text|message):\s*'((?:[^']|\\')+)'/g;
content = content.replace(regex, (match, attr, text) => {
if (!text?.trim()) {
return match;
}
const key = (attr + '-' + text.replace(/[\p{P}\p{S}\s]+/gu, '-').replace(/^-+|-+$/g, '').replace(/-+/g, '-')).toLowerCase();
if (!localesData.tools[toolName].texts) {
localesData.tools[toolName].texts = {};
}
localesData.tools[toolName].texts[key] = text;
return `${attr}: t('tools.${toolName}.texts.${key}')`;
});
if (filePath.endsWith('.vue')) {
// Regex to find label or placeholder attributes
regex = /(?<!:)((?:input-|output-)?(?:label|placeholder|title))="([^"]+)"/g;
content = content.replace(regex, (match, attr, text) => {
if (!text?.trim()) {
return match;
}
const key = (attr + '-' + text.replace(/[\p{P}\p{S}\s]+/gu, '-').replace(/^-+|-+$/g, '').replace(/-+/g, '-')).toLowerCase();
if (!localesData.tools[toolName].texts) {
localesData.tools[toolName].texts = {};
}
localesData.tools[toolName].texts[key] = text;
return `:${attr}="t('tools.${toolName}.texts.${key}')"`;
});
// Regex to find text inside HTML tags
const textInsideTagsRegex = /(?<!=)\>(?:\n\s*)?([^\<\>\n]+)(?:\n\s*)?\</g;
content = content.replace(textInsideTagsRegex, (match, text) => {
if (!text?.trim()) {
return match;
}
if (text.match(/[\}\{\|\[\<\>\]]/)) {
return match;
}
const key = ('tag-' + text.trim().replace(/[\p{P}\p{S}\s]+/gu, '-').replace(/^-+|-+$/g, '').replace(/-+/g, '-')).toLowerCase();
if (!localesData.tools[toolName].texts) {
localesData.tools[toolName].texts = {};
}
localesData.tools[toolName].texts[key] = text.trim();
return `>{{ t('tools.${toolName}.texts.${key}') }}<`;
});
}
if (origContent === content) {
console.log(`Nothing to extract in ${filePath}`);
return;
}
if (filePath.endsWith('.vue')) {
// Ensure the useI18n import exists
if (!content.includes("const { t } = useI18n();")) {
content = content.replace(/\<script setup( lang="ts")?\>/, "<script setup lang=\"ts\">\nimport { useI18n } from 'vue-i18n';\nconst { t } = useI18n();");
}
}
else {
// Ensure the useI18n import exists
if (!content.includes("import { translate as t } from '@/plugins/i18n.plugin';")) {
content = 'import { translate as t } from "@/plugins/i18n.plugin";\n' + content;
}
}
fs.writeFileSync(filePath, content, 'utf8');
console.log(`Processed: ${filePath}`);
}
const localFileOrDir = process.argv[2];
if (localFileOrDir) {
if (fs.statSync(localFileOrDir).isDirectory()) {
fs.readdirSync(localFileOrDir)
.filter((fileName) => {
const filePath = path.join(localFileOrDir, fileName);
return fs.statSync(filePath).isFile();
})
.forEach((fileName) => {
const filePath = path.join(localFileOrDir, fileName);
processVueComponent(filePath, process.argv[3] || basename(localFileOrDir));
});
} else {
processVueComponent(localFileOrDir, process.argv[3] || basename(localFileOrDir));
}
} else {
fs.readdirSync(toolsDir)
.filter((toolName) => {
const toolPath = path.join(toolsDir, toolName);
return fs.statSync(toolPath).isDirectory();
})
.forEach((toolName) => {
const toolPath = path.join(toolsDir, toolName);
console.log(`Processing tool: ${toolName}`);
processVueComponents(toolPath, toolName);
});
}
// Write back the updated locales file
fs.writeFileSync(localesFile, yaml.stringify(localesData), 'utf-8');
console.log('Locales file updated!');
console.log('Transformation completed!');
+5 -1
View File
@@ -23,7 +23,11 @@ async function checkTruncation() {
context.font = `${computedStyle.fontWeight} ${computedStyle.fontSize} ${computedStyle.fontFamily}`;
const textWidth = context.measureText(text).width;
const containerWidth = textRef.value.clientWidth;
// Calculate precise container width by accounting for padding
const containerWidth = textRef.value.clientWidth
- Number.parseFloat(computedStyle.paddingLeft)
- Number.parseFloat(computedStyle.paddingRight);
showTooltip.value = textWidth > containerWidth;
}
+2 -2
View File
@@ -29,8 +29,8 @@ const siderWidth = computed(() => {
return 0;
}
// Get 10% of window width, but ensure it's at least 240px
const tenPercent = windowWidth.value * 0.1;
// Use 12.5% of window width, but ensure it's at least 240px
const tenPercent = windowWidth.value * 0.125;
return Math.max(240, tenPercent);
});
</script>
+1
View File
@@ -52,6 +52,7 @@ hljs.registerLanguage('html', xmlHljs);
hljs.registerLanguage('xml', xmlHljs);
hljs.registerLanguage('yaml', yamlHljs);
hljs.registerLanguage('toml', iniHljs);
hljs.registerLanguage('ini', iniHljs);
hljs.registerLanguage('ts', tsHljs);
hljs.registerLanguage('typescript', tsHljs);
hljs.registerLanguage('bash', bashHljs);
+21 -36
View File
@@ -1,5 +1,5 @@
import { type MaybeRef, get } from '@vueuse/core';
import { computed, ref, watch } from 'vue';
import { computed, ref } from 'vue';
import FlexSearch from 'flexsearch';
// Define key types to match Fuse.js format
@@ -109,49 +109,34 @@ export function useFlexSearch<Data extends Record<string, any>>({
dataMap.value.set(itemKey, item);
});
// Batch add to indices - parallel processing with chunking
await Promise.all(
indices.map(async ({ key, index }) => {
// Filter items that have values for this key upfront
const itemsForThisKey = itemData
.map(({ itemKey, values }) => ({ itemKey, value: values.get(key) }))
.filter(({ value }) => value);
// Process indices sequentially to avoid event loop flooding
for (const { key, index } of indices) {
// Filter items that have values for this key upfront
const itemsForThisKey = itemData
.map(({ itemKey, values }) => ({ itemKey, value: values.get(key) }))
.filter(({ value }) => value);
// Process in chunks to avoid blocking the main thread
const chunkSize = 1000; // Adjust based on your data size
const chunks = [];
for (let i = 0; i < itemsForThisKey.length; i += chunkSize) {
chunks.push(itemsForThisKey.slice(i, i + chunkSize));
}
const chunkSize = 5000;
// Process each chunk asynchronously
for (const chunk of chunks) {
await new Promise<void>((resolve) => {
// Use setTimeout to yield control back to the browser
setTimeout(() => {
chunk.forEach(({ itemKey, value }) => {
index.add(itemKey, value!);
});
resolve();
}, 0);
for (let i = 0; i < itemsForThisKey.length; i += chunkSize) {
const chunk = itemsForThisKey.slice(i, i + chunkSize);
// Use requestAnimationFrame for better performance
await new Promise<void>((resolve) => {
requestAnimationFrame(() => {
chunk.forEach(({ itemKey, value }) => {
index.add(itemKey, value!);
});
resolve();
});
}
}),
);
});
}
}
};
// Initialize on creation
initializeIndices();
// Watch for data changes (deep watch for array content)
watch(
() => data,
() => {
initializeIndices();
},
{ immediate: true, deep: true },
);
// Function to search across all indices with weight consideration
const searchAllIndices = (query: string, searchLimit: number) => {
if (!query) {
+1 -1
View File
@@ -44,7 +44,7 @@ const toolFooter = computed<string>(() => {
packageName,
packageName.includes('://') ? packageName : `https://www.npmjs.com/package/${packageName}`),
);
return ((npmPackages.length > 0 ? `Made with ${npmPackages.join(', ')}\n` : '') + footer).trim();
return ((npmPackages.length > 0 ? t('tools.tool.layout.text.made-with-npmpackages-join-n', [npmPackages.join(', ')]) : '') + footer).trim();
});
const themeVars = useThemeVars();
</script>
+6
View File
@@ -9,6 +9,7 @@ import { registerSW } from 'virtual:pwa-register';
import shadow from 'vue-shadow-dom';
import { hideSplashScreen } from 'vite-plugin-splash-screen/runtime';
import { plausible } from './plugins/plausible.plugin';
import '@/utils/json5-bigint';
import 'virtual:uno.css';
@@ -20,6 +21,11 @@ import { i18nPlugin } from './plugins/i18n.plugin';
import store from './tools/pomodoro-timer/app/store';
// eslint-disable-next-line no-extend-native
BigInt.prototype.toJSON = function () {
return JSON.rawJSON ? JSON.rawJSON(this.toString()) : this.toString();
};
library.add(fas);
registerSW();
+2 -2
View File
@@ -15,7 +15,7 @@ export const i18nPlugin: Plugin = {
},
};
export const translate = function (localeKey: string) {
export const translate = function (localeKey: string, list: unknown[] = []) {
const hasKey = i18n.global.te(localeKey, get(i18n.global.locale));
return hasKey ? i18n.global.t(localeKey) : localeKey;
return hasKey ? i18n.global.t(localeKey, list) : localeKey;
};
+9
View File
@@ -43,3 +43,12 @@ declare module 'pdf-signature-reader' {
declare module 'vite-plugin-splash-screen/runtime' {
export function hideSplashScreen();
}
interface BigInt {
toJSON: () => string;
}
interface JSON {
parseBigInt: (jsonStr: string, options?: { minDigits?: number; fallbackToString?: boolean; }) => any;
rawJSON(value: string): any;
}
@@ -1,7 +1,10 @@
<script setup lang="ts">
import { useI18n } from 'vue-i18n';
import mappingData from './ad-mapping.json';
import { useFlexSearch } from '@/composable/flexSearch';
const { t } = useI18n();
const data = mappingData;
const search = ref('');
@@ -20,7 +23,7 @@ const { searchResult } = useFlexSearch({
<div flex items-center gap-3>
<c-input-text
v-model:value="search"
placeholder="Search Active Directory LDAP mapping"
:placeholder="t('tools.ad-ldap-searcher.texts.placeholder-search-active-directory-ldap-mapping')"
mx-auto max-w-600px
>
<template #prefix>
@@ -35,19 +38,19 @@ const { searchResult } = useFlexSearch({
mt-4 text-center text-20px font-bold
>
No results
{{ t('tools.ad-ldap-searcher.texts.tag-no-results') }}
</div>
<div v-else>
<div mt-4 text-20px font-bold>
Search result
{{ t('tools.ad-ldap-searcher.texts.tag-search-result') }}
</div>
<n-table>
<thead>
<th>TAB</th>
<th>Active Directory Field</th>
<th>LDAP Attribute</th>
<th>{{ t('tools.ad-ldap-searcher.texts.tag-tab') }}</th>
<th>{{ t('tools.ad-ldap-searcher.texts.tag-active-directory-field') }}</th>
<th>{{ t('tools.ad-ldap-searcher.texts.tag-ldap-attribute') }}</th>
</thead>
<tbody>
<tr v-for="(result, ix) in searchResult" :key="ix">
+3 -3
View File
@@ -1,11 +1,11 @@
import { Folder } from '@vicons/tabler';
import { defineTool } from '../tool';
import { translate } from '@/plugins/i18n.plugin';
import { translate as t } from '@/plugins/i18n.plugin';
export const tool = defineTool({
name: translate('tools.ad-ldap-searcher.title'),
name: t('tools.ad-ldap-searcher.title'),
path: '/ad-ldap-searcher',
description: translate('tools.ad-ldap-searcher.description'),
description: t('tools.ad-ldap-searcher.description'),
keywords: ['active', 'directory', 'ad', 'ldap', 'prop', 'searcher'],
component: () => import('./ad-ldap-searcher.vue'),
icon: Folder,
+41 -38
View File
@@ -1,7 +1,10 @@
<script setup lang="ts">
import { useI18n } from 'vue-i18n';
import { useScriptTag } from '@vueuse/core';
import ageWasmUrl from '/age-wasm/age.wasm?url';
const { t } = useI18n();
declare global {
interface Window {
generateX25519Identity: () => {
@@ -164,42 +167,42 @@ function onDecryptFilesUploaded(uploadedFiles: File[]) {
<template>
<n-tabs type="card">
<!-- Generate Keys -->
<n-tab-pane name="keys" tab="Generate Keys">
<n-card title="Private Key" mb-1>
<textarea-copyable v-model:value="privKey" rows="3" multiline placeholder="Your private key will be generated here." />
<n-tab-pane name="keys" :tab="t('tools.age-crypto.text.generate-keys')">
<n-card :title="t('tools.age-crypto.texts.title-private-key')" mb-1>
<textarea-copyable v-model:value="privKey" rows="3" multiline :placeholder="t('tools.age-crypto.texts.placeholder-your-private-key-will-be-generated-here')" />
</n-card>
<n-card title="Public Key" mb-1>
<textarea-copyable v-model:value="pubKey" rows="3" multiline placeholder="Your public key will be generated here." />
<n-card :title="t('tools.age-crypto.texts.title-public-key')" mb-1>
<textarea-copyable v-model:value="pubKey" rows="3" multiline :placeholder="t('tools.age-crypto.texts.placeholder-your-public-key-will-be-generated-here')" />
</n-card>
<n-button type="primary" @click="generateKeys">
Generate Keys
{{ t('tools.age-crypto.texts.tag-generate-keys') }}
</n-button>
</n-tab-pane>
<!-- Encrypt Text -->
<n-tab-pane name="encrypt" tab="Encrypt">
<n-card title="Public Keys" mb-1>
<n-input v-model:value="recipients" type="textarea" placeholder="Recipient key or keys one per line" required />
<n-tab-pane name="encrypt" :tab="t('tools.age-crypto.text.encrypt')">
<n-card :title="t('tools.age-crypto.texts.title-public-keys')" mb-1>
<n-input v-model:value="recipients" type="textarea" :placeholder="t('tools.age-crypto.texts.placeholder-recipient-key-or-keys-one-per-line')" required />
</n-card>
<n-card title="Message" mb-1>
<n-input v-model:value="message" type="textarea" placeholder="Message to encrypt" required />
<n-card :title="t('tools.age-crypto.texts.title-message')" mb-1>
<n-input v-model:value="message" type="textarea" :placeholder="t('tools.age-crypto.texts.placeholder-message-to-encrypt')" required />
</n-card>
<n-card title="Output" mb-1>
<textarea-copyable v-model:value="encryptedOutput" rows="3" multiline placeholder="Encrypted output will be generated here." />
<n-card :title="t('tools.age-crypto.texts.title-output')" mb-1>
<textarea-copyable v-model:value="encryptedOutput" rows="3" multiline :placeholder="t('tools.age-crypto.texts.placeholder-encrypted-output-will-be-generated-here')" />
</n-card>
<n-button type="primary" @click="encrypt">
Encrypt
{{ t('tools.age-crypto.texts.tag-encrypt') }}
</n-button>
</n-tab-pane>
<!-- Encrypt Binary -->
<n-tab-pane name="encryptBinary" tab="Encrypt Binary">
<n-card title="Public Keys" mb-1>
<n-input v-model:value="recipientsBinary" type="textarea" placeholder="Recipient key or keys one per line" required />
<n-tab-pane name="encryptBinary" :tab="t('tools.age-crypto.text.encrypt-binary')">
<n-card :title="t('tools.age-crypto.texts.title-public-keys')" mb-1>
<n-input v-model:value="recipientsBinary" type="textarea" :placeholder="t('tools.age-crypto.texts.placeholder-recipient-key-or-keys-one-per-line')" required />
</n-card>
<n-card title="Files" mb-1>
<n-card :title="t('tools.age-crypto.texts.title-files')" mb-1>
<c-file-upload
title="Drag and drop files here, or click to select some files"
:title="t('tools.age-crypto.texts.title-drag-and-drop-files-here-or-click-to-select-some-files')"
multiple
@files-upload="onEncryptFilesUploaded"
/>
@@ -209,38 +212,38 @@ function onDecryptFilesUploaded(uploadedFiles: File[]) {
</li>
</ul>
</n-card>
<n-card title="Output" mb-1>
<p>The encrypted files will be downloaded.</p>
<n-card :title="t('tools.age-crypto.texts.title-output')" mb-1>
<p>{{ t('tools.age-crypto.texts.tag-the-encrypted-files-will-be-downloaded') }}</p>
</n-card>
<n-button type="primary" @click="encryptBinary">
Encrypt Binary
{{ t('tools.age-crypto.texts.tag-encrypt-binary') }}
</n-button>
</n-tab-pane>
<!-- Decrypt Text -->
<n-tab-pane name="decrypt" tab="Decrypt">
<n-card title="Private Keys" mb-1>
<n-input v-model:value="identities" type="textarea" placeholder="Identity key or keys one per line" required />
<n-tab-pane name="decrypt" :tab="t('tools.age-crypto.text.decrypt')">
<n-card :title="t('tools.age-crypto.texts.title-private-keys')" mb-1>
<n-input v-model:value="identities" type="textarea" :placeholder="t('tools.age-crypto.texts.placeholder-identity-key-or-keys-one-per-line')" required />
</n-card>
<n-card title="Encrypted Text" mb-1>
<n-input v-model:value="encryptedText" type="textarea" placeholder="Paste here encrypted text" required />
<n-card :title="t('tools.age-crypto.texts.title-encrypted-text')" mb-1>
<n-input v-model:value="encryptedText" type="textarea" :placeholder="t('tools.age-crypto.texts.placeholder-paste-here-encrypted-text')" required />
</n-card>
<n-card title="Output" mb-1>
<textarea-copyable v-model:value="decryptedOutput" rows="3" multiline placeholder="Decrypted output will be generated here." />
<n-card :title="t('tools.age-crypto.texts.title-output')" mb-1>
<textarea-copyable v-model:value="decryptedOutput" rows="3" multiline :placeholder="t('tools.age-crypto.texts.placeholder-decrypted-output-will-be-generated-here')" />
</n-card>
<n-button type="primary" @click="decrypt">
Decrypt
{{ t('tools.age-crypto.texts.tag-decrypt') }}
</n-button>
</n-tab-pane>
<!-- Decrypt Binary -->
<n-tab-pane name="decryptBinary" tab="Decrypt Binary">
<n-card title="Private Keys" mb-1>
<n-input v-model:value="identitiesBinary" type="textarea" placeholder="Identity key or keys one per line" required />
<n-tab-pane name="decryptBinary" :tab="t('tools.age-crypto.text.decrypt-binary')">
<n-card :title="t('tools.age-crypto.texts.title-private-keys')" mb-1>
<n-input v-model:value="identitiesBinary" type="textarea" :placeholder="t('tools.age-crypto.texts.placeholder-identity-key-or-keys-one-per-line')" required />
</n-card>
<n-card title="Encrypted Files" mb-1>
<n-card :title="t('tools.age-crypto.texts.title-encrypted-files')" mb-1>
<c-file-upload
title="Drag and drop files here, or click to select some files"
:title="t('tools.age-crypto.texts.title-drag-and-drop-files-here-or-click-to-select-some-files')"
multiple
@files-upload="onDecryptFilesUploaded"
/>
@@ -250,11 +253,11 @@ function onDecryptFilesUploaded(uploadedFiles: File[]) {
</li>
</ul>
</n-card>
<n-card title="Output" mb-1>
<p>The decrypted files will be downloaded.</p>
<n-card :title="t('tools.age-crypto.texts.title-output')" mb-1>
<p>{{ t('tools.age-crypto.texts.tag-the-decrypted-files-will-be-downloaded') }}</p>
</n-card>
<n-button type="primary" @click="decryptBinary">
Decrypt Binary
{{ t('tools.age-crypto.texts.tag-decrypt-binary') }}
</n-button>
</n-tab-pane>
</n-tabs>
+3 -3
View File
@@ -1,11 +1,11 @@
import { EyeOff } from '@vicons/tabler';
import { defineTool } from '../tool';
import { translate } from '@/plugins/i18n.plugin';
import { translate as t } from '@/plugins/i18n.plugin';
export const tool = defineTool({
name: translate('tools.age-crypto.title'),
name: t('tools.age-crypto.title'),
path: '/age-crypto',
description: translate('tools.age-crypto.description'),
description: t('tools.age-crypto.description'),
keywords: ['age'],
component: () => import('./age-crypto.vue'),
icon: EyeOff,
@@ -1,7 +1,10 @@
<script setup lang="ts">
import { useI18n } from 'vue-i18n';
import promptSplitter from 'chatgpt-prompt-splitter';
import { useValidation } from '@/composable/validation';
const { t } = useI18n();
const prompt = ref('');
const splitLength = ref(1024);
@@ -23,7 +26,7 @@ const promptValidation = useValidation({
rules: [
{
validator: v => v !== '',
message: 'Prompt must not be empty',
message: t('tools.ai-prompt-splitter.texts.message-prompt-must-not-be-empty'),
},
],
});
@@ -31,22 +34,22 @@ const promptValidation = useValidation({
<template>
<div>
<c-card title="Prompt and options" mb-2>
<c-card :title="t('tools.ai-prompt-splitter.texts.title-prompt-and-options')" mb-2>
<c-input-text
v-model:value="prompt"
label="Full Prompt"
:label="t('tools.ai-prompt-splitter.texts.label-full-prompt')"
multiline
placeholder="Put your full prompt here..."
:placeholder="t('tools.ai-prompt-splitter.texts.placeholder-put-your-full-prompt-here')"
rows="10"
:validation="promptValidation"
mb-2
/>
<n-form-item label="Character length for each chunk">
<n-form-item :label="t('tools.ai-prompt-splitter.texts.label-character-length-for-each-chunk')">
<n-input-number v-model:value="splitLength" :min="1" />
</n-form-item>
</c-card>
<c-card title="Divided prompts">
<c-card :title="t('tools.ai-prompt-splitter.texts.title-divided-prompts')">
<div v-for="(splittedPrompt, index) in splittedPrompts" :key="index">
<TextareaCopyable :value="splittedPrompt" />
</div>
+3 -3
View File
@@ -1,11 +1,11 @@
import { Prompt } from '@vicons/tabler';
import { defineTool } from '../tool';
import { translate } from '@/plugins/i18n.plugin';
import { translate as t } from '@/plugins/i18n.plugin';
export const tool = defineTool({
name: translate('tools.ai-prompt-splitter.title'),
name: t('tools.ai-prompt-splitter.title'),
path: '/ai-prompt-splitter',
description: translate('tools.ai-prompt-splitter.description'),
description: t('tools.ai-prompt-splitter.description'),
keywords: ['ai', 'chatgpt', 'gpt', 'prompt', 'splitter'],
component: () => import('./ai-prompt-splitter.vue'),
icon: Prompt,
+3 -3
View File
@@ -1,11 +1,11 @@
import { Angle } from '@vicons/tabler';
import { defineTool } from '../tool';
import { translate } from '@/plugins/i18n.plugin';
import { translate as t } from '@/plugins/i18n.plugin';
export const tool = defineTool({
name: translate('tools.angle-converter.title'),
name: t('tools.angle-converter.title'),
path: '/angle-converter',
description: translate('tools.angle-converter.description'),
description: t('tools.angle-converter.description'),
keywords: ['angle', 'converter'],
component: () => import('./angle-converter.vue'),
icon: Angle,
@@ -1,14 +1,17 @@
<script setup lang="ts">
import { useI18n } from 'vue-i18n';
import { onMounted, ref } from 'vue';
import {
NButton, NCheckbox, NCheckboxGroup, NInput,
} from 'naive-ui';
import { Terminal } from 'xterm';
import 'xterm/css/xterm.css';
import { Terminal } from '@xterm/xterm';
import '@xterm/xterm/css/xterm.css';
import styles from 'ansi-styles';
import type { CSPair } from 'ansi-styles';
import { useQueryParamOrStorage } from '@/composable/queryParams';
const { t } = useI18n();
const terminalContainer = ref<HTMLElement | null>(null);
const decoratedText = useQueryParamOrStorage({ name: 'text', storageName: 'ansi:t', defaultValue: 'Sample text' });
@@ -80,71 +83,71 @@ const escapeSequenceToTest = ref('');
<template>
<div>
<NSpace justify="center">
<n-form-item label="Mode:" label-placement="left">
<n-form-item :label="t('tools.ansi-escape-tester.texts.label-mode')" label-placement="left">
<n-radio-group v-model:value="colorMode">
<n-radio value="basic">
Basic
{{ t('tools.ansi-escape-tester.texts.tag-basic') }}
</n-radio>
<n-radio value="256">
256-color
{{ t('tools.ansi-escape-tester.texts.tag-256-color') }}
</n-radio>
<n-radio value="truecolor">
Truecolor
{{ t('tools.ansi-escape-tester.texts.tag-truecolor') }}
</n-radio>
</n-radio-group>
</n-form-item>
</NSpace>
<n-form-item label="Foreground:" label-placement="left" mb-1>
<n-form-item :label="t('tools.ansi-escape-tester.texts.label-foreground')" label-placement="left" mb-1>
<n-color-picker v-model:value="foregroundColor" :modes="['hex']" :show-alpha="false" :actions="['clear']" />
</n-form-item>
<n-form-item label="Background:" label-placement="left" mb-1>
<n-form-item :label="t('tools.ansi-escape-tester.texts.label-background')" label-placement="left" mb-1>
<n-color-picker v-model:value="backgroundColor" :modes="['hex']" :show-alpha="false" :actions="['clear']" />
</n-form-item>
<NSpace justify="center" mb-1>
<n-form-item label="Styles:" label-placement="left">
<n-form-item :label="t('tools.ansi-escape-tester.texts.label-styles')" label-placement="left">
<NCheckboxGroup v-model:value="fontStyles">
<NCheckbox value="bold">
Bold
{{ t('tools.ansi-escape-tester.texts.tag-bold') }}
</NCheckbox>
<NCheckbox value="italic">
Italic
{{ t('tools.ansi-escape-tester.texts.tag-italic') }}
</NCheckbox>
<NCheckbox value="underline">
Underline
{{ t('tools.ansi-escape-tester.texts.tag-underline') }}
</NCheckbox>
<NCheckbox value="overline">
Overline
{{ t('tools.ansi-escape-tester.texts.tag-overline') }}
</NCheckbox>
<NCheckbox value="inverse">
Inverse
{{ t('tools.ansi-escape-tester.texts.tag-inverse') }}
</NCheckbox>
<NCheckbox value="dim">
Dim
{{ t('tools.ansi-escape-tester.texts.tag-dim') }}
</NCheckbox>
<NCheckbox value="strikethrough">
Strikethrough
{{ t('tools.ansi-escape-tester.texts.tag-strikethrough') }}
</NCheckbox>
</NCheckboxGroup>
</n-form-item>
</NSpace>
<n-form-item label="Decorated text:" label-placement="left" mb-1>
<NInput v-model:value="decoratedText" placeholder="Enter text" />
<n-form-item :label="t('tools.ansi-escape-tester.texts.label-decorated-text')" label-placement="left" mb-1>
<NInput v-model:value="decoratedText" :placeholder="t('tools.ansi-escape-tester.texts.placeholder-enter-text')" />
</n-form-item>
<c-card title="Output ANSI Escape Sequence:">
<c-card :title="t('tools.ansi-escape-tester.texts.title-output-ansi-escape-sequence')">
<input-copyable v-model:value="outputEscapeSequence" readonly />
</c-card>
<c-card title="Terminal Preview:">
<n-form-item label-placement="left" label="Custom ANSI Sequence:">
<NInput v-model:value="escapeSequenceToTest" placeholder="Enter ANSI escape sequence" />
<c-card :title="t('tools.ansi-escape-tester.texts.title-terminal-preview')">
<n-form-item label-placement="left" :label="t('tools.ansi-escape-tester.texts.label-custom-ansi-sequence')">
<NInput v-model:value="escapeSequenceToTest" :placeholder="t('tools.ansi-escape-tester.texts.placeholder-enter-ansi-escape-sequence')" />
<NButton type="primary" ml-1 @click="term?.writeln(escapeSequenceToTest)">
Test
{{ t('tools.ansi-escape-tester.texts.tag-test') }}
</NButton>
<NButton type="primary" ml-1 @click="term?.clear()">
Clear
{{ t('tools.ansi-escape-tester.texts.tag-clear') }}
</NButton>
</n-form-item>
<div ref="terminalContainer" class="terminal" />
+3 -3
View File
@@ -1,11 +1,11 @@
import { Terminal2 } from '@vicons/tabler';
import { defineTool } from '../tool';
import { translate } from '@/plugins/i18n.plugin';
import { translate as t } from '@/plugins/i18n.plugin';
export const tool = defineTool({
name: translate('tools.ansi-escape-tester.title'),
name: t('tools.ansi-escape-tester.title'),
path: '/ansi-escape-tester',
description: translate('tools.ansi-escape-tester.description'),
description: t('tools.ansi-escape-tester.description'),
keywords: ['ansi', 'escape', 'tester'],
component: () => import('./ansi-escape-tester.vue'),
icon: Terminal2,
@@ -1,7 +1,10 @@
<script setup lang="ts">
import { useI18n } from 'vue-i18n';
import { Vault } from 'ansible-vault';
import TextareaCopyable from '@/components/TextareaCopyable.vue';
const { t } = useI18n();
const decryptedInput = ref('');
const encryptPassword = ref('');
const encryptId = ref('');
@@ -34,11 +37,11 @@ const decryptedOutput = computedAsync(
</script>
<template>
<c-card title="Encrypt Ansible Vault Secret">
<c-card :title="t('tools.ansible-vault-crypt-decrypt.texts.title-encrypt-ansible-vault-secret')">
<c-input-text
v-model:value="decryptedInput"
placeholder="Put your string to encrypt..."
label="String to encrypt"
:placeholder="t('tools.ansible-vault-crypt-decrypt.texts.placeholder-put-your-string-to-encrypt')"
:label="t('tools.ansible-vault-crypt-decrypt.texts.label-string-to-encrypt')"
raw-text
mb-5
/>
@@ -46,15 +49,15 @@ const decryptedOutput = computedAsync(
<n-space>
<c-input-text
v-model:value="encryptPassword"
placeholder="Encryption password"
label="Encryption password"
:placeholder="t('tools.ansible-vault-crypt-decrypt.texts.placeholder-encryption-password')"
:label="t('tools.ansible-vault-crypt-decrypt.texts.label-encryption-password')"
raw-text
mb-5
/>
<c-input-text
v-model:value="encryptId"
placeholder="Encryption Id"
label="Encryption Id"
:placeholder="t('tools.ansible-vault-crypt-decrypt.texts.placeholder-encryption-id')"
:label="t('tools.ansible-vault-crypt-decrypt.texts.label-encryption-id')"
raw-text
mb-5
/>
@@ -63,7 +66,7 @@ const decryptedOutput = computedAsync(
<n-divider />
<TextareaCopyable
label="Encrypted string"
:label="t('tools.ansible-vault-crypt-decrypt.texts.label-encrypted-string')"
:value="cryptedOutput"
multiline
readonly
@@ -72,19 +75,19 @@ const decryptedOutput = computedAsync(
/>
</c-card>
<c-card title="Decrypt Ansible Vault Secret">
<c-card :title="t('tools.ansible-vault-crypt-decrypt.texts.title-decrypt-ansible-vault-secret')">
<c-input-text
v-model:value="cryptedInput"
placeholder="Put your encrypted string here..."
label="String to decrypt"
:placeholder="t('tools.ansible-vault-crypt-decrypt.texts.placeholder-put-your-encrypted-string-here')"
:label="t('tools.ansible-vault-crypt-decrypt.texts.label-string-to-decrypt')"
raw-text multiline mb-5
rows="5"
/>
<c-input-text
v-model:value="decryptPassword"
placeholder="Decryption password"
label="Decryption password"
:placeholder="t('tools.ansible-vault-crypt-decrypt.texts.placeholder-decryption-password')"
:label="t('tools.ansible-vault-crypt-decrypt.texts.label-decryption-password')"
raw-text
mb-5
/>
@@ -92,7 +95,7 @@ const decryptedOutput = computedAsync(
<n-divider />
<TextareaCopyable
label="Decrypted string"
:label="t('tools.ansible-vault-crypt-decrypt.texts.label-decrypted-string')"
:value="decryptedOutput"
multiline
readonly
@@ -1,11 +1,11 @@
import { LockSquare } from '@vicons/tabler';
import { defineTool } from '../tool';
import { translate } from '@/plugins/i18n.plugin';
import { translate as t } from '@/plugins/i18n.plugin';
export const tool = defineTool({
name: translate('tools.ansible-vault-crypt-decrypt.title'),
name: t('tools.ansible-vault-crypt-decrypt.title'),
path: '/ansible-vault-crypt-decrypt',
description: translate('tools.ansible-vault-crypt-decrypt.description'),
description: t('tools.ansible-vault-crypt-decrypt.description'),
keywords: ['ansible', 'vault', 'crypt', 'decrypt'],
component: () => import('./ansible-vault-crypt-decrypt.vue'),
icon: LockSquare,
+22 -19
View File
@@ -1,7 +1,10 @@
<script setup lang="ts">
import { useI18n } from 'vue-i18n';
import { useQueryParamOrStorage } from '@/composable/queryParams';
import TextareaCopyable from '@/components/TextareaCopyable.vue';
const { t } = useI18n();
interface KeyValuePair {
key: string
value?: string
@@ -72,50 +75,50 @@ function emptyKeyPair() {
<template>
<div>
<c-card title="API Calling">
<c-card :title="t('tools.api-tester.texts.title-api-calling')">
<c-input-text
v-model:value="baseUrl"
label="Base API Url"
placeholder="Base API Url"
:label="t('tools.api-tester.texts.label-base-api-url')"
:placeholder="t('tools.api-tester.texts.placeholder-base-api-url')"
mb-2
/>
<c-select
v-model:value="method"
label="HTTP Method:"
:label="t('tools.api-tester.texts.label-http-method')"
:options="['GET', 'POST', 'PUT', 'DELETE', 'PATCH']"
mb-2
/>
<c-card title="Headers" mb-2>
<c-card :title="t('tools.api-tester.texts.title-headers')" mb-2>
<n-dynamic-input v-model:value="headers" :on-create="emptyKeyPair">
<template #create-button-default>
Add a new HTTP Header
{{ t('tools.api-tester.texts.tag-add-a-new-http-header') }}
</template>
<template #default="{ value }">
<div v-if="value" w-100 flex justify-center gap-2>
<c-input-text v-model:value="value.key" placeholder="Header Name" type="text" />
<c-input-text v-model:value="value.value" placeholder="Value" type="text" />
<c-input-text v-model:value="value.key" :placeholder="t('tools.api-tester.texts.placeholder-header-name')" type="text" />
<c-input-text v-model:value="value.value" :placeholder="t('tools.api-tester.texts.placeholder-value')" type="text" />
</div>
</template>
</n-dynamic-input>
<c-select
v-model:value="contentType"
label="Content-Type:"
:label="t('tools.api-tester.texts.label-content-type')"
:options="['application/json', 'text/plain']"
mt-2
/>
</c-card>
<c-card title="Query Parameters" mb-2>
<c-card :title="t('tools.api-tester.texts.title-query-parameters')" mb-2>
<n-dynamic-input v-model:value="queryParams" :on-create="emptyKeyPair">
<template #create-button-default>
Add a new Query Parameter
{{ t('tools.api-tester.texts.tag-add-a-new-query-parameter') }}
</template>
<template #default="{ value }">
<div v-if="value" w-100 flex justify-center gap-2>
<c-input-text v-model:value="value.key" placeholder="Param Name" type="text" />
<c-input-text v-model:value="value.value" placeholder="Value" type="text" />
<c-input-text v-model:value="value.key" :placeholder="t('tools.api-tester.texts.placeholder-param-name')" type="text" />
<c-input-text v-model:value="value.value" :placeholder="t('tools.api-tester.texts.placeholder-value')" type="text" />
</div>
</template>
</n-dynamic-input>
@@ -123,20 +126,20 @@ function emptyKeyPair() {
<c-input-text
v-if="method !== 'GET' && method !== 'HEAD'"
v-model:value="body"
label="Body"
placeholder="HTTP Query body"
:label="t('tools.api-tester.texts.label-body')"
:placeholder="t('tools.api-tester.texts.placeholder-http-query-body')"
multiline
monospace
mb-2
/>
<n-checkbox v-model:checked="noCORS">
No CORS
{{ t('tools.api-tester.texts.tag-no-cors') }}
</n-checkbox>
<div mt-5 flex justify-center>
<c-button secondary @click="callAPI">
Call API
{{ t('tools.api-tester.texts.tag-call-api') }}
</c-button>
</div>
</c-card>
@@ -144,11 +147,11 @@ function emptyKeyPair() {
v-if="inprogress"
size="small"
/>
<c-alert v-if="!inprogress && apiCallResult && apiCallResult.code !== 200" type="error" mt-12 title="Error while calling API">
<c-alert v-if="!inprogress && apiCallResult && apiCallResult.code !== 200" type="error" mt-12 :title="t('tools.api-tester.texts.title-error-while-calling-api')">
<p><strong>Status code = {{ apiCallResult.code }}</strong></p>
<TextareaCopyable :value="apiCallResult.error" copy-placement="none" />
</c-alert>
<c-card v-if="!inprogress && apiCallResult && apiCallResult.code === 200" mt-12 title="API Call result">
<c-card v-if="!inprogress && apiCallResult && apiCallResult.code === 200" mt-12 :title="t('tools.api-tester.texts.title-api-call-result')">
<TextareaCopyable :value="apiCallResult.result" word-wrap />
</c-card>
</div>
+3 -3
View File
@@ -1,11 +1,11 @@
import { World } from '@vicons/tabler';
import { defineTool } from '../tool';
import { translate } from '@/plugins/i18n.plugin';
import { translate as t } from '@/plugins/i18n.plugin';
export const tool = defineTool({
name: translate('tools.api-tester.title'),
name: t('tools.api-tester.title'),
path: '/api-tester',
description: translate('tools.api-tester.description'),
description: t('tools.api-tester.description'),
keywords: ['api', 'http', 'call', 'tester'],
component: () => import('./api-tester.vue'),
icon: World,
+3 -3
View File
@@ -1,11 +1,11 @@
import { SquaresDiagonal } from '@vicons/tabler';
import { defineTool } from '../tool';
import { translate } from '@/plugins/i18n.plugin';
import { translate as t } from '@/plugins/i18n.plugin';
export const tool = defineTool({
name: translate('tools.area-converter.title'),
name: t('tools.area-converter.title'),
path: '/area-converter',
description: translate('tools.area-converter.description'),
description: t('tools.area-converter.description'),
keywords: ['area', 'converter'],
component: () => import('./area-converter.vue'),
icon: SquaresDiagonal,
@@ -75,12 +75,12 @@ const fonts = ['1Row', '3-D', '3D Diagonal', '3D-ASCII', '3x5', '4Max', '5 Line
:label="t('tools.ascii-text-drawer.font')"
:options="fonts"
searchable="true"
placeholder="Select font to use"
:placeholder="t('tools.ascii-text-drawer.texts.placeholder-select-font-to-use')"
/>
</n-gi>
<n-gi span="2">
<n-form-item :label="t('tools.ascii-text-drawer.width')" label-placement="top" label-width="100" :show-feedback="false">
<n-input-number v-model:value="width" min="0" max="10000" w-full placeholder="Width of the text" />
<n-input-number v-model:value="width" min="0" max="10000" w-full :placeholder="t('tools.ascii-text-drawer.texts.placeholder-width-of-the-text')" />
</n-form-item>
</n-gi>
</n-grid>
+3 -3
View File
@@ -1,11 +1,11 @@
import { Artboard } from '@vicons/tabler';
import { defineTool } from '../tool';
import { translate } from '@/plugins/i18n.plugin';
import { translate as t } from '@/plugins/i18n.plugin';
export const tool = defineTool({
name: translate('tools.ascii-text-drawer.title'),
name: t('tools.ascii-text-drawer.title'),
path: '/ascii-text-drawer',
description: translate('tools.ascii-text-drawer.description'),
description: t('tools.ascii-text-drawer.description'),
keywords: ['ascii', 'asciiart', 'text', 'drawer'],
component: () => import('./ascii-text-drawer.vue'),
icon: Artboard,
@@ -1,5 +1,6 @@
<!-- AspectRatioCalculator.vue -->
<script setup lang="ts">
import { useI18n } from 'vue-i18n';
import { ref } from 'vue';
import { NButton, NInputNumber, NRadio, NRadioGroup, NSpace } from 'naive-ui';
import {
@@ -7,6 +8,8 @@ import {
calculateDimensions,
} from './aspect-ratio-calculator.service';
const { t } = useI18n();
const width = ref<number | null>(null);
const height = ref<number | null>(null);
const r1 = ref<number | null>(null);
@@ -72,47 +75,47 @@ function clearRatio() {
<NSpace vertical :size="24">
<NRadioGroup v-model:value="mode">
<NRadio value="ratio">
Calculate Aspect Ratio
{{ t('tools.aspect-ratio-calculator.texts.tag-calculate-aspect-ratio') }}
</NRadio>
<NRadio value="dimensions">
Calculate Dimensions
{{ t('tools.aspect-ratio-calculator.texts.tag-calculate-dimensions') }}
</NRadio>
</NRadioGroup>
<div class="input-group">
<div class="input-pair">
<label>Pixels width</label>
<NInputNumber v-model:value="width" placeholder="Pixels width" :min="1" />
<label>{{ t('tools.aspect-ratio-calculator.texts.tag-pixels-width') }}</label>
<NInputNumber v-model:value="width" :placeholder="t('tools.aspect-ratio-calculator.texts.placeholder-pixels-width')" :min="1" />
</div>
<div class="input-pair">
<label>Pixels height</label>
<NInputNumber v-model:value="height" placeholder="Pixels height" :min="1" />
<label>{{ t('tools.aspect-ratio-calculator.texts.tag-pixels-height') }}</label>
<NInputNumber v-model:value="height" :placeholder="t('tools.aspect-ratio-calculator.texts.placeholder-pixels-height')" :min="1" />
</div>
</div>
<div class="input-group">
<div class="input-pair">
<label>Ratio width</label>
<NInputNumber v-model:value="r1" placeholder="Ratio width" :min="1" />
<label>{{ t('tools.aspect-ratio-calculator.texts.tag-ratio-width') }}</label>
<NInputNumber v-model:value="r1" :placeholder="t('tools.aspect-ratio-calculator.texts.placeholder-ratio-width')" :min="1" />
</div>
<div class="separator">
:
{{ t('tools.aspect-ratio-calculator.texts.tag-') }}
</div>
<div class="input-pair">
<label>Ratio height</label>
<NInputNumber v-model:value="r2" placeholder="Ratio height" :min="1" />
<label>{{ t('tools.aspect-ratio-calculator.texts.tag-ratio-height') }}</label>
<NInputNumber v-model:value="r2" :placeholder="t('tools.aspect-ratio-calculator.texts.placeholder-ratio-height')" :min="1" />
</div>
</div>
<div class="button-container">
<NButton type="primary" @click="calculateResult">
Calculate
{{ t('tools.aspect-ratio-calculator.texts.tag-calculate') }}
</NButton>
<NButton v-if="mode === 'ratio'" @click="clearRatio">
Clear Ratio
{{ t('tools.aspect-ratio-calculator.texts.tag-clear-ratio') }}
</NButton>
<NButton @click="clearAll">
Clear All
{{ t('tools.aspect-ratio-calculator.texts.tag-clear-all') }}
</NButton>
</div>
+3 -3
View File
@@ -1,11 +1,11 @@
import { AspectRatio } from '@vicons/tabler';
import { defineTool } from '../tool';
import { translate } from '@/plugins/i18n.plugin';
import { translate as t } from '@/plugins/i18n.plugin';
export const tool = defineTool({
name: translate('tools.aspect-ratio-calculator.title'),
name: t('tools.aspect-ratio-calculator.title'),
path: '/aspect-ratio-calculator',
description: translate('tools.aspect-ratio-calculator.description'),
description: t('tools.aspect-ratio-calculator.description'),
keywords: ['aspect', 'ratio', 'calculator'],
component: () => import('./aspect-ratio-calculator.vue'),
icon: AspectRatio,
@@ -1,10 +1,13 @@
<script setup lang="ts">
import { useI18n } from 'vue-i18n';
import bwipjs, { type RenderOptions } from 'bwip-js/browser';
import { Base64 } from 'js-base64';
import formats from './barcode.formats.json';
import { useDownloadFileFromBase64 } from '@/composable/downloadBase64';
import { useQueryParamOrStorage } from '@/composable/queryParams';
const { t } = useI18n();
const foreground = useQueryParamOrStorage({ name: 'fg', storageName: 'barcode-gen:fg', defaultValue: '#000000' });
const background = useQueryParamOrStorage({ name: 'bg', storageName: 'barcode-gen:bg', defaultValue: '#FFFFFF' });
const scale = useQueryParamOrStorage({ name: 'scale', storageName: 'barcode-gen:scale', defaultValue: 2 });
@@ -67,17 +70,17 @@ const { download: downloadSVG } = useDownloadFileFromBase64({ source: barcodeSVG
label-position="left"
label-width="130px"
label-align="right"
label="Text:"
:label="t('tools.barcode-generator.texts.label-text')"
multiline
rows="1"
autosize
placeholder="Your barcode..."
:placeholder="t('tools.barcode-generator.texts.placeholder-your-barcode')"
mb-6
/>
<n-form label-width="130" label-placement="left">
<c-select
v-model:value="format"
label="Format:"
:label="t('tools.barcode-generator.texts.label-format')"
label-position="left"
label-width="130px"
label-align="right"
@@ -86,22 +89,22 @@ const { download: downloadSVG } = useDownloadFileFromBase64({ source: barcodeSVG
mb-4
/>
<n-form-item label="Foreground color:">
<n-form-item :label="t('tools.barcode-generator.texts.label-foreground-color')">
<n-color-picker v-model:value="foreground" :modes="['hex']" :show-alpha="false" />
</n-form-item>
<n-form-item label="Background color:">
<n-form-item :label="t('tools.barcode-generator.texts.label-background-color')">
<n-color-picker v-model:value="background" :modes="['hex']" :show-alpha="false" />
</n-form-item>
<n-form-item label="Scale:">
<n-form-item :label="t('tools.barcode-generator.texts.label-scale')">
<n-input-number v-model:value="scale" :min="0" />
</n-form-item>
<n-form-item label="Height (mm):">
<n-form-item :label="t('tools.barcode-generator.texts.label-height-mm')">
<n-input-number v-model:value="height" :min="0" />
</n-form-item>
<n-form-item label="Margin:">
<n-form-item :label="t('tools.barcode-generator.texts.label-margin')">
<n-input-number v-model:value="margin" :min="0" />
</n-form-item>
<n-form-item label="Display text:">
<n-form-item :label="t('tools.barcode-generator.texts.label-display-text')">
<n-checkbox v-model:checked="displayValue" />
</n-form-item>
</n-form>
@@ -114,10 +117,10 @@ const { download: downloadSVG } = useDownloadFileFromBase64({ source: barcodeSVG
<canvas ref="barcodeCanvas" />
<div flex justify-center>
<c-button mr-2 @click="downloadPNG">
Download PNG barcode
{{ t('tools.barcode-generator.texts.tag-download-png-barcode') }}
</c-button>
<c-button @click="downloadSVG">
Download SVG barcode
{{ t('tools.barcode-generator.texts.tag-download-svg-barcode') }}
</c-button>
</div>
</div>
+3 -3
View File
@@ -1,11 +1,11 @@
import { Barcode } from '@vicons/tabler';
import { defineTool } from '../tool';
import { translate } from '@/plugins/i18n.plugin';
import { translate as t } from '@/plugins/i18n.plugin';
export const tool = defineTool({
name: translate('tools.barcode-generator.title'),
name: t('tools.barcode-generator.title'),
path: '/barcode-generator',
description: translate('tools.barcode-generator.description'),
description: t('tools.barcode-generator.description'),
keywords: ['barcode', 'generator'],
component: () => import('./barcode-generator.vue'),
icon: Barcode,
+5 -2
View File
@@ -1,7 +1,10 @@
<script setup lang="ts">
import { useI18n } from 'vue-i18n';
import { BarcodeFormat, BrowserMultiFormatReader } from '@zxing/library';
import TextareaCopyable from '@/components/TextareaCopyable.vue';
const { t } = useI18n();
const imageBase64 = ref('');
const barCode = computedAsync(async () => {
if (imageBase64.value === '') {
@@ -38,7 +41,7 @@ async function onUpload(file: File) {
<template>
<div>
<c-file-upload
title="Drag and drop a BarCode here, or click to select a file"
:title="t('tools.barcode-reader.texts.title-drag-and-drop-a-barcode-here-or-click-to-select-a-file')"
:paste-image="true"
mb-3
@file-upload="onUpload"
@@ -47,7 +50,7 @@ async function onUpload(file: File) {
<div v-if="barCode?.text">
<n-divider />
<h3>Decoded <span v-if="barCode?.format">({{ barCode?.format }})</span></h3>
<h3>{{ t('tools.barcode-reader.texts.tag-decoded') }}<span v-if="barCode?.format">({{ barCode?.format }})</span></h3>
<TextareaCopyable
:value="barCode?.text"
:word-wrap="true"
+3 -3
View File
@@ -1,11 +1,11 @@
import { Barcode } from '@vicons/tabler';
import { defineTool } from '../tool';
import { translate } from '@/plugins/i18n.plugin';
import { translate as t } from '@/plugins/i18n.plugin';
export const tool = defineTool({
name: translate('tools.barcode-reader.title'),
name: t('tools.barcode-reader.title'),
path: '/barcode-reader',
description: translate('tools.barcode-reader.description'),
description: t('tools.barcode-reader.description'),
keywords: ['barcode', 'reader'],
component: () => import('./barcode-reader.vue'),
icon: Barcode,
@@ -1,4 +1,5 @@
<script setup lang="ts">
import { useI18n } from 'vue-i18n';
import { useBase64 } from '@vueuse/core';
import type { Ref } from 'vue';
import { useCopy } from '@/composable/copy';
@@ -6,6 +7,8 @@ import { getExtensionFromMimeType, getMimeTypeFromBase64, previewImageFromBase64
import { useValidation } from '@/composable/validation';
import { isValidBase64 } from '@/utils/base64';
const { t } = useI18n();
const fileName = ref('file');
const fileExtension = ref('');
const base64Input = ref('');
@@ -19,7 +22,7 @@ const base64InputValidation = useValidation({
source: base64Input,
rules: [
{
message: 'Invalid base 64 string',
message: t('tools.base64-file-converter.texts.message-invalid-base-64-string'),
validator: value => isValidBase64(value.trim()),
},
],
@@ -69,7 +72,7 @@ function downloadFile() {
const fileInput = ref() as Ref<File>;
const { base64: fileBase64 } = useBase64(fileInput);
const { copy: copyFileBase64 } = useCopy({ source: fileBase64, text: 'Base64 string copied to the clipboard' });
const { copy: copyFileBase64 } = useCopy({ source: fileBase64, text: t('tools.base64-file-converter.texts.text-base64-string-copied-to-the-clipboard') });
async function onUpload(file: File) {
if (file) {
@@ -79,21 +82,21 @@ async function onUpload(file: File) {
</script>
<template>
<c-card title="Base64 to file">
<c-card :title="t('tools.base64-file-converter.texts.title-base64-to-file')">
<n-grid cols="3" x-gap="12">
<n-gi span="2">
<c-input-text
v-model:value="fileName"
label="File Name"
placeholder="Download filename"
:label="t('tools.base64-file-converter.texts.label-file-name')"
:placeholder="t('tools.base64-file-converter.texts.placeholder-download-filename')"
mb-2
/>
</n-gi>
<n-gi>
<c-input-text
v-model:value="fileExtension"
label="Extension"
placeholder="Extension"
:label="t('tools.base64-file-converter.texts.label-extension')"
:placeholder="t('tools.base64-file-converter.texts.placeholder-extension')"
mb-2
/>
</n-gi>
@@ -101,7 +104,7 @@ async function onUpload(file: File) {
<c-input-text
v-model:value="base64Input"
multiline
placeholder="Put your base64 file string here..."
:placeholder="t('tools.base64-file-converter.texts.placeholder-put-your-base64-file-string-here')"
rows="5"
:validation="base64InputValidation"
mb-2
@@ -113,21 +116,21 @@ async function onUpload(file: File) {
<div flex justify-center gap-3>
<c-button :disabled="base64Input === '' || !base64InputValidation.isValid" @click="previewImage()">
Preview image
{{ t('tools.base64-file-converter.texts.tag-preview-image') }}
</c-button>
<c-button :disabled="base64Input === '' || !base64InputValidation.isValid" @click="downloadFile()">
Download file
{{ t('tools.base64-file-converter.texts.tag-download-file') }}
</c-button>
</div>
</c-card>
<c-card title="File to base64">
<c-file-upload title="Drag and drop a file here, or click to select a file" @file-upload="onUpload" />
<c-input-text :value="fileBase64" multiline readonly placeholder="File in base64 will be here" rows="5" my-2 />
<c-card :title="t('tools.base64-file-converter.texts.title-file-to-base64')">
<c-file-upload :title="t('tools.base64-file-converter.texts.title-drag-and-drop-a-file-here-or-click-to-select-a-file')" @file-upload="onUpload" />
<c-input-text :value="fileBase64" multiline readonly :placeholder="t('tools.base64-file-converter.texts.placeholder-file-in-base64-will-be-here')" rows="5" my-2 />
<div flex justify-center>
<c-button @click="copyFileBase64()">
Copy
{{ t('tools.base64-file-converter.texts.tag-copy') }}
</c-button>
</div>
</c-card>
+3 -3
View File
@@ -1,11 +1,11 @@
import { FileDigit } from '@vicons/tabler';
import { defineTool } from '../tool';
import { translate } from '@/plugins/i18n.plugin';
import { translate as t } from '@/plugins/i18n.plugin';
export const tool = defineTool({
name: translate('tools.base64-file-converter.title'),
name: t('tools.base64-file-converter.title'),
path: '/base64-file-converter',
description: translate('tools.base64-file-converter.description'),
description: t('tools.base64-file-converter.description'),
keywords: ['base64', 'converter', 'upload', 'image', 'file', 'conversion', 'web', 'data', 'format'],
component: () => import('./base64-file-converter.vue'),
icon: FileDigit,
@@ -1,9 +1,12 @@
<script setup lang="ts">
import { useI18n } from 'vue-i18n';
import { Base64 } from 'js-base64';
import hexArray from 'hex-array';
import { useCopy } from '@/composable/copy';
import { isValidBase64 } from '@/utils/base64';
const { t } = useI18n();
const textInput = ref('');
const base64Output = computed(() => {
try {
@@ -13,7 +16,7 @@ const base64Output = computed(() => {
return e.toString();
}
});
const { copy: copyTextBase64 } = useCopy({ source: base64Output, text: 'Base64 Hex Array copied to the clipboard' });
const { copy: copyTextBase64 } = useCopy({ source: base64Output, text: t('tools.base64-hex-converter.texts.text-base64-hex-array-copied-to-the-clipboard') });
const uppercase = ref(false);
const grouping = ref(0);
@@ -33,70 +36,70 @@ const textOutput = computed(() => {
}
},
);
const { copy: copyText } = useCopy({ source: textOutput, text: 'Hex Array copied to the clipboard' });
const { copy: copyText } = useCopy({ source: textOutput, text: t('tools.base64-hex-converter.texts.text-hex-array-copied-to-the-clipboard') });
const b64ValidationRules = [
{
message: 'Invalid base64 string',
message: t('tools.base64-hex-converter.texts.message-invalid-base64-string'),
validator: (value: string) => isValidBase64(value.trim()),
},
];
</script>
<template>
<c-card title="Hex Array to Base64">
<c-card :title="t('tools.base64-hex-converter.texts.title-hex-array-to-base64')">
<c-input-text
v-model:value="textInput"
multiline
placeholder="Put your Hex Array here..."
:placeholder="t('tools.base64-hex-converter.texts.placeholder-put-your-hex-array-here')"
rows="5"
label="Hex Array to encode"
:label="t('tools.base64-hex-converter.texts.label-hex-array-to-encode')"
raw-text
mb-5
/>
<c-input-text
label="Base64 of Hex Array"
:label="t('tools.base64-hex-converter.texts.label-base64-of-hex-array')"
:value="base64Output"
multiline
readonly
placeholder="The Base64 encoding of your Hex Array will be here"
:placeholder="t('tools.base64-hex-converter.texts.placeholder-the-base64-encoding-of-your-hex-array-will-be-here')"
rows="5"
mb-5
/>
<div flex justify-center>
<c-button @click="copyTextBase64()">
Copy Base64
{{ t('tools.base64-hex-converter.texts.tag-copy-base64') }}
</c-button>
</div>
</c-card>
<c-card title="Base64 to Hex Array">
<c-card :title="t('tools.base64-hex-converter.texts.title-base64-to-hex-array')">
<n-space align="baseline" justify="center" mb-1>
<n-form-item label="Uppercase" label-placement="left">
<n-form-item :label="t('tools.base64-hex-converter.texts.label-uppercase')" label-placement="left">
<n-switch v-model:value="uppercase" />
</n-form-item>
<n-form-item label="Group by" label-placement="left">
<n-input-number v-model:value="grouping" :min="0" style="width: 6em" mr-1 /> digits (0 = no grouping)
<n-form-item :label="t('tools.base64-hex-converter.texts.label-group-by')" label-placement="left">
<n-input-number v-model:value="grouping" :min="0" style="width: 6em" mr-1 />{{ t('tools.base64-hex-converter.texts.tag-digits-0-no-grouping') }}
</n-form-item>
<n-form-item label="Split as rows by" label-placement="left">
<n-input-number v-model:value="rowlength" :min="0" style="width: 6em" mr-1 /> group of digits (0 = no rows)
<n-form-item :label="t('tools.base64-hex-converter.texts.label-split-as-rows-by')" label-placement="left">
<n-input-number v-model:value="rowlength" :min="0" style="width: 6em" mr-1 />{{ t('tools.base64-hex-converter.texts.tag-group-of-digits-0-no-rows') }}
</n-form-item>
</n-space>
<c-input-text
v-model:value="base64Input"
multiline
placeholder="Your Base64 Hex Array..."
:placeholder="t('tools.base64-hex-converter.texts.placeholder-your-base64-hex-array')"
rows="5"
:validation-rules="b64ValidationRules"
label="Base64 Hex Array to decode"
:label="t('tools.base64-hex-converter.texts.label-base64-hex-array-to-decode')"
mb-5
/>
<c-input-text
v-model:value="textOutput"
label="Decoded Hex Array"
placeholder="The decoded Hex Array will be here"
:label="t('tools.base64-hex-converter.texts.label-decoded-hex-array')"
:placeholder="t('tools.base64-hex-converter.texts.placeholder-the-decoded-hex-array-will-be-here')"
multiline
rows="5"
readonly
@@ -105,7 +108,7 @@ const b64ValidationRules = [
<div flex justify-center>
<c-button @click="copyText()">
Copy Decoded Hex Array
{{ t('tools.base64-hex-converter.texts.tag-copy-decoded-hex-array') }}
</c-button>
</div>
</c-card>
+3 -3
View File
@@ -1,11 +1,11 @@
import { FileDigit } from '@vicons/tabler';
import { defineTool } from '../tool';
import { translate } from '@/plugins/i18n.plugin';
import { translate as t } from '@/plugins/i18n.plugin';
export const tool = defineTool({
name: translate('tools.base64-hex-converter.title'),
name: t('tools.base64-hex-converter.title'),
path: '/base64-hex-converter',
description: translate('tools.base64-hex-converter.description'),
description: t('tools.base64-hex-converter.description'),
keywords: ['base64', 'converter', 'conversion', 'web', 'data', 'format', 'atob', 'btoa', 'hex'],
component: () => import('./base64-hex-converter.vue'),
icon: FileDigit,
@@ -1,23 +1,26 @@
<script setup lang="ts">
import { useI18n } from 'vue-i18n';
import { useCopy } from '@/composable/copy';
import { base64ToText, isValidBase64, textToBase64 } from '@/utils/base64';
import { withDefaultOnError } from '@/utils/defaults';
const { t } = useI18n();
const encodeUrlSafe = useStorage('base64-string-converter--encode-url-safe', false);
const decodeUrlSafe = useStorage('base64-string-converter--decode-url-safe', false);
const textInput = ref('');
const base64Output = computed(() => textToBase64(textInput.value, { makeUrlSafe: encodeUrlSafe.value }));
const { copy: copyTextBase64 } = useCopy({ source: base64Output, text: 'Base64 string copied to the clipboard' });
const { copy: copyTextBase64 } = useCopy({ source: base64Output, text: t('tools.base64-string-converter.texts.text-base64-string-copied-to-the-clipboard') });
const base64Input = ref('');
const textOutput = computed(() =>
withDefaultOnError(() => base64ToText(base64Input.value.trim(), { makeUrlSafe: decodeUrlSafe.value }), ''),
);
const { copy: copyText } = useCopy({ source: textOutput, text: 'String copied to the clipboard' });
const { copy: copyText } = useCopy({ source: textOutput, text: t('tools.base64-string-converter.texts.text-string-copied-to-the-clipboard') });
const b64ValidationRules = [
{
message: 'Invalid base64 string',
message: t('tools.base64-string-converter.texts.message-invalid-base64-string'),
validator: (value: string) => isValidBase64(value.trim(), { makeUrlSafe: decodeUrlSafe.value }),
},
];
@@ -25,56 +28,56 @@ const b64ValidationWatch = [decodeUrlSafe];
</script>
<template>
<c-card title="String to base64">
<n-form-item label="Encode URL safe" label-placement="left">
<c-card :title="t('tools.base64-string-converter.texts.title-string-to-base64')">
<n-form-item :label="t('tools.base64-string-converter.texts.label-encode-url-safe')" label-placement="left">
<n-switch v-model:value="encodeUrlSafe" />
</n-form-item>
<c-input-text
v-model:value="textInput"
multiline
placeholder="Put your string here..."
:placeholder="t('tools.base64-string-converter.texts.placeholder-put-your-string-here')"
rows="5"
label="String to encode"
:label="t('tools.base64-string-converter.texts.label-string-to-encode')"
raw-text
mb-5
/>
<c-input-text
label="Base64 of string"
:label="t('tools.base64-string-converter.texts.label-base64-of-string')"
:value="base64Output"
multiline
readonly
placeholder="The base64 encoding of your string will be here"
:placeholder="t('tools.base64-string-converter.texts.placeholder-the-base64-encoding-of-your-string-will-be-here')"
rows="5"
mb-5
/>
<div flex justify-center>
<c-button @click="copyTextBase64()">
Copy base64
{{ t('tools.base64-string-converter.texts.tag-copy-base64') }}
</c-button>
</div>
</c-card>
<c-card title="Base64 to string">
<n-form-item label="Decode URL safe" label-placement="left">
<c-card :title="t('tools.base64-string-converter.texts.title-base64-to-string')">
<n-form-item :label="t('tools.base64-string-converter.texts.label-decode-url-safe')" label-placement="left">
<n-switch v-model:value="decodeUrlSafe" />
</n-form-item>
<c-input-text
v-model:value="base64Input"
multiline
placeholder="Your base64 string..."
:placeholder="t('tools.base64-string-converter.texts.placeholder-your-base64-string')"
rows="5"
:validation-rules="b64ValidationRules"
:validation-watch="b64ValidationWatch"
label="Base64 string to decode"
:label="t('tools.base64-string-converter.texts.label-base64-string-to-decode')"
mb-5
/>
<c-input-text
v-model:value="textOutput"
label="Decoded string"
placeholder="The decoded string will be here"
:label="t('tools.base64-string-converter.texts.label-decoded-string')"
:placeholder="t('tools.base64-string-converter.texts.placeholder-the-decoded-string-will-be-here')"
multiline
rows="5"
readonly
@@ -83,7 +86,7 @@ const b64ValidationWatch = [decodeUrlSafe];
<div flex justify-center>
<c-button @click="copyText()">
Copy decoded string
{{ t('tools.base64-string-converter.texts.tag-copy-decoded-string') }}
</c-button>
</div>
</c-card>
+3 -3
View File
@@ -1,11 +1,11 @@
import { FileDigit } from '@vicons/tabler';
import { defineTool } from '../tool';
import { translate } from '@/plugins/i18n.plugin';
import { translate as t } from '@/plugins/i18n.plugin';
export const tool = defineTool({
name: translate('tools.base64-string-converter.title'),
name: t('tools.base64-string-converter.title'),
path: '/base64-string-converter',
description: translate('tools.base64-string-converter.description'),
description: t('tools.base64-string-converter.description'),
keywords: ['base64', 'converter', 'conversion', 'web', 'data', 'format', 'atob', 'btoa'],
component: () => import('./base64-string-converter.vue'),
icon: FileDigit,
+3 -3
View File
@@ -1,11 +1,11 @@
import { Command } from '@vicons/tabler';
import { defineTool } from '../tool';
import { translate } from '@/plugins/i18n.plugin';
import { translate as t } from '@/plugins/i18n.plugin';
export const tool = defineTool({
name: translate('tools.bash-memo.title'),
name: t('tools.bash-memo.title'),
path: '/bash-memo',
description: translate('tools.bash-memo.description'),
description: t('tools.bash-memo.description'),
keywords: ['bash', 'shell'],
component: () => import('./bash-memo.vue'),
icon: Command,
@@ -31,7 +31,7 @@ const { copy } = useCopy({ source: header, text: t('tools.basic-auth-generator.c
/>
<c-card>
<n-statistic label="Authorization header:" class="header">
<n-statistic :label="t('tools.basic-auth-generator.texts.label-authorization-header')" class="header">
<n-scrollbar x-scrollable style="max-width: 550px; margin-bottom: -10px; padding-bottom: 10px" trigger="none">
{{ header }}
</n-scrollbar>
+3 -3
View File
@@ -1,11 +1,11 @@
import { PasswordRound } from '@vicons/material';
import { defineTool } from '../tool';
import { translate } from '@/plugins/i18n.plugin';
import { translate as t } from '@/plugins/i18n.plugin';
export const tool = defineTool({
name: translate('tools.basic-auth-generator.title'),
name: t('tools.basic-auth-generator.title'),
path: '/basic-auth-generator',
description: translate('tools.basic-auth-generator.description'),
description: t('tools.basic-auth-generator.description'),
keywords: [
'basic',
'auth',
+16 -13
View File
@@ -1,14 +1,17 @@
<script setup lang="ts">
import { useI18n } from 'vue-i18n';
import { compareSync, hashSync } from 'bcryptjs';
import { useThemeVars } from 'naive-ui';
import { useCopy } from '@/composable/copy';
const { t } = useI18n();
const themeVars = useThemeVars();
const input = ref('');
const saltCount = ref(10);
const hashed = computed(() => hashSync(input.value, saltCount.value || 10));
const { copy } = useCopy({ source: hashed, text: 'Hashed string copied to the clipboard' });
const { copy } = useCopy({ source: hashed, text: t('tools.bcrypt.texts.text-hashed-string-copied-to-the-clipboard') });
const compareString = ref('');
const compareHash = ref('');
@@ -16,39 +19,39 @@ const compareMatch = computed(() => compareSync(compareString.value, compareHash
</script>
<template>
<c-card title="Hash">
<c-card :title="t('tools.bcrypt.texts.title-hash')">
<c-input-text
v-model:value="input"
placeholder="Your string to bcrypt..."
:placeholder="t('tools.bcrypt.texts.placeholder-your-string-to-bcrypt')"
raw-text
label="Your string: "
:label="t('tools.bcrypt.texts.label-your-string')"
label-position="left"
label-align="right"
label-width="120px"
mb-2
/>
<n-form-item label="Salt count: " label-placement="left" label-width="120">
<n-input-number v-model:value="saltCount" placeholder="Salt rounds..." :max="100" :min="0" w-full />
<n-form-item :label="t('tools.bcrypt.texts.label-salt-count')" label-placement="left" label-width="120">
<n-input-number v-model:value="saltCount" :placeholder="t('tools.bcrypt.texts.placeholder-salt-rounds')" :max="100" :min="0" w-full />
</n-form-item>
<c-input-text :value="hashed" readonly text-center />
<div mt-5 flex justify-center>
<c-button @click="copy()">
Copy hash
{{ t('tools.bcrypt.texts.tag-copy-hash') }}
</c-button>
</div>
</c-card>
<c-card title="Compare string with hash">
<c-card :title="t('tools.bcrypt.texts.title-compare-string-with-hash')">
<n-form label-width="120">
<n-form-item label="Your string: " label-placement="left">
<c-input-text v-model:value="compareString" placeholder="Your string to compare..." raw-text />
<n-form-item :label="t('tools.bcrypt.texts.label-your-string')" label-placement="left">
<c-input-text v-model:value="compareString" :placeholder="t('tools.bcrypt.texts.placeholder-your-string-to-compare')" raw-text />
</n-form-item>
<n-form-item label="Your hash: " label-placement="left">
<c-input-text v-model:value="compareHash" placeholder="Your hash to compare..." raw-text />
<n-form-item :label="t('tools.bcrypt.texts.label-your-hash')" label-placement="left">
<c-input-text v-model:value="compareHash" :placeholder="t('tools.bcrypt.texts.placeholder-your-hash-to-compare')" raw-text />
</n-form-item>
<n-form-item label="Do they match ? " label-placement="left" :show-feedback="false">
<n-form-item :label="t('tools.bcrypt.texts.label-do-they-match')" label-placement="left" :show-feedback="false">
<div class="compare-result" :class="{ positive: compareMatch }">
{{ compareMatch ? 'Yes' : 'No' }}
</div>
+3 -3
View File
@@ -1,11 +1,11 @@
import { LockSquare } from '@vicons/tabler';
import { defineTool } from '../tool';
import { translate } from '@/plugins/i18n.plugin';
import { translate as t } from '@/plugins/i18n.plugin';
export const tool = defineTool({
name: translate('tools.bcrypt.title'),
name: t('tools.bcrypt.title'),
path: '/bcrypt',
description: translate('tools.bcrypt.description'),
description: t('tools.bcrypt.description'),
keywords: ['bcrypt', 'hash', 'compare', 'password', 'salt', 'round', 'storage', 'crypto'],
component: () => import('./bcrypt.vue'),
icon: LockSquare,
@@ -1,4 +1,5 @@
<script setup lang="ts">
import { useI18n } from 'vue-i18n';
import { Plus, Trash } from '@vicons/tabler';
import { useStorage } from '@vueuse/core';
import _ from 'lodash';
@@ -7,6 +8,8 @@ import { arrayToMarkdownTable, computeAverage, computeVariance } from './benchma
import DynamicValues from './dynamic-values.vue';
import { useCopy } from '@/composable/copy';
const { t } = useI18n();
const suites = useStorage('benchmark-builder:suites', [
{ title: 'Suite 1', data: [5, 10] },
{ title: 'Suite 2', data: [8, 12] },
@@ -86,28 +89,26 @@ function copyAsBulletList() {
<c-input-text
v-model:value="suite.title"
label-position="left"
label="Suite name"
placeholder="Suite name..."
:label="t('tools.benchmark-builder.texts.label-suite-name')"
:placeholder="t('tools.benchmark-builder.texts.placeholder-suite-name')"
clearable
/>
<n-divider />
<n-form-item label="Suite values" :show-feedback="false">
<n-form-item :label="t('tools.benchmark-builder.texts.label-suite-values')" :show-feedback="false">
<DynamicValues v-model:values="suite.data" />
</n-form-item>
</c-card>
<div flex justify-center>
<c-button v-if="suites.length > 1" variant="text" @click="suites.splice(index, 1)">
<n-icon :component="Trash" depth="3" mr-2 size="18" />
Delete suite
<n-icon :component="Trash" depth="3" mr-2 size="18" />{{ t('tools.benchmark-builder.texts.tag-delete-suite') }}
</c-button>
<c-button
variant="text"
@click="suites.splice(index + 1, 0, { data: [0], title: `Suite ${suites.length + 1}` })"
>
<n-icon :component="Plus" depth="3" mr-2 size="18" />
Add suite
<n-icon :component="Plus" depth="3" mr-2 size="18" />{{ t('tools.benchmark-builder.texts.tag-add-suite') }}
</c-button>
</div>
</div>
@@ -117,7 +118,7 @@ function copyAsBulletList() {
<div style="flex: 0 0 100%">
<div style="max-width: 600px; margin: 0 auto">
<div mx-auto max-w-sm flex justify-center gap-3>
<c-input-text v-model:value="unit" placeholder="Unit (eg: ms)" label="Unit" label-position="left" mb-4 />
<c-input-text v-model:value="unit" :placeholder="t('tools.benchmark-builder.texts.placeholder-unit-eg-ms')" :label="t('tools.benchmark-builder.texts.label-unit')" label-position="left" mb-4 />
<c-button
@click="
@@ -127,7 +128,7 @@ function copyAsBulletList() {
]
"
>
Reset suites
{{ t('tools.benchmark-builder.texts.tag-reset-suites') }}
</c-button>
</div>
@@ -135,10 +136,10 @@ function copyAsBulletList() {
<div mt-5 flex justify-center gap-3>
<c-button @click="copyAsMarkdown()">
Copy as markdown table
{{ t('tools.benchmark-builder.texts.tag-copy-as-markdown-table') }}
</c-button>
<c-button @click="copyAsBulletList()">
Copy as bullet list
{{ t('tools.benchmark-builder.texts.tag-copy-as-bullet-list') }}
</c-button>
</div>
</div>
@@ -1,4 +1,5 @@
<script setup lang="ts">
import { useI18n } from 'vue-i18n';
import { Plus, Trash } from '@vicons/tabler';
import { useTemplateRefsList, useVModel } from '@vueuse/core';
import { NInputNumber } from 'naive-ui';
@@ -8,6 +9,8 @@ const props = defineProps<{ values: (number | null)[] }>();
const emit = defineEmits(['update:values']);
const { t } = useI18n();
const refs = useTemplateRefsList<typeof NInputNumber>();
const values = useVModel(props, 'values', emit);
@@ -35,7 +38,7 @@ function onInputEnter(index: number) {
:ref="refs.set"
v-model:value="values[index]"
:show-button="false"
placeholder="Set your measure..."
:placeholder="t('tools.benchmark-builder.texts.placeholder-set-your-measure')"
autofocus
@keydown.enter="onInputEnter(index)"
/>
@@ -47,8 +50,7 @@ function onInputEnter(index: number) {
</div>
<c-button @click="addValue">
<n-icon :component="Plus" depth="3" mr-2 size="18" />
Add a measure
<n-icon :component="Plus" depth="3" mr-2 size="18" />{{ t('tools.benchmark-builder.texts.tag-add-a-measure') }}
</c-button>
</div>
</template>
+3 -3
View File
@@ -1,11 +1,11 @@
import { SpeedFilled } from '@vicons/material';
import { defineTool } from '../tool';
import { translate } from '@/plugins/i18n.plugin';
import { translate as t } from '@/plugins/i18n.plugin';
export const tool = defineTool({
name: translate('tools.benchmark-builder.title'),
name: t('tools.benchmark-builder.title'),
path: '/benchmark-builder',
description: translate('tools.benchmark-builder.description'),
description: t('tools.benchmark-builder.description'),
keywords: ['benchmark', 'builder', 'execution', 'duration', 'mean', 'variance'],
component: () => import('./benchmark-builder.vue'),
icon: SpeedFilled,
@@ -1,7 +1,10 @@
<script setup lang="ts">
import { useI18n } from 'vue-i18n';
import { ref } from 'vue';
import { NCard, NForm, NFormItem, NInput } from 'naive-ui';
const { t } = useI18n();
const bimiData = ref({
domain: '',
logoUrl: '',
@@ -26,20 +29,20 @@ const bimiRecord = computed(() => {
</script>
<template>
<NCard title="BIMI DNS Record Generator">
<NCard :title="t('tools.bimi-dns-generator.texts.title-bimi-dns-record-generator')">
<NForm :model="bimiData" label-placement="left" label-width="150px">
<NFormItem label="Domain:">
<NInput v-model:value="bimiData.domain" placeholder="example.com" />
<NFormItem :label="t('tools.bimi-dns-generator.texts.label-domain')">
<NInput v-model:value="bimiData.domain" :placeholder="t('tools.bimi-dns-generator.texts.placeholder-example-com')" />
</NFormItem>
<NFormItem label="Logo URL:">
<NInput v-model:value="bimiData.logoUrl" placeholder="https://example.com/logo.svg" />
<NFormItem :label="t('tools.bimi-dns-generator.texts.label-logo-url')">
<NInput v-model:value="bimiData.logoUrl" :placeholder="t('tools.bimi-dns-generator.texts.placeholder-https-example-com-logo-svg')" />
</NFormItem>
<NFormItem label="VMC Certificate URL:">
<NInput v-model:value="bimiData.vmcUrl" placeholder="https://example.com/vmc.pem" />
<NFormItem :label="t('tools.bimi-dns-generator.texts.label-vmc-certificate-url')">
<NInput v-model:value="bimiData.vmcUrl" :placeholder="t('tools.bimi-dns-generator.texts.placeholder-https-example-com-vmc-pem')" />
</NFormItem>
</NForm>
<c-card title="Generated BIMI record">
<c-card :title="t('tools.bimi-dns-generator.texts.title-generated-bimi-record')">
<textarea-copyable :value="bimiRecord" />
</c-card>
</NCard>
+3 -3
View File
@@ -1,11 +1,11 @@
import { World } from '@vicons/tabler';
import { defineTool } from '../tool';
import { translate } from '@/plugins/i18n.plugin';
import { translate as t } from '@/plugins/i18n.plugin';
export const tool = defineTool({
name: translate('tools.bimi-dns-generator.title'),
name: t('tools.bimi-dns-generator.title'),
path: '/bimi-dns-generator',
description: translate('tools.bimi-dns-generator.description'),
description: t('tools.bimi-dns-generator.description'),
keywords: ['bimi', 'dns', 'txt'],
component: () => import('./bimi-dns-generator.vue'),
icon: World,
+13 -10
View File
@@ -1,4 +1,5 @@
<script setup lang="ts">
import { useI18n } from 'vue-i18n';
import {
chineseSimplifiedWordList,
chineseTraditionalWordList,
@@ -21,6 +22,8 @@ import { useValidation } from '@/composable/validation';
import { isNotThrowing } from '@/utils/boolean';
import { withDefaultOnError } from '@/utils/defaults';
const { t } = useI18n();
const languages = {
'English': englishWordList,
'Chinese simplified': chineseSimplifiedWordList,
@@ -53,11 +56,11 @@ const entropyValidation = useValidation({
rules: [
{
validator: value => value === '' || (value.length <= 32 && value.length >= 16 && value.length % 4 === 0),
message: 'Entropy length should be >= 16, <= 32 and be a multiple of 4',
message: t('tools.bip39-generator.texts.message-entropy-length-should-be-16-32-and-be-a-multiple-of-4'),
},
{
validator: value => /^[a-fA-F0-9]*$/.test(value),
message: 'Entropy should be an hexadecimal string',
message: t('tools.bip39-generator.texts.message-entropy-should-be-an-hexadecimal-string'),
},
],
});
@@ -67,7 +70,7 @@ const mnemonicValidation = useValidation({
rules: [
{
validator: value => isNotThrowing(() => mnemonicToEntropy(value, languages[language.value])),
message: 'Invalid mnemonic',
message: t('tools.bip39-generator.texts.message-invalid-mnemonic'),
},
],
});
@@ -76,8 +79,8 @@ function refreshEntropy() {
entropy.value = generateEntropy();
}
const { copy: copyEntropy } = useCopy({ source: entropy, text: 'Entropy copied to the clipboard' });
const { copy: copyPassphrase } = useCopy({ source: passphrase, text: 'Passphrase copied to the clipboard' });
const { copy: copyEntropy } = useCopy({ source: entropy, text: t('tools.bip39-generator.texts.text-entropy-copied-to-the-clipboard') });
const { copy: copyPassphrase } = useCopy({ source: passphrase, text: t('tools.bip39-generator.texts.text-passphrase-copied-to-the-clipboard') });
</script>
<template>
@@ -87,18 +90,18 @@ const { copy: copyPassphrase } = useCopy({ source: passphrase, text: 'Passphrase
<c-select
v-model:value="language"
searchable
label="Language:"
:label="t('tools.bip39-generator.texts.label-language')"
:options="Object.keys(languages)"
/>
</n-gi>
<n-gi span="2">
<n-form-item
label="Entropy (seed):"
:label="t('tools.bip39-generator.texts.label-entropy-seed')"
:feedback="entropyValidation.message"
:validation-status="entropyValidation.status"
>
<n-input-group>
<c-input-text v-model:value="entropy" placeholder="Your string..." />
<c-input-text v-model:value="entropy" :placeholder="t('tools.bip39-generator.texts.placeholder-your-string')" />
<c-button @click="refreshEntropy()">
<n-icon size="22">
@@ -115,12 +118,12 @@ const { copy: copyPassphrase } = useCopy({ source: passphrase, text: 'Passphrase
</n-gi>
</n-grid>
<n-form-item
label="Passphrase (mnemonic):"
:label="t('tools.bip39-generator.texts.label-passphrase-mnemonic')"
:feedback="mnemonicValidation.message"
:validation-status="mnemonicValidation.status"
>
<n-input-group>
<c-input-text v-model:value="passphrase" placeholder="Your mnemonic..." raw-text />
<c-input-text v-model:value="passphrase" :placeholder="t('tools.bip39-generator.texts.placeholder-your-mnemonic')" raw-text />
<c-button @click="copyPassphrase()">
<n-icon size="22" :component="Copy" />
+3 -3
View File
@@ -1,11 +1,11 @@
import { AlignJustified } from '@vicons/tabler';
import { defineTool } from '../tool';
import { translate } from '@/plugins/i18n.plugin';
import { translate as t } from '@/plugins/i18n.plugin';
export const tool = defineTool({
name: translate('tools.bip39-generator.title'),
name: t('tools.bip39-generator.title'),
path: '/bip39-generator',
description: translate('tools.bip39-generator.description'),
description: t('tools.bip39-generator.description'),
keywords: ['BIP39', 'passphrase', 'generator', 'mnemonic', 'entropy'],
component: () => import('./bip39-generator.vue'),
icon: AlignJustified,
+12 -9
View File
@@ -1,11 +1,14 @@
<script setup lang="ts">
import { useI18n } from 'vue-i18n';
const { t } = useI18n();
const units = ref('metric');
const weight = ref<number | null>(null);
const height = ref<number | null>(null);
const options = [
{ label: 'Metric (kg, m)', value: 'metric' },
{ label: 'US (lbs, in)', value: 'us' },
{ label: t('tools.bmi-calculator.texts.label-metric-kg-m'), value: 'metric' },
{ label: t('tools.bmi-calculator.texts.label-us-lbs-in'), value: 'us' },
];
const bmi = computed(() => {
@@ -48,19 +51,19 @@ const bmiCategory = computed(() => {
</script>
<template>
<c-card title="BMI Calculator" max-w-800px>
<c-select v-model:value="units" label="Select Units:" :options="options" mb-2 label-position="left" />
<c-card :title="t('tools.bmi-calculator.texts.title-bmi-calculator')" max-w-800px>
<c-select v-model:value="units" :label="t('tools.bmi-calculator.texts.label-select-units')" :options="options" mb-2 label-position="left" />
<n-space justify="space-evenly">
<n-form-item :label="`Weight (${(units === 'metric' ? 'kg' : 'lbs')}):`" label-placement="left" mb-2>
<n-input-number v-model:value="weight" placeholder="Enter weight" />
<n-input-number v-model:value="weight" :placeholder="t('tools.bmi-calculator.texts.placeholder-enter-weight')" />
</n-form-item>
<n-form-item :label="`Height (${(units === 'metric' ? 'm' : 'in')}):`" label-placement="left" mb-2>
<n-input-number v-model:value="height" placeholder="Enter height" />
<n-input-number v-model:value="height" :placeholder="t('tools.bmi-calculator.texts.placeholder-enter-height')" />
</n-form-item>
</n-space>
<c-card v-if="bmi" title="Result">
<input-copyable label="BMI:" label-position="left" label-width="100px" :value="bmi" mb-1 />
<input-copyable label="Category:" label-position="left" label-width="100px" :value="bmiCategory" />
<c-card v-if="bmi" :title="t('tools.bmi-calculator.texts.title-result')">
<input-copyable :label="t('tools.bmi-calculator.texts.label-bmi')" label-position="left" label-width="100px" :value="bmi" mb-1 />
<input-copyable :label="t('tools.bmi-calculator.texts.label-category')" label-position="left" label-width="100px" :value="bmiCategory" />
</c-card>
</c-card>
</template>
+3 -3
View File
@@ -1,11 +1,11 @@
import { MedicalCross } from '@vicons/tabler';
import { defineTool } from '../tool';
import { translate } from '@/plugins/i18n.plugin';
import { translate as t } from '@/plugins/i18n.plugin';
export const tool = defineTool({
name: translate('tools.bmi-calculator.title'),
name: t('tools.bmi-calculator.title'),
path: '/bmi-calculator',
description: translate('tools.bmi-calculator.description'),
description: t('tools.bmi-calculator.description'),
keywords: ['bmi', 'body', 'mass'],
component: () => import('./bmi-calculator.vue'),
icon: MedicalCross,
+26 -23
View File
@@ -1,6 +1,9 @@
<script setup lang="ts">
import { useI18n } from 'vue-i18n';
import EmailBounceParse from 'email-bounce-parser-browser';
const { t } = useI18n();
const emailContent = ref('');
const parsedBounce = computed(() => {
@@ -15,49 +18,49 @@ const parsedBounce = computed(() => {
<template>
<div>
<c-card title="Input" mb-2>
<c-card :title="t('tools.bounce-parser.texts.title-input')" mb-2>
<c-input-text
v-model:value="emailContent"
label="Bounce Email Textual Content"
:label="t('tools.bounce-parser.texts.label-bounce-email-textual-content')"
multiline
placeholder="Put your email text content here..."
:placeholder="t('tools.bounce-parser.texts.placeholder-put-your-email-text-content-here')"
rows="15"
mb-2
/>
</c-card>
<c-card v-if="parsedBounce && emailContent" title="Output" mb-2>
<c-card v-if="parsedBounce && emailContent" :title="t('tools.bounce-parser.texts.title-output')" mb-2>
<n-p v-if="parsedBounce.email?.email?.error" style="color: green" mb-2>
This mail is a bounce email
{{ t('tools.bounce-parser.texts.tag-this-mail-is-a-bounce-email') }}
</n-p>
<n-p v-if="!parsedBounce.email?.email?.error" style="color: red" mb-2>
This mail is NOT a bounce email
{{ t('tools.bounce-parser.texts.tag-this-mail-is-not-a-bounce-email') }}
</n-p>
<c-alert v-if="parsedBounce.parsingError" mb-2>
{{ parsedBounce.parsingError }}
</c-alert>
<input-copyable v-if="parsedBounce.email?.data?.recipient" label="Recipient" :value="parsedBounce.email?.data?.recipient" mb-2 />
<input-copyable v-if="parsedBounce.email?.data?.recipient" :label="t('tools.bounce-parser.texts.label-recipient')" :value="parsedBounce.email?.data?.recipient" mb-2 />
<div v-if="parsedBounce.email?.email?.error">
<c-card title="Error" mb-2>
<input-copyable v-if="parsedBounce.email?.data?.command" label="Command" :value="parsedBounce.email?.data?.command" />
<input-copyable v-if="parsedBounce.email?.data?.error?.code?.basic || parsedBounce.email?.data?.error?.code?.enhanced" label="Code" :value="`${parsedBounce.email?.data?.error?.code?.basic}/${parsedBounce.email?.data?.error?.code?.enhanced}`" />
<input-copyable v-if="parsedBounce.email?.data?.error?.label" label="Label" :value="parsedBounce.email?.data?.error?.label" />
<input-copyable v-if="parsedBounce.email?.data?.error?.type" label="Type" :value="parsedBounce.email?.data?.error?.type" />
<input-copyable v-if="parsedBounce.email?.data?.error?.temporary" label="Temporary" :value="parsedBounce.email?.data?.error?.temporary" />
<input-copyable v-if="parsedBounce.email?.data?.error?.permanent" label="Permanent" :value="parsedBounce.email?.data?.error?.permanent" />
<input-copyable v-if="parsedBounce.email?.data?.error?.data?.type" label="Subtype" :value="parsedBounce.email?.data?.error?.data?.type" />
<input-copyable v-if="parsedBounce.email?.data?.error?.data?.blocked" label="Blocked" :value="parsedBounce.email?.data?.error?.data?.blocked" />
<input-copyable v-if="parsedBounce.email?.data?.error?.data?.spam" label="Spam" :value="parsedBounce.email?.data?.error?.data?.spam" />
<c-card :title="t('tools.bounce-parser.texts.title-error')" mb-2>
<input-copyable v-if="parsedBounce.email?.data?.command" :label="t('tools.bounce-parser.texts.label-command')" :value="parsedBounce.email?.data?.command" />
<input-copyable v-if="parsedBounce.email?.data?.error?.code?.basic || parsedBounce.email?.data?.error?.code?.enhanced" :label="t('tools.bounce-parser.texts.label-code')" :value="`${parsedBounce.email?.data?.error?.code?.basic}/${parsedBounce.email?.data?.error?.code?.enhanced}`" />
<input-copyable v-if="parsedBounce.email?.data?.error?.label" :label="t('tools.bounce-parser.texts.label-label')" :value="parsedBounce.email?.data?.error?.label" />
<input-copyable v-if="parsedBounce.email?.data?.error?.type" :label="t('tools.bounce-parser.texts.label-type')" :value="parsedBounce.email?.data?.error?.type" />
<input-copyable v-if="parsedBounce.email?.data?.error?.temporary" :label="t('tools.bounce-parser.texts.label-temporary')" :value="parsedBounce.email?.data?.error?.temporary" />
<input-copyable v-if="parsedBounce.email?.data?.error?.permanent" :label="t('tools.bounce-parser.texts.label-permanent')" :value="parsedBounce.email?.data?.error?.permanent" />
<input-copyable v-if="parsedBounce.email?.data?.error?.data?.type" :label="t('tools.bounce-parser.texts.label-subtype')" :value="parsedBounce.email?.data?.error?.data?.type" />
<input-copyable v-if="parsedBounce.email?.data?.error?.data?.blocked" :label="t('tools.bounce-parser.texts.label-blocked')" :value="parsedBounce.email?.data?.error?.data?.blocked" />
<input-copyable v-if="parsedBounce.email?.data?.error?.data?.spam" :label="t('tools.bounce-parser.texts.label-spam')" :value="parsedBounce.email?.data?.error?.data?.spam" />
</c-card>
<c-card v-if="parsedBounce.email?.data?.server?.hostname || parsedBounce.email?.data?.server?.ip" title="Server" mb-2>
<input-copyable v-if="parsedBounce.email?.data?.server?.hostname" label="Host" :value="parsedBounce.email?.data?.server?.hostname" />
<input-copyable v-if="parsedBounce.email?.data?.server?.ip" label="IP" :value="parsedBounce.email?.data?.server?.ip" />
<input-copyable v-if="parsedBounce.email?.data?.server?.port" label="Port" :value="parsedBounce.email?.data?.server?.port" />
<c-card v-if="parsedBounce.email?.data?.server?.hostname || parsedBounce.email?.data?.server?.ip" :title="t('tools.bounce-parser.texts.title-server')" mb-2>
<input-copyable v-if="parsedBounce.email?.data?.server?.hostname" :label="t('tools.bounce-parser.texts.label-host')" :value="parsedBounce.email?.data?.server?.hostname" />
<input-copyable v-if="parsedBounce.email?.data?.server?.ip" :label="t('tools.bounce-parser.texts.label-ip')" :value="parsedBounce.email?.data?.server?.ip" />
<input-copyable v-if="parsedBounce.email?.data?.server?.port" :label="t('tools.bounce-parser.texts.label-port')" :value="parsedBounce.email?.data?.server?.port" />
</c-card>
<c-card title="Details" mb-2>
<c-card :title="t('tools.bounce-parser.texts.title-details')" mb-2>
<textarea-copyable :value="JSON.stringify(parsedBounce.email?.data, null, 2)" />
</c-card>
<c-card title="Raw Error" mb-2>
<c-card :title="t('tools.bounce-parser.texts.title-raw-error')" mb-2>
<textarea-copyable :value="parsedBounce.email?.email?.error" word-wrap />
</c-card>
</div>
+3 -3
View File
@@ -1,11 +1,11 @@
import { Mailbox } from '@vicons/tabler';
import { defineTool } from '../tool';
import { translate } from '@/plugins/i18n.plugin';
import { translate as t } from '@/plugins/i18n.plugin';
export const tool = defineTool({
name: translate('tools.bounce-parser.title'),
name: t('tools.bounce-parser.title'),
path: '/bounce-parser',
description: translate('tools.bounce-parser.description'),
description: t('tools.bounce-parser.description'),
keywords: ['bounce', 'email', 'smtp', 'parser'],
component: () => import('./bounce-parser.vue'),
icon: Mailbox,
+17 -21
View File
@@ -1,8 +1,11 @@
<script setup lang="ts">
import { useI18n } from 'vue-i18n';
import _ from 'lodash';
import { useMediaRecorder } from './useMediaRecorder';
const { t } = useI18n();
interface Media { type: 'image' | 'video'; value: string; createdAt: Date }
const {
@@ -106,20 +109,18 @@ function downloadMedia({ type, value, createdAt }: Media) {
<template>
<div>
<c-card v-if="!isSupported">
Your browser does not support recording video from camera
{{ t('tools.camera-recorder.texts.tag-your-browser-does-not-support-recording-video-from-camera') }}
</c-card>
<c-card v-else-if="!permissionGranted" text-center>
You need to grant permission to use your camera and microphone
<c-alert v-if="permissionCannotBePrompted" mt-4 text-left>
{{ t('tools.camera-recorder.texts.tag-you-need-to-grant-permission-to-use-your-camera-and-microphone') }}<c-alert v-if="permissionCannotBePrompted" mt-4 text-left>
Your browser has blocked permission request or does not support it. You need to grant permission manually in
your browser settings (usually the lock icon in the address bar).
</c-alert>
<div v-else mt-4 flex justify-center>
<c-button @click="requestPermissions">
Grant permission
{{ t('tools.camera-recorder.texts.tag-grant-permission') }}
</c-button>
</div>
</c-card>
@@ -130,24 +131,24 @@ function downloadMedia({ type, value, createdAt }: Media) {
v-model:value="currentCamera"
label-position="left"
label-width="60px"
label="Video:"
:label="t('tools.camera-recorder.texts.label-video')"
:options="cameras.map(({ deviceId, label }) => ({ value: deviceId, label }))"
placeholder="Select camera"
:placeholder="t('tools.camera-recorder.texts.placeholder-select-camera')"
/>
<c-select
v-if="currentMicrophone && microphones.length > 0"
v-model:value="currentMicrophone"
label="Audio:"
:label="t('tools.camera-recorder.texts.label-audio')"
label-position="left"
label-width="60px"
:options="microphones.map(({ deviceId, label }) => ({ value: deviceId, label }))"
placeholder="Select microphone"
:placeholder="t('tools.camera-recorder.texts.placeholder-select-microphone')"
/>
</div>
<div v-if="!isMediaStreamAvailable" mt-3 flex justify-center>
<c-button type="primary" @click="start">
Start webcam
{{ t('tools.camera-recorder.texts.tag-start-webcam') }}
</c-button>
</div>
@@ -158,33 +159,28 @@ function downloadMedia({ type, value, createdAt }: Media) {
<div flex items-center justify-between gap-2>
<c-button :disabled="!isMediaStreamAvailable" @click="takeScreenshot">
<span mr-2> <icon-mdi-camera /></span>
Take screenshot
<span mr-2> <icon-mdi-camera /></span>{{ t('tools.camera-recorder.texts.tag-take-screenshot') }}
</c-button>
<div v-if="isRecordingSupported" flex justify-center gap-2>
<c-button v-if="recordingState === 'stopped'" @click="startRecording">
<span mr-2> <icon-mdi-video /></span>
Start recording
<span mr-2> <icon-mdi-video /></span>{{ t('tools.camera-recorder.texts.tag-start-recording') }}
</c-button>
<c-button v-if="recordingState === 'recording'" @click="pauseRecording">
<span mr-2> <icon-mdi-pause /></span>
Pause
<span mr-2> <icon-mdi-pause /></span>{{ t('tools.camera-recorder.texts.tag-pause') }}
</c-button>
<c-button v-if="recordingState === 'paused'" @click="resumeRecording">
<span mr-2> <icon-mdi-play /></span>
Resume
<span mr-2> <icon-mdi-play /></span>{{ t('tools.camera-recorder.texts.tag-resume') }}
</c-button>
<c-button v-if="recordingState !== 'stopped'" type="error" @click="stopRecording">
<span mr-2> <icon-mdi-record /></span>
Stop
<span mr-2> <icon-mdi-record /></span>{{ t('tools.camera-recorder.texts.tag-stop') }}
</c-button>
</div>
<div v-else italic op-60>
Video recording is not supported in your browser
{{ t('tools.camera-recorder.texts.tag-video-recording-is-not-supported-in-your-browser') }}
</div>
</div>
</div>
+3 -3
View File
@@ -1,11 +1,11 @@
import { Camera } from '@vicons/tabler';
import { defineTool } from '../tool';
import { translate } from '@/plugins/i18n.plugin';
import { translate as t } from '@/plugins/i18n.plugin';
export const tool = defineTool({
name: translate('tools.camera-recorder.title'),
name: t('tools.camera-recorder.title'),
path: '/camera-recorder',
description: translate('tools.camera-recorder.description'),
description: t('tools.camera-recorder.description'),
keywords: ['camera', 'recoder'],
component: () => import('./camera-recorder.vue'),
icon: Camera,
+11 -8
View File
@@ -1,10 +1,13 @@
<script setup lang="ts">
import { useI18n } from 'vue-i18n';
import cards from '@younestouati/playing-cards-standard-deck';
import { exhaustiveUniqueRandom } from 'unique-random';
import { computedRefreshable } from '@/composable/computedRefreshable';
import { useCopy } from '@/composable/copy';
import { useQueryParamOrStorage } from '@/composable/queryParams';
const { t } = useI18n();
const cardKeys = [...Object.keys(cards).filter(k => k !== 'joker'), 'joker', 'joker'];
type CardNames = keyof typeof cards;
@@ -44,7 +47,7 @@ function translateName(cardId: string) {
const cardPickedString = computed(() => cardPicked.value.map(translateName).join(', '));
const { copy } = useCopy({ source: cardPickedString, text: 'Cards Picked copied to the clipboard' });
const { copy } = useCopy({ source: cardPickedString, text: t('tools.card-picker.texts.text-cards-picked-copied-to-the-clipboard') });
</script>
<template>
@@ -56,24 +59,24 @@ const { copy } = useCopy({ source: cardPickedString, text: 'Cards Picked copied
<textarea-copyable :value="cardPickedString" readonly mb-1 />
</div>
<div flex justify-center gap-3>
<n-form-item label="Number of cards:" label-placement="left">
<n-input-number v-model:value="numberOfCards" min="1" :max="maxCards" placeholder="Number of cards to pick" />
<n-form-item :label="t('tools.card-picker.texts.label-number-of-cards')" label-placement="left">
<n-input-number v-model:value="numberOfCards" min="1" :max="maxCards" :placeholder="t('tools.card-picker.texts.placeholder-number-of-cards-to-pick')" />
</n-form-item>
<n-form-item label="Number of packs:" label-placement="left">
<n-input-number v-model:value="numberOfPacks" min="1" placeholder="Number of card packs to pick in" />
<n-form-item :label="t('tools.card-picker.texts.label-number-of-packs')" label-placement="left">
<n-input-number v-model:value="numberOfPacks" min="1" :placeholder="t('tools.card-picker.texts.placeholder-number-of-card-packs-to-pick-in')" />
</n-form-item>
</div>
<div mb-4 flex justify-center>
<n-checkbox v-model:checked="useJokers">
Use Jokers
{{ t('tools.card-picker.texts.tag-use-jokers') }}
</n-checkbox>
</div>
<div flex justify-center gap-3>
<c-button @click="copy()">
Copy deck
{{ t('tools.card-picker.texts.tag-copy-deck') }}
</c-button>
<c-button @click="refreshCardPicked">
Refresh deck
{{ t('tools.card-picker.texts.tag-refresh-deck') }}
</c-button>
</div>
</c-card>
+3 -3
View File
@@ -1,11 +1,11 @@
import { PlayCard } from '@vicons/tabler';
import { defineTool } from '../tool';
import { translate } from '@/plugins/i18n.plugin';
import { translate as t } from '@/plugins/i18n.plugin';
export const tool = defineTool({
name: translate('tools.card-picker.title'),
name: t('tools.card-picker.title'),
path: '/card-picker',
description: translate('tools.card-picker.description'),
description: t('tools.card-picker.description'),
keywords: ['card', 'deck', 'picker'],
component: () => import('./card-picker.vue'),
icon: PlayCard,
+22 -19
View File
@@ -1,4 +1,5 @@
<script setup lang="ts">
import { useI18n } from 'vue-i18n';
import {
camelCase,
capitalCase,
@@ -16,12 +17,14 @@ import InputCopyable from '../../components/InputCopyable.vue';
import { useQueryParamOrStorage } from '@/composable/queryParams';
import { useValidation } from '@/composable/validation';
const { t } = useI18n();
const cleaningRegex = useQueryParamOrStorage({ name: 'clean', storageName: 'case-conv:cl', defaultValue: '[^\\w\\d\\s]' });
const cleaningRegexValidation = useValidation({
source: cleaningRegex,
rules: [
{
message: 'Invalid cleaning regex: {0}',
message: t('tools.case-converter.texts.message-invalid-cleaning-regex-0'),
validator: value => new RegExp(value),
getErrorMessage: (value) => {
const _ = new RegExp(value);
@@ -41,59 +44,59 @@ const inputCleaned = computed(() => {
const formats = computed(() => [
{
label: 'Lowercase:',
label: t('tools.case-converter.texts.label-lowercase'),
value: inputCleaned.value.toLocaleLowerCase(),
},
{
label: 'Uppercase:',
label: t('tools.case-converter.texts.label-uppercase'),
value: inputCleaned.value.toLocaleUpperCase(),
},
{
label: 'Camelcase:',
label: t('tools.case-converter.texts.label-camelcase'),
value: camelCase(inputCleaned.value),
},
{
label: 'Capitalcase:',
label: t('tools.case-converter.texts.label-capitalcase'),
value: capitalCase(inputCleaned.value),
},
{
label: 'Constantcase:',
label: t('tools.case-converter.texts.label-constantcase'),
value: constantCase(inputCleaned.value),
},
{
label: 'Dotcase:',
label: t('tools.case-converter.texts.label-dotcase'),
value: dotCase(inputCleaned.value),
},
{
label: 'Kebab/paramcase:',
label: t('tools.case-converter.texts.label-kebab-paramcase'),
value: kebabCase(inputCleaned.value),
},
{
label: 'Nocase:',
label: t('tools.case-converter.texts.label-nocase'),
value: noCase(inputCleaned.value),
},
{
label: 'Train/headercase:',
label: t('tools.case-converter.texts.label-train-headercase'),
value: trainCase(inputCleaned.value),
},
{
label: 'Pascalcase:',
label: t('tools.case-converter.texts.label-pascalcase'),
value: pascalCase(inputCleaned.value),
},
{
label: 'Pathcase:',
label: t('tools.case-converter.texts.label-pathcase'),
value: pathCase(inputCleaned.value),
},
{
label: 'Sentencecase:',
label: t('tools.case-converter.texts.label-sentencecase'),
value: sentenceCase(inputCleaned.value),
},
{
label: 'Snakecase:',
label: t('tools.case-converter.texts.label-snakecase'),
value: snakeCase(inputCleaned.value),
},
{
label: 'Mockingcase:',
label: t('tools.case-converter.texts.label-mockingcase'),
value: inputCleaned.value
.split('')
.map((char, index) => (index % 2 === 0 ? char.toUpperCase() : char.toLowerCase()))
@@ -112,8 +115,8 @@ const inputLabelAlignmentConfig = {
<c-card>
<c-input-text
v-model:value="input"
label="Your string:"
placeholder="Your string..."
:label="t('tools.case-converter.texts.label-your-string')"
:placeholder="t('tools.case-converter.texts.placeholder-your-string')"
raw-text
v-bind="inputLabelAlignmentConfig"
mb-1
@@ -121,8 +124,8 @@ const inputLabelAlignmentConfig = {
<c-input-text
v-model:value="cleaningRegex"
label="Cleaning regex:"
placeholder="Your cleaning regex..."
:label="t('tools.case-converter.texts.label-cleaning-regex')"
:placeholder="t('tools.case-converter.texts.placeholder-your-cleaning-regex')"
raw-text
v-bind="inputLabelAlignmentConfig"
mb-1
+3 -3
View File
@@ -1,11 +1,11 @@
import { LetterCaseToggle } from '@vicons/tabler';
import { defineTool } from '../tool';
import { translate } from '@/plugins/i18n.plugin';
import { translate as t } from '@/plugins/i18n.plugin';
export const tool = defineTool({
name: translate('tools.case-converter.title'),
name: t('tools.case-converter.title'),
path: '/case-converter',
description: translate('tools.case-converter.description'),
description: t('tools.case-converter.description'),
keywords: [
'case',
'converter',
@@ -10,6 +10,8 @@ import type * as openpgp from 'openpgp';
import * as forge from 'node-forge';
import oids from './oids.json';
import { translate as t } from '@/plugins/i18n.plugin';
export interface LabelValue {
label: string
value: string
@@ -34,38 +36,38 @@ function buf2Hex(buffer: ArrayBuffer) { // buffer is an ArrayBuffer
export function getPublicKeyLabelValues(publicKey: Key) {
return [
{
label: 'Type:',
value: 'Public Key',
label: t('tools.certificate-key-parser.infos.text.type'),
value: t('tools.certificate-key-parser.infos.text.public-key'),
},
{
label: 'Key Type:',
label: t('tools.certificate-key-parser.texts.label-key-type'),
value: publicKey.type,
},
{
label: 'Size:',
label: t('tools.certificate-key-parser.texts.label-size'),
value: publicKey.size,
},
{
label: 'Comment:',
label: t('tools.certificate-key-parser.texts.label-comment'),
value: publicKey.comment,
multiline: true,
},
{
label: 'Curve:',
label: t('tools.certificate-key-parser.texts.label-curve'),
value: publicKey.curve ?? 'none',
},
{
label: 'Fingerprint (sha256):',
label: t('tools.certificate-key-parser.texts.label-fingerprint-sha256'),
value: onErrorReturnErrorMessage(() => publicKey.fingerprint('sha256')),
multiline: true,
},
{
label: 'Fingerprint (sha512):',
label: t('tools.certificate-key-parser.texts.label-fingerprint-sha512'),
value: onErrorReturnErrorMessage(() => publicKey.fingerprint('sha512')),
multiline: true,
},
{
label: 'Key (PEM):',
label: t('tools.certificate-key-parser.texts.label-key-pem'),
value: onErrorReturnErrorMessage(() => publicKey.toString('pem')),
multiline: true,
},
@@ -75,38 +77,38 @@ export function getPublicKeyLabelValues(publicKey: Key) {
export function getPrivateKeyLabelValues(privateKey: PrivateKey) {
return [
{
label: 'Type:',
label: t('tools.certificate-key-parser.texts.label-type'),
value: 'Private Key',
},
{
label: 'Key Type:',
label: t('tools.certificate-key-parser.texts.label-key-type'),
value: privateKey.type,
},
{
label: 'Size:',
label: t('tools.certificate-key-parser.texts.label-size'),
value: privateKey.size,
},
{
label: 'Comment:',
label: t('tools.certificate-key-parser.texts.label-comment'),
value: privateKey.comment,
multiline: true,
},
{
label: 'Curve:',
label: t('tools.certificate-key-parser.texts.label-curve'),
value: privateKey.curve,
},
{
label: 'Fingerprint (sha256):',
label: t('tools.certificate-key-parser.texts.label-fingerprint-sha256'),
value: onErrorReturnErrorMessage(() => privateKey.fingerprint('sha256')),
multiline: true,
},
{
label: 'Fingerprint (sha512):',
label: t('tools.certificate-key-parser.texts.label-fingerprint-sha512'),
value: onErrorReturnErrorMessage(() => privateKey.fingerprint('sha512')),
multiline: true,
},
{
label: 'Key (PEM):',
label: t('tools.certificate-key-parser.texts.label-key-pem'),
value: onErrorReturnErrorMessage(() => privateKey.toString('pem')),
multiline: true,
},
@@ -116,64 +118,64 @@ export function getPrivateKeyLabelValues(privateKey: PrivateKey) {
export function getCertificateLabelValues(cert: Certificate, forgeCertificate: forge.pki.Certificate | null) {
return [
{
label: 'Type:',
label: t('tools.certificate-key-parser.texts.label-type'),
value: 'Certificate',
},
{
label: 'Subjects:',
label: t('tools.certificate-key-parser.texts.label-subjects'),
value: cert.subjects?.map(s => s.toString()).join('\n'),
multiline: true,
},
{
label: 'Valid From:',
label: t('tools.certificate-key-parser.texts.label-valid-from'),
value: cert.validFrom.toISOString(),
},
{
label: 'Valid Until:',
label: t('tools.certificate-key-parser.texts.label-valid-until'),
value: cert.validUntil.toISOString(),
},
{
label: 'Issuer:',
label: t('tools.certificate-key-parser.texts.label-issuer'),
value: cert.issuer.toString(),
multiline: true,
},
{
label: 'Subject Key:',
label: t('tools.certificate-key-parser.texts.label-subject-key'),
value: onErrorReturnErrorMessage(() => cert.subjectKey?.toString('ssh')),
multiline: true,
},
{
label: 'Subject Key Type:',
label: t('tools.certificate-key-parser.texts.label-subject-key-type'),
value: cert.subjectKey?.type,
},
{
label: 'Subject Size:',
label: t('tools.certificate-key-parser.texts.label-subject-size'),
value: cert.subjectKey?.size,
},
{
label: 'Subject Comment:',
label: t('tools.certificate-key-parser.texts.label-subject-comment'),
value: cert.subjectKey?.comment,
multiline: true,
},
{
label: 'Subject Curve:',
label: t('tools.certificate-key-parser.texts.label-subject-curve'),
value: cert.subjectKey?.curve ?? 'none',
},
{
label: 'Issuer Key:',
label: t('tools.certificate-key-parser.texts.label-issuer-key'),
value: onErrorReturnErrorMessage(() => cert.issuerKey?.toString('ssh')),
multiline: true,
},
{
label: 'Serial:',
label: t('tools.certificate-key-parser.texts.label-serial'),
value: buf2Hex(cert.serial),
},
{
label: 'Purposes:',
label: t('tools.certificate-key-parser.texts.label-purposes'),
value: cert.purposes?.join(', '),
},
{
label: 'Extensions (parsed):',
label: t('tools.certificate-key-parser.texts.label-extensions-parsed'),
value: JSON.stringify(cert.getExtensions().map(ext => ({
oid: (<any>ext).oid,
name: (<any>ext).name || (<any>oids)[(<any>ext).oid],
@@ -183,7 +185,7 @@ export function getCertificateLabelValues(cert: Certificate, forgeCertificate: f
multiline: true,
},
{
label: 'Extensions (raw):',
label: t('tools.certificate-key-parser.texts.label-extensions-raw'),
value: JSON.stringify(forgeCertificate?.extensions.map(ext => ({
id: (<any>ext).id,
name: (<any>ext).id || (<any>oids)[(<any>ext).id],
@@ -207,7 +209,7 @@ export function getCertificateLabelValues(cert: Certificate, forgeCertificate: f
],
),
{
label: 'Certificate (pem):',
label: t('tools.certificate-key-parser.texts.label-certificate-pem'),
value: onErrorReturnErrorMessage(() => cert.toString('pem')),
multiline: true,
},
@@ -217,31 +219,31 @@ export function getCertificateLabelValues(cert: Certificate, forgeCertificate: f
export async function getPGPPublicKeyLabelValuesAsync(pgpPublicKey: openpgp.Key) {
return [
{
label: 'Type:',
label: t('tools.certificate-key-parser.texts.label-type'),
value: 'PGP Public Key',
},
{
label: 'Creation Time:',
label: t('tools.certificate-key-parser.texts.label-creation-time'),
value: pgpPublicKey.getCreationTime().toString(),
},
{
label: 'Expiration Time:',
label: t('tools.certificate-key-parser.texts.label-expiration-time'),
value: (await pgpPublicKey.getExpirationTime())?.toString() || '',
},
{
label: 'Algorithm Info:',
label: t('tools.certificate-key-parser.texts.label-algorithm-info'),
value: JSON.stringify(pgpPublicKey.getAlgorithmInfo()),
},
{
label: 'Fingerprint:',
label: t('tools.certificate-key-parser.texts.label-fingerprint'),
value: pgpPublicKey.getFingerprint(),
},
{
label: 'User ID(s):',
label: t('tools.certificate-key-parser.texts.label-user-id-s'),
value: pgpPublicKey.getUserIDs().join(', '),
},
{
label: 'Key ID(s):',
label: t('tools.certificate-key-parser.texts.label-key-id-s'),
value: pgpPublicKey.getKeyIDs().map(k => k.toHex()).join(' ; '),
},
] as LabelValue[];
@@ -250,31 +252,31 @@ export async function getPGPPublicKeyLabelValuesAsync(pgpPublicKey: openpgp.Key)
export async function getPGPPrivateKeyLabelValuesAsync(pgpPrivateKey: openpgp.Key) {
return [
{
label: 'Type:',
label: t('tools.certificate-key-parser.texts.label-type'),
value: 'PGP Private Key',
},
{
label: 'Creation Time:',
label: t('tools.certificate-key-parser.texts.label-creation-time'),
value: pgpPrivateKey.getCreationTime().toString(),
},
{
label: 'Expiration Time:',
label: t('tools.certificate-key-parser.texts.label-expiration-time'),
value: (await pgpPrivateKey.getExpirationTime())?.toString() || '',
},
{
label: 'Algorithm Info:',
label: t('tools.certificate-key-parser.texts.label-algorithm-info'),
value: JSON.stringify(pgpPrivateKey.getAlgorithmInfo()),
},
{
label: 'Fingerprint:',
label: t('tools.certificate-key-parser.texts.label-fingerprint'),
value: pgpPrivateKey.getFingerprint(),
},
{
label: 'User ID(s):',
label: t('tools.certificate-key-parser.texts.label-user-id-s'),
value: pgpPrivateKey.getUserIDs().join(', '),
},
{
label: 'Key ID(s):',
label: t('tools.certificate-key-parser.texts.label-key-id-s'),
value: pgpPrivateKey.getKeyIDs().map(k => k.toHex()).join(' ; '),
},
] as LabelValue[];
@@ -283,47 +285,47 @@ export async function getPGPPrivateKeyLabelValuesAsync(pgpPrivateKey: openpgp.Ke
export function getCSRLabelValues(csr: forge.pki.CertificateSigningRequest) {
return [
{
label: 'Type:',
label: t('tools.certificate-key-parser.texts.label-type'),
value: 'Certificate Signing Request',
},
{
label: 'Subject:',
label: t('tools.certificate-key-parser.texts.label-subject'),
value: csr.subject?.attributes?.map(a => JSON.stringify(a, null, 2)).join('\n'),
multiline: true,
},
// {
// label: 'Request Info:',
// label: t('tools.certificate-key-parser.texts.label-request-info'),
// value: JSON.stringify(csr.certificationRequestInfo, null, 2),
// multiline: true,
// },
{
label: 'Signature:',
label: t('tools.certificate-key-parser.texts.label-signature'),
value: csr.signature?.toString('hex'),
},
{
label: 'Signature Oid:',
label: t('tools.certificate-key-parser.texts.label-signature-oid'),
value: csr.signatureOid?.toString(),
},
{
label: 'Signature parameters:',
label: t('tools.certificate-key-parser.texts.label-signature-parameters'),
value: JSON.stringify(csr.signatureParameters, null, 2),
},
{
label: 'Signing info:',
label: t('tools.certificate-key-parser.texts.label-signing-info'),
value: JSON.stringify(csr.siginfo, null, 2),
},
{
label: 'Extensions:',
label: t('tools.certificate-key-parser.texts.label-extensions'),
value: JSON.stringify(csr.attributes, null, 2),
multiline: true,
},
{
label: 'Public Key:',
label: t('tools.certificate-key-parser.texts.label-public-key'),
value: onErrorReturnErrorMessage(() => forge.pki.publicKeyToPem(csr.publicKey as never)),
multiline: true,
},
{
label: 'Public Key Fingerprint:',
label: t('tools.certificate-key-parser.texts.label-public-key-fingerprint'),
value: onErrorReturnErrorMessage(() => forge.pki.getPublicKeyFingerprint(csr.publicKey as never)?.toHex()),
multiline: true,
},
@@ -333,15 +335,15 @@ export function getCSRLabelValues(csr: forge.pki.CertificateSigningRequest) {
export function getFingerprintLabelValues(fingerprint: Fingerprint) {
return [
{
label: 'Type:',
label: t('tools.certificate-key-parser.texts.label-type'),
value: 'Fingerprint',
},
{
label: 'Fingerprint (hex):',
label: t('tools.certificate-key-parser.texts.label-fingerprint-hex'),
value: fingerprint.toString('hex'),
},
{
label: 'Fingerprint (base64):',
label: t('tools.certificate-key-parser.texts.label-fingerprint-base64'),
value: fingerprint.toString('base64'),
},
] as LabelValue[];
@@ -350,15 +352,15 @@ export function getFingerprintLabelValues(fingerprint: Fingerprint) {
export function getSignatureLabelValues(signature: Signature) {
return [
{
label: 'Type:',
label: t('tools.certificate-key-parser.texts.label-type'),
value: 'Signature',
},
{
label: 'Fingerprint (asn1):',
label: t('tools.certificate-key-parser.texts.label-fingerprint-asn1'),
value: signature.toString('asn1'),
},
{
label: 'Fingerprint (ssh):',
label: t('tools.certificate-key-parser.texts.label-fingerprint-ssh'),
value: signature.toString('ssh'),
},
] as LabelValue[];
@@ -19,6 +19,8 @@ import * as openpgp from 'openpgp';
import * as forge from 'node-forge';
import { type LabelValue, getCSRLabelValues, getCertificateLabelValues, getFingerprintLabelValues, getPGPPrivateKeyLabelValuesAsync, getPGPPublicKeyLabelValuesAsync, getPrivateKeyLabelValues, getPublicKeyLabelValues, getSignatureLabelValues } from './certificate-key-parser.infos';
import { translate as t } from '@/plugins/i18n.plugin';
export async function getKeysOrCertificatesInfosAsync(keyOrCertificateValue: string | Buffer, passphrase: string) {
const parts = keyOrCertificateValue.toString().trim().split(/(-----BEGIN [^-]+-----\n)/).filter(s => s !== '');
if (!parts.length) {
@@ -140,8 +142,8 @@ export async function getKeyOrCertificateInfosAsync(keyOrCertificateValue: strin
return {
values: [
{
label: 'Type:',
value: 'Unknown format or invalid passphrase',
label: t('tools.certificate-key-parser.service.text.type'),
value: t('tools.certificate-key-parser.service.text.unknown-format-or-invalid-passphrase'),
}],
};
}
@@ -149,7 +151,7 @@ export async function getKeyOrCertificateInfosAsync(keyOrCertificateValue: strin
return {
values: [
{
label: 'Error:',
label: t('tools.certificate-key-parser.service.text.error'),
value: e.toString(),
}] as LabelValue[],
};
@@ -1,10 +1,13 @@
<script setup lang="ts">
import { Buffer } from 'node:buffer';
import { useI18n } from 'vue-i18n';
import { getKeysOrCertificatesInfosAsync } from './certificate-key-parser.service';
import { type LabelValue } from './certificate-key-parser.infos';
import { useDownloadFileFromBase64 } from '@/composable/downloadBase64';
const { t } = useI18n();
const inputKeyOrCertificate = ref('');
const passphrase = ref('');
const fileInput = ref() as Ref<Buffer>;
@@ -60,7 +63,7 @@ const parsedSections = computedAsync<LabelValue[][]>(async () => {
}
catch (e: any) {
return [
[{ label: 'Parsing Error', value: e.toString() }],
[{ label: t('tools.certificate-key-parser.texts.label-parsing-error'), value: e.toString() }],
];
}
});
@@ -73,26 +76,26 @@ const parsedSections = computedAsync<LabelValue[][]>(async () => {
<n-space>
<n-radio
value="file"
label="File"
:label="t('tools.certificate-key-parser.texts.label-file')"
/>
<n-radio
value="content"
label="Content"
:label="t('tools.certificate-key-parser.texts.label-content')"
/>
</n-space>
</n-radio-group>
<c-file-upload
v-if="inputType === 'file'"
title="Drag and drop a Certificate file here, or click to select a Certificate file"
:title="t('tools.certificate-key-parser.texts.title-drag-and-drop-a-certificate-file-here-or-click-to-select-a-certificate-file')"
@file-upload="onUpload"
/>
<c-input-text
v-if="inputType === 'content'"
v-model:value="inputKeyOrCertificate"
label="Paste your Public Key / Private Key / Signature / Fingerprint / Certificate:"
placeholder="Your Public Key / Private Key / Signature / Fingerprint / Certificate..."
:label="t('tools.certificate-key-parser.texts.label-paste-your-public-key-private-key-signature-fingerprint-certificate')"
:placeholder="t('tools.certificate-key-parser.texts.placeholder-your-public-key-private-key-signature-fingerprint-certificate')"
multiline
rows="8"
data-test-id="input"
@@ -101,8 +104,8 @@ const parsedSections = computedAsync<LabelValue[][]>(async () => {
<c-input-text
v-model:value="passphrase"
label="Passphrase (for encrypted keys):"
placeholder="Passphrase (for encrypted keys)..."
:label="t('tools.certificate-key-parser.texts.label-passphrase-for-encrypted-keys')"
:placeholder="t('tools.certificate-key-parser.texts.placeholder-passphrase-for-encrypted-keys')"
type="password"
data-test-id="pass"
/>
@@ -126,13 +129,13 @@ const parsedSections = computedAsync<LabelValue[][]>(async () => {
autosize mb-2
:multiline="multiline"
:value="value"
placeholder="Not Set"
:placeholder="t('tools.certificate-key-parser.texts.placeholder-not-set')"
/>
</c-card>
<div v-if="certificateX509DER !== ''" flex justify-center>
<c-button @click="downloadX509DERFile()">
Download X509 DER certificate
{{ t('tools.certificate-key-parser.texts.tag-download-x509-der-certificate') }}
</c-button>
</div>
</div>
+3 -3
View File
@@ -1,11 +1,11 @@
import { FileCertificate } from '@vicons/tabler';
import { defineTool } from '../tool';
import { translate } from '@/plugins/i18n.plugin';
import { translate as t } from '@/plugins/i18n.plugin';
export const tool = defineTool({
name: translate('tools.certificate-key-parser.title'),
name: t('tools.certificate-key-parser.title'),
path: '/certificate-key-parser',
description: translate('tools.certificate-key-parser.description'),
description: t('tools.certificate-key-parser.description'),
keywords: ['certificate', 'key', 'parser'],
component: () => import('./certificate-key-parser.vue'),
icon: FileCertificate,
@@ -1,6 +1,8 @@
import _ from 'lodash';
import type { GroupPermissions, Permissions, SpecialPermissions } from './chmod-calculator.types';
import { translate as t } from '@/plugins/i18n.plugin';
export { computeUmaskRepresentation, computeChmodOctalRepresentation, computeChmodSymbolicRepresentation, computePermissionsFromChmodOctalRepresentation, computePermissionsFromChmodSymbolicRepresentation };
function computeChmodOctalRepresentation({ permissions }: { permissions: Permissions }): string {
@@ -42,7 +44,7 @@ function computePermissionsFromChmodOctalRepresentation(octalPermissions: string
const specialPermissionValue = { setuid: 4, setgid: 2, stickybit: 1 };
if (!octalPermissions || !octalPermissions.match(/^[0-7]{3,4}$/)) {
throw new Error(`Invalid octal permissions (must be 3 or 4 octal digits): ${octalPermissions}`);
throw new Error(t('tools.chmod-calculator.service.text.invalid-octal-permissions-must-be-3-or-4-octal-digits-octalpermissions', [octalPermissions]));
}
const fullOctalPermissions = octalPermissions.length === 3 ? `0${octalPermissions}` : octalPermissions;
@@ -65,7 +67,7 @@ function computePermissionsFromChmodOctalRepresentation(octalPermissions: string
function computePermissionsFromChmodSymbolicRepresentation(symbolicPermissions: string): Permissions {
const formatRegex = /^[-dlbcsp]?([r-])([w-])([xs-])([r-])([w-])([xs-])([r-])([w-])([xt-])$/;
if (!symbolicPermissions || !symbolicPermissions.match(formatRegex)) {
throw new Error(`Invalid string permissions (must be in form 'rwxrwxrwx'): ${symbolicPermissions}`);
throw new Error(t('tools.chmod-calculator.service.text.invalid-string-permissions-must-be-in-form-rwxrwxrwx-symbolicpermissions', [symbolicPermissions]));
}
const [_, rOwner, wOwner, xOwner, rGroup, wGroup, xGroup, rAll, wAll, xAll] = formatRegex.exec(symbolicPermissions) || [];
+17 -14
View File
@@ -1,4 +1,5 @@
<script setup lang="ts">
import { useI18n } from 'vue-i18n';
import { useThemeVars } from 'naive-ui';
import InputCopyable from '../../components/InputCopyable.vue';
@@ -7,6 +8,8 @@ import { computeChmodOctalRepresentation, computeChmodSymbolicRepresentation, co
import type { Group, Scope } from './chmod-calculator.types';
import { useValidation } from '@/composable/validation';
const { t } = useI18n();
const themeVars = useThemeVars();
const scopes: { scope: Scope; title: string }[] = [
@@ -28,7 +31,7 @@ const octalPermissionsInputValidation = useValidation({
source: octalPermissionsInput,
rules: [
{
message: 'Invalid octal permission string',
message: t('tools.chmod-calculator.texts.message-invalid-octal-permission-string'),
validator: (value) => {
try {
computePermissionsFromChmodOctalRepresentation(value.trim());
@@ -56,7 +59,7 @@ const symbolicPermissionsInputValidation = useValidation({
source: symbolicPermissionsInput,
rules: [
{
message: 'Invalid symbolic permission string',
message: t('tools.chmod-calculator.texts.message-invalid-symbolic-permission-string'),
validator: (value) => {
try {
computePermissionsFromChmodSymbolicRepresentation(value.trim());
@@ -89,16 +92,16 @@ const umask = computed(() => computeUmaskRepresentation({ permissions: permissio
<n-space justify="center">
<c-input-text
v-model:value="octalPermissionsInput"
placeholder="Put your octal permissions here..."
label="Copy your octal permissions"
:placeholder="t('tools.chmod-calculator.texts.placeholder-put-your-octal-permissions-here')"
:label="t('tools.chmod-calculator.texts.label-copy-your-octal-permissions')"
:validation="octalPermissionsInputValidation"
mb-2
/>
<c-input-text
v-model:value="symbolicPermissionsInput"
placeholder="Put your symbolic permissions here..."
label="Copy your symbolic permissions"
:placeholder="t('tools.chmod-calculator.texts.placeholder-put-your-symbolic-permissions-here')"
:label="t('tools.chmod-calculator.texts.label-copy-your-symbolic-permissions')"
:validation="symbolicPermissionsInputValidation"
mb-2
/>
@@ -111,13 +114,13 @@ const umask = computed(() => computeUmaskRepresentation({ permissions: permissio
<tr>
<th class="text-center" scope="col" />
<th class="text-center" scope="col">
Owner (u)
{{ t('tools.chmod-calculator.texts.tag-owner-u') }}
</th>
<th class="text-center" scope="col">
Group (g)
{{ t('tools.chmod-calculator.texts.tag-group-g') }}
</th>
<th class="text-center" scope="col">
Public (o)
{{ t('tools.chmod-calculator.texts.tag-public-o') }}
</th>
</tr>
</thead>
@@ -133,7 +136,7 @@ const umask = computed(() => computeUmaskRepresentation({ permissions: permissio
</tr>
<tr>
<td class="line-header">
Flags
{{ t('tools.chmod-calculator.texts.tag-flags') }}
</td>
<td class="text-center">
<n-checkbox v-model:checked="permissions.flags.setuid" size="large" />
@@ -155,13 +158,13 @@ const umask = computed(() => computeUmaskRepresentation({ permissions: permissio
{{ symbolic }}
</div>
<c-card title="Chmod command" mb-1>
<c-card :title="t('tools.chmod-calculator.texts.title-chmod-command')" mb-1>
<InputCopyable label-position="left" :value="`chmod ${octal} path`" readonly />
</c-card>
<c-card title="Umask">
<InputCopyable label="Octal:" label-position="left" label-width="100px" :value="umask.octal" readonly />
<InputCopyable label="Symbolic:" label-position="left" label-width="100px" :value="umask.symbolic" readonly />
<c-card :title="t('tools.chmod-calculator.texts.title-umask')">
<InputCopyable :label="t('tools.chmod-calculator.texts.label-octal')" label-position="left" label-width="100px" :value="umask.octal" readonly />
<InputCopyable :label="t('tools.chmod-calculator.texts.label-symbolic')" label-position="left" label-width="100px" :value="umask.symbolic" readonly />
</c-card>
</div>
</template>
+3 -3
View File
@@ -1,11 +1,11 @@
import { FileInvoice } from '@vicons/tabler';
import { defineTool } from '../tool';
import { translate } from '@/plugins/i18n.plugin';
import { translate as t } from '@/plugins/i18n.plugin';
export const tool = defineTool({
name: translate('tools.chmod-calculator.title'),
name: t('tools.chmod-calculator.title'),
path: '/chmod-calculator',
description: translate('tools.chmod-calculator.description'),
description: t('tools.chmod-calculator.description'),
keywords: [
'chmod',
'calculator',
+3 -3
View File
@@ -1,11 +1,11 @@
import { TimerOutlined } from '@vicons/material';
import { defineTool } from '../tool';
import { translate } from '@/plugins/i18n.plugin';
import { translate as t } from '@/plugins/i18n.plugin';
export const tool = defineTool({
name: translate('tools.chronometer.title'),
name: t('tools.chronometer.title'),
path: '/chronometer',
description: translate('tools.chronometer.description'),
description: t('tools.chronometer.description'),
keywords: ['chronometer', 'time', 'lap', 'duration', 'measure', 'pause', 'resume', 'stopwatch'],
component: () => import('./chronometer.vue'),
icon: TimerOutlined,
+11 -12
View File
@@ -1,4 +1,5 @@
<script setup lang="ts">
import { useI18n } from 'vue-i18n';
import { useStorage } from '@vueuse/core';
import { Check as CheckIcon, LetterX as CrossIcon } from '@vicons/tabler';
import { getMatch } from 'ip-matching';
@@ -7,6 +8,8 @@ import { withDefaultOnError } from '@/utils/defaults';
import { isNotThrowing } from '@/utils/boolean';
import SpanCopyable from '@/components/SpanCopyable.vue';
const { t } = useI18n();
const baseRange = useStorage('cidr-in-cidr:range', '192.168.0.1/24'); // NOSONAR
const ipOrRangeToTest = useStorage('cidr-in-cidr:ip', '192.168.0.1'); // NOSONAR
@@ -16,7 +19,7 @@ const matchResult = computed(() => withDefaultOnError(
const rangeValidationRules = [
{
message: 'We cannot parse this CIDR/IP Range/Mask/Wildcard, check the format',
message: t('tools.cidr-in-cidr.texts.message-we-cannot-parse-this-cidr-ip-range-mask-wildcard-check-the-format'),
validator: (value: string) => isNotThrowing(() => getMatch(value)) && getMatch(value),
},
];
@@ -26,16 +29,16 @@ const rangeValidationRules = [
<div>
<c-input-text
v-model:value="baseRange"
label="An IPv4/6 CIDR/Range/Mask/Wildcard (base network)"
placeholder="The ipv4/6 CIDR..."
:label="t('tools.cidr-in-cidr.texts.label-an-ipv4-6-cidr-range-mask-wildcard-base-network')"
:placeholder="t('tools.cidr-in-cidr.texts.placeholder-the-ipv4-6-cidr')"
:validation-rules="rangeValidationRules"
mb-4
/>
<c-input-text
v-model:value="ipOrRangeToTest"
label="An IPv4/6 CIDR/Range/Mask/Wildcard (to test for inclusion)"
placeholder="The An IPv4/6 CIDR/Range/Mask/Wildcard..."
:label="t('tools.cidr-in-cidr.texts.label-an-ipv4-6-cidr-range-mask-wildcard-to-test-for-inclusion')"
:placeholder="t('tools.cidr-in-cidr.texts.placeholder-the-an-ipv4-6-cidr-range-mask-wildcard')"
:validation-rules="rangeValidationRules"
mb-4
/>
@@ -46,20 +49,16 @@ const rangeValidationRules = [
<span v-if="matchResult.isIncluded">
<n-icon color="green">
<CheckIcon />
</n-icon>
Included
</span>
</n-icon>{{ t('tools.cidr-in-cidr.texts.tag-included') }}</span>
<span v-else>
<n-icon color="red">
<CrossIcon />
</n-icon>
Not included
</span>
</n-icon>{{ t('tools.cidr-in-cidr.texts.tag-not-included') }}</span>
</div>
<n-divider />
<c-card title="Subnets">
<c-card :title="t('tools.cidr-in-cidr.texts.title-subnets')">
<n-table>
<tbody>
<tr v-for="{ cidr, start, end } in matchResult.baseSubnets" :key="cidr">
+3 -3
View File
@@ -1,11 +1,11 @@
import { UnfoldMoreOutlined } from '@vicons/material';
import { defineTool } from '../tool';
import { translate } from '@/plugins/i18n.plugin';
import { translate as t } from '@/plugins/i18n.plugin';
export const tool = defineTool({
name: translate('tools.cidr-in-cidr.title'),
name: t('tools.cidr-in-cidr.title'),
path: '/cidr-in-cidr',
description: translate('tools.cidr-in-cidr.description'),
description: t('tools.cidr-in-cidr.description'),
keywords: ['ip', 'cidr', 'range', 'mask', 'wildcard', 'ipv4', 'ipv6', 'subnet', 'include', 'inclusion'],
component: () => import('./cidr-in-cidr.vue'),
redirectFrom: ['/ip-in-range'],
@@ -1,7 +1,10 @@
<script setup lang="ts">
import { useI18n } from 'vue-i18n';
import { ref } from 'vue';
import { APA, MLA } from 'citation-formatter';
const { t } = useI18n();
const citationData = ref({
authors: [''],
title: '',
@@ -38,37 +41,37 @@ const formattedCitation = computed(() => {
</script>
<template>
<n-card title="Citation Generator" style="max-width: 600px; margin: auto;">
<n-card :title="t('tools.citation-generator.texts.title-citation-generator')" style="max-width: 600px; margin: auto;">
<n-form label-placement="left" label-width="150px" :model="citationData">
<n-form-item label="Authors (in Last Name, First Name format):" label-placement="top">
<n-form-item :label="t('tools.citation-generator.texts.label-authors-in-last-name-first-name-format')" label-placement="top">
<n-dynamic-input
v-model:value="citationData.authors"
placeholder="Enter author name"
:placeholder="t('tools.citation-generator.texts.placeholder-enter-author-name')"
/>
</n-form-item>
<n-form-item label="Title:">
<n-input v-model:value="citationData.title" placeholder="e.g. Introduction to Vue 3" :status="citationData.title ? 'success' : 'error'" />
<n-form-item :label="t('tools.citation-generator.texts.label-title')">
<n-input v-model:value="citationData.title" :placeholder="t('tools.citation-generator.texts.placeholder-e-g-introduction-to-vue-3')" :status="citationData.title ? 'success' : 'error'" />
</n-form-item>
<n-form-item label="Publisher:">
<n-input v-model:value="citationData.publisher" placeholder="e.g. O'Reilly Media" :status="citationData.publisher ? 'success' : 'error'" />
<n-form-item :label="t('tools.citation-generator.texts.label-publisher')">
<n-input v-model:value="citationData.publisher" :placeholder="t('tools.citation-generator.texts.placeholder-e-g-o-reilly-media')" :status="citationData.publisher ? 'success' : 'error'" />
</n-form-item>
<n-form-item label="Publication Year:">
<n-form-item :label="t('tools.citation-generator.texts.label-publication-year')">
<n-input-number v-model:value="citationData.year" :min="0" :status="citationData.year ? 'success' : 'error'" />
</n-form-item>
<n-form-item label="URL (optional):">
<n-input v-model:value="citationData.url" placeholder="e.g. https://example.com" />
<n-form-item :label="t('tools.citation-generator.texts.label-url-optional')">
<n-input v-model:value="citationData.url" :placeholder="t('tools.citation-generator.texts.placeholder-e-g-https-example-com')" />
</n-form-item>
<n-form-item label="Citation Style">
<n-form-item :label="t('tools.citation-generator.texts.label-citation-style')">
<n-select
v-model:value="style"
:options="[
{ label: 'APA', value: 'apa' },
{ label: 'MLA', value: 'mla' },
{ label: t('tools.citation-generator.texts.label-apa'), value: 'apa' },
{ label: t('tools.citation-generator.texts.label-mla'), value: 'mla' },
]"
/>
</n-form-item>
@@ -76,7 +79,7 @@ const formattedCitation = computed(() => {
<n-divider />
<c-card title="Generated Citation">
<c-card :title="t('tools.citation-generator.texts.title-generated-citation')">
<textarea-copyable :value="formattedCitation" />
</c-card>
</n-card>
+3 -3
View File
@@ -1,11 +1,11 @@
import { Book2 } from '@vicons/tabler';
import { defineTool } from '../tool';
import { translate } from '@/plugins/i18n.plugin';
import { translate as t } from '@/plugins/i18n.plugin';
export const tool = defineTool({
name: translate('tools.citation-generator.title'),
name: t('tools.citation-generator.title'),
path: '/citation-generator',
description: translate('tools.citation-generator.description'),
description: t('tools.citation-generator.description'),
keywords: ['citation', 'generator', 'apa', 'mla', 'bibliography'],
component: () => import('./citation-generator.vue'),
icon: Book2,
@@ -1,6 +1,9 @@
<script setup lang="ts">
import { useI18n } from 'vue-i18n';
import * as service from './cli-command-editor.service';
const { t } = useI18n();
const inputCommand = ref('');
const options = computed(() => service.extractOptions(inputCommand.value));
const optionsObject = computed(() => service.buildOptionsObject(options.value));
@@ -17,9 +20,9 @@ const command = ref('');
label-position="left"
label-width="130px"
:label="$t('tools.cli-command-editor.command')"
:aria-label="$t('tools.cli-command-editor.command')"
:aria-:label="t('tools.cli-command-editor.texts.label-t-tools-cli-command-editor-command')"
:placeholder="$t('tools.cli-command-editor.placeholder')"
:aria-placeholder="$t('tools.cli-command-editor.placeholder')"
:aria-:placeholder="t('tools.cli-command-editor.texts.placeholder-t-tools-cli-command-editor-placeholder')"
raw-text
@update:value="() => { command = inputCommand }"
/>
@@ -30,9 +33,9 @@ const command = ref('');
label-width="130px"
label-align="left"
:label="service.sanitizeOption(option)"
:aria-label="service.sanitizeOption(option)"
:aria-:label="t('tools.cli-command-editor.texts.label-service-sanitizeoption-option')"
:placeholder="service.sanitizeOption(option)"
:aria-placeholder="service.sanitizeOption(option)"
:aria-:placeholder="t('tools.cli-command-editor.texts.placeholder-service-sanitizeoption-option')"
mt-6
@update:value="() => { command = service.buildEditedCommand(optionsInput, optionsObject, inputCommand) }"
/>
+2 -2
View File
@@ -1,9 +1,9 @@
import { Terminal2 } from '@vicons/tabler';
import { defineTool } from '../tool';
import { translate } from '@/plugins/i18n.plugin';
import { translate as t } from '@/plugins/i18n.plugin';
export const tool = defineTool({
name: translate('tools.cli-command-editor.title'),
name: t('tools.cli-command-editor.title'),
path: '/cli-command-editor',
description: '',
keywords: ['cli', 'command', 'editor'],
@@ -1,10 +1,13 @@
<script setup lang="ts">
import { useI18n } from 'vue-i18n';
import { computed, ref } from 'vue';
import { bundledLanguagesInfo, createHighlighter } from 'shiki/bundle/full';
import { bundledThemesInfo } from 'shiki/themes';
import { useQueryParamOrStorage } from '@/composable/queryParams';
import { useCopy, useCopyClipboardItems } from '@/composable/copy';
const { t } = useI18n();
const code = ref(`// Using 'typeof' to infer types
const person = { name: "Alice", age: 30 };
type PersonType = typeof person; // { name: string; age: number }
@@ -85,7 +88,7 @@ const { copy: copyText } = useCopy({ source: code });
<div mb-3 flex items-baseline gap-1>
<c-select
v-model:value="currentLang"
label="Language"
:label="t('tools.code-highlighter.texts.label-language')"
label-position="left"
searchable
:options="langs"
@@ -93,7 +96,7 @@ const { copy: copyText } = useCopy({ source: code });
/>
<c-select
v-model:value="currentTheme"
label="Theme"
:label="t('tools.code-highlighter.texts.label-theme')"
label-position="left"
searchable
:options="themes"
@@ -103,22 +106,22 @@ const { copy: copyText } = useCopy({ source: code });
<c-input-text
v-model:value="code"
label="Code snippet to format:"
:label="t('tools.code-highlighter.texts.label-code-snippet-to-format')"
multiline
placeholder="Put your code snippet here"
:placeholder="t('tools.code-highlighter.texts.placeholder-put-your-code-snippet-here')"
rows="5"
mb-3
/>
<div flex justify-center gap-2>
<n-form-item label="Show line numbers" label-placement="left">
<n-form-item :label="t('tools.code-highlighter.texts.label-show-line-numbers')" label-placement="left">
<n-switch v-model:value="showLineNumbers" />
</n-form-item>
<c-button @click="copyHtml()">
Copy HTML Formatted
{{ t('tools.code-highlighter.texts.tag-copy-html-formatted') }}
</c-button>
<c-button @click="copyText()">
Copy Code Text
{{ t('tools.code-highlighter.texts.tag-copy-code-text') }}
</c-button>
</div>
+3 -3
View File
@@ -1,11 +1,11 @@
import { Code } from '@vicons/tabler';
import { defineTool } from '../tool';
import { translate } from '@/plugins/i18n.plugin';
import { translate as t } from '@/plugins/i18n.plugin';
export const tool = defineTool({
name: translate('tools.code-highlighter.title'),
name: t('tools.code-highlighter.title'),
path: '/code-highlighter',
description: translate('tools.code-highlighter.description'),
description: t('tools.code-highlighter.description'),
keywords: ['code', 'highlighter'],
component: () => import('./code-highlighter.vue'),
icon: Code,
+4 -1
View File
@@ -1,7 +1,10 @@
<script setup lang="ts">
import { useI18n } from 'vue-i18n';
import { computedRefreshable } from '@/composable/computedRefreshable';
import { randIntFromInterval } from '@/utils/random';
const { t } = useI18n();
const [coinFlip, refreshCoinFlip] = computedRefreshable(() => ({
coin: randIntFromInterval(0, 10) % 2 === 0 ? 'Heads' : 'Tails',
dt: Date.now(),
@@ -19,7 +22,7 @@ const [coinFlip, refreshCoinFlip] = computedRefreshable(() => ({
</Transition>
<div mt-4 flex justify-center>
<c-button @click="refreshCoinFlip">
Re flip
{{ t('tools.coin-flipper.texts.tag-re-flip') }}
</c-button>
</div>
</div>
+3 -3
View File
@@ -1,11 +1,11 @@
import { Coin } from '@vicons/tabler';
import { defineTool } from '../tool';
import { translate } from '@/plugins/i18n.plugin';
import { translate as t } from '@/plugins/i18n.plugin';
export const tool = defineTool({
name: translate('tools.coin-flipper.title'),
name: t('tools.coin-flipper.title'),
path: '/coin-flipper',
description: translate('tools.coin-flipper.description'),
description: t('tools.coin-flipper.description'),
keywords: ['coin', 'flipper'],
component: () => import('./coin-flipper.vue'),
icon: Coin,
@@ -1,16 +1,19 @@
<script setup lang="ts">
import { useI18n } from 'vue-i18n';
import { apcaContrastValue, hex, wcag, wcagContrastValue } from 'a11y-color-contrast';
import { useQueryParam } from '@/composable/queryParams';
const { t } = useI18n();
const forecolor = useQueryParam({ name: 'fg', defaultValue: '#000' });
const backcolor = useQueryParam({ name: 'bg', defaultValue: '#fff' });
const levels = [
{ score: 3, text: 'Very poor', bg: '#fbd0da', fg: '#5f071c', stars: 1 },
{ score: 4.5, text: 'Poor', bg: '#fbd0da', fg: '#5f071c', stars: 2 },
{ score: 7, text: 'Good', bg: '#fbf5d0', fg: '#5f5207', stars: 3 },
{ score: 12, text: 'Very good', bg: '#d2fbd0', fg: '#0d5f07', stars: 4 },
{ score: 9999, text: 'Super', bg: '#d2fbd0', fg: '#0d5f07', stars: 5 },
{ score: 3, text: t('tools.color-contrast-checker.texts.text-very-poor'), bg: '#fbd0da', fg: '#5f071c', stars: 1 },
{ score: 4.5, text: t('tools.color-contrast-checker.texts.text-poor'), bg: '#fbd0da', fg: '#5f071c', stars: 2 },
{ score: 7, text: t('tools.color-contrast-checker.texts.text-good'), bg: '#fbf5d0', fg: '#5f5207', stars: 3 },
{ score: 12, text: t('tools.color-contrast-checker.texts.text-very-good'), bg: '#d2fbd0', fg: '#0d5f07', stars: 4 },
{ score: 9999, text: t('tools.color-contrast-checker.texts.text-super'), bg: '#d2fbd0', fg: '#0d5f07', stars: 5 },
];
const smallLevels = [
{ score: 4.5, bg: '#fbd0da', fg: '#5f071c', stars: 1 },
@@ -53,7 +56,7 @@ const result = computed(() => {
<template>
<div max-w-600px>
<n-form-item
label="Forecolor:"
:label="t('tools.color-contrast-checker.texts.label-forecolor')"
label-placement="left"
mb-1
>
@@ -64,7 +67,7 @@ const result = computed(() => {
/>
</n-form-item>
<n-form-item
label="Backcolor:"
:label="t('tools.color-contrast-checker.texts.label-backcolor')"
label-placement="left"
mb-1
>
@@ -81,10 +84,10 @@ const result = computed(() => {
{{ result.error }}
</c-alert>
<c-card v-if="!result.error" title="WCAG 2.1">
<input-copyable readonly label="WCAG Constrast:" label-width="130px" label-position="left" :value="result.wcag21ConstrastValue" mb-3 />
<c-card v-if="!result.error" :title="t('tools.color-contrast-checker.texts.title-wcag-2-1')">
<input-copyable readonly :label="t('tools.color-contrast-checker.texts.label-wcag-constrast')" label-width="130px" label-position="left" :value="result.wcag21ConstrastValue" mb-3 />
<n-form-item v-if="result.level" label="Contrast quality:" label-width="130px" label-placement="left">
<n-form-item v-if="result.level" :label="t('tools.color-contrast-checker.texts.label-contrast-quality')" label-width="130px" label-placement="left">
<n-tag :max="5" :color="{ color: result.level.bg, textColor: result.level.fg, borderColor: result.level.fg }" mr-2>
<span>{{ result.wcag21ConstrastValue.toFixed(2) }} - {{ result.level.text }}</span>
</n-tag>
@@ -92,37 +95,37 @@ const result = computed(() => {
<n-rate :count="5" readonly :default-value="result.level.stars" :color="result.level.fg" />
</n-tag>
</n-form-item>
<n-form-item v-if="result.smallLevel" label="Small texts:" label-width="130px" label-placement="left">
<n-form-item v-if="result.smallLevel" :label="t('tools.color-contrast-checker.texts.label-small-texts')" label-width="130px" label-placement="left">
<n-tag :color="{ color: result.smallLevel.bg, textColor: result.smallLevel.fg, borderColor: result.smallLevel.fg }">
<n-rate :count="3" readonly :default-value="result.smallLevel.stars" :color="result.smallLevel.fg" />
</n-tag>
</n-form-item>
<n-form-item v-if="result.largeLevel" label="Large texts:" label-width="130px" label-placement="left">
<n-form-item v-if="result.largeLevel" :label="t('tools.color-contrast-checker.texts.label-large-texts')" label-width="130px" label-placement="left">
<n-tag :color="{ color: result.largeLevel.bg, textColor: result.largeLevel.fg, borderColor: result.largeLevel.fg }">
<n-rate :count="3" readonly :default-value="result.largeLevel.stars" :color="result.largeLevel.fg" />
</n-tag>
</n-form-item>
<c-card title="Normal text">
<n-form-item label="WCAG 2.1 AA:" label-width="130px" label-placement="left">
<c-card :title="t('tools.color-contrast-checker.texts.title-normal-text')">
<n-form-item :label="t('tools.color-contrast-checker.texts.label-wcag-2-1-aa')" label-width="130px" label-placement="left">
<n-tag :bordered="false" :type="result.aaNormal ? 'success' : 'error'">
{{ result.aaNormal ? 'Pass' : 'Fail' }}
</n-tag>
</n-form-item>
<n-form-item label="WCAG 2.1 AAA:" label-width="130px" label-placement="left">
<n-form-item :label="t('tools.color-contrast-checker.texts.label-wcag-2-1-aaa')" label-width="130px" label-placement="left">
<n-tag :bordered="false" :type="result.aaaNormal ? 'success' : 'error'">
{{ result.aaaNormal ? 'Pass' : 'Fail' }}
</n-tag>
</n-form-item>
</c-card>
<c-card title="Large text">
<n-p><i>Text that is 14pt (18.67px) and bold or any text bigger than 18pt (24px) is defined as large scale text.</i></n-p>
<n-form-item label="WCAG 2.1 AA:" label-width="130px" label-placement="left">
<c-card :title="t('tools.color-contrast-checker.texts.title-large-text')">
<n-p><i>{{ t('tools.color-contrast-checker.texts.tag-text-that-is-14pt-18-67px-and-bold-or-any-text-bigger-than-18pt-24px-is-defined-as-large-scale-text') }}</i></n-p>
<n-form-item :label="t('tools.color-contrast-checker.texts.label-wcag-2-1-aa')" label-width="130px" label-placement="left">
<n-tag :bordered="false" :type="result.aaLarge ? 'success' : 'error'">
{{ result.aaLarge ? 'Pass' : 'Fail' }}
</n-tag>
</n-form-item>
<n-form-item label="WCAG 2.1 AAA:" label-width="130px" label-placement="left">
<n-form-item :label="t('tools.color-contrast-checker.texts.label-wcag-2-1-aaa')" label-width="130px" label-placement="left">
<n-tag :bordered="false" :type="result.aaaLarge ? 'success' : 'error'">
{{ result.aaaLarge ? 'Pass' : 'Fail' }}
</n-tag>
@@ -130,8 +133,8 @@ const result = computed(() => {
</c-card>
</c-card>
<c-card v-if="!result.error" title="APCA">
<input-copyable readonly label="APCA Constrast:" label-width="130px" label-position="left" :value="result.apcaContrastValue" mb-2 />
<c-card v-if="!result.error" :title="t('tools.color-contrast-checker.texts.title-apca')">
<input-copyable readonly :label="t('tools.color-contrast-checker.texts.label-apca-constrast')" label-width="130px" label-position="left" :value="result.apcaContrastValue" mb-2 />
</c-card>
</div>
</template>
+3 -3
View File
@@ -1,11 +1,11 @@
import { ColorSwatch } from '@vicons/tabler';
import { defineTool } from '../tool';
import { translate } from '@/plugins/i18n.plugin';
import { translate as t } from '@/plugins/i18n.plugin';
export const tool = defineTool({
name: translate('tools.color-contrast-checker.title'),
name: t('tools.color-contrast-checker.title'),
path: '/color-contrast-checker',
description: translate('tools.color-contrast-checker.description'),
description: t('tools.color-contrast-checker.description'),
keywords: ['color', 'contrast', 'checker', 'wcag'],
component: () => import('./color-contrast-checker.vue'),
icon: ColorSwatch,
@@ -2,6 +2,8 @@ import { type Colord, colord } from 'colord';
import { withDefaultOnError } from '@/utils/defaults';
import { useValidation } from '@/composable/validation';
import { translate as t } from '@/plugins/i18n.plugin';
export { removeAlphaChannelWhenOpaque, buildColorFormat };
function removeAlphaChannelWhenOpaque(hexColor: string) {
@@ -13,7 +15,7 @@ function buildColorFormat({
parse = value => colord(value),
format,
placeholder,
invalidMessage = `Invalid ${label.toLowerCase()} format.`,
invalidMessage = t('tools.color-converter.models.text.invalid-label-tolowercase-format', [label.toLowerCase()]),
type = 'text',
}: {
label: string
+18 -15
View File
@@ -1,4 +1,5 @@
<script setup lang="ts">
import { useI18n } from 'vue-i18n';
import type { Colord } from 'colord';
import { colord, extend } from 'colord';
import _ from 'lodash';
@@ -10,58 +11,60 @@ import xyzPlugin from 'colord/plugins/xyz';
import labPlugin from 'colord/plugins/lab';
import { buildColorFormat } from './color-converter.models';
const { t } = useI18n();
extend([cmykPlugin, hwbPlugin, namesPlugin, lchPlugin, xyzPlugin, labPlugin]);
const formats = {
picker: buildColorFormat({
label: 'color picker',
label: t('tools.color-converter.texts.label-color-picker'),
format: (v: Colord) => v.toHex(),
type: 'color-picker',
}),
hex: buildColorFormat({
label: 'hex',
label: t('tools.color-converter.texts.label-hex'),
format: (v: Colord) => v.toHex(),
placeholder: 'e.g. #ff0000',
}),
rgb: buildColorFormat({
label: 'rgb',
label: t('tools.color-converter.texts.label-rgb'),
format: (v: Colord) => v.toRgbString(),
placeholder: 'e.g. rgb(255, 0, 0)',
}),
hsl: buildColorFormat({
label: 'hsl',
label: t('tools.color-converter.texts.label-hsl'),
format: (v: Colord) => v.toHslString(),
placeholder: 'e.g. hsl(0, 100%, 50%)',
}),
hwb: buildColorFormat({
label: 'hwb',
label: t('tools.color-converter.texts.label-hwb'),
format: (v: Colord) => v.toHwbString(),
placeholder: 'e.g. hwb(0, 0%, 0%)',
}),
lch: buildColorFormat({
label: 'lch',
label: t('tools.color-converter.texts.label-lch'),
format: (v: Colord) => v.toLchString(),
placeholder: 'e.g. lch(53.24, 104.55, 40.85)',
}),
cmyk: buildColorFormat({
label: 'cmyk',
label: t('tools.color-converter.texts.label-cmyk'),
format: (v: Colord) => v.toCmykString(),
placeholder: 'e.g. cmyk(0, 100%, 100%, 0)',
}),
lab: buildColorFormat({
label: 'lab',
label: t('tools.color-converter.texts.label-lab'),
format: (v: Colord) => JSON.stringify(v.toLab()),
placeholder: 'e.g. { l: 14.89, a: 5.77, b: 14.41, alpha: 0.5 }',
parse: value => colord(JSON.parse(value)),
}),
xyz: buildColorFormat({
label: 'xyz',
label: t('tools.color-converter.texts.label-xyz'),
format: (v: Colord) => JSON.stringify(v.toXyz()),
placeholder: 'e.g. { x: 95.047, y: 100, z: 108.883, a: 1 }',
parse: value => colord(JSON.parse(value)),
}),
name: buildColorFormat({
label: 'name',
label: t('tools.color-converter.texts.label-name'),
format: (v: Colord) => v.toName({ closest: true }) ?? 'Unknown',
placeholder: 'e.g. red',
}),
@@ -124,23 +127,23 @@ function updateColorValue(value: Colord | undefined, omitLabel?: string) {
<template>
<div>
<c-card title="Transformations">
<n-form-item label="Saturation" label-placement="left">
<c-card :title="t('tools.color-converter.texts.title-transformations')">
<n-form-item :label="t('tools.color-converter.texts.label-saturation')" label-placement="left">
<n-slider v-model:value="saturation" :step="1" :min="-100" :max="100" mr-2 />
<n-input-number v-model:value="saturation" size="small" />
</n-form-item>
<n-form-item label="Brightness" label-placement="left">
<n-form-item :label="t('tools.color-converter.texts.label-brightness')" label-placement="left">
<n-slider v-model:value="brightness" :step="1" :min="-100" :max="100" mr-2 />
<n-input-number v-model:value="brightness" size="small" />
</n-form-item>
<n-space>
<n-form-item label="Grayscale" label-placement="left">
<n-form-item :label="t('tools.color-converter.texts.label-grayscale')" label-placement="left">
<n-checkbox v-model:checked="grayscale" mr-2 />
</n-form-item>
<n-form-item label="Invert" label-placement="left">
<n-form-item :label="t('tools.color-converter.texts.label-invert')" label-placement="left">
<n-checkbox v-model:checked="invert" mr-2 />
</n-form-item>
</n-space>
+3 -3
View File
@@ -1,11 +1,11 @@
import { Palette } from '@vicons/tabler';
import { defineTool } from '../tool';
import { translate } from '@/plugins/i18n.plugin';
import { translate as t } from '@/plugins/i18n.plugin';
export const tool = defineTool({
name: translate('tools.color-converter.title'),
name: t('tools.color-converter.title'),
path: '/color-converter',
description: translate('tools.color-converter.description'),
description: t('tools.color-converter.description'),
keywords: ['color', 'converter'],
component: () => import('./color-converter.vue'),
icon: Palette,
+15 -12
View File
@@ -1,4 +1,5 @@
<script setup lang="ts">
import { useI18n } from 'vue-i18n';
import { colord, extend } from 'colord';
import a11yPlugin from 'colord/plugins/a11y';
@@ -7,6 +8,8 @@ import { useDebounce } from '@vueuse/core';
import type { Harmony, HarmonyType } from 'vue-color-wheel';
import { VueColorWheel } from 'vue-color-wheel';
const { t } = useI18n();
extend([a11yPlugin]);
const wheelColor = useDebounce(ref('#40ffff')); // { hue: 0, saturation: 0.68, value: 1 }
@@ -16,15 +19,15 @@ const isColorReadable = ref(false);
const isDarkTheme = useDark();
const harmonyTypes: { type: HarmonyType; label: string }[] = [
{ type: 'monochromatic', label: 'Monochromatic' },
{ type: 'complementary', label: 'Complementary' },
{ type: 'analogous', label: 'Analogous' },
{ type: 'triad', label: 'Triad' },
{ type: 'split', label: 'Split' },
{ type: 'compound', label: 'Compound' },
{ type: 'tetradic', label: 'Tetradic' },
{ type: 'square', label: 'Square' },
{ type: 'doubleSplit', label: 'Double Split' },
{ type: 'monochromatic', label: t('tools.color-wheel.texts.label-monochromatic') },
{ type: 'complementary', label: t('tools.color-wheel.texts.label-complementary') },
{ type: 'analogous', label: t('tools.color-wheel.texts.label-analogous') },
{ type: 'triad', label: t('tools.color-wheel.texts.label-triad') },
{ type: 'split', label: t('tools.color-wheel.texts.label-split') },
{ type: 'compound', label: t('tools.color-wheel.texts.label-compound') },
{ type: 'tetradic', label: t('tools.color-wheel.texts.label-tetradic') },
{ type: 'square', label: t('tools.color-wheel.texts.label-square') },
{ type: 'doubleSplit', label: t('tools.color-wheel.texts.label-double-split') },
];
const colorList = computed(() => {
@@ -85,14 +88,14 @@ watch(
<template>
<div>
<c-card title="Pick a color" mb-2>
<c-card :title="t('tools.color-wheel.texts.title-pick-a-color')" mb-2>
<n-color-picker :value="wheelColor" :show-alpha="false" />
<div
:style="{ backgroundColor: wheelColor }"
/>
</c-card>
<c-card title="Pick a palette type" mb-2>
<c-card :title="t('tools.color-wheel.texts.title-pick-a-palette-type')" mb-2>
<n-radio-group v-model:value="currentType" name="radiogroup">
<n-space>
<n-radio
@@ -104,7 +107,7 @@ watch(
</n-space>
</n-radio-group>
</c-card>
<c-card title="Wheel" mb-2 style="text-align: center">
<c-card :title="t('tools.color-wheel.texts.title-wheel')" mb-2 style="text-align: center">
<div style="display: inline-block">
<VueColorWheel
v-model:color="wheelColor"
+3 -3
View File
@@ -1,11 +1,11 @@
import { ColorPicker } from '@vicons/tabler';
import { defineTool } from '../tool';
import { translate } from '@/plugins/i18n.plugin';
import { translate as t } from '@/plugins/i18n.plugin';
export const tool = defineTool({
name: translate('tools.color-wheel.title'),
name: t('tools.color-wheel.title'),
path: '/color-wheel',
description: translate('tools.color-wheel.description'),
description: t('tools.color-wheel.description'),
keywords: ['color', 'wheel', 'palette', 'theme'],
component: () => import('./color-wheel.vue'),
icon: ColorPicker,
+3 -3
View File
@@ -1,11 +1,11 @@
import { FileText } from '@vicons/tabler';
import { defineTool } from '../tool';
import { translate } from '@/plugins/i18n.plugin';
import { translate as t } from '@/plugins/i18n.plugin';
export const tool = defineTool({
name: translate('tools.common-regex-memo.title'),
name: t('tools.common-regex-memo.title'),
path: '/common-regex-memo',
description: translate('tools.common-regex-memo.description'),
description: t('tools.common-regex-memo.description'),
keywords: ['common', 'regex', 'memo', 'cheatsheet'],
component: () => import('./common-regex-memo.vue'),
icon: FileText,
+11 -7
View File
@@ -1,6 +1,10 @@
<script lang="ts" setup>
import { useI18n } from 'vue-i18n';
import { useQueryParam } from '@/composable/queryParams';
const { t } = useI18n();
const cookieHeader = useQueryParam({ name: 'cookies', defaultValue: '' });
const parsedCookies = computed(() => {
@@ -12,17 +16,17 @@ const parsedCookies = computed(() => {
</script>
<template>
<n-card title="Cookie Parser">
<n-card :title="t('tools.cookies-parser.texts.title-cookie-parser')">
<n-space vertical>
<n-input v-model:value="cookieHeader" placeholder="Enter cookie header" type="text" />
<n-input v-model:value="cookieHeader" :placeholder="t('tools.cookies-parser.texts.placeholder-enter-cookie-header')" type="text" />
</n-space>
<n-p>
Tip: Navigate to a website to test, open F12 Console and run <n-tag :bordered="false">
<code>window.copy(document.cookie)</code>
</n-tag>. This will copy the cookie string to your clipboard. Note: This will only copy cookies available to javascript (HTTP only and secure cookies will be omitted).
{{ t('tools.cookies-parser.texts.tag-tip-navigate-to-a-website-to-test-open-f12-console-and-run') }}<n-tag :bordered="false">
<code>{{ t('tools.cookies-parser.texts.tag-window-copy-document-cookie') }}</code>
</n-tag>{{ t('tools.cookies-parser.texts.tag-this-will-copy-the-cookie-string-to-your-clipboard-note-this-will-only-copy-cookies-available-to-javascript-http-only-and-secure-cookies-will-be-omitted') }}
</n-p>
<n-table v-if="parsedCookies.length">
<thead><tr><th>Name</th><th>Value</th></tr></thead>
<thead><tr><th>{{ t('tools.cookies-parser.texts.tag-name') }}</th><th>{{ t('tools.cookies-parser.texts.tag-value') }}</th></tr></thead>
<tbody>
<tr v-for="cookie in parsedCookies" :key="cookie.name">
<td>
@@ -35,7 +39,7 @@ const parsedCookies = computed(() => {
</tbody>
</n-table>
<n-alert v-else type="warning">
No cookies found
{{ t('tools.cookies-parser.texts.tag-no-cookies-found') }}
</n-alert>
</n-card>
</template>
+3 -3
View File
@@ -1,11 +1,11 @@
import { Cookie } from '@vicons/tabler';
import { defineTool } from '../tool';
import { translate } from '@/plugins/i18n.plugin';
import { translate as t } from '@/plugins/i18n.plugin';
export const tool = defineTool({
name: translate('tools.cookies-parser.title'),
name: t('tools.cookies-parser.title'),
path: '/cookies-parser',
description: translate('tools.cookies-parser.description'),
description: t('tools.cookies-parser.description'),
keywords: ['cookies', 'parser'],
component: () => import('./cookies-parser.vue'),
icon: Cookie,
+15 -12
View File
@@ -1,8 +1,11 @@
<script setup lang="ts">
import { useI18n } from 'vue-i18n';
import { Countdown } from 'vue3-flip-countdown';
import moment from 'moment';
import { useQueryParam } from '@/composable/queryParams';
const { t } = useI18n();
interface CountDown {
d: number
h: number
@@ -96,26 +99,26 @@ const isEnded = computed(() => status.value === 'ended');
<template>
<div max-w-600px>
<c-card :disabled="status !== 'stopped'" title="Countdown time" mb-4>
<c-card :disabled="status !== 'stopped'" :title="t('tools.countdown.texts.title-countdown-time')" mb-4>
<div mb-4 flex justify-center gap-2>
<n-input-number v-model:value="days" :min="0">
<template #suffix>
days
{{ t('tools.countdown.texts.tag-days') }}
</template>
</n-input-number>
<n-input-number v-model:value="hours" :min="0">
<template #suffix>
hours
{{ t('tools.countdown.texts.tag-hours') }}
</template>
</n-input-number>
<n-input-number v-model:value="minutes" :min="0">
<template #suffix>
minutes
{{ t('tools.countdown.texts.tag-minutes') }}
</template>
</n-input-number>
<n-input-number v-model:value="seconds" :min="0">
<template #suffix>
seconds
{{ t('tools.countdown.texts.tag-seconds') }}
</template>
</n-input-number>
</div>
@@ -124,7 +127,7 @@ const isEnded = computed(() => status.value === 'ended');
<c-button
@click="start"
>
Start
{{ t('tools.countdown.texts.tag-start') }}
</c-button>
</div>
</c-card>
@@ -138,7 +141,7 @@ const isEnded = computed(() => status.value === 'ended');
:disabled="status === 'stopped'"
@click="toggleFullScreen"
>
Toggle Fullscreen
{{ t('tools.countdown.texts.tag-toggle-fullscreen') }}
</c-button>
</div>
</div>
@@ -147,16 +150,16 @@ const isEnded = computed(() => status.value === 'ended');
<n-modal v-model:show="isEnded" mask-closable="false">
<n-card
style="width: 600px"
title="Timer finished"
:title="t('tools.countdown.texts.title-timer-finished')"
:bordered="false"
size="huge"
role="dialog"
aria-modal="true"
>
<p>Timer ellapsed!</p>
<p>{{ t('tools.countdown.texts.tag-timer-ellapsed') }}</p>
<template #footer>
<n-button @click="stop()">
OK
{{ t('tools.countdown.texts.tag-ok') }}
</n-button>
</template>
</n-card>
@@ -167,7 +170,7 @@ const isEnded = computed(() => status.value === 'ended');
:disabled="status === 'stopped'"
@click="stop"
>
Stop
{{ t('tools.countdown.texts.tag-stop') }}
</c-button>
</div>
@@ -175,7 +178,7 @@ const isEnded = computed(() => status.value === 'ended');
Alarm at: {{ deadlineDate }}
</n-p>
<c-card v-if="history" title="History">
<c-card v-if="history" :title="t('tools.countdown.texts.title-history')">
<div flex justify-center gap-1>
<template v-for="(entry, index) in history" :key="index">
{{ index > 0 ? ' / ' : '' }}
+3 -3
View File
@@ -1,11 +1,11 @@
import { Alarm } from '@vicons/tabler';
import { defineTool } from '../tool';
import { translate } from '@/plugins/i18n.plugin';
import { translate as t } from '@/plugins/i18n.plugin';
export const tool = defineTool({
name: translate('tools.countdown.title'),
name: t('tools.countdown.title'),
path: '/countdown',
description: translate('tools.countdown.description'),
description: t('tools.countdown.description'),
keywords: ['countdown'],
component: () => import('./countdown.vue'),
icon: Alarm,
+13 -10
View File
@@ -1,4 +1,5 @@
<script setup lang="ts">
import { useI18n } from 'vue-i18n';
import type { lib } from 'crypto-js';
import { enc } from 'crypto-js';
@@ -8,6 +9,8 @@ import { convertHexToBin } from '../hash-text/hash-text.service';
import { useQueryParamOrStorage } from '@/composable/queryParams';
import { withDefaultOnError } from '@/utils/defaults';
const { t } = useI18n();
const status = ref<'idle' | 'done' | 'error' | 'processing'>('idle');
const text = ref('');
const file = ref<File | null>(null);
@@ -104,17 +107,17 @@ watch(text,
<div>
<c-card>
<c-file-upload
title="Drag and drop a file here, or click to select a file"
:title="t('tools.crc-calculator.texts.title-drag-and-drop-a-file-here-or-click-to-select-a-file')"
@file-upload="onUpload"
/>
<p>OR</p>
<p>{{ t('tools.crc-calculator.texts.tag-or') }}</p>
<c-input-text
v-model:value="text"
multiline raw-text
placeholder="Paste string to CRC..." rows="3"
autosize autofocus label="Your text to CRC:"
:placeholder="t('tools.crc-calculator.texts.placeholder-paste-string-to-crc')" rows="3"
autosize autofocus :label="t('tools.crc-calculator.texts.label-your-text-to-crc')"
/>
<n-divider />
@@ -122,22 +125,22 @@ watch(text,
<c-select
v-model:value="encoding"
mb-4
label="Digest encoding"
:label="t('tools.crc-calculator.texts.label-digest-encoding')"
:options="[
{
label: 'Binary (base 2)',
label: t('tools.crc-calculator.texts.label-binary-base-2'),
value: 'Bin',
},
{
label: 'Hexadecimal (base 16)',
label: t('tools.crc-calculator.texts.label-hexadecimal-base-16'),
value: 'Hex',
},
{
label: 'Base64 (base 64)',
label: t('tools.crc-calculator.texts.label-base64-base-64'),
value: 'Base64',
},
{
label: 'Base64url (base 64 with url safe chars)',
label: t('tools.crc-calculator.texts.label-base64url-base-64-with-url-safe-chars'),
value: 'Base64url',
},
]"
@@ -146,7 +149,7 @@ watch(text,
<div mt-3 flex justify-center>
<c-alert v-if="status === 'error'" type="error">
An error occured hashing file.
{{ t('tools.crc-calculator.texts.tag-an-error-occured-hashing-file') }}
</c-alert>
<n-spin
v-if="status === 'processing'"
+3 -3
View File
@@ -1,11 +1,11 @@
import { EyeOff } from '@vicons/tabler';
import { defineTool } from '../tool';
import { translate } from '@/plugins/i18n.plugin';
import { translate as t } from '@/plugins/i18n.plugin';
export const tool = defineTool({
name: translate('tools.crc-calculator.title'),
name: t('tools.crc-calculator.title'),
path: '/crc-calculator',
description: translate('tools.crc-calculator.description'),
description: t('tools.crc-calculator.description'),
keywords: ['crc', 'checksum', 'crc1',
'crc8',
'crc8 1-wire',
+19 -16
View File
@@ -1,9 +1,12 @@
<script setup lang="ts">
import { useI18n } from 'vue-i18n';
import { Countdown } from 'vue3-flip-countdown';
import { parseExpression } from 'cron-parser';
import moment from 'moment';
import { useQueryParam } from '@/composable/queryParams';
const { t } = useI18n();
const allDays = '0,1,2,3,4,5,6';
const alarmAt = useQueryParam({ name: 'at', defaultValue: '17:30:00' });
const alarmDays = useQueryParam({ name: 'days', defaultValue: allDays });
@@ -91,22 +94,22 @@ const isEnded = computed(() => status.value === 'ended');
<template>
<div max-w-600px>
<c-card :disabled="status !== 'stopped'" title="Alarm" mb-4>
<c-card :disabled="status !== 'stopped'" :title="t('tools.cron-alarm.texts.title-alarm')" mb-4>
<div mb-1 flex justify-center>
<n-form-item label="Alarm at:" label-placement="left">
<n-form-item :label="t('tools.cron-alarm.texts.label-alarm-at')" label-placement="left">
<n-time-picker v-model:formatted-value="alarmAt" />
</n-form-item>
</div>
<div flex justify-center>
<n-checkbox-group v-model:value="daysArray">
<n-space item-style="display: flex;">
<n-checkbox value="1" label="Monday" />
<n-checkbox value="2" label="Tuesday" />
<n-checkbox value="3" label="Wednesday" />
<n-checkbox value="4" label="Thursday" />
<n-checkbox value="5" label="Friday" />
<n-checkbox value="6" label="Saturday" />
<n-checkbox value="0" label="Sunday" />
<n-checkbox value="1" :label="t('tools.cron-alarm.texts.label-monday')" />
<n-checkbox value="2" :label="t('tools.cron-alarm.texts.label-tuesday')" />
<n-checkbox value="3" :label="t('tools.cron-alarm.texts.label-wednesday')" />
<n-checkbox value="4" :label="t('tools.cron-alarm.texts.label-thursday')" />
<n-checkbox value="5" :label="t('tools.cron-alarm.texts.label-friday')" />
<n-checkbox value="6" :label="t('tools.cron-alarm.texts.label-saturday')" />
<n-checkbox value="0" :label="t('tools.cron-alarm.texts.label-sunday')" />
</n-space>
</n-checkbox-group>
</div>
@@ -115,7 +118,7 @@ const isEnded = computed(() => status.value === 'ended');
<c-button
@click="start"
>
Start
{{ t('tools.cron-alarm.texts.tag-start') }}
</c-button>
</div>
</c-card>
@@ -128,7 +131,7 @@ const isEnded = computed(() => status.value === 'ended');
:disabled="status === 'stopped'"
@click="toggleFullScreen"
>
Toggle Fullscreen
{{ t('tools.cron-alarm.texts.tag-toggle-fullscreen') }}
</c-button>
</div>
</div>
@@ -139,7 +142,7 @@ const isEnded = computed(() => status.value === 'ended');
:disabled="status === 'stopped'"
@click="stop"
>
Stop
{{ t('tools.cron-alarm.texts.tag-stop') }}
</c-button>
</div>
@@ -150,22 +153,22 @@ const isEnded = computed(() => status.value === 'ended');
<n-modal v-model:show="isEnded" mask-closable="false">
<n-card
style="width: 600px"
title="Timer finished"
:title="t('tools.cron-alarm.texts.title-timer-finished')"
:bordered="false"
size="huge"
role="dialog"
aria-modal="true"
>
<p>Timer elapsed!</p>
<p>{{ t('tools.cron-alarm.texts.tag-timer-elapsed') }}</p>
<template #footer>
<n-button @click="stop()">
OK
{{ t('tools.cron-alarm.texts.tag-ok') }}
</n-button>
</template>
</n-card>
</n-modal>
<c-card v-if="history" title="History">
<c-card v-if="history" :title="t('tools.cron-alarm.texts.title-history')">
<div flex justify-center gap-1>
<template v-for="(entry, index) in history" :key="index">
{{ index > 0 ? ' / ' : '' }}
Loaded 100 of 704 files, more files were not shown because too many files have changed in this diff. Show more