Upgrade toolchain: Vite 8, Vue 3.5, Vitest 4, TypeScript 6, pnpm 11, Node 24; replace ESLint/Prettier with oxlint/oxfmt (#418)

* chore: upgrade toolchain to Vite 8, Vue 3.5, Vitest 4, TypeScript 6 and pnpm 11; adopt oxlint/oxfmt

- vite 4 -> 8.1.3 (rolldown-based: build.rollupOptions -> rolldownOptions,
  drop optimizeDeps.esbuildOptions), @vitejs/plugin-vue 4 -> 6, plugin-vue-jsx 3 -> 5
- vue 3.3 -> 3.5.39, vue-tsc 1.8 -> 3.3.6, vitest 0.34 -> 4.1.9, jsdom 22 -> 29
- typescript 5.2 -> 6.0.3 with moduleResolution=bundler (baseUrl/node10 are
  hard errors in TS 6, removed in TS 7); TS 7 RC not adoptable: its native
  tsc lacks the JS compiler API vue-tsc needs (vuejs/language-tools#5381)
- unocss 0.57 -> 66 (presetUno -> presetWind3), unplugin-* to current majors
  (unplugin-vue-components dtsTsx disabled: emits invalid declarations for
  dotted component names)
- @vueuse/head 1.0.0 -> 1.3.1 (1.0.0 silently stopped applying page titles
  under Vue 3.5)
- replace ESLint (@antfu config) + Prettier with oxlint + oxfmt; configs
  mirror the previous style rules. Existing files are intentionally NOT
  mass-reformatted (oxfmt has no brace-style/operator-position options to
  match the old @antfu style) — only files with real changes are formatted
- pnpm 9 -> 11.10.0: settings move to pnpm-workspace.yaml, fresh lockfile
  passing supply-chain policies, explicit allowBuilds decisions,
  blockExoticSubdeps off (xlsx CDN override patches vulnerable npm 0.18.5)
- isolated-vm (17 MB) and onnxruntime-node (208 MB) stubbed via overrides:
  native-only transitives already aliased to an empty module for the bundle
- elliptic overridden to npm ^6.6.1 (github fork tarball of
  webcrypto-liner-shim unreachable from the build environment)
- CI: node 22 -> 24, all actions pinned to latest patch releases, automatic
  Vercel workflows disabled (fork deploys via Vercel Git integration),
  vercel.json: git.deploymentEnabled removed, buildCommand skips no-op vue-tsc
- Dockerfile: node:24-alpine, pnpm@11, ship pnpm-workspace.yaml and stubs

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01M6deEDJXFzgDzPiYPAcsv1

* fix: resolve type, lint and runtime issues from the toolchain upgrade

vue-tsc 3 checks templates far more strictly than 1.8 and TS 5.7+ made
Uint8Array generic over its backing buffer. Widen shared component props
(InputCopyable, c-table, c-input-text, UnitsConverter), convert values at
call sites, fix invalid local .d.ts declarations, and repair issues the
new tooling exposed:

- WireGuard generator: pre-shared-keys checkbox used v-model:value which
  never binds on a standalone n-checkbox (now v-model:checked)
- mask-closable="false" string attrs became real boolean bindings in
  countdown/cron-alarm/time-alarm
- v-model casts (x as any) fail to compile under plugin-vue 6 + rolldown;
  replaced with :value/@update:value split bindings
- invalid '::ffff::' IPv6 literal in ipv6registry.json, exposed by stricter
  parsing in cidr-tools 11.3 (IPv4-mapped range never matched)
- fanger pinned to 0.3.1 (0.3.2 published without dist/)
- countries-and-timezones namespace imports, Vitest 4 snapshot format,
  invalid ul-inside-p HTML in dead-pixel, test assertion outside it() block

vue-tsc clean; oxlint clean; vitest 665/665; vite build + PWA OK;
Playwright e2e 100/100; all 457 tool routes render without errors

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01M6deEDJXFzgDzPiYPAcsv1

* chore: drop whole-tree oxfmt from precommit instructions

The tree deliberately keeps its existing @antfu-era formatting; running
'pnpm fmt' (oxfmt over all of src) would reformat ~800 untouched files.
Format only the files you change, or run 'pnpm fmt' in a dedicated PR.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01M6deEDJXFzgDzPiYPAcsv1

* fix: escape backslashes before dots in parquet column keys

CodeQL flagged incomplete string escaping (js/incomplete-sanitization):
escaping '.' to '\.' without first escaping existing backslashes makes
column names containing backslashes ambiguous in naive-ui's nested-key
syntax. Escape backslashes first.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01M6deEDJXFzgDzPiYPAcsv1

* test: allow 30s for initial mermaid render in e2e

mermaid is a large lazy-loaded chunk; webkit on cold CI runners exceeds
Playwright's default 5s expect timeout even across retries.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01M6deEDJXFzgDzPiYPAcsv1

* refactor: replace 'as any' input type casts with proper typings

Copilot review on the upstream PR flagged the casts. c-input-text
renders any non-password type as a text input, so widen its type union
to include 'url' instead of casting; for naive-ui's NInput use the
documented input-props to set the native input's type=number.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01M6deEDJXFzgDzPiYPAcsv1
(cherry picked from commit 906820336b271aa6d96ecb11efa03219bf869475)

* fix: reconcile lockfile with upstream sync; repair date-picker typing in Docker Label Generator

- fold upstream's new CodeMirror/picomatch dependencies into the pnpm 11
  lockfile; add @lezer/highlight to optimizeDeps (kept from upstream)
- dockerfile-label-generator: n-date-picker emits a number timestamp,
  not a Date — calling toISOString() on it would throw at runtime the
  moment a date was picked. Type as number and convert via new Date()
- drop stray tsconfig.vite-config.tsbuildinfo build artifact; ignore
  *.tsbuildinfo

vue-tsc clean; oxlint clean; vitest 665/665; vite build OK

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01M6deEDJXFzgDzPiYPAcsv1

* chore: keep upstream Vercel CLI deployment setup

The fork-specific Vercel changes (Git-integration deploys, disabled CLI
workflows, build:vercel command) are excluded from the upstream
contribution; upstream deploys via its own Vercel CLI workflows.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01M6deEDJXFzgDzPiYPAcsv1
(cherry picked from commit ed182ec55648358556343e60e1667129acdbb966)

* fix: escape backslashes in Docker label values; raise global e2e expect timeout

- dockerfile-label-generator escaped quotes without escaping existing
  backslashes first (CodeQL js/incomplete-sanitization, same class as
  the parquets-reader fix): a value ending in a backslash would break
  the generated LABEL quoting
- playwright: 15s global expect timeout — first paint of heavy lazy
  chunks exceeds the 5s default on slow CI browsers (webkit), which
  intermittently failed title assertions across retries

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01M6deEDJXFzgDzPiYPAcsv1
(cherry picked from commit 5b3822e10113a49bc519661a5b01ad62660d56a9)

* Update .gitignore to include specific file types

* Add stats.html to .gitignore

* Delete tsconfig.vite-config.tsbuildinfo

* Delete stats.html

---------

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: sharevb <sharevb@gmail.com>
This commit is contained in:
authored and GitHub committed 2026-07-06 18:29:27 +02:00
1 parent 3c76776e2c
commit 63f011b071
130 files changed
+10665 -11797

No files matched your search

-294
View File
@@ -1,294 +0,0 @@
{
"globals": {
"Component": true,
"ComponentPublicInstance": true,
"ComputedRef": true,
"EffectScope": true,
"InjectionKey": true,
"PropType": true,
"Ref": true,
"VNode": true,
"asyncComputed": true,
"autoResetRef": true,
"computed": true,
"computedAsync": true,
"computedEager": true,
"computedInject": true,
"computedWithControl": true,
"controlledComputed": true,
"controlledRef": true,
"createApp": true,
"createEventHook": true,
"createGlobalState": true,
"createInjectionState": true,
"createReactiveFn": true,
"createReusableTemplate": true,
"createSharedComposable": true,
"createTemplatePromise": true,
"createUnrefFn": true,
"customRef": true,
"debouncedRef": true,
"debouncedWatch": true,
"defineAsyncComponent": true,
"defineComponent": true,
"eagerComputed": true,
"effectScope": true,
"extendRef": true,
"getCurrentInstance": true,
"getCurrentScope": true,
"h": true,
"ignorableWatch": true,
"inject": true,
"injectLocal": true,
"isDefined": true,
"isProxy": true,
"isReactive": true,
"isReadonly": true,
"isRef": true,
"makeDestructurable": true,
"markRaw": true,
"nextTick": true,
"onActivated": true,
"onBeforeMount": true,
"onBeforeRouteLeave": true,
"onBeforeRouteUpdate": true,
"onBeforeUnmount": true,
"onBeforeUpdate": true,
"onClickOutside": true,
"onDeactivated": true,
"onErrorCaptured": true,
"onKeyStroke": true,
"onLongPress": true,
"onMounted": true,
"onRenderTracked": true,
"onRenderTriggered": true,
"onScopeDispose": true,
"onServerPrefetch": true,
"onStartTyping": true,
"onUnmounted": true,
"onUpdated": true,
"pausableWatch": true,
"provide": true,
"provideLocal": true,
"reactify": true,
"reactifyObject": true,
"reactive": true,
"reactiveComputed": true,
"reactiveOmit": true,
"reactivePick": true,
"readonly": true,
"ref": true,
"refAutoReset": true,
"refDebounced": true,
"refDefault": true,
"refThrottled": true,
"refWithControl": true,
"resolveComponent": true,
"resolveRef": true,
"resolveUnref": true,
"shallowReactive": true,
"shallowReadonly": true,
"shallowRef": true,
"syncRef": true,
"syncRefs": true,
"templateRef": true,
"throttledRef": true,
"throttledWatch": true,
"toRaw": true,
"toReactive": true,
"toRef": true,
"toRefs": true,
"toValue": true,
"triggerRef": true,
"tryOnBeforeMount": true,
"tryOnBeforeUnmount": true,
"tryOnMounted": true,
"tryOnScopeDispose": true,
"tryOnUnmounted": true,
"unref": true,
"unrefElement": true,
"until": true,
"useActiveElement": true,
"useAnimate": true,
"useArrayDifference": true,
"useArrayEvery": true,
"useArrayFilter": true,
"useArrayFind": true,
"useArrayFindIndex": true,
"useArrayFindLast": true,
"useArrayIncludes": true,
"useArrayJoin": true,
"useArrayMap": true,
"useArrayReduce": true,
"useArraySome": true,
"useArrayUnique": true,
"useAsyncQueue": true,
"useAsyncState": true,
"useAttrs": true,
"useBase64": true,
"useBattery": true,
"useBluetooth": true,
"useBreakpoints": true,
"useBroadcastChannel": true,
"useBrowserLocation": true,
"useCached": true,
"useClipboard": true,
"useClipboardItems": true,
"useCloned": true,
"useColorMode": true,
"useConfirmDialog": true,
"useCounter": true,
"useCssModule": true,
"useCssVar": true,
"useCssVars": true,
"useCurrentElement": true,
"useCycleList": true,
"useDark": true,
"useDateFormat": true,
"useDebounce": true,
"useDebounceFn": true,
"useDebouncedRefHistory": true,
"useDeviceMotion": true,
"useDeviceOrientation": true,
"useDevicePixelRatio": true,
"useDevicesList": true,
"useDialog": true,
"useDisplayMedia": true,
"useDocumentVisibility": true,
"useDraggable": true,
"useDropZone": true,
"useElementBounding": true,
"useElementByPoint": true,
"useElementHover": true,
"useElementSize": true,
"useElementVisibility": true,
"useEventBus": true,
"useEventListener": true,
"useEventSource": true,
"useEyeDropper": true,
"useFavicon": true,
"useFetch": true,
"useFileDialog": true,
"useFileSystemAccess": true,
"useFocus": true,
"useFocusWithin": true,
"useFps": true,
"useFullscreen": true,
"useGamepad": true,
"useGeolocation": true,
"useI18n": true,
"useIdle": true,
"useImage": true,
"useInfiniteScroll": true,
"useIntersectionObserver": true,
"useInterval": true,
"useIntervalFn": true,
"useKeyModifier": true,
"useLastChanged": true,
"useLink": true,
"useLoadingBar": true,
"useLocalStorage": true,
"useMagicKeys": true,
"useManualRefHistory": true,
"useMediaControls": true,
"useMediaQuery": true,
"useMemoize": true,
"useMemory": true,
"useMessage": true,
"useMounted": true,
"useMouse": true,
"useMouseInElement": true,
"useMousePressed": true,
"useMutationObserver": true,
"useNavigatorLanguage": true,
"useNetwork": true,
"useNotification": true,
"useNow": true,
"useObjectUrl": true,
"useOffsetPagination": true,
"useOnline": true,
"usePageLeave": true,
"useParallax": true,
"useParentElement": true,
"usePerformanceObserver": true,
"usePermission": true,
"usePointer": true,
"usePointerLock": true,
"usePointerSwipe": true,
"usePreferredColorScheme": true,
"usePreferredContrast": true,
"usePreferredDark": true,
"usePreferredLanguages": true,
"usePreferredReducedMotion": true,
"usePrevious": true,
"useRafFn": true,
"useRefHistory": true,
"useResizeObserver": true,
"useRoute": true,
"useRouter": true,
"useScreenOrientation": true,
"useScreenSafeArea": true,
"useScriptTag": true,
"useScroll": true,
"useScrollLock": true,
"useSessionStorage": true,
"useShare": true,
"useSlots": true,
"useSorted": true,
"useSpeechRecognition": true,
"useSpeechSynthesis": true,
"useStepper": true,
"useStorage": true,
"useStorageAsync": true,
"useStyleTag": true,
"useSupported": true,
"useSwipe": true,
"useTemplateRefsList": true,
"useTextDirection": true,
"useTextSelection": true,
"useTextareaAutosize": true,
"useThrottle": true,
"useThrottleFn": true,
"useThrottledRefHistory": true,
"useTimeAgo": true,
"useTimeout": true,
"useTimeoutFn": true,
"useTimeoutPoll": true,
"useTimestamp": true,
"useTitle": true,
"useToNumber": true,
"useToString": true,
"useToggle": true,
"useTransition": true,
"useUrlSearchParams": true,
"useUserMedia": true,
"useVModel": true,
"useVModels": true,
"useVibrate": true,
"useVirtualList": true,
"useWakeLock": true,
"useWebNotification": true,
"useWebSocket": true,
"useWebWorker": true,
"useWebWorkerFn": true,
"useWindowFocus": true,
"useWindowScroll": true,
"useWindowSize": true,
"watch": true,
"watchArray": true,
"watchAtMost": true,
"watchDebounced": true,
"watchDeep": true,
"watchEffect": true,
"watchIgnorable": true,
"watchImmediate": true,
"watchOnce": true,
"watchPausable": true,
"watchPostEffect": true,
"watchSyncEffect": true,
"watchThrottled": true,
"watchTriggerable": true,
"watchWithFilter": true,
"whenever": true
}
}
-24
View File
@@ -1,24 +0,0 @@
/**
* @type {import('eslint').Linter.Config}
*/
module.exports = {
root: true,
extends: ['@antfu', './.eslintrc-auto-import.json', '@unocss'],
ignorePatterns: ['src/libs/*'],
rules: {
'curly': ['error', 'all'],
'@typescript-eslint/semi': ['error', 'always'],
'@typescript-eslint/no-use-before-define': ['error', { allowNamedExports: true, functions: false }],
'vue/no-empty-component-block': ['error'],
'import/order': 'off',
'no-restricted-imports': ['error', {
paths: [{
name: '@vueuse/core',
importNames: ['useClipboard'],
message: 'Please use local useCopy from src/composable/copy.ts instead of useClipboard.',
}],
}],
},
};
@@ -22,5 +22,5 @@
- [ ] Submit the PR against the `chore/all-my-stuffs` branch.
- [ ] Check that there isn't already a PR that solves the problem the same way to avoid creating a duplicate.
- [ ] Provide a description, in PLAIN ENGLISH ONLY, in this PR that addresses **what** the PR is solving, or reference the issue that it solves (e.g. `fixes #123`).
- [ ] Run `pnpm install --ignore-scripts && pnpm lint --fix && pnpm typecheck` to ensure pnpm lock, eslint and typecheck are ok
- [ ] Run `pnpm install --ignore-scripts && pnpm lint:fix && pnpm typecheck` to ensure pnpm lock, oxlint and typecheck are ok
- [ ] Ideally, include relevant tests that fail without this PR but pass with it.
+3 -3
View File
@@ -11,16 +11,16 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@v7.0.0
- run: |
echo "Before: corepack version => $(corepack --version || echo 'not installed')"
npm install -g corepack@latest
echo "After : corepack version => $(corepack --version)"
corepack enable
pnpm --version
- uses: actions/setup-node@v6
- uses: actions/setup-node@v6.4.0
with:
node-version: 22
node-version: 24
cache: 'pnpm'
- name: Install dependencies
@@ -37,11 +37,11 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v6
uses: actions/checkout@v7.0.0
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v4
uses: github/codeql-action/init@v4.36.3
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -55,7 +55,7 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v4
uses: github/codeql-action/autobuild@v4.36.3
# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
@@ -69,4 +69,4 @@ jobs:
# make release
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v4
uses: github/codeql-action/analyze@v4.36.3
@@ -15,7 +15,7 @@ jobs:
outputs:
should_run: ${{ steps.should_run.outputs.should_run }}
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@v7.0.0
- name: print latest_commit
run: echo ${{ github.sha }}
@@ -31,16 +31,16 @@ jobs:
if: ${{ needs.check_date.outputs.should_run != 'false' }}
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@v7.0.0
- run: |
echo "Before: corepack version => $(corepack --version || echo 'not installed')"
npm install -g corepack@latest
echo "After : corepack version => $(corepack --version)"
corepack enable
pnpm --version
- uses: actions/setup-node@v6
- uses: actions/setup-node@v6.4.0
with:
node-version: 22
node-version: 24
cache: 'pnpm'
- name: Install dependencies
@@ -63,7 +63,7 @@ jobs:
steps:
- name: Docker meta
id: meta
uses: docker/metadata-action@v6
uses: docker/metadata-action@v6.2.0
with:
images: sharevb/it-tools
labels: |
@@ -71,29 +71,29 @@ jobs:
# Checkout the repository
- name: Checkout repository
uses: actions/checkout@v6
uses: actions/checkout@v7.0.0
- name: Login to Docker Hub
uses: docker/login-action@v4
uses: docker/login-action@v4.4.0
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v4
uses: docker/login-action@v4.4.0
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v4
uses: docker/setup-qemu-action@v4.2.0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
uses: docker/setup-buildx-action@v4.2.0
- name: Build and push
uses: docker/build-push-action@v7
uses: docker/build-push-action@v7.3.0
with:
context: .
file: ./Dockerfile
@@ -116,7 +116,7 @@ jobs:
run: echo "RELEASE_VERSION=nightly" >> $GITHUB_ENV
- name: Checkout
uses: actions/checkout@v6
uses: actions/checkout@v7.0.0
- run: |
echo "Before: corepack version => $(corepack --version || echo 'not installed')"
@@ -125,9 +125,9 @@ jobs:
corepack enable
pnpm --version
- uses: actions/setup-node@v6
- uses: actions/setup-node@v6.4.0
with:
node-version: 22
node-version: 24
cache: 'pnpm'
- name: Install dependencies
@@ -148,7 +148,7 @@ jobs:
echo "$EOF" >> $GITHUB_OUTPUT
- name: Create Release
uses: softprops/action-gh-release@v3
uses: softprops/action-gh-release@v3.0.1
with:
token: ${{ secrets.GITHUB_TOKEN }}
files: it-tools-${{ env.RELEASE_VERSION }}.zip
@@ -13,16 +13,16 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@v7.0.0
- run: |
echo "Before: corepack version => $(corepack --version || echo 'not installed')"
npm install -g corepack@latest
echo "After : corepack version => $(corepack --version)"
corepack enable
pnpm --version
- uses: actions/setup-node@v6
- uses: actions/setup-node@v6.4.0
with:
node-version: 22
node-version: 24
cache: 'pnpm'
- name: Install dependencies
@@ -44,7 +44,7 @@ jobs:
steps:
- name: Docker meta
id: meta
uses: docker/metadata-action@v6
uses: docker/metadata-action@v6.2.0
with:
images: sharevb/it-tools
labels: |
@@ -52,29 +52,29 @@ jobs:
# Checkout the repository
- name: Checkout repository
uses: actions/checkout@v6
uses: actions/checkout@v7.0.0
- name: Login to Docker Hub
uses: docker/login-action@v4
uses: docker/login-action@v4.4.0
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v4
uses: docker/login-action@v4.4.0
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v4
uses: docker/setup-qemu-action@v4.2.0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
uses: docker/setup-buildx-action@v4.2.0
- name: Build and push (BASE_URL)
uses: docker/build-push-action@v7
uses: docker/build-push-action@v7.3.0
with:
context: .
file: ./Dockerfile
@@ -13,16 +13,16 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@v7.0.0
- run: |
echo "Before: corepack version => $(corepack --version || echo 'not installed')"
npm install -g corepack@latest
echo "After : corepack version => $(corepack --version)"
corepack enable
pnpm --version
- uses: actions/setup-node@v6
- uses: actions/setup-node@v6.4.0
with:
node-version: 22
node-version: 24
cache: 'pnpm'
- name: Install dependencies
@@ -47,7 +47,7 @@ jobs:
steps:
- name: Docker meta
id: meta
uses: docker/metadata-action@v6
uses: docker/metadata-action@v6.2.0
with:
images: sharevb/it-tools
labels: |
@@ -55,29 +55,29 @@ jobs:
# Checkout the repository
- name: Checkout repository
uses: actions/checkout@v6
uses: actions/checkout@v7.0.0
- name: Login to Docker Hub
uses: docker/login-action@v4
uses: docker/login-action@v4.4.0
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v4
uses: docker/login-action@v4.4.0
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v4
uses: docker/setup-qemu-action@v4.2.0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
uses: docker/setup-buildx-action@v4.2.0
- name: Build and push
uses: docker/build-push-action@v7
uses: docker/build-push-action@v7.3.0
with:
context: .
file: ./Dockerfile
+4 -4
View File
@@ -12,7 +12,7 @@ jobs:
matrix:
shard: [1/3, 2/3, 3/3]
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@v7.0.0
- run: |
echo "Before: corepack version => $(corepack --version || echo 'not installed')"
@@ -21,9 +21,9 @@ jobs:
corepack enable
pnpm --version
- uses: actions/setup-node@v6
- uses: actions/setup-node@v6.4.0
with:
node-version: 22
node-version: 24
cache: 'pnpm'
- name: Get Playwright version
@@ -37,7 +37,7 @@ jobs:
run: pnpm build
- name: Restore Playwright browsers from cache
uses: actions/cache@v5
uses: actions/cache@v6.1.0
with:
path: ~/.cache/ms-playwright
key: ${{ runner.os }}-playwright-${{ steps.playwright-version.outputs.PLAYWRIGHT_VERSION }}-${{ hashFiles('**/playwright.config.ts') }}
@@ -32,18 +32,17 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
uses: actions/checkout@v7.0.0
- name: Install Node.js
uses: actions/setup-node@v6
uses: actions/setup-node@v6.4.0
with:
node-version: 22
node-version: 24
- uses: pnpm/action-setup@v2
- uses: pnpm/action-setup@v6.0.9
name: Install pnpm
id: pnpm-install
with:
version: 9
run_install: true
- name: Build
@@ -51,13 +50,13 @@ jobs:
BASE_URL="/it-tools/" pnpm build
cp dist/index.html dist/404.html
- name: Setup Pages
uses: actions/configure-pages@v6
uses: actions/configure-pages@v6.0.0
- name: Upload artifact
uses: actions/upload-pages-artifact@v5
uses: actions/upload-pages-artifact@v5.0.0
with:
path: './dist'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v5
uses: actions/deploy-pages@v5.0.0
+12 -12
View File
@@ -14,7 +14,7 @@ jobs:
steps:
- name: Docker meta
id: meta
uses: docker/metadata-action@v6
uses: docker/metadata-action@v6.2.0
with:
images: sharevb/it-tools
@@ -22,29 +22,29 @@ jobs:
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV
- name: Checkout
uses: actions/checkout@v6
uses: actions/checkout@v7.0.0
- name: Login to Docker Hub
uses: docker/login-action@v4
uses: docker/login-action@v4.4.0
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v4
uses: docker/login-action@v4.4.0
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v4
uses: docker/setup-qemu-action@v4.2.0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
uses: docker/setup-buildx-action@v4.2.0
- name: Build and push (BASE_URL)
uses: docker/build-push-action@v7
uses: docker/build-push-action@v7.3.0
with:
context: .
file: ./Dockerfile
@@ -62,7 +62,7 @@ jobs:
ghcr.io/sharevb/it-tools:${{ env.RELEASE_VERSION}}-baseurl-it-tools
- name: Build and push
uses: docker/build-push-action@v7
uses: docker/build-push-action@v7.3.0
with:
context: .
file: ./Dockerfile
@@ -85,7 +85,7 @@ jobs:
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV
- name: Checkout
uses: actions/checkout@v6
uses: actions/checkout@v7.0.0
- run: |
echo "Before: corepack version => $(corepack --version || echo 'not installed')"
@@ -94,9 +94,9 @@ jobs:
corepack enable
pnpm --version
- uses: actions/setup-node@v6
- uses: actions/setup-node@v6.4.0
with:
node-version: 22
node-version: 24
cache: 'pnpm'
- name: Install dependencies
@@ -117,7 +117,7 @@ jobs:
echo "$EOF" >> $GITHUB_OUTPUT
- name: Create Release
uses: softprops/action-gh-release@v3
uses: softprops/action-gh-release@v3.0.1
with:
token: ${{ secrets.GITHUB_TOKEN }}
files: it-tools-${{ env.RELEASE_VERSION }}.zip
+3 -1
View File
@@ -47,4 +47,6 @@ components.d.ts
!*.code-workspace
# Ignore build or packaged VS Code extensions
*.vsix
*.vsix
*.tsbuildinfo
stats.html
+18
View File
@@ -0,0 +1,18 @@
{
"printWidth": 120,
"tabWidth": 2,
"useTabs": false,
"semi": true,
"singleQuote": true,
"trailingComma": "all",
"arrowParens": "always",
"endOfLine": "lf",
"ignorePatterns": [
"src/libs/**",
"dist/**",
"coverage/**",
"auto-imports.d.ts",
"components.d.ts",
"pnpm-lock.yaml"
]
}
+64
View File
@@ -0,0 +1,64 @@
{
"$schema": "./node_modules/oxlint/configuration_schema.json",
"plugins": ["eslint", "typescript", "oxc", "unicorn", "import", "promise", "vue", "vitest"],
"categories": {
"correctness": "error"
},
"env": {
"browser": true,
"es2026": true
},
"globals": {
"process": "readonly"
},
"ignorePatterns": [
"src/libs/**",
"dist/**",
"coverage/**",
"auto-imports.d.ts",
"components.d.ts"
],
"rules": {
"eslint/curly": ["error", "all"],
"typescript/no-use-before-define": [
"error",
{ "allowNamedExports": true, "functions": false }
],
"eslint/no-restricted-imports": [
"error",
{
"paths": [
{
"name": "@vueuse/core",
"importNames": ["useClipboard"],
"message": "Please use local useCopy from src/composable/copy.ts instead of useClipboard."
}
]
}
],
"no-undef": "off",
"eslint/no-unused-vars": [
"error",
{ "caughtErrors": "none", "varsIgnorePattern": "^_", "argsIgnorePattern": "^_" }
],
"eslint/no-useless-escape": "off",
"import/default": "off",
"vue/no-dupe-keys": "off",
"vitest/valid-expect": "off",
"vitest/expect-expect": "off",
"vitest/require-to-throw-message": "off"
},
"overrides": [
{
"files": ["**/*.test.ts", "**/*.spec.ts", "**/*.e2e.spec.ts"],
"env": { "vitest": true }
},
{
"files": ["**/calendar-converter/calendar-converter.service.ts"],
"rules": {
"eslint/no-unused-vars": "off",
"oxc/erasing-op": "off"
}
}
]
}
-7
View File
@@ -1,7 +0,0 @@
{
"singleQuote": true,
"semi": true,
"tabWidth": 2,
"trailingComma": "all",
"printWidth": 120
}
+1 -1
View File
@@ -1,7 +1,7 @@
{
"recommendations": [
"Vue.volar",
"dbaeumer.vscode-eslint",
"oxc.oxc-vscode",
"lokalise.i18n-ally",
"ms-vscode-remote.remote-wsl"
]
+4 -3
View File
@@ -1,9 +1,10 @@
{
"editor.formatOnSave": false,
"editor.formatOnSave": true,
"editor.defaultFormatter": "oxc.oxc-vscode",
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "always",
"source.formatDocument": "always"
"source.fixAll.oxc": "always"
},
"oxc.fmt.experimental": true,
"i18n-ally.localesPaths": [
"locales",
"src/modules/i18n"
+4 -3
View File
@@ -1,5 +1,5 @@
# build stage
FROM --platform=$BUILDPLATFORM node:lts-alpine AS build-stage
FROM --platform=$BUILDPLATFORM node:24-alpine AS build-stage
# Set environment variables for non-interactive npm installs
ENV NPM_CONFIG_LOGLEVEL=warn
ENV CI=true
@@ -8,9 +8,10 @@ RUN apk add --update python3 make g++\
&& rm -rf /var/cache/apk/*
WORKDIR /app
COPY package.json pnpm-lock.yaml ./
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./
COPY patches patches
RUN npm install -g pnpm && pnpm i --ignore-scripts --frozen-lockfile
COPY stubs stubs
RUN npm install -g pnpm@11 && pnpm i --ignore-scripts --frozen-lockfile
COPY . .
ARG BASE_URL
ENV BASE_URL=${BASE_URL}
+13 -6
View File
@@ -269,16 +269,17 @@ To install VSCode in WSL2 (Windows), see: https://learn.microsoft.com/en-us/wind
- [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur)
- [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin).
- [ESLint](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint)
- [Oxc](https://marketplace.visualstudio.com/items?itemName=oxc.oxc-vscode) (oxlint + oxfmt)
- [i18n Ally](https://marketplace.visualstudio.com/items?itemName=lokalise.i18n-ally)
with the following settings:
```json
{
"editor.formatOnSave": false,
"editor.formatOnSave": true,
"editor.defaultFormatter": "oxc.oxc-vscode",
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
"source.fixAll.oxc": "always"
},
"i18n-ally.localesPaths": ["locales", "src/tools/*/locales"],
"i18n-ally.keystyle": "nested"
@@ -320,18 +321,24 @@ pnpm build
pnpm test
```
### Lint with [ESLint](https://eslint.org/)
### Lint with [Oxlint](https://oxc.rs/docs/guide/usage/linter)
```sh
pnpm lint
```
### Ensure CI (lock, eslint, typecheck) will succeed
### Format with [Oxfmt](https://oxc.rs/docs/guide/usage/formatter)
```sh
pnpm fmt
```
### Ensure CI (lock, oxlint, typecheck) will succeed
Before submitting a PR, run:
```sh
pnpm install --ignore-scripts && pnpm lint --fix && pnpm typecheck
pnpm install --ignore-scripts && pnpm lint:fix && pnpm typecheck
```
### Create a new tool
+302 -572
View File
@@ -1,301 +1,312 @@
/* eslint-disable */
/* prettier-ignore */
// @ts-nocheck
// noinspection JSUnusedGlobalSymbols
// Generated by unplugin-auto-import
// biome-ignore lint: disable
export {}
declare global {
const EffectScope: typeof import('vue')['EffectScope']
const asyncComputed: typeof import('@vueuse/core')['asyncComputed']
const autoResetRef: typeof import('@vueuse/core')['autoResetRef']
const computed: typeof import('vue')['computed']
const computedAsync: typeof import('@vueuse/core')['computedAsync']
const computedEager: typeof import('@vueuse/core')['computedEager']
const computedInject: typeof import('@vueuse/core')['computedInject']
const computedWithControl: typeof import('@vueuse/core')['computedWithControl']
const controlledComputed: typeof import('@vueuse/core')['controlledComputed']
const controlledRef: typeof import('@vueuse/core')['controlledRef']
const createApp: typeof import('vue')['createApp']
const createEventHook: typeof import('@vueuse/core')['createEventHook']
const createGlobalState: typeof import('@vueuse/core')['createGlobalState']
const createInjectionState: typeof import('@vueuse/core')['createInjectionState']
const createReactiveFn: typeof import('@vueuse/core')['createReactiveFn']
const createReusableTemplate: typeof import('@vueuse/core')['createReusableTemplate']
const createSharedComposable: typeof import('@vueuse/core')['createSharedComposable']
const createTemplatePromise: typeof import('@vueuse/core')['createTemplatePromise']
const createUnrefFn: typeof import('@vueuse/core')['createUnrefFn']
const customRef: typeof import('vue')['customRef']
const debouncedRef: typeof import('@vueuse/core')['debouncedRef']
const debouncedWatch: typeof import('@vueuse/core')['debouncedWatch']
const defineAsyncComponent: typeof import('vue')['defineAsyncComponent']
const defineComponent: typeof import('vue')['defineComponent']
const eagerComputed: typeof import('@vueuse/core')['eagerComputed']
const effectScope: typeof import('vue')['effectScope']
const extendRef: typeof import('@vueuse/core')['extendRef']
const getCurrentInstance: typeof import('vue')['getCurrentInstance']
const getCurrentScope: typeof import('vue')['getCurrentScope']
const h: typeof import('vue')['h']
const ignorableWatch: typeof import('@vueuse/core')['ignorableWatch']
const inject: typeof import('vue')['inject']
const injectLocal: typeof import('@vueuse/core')['injectLocal']
const isDefined: typeof import('@vueuse/core')['isDefined']
const isProxy: typeof import('vue')['isProxy']
const isReactive: typeof import('vue')['isReactive']
const isReadonly: typeof import('vue')['isReadonly']
const isRef: typeof import('vue')['isRef']
const makeDestructurable: typeof import('@vueuse/core')['makeDestructurable']
const markRaw: typeof import('vue')['markRaw']
const nextTick: typeof import('vue')['nextTick']
const onActivated: typeof import('vue')['onActivated']
const onBeforeMount: typeof import('vue')['onBeforeMount']
const onBeforeRouteLeave: typeof import('vue-router')['onBeforeRouteLeave']
const onBeforeRouteUpdate: typeof import('vue-router')['onBeforeRouteUpdate']
const onBeforeUnmount: typeof import('vue')['onBeforeUnmount']
const onBeforeUpdate: typeof import('vue')['onBeforeUpdate']
const onClickOutside: typeof import('@vueuse/core')['onClickOutside']
const onDeactivated: typeof import('vue')['onDeactivated']
const onErrorCaptured: typeof import('vue')['onErrorCaptured']
const onKeyStroke: typeof import('@vueuse/core')['onKeyStroke']
const onLongPress: typeof import('@vueuse/core')['onLongPress']
const onMounted: typeof import('vue')['onMounted']
const onRenderTracked: typeof import('vue')['onRenderTracked']
const onRenderTriggered: typeof import('vue')['onRenderTriggered']
const onScopeDispose: typeof import('vue')['onScopeDispose']
const onServerPrefetch: typeof import('vue')['onServerPrefetch']
const onStartTyping: typeof import('@vueuse/core')['onStartTyping']
const onUnmounted: typeof import('vue')['onUnmounted']
const onUpdated: typeof import('vue')['onUpdated']
const pausableWatch: typeof import('@vueuse/core')['pausableWatch']
const provide: typeof import('vue')['provide']
const provideLocal: typeof import('@vueuse/core')['provideLocal']
const reactify: typeof import('@vueuse/core')['reactify']
const reactifyObject: typeof import('@vueuse/core')['reactifyObject']
const reactive: typeof import('vue')['reactive']
const reactiveComputed: typeof import('@vueuse/core')['reactiveComputed']
const reactiveOmit: typeof import('@vueuse/core')['reactiveOmit']
const reactivePick: typeof import('@vueuse/core')['reactivePick']
const readonly: typeof import('vue')['readonly']
const ref: typeof import('vue')['ref']
const refAutoReset: typeof import('@vueuse/core')['refAutoReset']
const refDebounced: typeof import('@vueuse/core')['refDebounced']
const refDefault: typeof import('@vueuse/core')['refDefault']
const refThrottled: typeof import('@vueuse/core')['refThrottled']
const refWithControl: typeof import('@vueuse/core')['refWithControl']
const resolveComponent: typeof import('vue')['resolveComponent']
const resolveRef: typeof import('@vueuse/core')['resolveRef']
const resolveUnref: typeof import('@vueuse/core')['resolveUnref']
const shallowReactive: typeof import('vue')['shallowReactive']
const shallowReadonly: typeof import('vue')['shallowReadonly']
const shallowRef: typeof import('vue')['shallowRef']
const syncRef: typeof import('@vueuse/core')['syncRef']
const syncRefs: typeof import('@vueuse/core')['syncRefs']
const templateRef: typeof import('@vueuse/core')['templateRef']
const throttledRef: typeof import('@vueuse/core')['throttledRef']
const throttledWatch: typeof import('@vueuse/core')['throttledWatch']
const toRaw: typeof import('vue')['toRaw']
const toReactive: typeof import('@vueuse/core')['toReactive']
const toRef: typeof import('vue')['toRef']
const toRefs: typeof import('vue')['toRefs']
const toValue: typeof import('vue')['toValue']
const triggerRef: typeof import('vue')['triggerRef']
const tryOnBeforeMount: typeof import('@vueuse/core')['tryOnBeforeMount']
const tryOnBeforeUnmount: typeof import('@vueuse/core')['tryOnBeforeUnmount']
const tryOnMounted: typeof import('@vueuse/core')['tryOnMounted']
const tryOnScopeDispose: typeof import('@vueuse/core')['tryOnScopeDispose']
const tryOnUnmounted: typeof import('@vueuse/core')['tryOnUnmounted']
const unref: typeof import('vue')['unref']
const unrefElement: typeof import('@vueuse/core')['unrefElement']
const until: typeof import('@vueuse/core')['until']
const useActiveElement: typeof import('@vueuse/core')['useActiveElement']
const useAnimate: typeof import('@vueuse/core')['useAnimate']
const useArrayDifference: typeof import('@vueuse/core')['useArrayDifference']
const useArrayEvery: typeof import('@vueuse/core')['useArrayEvery']
const useArrayFilter: typeof import('@vueuse/core')['useArrayFilter']
const useArrayFind: typeof import('@vueuse/core')['useArrayFind']
const useArrayFindIndex: typeof import('@vueuse/core')['useArrayFindIndex']
const useArrayFindLast: typeof import('@vueuse/core')['useArrayFindLast']
const useArrayIncludes: typeof import('@vueuse/core')['useArrayIncludes']
const useArrayJoin: typeof import('@vueuse/core')['useArrayJoin']
const useArrayMap: typeof import('@vueuse/core')['useArrayMap']
const useArrayReduce: typeof import('@vueuse/core')['useArrayReduce']
const useArraySome: typeof import('@vueuse/core')['useArraySome']
const useArrayUnique: typeof import('@vueuse/core')['useArrayUnique']
const useAsyncQueue: typeof import('@vueuse/core')['useAsyncQueue']
const useAsyncState: typeof import('@vueuse/core')['useAsyncState']
const useAttrs: typeof import('vue')['useAttrs']
const useBase64: typeof import('@vueuse/core')['useBase64']
const useBattery: typeof import('@vueuse/core')['useBattery']
const useBluetooth: typeof import('@vueuse/core')['useBluetooth']
const useBreakpoints: typeof import('@vueuse/core')['useBreakpoints']
const useBroadcastChannel: typeof import('@vueuse/core')['useBroadcastChannel']
const useBrowserLocation: typeof import('@vueuse/core')['useBrowserLocation']
const useCached: typeof import('@vueuse/core')['useCached']
const useClipboard: typeof import('@vueuse/core')['useClipboard']
const useClipboardItems: typeof import('@vueuse/core')['useClipboardItems']
const useCloned: typeof import('@vueuse/core')['useCloned']
const useColorMode: typeof import('@vueuse/core')['useColorMode']
const useConfirmDialog: typeof import('@vueuse/core')['useConfirmDialog']
const useCounter: typeof import('@vueuse/core')['useCounter']
const useCssModule: typeof import('vue')['useCssModule']
const useCssVar: typeof import('@vueuse/core')['useCssVar']
const useCssVars: typeof import('vue')['useCssVars']
const useCurrentElement: typeof import('@vueuse/core')['useCurrentElement']
const useCycleList: typeof import('@vueuse/core')['useCycleList']
const useDark: typeof import('@vueuse/core')['useDark']
const useDateFormat: typeof import('@vueuse/core')['useDateFormat']
const useDebounce: typeof import('@vueuse/core')['useDebounce']
const useDebounceFn: typeof import('@vueuse/core')['useDebounceFn']
const useDebouncedRefHistory: typeof import('@vueuse/core')['useDebouncedRefHistory']
const useDeviceMotion: typeof import('@vueuse/core')['useDeviceMotion']
const useDeviceOrientation: typeof import('@vueuse/core')['useDeviceOrientation']
const useDevicePixelRatio: typeof import('@vueuse/core')['useDevicePixelRatio']
const useDevicesList: typeof import('@vueuse/core')['useDevicesList']
const useDialog: typeof import('naive-ui')['useDialog']
const useDisplayMedia: typeof import('@vueuse/core')['useDisplayMedia']
const useDocumentVisibility: typeof import('@vueuse/core')['useDocumentVisibility']
const useDraggable: typeof import('@vueuse/core')['useDraggable']
const useDropZone: typeof import('@vueuse/core')['useDropZone']
const useElementBounding: typeof import('@vueuse/core')['useElementBounding']
const useElementByPoint: typeof import('@vueuse/core')['useElementByPoint']
const useElementHover: typeof import('@vueuse/core')['useElementHover']
const useElementSize: typeof import('@vueuse/core')['useElementSize']
const useElementVisibility: typeof import('@vueuse/core')['useElementVisibility']
const useEventBus: typeof import('@vueuse/core')['useEventBus']
const useEventListener: typeof import('@vueuse/core')['useEventListener']
const useEventSource: typeof import('@vueuse/core')['useEventSource']
const useEyeDropper: typeof import('@vueuse/core')['useEyeDropper']
const useFavicon: typeof import('@vueuse/core')['useFavicon']
const useFetch: typeof import('@vueuse/core')['useFetch']
const useFileDialog: typeof import('@vueuse/core')['useFileDialog']
const useFileSystemAccess: typeof import('@vueuse/core')['useFileSystemAccess']
const useFocus: typeof import('@vueuse/core')['useFocus']
const useFocusWithin: typeof import('@vueuse/core')['useFocusWithin']
const useFps: typeof import('@vueuse/core')['useFps']
const useFullscreen: typeof import('@vueuse/core')['useFullscreen']
const useGamepad: typeof import('@vueuse/core')['useGamepad']
const useGeolocation: typeof import('@vueuse/core')['useGeolocation']
const useI18n: typeof import('vue-i18n')['useI18n']
const useIdle: typeof import('@vueuse/core')['useIdle']
const useImage: typeof import('@vueuse/core')['useImage']
const useInfiniteScroll: typeof import('@vueuse/core')['useInfiniteScroll']
const useIntersectionObserver: typeof import('@vueuse/core')['useIntersectionObserver']
const useInterval: typeof import('@vueuse/core')['useInterval']
const useIntervalFn: typeof import('@vueuse/core')['useIntervalFn']
const useKeyModifier: typeof import('@vueuse/core')['useKeyModifier']
const useLastChanged: typeof import('@vueuse/core')['useLastChanged']
const useLink: typeof import('vue-router')['useLink']
const useLoadingBar: typeof import('naive-ui')['useLoadingBar']
const useLocalStorage: typeof import('@vueuse/core')['useLocalStorage']
const useMagicKeys: typeof import('@vueuse/core')['useMagicKeys']
const useManualRefHistory: typeof import('@vueuse/core')['useManualRefHistory']
const useMediaControls: typeof import('@vueuse/core')['useMediaControls']
const useMediaQuery: typeof import('@vueuse/core')['useMediaQuery']
const useMemoize: typeof import('@vueuse/core')['useMemoize']
const useMemory: typeof import('@vueuse/core')['useMemory']
const useMessage: typeof import('naive-ui')['useMessage']
const useMounted: typeof import('@vueuse/core')['useMounted']
const useMouse: typeof import('@vueuse/core')['useMouse']
const useMouseInElement: typeof import('@vueuse/core')['useMouseInElement']
const useMousePressed: typeof import('@vueuse/core')['useMousePressed']
const useMutationObserver: typeof import('@vueuse/core')['useMutationObserver']
const useNavigatorLanguage: typeof import('@vueuse/core')['useNavigatorLanguage']
const useNetwork: typeof import('@vueuse/core')['useNetwork']
const useNotification: typeof import('naive-ui')['useNotification']
const useNow: typeof import('@vueuse/core')['useNow']
const useObjectUrl: typeof import('@vueuse/core')['useObjectUrl']
const useOffsetPagination: typeof import('@vueuse/core')['useOffsetPagination']
const useOnline: typeof import('@vueuse/core')['useOnline']
const usePageLeave: typeof import('@vueuse/core')['usePageLeave']
const useParallax: typeof import('@vueuse/core')['useParallax']
const useParentElement: typeof import('@vueuse/core')['useParentElement']
const usePerformanceObserver: typeof import('@vueuse/core')['usePerformanceObserver']
const usePermission: typeof import('@vueuse/core')['usePermission']
const usePointer: typeof import('@vueuse/core')['usePointer']
const usePointerLock: typeof import('@vueuse/core')['usePointerLock']
const usePointerSwipe: typeof import('@vueuse/core')['usePointerSwipe']
const usePreferredColorScheme: typeof import('@vueuse/core')['usePreferredColorScheme']
const usePreferredContrast: typeof import('@vueuse/core')['usePreferredContrast']
const usePreferredDark: typeof import('@vueuse/core')['usePreferredDark']
const usePreferredLanguages: typeof import('@vueuse/core')['usePreferredLanguages']
const usePreferredReducedMotion: typeof import('@vueuse/core')['usePreferredReducedMotion']
const usePrevious: typeof import('@vueuse/core')['usePrevious']
const useRafFn: typeof import('@vueuse/core')['useRafFn']
const useRefHistory: typeof import('@vueuse/core')['useRefHistory']
const useResizeObserver: typeof import('@vueuse/core')['useResizeObserver']
const useRoute: typeof import('vue-router')['useRoute']
const useRouter: typeof import('vue-router')['useRouter']
const useScreenOrientation: typeof import('@vueuse/core')['useScreenOrientation']
const useScreenSafeArea: typeof import('@vueuse/core')['useScreenSafeArea']
const useScriptTag: typeof import('@vueuse/core')['useScriptTag']
const useScroll: typeof import('@vueuse/core')['useScroll']
const useScrollLock: typeof import('@vueuse/core')['useScrollLock']
const useSessionStorage: typeof import('@vueuse/core')['useSessionStorage']
const useShare: typeof import('@vueuse/core')['useShare']
const useSlots: typeof import('vue')['useSlots']
const useSorted: typeof import('@vueuse/core')['useSorted']
const useSpeechRecognition: typeof import('@vueuse/core')['useSpeechRecognition']
const useSpeechSynthesis: typeof import('@vueuse/core')['useSpeechSynthesis']
const useStepper: typeof import('@vueuse/core')['useStepper']
const useStorage: typeof import('@vueuse/core')['useStorage']
const useStorageAsync: typeof import('@vueuse/core')['useStorageAsync']
const useStyleTag: typeof import('@vueuse/core')['useStyleTag']
const useSupported: typeof import('@vueuse/core')['useSupported']
const useSwipe: typeof import('@vueuse/core')['useSwipe']
const useTemplateRefsList: typeof import('@vueuse/core')['useTemplateRefsList']
const useTextDirection: typeof import('@vueuse/core')['useTextDirection']
const useTextSelection: typeof import('@vueuse/core')['useTextSelection']
const useTextareaAutosize: typeof import('@vueuse/core')['useTextareaAutosize']
const useThrottle: typeof import('@vueuse/core')['useThrottle']
const useThrottleFn: typeof import('@vueuse/core')['useThrottleFn']
const useThrottledRefHistory: typeof import('@vueuse/core')['useThrottledRefHistory']
const useTimeAgo: typeof import('@vueuse/core')['useTimeAgo']
const useTimeout: typeof import('@vueuse/core')['useTimeout']
const useTimeoutFn: typeof import('@vueuse/core')['useTimeoutFn']
const useTimeoutPoll: typeof import('@vueuse/core')['useTimeoutPoll']
const useTimestamp: typeof import('@vueuse/core')['useTimestamp']
const useTitle: typeof import('@vueuse/core')['useTitle']
const useToNumber: typeof import('@vueuse/core')['useToNumber']
const useToString: typeof import('@vueuse/core')['useToString']
const useToggle: typeof import('@vueuse/core')['useToggle']
const useTransition: typeof import('@vueuse/core')['useTransition']
const useUrlSearchParams: typeof import('@vueuse/core')['useUrlSearchParams']
const useUserMedia: typeof import('@vueuse/core')['useUserMedia']
const useVModel: typeof import('@vueuse/core')['useVModel']
const useVModels: typeof import('@vueuse/core')['useVModels']
const useVibrate: typeof import('@vueuse/core')['useVibrate']
const useVirtualList: typeof import('@vueuse/core')['useVirtualList']
const useWakeLock: typeof import('@vueuse/core')['useWakeLock']
const useWebNotification: typeof import('@vueuse/core')['useWebNotification']
const useWebSocket: typeof import('@vueuse/core')['useWebSocket']
const useWebWorker: typeof import('@vueuse/core')['useWebWorker']
const useWebWorkerFn: typeof import('@vueuse/core')['useWebWorkerFn']
const useWindowFocus: typeof import('@vueuse/core')['useWindowFocus']
const useWindowScroll: typeof import('@vueuse/core')['useWindowScroll']
const useWindowSize: typeof import('@vueuse/core')['useWindowSize']
const watch: typeof import('vue')['watch']
const watchArray: typeof import('@vueuse/core')['watchArray']
const watchAtMost: typeof import('@vueuse/core')['watchAtMost']
const watchDebounced: typeof import('@vueuse/core')['watchDebounced']
const watchDeep: typeof import('@vueuse/core')['watchDeep']
const watchEffect: typeof import('vue')['watchEffect']
const watchIgnorable: typeof import('@vueuse/core')['watchIgnorable']
const watchImmediate: typeof import('@vueuse/core')['watchImmediate']
const watchOnce: typeof import('@vueuse/core')['watchOnce']
const watchPausable: typeof import('@vueuse/core')['watchPausable']
const watchPostEffect: typeof import('vue')['watchPostEffect']
const watchSyncEffect: typeof import('vue')['watchSyncEffect']
const watchThrottled: typeof import('@vueuse/core')['watchThrottled']
const watchTriggerable: typeof import('@vueuse/core')['watchTriggerable']
const watchWithFilter: typeof import('@vueuse/core')['watchWithFilter']
const whenever: typeof import('@vueuse/core')['whenever']
const EffectScope: typeof import('vue').EffectScope
const asyncComputed: typeof import('@vueuse/core').asyncComputed
const autoResetRef: typeof import('@vueuse/core').autoResetRef
const computed: typeof import('vue').computed
const computedAsync: typeof import('@vueuse/core').computedAsync
const computedEager: typeof import('@vueuse/core').computedEager
const computedInject: typeof import('@vueuse/core').computedInject
const computedWithControl: typeof import('@vueuse/core').computedWithControl
const controlledComputed: typeof import('@vueuse/core').controlledComputed
const controlledRef: typeof import('@vueuse/core').controlledRef
const createApp: typeof import('vue').createApp
const createEventHook: typeof import('@vueuse/core').createEventHook
const createGlobalState: typeof import('@vueuse/core').createGlobalState
const createInjectionState: typeof import('@vueuse/core').createInjectionState
const createReactiveFn: typeof import('@vueuse/core').createReactiveFn
const createReusableTemplate: typeof import('@vueuse/core').createReusableTemplate
const createSharedComposable: typeof import('@vueuse/core').createSharedComposable
const createTemplatePromise: typeof import('@vueuse/core').createTemplatePromise
const createUnrefFn: typeof import('@vueuse/core').createUnrefFn
const customRef: typeof import('vue').customRef
const debouncedRef: typeof import('@vueuse/core').debouncedRef
const debouncedWatch: typeof import('@vueuse/core').debouncedWatch
const defineAsyncComponent: typeof import('vue').defineAsyncComponent
const defineComponent: typeof import('vue').defineComponent
const eagerComputed: typeof import('@vueuse/core').eagerComputed
const effectScope: typeof import('vue').effectScope
const extendRef: typeof import('@vueuse/core').extendRef
const getCurrentInstance: typeof import('vue').getCurrentInstance
const getCurrentScope: typeof import('vue').getCurrentScope
const getCurrentWatcher: typeof import('vue').getCurrentWatcher
const h: typeof import('vue').h
const ignorableWatch: typeof import('@vueuse/core').ignorableWatch
const inject: typeof import('vue').inject
const injectLocal: typeof import('@vueuse/core').injectLocal
const isDefined: typeof import('@vueuse/core').isDefined
const isProxy: typeof import('vue').isProxy
const isReactive: typeof import('vue').isReactive
const isReadonly: typeof import('vue').isReadonly
const isRef: typeof import('vue').isRef
const isShallow: typeof import('vue').isShallow
const makeDestructurable: typeof import('@vueuse/core').makeDestructurable
const markRaw: typeof import('vue').markRaw
const nextTick: typeof import('vue').nextTick
const onActivated: typeof import('vue').onActivated
const onBeforeMount: typeof import('vue').onBeforeMount
const onBeforeRouteLeave: typeof import('vue-router').onBeforeRouteLeave
const onBeforeRouteUpdate: typeof import('vue-router').onBeforeRouteUpdate
const onBeforeUnmount: typeof import('vue').onBeforeUnmount
const onBeforeUpdate: typeof import('vue').onBeforeUpdate
const onClickOutside: typeof import('@vueuse/core').onClickOutside
const onDeactivated: typeof import('vue').onDeactivated
const onErrorCaptured: typeof import('vue').onErrorCaptured
const onKeyStroke: typeof import('@vueuse/core').onKeyStroke
const onLongPress: typeof import('@vueuse/core').onLongPress
const onMounted: typeof import('vue').onMounted
const onRenderTracked: typeof import('vue').onRenderTracked
const onRenderTriggered: typeof import('vue').onRenderTriggered
const onScopeDispose: typeof import('vue').onScopeDispose
const onServerPrefetch: typeof import('vue').onServerPrefetch
const onStartTyping: typeof import('@vueuse/core').onStartTyping
const onUnmounted: typeof import('vue').onUnmounted
const onUpdated: typeof import('vue').onUpdated
const onWatcherCleanup: typeof import('vue').onWatcherCleanup
const pausableWatch: typeof import('@vueuse/core').pausableWatch
const provide: typeof import('vue').provide
const provideLocal: typeof import('@vueuse/core').provideLocal
const reactify: typeof import('@vueuse/core').reactify
const reactifyObject: typeof import('@vueuse/core').reactifyObject
const reactive: typeof import('vue').reactive
const reactiveComputed: typeof import('@vueuse/core').reactiveComputed
const reactiveOmit: typeof import('@vueuse/core').reactiveOmit
const reactivePick: typeof import('@vueuse/core').reactivePick
const readonly: typeof import('vue').readonly
const ref: typeof import('vue').ref
const refAutoReset: typeof import('@vueuse/core').refAutoReset
const refDebounced: typeof import('@vueuse/core').refDebounced
const refDefault: typeof import('@vueuse/core').refDefault
const refThrottled: typeof import('@vueuse/core').refThrottled
const refWithControl: typeof import('@vueuse/core').refWithControl
const resolveComponent: typeof import('vue').resolveComponent
const resolveRef: typeof import('@vueuse/core').resolveRef
const resolveUnref: typeof import('@vueuse/core').resolveUnref
const shallowReactive: typeof import('vue').shallowReactive
const shallowReadonly: typeof import('vue').shallowReadonly
const shallowRef: typeof import('vue').shallowRef
const syncRef: typeof import('@vueuse/core').syncRef
const syncRefs: typeof import('@vueuse/core').syncRefs
const templateRef: typeof import('@vueuse/core').templateRef
const throttledRef: typeof import('@vueuse/core').throttledRef
const throttledWatch: typeof import('@vueuse/core').throttledWatch
const toRaw: typeof import('vue').toRaw
const toReactive: typeof import('@vueuse/core').toReactive
const toRef: typeof import('vue').toRef
const toRefs: typeof import('vue').toRefs
const toValue: typeof import('vue').toValue
const triggerRef: typeof import('vue').triggerRef
const tryOnBeforeMount: typeof import('@vueuse/core').tryOnBeforeMount
const tryOnBeforeUnmount: typeof import('@vueuse/core').tryOnBeforeUnmount
const tryOnMounted: typeof import('@vueuse/core').tryOnMounted
const tryOnScopeDispose: typeof import('@vueuse/core').tryOnScopeDispose
const tryOnUnmounted: typeof import('@vueuse/core').tryOnUnmounted
const unref: typeof import('vue').unref
const unrefElement: typeof import('@vueuse/core').unrefElement
const until: typeof import('@vueuse/core').until
const useActiveElement: typeof import('@vueuse/core').useActiveElement
const useAnimate: typeof import('@vueuse/core').useAnimate
const useArrayDifference: typeof import('@vueuse/core').useArrayDifference
const useArrayEvery: typeof import('@vueuse/core').useArrayEvery
const useArrayFilter: typeof import('@vueuse/core').useArrayFilter
const useArrayFind: typeof import('@vueuse/core').useArrayFind
const useArrayFindIndex: typeof import('@vueuse/core').useArrayFindIndex
const useArrayFindLast: typeof import('@vueuse/core').useArrayFindLast
const useArrayIncludes: typeof import('@vueuse/core').useArrayIncludes
const useArrayJoin: typeof import('@vueuse/core').useArrayJoin
const useArrayMap: typeof import('@vueuse/core').useArrayMap
const useArrayReduce: typeof import('@vueuse/core').useArrayReduce
const useArraySome: typeof import('@vueuse/core').useArraySome
const useArrayUnique: typeof import('@vueuse/core').useArrayUnique
const useAsyncQueue: typeof import('@vueuse/core').useAsyncQueue
const useAsyncState: typeof import('@vueuse/core').useAsyncState
const useAttrs: typeof import('vue').useAttrs
const useBase64: typeof import('@vueuse/core').useBase64
const useBattery: typeof import('@vueuse/core').useBattery
const useBluetooth: typeof import('@vueuse/core').useBluetooth
const useBreakpoints: typeof import('@vueuse/core').useBreakpoints
const useBroadcastChannel: typeof import('@vueuse/core').useBroadcastChannel
const useBrowserLocation: typeof import('@vueuse/core').useBrowserLocation
const useCached: typeof import('@vueuse/core').useCached
const useClipboard: typeof import('@vueuse/core').useClipboard
const useClipboardItems: typeof import('@vueuse/core').useClipboardItems
const useCloned: typeof import('@vueuse/core').useCloned
const useColorMode: typeof import('@vueuse/core').useColorMode
const useConfirmDialog: typeof import('@vueuse/core').useConfirmDialog
const useCounter: typeof import('@vueuse/core').useCounter
const useCssModule: typeof import('vue').useCssModule
const useCssVar: typeof import('@vueuse/core').useCssVar
const useCssVars: typeof import('vue').useCssVars
const useCurrentElement: typeof import('@vueuse/core').useCurrentElement
const useCycleList: typeof import('@vueuse/core').useCycleList
const useDark: typeof import('@vueuse/core').useDark
const useDateFormat: typeof import('@vueuse/core').useDateFormat
const useDebounce: typeof import('@vueuse/core').useDebounce
const useDebounceFn: typeof import('@vueuse/core').useDebounceFn
const useDebouncedRefHistory: typeof import('@vueuse/core').useDebouncedRefHistory
const useDeviceMotion: typeof import('@vueuse/core').useDeviceMotion
const useDeviceOrientation: typeof import('@vueuse/core').useDeviceOrientation
const useDevicePixelRatio: typeof import('@vueuse/core').useDevicePixelRatio
const useDevicesList: typeof import('@vueuse/core').useDevicesList
const useDialog: typeof import('naive-ui').useDialog
const useDisplayMedia: typeof import('@vueuse/core').useDisplayMedia
const useDocumentVisibility: typeof import('@vueuse/core').useDocumentVisibility
const useDraggable: typeof import('@vueuse/core').useDraggable
const useDropZone: typeof import('@vueuse/core').useDropZone
const useElementBounding: typeof import('@vueuse/core').useElementBounding
const useElementByPoint: typeof import('@vueuse/core').useElementByPoint
const useElementHover: typeof import('@vueuse/core').useElementHover
const useElementSize: typeof import('@vueuse/core').useElementSize
const useElementVisibility: typeof import('@vueuse/core').useElementVisibility
const useEventBus: typeof import('@vueuse/core').useEventBus
const useEventListener: typeof import('@vueuse/core').useEventListener
const useEventSource: typeof import('@vueuse/core').useEventSource
const useEyeDropper: typeof import('@vueuse/core').useEyeDropper
const useFavicon: typeof import('@vueuse/core').useFavicon
const useFetch: typeof import('@vueuse/core').useFetch
const useFileDialog: typeof import('@vueuse/core').useFileDialog
const useFileSystemAccess: typeof import('@vueuse/core').useFileSystemAccess
const useFocus: typeof import('@vueuse/core').useFocus
const useFocusWithin: typeof import('@vueuse/core').useFocusWithin
const useFps: typeof import('@vueuse/core').useFps
const useFullscreen: typeof import('@vueuse/core').useFullscreen
const useGamepad: typeof import('@vueuse/core').useGamepad
const useGeolocation: typeof import('@vueuse/core').useGeolocation
const useI18n: typeof import('vue-i18n').useI18n
const useId: typeof import('vue').useId
const useIdle: typeof import('@vueuse/core').useIdle
const useImage: typeof import('@vueuse/core').useImage
const useInfiniteScroll: typeof import('@vueuse/core').useInfiniteScroll
const useIntersectionObserver: typeof import('@vueuse/core').useIntersectionObserver
const useInterval: typeof import('@vueuse/core').useInterval
const useIntervalFn: typeof import('@vueuse/core').useIntervalFn
const useKeyModifier: typeof import('@vueuse/core').useKeyModifier
const useLastChanged: typeof import('@vueuse/core').useLastChanged
const useLink: typeof import('vue-router').useLink
const useLoadingBar: typeof import('naive-ui').useLoadingBar
const useLocalStorage: typeof import('@vueuse/core').useLocalStorage
const useMagicKeys: typeof import('@vueuse/core').useMagicKeys
const useManualRefHistory: typeof import('@vueuse/core').useManualRefHistory
const useMediaControls: typeof import('@vueuse/core').useMediaControls
const useMediaQuery: typeof import('@vueuse/core').useMediaQuery
const useMemoize: typeof import('@vueuse/core').useMemoize
const useMemory: typeof import('@vueuse/core').useMemory
const useMessage: typeof import('naive-ui').useMessage
const useModel: typeof import('vue').useModel
const useMounted: typeof import('@vueuse/core').useMounted
const useMouse: typeof import('@vueuse/core').useMouse
const useMouseInElement: typeof import('@vueuse/core').useMouseInElement
const useMousePressed: typeof import('@vueuse/core').useMousePressed
const useMutationObserver: typeof import('@vueuse/core').useMutationObserver
const useNavigatorLanguage: typeof import('@vueuse/core').useNavigatorLanguage
const useNetwork: typeof import('@vueuse/core').useNetwork
const useNotification: typeof import('naive-ui').useNotification
const useNow: typeof import('@vueuse/core').useNow
const useObjectUrl: typeof import('@vueuse/core').useObjectUrl
const useOffsetPagination: typeof import('@vueuse/core').useOffsetPagination
const useOnline: typeof import('@vueuse/core').useOnline
const usePageLeave: typeof import('@vueuse/core').usePageLeave
const useParallax: typeof import('@vueuse/core').useParallax
const useParentElement: typeof import('@vueuse/core').useParentElement
const usePerformanceObserver: typeof import('@vueuse/core').usePerformanceObserver
const usePermission: typeof import('@vueuse/core').usePermission
const usePointer: typeof import('@vueuse/core').usePointer
const usePointerLock: typeof import('@vueuse/core').usePointerLock
const usePointerSwipe: typeof import('@vueuse/core').usePointerSwipe
const usePreferredColorScheme: typeof import('@vueuse/core').usePreferredColorScheme
const usePreferredContrast: typeof import('@vueuse/core').usePreferredContrast
const usePreferredDark: typeof import('@vueuse/core').usePreferredDark
const usePreferredLanguages: typeof import('@vueuse/core').usePreferredLanguages
const usePreferredReducedMotion: typeof import('@vueuse/core').usePreferredReducedMotion
const usePrevious: typeof import('@vueuse/core').usePrevious
const useRafFn: typeof import('@vueuse/core').useRafFn
const useRefHistory: typeof import('@vueuse/core').useRefHistory
const useResizeObserver: typeof import('@vueuse/core').useResizeObserver
const useRoute: typeof import('vue-router').useRoute
const useRouter: typeof import('vue-router').useRouter
const useScreenOrientation: typeof import('@vueuse/core').useScreenOrientation
const useScreenSafeArea: typeof import('@vueuse/core').useScreenSafeArea
const useScriptTag: typeof import('@vueuse/core').useScriptTag
const useScroll: typeof import('@vueuse/core').useScroll
const useScrollLock: typeof import('@vueuse/core').useScrollLock
const useSessionStorage: typeof import('@vueuse/core').useSessionStorage
const useShare: typeof import('@vueuse/core').useShare
const useSlots: typeof import('vue').useSlots
const useSorted: typeof import('@vueuse/core').useSorted
const useSpeechRecognition: typeof import('@vueuse/core').useSpeechRecognition
const useSpeechSynthesis: typeof import('@vueuse/core').useSpeechSynthesis
const useStepper: typeof import('@vueuse/core').useStepper
const useStorage: typeof import('@vueuse/core').useStorage
const useStorageAsync: typeof import('@vueuse/core').useStorageAsync
const useStyleTag: typeof import('@vueuse/core').useStyleTag
const useSupported: typeof import('@vueuse/core').useSupported
const useSwipe: typeof import('@vueuse/core').useSwipe
const useTemplateRef: typeof import('vue').useTemplateRef
const useTemplateRefsList: typeof import('@vueuse/core').useTemplateRefsList
const useTextDirection: typeof import('@vueuse/core').useTextDirection
const useTextSelection: typeof import('@vueuse/core').useTextSelection
const useTextareaAutosize: typeof import('@vueuse/core').useTextareaAutosize
const useThrottle: typeof import('@vueuse/core').useThrottle
const useThrottleFn: typeof import('@vueuse/core').useThrottleFn
const useThrottledRefHistory: typeof import('@vueuse/core').useThrottledRefHistory
const useTimeAgo: typeof import('@vueuse/core').useTimeAgo
const useTimeout: typeof import('@vueuse/core').useTimeout
const useTimeoutFn: typeof import('@vueuse/core').useTimeoutFn
const useTimeoutPoll: typeof import('@vueuse/core').useTimeoutPoll
const useTimestamp: typeof import('@vueuse/core').useTimestamp
const useTitle: typeof import('@vueuse/core').useTitle
const useToNumber: typeof import('@vueuse/core').useToNumber
const useToString: typeof import('@vueuse/core').useToString
const useToggle: typeof import('@vueuse/core').useToggle
const useTransition: typeof import('@vueuse/core').useTransition
const useUrlSearchParams: typeof import('@vueuse/core').useUrlSearchParams
const useUserMedia: typeof import('@vueuse/core').useUserMedia
const useVModel: typeof import('@vueuse/core').useVModel
const useVModels: typeof import('@vueuse/core').useVModels
const useVibrate: typeof import('@vueuse/core').useVibrate
const useVirtualList: typeof import('@vueuse/core').useVirtualList
const useWakeLock: typeof import('@vueuse/core').useWakeLock
const useWebNotification: typeof import('@vueuse/core').useWebNotification
const useWebSocket: typeof import('@vueuse/core').useWebSocket
const useWebWorker: typeof import('@vueuse/core').useWebWorker
const useWebWorkerFn: typeof import('@vueuse/core').useWebWorkerFn
const useWindowFocus: typeof import('@vueuse/core').useWindowFocus
const useWindowScroll: typeof import('@vueuse/core').useWindowScroll
const useWindowSize: typeof import('@vueuse/core').useWindowSize
const watch: typeof import('vue').watch
const watchArray: typeof import('@vueuse/core').watchArray
const watchAtMost: typeof import('@vueuse/core').watchAtMost
const watchDebounced: typeof import('@vueuse/core').watchDebounced
const watchDeep: typeof import('@vueuse/core').watchDeep
const watchEffect: typeof import('vue').watchEffect
const watchIgnorable: typeof import('@vueuse/core').watchIgnorable
const watchImmediate: typeof import('@vueuse/core').watchImmediate
const watchOnce: typeof import('@vueuse/core').watchOnce
const watchPausable: typeof import('@vueuse/core').watchPausable
const watchPostEffect: typeof import('vue').watchPostEffect
const watchSyncEffect: typeof import('vue').watchSyncEffect
const watchThrottled: typeof import('@vueuse/core').watchThrottled
const watchTriggerable: typeof import('@vueuse/core').watchTriggerable
const watchWithFilter: typeof import('@vueuse/core').watchWithFilter
const whenever: typeof import('@vueuse/core').whenever
}
// for type re-export
declare global {
// @ts-ignore
export type { Component, ComponentPublicInstance, ComputedRef, InjectionKey, PropType, Ref, VNode } from 'vue'
export type { Component, Slot, Slots, ComponentPublicInstance, ComputedRef, DirectiveBinding, ExtractDefaultPropTypes, ExtractPropTypes, ExtractPublicPropTypes, InjectionKey, PropType, Ref, ShallowRef, MaybeRef, MaybeRefOrGetter, VNode, WritableComputedRef } from 'vue'
import('vue')
}
// for vue template auto import
import { UnwrapRef } from 'vue'
declare module 'vue' {
interface GlobalComponents {}
interface ComponentCustomProperties {
readonly EffectScope: UnwrapRef<typeof import('vue')['EffectScope']>
readonly asyncComputed: UnwrapRef<typeof import('@vueuse/core')['asyncComputed']>
@@ -326,6 +337,7 @@ declare module 'vue' {
readonly extendRef: UnwrapRef<typeof import('@vueuse/core')['extendRef']>
readonly getCurrentInstance: UnwrapRef<typeof import('vue')['getCurrentInstance']>
readonly getCurrentScope: UnwrapRef<typeof import('vue')['getCurrentScope']>
readonly getCurrentWatcher: UnwrapRef<typeof import('vue')['getCurrentWatcher']>
readonly h: UnwrapRef<typeof import('vue')['h']>
readonly ignorableWatch: UnwrapRef<typeof import('@vueuse/core')['ignorableWatch']>
readonly inject: UnwrapRef<typeof import('vue')['inject']>
@@ -335,6 +347,7 @@ declare module 'vue' {
readonly isReactive: UnwrapRef<typeof import('vue')['isReactive']>
readonly isReadonly: UnwrapRef<typeof import('vue')['isReadonly']>
readonly isRef: UnwrapRef<typeof import('vue')['isRef']>
readonly isShallow: UnwrapRef<typeof import('vue')['isShallow']>
readonly makeDestructurable: UnwrapRef<typeof import('@vueuse/core')['makeDestructurable']>
readonly markRaw: UnwrapRef<typeof import('vue')['markRaw']>
readonly nextTick: UnwrapRef<typeof import('vue')['nextTick']>
@@ -357,6 +370,7 @@ declare module 'vue' {
readonly onStartTyping: UnwrapRef<typeof import('@vueuse/core')['onStartTyping']>
readonly onUnmounted: UnwrapRef<typeof import('vue')['onUnmounted']>
readonly onUpdated: UnwrapRef<typeof import('vue')['onUpdated']>
readonly onWatcherCleanup: UnwrapRef<typeof import('vue')['onWatcherCleanup']>
readonly pausableWatch: UnwrapRef<typeof import('@vueuse/core')['pausableWatch']>
readonly provide: UnwrapRef<typeof import('vue')['provide']>
readonly provideLocal: UnwrapRef<typeof import('@vueuse/core')['provideLocal']>
@@ -467,6 +481,7 @@ declare module 'vue' {
readonly useGamepad: UnwrapRef<typeof import('@vueuse/core')['useGamepad']>
readonly useGeolocation: UnwrapRef<typeof import('@vueuse/core')['useGeolocation']>
readonly useI18n: UnwrapRef<typeof import('vue-i18n')['useI18n']>
readonly useId: UnwrapRef<typeof import('vue')['useId']>
readonly useIdle: UnwrapRef<typeof import('@vueuse/core')['useIdle']>
readonly useImage: UnwrapRef<typeof import('@vueuse/core')['useImage']>
readonly useInfiniteScroll: UnwrapRef<typeof import('@vueuse/core')['useInfiniteScroll']>
@@ -485,6 +500,7 @@ declare module 'vue' {
readonly useMemoize: UnwrapRef<typeof import('@vueuse/core')['useMemoize']>
readonly useMemory: UnwrapRef<typeof import('@vueuse/core')['useMemory']>
readonly useMessage: UnwrapRef<typeof import('naive-ui')['useMessage']>
readonly useModel: UnwrapRef<typeof import('vue')['useModel']>
readonly useMounted: UnwrapRef<typeof import('@vueuse/core')['useMounted']>
readonly useMouse: UnwrapRef<typeof import('@vueuse/core')['useMouse']>
readonly useMouseInElement: UnwrapRef<typeof import('@vueuse/core')['useMouseInElement']>
@@ -533,6 +549,7 @@ declare module 'vue' {
readonly useStyleTag: UnwrapRef<typeof import('@vueuse/core')['useStyleTag']>
readonly useSupported: UnwrapRef<typeof import('@vueuse/core')['useSupported']>
readonly useSwipe: UnwrapRef<typeof import('@vueuse/core')['useSwipe']>
readonly useTemplateRef: UnwrapRef<typeof import('vue')['useTemplateRef']>
readonly useTemplateRefsList: UnwrapRef<typeof import('@vueuse/core')['useTemplateRefsList']>
readonly useTextDirection: UnwrapRef<typeof import('@vueuse/core')['useTextDirection']>
readonly useTextSelection: UnwrapRef<typeof import('@vueuse/core')['useTextSelection']>
@@ -581,291 +598,4 @@ declare module 'vue' {
readonly watchWithFilter: UnwrapRef<typeof import('@vueuse/core')['watchWithFilter']>
readonly whenever: UnwrapRef<typeof import('@vueuse/core')['whenever']>
}
}
declare module '@vue/runtime-core' {
interface ComponentCustomProperties {
readonly EffectScope: UnwrapRef<typeof import('vue')['EffectScope']>
readonly asyncComputed: UnwrapRef<typeof import('@vueuse/core')['asyncComputed']>
readonly autoResetRef: UnwrapRef<typeof import('@vueuse/core')['autoResetRef']>
readonly computed: UnwrapRef<typeof import('vue')['computed']>
readonly computedAsync: UnwrapRef<typeof import('@vueuse/core')['computedAsync']>
readonly computedEager: UnwrapRef<typeof import('@vueuse/core')['computedEager']>
readonly computedInject: UnwrapRef<typeof import('@vueuse/core')['computedInject']>
readonly computedWithControl: UnwrapRef<typeof import('@vueuse/core')['computedWithControl']>
readonly controlledComputed: UnwrapRef<typeof import('@vueuse/core')['controlledComputed']>
readonly controlledRef: UnwrapRef<typeof import('@vueuse/core')['controlledRef']>
readonly createApp: UnwrapRef<typeof import('vue')['createApp']>
readonly createEventHook: UnwrapRef<typeof import('@vueuse/core')['createEventHook']>
readonly createGlobalState: UnwrapRef<typeof import('@vueuse/core')['createGlobalState']>
readonly createInjectionState: UnwrapRef<typeof import('@vueuse/core')['createInjectionState']>
readonly createReactiveFn: UnwrapRef<typeof import('@vueuse/core')['createReactiveFn']>
readonly createReusableTemplate: UnwrapRef<typeof import('@vueuse/core')['createReusableTemplate']>
readonly createSharedComposable: UnwrapRef<typeof import('@vueuse/core')['createSharedComposable']>
readonly createTemplatePromise: UnwrapRef<typeof import('@vueuse/core')['createTemplatePromise']>
readonly createUnrefFn: UnwrapRef<typeof import('@vueuse/core')['createUnrefFn']>
readonly customRef: UnwrapRef<typeof import('vue')['customRef']>
readonly debouncedRef: UnwrapRef<typeof import('@vueuse/core')['debouncedRef']>
readonly debouncedWatch: UnwrapRef<typeof import('@vueuse/core')['debouncedWatch']>
readonly defineAsyncComponent: UnwrapRef<typeof import('vue')['defineAsyncComponent']>
readonly defineComponent: UnwrapRef<typeof import('vue')['defineComponent']>
readonly eagerComputed: UnwrapRef<typeof import('@vueuse/core')['eagerComputed']>
readonly effectScope: UnwrapRef<typeof import('vue')['effectScope']>
readonly extendRef: UnwrapRef<typeof import('@vueuse/core')['extendRef']>
readonly getCurrentInstance: UnwrapRef<typeof import('vue')['getCurrentInstance']>
readonly getCurrentScope: UnwrapRef<typeof import('vue')['getCurrentScope']>
readonly h: UnwrapRef<typeof import('vue')['h']>
readonly ignorableWatch: UnwrapRef<typeof import('@vueuse/core')['ignorableWatch']>
readonly inject: UnwrapRef<typeof import('vue')['inject']>
readonly injectLocal: UnwrapRef<typeof import('@vueuse/core')['injectLocal']>
readonly isDefined: UnwrapRef<typeof import('@vueuse/core')['isDefined']>
readonly isProxy: UnwrapRef<typeof import('vue')['isProxy']>
readonly isReactive: UnwrapRef<typeof import('vue')['isReactive']>
readonly isReadonly: UnwrapRef<typeof import('vue')['isReadonly']>
readonly isRef: UnwrapRef<typeof import('vue')['isRef']>
readonly makeDestructurable: UnwrapRef<typeof import('@vueuse/core')['makeDestructurable']>
readonly markRaw: UnwrapRef<typeof import('vue')['markRaw']>
readonly nextTick: UnwrapRef<typeof import('vue')['nextTick']>
readonly onActivated: UnwrapRef<typeof import('vue')['onActivated']>
readonly onBeforeMount: UnwrapRef<typeof import('vue')['onBeforeMount']>
readonly onBeforeRouteLeave: UnwrapRef<typeof import('vue-router')['onBeforeRouteLeave']>
readonly onBeforeRouteUpdate: UnwrapRef<typeof import('vue-router')['onBeforeRouteUpdate']>
readonly onBeforeUnmount: UnwrapRef<typeof import('vue')['onBeforeUnmount']>
readonly onBeforeUpdate: UnwrapRef<typeof import('vue')['onBeforeUpdate']>
readonly onClickOutside: UnwrapRef<typeof import('@vueuse/core')['onClickOutside']>
readonly onDeactivated: UnwrapRef<typeof import('vue')['onDeactivated']>
readonly onErrorCaptured: UnwrapRef<typeof import('vue')['onErrorCaptured']>
readonly onKeyStroke: UnwrapRef<typeof import('@vueuse/core')['onKeyStroke']>
readonly onLongPress: UnwrapRef<typeof import('@vueuse/core')['onLongPress']>
readonly onMounted: UnwrapRef<typeof import('vue')['onMounted']>
readonly onRenderTracked: UnwrapRef<typeof import('vue')['onRenderTracked']>
readonly onRenderTriggered: UnwrapRef<typeof import('vue')['onRenderTriggered']>
readonly onScopeDispose: UnwrapRef<typeof import('vue')['onScopeDispose']>
readonly onServerPrefetch: UnwrapRef<typeof import('vue')['onServerPrefetch']>
readonly onStartTyping: UnwrapRef<typeof import('@vueuse/core')['onStartTyping']>
readonly onUnmounted: UnwrapRef<typeof import('vue')['onUnmounted']>
readonly onUpdated: UnwrapRef<typeof import('vue')['onUpdated']>
readonly pausableWatch: UnwrapRef<typeof import('@vueuse/core')['pausableWatch']>
readonly provide: UnwrapRef<typeof import('vue')['provide']>
readonly provideLocal: UnwrapRef<typeof import('@vueuse/core')['provideLocal']>
readonly reactify: UnwrapRef<typeof import('@vueuse/core')['reactify']>
readonly reactifyObject: UnwrapRef<typeof import('@vueuse/core')['reactifyObject']>
readonly reactive: UnwrapRef<typeof import('vue')['reactive']>
readonly reactiveComputed: UnwrapRef<typeof import('@vueuse/core')['reactiveComputed']>
readonly reactiveOmit: UnwrapRef<typeof import('@vueuse/core')['reactiveOmit']>
readonly reactivePick: UnwrapRef<typeof import('@vueuse/core')['reactivePick']>
readonly readonly: UnwrapRef<typeof import('vue')['readonly']>
readonly ref: UnwrapRef<typeof import('vue')['ref']>
readonly refAutoReset: UnwrapRef<typeof import('@vueuse/core')['refAutoReset']>
readonly refDebounced: UnwrapRef<typeof import('@vueuse/core')['refDebounced']>
readonly refDefault: UnwrapRef<typeof import('@vueuse/core')['refDefault']>
readonly refThrottled: UnwrapRef<typeof import('@vueuse/core')['refThrottled']>
readonly refWithControl: UnwrapRef<typeof import('@vueuse/core')['refWithControl']>
readonly resolveComponent: UnwrapRef<typeof import('vue')['resolveComponent']>
readonly resolveRef: UnwrapRef<typeof import('@vueuse/core')['resolveRef']>
readonly resolveUnref: UnwrapRef<typeof import('@vueuse/core')['resolveUnref']>
readonly shallowReactive: UnwrapRef<typeof import('vue')['shallowReactive']>
readonly shallowReadonly: UnwrapRef<typeof import('vue')['shallowReadonly']>
readonly shallowRef: UnwrapRef<typeof import('vue')['shallowRef']>
readonly syncRef: UnwrapRef<typeof import('@vueuse/core')['syncRef']>
readonly syncRefs: UnwrapRef<typeof import('@vueuse/core')['syncRefs']>
readonly templateRef: UnwrapRef<typeof import('@vueuse/core')['templateRef']>
readonly throttledRef: UnwrapRef<typeof import('@vueuse/core')['throttledRef']>
readonly throttledWatch: UnwrapRef<typeof import('@vueuse/core')['throttledWatch']>
readonly toRaw: UnwrapRef<typeof import('vue')['toRaw']>
readonly toReactive: UnwrapRef<typeof import('@vueuse/core')['toReactive']>
readonly toRef: UnwrapRef<typeof import('vue')['toRef']>
readonly toRefs: UnwrapRef<typeof import('vue')['toRefs']>
readonly toValue: UnwrapRef<typeof import('vue')['toValue']>
readonly triggerRef: UnwrapRef<typeof import('vue')['triggerRef']>
readonly tryOnBeforeMount: UnwrapRef<typeof import('@vueuse/core')['tryOnBeforeMount']>
readonly tryOnBeforeUnmount: UnwrapRef<typeof import('@vueuse/core')['tryOnBeforeUnmount']>
readonly tryOnMounted: UnwrapRef<typeof import('@vueuse/core')['tryOnMounted']>
readonly tryOnScopeDispose: UnwrapRef<typeof import('@vueuse/core')['tryOnScopeDispose']>
readonly tryOnUnmounted: UnwrapRef<typeof import('@vueuse/core')['tryOnUnmounted']>
readonly unref: UnwrapRef<typeof import('vue')['unref']>
readonly unrefElement: UnwrapRef<typeof import('@vueuse/core')['unrefElement']>
readonly until: UnwrapRef<typeof import('@vueuse/core')['until']>
readonly useActiveElement: UnwrapRef<typeof import('@vueuse/core')['useActiveElement']>
readonly useAnimate: UnwrapRef<typeof import('@vueuse/core')['useAnimate']>
readonly useArrayDifference: UnwrapRef<typeof import('@vueuse/core')['useArrayDifference']>
readonly useArrayEvery: UnwrapRef<typeof import('@vueuse/core')['useArrayEvery']>
readonly useArrayFilter: UnwrapRef<typeof import('@vueuse/core')['useArrayFilter']>
readonly useArrayFind: UnwrapRef<typeof import('@vueuse/core')['useArrayFind']>
readonly useArrayFindIndex: UnwrapRef<typeof import('@vueuse/core')['useArrayFindIndex']>
readonly useArrayFindLast: UnwrapRef<typeof import('@vueuse/core')['useArrayFindLast']>
readonly useArrayIncludes: UnwrapRef<typeof import('@vueuse/core')['useArrayIncludes']>
readonly useArrayJoin: UnwrapRef<typeof import('@vueuse/core')['useArrayJoin']>
readonly useArrayMap: UnwrapRef<typeof import('@vueuse/core')['useArrayMap']>
readonly useArrayReduce: UnwrapRef<typeof import('@vueuse/core')['useArrayReduce']>
readonly useArraySome: UnwrapRef<typeof import('@vueuse/core')['useArraySome']>
readonly useArrayUnique: UnwrapRef<typeof import('@vueuse/core')['useArrayUnique']>
readonly useAsyncQueue: UnwrapRef<typeof import('@vueuse/core')['useAsyncQueue']>
readonly useAsyncState: UnwrapRef<typeof import('@vueuse/core')['useAsyncState']>
readonly useAttrs: UnwrapRef<typeof import('vue')['useAttrs']>
readonly useBase64: UnwrapRef<typeof import('@vueuse/core')['useBase64']>
readonly useBattery: UnwrapRef<typeof import('@vueuse/core')['useBattery']>
readonly useBluetooth: UnwrapRef<typeof import('@vueuse/core')['useBluetooth']>
readonly useBreakpoints: UnwrapRef<typeof import('@vueuse/core')['useBreakpoints']>
readonly useBroadcastChannel: UnwrapRef<typeof import('@vueuse/core')['useBroadcastChannel']>
readonly useBrowserLocation: UnwrapRef<typeof import('@vueuse/core')['useBrowserLocation']>
readonly useCached: UnwrapRef<typeof import('@vueuse/core')['useCached']>
readonly useClipboard: UnwrapRef<typeof import('@vueuse/core')['useClipboard']>
readonly useClipboardItems: UnwrapRef<typeof import('@vueuse/core')['useClipboardItems']>
readonly useCloned: UnwrapRef<typeof import('@vueuse/core')['useCloned']>
readonly useColorMode: UnwrapRef<typeof import('@vueuse/core')['useColorMode']>
readonly useConfirmDialog: UnwrapRef<typeof import('@vueuse/core')['useConfirmDialog']>
readonly useCounter: UnwrapRef<typeof import('@vueuse/core')['useCounter']>
readonly useCssModule: UnwrapRef<typeof import('vue')['useCssModule']>
readonly useCssVar: UnwrapRef<typeof import('@vueuse/core')['useCssVar']>
readonly useCssVars: UnwrapRef<typeof import('vue')['useCssVars']>
readonly useCurrentElement: UnwrapRef<typeof import('@vueuse/core')['useCurrentElement']>
readonly useCycleList: UnwrapRef<typeof import('@vueuse/core')['useCycleList']>
readonly useDark: UnwrapRef<typeof import('@vueuse/core')['useDark']>
readonly useDateFormat: UnwrapRef<typeof import('@vueuse/core')['useDateFormat']>
readonly useDebounce: UnwrapRef<typeof import('@vueuse/core')['useDebounce']>
readonly useDebounceFn: UnwrapRef<typeof import('@vueuse/core')['useDebounceFn']>
readonly useDebouncedRefHistory: UnwrapRef<typeof import('@vueuse/core')['useDebouncedRefHistory']>
readonly useDeviceMotion: UnwrapRef<typeof import('@vueuse/core')['useDeviceMotion']>
readonly useDeviceOrientation: UnwrapRef<typeof import('@vueuse/core')['useDeviceOrientation']>
readonly useDevicePixelRatio: UnwrapRef<typeof import('@vueuse/core')['useDevicePixelRatio']>
readonly useDevicesList: UnwrapRef<typeof import('@vueuse/core')['useDevicesList']>
readonly useDialog: UnwrapRef<typeof import('naive-ui')['useDialog']>
readonly useDisplayMedia: UnwrapRef<typeof import('@vueuse/core')['useDisplayMedia']>
readonly useDocumentVisibility: UnwrapRef<typeof import('@vueuse/core')['useDocumentVisibility']>
readonly useDraggable: UnwrapRef<typeof import('@vueuse/core')['useDraggable']>
readonly useDropZone: UnwrapRef<typeof import('@vueuse/core')['useDropZone']>
readonly useElementBounding: UnwrapRef<typeof import('@vueuse/core')['useElementBounding']>
readonly useElementByPoint: UnwrapRef<typeof import('@vueuse/core')['useElementByPoint']>
readonly useElementHover: UnwrapRef<typeof import('@vueuse/core')['useElementHover']>
readonly useElementSize: UnwrapRef<typeof import('@vueuse/core')['useElementSize']>
readonly useElementVisibility: UnwrapRef<typeof import('@vueuse/core')['useElementVisibility']>
readonly useEventBus: UnwrapRef<typeof import('@vueuse/core')['useEventBus']>
readonly useEventListener: UnwrapRef<typeof import('@vueuse/core')['useEventListener']>
readonly useEventSource: UnwrapRef<typeof import('@vueuse/core')['useEventSource']>
readonly useEyeDropper: UnwrapRef<typeof import('@vueuse/core')['useEyeDropper']>
readonly useFavicon: UnwrapRef<typeof import('@vueuse/core')['useFavicon']>
readonly useFetch: UnwrapRef<typeof import('@vueuse/core')['useFetch']>
readonly useFileDialog: UnwrapRef<typeof import('@vueuse/core')['useFileDialog']>
readonly useFileSystemAccess: UnwrapRef<typeof import('@vueuse/core')['useFileSystemAccess']>
readonly useFocus: UnwrapRef<typeof import('@vueuse/core')['useFocus']>
readonly useFocusWithin: UnwrapRef<typeof import('@vueuse/core')['useFocusWithin']>
readonly useFps: UnwrapRef<typeof import('@vueuse/core')['useFps']>
readonly useFullscreen: UnwrapRef<typeof import('@vueuse/core')['useFullscreen']>
readonly useGamepad: UnwrapRef<typeof import('@vueuse/core')['useGamepad']>
readonly useGeolocation: UnwrapRef<typeof import('@vueuse/core')['useGeolocation']>
readonly useI18n: UnwrapRef<typeof import('vue-i18n')['useI18n']>
readonly useIdle: UnwrapRef<typeof import('@vueuse/core')['useIdle']>
readonly useImage: UnwrapRef<typeof import('@vueuse/core')['useImage']>
readonly useInfiniteScroll: UnwrapRef<typeof import('@vueuse/core')['useInfiniteScroll']>
readonly useIntersectionObserver: UnwrapRef<typeof import('@vueuse/core')['useIntersectionObserver']>
readonly useInterval: UnwrapRef<typeof import('@vueuse/core')['useInterval']>
readonly useIntervalFn: UnwrapRef<typeof import('@vueuse/core')['useIntervalFn']>
readonly useKeyModifier: UnwrapRef<typeof import('@vueuse/core')['useKeyModifier']>
readonly useLastChanged: UnwrapRef<typeof import('@vueuse/core')['useLastChanged']>
readonly useLink: UnwrapRef<typeof import('vue-router')['useLink']>
readonly useLoadingBar: UnwrapRef<typeof import('naive-ui')['useLoadingBar']>
readonly useLocalStorage: UnwrapRef<typeof import('@vueuse/core')['useLocalStorage']>
readonly useMagicKeys: UnwrapRef<typeof import('@vueuse/core')['useMagicKeys']>
readonly useManualRefHistory: UnwrapRef<typeof import('@vueuse/core')['useManualRefHistory']>
readonly useMediaControls: UnwrapRef<typeof import('@vueuse/core')['useMediaControls']>
readonly useMediaQuery: UnwrapRef<typeof import('@vueuse/core')['useMediaQuery']>
readonly useMemoize: UnwrapRef<typeof import('@vueuse/core')['useMemoize']>
readonly useMemory: UnwrapRef<typeof import('@vueuse/core')['useMemory']>
readonly useMessage: UnwrapRef<typeof import('naive-ui')['useMessage']>
readonly useMounted: UnwrapRef<typeof import('@vueuse/core')['useMounted']>
readonly useMouse: UnwrapRef<typeof import('@vueuse/core')['useMouse']>
readonly useMouseInElement: UnwrapRef<typeof import('@vueuse/core')['useMouseInElement']>
readonly useMousePressed: UnwrapRef<typeof import('@vueuse/core')['useMousePressed']>
readonly useMutationObserver: UnwrapRef<typeof import('@vueuse/core')['useMutationObserver']>
readonly useNavigatorLanguage: UnwrapRef<typeof import('@vueuse/core')['useNavigatorLanguage']>
readonly useNetwork: UnwrapRef<typeof import('@vueuse/core')['useNetwork']>
readonly useNotification: UnwrapRef<typeof import('naive-ui')['useNotification']>
readonly useNow: UnwrapRef<typeof import('@vueuse/core')['useNow']>
readonly useObjectUrl: UnwrapRef<typeof import('@vueuse/core')['useObjectUrl']>
readonly useOffsetPagination: UnwrapRef<typeof import('@vueuse/core')['useOffsetPagination']>
readonly useOnline: UnwrapRef<typeof import('@vueuse/core')['useOnline']>
readonly usePageLeave: UnwrapRef<typeof import('@vueuse/core')['usePageLeave']>
readonly useParallax: UnwrapRef<typeof import('@vueuse/core')['useParallax']>
readonly useParentElement: UnwrapRef<typeof import('@vueuse/core')['useParentElement']>
readonly usePerformanceObserver: UnwrapRef<typeof import('@vueuse/core')['usePerformanceObserver']>
readonly usePermission: UnwrapRef<typeof import('@vueuse/core')['usePermission']>
readonly usePointer: UnwrapRef<typeof import('@vueuse/core')['usePointer']>
readonly usePointerLock: UnwrapRef<typeof import('@vueuse/core')['usePointerLock']>
readonly usePointerSwipe: UnwrapRef<typeof import('@vueuse/core')['usePointerSwipe']>
readonly usePreferredColorScheme: UnwrapRef<typeof import('@vueuse/core')['usePreferredColorScheme']>
readonly usePreferredContrast: UnwrapRef<typeof import('@vueuse/core')['usePreferredContrast']>
readonly usePreferredDark: UnwrapRef<typeof import('@vueuse/core')['usePreferredDark']>
readonly usePreferredLanguages: UnwrapRef<typeof import('@vueuse/core')['usePreferredLanguages']>
readonly usePreferredReducedMotion: UnwrapRef<typeof import('@vueuse/core')['usePreferredReducedMotion']>
readonly usePrevious: UnwrapRef<typeof import('@vueuse/core')['usePrevious']>
readonly useRafFn: UnwrapRef<typeof import('@vueuse/core')['useRafFn']>
readonly useRefHistory: UnwrapRef<typeof import('@vueuse/core')['useRefHistory']>
readonly useResizeObserver: UnwrapRef<typeof import('@vueuse/core')['useResizeObserver']>
readonly useRoute: UnwrapRef<typeof import('vue-router')['useRoute']>
readonly useRouter: UnwrapRef<typeof import('vue-router')['useRouter']>
readonly useScreenOrientation: UnwrapRef<typeof import('@vueuse/core')['useScreenOrientation']>
readonly useScreenSafeArea: UnwrapRef<typeof import('@vueuse/core')['useScreenSafeArea']>
readonly useScriptTag: UnwrapRef<typeof import('@vueuse/core')['useScriptTag']>
readonly useScroll: UnwrapRef<typeof import('@vueuse/core')['useScroll']>
readonly useScrollLock: UnwrapRef<typeof import('@vueuse/core')['useScrollLock']>
readonly useSessionStorage: UnwrapRef<typeof import('@vueuse/core')['useSessionStorage']>
readonly useShare: UnwrapRef<typeof import('@vueuse/core')['useShare']>
readonly useSlots: UnwrapRef<typeof import('vue')['useSlots']>
readonly useSorted: UnwrapRef<typeof import('@vueuse/core')['useSorted']>
readonly useSpeechRecognition: UnwrapRef<typeof import('@vueuse/core')['useSpeechRecognition']>
readonly useSpeechSynthesis: UnwrapRef<typeof import('@vueuse/core')['useSpeechSynthesis']>
readonly useStepper: UnwrapRef<typeof import('@vueuse/core')['useStepper']>
readonly useStorage: UnwrapRef<typeof import('@vueuse/core')['useStorage']>
readonly useStorageAsync: UnwrapRef<typeof import('@vueuse/core')['useStorageAsync']>
readonly useStyleTag: UnwrapRef<typeof import('@vueuse/core')['useStyleTag']>
readonly useSupported: UnwrapRef<typeof import('@vueuse/core')['useSupported']>
readonly useSwipe: UnwrapRef<typeof import('@vueuse/core')['useSwipe']>
readonly useTemplateRefsList: UnwrapRef<typeof import('@vueuse/core')['useTemplateRefsList']>
readonly useTextDirection: UnwrapRef<typeof import('@vueuse/core')['useTextDirection']>
readonly useTextSelection: UnwrapRef<typeof import('@vueuse/core')['useTextSelection']>
readonly useTextareaAutosize: UnwrapRef<typeof import('@vueuse/core')['useTextareaAutosize']>
readonly useThrottle: UnwrapRef<typeof import('@vueuse/core')['useThrottle']>
readonly useThrottleFn: UnwrapRef<typeof import('@vueuse/core')['useThrottleFn']>
readonly useThrottledRefHistory: UnwrapRef<typeof import('@vueuse/core')['useThrottledRefHistory']>
readonly useTimeAgo: UnwrapRef<typeof import('@vueuse/core')['useTimeAgo']>
readonly useTimeout: UnwrapRef<typeof import('@vueuse/core')['useTimeout']>
readonly useTimeoutFn: UnwrapRef<typeof import('@vueuse/core')['useTimeoutFn']>
readonly useTimeoutPoll: UnwrapRef<typeof import('@vueuse/core')['useTimeoutPoll']>
readonly useTimestamp: UnwrapRef<typeof import('@vueuse/core')['useTimestamp']>
readonly useTitle: UnwrapRef<typeof import('@vueuse/core')['useTitle']>
readonly useToNumber: UnwrapRef<typeof import('@vueuse/core')['useToNumber']>
readonly useToString: UnwrapRef<typeof import('@vueuse/core')['useToString']>
readonly useToggle: UnwrapRef<typeof import('@vueuse/core')['useToggle']>
readonly useTransition: UnwrapRef<typeof import('@vueuse/core')['useTransition']>
readonly useUrlSearchParams: UnwrapRef<typeof import('@vueuse/core')['useUrlSearchParams']>
readonly useUserMedia: UnwrapRef<typeof import('@vueuse/core')['useUserMedia']>
readonly useVModel: UnwrapRef<typeof import('@vueuse/core')['useVModel']>
readonly useVModels: UnwrapRef<typeof import('@vueuse/core')['useVModels']>
readonly useVibrate: UnwrapRef<typeof import('@vueuse/core')['useVibrate']>
readonly useVirtualList: UnwrapRef<typeof import('@vueuse/core')['useVirtualList']>
readonly useWakeLock: UnwrapRef<typeof import('@vueuse/core')['useWakeLock']>
readonly useWebNotification: UnwrapRef<typeof import('@vueuse/core')['useWebNotification']>
readonly useWebSocket: UnwrapRef<typeof import('@vueuse/core')['useWebSocket']>
readonly useWebWorker: UnwrapRef<typeof import('@vueuse/core')['useWebWorker']>
readonly useWebWorkerFn: UnwrapRef<typeof import('@vueuse/core')['useWebWorkerFn']>
readonly useWindowFocus: UnwrapRef<typeof import('@vueuse/core')['useWindowFocus']>
readonly useWindowScroll: UnwrapRef<typeof import('@vueuse/core')['useWindowScroll']>
readonly useWindowSize: UnwrapRef<typeof import('@vueuse/core')['useWindowSize']>
readonly watch: UnwrapRef<typeof import('vue')['watch']>
readonly watchArray: UnwrapRef<typeof import('@vueuse/core')['watchArray']>
readonly watchAtMost: UnwrapRef<typeof import('@vueuse/core')['watchAtMost']>
readonly watchDebounced: UnwrapRef<typeof import('@vueuse/core')['watchDebounced']>
readonly watchDeep: UnwrapRef<typeof import('@vueuse/core')['watchDeep']>
readonly watchEffect: UnwrapRef<typeof import('vue')['watchEffect']>
readonly watchIgnorable: UnwrapRef<typeof import('@vueuse/core')['watchIgnorable']>
readonly watchImmediate: UnwrapRef<typeof import('@vueuse/core')['watchImmediate']>
readonly watchOnce: UnwrapRef<typeof import('@vueuse/core')['watchOnce']>
readonly watchPausable: UnwrapRef<typeof import('@vueuse/core')['watchPausable']>
readonly watchPostEffect: UnwrapRef<typeof import('vue')['watchPostEffect']>
readonly watchSyncEffect: UnwrapRef<typeof import('vue')['watchSyncEffect']>
readonly watchThrottled: UnwrapRef<typeof import('@vueuse/core')['watchThrottled']>
readonly watchTriggerable: UnwrapRef<typeof import('@vueuse/core')['watchTriggerable']>
readonly watchWithFilter: UnwrapRef<typeof import('@vueuse/core')['watchWithFilter']>
readonly whenever: UnwrapRef<typeof import('@vueuse/core')['whenever']>
}
}
}
+45 -55
View File
@@ -2,7 +2,7 @@
"name": "it-tools",
"type": "module",
"version": "2026.1.4",
"packageManager": "pnpm@9.15.9",
"packageManager": "pnpm@11.10.0+sha512.0b7f8b98060031904c017e3a41eb187a16d40eeb829b95c4f8cb03681761fc4ab53dd219115b9b447f4dce1a05a214764461e7d3703392a9f32f9511ce8c86c8",
"description": "Collection of handy online tools for developers, with great UX. ",
"author": "Corentin Th <corentin.thomasset74+it-tools@gmail.com> (https://corentin.tech)",
"license": "GNU GPLv3",
@@ -31,7 +31,10 @@
"test:e2e:dev": "TZ=UTC BASE_URL=http://localhost:5173 NO_WEB_SERVER=true playwright test",
"coverage": "vitest run --coverage",
"typecheck": "vue-tsc --noEmit -p tsconfig.vitest.json --composite false",
"lint": "eslint src --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --ignore-path .gitignore",
"lint": "oxlint src",
"lint:fix": "oxlint src --fix",
"fmt": "oxfmt src",
"fmt:check": "oxfmt --check src",
"script:create:tool": "node scripts/create-tool.mjs",
"script:create:ui": "hygen generator ui-component",
"release": "node ./scripts/release.mjs",
@@ -39,7 +42,7 @@
"script:extract:strings": "node ./scripts/extract-tools-strings.mjs",
"script:translate-missing": "node ./scripts/translate-missings.mjs -e ./locales/en.yml -t ./locales/*.yml",
"vue-i18n-extract": "vue-i18n-extract report --vueFiles 'src/**/*.?(ts|vue)' --languageFiles 'locales/*.yml'",
"precommit": "pnpm install --ignore-scripts && pnpm lint --fix && pnpm typecheck"
"precommit": "pnpm install --ignore-scripts && pnpm lint:fix && pnpm typecheck"
},
"dependencies": {
"@boxyhq/saml20": "^1.16.0",
@@ -87,7 +90,7 @@
"@regexper/render": "^1.0.0",
"@sindresorhus/slugify": "^3.0.0",
"@skeepit/unicode-to-gsm7": "^1.0.0",
"@tabler/icons-vue": "^3.20.0",
"@tabler/icons-vue": "^3.30.0",
"@tiptap/core": "^3.22.5",
"@tiptap/extension-color": "^3.22.5",
"@tiptap/extension-gapcursor": "^3.22.5",
@@ -107,7 +110,7 @@
"@vicons/material": "^0.12.0",
"@vicons/tabler": "^0.12.0",
"@vueuse/core": "^10.11.1",
"@vueuse/head": "^1.0.0",
"@vueuse/head": "^1.3.1",
"@vueuse/integrations": "^14.2.0",
"@vueuse/router": "^10.0.0",
"@xmldom/xmldom": "^0.8.13",
@@ -153,7 +156,7 @@
"creditcard-generator": "^0.0.7",
"cron-parser": "4.9.0",
"cron-validator": "^1.4.0",
"cronstrue": "^3.0.0",
"cronstrue": "^3.1.0",
"cross-spawn": "^7.0.6",
"crypto-js": "^4.2.0",
"csstoxpath": "^2.0.0",
@@ -190,13 +193,13 @@
"event-cron-parser": "^1.0.37",
"exif-be-gone": "^1.5.1",
"exifreader": "^4.33.1",
"fanger": "^0.3.1",
"fanger": "0.3.1",
"fast-xml-parser": "^5.7.2",
"fast_array_intersect": "^1.1.0",
"fflate": "^0.8.2",
"figlet": "^1.9.4",
"figue": "^1.2.0",
"file-type": "^21.2.0",
"file-type": "^21.3.4",
"flatten-anything": "^4.0.2",
"flexsearch": "^0.8.212",
"fuse.js": "^7.1.0",
@@ -218,7 +221,7 @@
"ibantools": "^4.5.1",
"ical-generator": "^10.0.0",
"ical.js": "^2.2.1",
"iconv-lite": "^0.7.1",
"iconv-lite": "^0.7.2",
"idb-keyval": "^6.2.2",
"image-compare-viewer": "^1.6.2",
"image-in-browser": "^3.3.0",
@@ -270,7 +273,7 @@
"long": "^5.3.2",
"lorem-ipsum-japanese": "^1.0.1",
"luhn-js": "^1.1.2",
"luxon": "^3.5.0",
"luxon": "^3.7.1",
"markdown-docx": "^1.6.0",
"markdown-it": "^14.1.1",
"markdown-it-mark": "^4.0.0",
@@ -311,7 +314,7 @@
"paseto-ts": "^2.0.5",
"path2d-polyfill": "^3.1.3",
"pdf-signature-reader": "^1.4.3",
"pdfjs-dist": "^4.8.69",
"pdfjs-dist": "^4.10.38",
"picomatch": "^4.0.5",
"pinia": "^2.0.34",
"plausible-tracker": "^0.3.9",
@@ -375,19 +378,19 @@
"units-converter": "^1.0.3",
"unixcrypt-browser": "^2.0.4",
"unpdf": "^1.4.0",
"unplugin-auto-import": "^0.16.4",
"unplugin-auto-import": "^21.0.0",
"utf8": "^3.0.0",
"uuid": "^14.0.0",
"vanilla-jsoneditor": "^3.11.0",
"vue": "^3.3.4",
"vue": "^3.5.39",
"vue-color-wheel": "^0.1.1",
"vue-i18n": "^11.4.0",
"vue-loading-overlay": "^6.0",
"vue-loading-overlay": "^6.0.6",
"vue-markdown-render": "^2.3.0",
"vue-mathjax-next": "^0.0.6",
"vue-router": "^4.1.6",
"vue-shadow-dom": "^4.2.0",
"vue-tsc": "^1.8.1",
"vue-tsc": "^3.3.6",
"vue3-flip-countdown": "^0.1.6",
"vuedraggable": "^4.1.0",
"vuex": "^4.1.0",
@@ -404,12 +407,10 @@
"yaml": "^2.8.4"
},
"devDependencies": {
"@antfu/eslint-config": "^0.41.0",
"@iconify-json/mdi": "^1.1.50",
"@intlify/unplugin-vue-i18n": "^11.0.0",
"@iconify-json/mdi": "^1.2.3",
"@intlify/unplugin-vue-i18n": "^11.2.4",
"@playwright/test": "^1.59.1",
"@rushstack/eslint-patch": "^1.2.0",
"@tsconfig/node18": "^18.2.0",
"@tsconfig/node24": "^24.0.4",
"@types/arr-diff": "^4.0.3",
"@types/bcryptjs": "^2.4.6",
"@types/big.js": "^6.2.2",
@@ -452,52 +453,41 @@
"@types/unist": "^3.0.3",
"@types/utf8": "^3.0.3",
"@types/uuid": "^10.0.0",
"@unocss/eslint-config": "^0.57.1",
"@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",
"@vue/test-utils": "^2.3.2",
"@vue/tsconfig": "^0.4.0",
"@vitejs/plugin-vue": "^6.0.7",
"@vitejs/plugin-vue-jsx": "^5.1.6",
"@vue/compiler-sfc": "^3.5.39",
"@vue/runtime-dom": "^3.5.39",
"@vue/test-utils": "^2.4.11",
"@vue/tsconfig": "^0.9.1",
"axios": "^1.16.0",
"commander": "^14.0.1",
"consola": "^3.0.2",
"consola": "^3.4.2",
"dotenv": "^17.2.3",
"eslint": "^8.47.0",
"hygen": "^6.2.11",
"jsdom": "^22.0.0",
"jsdom": "^29.1.1",
"less": "^4.2.2",
"prettier": "^3.0.0",
"oxfmt": "^0.57.0",
"oxlint": "^1.72.0",
"rollup-plugin-visualizer": "^7.0.1",
"semver": "^7.5.2",
"typescript": "~5.2.2",
"unocss": "^0.57.1",
"unocss-preset-scrollbar": "^0.2.1",
"unplugin-icons": "^0.17.0",
"unplugin-vue-components": "^0.25.0",
"unplugin-vue-markdown": "^29.1.0",
"vite": "^4.4.9",
"vite-plugin-node-polyfills": "^0.26.0",
"vite-plugin-pwa": "^1.1.0",
"semver": "^7.7.2",
"typescript": "~6.0.3",
"unocss": "^66.7.4",
"unocss-preset-scrollbar": "^4.0.0",
"unplugin-icons": "^23.0.1",
"unplugin-vue-components": "^32.1.0",
"unplugin-vue-markdown": "^32.0.0",
"vite": "^8.1.3",
"vite-plugin-node-polyfills": "^0.28.0",
"vite-plugin-pwa": "^1.3.0",
"vite-plugin-splash-screen": "^0.2.0",
"vite-plugin-wasm": "^3.6.0",
"vite-svg-loader": "^4.0.0",
"vitest": "^0.34.6",
"vite-svg-loader": "^5.1.1",
"vitest": "^4.1.9",
"vue-i18n-extract": "^2.0.7",
"workbox-window": "^7.3.0",
"workbox-build": "^7.4.1",
"workbox-window": "^7.4.1",
"zx": "^8.8.5"
},
"pnpm": {
"overrides": {
"@vueuse/shared": "13.9.0",
"xlsx": "https://cdn.sheetjs.com/xlsx-0.20.3/xlsx-0.20.3.tgz"
},
"patchedDependencies": {
"node-forge@1.4.0": "patches/node-forge@1.4.0.patch",
"esm-potrace-wasm": "patches/esm-potrace-wasm.patch",
"run-pace": "patches/run-pace.patch"
}
},
"scarfSettings": {
"enabled": false
}
+10 -9
View File
@@ -10,6 +10,9 @@ const useWebServer = process.env.NO_WEB_SERVER !== 'true';
export default defineConfig({
testDir: './src',
testMatch: /\.e2e\.(spec\.)?ts$/,
/* First paint of heavy lazy-loaded tools can exceed the 5s default on
slow CI browsers (webkit especially) */
expect: { timeout: 15_000 },
/* Run tests in files in parallel */
fullyParallel: true,
/* Fail the build on CI if you accidentally left test.only in the source code. */
@@ -53,13 +56,11 @@ export default defineConfig({
/* Run your local dev server before starting the tests */
...(useWebServer
&& {
webServer: {
command: 'npm run preview',
url: 'http://localhost:5050',
reuseExistingServer: !isCI,
},
}
),
...(useWebServer && {
webServer: {
command: 'npm run preview',
url: 'http://localhost:5050',
reuseExistingServer: !isCI,
},
}),
});
+6905 -8725
View File
File diff suppressed because it is too large. Load diff
+39
View File
@@ -0,0 +1,39 @@
# The xlsx override below intentionally points the whole graph (including
# wsemi's transitive xlsx) at the SheetJS CDN tarball, because the npm
# registry version is stale (0.18.5) and carries known vulnerabilities.
# pnpm 11 blocks URL tarballs in subdependencies by default and has no
# per-package exception, so this protection must be disabled repo-wide.
blockExoticSubdeps: false
overrides:
'@vueuse/shared': 13.9.0
# Native-only transitives of webcrack / @huggingface/transformers.
# The browser app aliases both to an empty module in vite.config.ts,
# so stub them out entirely (saves ~225 MB of node_modules).
isolated-vm: file:./stubs/empty-stub
onnxruntime-node: file:./stubs/empty-stub
elliptic: ^6.6.1
xlsx: https://cdn.sheetjs.com/xlsx-0.20.3/xlsx-0.20.3.tgz
patchedDependencies:
node-forge@1.4.0: patches/node-forge@1.4.0.patch
esm-potrace-wasm: patches/esm-potrace-wasm.patch
run-pace: patches/run-pace.patch
# pnpm 11 requires an explicit decision for every dependency build script.
# true = script is needed (native binaries / functional postinstall)
# false = script is cosmetic (funding banners) or the build is unneeded
allowBuilds:
'@scarf/scarf': false
core-js: false
es5-ext: false
esbuild: true
exifreader: false
json-editor-vue: false
msgpackr-extract: true
protobufjs: false
sharp: false
tesseract.js: false
tree-sitter: true
tree-sitter-bash: true
vue-demi: true
-1
View File
@@ -50,7 +50,6 @@
"groupName": "UnoCSS ecosystem",
"matchPackageNames": [
"unocss",
"@unocss/eslint-config",
"unocss-preset-scrollbar"
],
"matchUpdateTypes": ["major", "minor", "patch"]
-1
View File
@@ -1,3 +1,2 @@
export function readFile() {}
export function writeFile() {}
export {};
+14 -14
View File
@@ -4,27 +4,27 @@ import { useCopy } from '@/composable/copy';
import { translate as t } from '@/plugins/i18n.plugin';
const props = defineProps<{
value: string
multiline?: boolean
rows?: number | string
autosize?: boolean
readonly?: boolean
value?: string | number | boolean | null;
multiline?: boolean;
rows?: number | string;
autosize?: boolean;
readonly?: boolean;
}>();
const emit = defineEmits(['update:value']);
const value = useVModel(props, 'value', emit);
const rawValue = useVModel(props, 'value', emit);
const value = computed({
get: () => String(rawValue.value ?? ''),
set: (newValue: string) => {
rawValue.value = newValue;
},
});
const { copy, isJustCopied } = useCopy({ source: value, createToast: false });
const tooltipText = computed(() => isJustCopied.value ? t('inputCopyable.copied') : t('inputCopyable.copy'));
const tooltipText = computed(() => (isJustCopied.value ? t('inputCopyable.copied') : t('inputCopyable.copy')));
</script>
<template>
<c-input-text
v-model:value="value"
:multiline="multiline"
:rows="rows"
:autosize="autosize"
:readonly="readonly"
>
<c-input-text v-model:value="value" :multiline="multiline" :rows="rows" :autosize="autosize" :readonly="readonly">
<template #suffix>
<c-tooltip :tooltip="tooltipText">
<c-button circle variant="text" size="small" @click="copy()">
+32 -36
View File
@@ -3,17 +3,20 @@ import _ from 'lodash';
import convert, { type Unit } from 'convert';
import * as unitsconverter from 'units-converter';
const props = withDefaults(defineProps<{
supportedUnits: { [key: string]: string }
defaultUnit: string
labelWidth?: string
unitMinWidth?: string
converterType: 'convert' | 'frequency' | 'volumeFlowRate' | 'speed' | 'acceleration'
}>(), {
labelWidth: '150px',
unitMinWidth: '50px',
converterType: 'convert',
});
const props = withDefaults(
defineProps<{
supportedUnits: { [key: string]: string };
defaultUnit: string;
labelWidth?: string;
unitMinWidth?: string;
converterType?: 'convert' | 'frequency' | 'volumeFlowRate' | 'speed' | 'acceleration';
}>(),
{
labelWidth: '150px',
unitMinWidth: '50px',
converterType: 'convert',
},
);
const { supportedUnits, defaultUnit, labelWidth, unitMinWidth, converterType } = toRefs(props);
const SI_PREFIX_NAMES = [
@@ -45,19 +48,21 @@ const SI_PREFIX_NAMES = [
const SI_PREFIX_NAMES_REGEX = new RegExp(`^(${SI_PREFIX_NAMES.join('|')})`);
const units = reactive<
Record<
string,
{ title: string; unit: string; ref: number }
>
>(Object.entries(supportedUnits.value).map(([key, label]) => ({
title: label,
unit: key,
ref: 1,
})).reduce((prev, current) => ({
const units = reactive<Record<string, { title: string; unit: string; ref: number }>>(
Object.entries(supportedUnits.value)
.map(([key, label]) => ({
title: label,
unit: key,
ref: 1,
}))
.reduce(
(prev, current) => ({
...prev,
[current.unit]: current,
}), {}));
}),
{},
),
);
const excludeSIPrefixes = ref(true);
const filteredUnits = computed(() => {
@@ -65,9 +70,7 @@ const filteredUnits = computed(() => {
return Object.entries(units);
}
return Object.entries(units).filter(
([_, { title }]) => !SI_PREFIX_NAMES_REGEX.test(title),
);
return Object.entries(units).filter(([_, { title }]) => !SI_PREFIX_NAMES_REGEX.test(title));
});
function update(key: string) {
@@ -84,14 +87,12 @@ function update(key: string) {
.forEach(({ unit }) => {
try {
units[unit].ref = converter.to(unit as Unit);
}
catch (e: any) {
} catch (e: any) {
units[unit].ref = 0;
}
})
.value();
}
else {
} else {
const mapUnit = (unit: string) => {
// npm units-converter uses wrong symbol for miles per hour, so we need to fix it
if (converterType.value === 'speed' && unit === 'mi/h') {
@@ -106,8 +107,7 @@ function update(key: string) {
.forEach(({ unit }) => {
try {
units[unit].ref = converter.to(mapUnit(unit)).value;
}
catch (e: any) {
} catch (e: any) {
units[unit].ref = 0;
}
})
@@ -133,11 +133,7 @@ update(defaultUnit.value);
{{ title }}
</n-input-group-label>
<n-input-number
v-model:value="units[key].ref"
style="flex: 1"
@update:value="() => update(key)"
/>
<n-input-number v-model:value="units[key].ref" style="flex: 1" @update:value="() => update(key)" />
<n-input-group-label :style="{ minWidth: unitMinWidth }">
{{ unit }}
+20 -20
View File
@@ -1,5 +1,5 @@
import { type MaybeRef, get } from '@vueuse/core';
import { computed, ref } from 'vue';
import { type Ref, computed, ref } from 'vue';
import FlexSearch from 'flexsearch';
// Define key types to match Fuse.js format
@@ -13,20 +13,20 @@ export function useFlexSearch<Data extends Record<string, any>>({
},
limit = -1,
}: {
search: MaybeRef<string>
data: Data[]
search: MaybeRef<string>;
data: Data[];
options?: {
keys: SearchKey[]
keys: SearchKey[];
/**
* Whether to show or not show items with an empty search query. `true` won't show any items, `false` will show all items.
* @default true
*/
filterEmpty?: boolean
filterEmpty?: boolean;
/**
* Whether the results should be sorted by similarity score using the Levenshtein distance.
* @default true
*/
shouldSort?: boolean
shouldSort?: boolean;
/**
* Type of tokenization logic to use (Determines how the search logic will behave).
* @default 'forward'
@@ -34,23 +34,23 @@ export function useFlexSearch<Data extends Record<string, any>>({
*
* Note: The `'tolerant'` tokenizer option mentioned in the documentation doesn't exist anymore in the current version of FlexSearch.
*/
tokenize?: 'strict' | 'forward' | 'reverse' | 'full'
tokenize?: 'strict' | 'forward' | 'reverse' | 'full';
/**
* Resolution value for giving meaningful results when searching for partial matches.
* @default 9
* @see {@link https://github.com/nextapps-de/flexsearch?tab=readme-ov-file#resolution | FlexSearch Resolution Documentation}
*/
resolution?: number
optimize?: boolean
resolution?: number;
optimize?: boolean;
/**
* Value to determine if the cache should be used.
* If set to a number, the cache will use the number to assign that number of cache slots (No information in the documentation is provided about what a cache slot is exactly).
* @default false
* @see {@link https://github.com/nextapps-de/flexsearch?tab=readme-ov-file#auto-balanced-cache-by-popularity | FlexSearch Cache Documentation}
*/
cache?: boolean | number
}
limit?: MaybeRef<number>
cache?: boolean | number;
};
limit?: MaybeRef<number>;
}) {
// Extract options
const { keys, filterEmpty = true, shouldSort = true, tokenize = 'forward', ...indexOptions } = options;
@@ -67,7 +67,7 @@ export function useFlexSearch<Data extends Record<string, any>>({
const getItemKey = (item: Data, idx: number) => (item.id !== undefined ? item.id : idx);
// Map to store original data items by unique key
const dataMap = ref(new Map<any, Data>());
const dataMap = ref(new Map<any, Data>()) as Ref<Map<any, Data>>;
// Create separate indices for each key with weight info
const indices = normalizedKeys.map(({ name, weight }) => ({
@@ -156,7 +156,7 @@ export function useFlexSearch<Data extends Record<string, any>>({
const current = weightedResults.get(id) || { score: 0, maxWeight: 0 };
// Use the maximum weight among matching fields as the primary score
// Add a small bonus for additional field matches
const newScore = Math.max(current.score, weight * 100) + (weight * 10);
const newScore = Math.max(current.score, weight * 100) + weight * 10;
const newMaxWeight = Math.max(current.maxWeight, weight);
weightedResults.set(id, {
@@ -180,14 +180,14 @@ export function useFlexSearch<Data extends Record<string, any>>({
// If shouldn't be sorted by similarity, apply limit here and return early
if (!shouldSort) {
const limitedIds = searchLimit > 0 ? sortedIds.slice(0, searchLimit) : sortedIds;
return limitedIds
.map(id => dataMap.value.get(id))
.filter(Boolean) as Data[];
return limitedIds.map((id) => dataMap.value.get(id)).filter(Boolean) as Data[];
}
// Calculate Levenshtein distance
const levenshteinDistance = (str1: string, str2: string): number => {
const matrix = Array(str2.length + 1).fill(null).map(() => Array(str1.length + 1).fill(null));
const matrix = Array(str2.length + 1)
.fill(null)
.map(() => Array(str1.length + 1).fill(null));
for (let i = 0; i <= str1.length; i++) {
matrix[0][i] = i;
@@ -218,7 +218,7 @@ export function useFlexSearch<Data extends Record<string, any>>({
}
const distance = levenshteinDistance(str1.toLowerCase(), str2.toLowerCase());
return 1 - (distance / maxLength);
return 1 - distance / maxLength;
};
// Sort ALL results by similarity score, then apply limit at the end
@@ -260,7 +260,7 @@ export function useFlexSearch<Data extends Record<string, any>>({
}
return b!.similarity - a!.similarity;
})
.map(result => result!.item);
.map((result) => result!.item);
// Apply limit after final sorting
return searchLimit > 0 ? sortedResults.slice(0, searchLimit) : sortedResults;
+22 -32
View File
@@ -65,13 +65,13 @@ const toolFooter = computed<string>(() => {
if (footer === 'undefined') {
footer = '';
}
const npmPackages = (route.meta.npmPackages as string[] || [])
.map(
packageName => createLink(
packageName,
packageName.includes('://') ? packageName : `https://www.npmjs.com/package/${packageName}`),
);
return ((npmPackages.length > 0 ? `${t('tools.tool.layout.text.made-with-npmpackages', [npmPackages.join(', ')])}\n` : '') + footer).trim();
const npmPackages = ((route.meta.npmPackages as string[]) || []).map((packageName) =>
createLink(packageName, packageName.includes('://') ? packageName : `https://www.npmjs.com/package/${packageName}`),
);
return (
(npmPackages.length > 0 ? `${t('tools.tool.layout.text.made-with-npmpackages', [npmPackages.join(', ')])}\n` : '') +
footer
).trim();
});
const themeVars = useThemeVars();
@@ -85,24 +85,14 @@ const linkTheme = useTheme();
<div flex flex-nowrap items-center justify-between>
<n-h1>
{{ toolTitle }}
<n-tooltip
placement="right"
trigger="click"
content-class="tool-privacy-info"
>
<n-tooltip placement="right" trigger="click" content-class="tool-privacy-info">
<template #trigger>
<World
v-if="route.meta.externAccessDescription"
class="tool-privacy-icon"
/>
<DeviceDesktop
v-else
class="tool-privacy-icon"
/>
<World v-if="route.meta.externAccessDescription" class="tool-privacy-icon" />
<DeviceDesktop v-else class="tool-privacy-icon" />
</template>
<VueMarkdown
v-if="route.meta.externAccessDescription"
:source="route.meta.externAccessDescription"
:source="route.meta.externAccessDescription as string"
:options="{ linkify: true }"
/>
<template v-else>
@@ -139,7 +129,7 @@ const linkTheme = useTheme();
<style lang="less">
.tool-privacy-info {
p {
margin:0;
margin: 0;
}
a {
color: inherit !important;
@@ -151,7 +141,7 @@ const linkTheme = useTheme();
<style lang="less" scoped>
.tool-privacy-icon {
display: inline-block;
height: .6em;
height: 0.6em;
}
.tool-content {
display: flex;
@@ -164,7 +154,7 @@ const linkTheme = useTheme();
::v-deep(& > *) {
flex: 0 1 1200px;
min-width:0;
min-width: 0;
}
}
@@ -186,7 +176,7 @@ const linkTheme = useTheme();
}
.separator {
width:'100%';
width: '100%';
height: 2px;
background: rgb(161, 161, 161);
opacity: 0.2;
@@ -202,15 +192,15 @@ const linkTheme = useTheme();
}
}
.tool-footer {
opacity: 0.7;
font-size: 12px;
text-align: center;
opacity: 0.7;
font-size: 12px;
text-align: center;
::v-deep(a) {
color: v-bind('themeVars.textColor1');
font-style: italic;
}
::v-deep(a) {
color: v-bind('themeVars.textColor1');
font-style: italic;
}
}
::v-deep(.external-tool) a {
line-height: inherit;
font-family: inherit;
+7 -8
View File
@@ -9,7 +9,9 @@ const { t } = useI18n();
const toolStore = useToolStore();
const desc = t('about.text.collection-of-handy-online-tools-for-developers-with-great-ux-it-tools-is-a-free-and-open-source-collection-of-handy-online-tools-for-developers-and-people-working-in-it');
const desc = t(
'about.text.collection-of-handy-online-tools-for-developers-with-great-ux-it-tools-is-a-free-and-open-source-collection-of-handy-online-tools-for-developers-and-people-working-in-it',
);
const title = t('about.text.about-it-tools');
useHead({
title,
@@ -17,7 +19,7 @@ useHead({
{
itemprop: 'name',
content: title,
},
} as never,
{
property: 'og:title',
content: title,
@@ -33,7 +35,7 @@ useHead({
{
itemprop: 'description',
content: desc,
},
} as never,
{
property: 'og:description',
content: desc,
@@ -54,8 +56,7 @@ function importFavorites() {
try {
favoriteToolsName.value = JSON.parse(importFavoritesJson.value);
message.success(t('about.favorites-imported-successfully'));
}
catch (e: any) {
} catch (e: any) {
message.error(t('about.error-importing-favorites-e', [e]));
}
}
@@ -79,9 +80,7 @@ const favoritesJson = computed(() => JSON.stringify(favoriteToolsName.value));
</n-card>
<n-card :title="$t('about.export-favorites')" mx-auto mt-50px>
<textarea-copyable
v-model:value="favoritesJson"
/>
<textarea-copyable v-model:value="favoritesJson" />
</n-card>
<n-card :title="$t('about.alltools-title', { toolsCount: toolStore.tools.length })" mx-auto mt-50px>
+9 -9
View File
@@ -12,7 +12,9 @@ import { config } from '@/config';
const { t } = useI18n();
const toolStore = useToolStore();
const desc = t('home.page.text.collection-of-handy-online-tools-for-developers-with-great-ux-it-tools-is-a-free-and-open-source-collection-of-handy-online-tools-for-developers-and-people-working-in-it');
const desc = t(
'home.page.text.collection-of-handy-online-tools-for-developers-with-great-ux-it-tools-is-a-free-and-open-source-collection-of-handy-online-tools-for-developers-and-people-working-in-it',
);
const title = t('home.page.text.it-tools-handy-online-tools-for-developers');
useHead({
@@ -21,7 +23,7 @@ useHead({
{
itemprop: 'name',
content: title,
},
} as never,
{
property: 'og:title',
content: title,
@@ -37,7 +39,7 @@ useHead({
{
itemprop: 'description',
content: desc,
},
} as never,
{
property: 'og:description',
content: desc,
@@ -87,10 +89,7 @@ const visibleTools = computed(() => {
// Function to load next batch
function loadNextBatch() {
if (visibleToolsCount.value < toolStore.tools.length) {
visibleToolsCount.value = Math.min(
visibleToolsCount.value + TOOLS_PER_BATCH,
toolStore.tools.length,
);
visibleToolsCount.value = Math.min(visibleToolsCount.value + TOOLS_PER_BATCH, toolStore.tools.length);
}
}
@@ -136,7 +135,8 @@ onUnmounted(() => {
rel="noopener"
target="_blank"
:aria-label="$t('home.follow.githubRepository')"
>GitHub</a>
>GitHub</a
>
{{ $t('home.follow.thankYou') }}
<n-icon :component="IconHeart" />
</ColoredCard>
@@ -228,7 +228,7 @@ onUnmounted(() => {
}
100% {
opacity: 0.4;
transform: scale(1.0);
transform: scale(1);
}
}
</style>
+84 -32
View File
@@ -8,19 +8,25 @@ const { t } = useI18n();
declare global {
interface Window {
generateX25519Identity: () => {
privateKey: string
publicKey: string
}
encrypt: (publicKeys: string, message: string) => {
error?: string
output: string
}
decrypt: (privateKeys: string, message: string) => {
error?: string
output: string
}
encryptBinary: (publicKeys: string, buffer: Uint8Array) => string | Uint8Array
decryptBinary: (privateKeys: string, buffer: Uint8Array) => string | Uint8Array
privateKey: string;
publicKey: string;
};
encrypt: (
publicKeys: string,
message: string,
) => {
error?: string;
output: string;
};
decrypt: (
privateKeys: string,
message: string,
) => {
error?: string;
output: string;
};
encryptBinary: (publicKeys: string, buffer: Uint8Array) => string | Uint8Array;
decryptBinary: (privateKeys: string, buffer: Uint8Array) => string | Uint8Array;
}
}
/**
@@ -72,7 +78,7 @@ function downloadURL(data: string, fileName: string) {
}
function downloadBlob(data: Uint8Array, fileName: string) {
const blob = new Blob([data], {
const blob = new Blob([new Uint8Array(data)], {
type: 'application/octet-stream',
});
const url = window.URL.createObjectURL(blob);
@@ -91,8 +97,7 @@ function encrypt() {
const result = window.encrypt(recipients.value, message.value);
if (result.error) {
error.value = result.error;
}
else {
} else {
encryptedOutput.value = result.output;
}
}
@@ -111,8 +116,7 @@ function encryptBinary() {
const result = window.encryptBinary(recipientsBinary.value, buffer);
if (typeof result === 'string') {
error.value = result;
}
else {
} else {
downloadBlob(result, `${f.name}.age`);
}
};
@@ -127,8 +131,7 @@ function decrypt() {
const result = window.decrypt(identities.value, encryptedText.value);
if (result.error) {
error.value = result.error;
}
else {
} else {
decryptedOutput.value = result.output;
}
}
@@ -147,8 +150,7 @@ function decryptBinary() {
const result = window.decryptBinary(identitiesBinary.value, buffer);
if (typeof result === 'string') {
error.value = result;
}
else {
} else {
downloadBlob(result, f.name.replace('.age', ''));
}
};
@@ -171,10 +173,20 @@ function onDecryptFilesUploaded(uploadedFiles: File[]) {
<!-- Generate Keys -->
<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')" />
<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="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')" />
<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">
{{ t('tools.age-crypto.texts.tag-generate-keys') }}
@@ -184,13 +196,28 @@ function onDecryptFilesUploaded(uploadedFiles: File[]) {
<!-- Encrypt Text -->
<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-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="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-input
v-model:value="message"
type="textarea"
:placeholder="t('tools.age-crypto.texts.placeholder-message-to-encrypt')"
required
/>
</n-card>
<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')" />
<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">
{{ t('tools.age-crypto.texts.tag-encrypt') }}
@@ -200,7 +227,12 @@ function onDecryptFilesUploaded(uploadedFiles: File[]) {
<!-- Encrypt Binary -->
<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-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="t('tools.age-crypto.texts.title-files')" mb-1>
<c-file-upload
@@ -225,13 +257,28 @@ function onDecryptFilesUploaded(uploadedFiles: File[]) {
<!-- Decrypt Text -->
<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-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="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-input
v-model:value="encryptedText"
type="textarea"
:placeholder="t('tools.age-crypto.texts.placeholder-paste-here-encrypted-text')"
required
/>
</n-card>
<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')" />
<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">
{{ t('tools.age-crypto.texts.tag-decrypt') }}
@@ -241,7 +288,12 @@ function onDecryptFilesUploaded(uploadedFiles: File[]) {
<!-- Decrypt Binary -->
<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-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="t('tools.age-crypto.texts.title-encrypted-files')" mb-1>
<c-file-upload
@@ -11,25 +11,184 @@ const amortizationCalculator = ref(new StandardAmortizationCalculator());
const currencyDisplayNames = computed(() => new Intl.DisplayNames(locale.value, { type: 'currency' }));
const historicalCodes = ['AFA', 'FIM', 'ALK', 'ADP', 'ESP', 'FRF', 'AOK', 'AON', 'AOR', 'ARA', 'ARP', 'ARY',
'RUR', 'ATS', 'AYM', 'AZM', 'RUR', 'BYB', 'BYR', 'RUR', 'BEC', 'BEF', 'BEL', 'BOP', 'BAD', 'BRB', 'BRC',
'BRE', 'BRN', 'BRR', 'BGJ', 'BGK', 'BGL', 'BGN', 'BUK', 'HRD', 'HRK', 'HRK', 'CUC', 'ANG', 'CYP', 'CSJ',
'CSK', 'ECS', 'ECV', 'GQE', 'EEK', 'XEU', 'FIM', 'FRF', 'FRF', 'FRF', 'GEK', 'RUR', 'DDM', 'DEM', 'GHC',
'GHP', 'GRD', 'FRF', 'GNE', 'GNS', 'GWE', 'GWP', 'ITL', 'ISJ', 'IEP', 'ILP', 'ILR', 'ITL', 'RUR', 'RUR',
'LAJ', 'LVL', 'LVR', 'LSM', 'ZAL', 'LTL', 'LTT', 'LUC', 'LUF', 'LUL', 'MGF', 'MWK', 'MVQ', 'MLF', 'MTL',
'MTP', 'FRF', 'MRO', 'FRF', 'MXP', 'RUR', 'FRF', 'MZE', 'MZM', 'NLG', 'ANG', 'NIC', 'PEH', 'PEI', 'PEN',
'PES', 'PLZ', 'PTE', 'FRF', 'ROK', 'ROL', 'RON', 'RUR', 'FRF', 'FRF', 'FRF', 'ITL', 'STD', 'CSD', 'EUR',
'SLL', 'ANG', 'SKK', 'SIT', 'ZAL', 'SDG', 'RHD', 'ESA', 'ESB', 'ESP', 'SDD', 'SDP', 'SRG', 'SZL', 'CHC',
'RUR', 'TJR', 'IDR', 'TPE', 'TRL', 'TRY', 'RUR', 'TMM', 'UGS', 'UGW', 'UAK', 'SUR', 'USS', 'UYN', 'UYP',
'RUR', 'VEB', 'VEF', 'VEF', 'VEF', 'VNC', 'YDD', 'YUD', 'YUM', 'YUN', 'ZRN', 'ZRZ', 'ZMK', 'ZWC', 'ZWD',
'ZWD', 'ZWN', 'ZWR', 'ZWL', 'XFO', 'XRE', 'XFU'];
const historicalCodes = [
'AFA',
'FIM',
'ALK',
'ADP',
'ESP',
'FRF',
'AOK',
'AON',
'AOR',
'ARA',
'ARP',
'ARY',
'RUR',
'ATS',
'AYM',
'AZM',
'RUR',
'BYB',
'BYR',
'RUR',
'BEC',
'BEF',
'BEL',
'BOP',
'BAD',
'BRB',
'BRC',
'BRE',
'BRN',
'BRR',
'BGJ',
'BGK',
'BGL',
'BGN',
'BUK',
'HRD',
'HRK',
'HRK',
'CUC',
'ANG',
'CYP',
'CSJ',
'CSK',
'ECS',
'ECV',
'GQE',
'EEK',
'XEU',
'FIM',
'FRF',
'FRF',
'FRF',
'GEK',
'RUR',
'DDM',
'DEM',
'GHC',
'GHP',
'GRD',
'FRF',
'GNE',
'GNS',
'GWE',
'GWP',
'ITL',
'ISJ',
'IEP',
'ILP',
'ILR',
'ITL',
'RUR',
'RUR',
'LAJ',
'LVL',
'LVR',
'LSM',
'ZAL',
'LTL',
'LTT',
'LUC',
'LUF',
'LUL',
'MGF',
'MWK',
'MVQ',
'MLF',
'MTL',
'MTP',
'FRF',
'MRO',
'FRF',
'MXP',
'RUR',
'FRF',
'MZE',
'MZM',
'NLG',
'ANG',
'NIC',
'PEH',
'PEI',
'PEN',
'PES',
'PLZ',
'PTE',
'FRF',
'ROK',
'ROL',
'RON',
'RUR',
'FRF',
'FRF',
'FRF',
'ITL',
'STD',
'CSD',
'EUR',
'SLL',
'ANG',
'SKK',
'SIT',
'ZAL',
'SDG',
'RHD',
'ESA',
'ESB',
'ESP',
'SDD',
'SDP',
'SRG',
'SZL',
'CHC',
'RUR',
'TJR',
'IDR',
'TPE',
'TRL',
'TRY',
'RUR',
'TMM',
'UGS',
'UGW',
'UAK',
'SUR',
'USS',
'UYN',
'UYP',
'RUR',
'VEB',
'VEF',
'VEF',
'VEF',
'VNC',
'YDD',
'YUD',
'YUM',
'YUN',
'ZRN',
'ZRZ',
'ZMK',
'ZWC',
'ZWD',
'ZWD',
'ZWN',
'ZWR',
'ZWL',
'XFO',
'XRE',
'XFU',
];
const supportedCurrencies = ref(
Intl.supportedValuesOf('currency')
.filter(value => !historicalCodes.includes(value))
.map(value => ({
.filter((value) => !historicalCodes.includes(value))
.map((value) => ({
value,
label: currencyDisplayNames.value.of(value),
label: currencyDisplayNames.value.of(value) ?? value,
})),
);
@@ -151,7 +310,12 @@ function formatCurrency(num: number): string {
:validation="interestRateValidation"
/>
<c-select v-model:value="selectedCurrency" :options="supportedCurrencies" :label="t('tools.amortization-calculator.texts.label-displayed-currency')" mb-5 />
<c-select
v-model:value="selectedCurrency"
:options="supportedCurrencies"
:label="t('tools.amortization-calculator.texts.label-displayed-currency')"
mb-5
/>
</c-card>
<div v-if="allValid">
@@ -12,5 +12,5 @@ const supportedUnits = {
</script>
<template>
<UnitsConverter default-unit="deg" :supported-units="supportedUnits" label-width="150px" />
<UnitsConverter default-unit="deg" converter-type="convert" :supported-units="supportedUnits" label-width="150px" />
</template>
+318 -24
View File
@@ -1,5 +1,5 @@
<script setup lang="ts">
import figlet from 'figlet';
import figlet, { type FigletOptions, type FontName } from 'figlet';
import TextareaCopyable from '@/components/TextareaCopyable.vue';
import { languages, printToLanguage } from '@/utils/ascii-lang-utils';
import { useITStorage } from '@/composable/queryParams';
@@ -17,7 +17,7 @@ const base = import.meta.env.BASE_URL ?? '/';
figlet.defaults({ fontPath: `${base}figlet-fonts` });
const languagesOptions = languages.map(lang => ({ value: lang.id, label: lang.name }));
const languagesOptions = languages.map((lang) => ({ value: lang.id, label: lang.name }));
watchEffect(async () => {
const inputValue = input.value;
@@ -26,32 +26,319 @@ watchEffect(async () => {
const widthValue = width.value;
processing.value = true;
try {
const options: figlet.FigletOptions = {
font: fontValue as figlet.FontName,
const options: FigletOptions = {
font: fontValue as FontName,
width: widthValue,
whitespaceBreak: true,
};
const rawOutput = await (new Promise<string>((resolve, reject) =>
figlet.text(inputValue, options,
(err, text) => {
if (err) {
reject(err);
return;
}
const rawOutput = await new Promise<string>((resolve, reject) =>
figlet.text(inputValue, options, (err, text) => {
if (err) {
reject(err);
return;
}
resolve(text ?? '');
})));
resolve(text ?? '');
}),
);
output.value = printToLanguage(rawOutput, languageValue);
errored.value = false;
}
catch (e: any) {
} catch (e: any) {
errored.value = true;
}
processing.value = false;
});
const fonts = ['1Row', '3-D', '3D Diagonal', '3D-ASCII', '3x5', '4Max', '5 Line Oblique', 'AMC 3 Line', 'AMC 3 Liv1', 'AMC AAA01', 'AMC Neko', 'AMC Razor', 'AMC Razor2', 'AMC Slash', 'AMC Slider', 'AMC Thin', 'AMC Tubes', 'AMC Untitled', 'ANSI Shadow', 'ASCII New Roman', 'Acrobatic', 'Alligator', 'Alligator2', 'Alpha', 'Alphabet', 'Arrows', 'Avatar', 'B1FF', 'Banner', 'Banner3-D', 'Banner3', 'Banner4', 'Barbwire', 'Basic', 'Bear', 'Bell', 'Benjamin', 'Big Chief', 'Big Money-ne', 'Big Money-nw', 'Big Money-se', 'Big Money-sw', 'Big', 'Bigfig', 'Binary', 'Block', 'Blocks', 'Bloody', 'Bolger', 'Braced', 'Bright', 'Broadway KB', 'Broadway', 'Bubble', 'Bulbhead', 'Caligraphy', 'Caligraphy2', 'Calvin S', 'Cards', 'Catwalk', 'Chiseled', 'Chunky', 'Coinstak', 'Cola', 'Colossal', 'Computer', 'Contessa', 'Contrast', 'Cosmike', 'Crawford', 'Crawford2', 'Crazy', 'Cricket', 'Cursive', 'Cyberlarge', 'Cybermedium', 'Cybersmall', 'Cygnet', 'DANC4', 'DOS Rebel', 'DWhistled', 'Dancing Font', 'Decimal', 'Def Leppard', 'Delta Corps Priest 1', 'Diamond', 'Diet Cola', 'Digital', 'Doh', 'Doom', 'Dot Matrix', 'Double Shorts', 'Double', 'Dr Pepper', 'Efti Chess', 'Efti Font', 'Efti Italic', 'Efti Piti', 'Efti Robot', 'Efti Wall', 'Efti Water', 'Electronic', 'Elite', 'Epic', 'Fender', 'Filter', 'Fire Font-k', 'Fire Font-s', 'Flipped', 'Flower Power', 'Four Tops', 'Fraktur', 'Fun Face', 'Fun Faces', 'Fuzzy', 'Georgi16', 'Georgia11', 'Ghost', 'Ghoulish', 'Glenyn', 'Goofy', 'Gothic', 'Graceful', 'Gradient', 'Graffiti', 'Greek', 'Heart Left', 'Heart Right', 'Henry 3D', 'Hex', 'Hieroglyphs', 'Hollywood', 'Horizontal Left', 'Horizontal Right', 'ICL-1900', 'Impossible', 'Invita', 'Isometric1', 'Isometric2', 'Isometric3', 'Isometric4', 'Italic', 'Ivrit', 'JS Block Letters', 'JS Bracket Letters', 'JS Capital Curves', 'JS Cursive', 'JS Stick Letters', 'Jacky', 'Jazmine', 'Jerusalem', 'Katakana', 'Kban', 'Keyboard', 'Knob', 'Konto Slant', 'Konto', 'LCD', 'Larry 3D 2', 'Larry 3D', 'Lean', 'Letters', 'Lil Devil', 'Line Blocks', 'Linux', 'Lockergnome', 'Madrid', 'Marquee', 'Maxfour', 'Merlin1', 'Merlin2', 'Mike', 'Mini', 'Mirror', 'Mnemonic', 'Modular', 'Morse', 'Morse2', 'Moscow', 'Mshebrew210', 'Muzzle', 'NScript', 'NT Greek', 'NV Script', 'Nancyj-Fancy', 'Nancyj-Improved', 'Nancyj-Underlined', 'Nancyj', 'Nipples', 'O8', 'OS2', 'Octal', 'Ogre', 'Old Banner', 'Patorjk\'s Cheese', 'Patorjk-HeX', 'Pawp', 'Peaks Slant', 'Peaks', 'Pebbles', 'Pepper', 'Poison', 'Puffy', 'Puzzle', 'Pyramid', 'Rammstein', 'Rectangles', 'Red Phoenix', 'Relief', 'Relief2', 'Reverse', 'Roman', 'Rot13', 'Rotated', 'Rounded', 'Rowan Cap', 'Rozzo', 'Runic', 'Runyc', 'S Blood', 'SL Script', 'Santa Clara', 'Script', 'Serifcap', 'Shadow', 'Shimrod', 'Short', 'Slant Relief', 'Slant', 'Slide', 'Small Caps', 'Small Isometric1', 'Small Keyboard', 'Small Poison', 'Small Script', 'Small Shadow', 'Small Slant', 'Small Tengwar', 'Small', 'Soft', 'Speed', 'Spliff', 'Stacey', 'Stampate', 'Stampatello', 'Standard', 'Star Strips', 'Star Wars', 'Stellar', 'Stforek', 'Stick Letters', 'Stop', 'Straight', 'Stronger Than All', 'Sub-Zero', 'Swamp Land', 'Swan', 'Sweet', 'THIS', 'Tanja', 'Tengwar', 'Term', 'Test1', 'The Edge', 'Thick', 'Thin', 'Thorned', 'Three Point', 'Ticks Slant', 'Ticks', 'Tiles', 'Tinker-Toy', 'Tombstone', 'Train', 'Trek', 'Tsalagi', 'Tubular', 'Twisted', 'Two Point', 'USA Flag', 'Univers', 'Varsity', 'Wavy', 'Weird', 'Wet Letter', 'Whimsy', 'Wow'];
const fonts = [
'1Row',
'3-D',
'3D Diagonal',
'3D-ASCII',
'3x5',
'4Max',
'5 Line Oblique',
'AMC 3 Line',
'AMC 3 Liv1',
'AMC AAA01',
'AMC Neko',
'AMC Razor',
'AMC Razor2',
'AMC Slash',
'AMC Slider',
'AMC Thin',
'AMC Tubes',
'AMC Untitled',
'ANSI Shadow',
'ASCII New Roman',
'Acrobatic',
'Alligator',
'Alligator2',
'Alpha',
'Alphabet',
'Arrows',
'Avatar',
'B1FF',
'Banner',
'Banner3-D',
'Banner3',
'Banner4',
'Barbwire',
'Basic',
'Bear',
'Bell',
'Benjamin',
'Big Chief',
'Big Money-ne',
'Big Money-nw',
'Big Money-se',
'Big Money-sw',
'Big',
'Bigfig',
'Binary',
'Block',
'Blocks',
'Bloody',
'Bolger',
'Braced',
'Bright',
'Broadway KB',
'Broadway',
'Bubble',
'Bulbhead',
'Caligraphy',
'Caligraphy2',
'Calvin S',
'Cards',
'Catwalk',
'Chiseled',
'Chunky',
'Coinstak',
'Cola',
'Colossal',
'Computer',
'Contessa',
'Contrast',
'Cosmike',
'Crawford',
'Crawford2',
'Crazy',
'Cricket',
'Cursive',
'Cyberlarge',
'Cybermedium',
'Cybersmall',
'Cygnet',
'DANC4',
'DOS Rebel',
'DWhistled',
'Dancing Font',
'Decimal',
'Def Leppard',
'Delta Corps Priest 1',
'Diamond',
'Diet Cola',
'Digital',
'Doh',
'Doom',
'Dot Matrix',
'Double Shorts',
'Double',
'Dr Pepper',
'Efti Chess',
'Efti Font',
'Efti Italic',
'Efti Piti',
'Efti Robot',
'Efti Wall',
'Efti Water',
'Electronic',
'Elite',
'Epic',
'Fender',
'Filter',
'Fire Font-k',
'Fire Font-s',
'Flipped',
'Flower Power',
'Four Tops',
'Fraktur',
'Fun Face',
'Fun Faces',
'Fuzzy',
'Georgi16',
'Georgia11',
'Ghost',
'Ghoulish',
'Glenyn',
'Goofy',
'Gothic',
'Graceful',
'Gradient',
'Graffiti',
'Greek',
'Heart Left',
'Heart Right',
'Henry 3D',
'Hex',
'Hieroglyphs',
'Hollywood',
'Horizontal Left',
'Horizontal Right',
'ICL-1900',
'Impossible',
'Invita',
'Isometric1',
'Isometric2',
'Isometric3',
'Isometric4',
'Italic',
'Ivrit',
'JS Block Letters',
'JS Bracket Letters',
'JS Capital Curves',
'JS Cursive',
'JS Stick Letters',
'Jacky',
'Jazmine',
'Jerusalem',
'Katakana',
'Kban',
'Keyboard',
'Knob',
'Konto Slant',
'Konto',
'LCD',
'Larry 3D 2',
'Larry 3D',
'Lean',
'Letters',
'Lil Devil',
'Line Blocks',
'Linux',
'Lockergnome',
'Madrid',
'Marquee',
'Maxfour',
'Merlin1',
'Merlin2',
'Mike',
'Mini',
'Mirror',
'Mnemonic',
'Modular',
'Morse',
'Morse2',
'Moscow',
'Mshebrew210',
'Muzzle',
'NScript',
'NT Greek',
'NV Script',
'Nancyj-Fancy',
'Nancyj-Improved',
'Nancyj-Underlined',
'Nancyj',
'Nipples',
'O8',
'OS2',
'Octal',
'Ogre',
'Old Banner',
"Patorjk's Cheese",
'Patorjk-HeX',
'Pawp',
'Peaks Slant',
'Peaks',
'Pebbles',
'Pepper',
'Poison',
'Puffy',
'Puzzle',
'Pyramid',
'Rammstein',
'Rectangles',
'Red Phoenix',
'Relief',
'Relief2',
'Reverse',
'Roman',
'Rot13',
'Rotated',
'Rounded',
'Rowan Cap',
'Rozzo',
'Runic',
'Runyc',
'S Blood',
'SL Script',
'Santa Clara',
'Script',
'Serifcap',
'Shadow',
'Shimrod',
'Short',
'Slant Relief',
'Slant',
'Slide',
'Small Caps',
'Small Isometric1',
'Small Keyboard',
'Small Poison',
'Small Script',
'Small Shadow',
'Small Slant',
'Small Tengwar',
'Small',
'Soft',
'Speed',
'Spliff',
'Stacey',
'Stampate',
'Stampatello',
'Standard',
'Star Strips',
'Star Wars',
'Stellar',
'Stforek',
'Stick Letters',
'Stop',
'Straight',
'Stronger Than All',
'Sub-Zero',
'Swamp Land',
'Swan',
'Sweet',
'THIS',
'Tanja',
'Tengwar',
'Term',
'Test1',
'The Edge',
'Thick',
'Thin',
'Thorned',
'Three Point',
'Ticks Slant',
'Ticks',
'Tiles',
'Tinker-Toy',
'Tombstone',
'Train',
'Trek',
'Tsalagi',
'Tubular',
'Twisted',
'Two Point',
'USA Flag',
'Univers',
'Varsity',
'Wavy',
'Weird',
'Wet Letter',
'Whimsy',
'Wow',
];
</script>
<template>
@@ -75,13 +362,24 @@ const fonts = ['1Row', '3-D', '3D Diagonal', '3D-ASCII', '3x5', '4Max', '5 Line
label-position="top"
:label="t('tools.ascii-text-drawer.font')"
:options="fonts"
searchable="true"
searchable
: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-i18n 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
:label="t('tools.ascii-text-drawer.width')"
label-placement="top"
label-width="100"
:show-feedback="false"
>
<n-input-number-i18n
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>
@@ -98,11 +396,7 @@ const fonts = ['1Row', '3-D', '3D Diagonal', '3D-ASCII', '3x5', '4Max', '5 Line
</c-alert>
<n-form-item v-if="!processing && !errored" :label="t('tools.ascii-text-drawer.output')">
<TextareaCopyable
:value="output"
mb-1 mt-1
copy-placement="outside"
/>
<TextareaCopyable :value="output" mb-1 mt-1 copy-placement="outside" />
</n-form-item>
</c-card>
</template>
+2 -2
View File
@@ -21,7 +21,7 @@ function checkProgressAndGetResult<T>(updates: Update<T>[]) {
const last = updates.at(-1);
const allExceptLast = updates.slice(0, -1);
expect(allExceptLast.every(x => x.kind === 'progress')).toBeTruthy();
expect(allExceptLast.every((x) => x.kind === 'progress')).toBeTruthy();
expect(first).toEqual({ kind: 'progress', progress: 0 });
expect(penultimate).toEqual({ kind: 'progress', progress: 1 });
@@ -31,7 +31,7 @@ function checkProgressAndGetResult<T>(updates: Update<T>[]) {
}
describe('bcrypt models', () => {
describe(bcryptWithProgressUpdates.name, () => {
describe('bcryptWithProgressUpdates', () => {
test('with bcrypt hash function', async () => {
const updates = await fromAsync(bcryptWithProgressUpdates(hash, ['abc', 5]));
const result = checkProgressAndGetResult(updates);
+69 -49
View File
@@ -24,11 +24,11 @@ const encodeError = ref('');
const bechOutput = ref('');
interface DecodedRow {
input: string
hrp: string
variant: string
hex: string
status: string
input: string;
hrp: string;
variant: string;
hex: string;
status: string;
}
// Batch state
@@ -37,7 +37,10 @@ const batchRows = ref<DecodedRow[]>([]);
// Helpers
function wordsToHex(words: number[]): string {
return bech32.fromWords(words).map(b => b.toString(16).padStart(2, '0')).join('');
return bech32
.fromWords(words)
.map((b) => b.toString(16).padStart(2, '0'))
.join('');
}
function hexToWords(hex: string): number[] {
@@ -46,15 +49,14 @@ function hexToWords(hex: string): number[] {
throw new Error(t('tools.bech32.texts.invalid-hex-payload'));
}
return bech32.toWords(clean.match(/.{2}/g)!.map(b => Number.parseInt(b, 16)));
return bech32.toWords(clean.match(/.{2}/g)!.map((b) => Number.parseInt(b, 16)));
}
function detectVariant(input: string) {
try {
const r = bech32.decode(input);
return { variant: 'bech32', ...r };
}
catch {}
} catch {}
const r = bech32m.decode(input);
return { variant: 'bech32m', ...r };
}
@@ -79,8 +81,7 @@ function decode() {
decodedHex.value = wordsToHex(res.words);
detectedVariant.value = res.variant;
checksumValid.value = true;
}
catch (err: any) {
} catch (err: any) {
checksumValid.value = false;
decodeError.value = err.toString();
}
@@ -91,15 +92,16 @@ function validateChecksum() {
const input = bechInput.value.trim();
try {
autoDetect.value
? detectVariant(input)
: encodingVariant.value === 'bech32'
? bech32.decode(input)
: bech32m.decode(input);
if (autoDetect.value) {
detectVariant(input);
} else if (encodingVariant.value === 'bech32') {
bech32.decode(input);
} else {
bech32m.decode(input);
}
checksumValid.value = true;
}
catch (err: any) {
} catch (err: any) {
checksumValid.value = false;
decodeError.value = err.toString();
}
@@ -108,14 +110,10 @@ function validateChecksum() {
function encode() {
try {
const words = hexToWords(hexPayload.value);
const enc
= encodingVariant.value === 'bech32'
? bech32.encode(hrp.value, words)
: bech32m.encode(hrp.value, words);
const enc = encodingVariant.value === 'bech32' ? bech32.encode(hrp.value, words) : bech32m.encode(hrp.value, words);
bechOutput.value = enc;
}
catch (err: any) {
} catch (err: any) {
encodeError.value = err.toString();
}
}
@@ -123,7 +121,7 @@ function encode() {
function batchConvert() {
const lines = batchInput.value
.split('\n')
.map(l => l.trim())
.map((l) => l.trim())
.filter(Boolean);
const rows: DecodedRow[] = [];
@@ -138,8 +136,7 @@ function batchConvert() {
hex: wordsToHex(r.words),
status: 'OK',
});
}
catch (err: any) {
} catch (err: any) {
rows.push({
input: line,
hrp: '',
@@ -165,18 +162,9 @@ function exportCsv() {
t('tools.bech32.texts.hex'),
t('tools.bech32.texts.status'),
];
const rows = batchRows.value.map(r => [
r.input,
r.hrp,
r.variant,
r.hex,
r.status,
]);
const rows = batchRows.value.map((r) => [r.input, r.hrp, r.variant, r.hex, r.status]);
const csv
= `${header.join(',')
}\n${
rows.map(r => r.map(v => `"${v}"`).join(',')).join('\n')}`;
const csv = `${header.join(',')}\n${rows.map((r) => r.map((v) => `"${v}"`).join(',')).join('\n')}`;
const blob = new Blob([csv], { type: 'text/csv;charset=utf-8;' });
const url = URL.createObjectURL(blob);
@@ -234,10 +222,7 @@ function exportCsv() {
</n-space>
<n-space justify="center" mb-2>
<n-button
type="primary"
@click="checksumOnly ? validateChecksum() : decode()"
>
<n-button type="primary" @click="checksumOnly ? validateChecksum() : decode()">
{{ checksumOnly ? 'Validate' : 'Decode' }}
</n-button>
</n-space>
@@ -254,18 +239,47 @@ function exportCsv() {
</c-alert>
<div v-if="decodedHex">
<input-copyable v-model:value="decodedHrp" label-width="110px" label-position="left" :label="t('tools.bech32.texts.label-hrp')" readonly :placeholder="t('tools.bech32.texts.placeholder-hrp')" />
<input-copyable v-model:value="decodedHex" label-width="110px" label-position="left" :label="t('tools.bech32.texts.label-payload')" readonly :placeholder="t('tools.bech32.texts.placeholder-hex-payload')" />
<input-copyable v-model:value="detectedVariant" label-width="110px" label-position="left" :label="t('tools.bech32.texts.label-variant')" readonly :placeholder="t('tools.bech32.texts.placeholder-variant')" />
<input-copyable
v-model:value="decodedHrp"
label-width="110px"
label-position="left"
:label="t('tools.bech32.texts.label-hrp')"
readonly
:placeholder="t('tools.bech32.texts.placeholder-hrp')"
/>
<input-copyable
v-model:value="decodedHex"
label-width="110px"
label-position="left"
:label="t('tools.bech32.texts.label-payload')"
readonly
:placeholder="t('tools.bech32.texts.placeholder-hex-payload')"
/>
<input-copyable
v-model:value="detectedVariant"
label-width="110px"
label-position="left"
:label="t('tools.bech32.texts.label-variant')"
readonly
:placeholder="t('tools.bech32.texts.placeholder-variant')"
/>
</div>
</n-tab-pane>
<!-- ENCODE TAB -->
<n-tab-pane name="encode" :tab="t('tools.bech32.texts.tab-encode')">
<c-input-text v-model:value="hrp" label-position="left" :label="t('tools.bech32.texts.label-hrp')" label-width="110px" :placeholder="t('tools.bech32.texts.placeholder-hrp')" mb-1 />
<c-input-text
v-model:value="hrp"
label-position="left"
:label="t('tools.bech32.texts.label-hrp')"
label-width="110px"
:placeholder="t('tools.bech32.texts.placeholder-hrp')"
mb-1
/>
<c-input-text
v-model:value="hexPayload"
label-position="left" label-width="110px"
label-position="left"
label-width="110px"
:label="t('tools.bech32.texts.label-payload')"
:placeholder="t('tools.bech32.texts.placeholder-hex-payload')"
mb-1
@@ -273,7 +287,8 @@ function exportCsv() {
<c-select
v-model:value="encodingVariant"
label-position="left" label-width="110px"
label-position="left"
label-width="110px"
:label="t('tools.bech32.texts.label-variant')"
:options="[
{ label: t('tools.bech32.texts.label-bech32'), value: 'bech32' },
@@ -293,7 +308,12 @@ function exportCsv() {
</c-alert>
<div v-else>
<input-copyable v-model:value="bechOutput" :label="t('tools.bech32.texts.label-encoded-bech32-string')" readonly :placeholder="t('tools.bech32.texts.placeholder-bech32-string')" />
<input-copyable
v-model:value="bechOutput"
:label="t('tools.bech32.texts.label-encoded-bech32-string')"
readonly
:placeholder="t('tools.bech32.texts.placeholder-bech32-string')"
/>
</div>
</n-tab-pane>
+31 -24
View File
@@ -23,13 +23,17 @@ import { useValidation } from '@/composable/validation';
const { t } = useI18n();
const cleaningRegex = useQueryParamOrStorage({ name: 'clean', storageName: 'case-conv:cl', defaultValue: '[^\\w\\d\\s]' });
const cleaningRegex = useQueryParamOrStorage({
name: 'clean',
storageName: 'case-conv:cl',
defaultValue: '[^\\w\\d\\s]',
});
const cleaningRegexValidation = useValidation({
source: cleaningRegex,
rules: [
{
message: t('tools.case-converter.texts.message-invalid-cleaning-regex-0'),
validator: value => new RegExp(value),
validator: (value) => new RegExp(value),
getErrorMessage: (value) => {
const _ = new RegExp(value);
return '';
@@ -49,74 +53,76 @@ const inputCleaned = computed(() => {
const formats = computed(() => [
{
label: t('tools.case-converter.texts.label-lowercase'),
value: inputCleaned.value.map(s => s.toLocaleLowerCase()),
value: inputCleaned.value.map((s) => s.toLocaleLowerCase()),
},
{
label: t('tools.case-converter.texts.label-uppercase'),
value: inputCleaned.value.map(s => s.toLocaleUpperCase()),
value: inputCleaned.value.map((s) => s.toLocaleUpperCase()),
},
{
label: t('tools.case-converter.texts.label-camelcase'),
value: inputCleaned.value.map(s => camelCase(s)),
value: inputCleaned.value.map((s) => camelCase(s)),
},
{
label: t('tools.case-converter.texts.label-titlecase'),
value: inputCleaned.value.map(s => titleCase(s)),
value: inputCleaned.value.map((s) => titleCase(s)),
},
{
label: t('tools.case-converter.texts.label-capitalcase'),
value: inputCleaned.value.map(s => capitalCase(s)),
value: inputCleaned.value.map((s) => capitalCase(s)),
},
{
label: t('tools.case-converter.texts.label-constantcase'),
value: inputCleaned.value.map(s => constantCase(s)),
value: inputCleaned.value.map((s) => constantCase(s)),
},
{
label: t('tools.case-converter.texts.label-dotcase'),
value: inputCleaned.value.map(s => dotCase(s)),
value: inputCleaned.value.map((s) => dotCase(s)),
},
{
label: t('tools.case-converter.texts.label-kebab-paramcase'),
value: inputCleaned.value.map(s => kebabCase(s)),
value: inputCleaned.value.map((s) => kebabCase(s)),
},
{
label: t('tools.case-converter.texts.label-nocase'),
value: inputCleaned.value.map(s => noCase(s)),
value: inputCleaned.value.map((s) => noCase(s)),
},
{
label: t('tools.case-converter.texts.label-train-headercase'),
value: inputCleaned.value.map(s => trainCase(s)),
value: inputCleaned.value.map((s) => trainCase(s)),
},
{
label: t('tools.case-converter.texts.label-pascalcase'),
value: inputCleaned.value.map(s => pascalCase(s)),
value: inputCleaned.value.map((s) => pascalCase(s)),
},
{
label: t('tools.case-converter.texts.label-pathcase'),
value: inputCleaned.value.map(s => pathCase(s)),
value: inputCleaned.value.map((s) => pathCase(s)),
},
{
label: t('tools.case-converter.texts.label-sentencecase'),
value: inputCleaned.value.map(s => sentenceCase(s)),
value: inputCleaned.value.map((s) => sentenceCase(s)),
},
{
label: t('tools.case-converter.texts.label-snakecase'),
value: inputCleaned.value.map(s => snakeCase(s)),
value: inputCleaned.value.map((s) => snakeCase(s)),
},
{
label: t('tools.case-converter.texts.label-mockingcase'),
value: inputCleaned.value.map(s => s
.split('')
.map((char, index) => (index % 2 === 0 ? char.toUpperCase() : char.toLowerCase()))
.join('')),
value: inputCleaned.value.map((s) =>
s
.split('')
.map((char, index) => (index % 2 === 0 ? char.toUpperCase() : char.toLowerCase()))
.join(''),
),
},
{
label: t('tools.case-converter.texts.label-spongecase'),
value: inputCleaned.value.map(s => spongeCase(s)),
value: inputCleaned.value.map((s) => spongeCase(s)),
},
{
label: t('tools.case-converter.texts.label-swapcase'),
value: inputCleaned.value.map(s => swapCase(s)),
value: inputCleaned.value.map((s) => swapCase(s)),
},
]);
@@ -124,7 +130,7 @@ const inputLabelAlignmentConfig = {
labelPosition: 'left',
labelWidth: '125px',
labelAlign: 'right',
};
} as const;
</script>
<template>
@@ -156,7 +162,8 @@ const inputLabelAlignmentConfig = {
:value="format.value?.join('\n')"
:label="format.label"
v-bind="inputLabelAlignmentConfig"
multiline mb-1
multiline
mb-1
/>
</c-card>
</template>
@@ -1,10 +1,4 @@
import type {
AlgorithmHashType,
Certificate,
Fingerprint,
Key,
PrivateKey, Signature,
} from 'sshpk';
import type { AlgorithmHashType, Certificate, Fingerprint, Key, PrivateKey, Signature } from 'sshpk';
import 'webcrypto-liner-shim';
import type * as openpgp from 'openpgp';
import * as forge from 'node-forge';
@@ -13,24 +7,22 @@ import oids from './oids.json';
import { translate as t } from '@/plugins/i18n.plugin';
export interface LabelValue {
label: string
value: string
multiline?: boolean
label: string;
value: string;
multiline?: boolean;
}
function onErrorReturnErrorMessage(func: () => any) {
try {
return func();
}
catch (e: any) {
} catch (e: any) {
return e.toString();
}
}
function buf2Hex(buffer: ArrayBuffer) { // buffer is an ArrayBuffer
return [...new Uint8Array(buffer)]
.map(x => x.toString(16).padStart(2, '0'))
.join('');
function buf2Hex(buffer: ArrayBuffer | Uint8Array) {
// buffer is an ArrayBuffer
return [...new Uint8Array(buffer)].map((x) => x.toString(16).padStart(2, '0')).join('');
}
export function getPublicKeyLabelValues(publicKey: Key) {
@@ -123,7 +115,7 @@ export function getCertificateLabelValues(cert: Certificate, forgeCertificate: f
},
{
label: t('tools.certificate-key-parser.texts.label-subjects'),
value: cert.subjects?.map(s => s.toString()).join('\n'),
value: cert.subjects?.map((s) => s.toString()).join('\n'),
multiline: true,
},
{
@@ -176,38 +168,43 @@ export function getCertificateLabelValues(cert: Certificate, forgeCertificate: f
},
{
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],
critical: (<any>ext).critical,
data: ext.data?.toString('hex') || (<any>ext).bits?.toString('hex'),
})), null, 2),
value: JSON.stringify(
cert.getExtensions().map((ext) => ({
oid: (<any>ext).oid,
name: (<any>ext).name || (<any>oids)[(<any>ext).oid],
critical: (<any>ext).critical,
data: ext.data?.toString('hex') || (<any>ext).bits?.toString('hex'),
})),
null,
2,
),
multiline: true,
},
{
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],
...ext,
})), null, 2),
value: JSON.stringify(
forgeCertificate?.extensions.map((ext) => ({
id: (<any>ext).id,
name: (<any>ext).id || (<any>oids)[(<any>ext).id],
...ext,
})),
null,
2,
),
multiline: true,
},
...['sha1', 'sha256', 'sha512'].flatMap(algorithm =>
[
{
label: `Fingerprint (${algorithm}):`,
value: onErrorReturnErrorMessage(() => cert.fingerprint(algorithm as AlgorithmHashType)),
multiline: true,
},
{
label: `Fingerprint HEX (${algorithm}):`,
value: onErrorReturnErrorMessage(() => cert.fingerprint(algorithm as AlgorithmHashType).toString('hex')),
multiline: true,
},
],
),
...['sha1', 'sha256', 'sha512'].flatMap((algorithm) => [
{
label: `Fingerprint (${algorithm}):`,
value: onErrorReturnErrorMessage(() => cert.fingerprint(algorithm as AlgorithmHashType)),
multiline: true,
},
{
label: `Fingerprint HEX (${algorithm}):`,
value: onErrorReturnErrorMessage(() => cert.fingerprint(algorithm as AlgorithmHashType).toString('hex')),
multiline: true,
},
]),
{
label: t('tools.certificate-key-parser.texts.label-certificate-pem'),
value: onErrorReturnErrorMessage(() => cert.toString('pem')),
@@ -244,7 +241,10 @@ export async function getPGPPublicKeyLabelValuesAsync(pgpPublicKey: openpgp.Key)
},
{
label: t('tools.certificate-key-parser.texts.label-key-id-s'),
value: pgpPublicKey.getKeyIDs().map(k => k.toHex()).join(' ; '),
value: pgpPublicKey
.getKeyIDs()
.map((k) => k.toHex())
.join(' ; '),
},
] as LabelValue[];
}
@@ -277,7 +277,10 @@ export async function getPGPPrivateKeyLabelValuesAsync(pgpPrivateKey: openpgp.Ke
},
{
label: t('tools.certificate-key-parser.texts.label-key-id-s'),
value: pgpPrivateKey.getKeyIDs().map(k => k.toHex()).join(' ; '),
value: pgpPrivateKey
.getKeyIDs()
.map((k) => k.toHex())
.join(' ; '),
},
] as LabelValue[];
}
@@ -290,7 +293,7 @@ export function getCSRLabelValues(csr: forge.pki.CertificateSigningRequest) {
},
{
label: t('tools.certificate-key-parser.texts.label-subject'),
value: csr.subject?.attributes?.map(a => JSON.stringify(a, null, 2)).join('\n'),
value: csr.subject?.attributes?.map((a) => JSON.stringify(a, null, 2)).join('\n'),
multiline: true,
},
// {
+20 -11
View File
@@ -10,12 +10,23 @@ import { useQueryParamOrStorage } from '@/composable/queryParams';
const { t } = useI18n();
const baseRange = useQueryParamOrStorage({ name: 'range', storageName: 'cidr-in-cidr:range', defaultValue: '192.168.0.1/24' }); // NOSONAR
const ipOrRangeToTest = useQueryParamOrStorage({ name: 'ip', storageName: 'cidr-in-cidr:ip', defaultValue: '192.168.0.1' }); // NOSONAR
const baseRange = useQueryParamOrStorage({
name: 'range',
storageName: 'cidr-in-cidr:range',
defaultValue: '192.168.0.1/24',
}); // NOSONAR
const ipOrRangeToTest = useQueryParamOrStorage({
name: 'ip',
storageName: 'cidr-in-cidr:ip',
defaultValue: '192.168.0.1',
}); // NOSONAR
const matchResult = computed(() => withDefaultOnError(
() => cidrInCidr({ baseRange: baseRange.value, ipOrRangeToTest: ipOrRangeToTest.value }),
{ baseSubnets: [], isIncluded: false }));
const matchResult = computed(() =>
withDefaultOnError(() => cidrInCidr({ baseRange: baseRange.value, ipOrRangeToTest: ipOrRangeToTest.value }), {
baseSubnets: [],
isIncluded: false,
}),
);
const rangeValidationRules = [
{
@@ -47,13 +58,11 @@ const rangeValidationRules = [
<div flex justify-center>
<span v-if="matchResult.isIncluded">
<n-icon color="green">
<CheckIcon />
</n-icon>{{ t('tools.cidr-in-cidr.texts.tag-included') }}</span>
<n-icon color="green"> <CheckIcon /> </n-icon>{{ t('tools.cidr-in-cidr.texts.tag-included') }}</span
>
<span v-else>
<n-icon color="red">
<CrossIcon />
</n-icon>{{ t('tools.cidr-in-cidr.texts.tag-not-included') }}</span>
<n-icon color="red"> <CrossIcon /> </n-icon>{{ t('tools.cidr-in-cidr.texts.tag-not-included') }}</span
>
</div>
<n-divider />
@@ -10,22 +10,22 @@ const citationData = ref({
authors: [''],
title: '',
publisher: '',
year: '',
year: null as number | null,
url: '',
});
const style = ref('apa');
const formattedCitation = computed(() => {
try {
const authors = citationData.value.authors.filter(a => a.trim() !== '').map((a) => {
const [first, last] = a.split(/,\s*/, 2);
return { first, last };
});
if (!citationData.value.title
|| !citationData.value.publisher
|| !citationData.value.year
|| !authors.length
) { return '### Please fill Title, Publisher, Year and authors'; }
const authors = citationData.value.authors
.filter((a) => a.trim() !== '')
.map((a) => {
const [first, last] = a.split(/,\s*/, 2);
return { first, last };
});
if (!citationData.value.title || !citationData.value.publisher || !citationData.value.year || !authors.length) {
return '### Please fill Title, Publisher, Year and authors';
}
const citationInData = {
authors,
@@ -38,20 +38,20 @@ const formattedCitation = computed(() => {
if (style.value === 'vancouver') {
return formatVancouverCitation(citationInData);
}
return (style.value === 'apa' ? APA : MLA)([
citationInData,
]);
}
catch (e: any) {
return (style.value === 'apa' ? APA : MLA)([citationInData]);
} catch (e: any) {
return e.toString();
}
});
</script>
<template>
<n-card :title="t('tools.citation-generator.texts.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="t('tools.citation-generator.texts.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="t('tools.citation-generator.texts.placeholder-enter-author-name')"
@@ -59,19 +59,34 @@ const formattedCitation = computed(() => {
</n-form-item>
<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-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="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-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="t('tools.citation-generator.texts.label-publication-year')">
<n-input-number-i18n v-model:value="citationData.year" :min="0" :status="citationData.year ? 'success' : 'error'" />
<n-input-number-i18n
v-model:value="citationData.year"
:min="0"
:status="citationData.year ? 'success' : 'error'"
/>
</n-form-item>
<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-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="t('tools.citation-generator.texts.label-citation-style')">
@@ -38,14 +38,13 @@ const result = computed(() => {
aaaNormal: wcag(bgHex, fgHex, { level: 'AAA', size: 'normal' }).pass,
aaLarge: wcag(bgHex, fgHex, { level: 'AA', size: 'large' }).pass,
aaaLarge: wcag(bgHex, fgHex, { level: 'AAA', size: 'large' }).pass,
level: levels.find(l => wcagLevel < l.score),
largeLevel: largeLevels.find(l => wcagLevel < l.score),
smallLevel: smallLevels.find(l => wcagLevel < l.score),
level: levels.find((l) => wcagLevel < l.score),
largeLevel: largeLevels.find((l) => wcagLevel < l.score),
smallLevel: smallLevels.find((l) => wcagLevel < l.score),
apcaContrastValue: apcaContrastValue(bgHex, fgHex),
error: '',
};
}
catch (e: any) {
} catch (e: any) {
return {
error: e.toString(),
};
@@ -55,27 +54,11 @@ const result = computed(() => {
<template>
<div max-w-600px>
<n-form-item
:label="t('tools.color-contrast-checker.texts.label-forecolor')"
label-placement="left"
mb-1
>
<n-color-picker
v-model:value="forecolor"
:modes="['hex']"
:show-alpha="false"
/>
<n-form-item :label="t('tools.color-contrast-checker.texts.label-forecolor')" label-placement="left" mb-1>
<n-color-picker v-model:value="forecolor" :modes="['hex']" :show-alpha="false" />
</n-form-item>
<n-form-item
:label="t('tools.color-contrast-checker.texts.label-backcolor')"
label-placement="left"
mb-1
>
<n-color-picker
v-model:value="backcolor"
:modes="['hex']"
:show-alpha="false"
/>
<n-form-item :label="t('tools.color-contrast-checker.texts.label-backcolor')" label-placement="left" mb-1>
<n-color-picker v-model:value="backcolor" :modes="['hex']" :show-alpha="false" />
</n-form-item>
<n-divider />
@@ -85,47 +68,99 @@ const result = computed(() => {
</c-alert>
<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 />
<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="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>
<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>
<n-tag :max="5" :color="{ color: result.level.bg, textColor: result.level.fg, borderColor: result.level.fg }">
<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="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-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="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-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="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-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="t('tools.color-contrast-checker.texts.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="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-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="t('tools.color-contrast-checker.texts.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>
@@ -134,7 +169,14 @@ const result = computed(() => {
</c-card>
<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 />
<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>
+23 -29
View File
@@ -7,10 +7,10 @@ import { useQueryParam } from '@/composable/queryParams';
const { t } = useI18n();
interface CountDown {
d: number
h: number
m: number
s: number
d: number;
h: number;
m: number;
s: number;
}
function getCountDownHref(c: CountDown) {
@@ -40,12 +40,7 @@ watchEffect(() => {
const now = ref(moment());
const deadlineDate = computed(() => {
return now.value
.add(days.value, 'd')
.add(hours.value, 'h')
.add(minutes.value, 'm')
.add(seconds.value, 's')
.toDate();
return now.value.add(days.value, 'd').add(hours.value, 'h').add(minutes.value, 'm').add(seconds.value, 's').toDate();
});
const fmt = 'YYYY-MM-DD HH:mm:ss';
const deadlineFormatted = computed(() => {
@@ -61,7 +56,11 @@ function start() {
now.value = moment();
status.value = 'running';
const histoEntry = { d: days.value, h: hours.value, m: minutes.value, s: seconds.value };
if (!history.value.find(h => h.d === histoEntry.d && h.h === histoEntry.h && h.m === histoEntry.m && h.s === histoEntry.s)) {
if (
!history.value.find(
(h) => h.d === histoEntry.d && h.h === histoEntry.h && h.m === histoEntry.m && h.s === histoEntry.s,
)
) {
history.value = [histoEntry, ...history.value];
}
}
@@ -88,8 +87,7 @@ function toggleFullScreen() {
}
if (!document.fullscreenElement) {
element?.requestFullscreen();
}
else {
} else {
document.exitFullscreen?.();
}
}
@@ -124,9 +122,7 @@ const isEnded = computed(() => status.value === 'ended');
</div>
<div flex justify-center>
<c-button
@click="start"
>
<c-button @click="start">
{{ t('tools.countdown.texts.tag-start') }}
</c-button>
</div>
@@ -134,20 +130,23 @@ const isEnded = computed(() => status.value === 'ended');
<div id="fullScreenElement" ref="fullScreenElement" mb-2>
<div>
<Countdown :deadline="deadlineFormatted" :stop="status !== 'running'" mb-2 countdown-size="4rem" @time-elapsed="ended()" />
<Countdown
:deadline="deadlineFormatted"
:stop="status !== 'running'"
mb-2
countdown-size="4rem"
@time-elapsed="ended()"
/>
<div mb-2 flex justify-center>
<c-button
:disabled="status === 'stopped'"
@click="toggleFullScreen"
>
<c-button :disabled="status === 'stopped'" @click="toggleFullScreen">
{{ t('tools.countdown.texts.tag-toggle-fullscreen') }}
</c-button>
</div>
</div>
</div>
<n-modal v-model:show="isEnded" mask-closable="false">
<n-modal v-model:show="isEnded" :mask-closable="false">
<n-card
style="width: 600px"
:title="t('tools.countdown.texts.title-timer-finished')"
@@ -166,17 +165,12 @@ const isEnded = computed(() => status.value === 'ended');
</n-modal>
<div mb-2 flex justify-center>
<c-button
:disabled="status === 'stopped'"
@click="stop"
>
<c-button :disabled="status === 'stopped'" @click="stop">
{{ t('tools.countdown.texts.tag-stop') }}
</c-button>
</div>
<n-p align="center">
Alarm at: {{ deadlineDate }}
</n-p>
<n-p align="center"> Alarm at: {{ deadlineDate }} </n-p>
<c-card v-if="history" :title="t('tools.countdown.texts.title-history')">
<div flex justify-center gap-1>
+32 -27
View File
@@ -32,7 +32,8 @@ const defaultCRCValues = {
};
type AlgoNames = keyof typeof defaultCRCValues;
function getCRCs(content: Uint8Array | string) {
function getCRCs(rawContent: Uint8Array | string) {
const content = rawContent as Buffer | string;
return {
crc1: crc.crc1(content).toString(16),
crc8: crc.crc8(content).toString(16),
@@ -60,8 +61,7 @@ async function onUpload(uploadedFile: File) {
try {
hashes.value = getCRCs(new Uint8Array(buffer));
status.value = 'done';
}
catch (e) {
} catch (e) {
status.value = 'error';
}
}
@@ -69,7 +69,11 @@ async function onUpload(uploadedFile: File) {
const algoWasmNames = Object.keys(defaultCRCValues) as AlgoNames[];
type Encoding = keyof typeof enc | 'Bin';
const encoding = useQueryParamOrStorage<Encoding>({ defaultValue: 'Hex', storageName: 'hash-text:encoding', name: 'encoding' });
const encoding = useQueryParamOrStorage<Encoding>({
defaultValue: 'Hex',
storageName: 'hash-text:encoding',
name: 'encoding',
});
function formatWithEncoding(words: lib.WordArray, encoding: Encoding) {
if (encoding === 'Bin') {
@@ -79,24 +83,24 @@ function formatWithEncoding(words: lib.WordArray, encoding: Encoding) {
return words.toString(enc[encoding]);
}
const CRCValues = computed(() => withDefaultOnError(() => {
const encodingValue = encoding.value;
const hashesValue = hashes.value;
const CRCValues = computed(() =>
withDefaultOnError(() => {
const encodingValue = encoding.value;
const hashesValue = hashes.value;
const ret = defaultCRCValues;
for (const algo of algoWasmNames) {
ret[algo] = formatWithEncoding(enc.Hex.parse(hashesValue[algo]), encodingValue);
}
return ret;
}, defaultCRCValues));
watch(text,
(newValue) => {
file.value = null;
hashes.value = getCRCs(newValue);
status.value = 'done';
},
const ret = defaultCRCValues;
for (const algo of algoWasmNames) {
ret[algo] = formatWithEncoding(enc.Hex.parse(hashesValue[algo]), encodingValue);
}
return ret;
}, defaultCRCValues),
);
watch(text, (newValue) => {
file.value = null;
hashes.value = getCRCs(newValue);
status.value = 'done';
});
</script>
<template>
@@ -111,9 +115,13 @@ watch(text,
<c-input-text
v-model:value="text"
multiline raw-text
: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')"
multiline
raw-text
: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 />
@@ -147,10 +155,7 @@ watch(text,
<c-alert v-if="status === 'error'" type="error">
{{ t('tools.crc-calculator.texts.tag-an-error-occured-hashing-file') }}
</c-alert>
<n-spin
v-if="status === 'processing'"
size="small"
/>
<n-spin v-if="status === 'processing'" size="small" />
</div>
<c-card v-if="status === 'done'" :title="file === null ? 'CRC of text' : `CRC of ${file?.name}`">
+9 -22
View File
@@ -32,7 +32,7 @@ watchEffect(() => {
const now = ref(moment());
const daysArray = computed<string[]>({
get() {
return (alarmDays.value || allDays).split(',').map(s => s.trim());
return (alarmDays.value || allDays).split(',').map((s) => s.trim());
},
set(newValue) {
alarmDays.value = newValue.join(',');
@@ -56,7 +56,7 @@ function start() {
now.value = moment();
status.value = 'running';
const histoEntry = { at: alarmAt.value, days: alarmDays.value };
if (!history.value.find(h => h.at === histoEntry.at && h.days === histoEntry.days)) {
if (!history.value.find((h) => h.at === histoEntry.at && h.days === histoEntry.days)) {
history.value = [histoEntry, ...history.value];
}
}
@@ -83,8 +83,7 @@ function toggleFullScreen() {
}
if (!document.fullscreenElement) {
element?.requestFullscreen();
}
else {
} else {
document.exitFullscreen?.();
}
}
@@ -115,9 +114,7 @@ const isEnded = computed(() => status.value === 'ended');
</div>
<div flex justify-center>
<c-button
@click="start"
>
<c-button @click="start">
{{ t('tools.cron-alarm.texts.tag-start') }}
</c-button>
</div>
@@ -127,10 +124,7 @@ const isEnded = computed(() => status.value === 'ended');
<div>
<Countdown :deadline="alarmAtFormatted" :stop="status !== 'running'" mb-2 @time-elapsed="ended()" />
<div mb-2 flex justify-center>
<c-button
:disabled="status === 'stopped'"
@click="toggleFullScreen"
>
<c-button :disabled="status === 'stopped'" @click="toggleFullScreen">
{{ t('tools.cron-alarm.texts.tag-toggle-fullscreen') }}
</c-button>
</div>
@@ -138,19 +132,14 @@ const isEnded = computed(() => status.value === 'ended');
</div>
<div mb-2 flex justify-center>
<c-button
:disabled="status === 'stopped'"
@click="stop"
>
<c-button :disabled="status === 'stopped'" @click="stop">
{{ t('tools.cron-alarm.texts.tag-stop') }}
</c-button>
</div>
<n-p align="center">
Next alarm at: {{ alarmAtDate }}
</n-p>
<n-p align="center"> Next alarm at: {{ alarmAtDate }} </n-p>
<n-modal v-model:show="isEnded" mask-closable="false">
<n-modal v-model:show="isEnded" :mask-closable="false">
<n-card
style="width: 600px"
:title="t('tools.cron-alarm.texts.title-timer-finished')"
@@ -172,9 +161,7 @@ const isEnded = computed(() => status.value === 'ended');
<div flex justify-center gap-1>
<template v-for="(entry, index) in history" :key="index">
{{ index > 0 ? ' / ' : '' }}
<n-a :href="getTimeHref(entry.at, entry.days)">
At: {{ entry.at }} ; Days: {{ entry.days || '*' }}
</n-a>
<n-a :href="getTimeHref(entry.at, entry.days)"> At: {{ entry.at }} ; Days: {{ entry.days || '*' }} </n-a>
</template>
</div>
</c-card>
@@ -1,7 +1,7 @@
<script setup lang="ts">
import { useI18n } from 'vue-i18n';
import cronstrue from 'cronstrue';
import ctz from 'countries-and-timezones';
import * as ctz from 'countries-and-timezones';
import getTimezoneOffset from 'get-timezone-offset';
import { type CronType, getLastExecutionTimes, isCronValid } from './crontab-generator.service';
import { useStyleStore } from '@/stores/style.store';
@@ -18,19 +18,24 @@ const cronstrueConfig = reactive({
use24HourTimeFormat: true,
throwExceptionOnParseError: true,
monthStartIndexZero: false,
tzOffset: (new Date()).getTimezoneOffset() / 60,
tzOffset: new Date().getTimezoneOffset() / 60,
});
// getTimezoneOffset(tz.name, now) / 60
const browserTimezone = Intl.DateTimeFormat().resolvedOptions().timeZone;
const allTimezones = Object.values(ctz.getAllTimezones()).map((tz) => {
const timezoneUTCDSTOffset = tz.utcOffset === tz.dstOffset ? tz.utcOffsetStr : `${tz.utcOffsetStr}/${tz.dstOffsetStr}`;
const timezoneUTCDSTOffset =
tz.utcOffset === tz.dstOffset ? tz.utcOffsetStr : `${tz.utcOffsetStr}/${tz.dstOffsetStr}`;
return {
value: tz.name,
label: `${tz.name === browserTimezone ? 'Browser TZ - ' : ''}${tz.name} (${timezoneUTCDSTOffset})`,
};
});
const currentTimezone = useQueryParamOrStorage({ name: 'tz', storageName: 'crongen:tz', defaultValue: browserTimezone });
const currentTimezone = useQueryParamOrStorage({
name: 'tz',
storageName: 'crongen:tz',
defaultValue: browserTimezone,
});
watchEffect(() => {
cronstrueConfig.tzOffset = -getTimezoneOffset(currentTimezone.value, new Date()) / 60;
});
@@ -118,7 +123,8 @@ const awsHelpers = [
...commonHelpers,
{
symbol: '?',
meaning: 'One or another. In the Day-of-month field you could enter 7, and if you didn\'t care what day of the week the seventh was, you could enter ? in the Day-of-week field',
meaning:
"One or another. In the Day-of-month field you could enter 7, and if you didn't care what day of the week the seventh was, you could enter ? in the Day-of-week field",
example: '9 * 7,9,11 5 ? 2021',
equivalent: 'At 9 minutes past the hour, every hour, on day 7, 9, and 11 of the month, only in May, only in 2021',
},
@@ -126,39 +132,40 @@ const awsHelpers = [
symbol: 'L',
meaning: 'The L wildcard in the Day-of-month or Day-of-week fields specifies the last day of the month or week.',
example: '9 * L 5 ? 2019,2020',
equivalent: 'At 9 minutes past the hour, every hour, on the last day of the month, only in May, only in 2019 and 2020',
equivalent:
'At 9 minutes past the hour, every hour, on the last day of the month, only in May, only in 2019 and 2020',
},
{
symbol: 'W',
meaning: 'The W wildcard in the Day-of-month field specifies a weekday. In the Day-of-month field, 3W specifies the day closest to the third weekday of the month.',
meaning:
'The W wildcard in the Day-of-month field specifies a weekday. In the Day-of-month field, 3W specifies the day closest to the third weekday of the month.',
example: '19 4 3W 9 ? 2019,2020',
equivalent: 'At 04:19 AM, on the weekday nearest day 3 of the month, only in September, only in 2019 and 2020',
},
{
symbol: '#',
meaning: 'The # wildcard in the Day-of-week field specifies the nieth weekday of the month. 3#5 specifies the fifth Wednesday of the month',
meaning:
'The # wildcard in the Day-of-week field specifies the nieth weekday of the month. 3#5 specifies the fifth Wednesday of the month',
example: '9 8-20 ? 12 3#5 2019,2020',
equivalent: 'At 9 minutes past the hour, between 08:00 AM and 08:59 PM, on the fifth Wednesday of the month, only in December, only in 2019 and 2020',
equivalent:
'At 9 minutes past the hour, between 08:00 AM and 08:59 PM, on the fifth Wednesday of the month, only in December, only in 2019 and 2020',
},
];
const defaultAWSCronExpression = '0 0 ? * 1 *';
const defaultStandardCronExpression = '40 * * * *';
const cronType = ref<CronType>('standard');
watch(cronType,
(newCronType) => {
if (newCronType === 'aws') {
if (!cron.value || cron.value === defaultStandardCronExpression) {
cron.value = defaultAWSCronExpression;
}
watch(cronType, (newCronType) => {
if (newCronType === 'aws') {
if (!cron.value || cron.value === defaultStandardCronExpression) {
cron.value = defaultAWSCronExpression;
}
else if (newCronType === 'standard') {
if (!cron.value || cron.value === defaultAWSCronExpression) {
cron.value = defaultStandardCronExpression;
}
} else if (newCronType === 'standard') {
if (!cron.value || cron.value === defaultAWSCronExpression) {
cron.value = defaultStandardCronExpression;
}
},
);
}
});
const getHelpers = computed(() => {
if (cronType.value === 'aws') {
@@ -171,8 +178,7 @@ const cronString = computed(() => {
if (isCronValid(cron.value)) {
try {
return cronstrue.toString(cron.value, cronstrueConfig);
}
catch (e: any) {
} catch (e: any) {
return e.toString();
}
}
@@ -192,8 +198,7 @@ const executionTimesString = computed(() => {
const lastExecutionTimes = getLastExecutionTimes(cron.value, currentTimezone.value);
const executionTimesString = lastExecutionTimes.join('\n');
return `Next 5 execution times:\n${executionTimesString}`;
}
catch (e: any) {
} catch (e: any) {
return e.toString();
}
}
@@ -215,14 +220,8 @@ const executionTimesString = computed(() => {
<n-radio-group v-model:value="cronType" name="radiogroup" mb-2 flex justify-center>
<n-space>
<n-radio
value="standard"
:label="t('tools.crontab-generator.texts.label-unix-standard')"
/>
<n-radio
value="aws"
:label="t('tools.crontab-generator.texts.label-aws')"
/>
<n-radio value="standard" :label="t('tools.crontab-generator.texts.label-unix-standard')" />
<n-radio value="aws" :label="t('tools.crontab-generator.texts.label-aws')" />
</n-space>
</n-radio-group>
@@ -269,7 +268,8 @@ const executionTimesString = computed(() => {
| | | | ┌──── month (1 - 12) OR jan,feb,mar,apr ...
| | | | | ┌── day of week (0 - 6, sunday=0) OR sun,mon ...
| | | | | |
* * * * * * command</pre>
* * * * * * command</pre
>
<pre v-if="cronType === 'aws'">
-- AWS CRON Syntax --
@@ -280,7 +280,8 @@ const executionTimesString = computed(() => {
| | | | ┌──── day of week (0 - 6, sunday=0) OR sun,mon OR L ...
| | | | | ┌── year
| | | | | |
* * * * * *</pre>
* * * * * *</pre
>
<div v-if="styleStore.isSmallScreen">
<c-card v-for="{ symbol, meaning, example, equivalent } in getHelpers" :key="symbol" mb-3 important:border-none>
@@ -291,7 +292,10 @@ const executionTimesString = computed(() => {
{{ t('tools.crontab-generator.texts.tag-meaning') }}<strong>{{ meaning }}</strong>
</div>
<div>
{{ t('tools.crontab-generator.texts.tag-example') }}<strong><code>{{ example }}</code></strong>
{{ t('tools.crontab-generator.texts.tag-example')
}}<strong
><code>{{ example }}</code></strong
>
</div>
<div>
{{ t('tools.crontab-generator.texts.tag-equivalent') }}<strong>{{ equivalent }}</strong>
@@ -323,7 +327,7 @@ pre {
padding: 10px 0;
}
.cron-execution-string{
.cron-execution-string {
text-align: center;
font-size: 14px;
opacity: 0.8;
+32 -45
View File
@@ -156,8 +156,7 @@ function fitToViewport() {
if (iRatio > vRatio) {
// Fit width
bW = vW;
}
else {
} else {
// Fit height
bW = vH * iRatio;
}
@@ -252,8 +251,7 @@ function handleWheel(e: WheelEvent) {
let newZoom = zoom.value;
if (e.deltaY < 0) {
newZoom = Math.min(zoom.value + zoomStep, 10.0);
}
else {
} else {
newZoom = Math.max(zoom.value - zoomStep, 0.05);
}
zoom.value = newZoom;
@@ -278,8 +276,7 @@ function exportImage() {
const scaleFactor = imgNaturalWidth.value / bW;
canvasWidth = vW * scaleFactor;
canvasHeight = vH * scaleFactor;
}
else if (exportWidthMode.value === 'custom') {
} else if (exportWidthMode.value === 'custom') {
canvasWidth = customExportWidth.value;
canvasHeight = customExportWidth.value / currentRatio.value;
}
@@ -296,8 +293,7 @@ function exportImage() {
if (backgroundColor.value !== '#00000000') {
ctx.fillStyle = backgroundColor.value;
ctx.fillRect(0, 0, canvasWidth, canvasHeight);
}
else {
} else {
ctx.clearRect(0, 0, canvasWidth, canvasHeight);
}
@@ -309,7 +305,7 @@ function exportImage() {
const bH = baseDimensions.value.height;
const ox = offsetX.value;
const oy = offsetY.value;
const r = rotation.value * Math.PI / 180;
const r = (rotation.value * Math.PI) / 180;
const sx = zoom.value * (flipH.value ? -1 : 1);
const sy = zoom.value * (flipV.value ? -1 : 1);
@@ -324,7 +320,8 @@ function exportImage() {
ctx.restore();
// Trigger Download
const mime = exportFormat.value === 'jpeg' ? 'image/jpeg' : exportFormat.value === 'webp' ? 'image/webp' : 'image/png';
const mime =
exportFormat.value === 'jpeg' ? 'image/jpeg' : exportFormat.value === 'webp' ? 'image/webp' : 'image/png';
const extension = exportFormat.value;
const dataUrl = canvas.toDataURL(mime, exportQuality.value);
@@ -347,12 +344,7 @@ function exportImage() {
<!-- Drop Zone Mode -->
<c-card v-if="!imageSrc">
<div flex flex-col items-center justify-center gap-6 py-12>
<c-file-upload
accept="image/*"
:title="t('tools.crop-image.texts.drag-drop')"
w-full
@file-upload="onUpload"
/>
<c-file-upload accept="image/*" :title="t('tools.crop-image.texts.drag-drop')" w-full @file-upload="onUpload" />
</div>
</c-card>
@@ -389,7 +381,10 @@ function exportImage() {
>
<!-- Transparent checkerboard background -->
<div
v-if="backgroundColor === '#00000000' || backgroundColor.includes('rgba(') && backgroundColor.endsWith(', 0)')"
v-if="
backgroundColor === '#00000000' ||
(backgroundColor.includes('rgba(') && backgroundColor.endsWith(', 0)'))
"
class="checkerboard-bg pointer-events-none absolute inset-0"
/>
@@ -403,7 +398,7 @@ function exportImage() {
transform: `translate(${offsetX}px, ${offsetY}px) rotate(${rotation}deg) scale(${zoom * (flipH ? -1 : 1)}, ${zoom * (flipV ? -1 : 1)})`,
transformOrigin: 'center center',
}"
>
/>
<!-- 3x3 rule of thirds grid overlay -->
<div
@@ -478,11 +473,7 @@ function exportImage() {
<n-form label-placement="left" label-width="140" label-align="right">
<!-- Aspect Ratio Presets -->
<n-form-item :label="t('tools.crop-image.texts.aspect-ratio')">
<c-select
v-model:value="aspectRatio"
:options="aspectRatioOptions"
w-full
/>
<c-select v-model:value="aspectRatio" :options="aspectRatioOptions" w-full />
</n-form-item>
<!-- Custom Aspect Ratio Inputs -->
@@ -497,7 +488,7 @@ function exportImage() {
<!-- Background Color Picker -->
<n-form-item :label="t('tools.crop-image.texts.background-color')">
<div w-full flex items-center gap-4>
<n-color-picker v-model:value="backgroundColor" :modes="['hex', 'rgba']" class="flex-1" />
<n-color-picker v-model:value="backgroundColor" :modes="['hex', 'rgba'] as any" class="flex-1" />
<c-button size="small" @click="backgroundColor = '#00000000'">
{{ t('tools.crop-image.texts.transparent') }}
</c-button>
@@ -535,15 +526,14 @@ function exportImage() {
<n-form label-placement="left" label-width="140" label-align="right">
<!-- Export Format select -->
<n-form-item :label="t('tools.crop-image.texts.export-format')">
<c-select
v-model:value="exportFormat"
:options="exportFormatOptions"
w-full
/>
<c-select v-model:value="exportFormat" :options="exportFormatOptions" w-full />
</n-form-item>
<!-- Quality slider for lossy formats -->
<n-form-item v-if="exportFormat === 'jpeg' || exportFormat === 'webp'" :label="t('tools.crop-image.texts.image-quality')">
<n-form-item
v-if="exportFormat === 'jpeg' || exportFormat === 'webp'"
:label="t('tools.crop-image.texts.image-quality')"
>
<div w-full flex items-center gap-4>
<n-slider v-model:value="exportQuality" :min="0.1" :max="1" :step="0.05" class="flex-1" />
<span w-50px text-right font-mono>{{ Math.round(exportQuality * 100) }}%</span>
@@ -552,11 +542,7 @@ function exportImage() {
<!-- Export width options -->
<n-form-item :label="t('tools.crop-image.texts.export-width')">
<c-select
v-model:value="exportWidthMode"
:options="exportWidthOptions"
w-full
/>
<c-select v-model:value="exportWidthMode" :options="exportWidthOptions" w-full />
</n-form-item>
<!-- Custom Export Width Input -->
@@ -584,19 +570,20 @@ function exportImage() {
.checkerboard-bg {
background-image:
linear-gradient(45deg, #e5e7eb 25%, transparent 25%),
linear-gradient(-45deg, #e5e7eb 25%, transparent 25%),
linear-gradient(45deg, transparent 75%, #e5e7eb 75%),
linear-gradient(-45deg, transparent 75%, #e5e7eb 75%);
linear-gradient(45deg, #e5e7eb 25%, transparent 25%), linear-gradient(-45deg, #e5e7eb 25%, transparent 25%),
linear-gradient(45deg, transparent 75%, #e5e7eb 75%), linear-gradient(-45deg, transparent 75%, #e5e7eb 75%);
background-size: 16px 16px;
background-position: 0 0, 0 8px, 8px -8px, -8px 0px;
background-position:
0 0,
0 8px,
8px -8px,
-8px 0px;
:deep(.dark) &, .dark & {
:deep(.dark) &,
.dark & {
background-image:
linear-gradient(45deg, #374151 25%, transparent 25%),
linear-gradient(-45deg, #374151 25%, transparent 25%),
linear-gradient(45deg, transparent 75%, #374151 75%),
linear-gradient(-45deg, transparent 75%, #374151 75%);
linear-gradient(45deg, #374151 25%, transparent 25%), linear-gradient(-45deg, #374151 25%, transparent 25%),
linear-gradient(45deg, transparent 75%, #374151 75%), linear-gradient(-45deg, transparent 75%, #374151 75%);
}
}
+202 -46
View File
@@ -1,7 +1,14 @@
<script setup lang="ts">
import { useI18n } from 'vue-i18n';
import ctz from 'countries-and-timezones';
import { type Weekdays, allWeekDays, diffDateTimes, getSupportedCountries, getSupportedRegions, getSupportedStates } from './days-calculator.service';
import * as ctz from 'countries-and-timezones';
import {
type Weekdays,
allWeekDays,
diffDateTimes,
getSupportedCountries,
getSupportedRegions,
getSupportedStates,
} from './days-calculator.service';
import { useQueryParamOrStorage } from '@/composable/queryParams';
const { t } = useI18n();
@@ -11,7 +18,7 @@ const now = Date.now();
const inputDateRange = ref<[number, number]>([now, now + 86400]);
const browserTimezone = Intl.DateTimeFormat().resolvedOptions().timeZone;
const allTimezones = Object.values(ctz.getAllTimezones()).map(tz => ({
const allTimezones = Object.values(ctz.getAllTimezones()).map((tz) => ({
value: tz.name,
label: `${tz.name === browserTimezone ? 'Browser TZ - ' : ''}${tz.name} (${tz.utcOffset === tz.dstOffset ? tz.utcOffsetStr : `${tz.utcOffsetStr}/${tz.dstOffsetStr}`})`,
}));
@@ -21,18 +28,42 @@ const possibleStates = computed(() => getSupportedStates(country.value));
const state = useQueryParamOrStorage({ name: 'state', storageName: 'days-calc:st', defaultValue: '' });
const possibleRegions = computed(() => getSupportedRegions(country.value, state.value));
const region = useQueryParamOrStorage({ name: 'region', storageName: 'days-calc:reg', defaultValue: '' });
const includeEndDate = useQueryParamOrStorage({ name: 'includeend', storageName: 'days-calc:end', defaultValue: false });
const includeWeekDays = useQueryParamOrStorage<Weekdays[]>({ name: 'days', storageName: 'days-calc:days', defaultValue: allWeekDays });
const includeHolidays = useQueryParamOrStorage({ name: 'includehol', storageName: 'days-calc:hol', defaultValue: true });
const businessStartHour = useQueryParamOrStorage({ name: 'businessstart', storageName: 'days-calc:bss', defaultValue: 9 });
const businessEndHour = useQueryParamOrStorage({ name: 'businessstend', storageName: 'days-calc:bse', defaultValue: 18 });
const businessTimezone = useQueryParamOrStorage({ name: 'tz', storageName: 'days-calc:tz', defaultValue: browserTimezone });
const includeEndDate = useQueryParamOrStorage({
name: 'includeend',
storageName: 'days-calc:end',
defaultValue: false,
});
const includeWeekDays = useQueryParamOrStorage<Weekdays[]>({
name: 'days',
storageName: 'days-calc:days',
defaultValue: allWeekDays,
});
const includeHolidays = useQueryParamOrStorage({
name: 'includehol',
storageName: 'days-calc:hol',
defaultValue: true,
});
const businessStartHour = useQueryParamOrStorage({
name: 'businessstart',
storageName: 'days-calc:bss',
defaultValue: 9,
});
const businessEndHour = useQueryParamOrStorage({
name: 'businessstend',
storageName: 'days-calc:bse',
defaultValue: 18,
});
const businessTimezone = useQueryParamOrStorage({
name: 'tz',
storageName: 'days-calc:tz',
defaultValue: browserTimezone,
});
const error = ref('');
const resultDaysDiff = computed(() => {
try {
return diffDateTimes({
date1: new Date(inputDateRange.value[0] / 1000 * 1000),
date2: new Date(inputDateRange.value[1] / 1000 * 1000),
date1: new Date((inputDateRange.value[0] / 1000) * 1000),
date2: new Date((inputDateRange.value[1] / 1000) * 1000),
country: country.value,
state: state.value,
region: region.value,
@@ -43,17 +74,16 @@ const resultDaysDiff = computed(() => {
businessStartHour: businessStartHour.value,
businessEndHour: businessEndHour.value,
});
}
catch (e: any) {
} catch (e: any) {
error.value = e.toString();
return null;
}
});
const inputProps = {
'labelPosition': 'left',
'labelWidth': '170px',
'readonly': true,
labelPosition: 'left',
labelWidth: '170px',
readonly: true,
'mb-2': '',
} as const;
</script>
@@ -61,7 +91,13 @@ const inputProps = {
<template>
<div>
<c-card :title="t('tools.days-calculator.texts.title-dates-interval')" mb-2>
<n-form-item :label="t('tools.days-calculator.texts.label-date-range')" label-placement="left" label-width="100px" label-align="left" mb-1>
<n-form-item
:label="t('tools.days-calculator.texts.label-date-range')"
label-placement="left"
label-width="100px"
label-align="left"
mb-1
>
<n-date-picker v-model:value="inputDateRange" type="datetimerange" />
</n-form-item>
@@ -82,7 +118,9 @@ const inputProps = {
searchable
:label="t('tools.days-calculator.texts.label-state')"
:options="possibleStates"
:placeholder="t('tools.days-calculator.texts.placeholder-select-a-specific-state-or-let-empty-for-general-info')"
:placeholder="
t('tools.days-calculator.texts.placeholder-select-a-specific-state-or-let-empty-for-general-info')
"
mb-1
/>
<c-select
@@ -144,39 +182,157 @@ const inputProps = {
</c-alert>
<c-card v-if="resultDaysDiff" :title="t('tools.days-calculator.texts.title-result')">
<input-copyable v-bind="inputProps" :label="t('tools.days-calculator.texts.label-start-date')" :value="resultDaysDiff.startDate" />
<input-copyable v-bind="inputProps" :label="t('tools.days-calculator.texts.label-start-date-iso')" :value="resultDaysDiff.startDate.toISOString()" />
<input-copyable v-bind="inputProps" :label="t('tools.days-calculator.texts.label-end-date')" :value="resultDaysDiff.endDate" />
<input-copyable v-bind="inputProps" :label="t('tools.days-calculator.texts.label-end-date-iso')" :value="resultDaysDiff.endDate.toISOString()" />
<input-copyable
v-bind="inputProps"
:label="t('tools.days-calculator.texts.label-start-date')"
:value="resultDaysDiff.startDate.toString()"
/>
<input-copyable
v-bind="inputProps"
:label="t('tools.days-calculator.texts.label-start-date-iso')"
:value="resultDaysDiff.startDate.toISOString()"
/>
<input-copyable
v-bind="inputProps"
:label="t('tools.days-calculator.texts.label-end-date')"
:value="resultDaysDiff.endDate.toString()"
/>
<input-copyable
v-bind="inputProps"
:label="t('tools.days-calculator.texts.label-end-date-iso')"
:value="resultDaysDiff.endDate.toISOString()"
/>
<n-divider />
<input-copyable v-bind="inputProps" :label="t('tools.days-calculator.texts.label-total-difference-seconds')" :value="resultDaysDiff.totalDifference.seconds" />
<input-copyable v-bind="inputProps" :label="t('tools.days-calculator.texts.label-total-difference-minutes')" :value="resultDaysDiff.totalDifference.minutes" />
<input-copyable v-bind="inputProps" :label="t('tools.days-calculator.texts.label-total-difference-hours')" :value="resultDaysDiff.totalDifference.hours" />
<input-copyable v-bind="inputProps" :label="t('tools.days-calculator.texts.label-total-difference-days')" :value="resultDaysDiff.totalDifference.days" />
<input-copyable v-bind="inputProps" :label="t('tools.days-calculator.texts.label-total-difference-weeks')" :value="resultDaysDiff.totalDifference.weeks" />
<input-copyable v-bind="inputProps" :label="t('tools.days-calculator.texts.label-total-difference-months')" :value="resultDaysDiff.totalDifference.months" />
<input-copyable v-bind="inputProps" :label="t('tools.days-calculator.texts.label-total-difference-years')" :value="resultDaysDiff.totalDifference.years" />
<input-copyable v-bind="inputProps" :label="t('tools.days-calculator.texts.label-total-difference')" :value="resultDaysDiff.totalDifferenceFormatted" />
<input-copyable
v-bind="inputProps"
:label="t('tools.days-calculator.texts.label-total-difference-seconds')"
:value="resultDaysDiff.totalDifference.seconds"
/>
<input-copyable
v-bind="inputProps"
:label="t('tools.days-calculator.texts.label-total-difference-minutes')"
:value="resultDaysDiff.totalDifference.minutes"
/>
<input-copyable
v-bind="inputProps"
:label="t('tools.days-calculator.texts.label-total-difference-hours')"
:value="resultDaysDiff.totalDifference.hours"
/>
<input-copyable
v-bind="inputProps"
:label="t('tools.days-calculator.texts.label-total-difference-days')"
:value="resultDaysDiff.totalDifference.days"
/>
<input-copyable
v-bind="inputProps"
:label="t('tools.days-calculator.texts.label-total-difference-weeks')"
:value="resultDaysDiff.totalDifference.weeks"
/>
<input-copyable
v-bind="inputProps"
:label="t('tools.days-calculator.texts.label-total-difference-months')"
:value="resultDaysDiff.totalDifference.months"
/>
<input-copyable
v-bind="inputProps"
:label="t('tools.days-calculator.texts.label-total-difference-years')"
:value="resultDaysDiff.totalDifference.years"
/>
<input-copyable
v-bind="inputProps"
:label="t('tools.days-calculator.texts.label-total-difference')"
:value="resultDaysDiff.totalDifferenceFormatted"
/>
<n-divider />
<input-copyable v-bind="inputProps" :label="t('tools.days-calculator.texts.label-difference-seconds')" :value="resultDaysDiff.differenceSeconds" />
<input-copyable v-bind="inputProps" :label="t('tools.days-calculator.texts.label-difference')" :value="resultDaysDiff.differenceFormatted" />
<input-copyable
v-bind="inputProps"
:label="t('tools.days-calculator.texts.label-difference-seconds')"
:value="resultDaysDiff.differenceSeconds"
/>
<input-copyable
v-bind="inputProps"
:label="t('tools.days-calculator.texts.label-difference')"
:value="resultDaysDiff.differenceFormatted"
/>
<n-divider />
<input-copyable v-bind="inputProps" :label="t('tools.days-calculator.texts.label-business-seconds')" :value="resultDaysDiff.businessSeconds" />
<input-copyable v-bind="inputProps" :label="t('tools.days-calculator.texts.label-business-time')" :value="resultDaysDiff.businessSecondsFormatted" />
<input-copyable v-bind="inputProps" :label="t('tools.days-calculator.texts.label-business-hours')" :value="resultDaysDiff.businessHours" />
<input-copyable v-bind="inputProps" :label="t('tools.days-calculator.texts.label-business-days')" :value="resultDaysDiff.businessDays" />
<input-copyable
v-bind="inputProps"
:label="t('tools.days-calculator.texts.label-business-seconds')"
:value="resultDaysDiff.businessSeconds"
/>
<input-copyable
v-bind="inputProps"
:label="t('tools.days-calculator.texts.label-business-time')"
:value="resultDaysDiff.businessSecondsFormatted"
/>
<input-copyable
v-bind="inputProps"
:label="t('tools.days-calculator.texts.label-business-hours')"
:value="resultDaysDiff.businessHours"
/>
<input-copyable
v-bind="inputProps"
:label="t('tools.days-calculator.texts.label-business-days')"
:value="resultDaysDiff.businessDays"
/>
<n-divider />
<input-copyable v-bind="inputProps" :placeholder="t('tools.days-calculator.texts.placeholder-none')" :label="t('tools.days-calculator.texts.label-mondays')" :value="resultDaysDiff.mondays" />
<input-copyable v-bind="inputProps" :placeholder="t('tools.days-calculator.texts.placeholder-none')" :label="t('tools.days-calculator.texts.label-tuesdays')" :value="resultDaysDiff.tuesdays" />
<input-copyable v-bind="inputProps" :placeholder="t('tools.days-calculator.texts.placeholder-none')" :label="t('tools.days-calculator.texts.label-wednesdays')" :value="resultDaysDiff.wednesdays" />
<input-copyable v-bind="inputProps" :placeholder="t('tools.days-calculator.texts.placeholder-none')" :label="t('tools.days-calculator.texts.label-thursdays')" :value="resultDaysDiff.thursdays" />
<input-copyable v-bind="inputProps" :placeholder="t('tools.days-calculator.texts.placeholder-none')" :label="t('tools.days-calculator.texts.label-fridays')" :value="resultDaysDiff.fridays" />
<input-copyable v-bind="inputProps" :placeholder="t('tools.days-calculator.texts.placeholder-none')" :label="t('tools.days-calculator.texts.label-saturdays')" :value="resultDaysDiff.saturdays" />
<input-copyable v-bind="inputProps" :placeholder="t('tools.days-calculator.texts.placeholder-none')" :label="t('tools.days-calculator.texts.label-sundays')" :value="resultDaysDiff.sundays" />
<input-copyable
v-bind="inputProps"
:placeholder="t('tools.days-calculator.texts.placeholder-none')"
:label="t('tools.days-calculator.texts.label-mondays')"
:value="resultDaysDiff.mondays.toString()"
/>
<input-copyable
v-bind="inputProps"
:placeholder="t('tools.days-calculator.texts.placeholder-none')"
:label="t('tools.days-calculator.texts.label-tuesdays')"
:value="resultDaysDiff.tuesdays.toString()"
/>
<input-copyable
v-bind="inputProps"
:placeholder="t('tools.days-calculator.texts.placeholder-none')"
:label="t('tools.days-calculator.texts.label-wednesdays')"
:value="resultDaysDiff.wednesdays.toString()"
/>
<input-copyable
v-bind="inputProps"
:placeholder="t('tools.days-calculator.texts.placeholder-none')"
:label="t('tools.days-calculator.texts.label-thursdays')"
:value="resultDaysDiff.thursdays.toString()"
/>
<input-copyable
v-bind="inputProps"
:placeholder="t('tools.days-calculator.texts.placeholder-none')"
:label="t('tools.days-calculator.texts.label-fridays')"
:value="resultDaysDiff.fridays.toString()"
/>
<input-copyable
v-bind="inputProps"
:placeholder="t('tools.days-calculator.texts.placeholder-none')"
:label="t('tools.days-calculator.texts.label-saturdays')"
:value="resultDaysDiff.saturdays.toString()"
/>
<input-copyable
v-bind="inputProps"
:placeholder="t('tools.days-calculator.texts.placeholder-none')"
:label="t('tools.days-calculator.texts.label-sundays')"
:value="resultDaysDiff.sundays.toString()"
/>
<n-divider />
<input-copyable v-bind="inputProps" :label="t('tools.days-calculator.texts.label-weekend-days')" :value="resultDaysDiff.weekendDays" />
<input-copyable v-bind="inputProps" :label="t('tools.days-calculator.texts.label-full-weekends')" :value="resultDaysDiff.weekends" />
<c-card v-if="resultDaysDiff.holidays?.length" :title="t('tools.days-calculator.texts.title-holidays-in-period')">
<input-copyable
v-bind="inputProps"
:label="t('tools.days-calculator.texts.label-weekend-days')"
:value="resultDaysDiff.weekendDays"
/>
<input-copyable
v-bind="inputProps"
:label="t('tools.days-calculator.texts.label-full-weekends')"
:value="resultDaysDiff.weekends"
/>
<c-card
v-if="resultDaysDiff.holidays?.length"
:title="t('tools.days-calculator.texts.title-holidays-in-period')"
>
<ul>
<li v-for="(holiday, index) in resultDaysDiff.holidays" :key="index">
{{ holiday.date }}: {{ holiday.name }} ({{ holiday.type }})
+21 -8
View File
@@ -17,8 +17,7 @@ async function startDeadPixel() {
iframe.onload = async () => {
try {
await iframe.requestFullscreen();
}
catch (e) {
} catch (e) {
console.warn('Fullscreen failed', e);
}
};
@@ -104,19 +103,33 @@ const iframeHTML = `
<template>
<div class="flex flex-col">
<p>
{{ t('tools.dead-pixel.texts.tag-keyboard-shortcuts') }}<ul>
<li><strong>{{ t('tools.dead-pixel.texts.tag-arrow-right-arrow-down-space') }}</strong>{{ t('tools.dead-pixel.texts.tag-next-color') }}</li>
<li><strong>{{ t('tools.dead-pixel.texts.tag-arrow-left-arrow-up') }}</strong>{{ t('tools.dead-pixel.texts.tag-previous-color') }}</li>
<li><strong>{{ t('tools.dead-pixel.texts.tag-esc') }}</strong>{{ t('tools.dead-pixel.texts.tag-exit-dead-pixel-mode') }}</li>
</ul>
{{ t('tools.dead-pixel.texts.tag-keyboard-shortcuts') }}
</p>
<ul>
<li>
<strong>{{ t('tools.dead-pixel.texts.tag-arrow-right-arrow-down-space') }}</strong
>{{ t('tools.dead-pixel.texts.tag-next-color') }}
</li>
<li>
<strong>{{ t('tools.dead-pixel.texts.tag-arrow-left-arrow-up') }}</strong
>{{ t('tools.dead-pixel.texts.tag-previous-color') }}
</li>
<li>
<strong>{{ t('tools.dead-pixel.texts.tag-esc') }}</strong
>{{ t('tools.dead-pixel.texts.tag-exit-dead-pixel-mode') }}
</li>
</ul>
<c-button v-if="!showIframe" class="mx-auto" @click="startDeadPixel">
{{ t('tools.dead-pixel.texts.tag-start-dead-pixel') }}
</c-button>
</div>
<iframe
v-if="showIframe" ref="iframeRef" :title="t('tools.dead-pixel.texts.title-dead-pixel-iframe')" class="dead-pixel-iframe" :srcdoc="iframeHTML"
v-if="showIframe"
ref="iframeRef"
:title="t('tools.dead-pixel.texts.title-dead-pixel-iframe')"
class="dead-pixel-iframe"
:srcdoc="iframeHTML"
allow="fullscreen"
/>
</template>
@@ -14,7 +14,7 @@ function readAsText(file: File) {
const reader = new FileReader();
reader.readAsText(file);
reader.onload = () => resolve(reader.result?.toString() ?? '');
reader.onerror = error => reject(error);
reader.onerror = (error) => reject(error);
});
}
@@ -25,15 +25,12 @@ const parsedReport = computedAsync(async () => {
try {
if (inputType.value === 'file' && file) {
return await parseDmarcReportsFromXml([await readAsText(file)]);
}
else if (inputType.value === 'content' && emailContentValue) {
} else if (inputType.value === 'content' && emailContentValue) {
return await parseDmarcReportFromEmail(emailContentValue);
}
else {
} else {
return null;
}
}
catch (e: any) {
} catch (e: any) {
error.value = e.toString();
return null;
}
@@ -55,7 +52,7 @@ function toDate(dt: number | undefined) {
if (!dt) {
return 'NA';
}
return (new Date(dt)).toString();
return new Date(dt).toString();
}
function policyResultClass(policyResult: string) {
@@ -74,20 +71,18 @@ function policyResultClass(policyResult: string) {
<c-card :title="t('tools.dmarc-report-analyzer.texts.title-input')" mb-2>
<n-radio-group v-model:value="inputType" name="radiogroup" mb-2 flex justify-center>
<n-space>
<n-radio
value="file"
:label="t('tools.dmarc-report-analyzer.texts.label-dmarc-xml-file')"
/>
<n-radio
value="content"
:label="t('tools.dmarc-report-analyzer.texts.label-eml-content')"
/>
<n-radio value="file" :label="t('tools.dmarc-report-analyzer.texts.label-dmarc-xml-file')" />
<n-radio value="content" :label="t('tools.dmarc-report-analyzer.texts.label-eml-content')" />
</n-space>
</n-radio-group>
<c-file-upload
v-if="inputType === 'file'"
:title="t('tools.dmarc-report-analyzer.texts.title-drag-and-drop-dmarc-xml-report-file-here-or-click-to-select-a-file')"
:title="
t(
'tools.dmarc-report-analyzer.texts.title-drag-and-drop-dmarc-xml-report-file-here-or-click-to-select-a-file',
)
"
@file-upload="onUpload"
/>
@@ -107,19 +102,59 @@ function policyResultClass(policyResult: string) {
</c-alert>
<c-card v-if="!error && parsedReport" :title="t('tools.dmarc-report-analyzer.texts.title-output')">
<input-copyable v-if="fileInput?.name" :label="t('tools.dmarc-report-analyzer.texts.label-file-name')" :value="fileInput?.name" />
<input-copyable
v-if="fileInput?.name"
:label="t('tools.dmarc-report-analyzer.texts.label-file-name')"
:value="fileInput?.name"
/>
<c-card
v-for="(report, reportIndex) in parsedReport.reports || []"
:key="reportIndex" :title="`${report.reportMetadata?.orgName} (${report.reportMetadata?.reportId})`"
:key="reportIndex"
:title="`${report.reportMetadata?.orgName} (${report.reportMetadata?.reportId})`"
>
<input-copyable v-bind="inputLabelAlignmentConfig" mb-1 :label="t('tools.dmarc-report-analyzer.texts.label-orgname')" :value="report.reportMetadata?.orgName" />
<input-copyable v-bind="inputLabelAlignmentConfig" mb-1 :label="t('tools.dmarc-report-analyzer.texts.label-email')" :value="report.reportMetadata?.email" />
<input-copyable v-bind="inputLabelAlignmentConfig" mb-1 :label="t('tools.dmarc-report-analyzer.texts.label-extracontactinfo')" :value="report.reportMetadata?.extraContactInfo" />
<input-copyable v-bind="inputLabelAlignmentConfig" mb-1 :label="t('tools.dmarc-report-analyzer.texts.label-reportid')" :value="report.reportMetadata?.reportId" />
<input-copyable v-bind="inputLabelAlignmentConfig" mb-1 :label="t('tools.dmarc-report-analyzer.texts.label-date-begin')" :value="toDate(report.reportMetadata?.dateRange?.begin)" />
<input-copyable v-bind="inputLabelAlignmentConfig" mb-1 :label="t('tools.dmarc-report-analyzer.texts.label-date-end')" :value="toDate(report.reportMetadata?.dateRange?.end)" />
<input-copyable v-bind="inputLabelAlignmentConfig" mb-1 :label="t('tools.dmarc-report-analyzer.texts.label-domain')" :value="report.policyPublished?.domain" />
<input-copyable
v-bind="inputLabelAlignmentConfig"
mb-1
:label="t('tools.dmarc-report-analyzer.texts.label-orgname')"
:value="report.reportMetadata?.orgName ?? ''"
/>
<input-copyable
v-bind="inputLabelAlignmentConfig"
mb-1
:label="t('tools.dmarc-report-analyzer.texts.label-email')"
:value="report.reportMetadata?.email ?? ''"
/>
<input-copyable
v-bind="inputLabelAlignmentConfig"
mb-1
:label="t('tools.dmarc-report-analyzer.texts.label-extracontactinfo')"
:value="report.reportMetadata?.extraContactInfo ?? ''"
/>
<input-copyable
v-bind="inputLabelAlignmentConfig"
mb-1
:label="t('tools.dmarc-report-analyzer.texts.label-reportid')"
:value="report.reportMetadata?.reportId ?? ''"
/>
<input-copyable
v-bind="inputLabelAlignmentConfig"
mb-1
:label="t('tools.dmarc-report-analyzer.texts.label-date-begin')"
:value="toDate(report.reportMetadata?.dateRange?.begin)"
/>
<input-copyable
v-bind="inputLabelAlignmentConfig"
mb-1
:label="t('tools.dmarc-report-analyzer.texts.label-date-end')"
:value="toDate(report.reportMetadata?.dateRange?.end)"
/>
<input-copyable
v-bind="inputLabelAlignmentConfig"
mb-1
:label="t('tools.dmarc-report-analyzer.texts.label-domain')"
:value="report.policyPublished?.domain"
/>
<c-card :title="t('tools.dmarc-report-analyzer.texts.title-policy-published')" mb-2>
<textarea-copyable :value="JSON.stringify(report.policyPublished, null, 2)" />
</c-card>
@@ -148,14 +183,22 @@ function policyResultClass(policyResult: string) {
{{ record.row.policyEvaluated.disposition }}
</td>
<td>
<span :class="policyResultClass(record.row.policyEvaluated.dkim)">{{ record.row.policyEvaluated.dkim }}</span>
<br>
{{ (record.authResults.dkim || []).map(dkim => `${dkim.domain}: ${dkim.result} ${dkim.humanResult}`.trim()).join(', ') }}
<span :class="policyResultClass(record.row.policyEvaluated.dkim)">{{
record.row.policyEvaluated.dkim
}}</span>
<br />
{{
(record.authResults.dkim || [])
.map((dkim) => `${dkim.domain}: ${dkim.result} ${dkim.humanResult}`.trim())
.join(', ')
}}
</td>
<td>
<span :class="policyResultClass(record.row.policyEvaluated.spf)">{{ record.row.policyEvaluated.spf }}</span>
<br>
{{ (record.authResults.spf || []).map(spf => `${spf.domain}: ${spf.result}`.trim()).join(', ') }}
<span :class="policyResultClass(record.row.policyEvaluated.spf)">{{
record.row.policyEvaluated.spf
}}</span>
<br />
{{ (record.authResults.spf || []).map((spf) => `${spf.domain}: ${spf.result}`.trim()).join(', ') }}
</td>
<td>
<textarea-copyable :value="JSON.stringify(record.identifiers, null, 2)" />
+5 -5
View File
@@ -10,10 +10,10 @@ declare module 'composeverter' {
helpLink?: string;
}
export function validateDockerComposeToCommonSpec(content: string): DockerComposeValidatioError[];
export function migrateFromV2xToV3x(content: string, configuration?: Configuration = null): string;
export function migrateFromV3xToV2x(content: string, configuration?: Configuration = null): string;
export function migrateFromV1ToV2x(content: string, configuration?: Configuration = null): string;
export function migrateToCommonSpec(content: string, configuration?: Configuration = null): string;
export function migrateFromV2xToV3x(content: string, configuration?: Configuration = null): string;
export function migrateFromV2xToV3x(content: string, configuration?: Configuration): string;
export function migrateFromV3xToV2x(content: string, configuration?: Configuration): string;
export function migrateFromV1ToV2x(content: string, configuration?: Configuration): string;
export function migrateToCommonSpec(content: string, configuration?: Configuration): string;
export function migrateFromV2xToV3x(content: string, configuration?: Configuration): string;
export function getDockerComposeSchemaWithoutFormats(): object;
}
+18 -18
View File
@@ -1,19 +1,19 @@
declare module 'composeverter' {
interface Configuration {
expandVolumes?: boolean;
expandPorts?: boolean;
indent?: number;
}
interface DockerComposeValidatioError {
line?: number;
message: string;
helpLink?: string;
}
export function validateDockerComposeToCommonSpec(content: string): DockerComposeValidatioError[];
export function migrateFromV2xToV3x(content: string, configuration?: Configuration = null): string;
export function migrateFromV3xToV2x(content: string, configuration?: Configuration = null): string;
export function migrateFromV1ToV2x(content: string, configuration?: Configuration = null): string;
export function migrateToCommonSpec(content: string, configuration?: Configuration = null): string;
export function migrateFromV2xToV3x(content: string, configuration?: Configuration = null): string;
export function getDockerComposeSchemaWithoutFormats(): object;
}
interface Configuration {
expandVolumes?: boolean;
expandPorts?: boolean;
indent?: number;
}
interface DockerComposeValidatioError {
line?: number;
message: string;
helpLink?: string;
}
export function validateDockerComposeToCommonSpec(content: string): DockerComposeValidatioError[];
export function migrateFromV2xToV3x(content: string, configuration?: Configuration): string;
export function migrateFromV3xToV2x(content: string, configuration?: Configuration): string;
export function migrateFromV1ToV2x(content: string, configuration?: Configuration): string;
export function migrateToCommonSpec(content: string, configuration?: Configuration): string;
export function migrateFromV2xToV3x(content: string, configuration?: Configuration): string;
export function getDockerComposeSchemaWithoutFormats(): object;
}
@@ -1,15 +1,15 @@
<script setup lang="ts">
export interface OciGithubLabels {
title: string
description: string
url: string
source: string
documentation: string
licenses: string
version: string
revision: string
created: Date | null
authors: string
title: string;
description: string;
url: string;
source: string;
documentation: string;
licenses: string;
version: string;
revision: string;
created: number | null;
authors: string;
}
const form = ref<OciGithubLabels>({
@@ -37,13 +37,13 @@ const dockerfileLabels = computed(() => {
['org.opencontainers.image.licenses', f.licenses],
['org.opencontainers.image.version', f.version],
['org.opencontainers.image.revision', f.revision],
['org.opencontainers.image.created', f.created?.toISOString() || ''],
['org.opencontainers.image.created', f.created != null ? new Date(f.created).toISOString() : ''],
['org.opencontainers.image.authors', f.authors],
];
const lines = entries
.filter(([_, v]) => v.trim() !== '')
.map(([k, v]) => ` ${k}="${v.replace(/"/g, '\\"')}"`);
.map(([k, v]) => ` ${k}="${v.replace(/\\/g, '\\\\').replace(/"/g, '\\"')}"`);
if (lines.length === 0) {
return '';
@@ -61,11 +61,7 @@ const dockerfileLabels = computed(() => {
</n-form-item>
<n-form-item label="Description:">
<n-input
v-model:value="form.description"
type="textarea"
placeholder="Short project description"
/>
<n-input v-model:value="form.description" type="textarea" placeholder="Short project description" />
</n-form-item>
<n-form-item label="Repository URL:">
@@ -77,10 +73,7 @@ const dockerfileLabels = computed(() => {
</n-form-item>
<n-form-item label="Documentation URL:">
<n-input
v-model:value="form.documentation"
placeholder="https://github.com/username/repo#readme"
/>
<n-input v-model:value="form.documentation" placeholder="https://github.com/username/repo#readme" />
</n-form-item>
<n-form-item label="License (SPDX):">
+91 -43
View File
@@ -16,22 +16,19 @@ const parsedEmail = computedAsync(async () => {
try {
if (inputType.value === 'file' && file) {
return await PostalMime.parse(await file.arrayBuffer());
}
else if (inputType.value === 'content' && emailContentValue) {
} else if (inputType.value === 'content' && emailContentValue) {
return await PostalMime.parse(emailContentValue);
}
else {
} else {
return null;
}
}
catch (e: any) {
} catch (e: any) {
error.value = e.toString();
return null;
}
});
function downloadFile(data: ArrayBuffer | string, fileName: string, fileType: string) {
const blob = new Blob([data], { type: fileType || 'application/octet-stream' });
function downloadFile(data: ArrayBuffer | Uint8Array | string, fileName: string, fileType: string) {
const blob = new Blob([data as BlobPart], { type: fileType || 'application/octet-stream' });
const downloadUrl = URL.createObjectURL(blob);
const a = document.createElement('a');
a.href = downloadUrl;
@@ -53,14 +50,8 @@ function onUpload(file: File) {
<c-card :title="t('tools.email-parser.texts.title-input')" mb-2>
<n-radio-group v-model:value="inputType" name="radiogroup" mb-2 flex justify-center>
<n-space>
<n-radio
value="file"
:label="t('tools.email-parser.texts.label-file')"
/>
<n-radio
value="content"
:label="t('tools.email-parser.texts.label-content')"
/>
<n-radio value="file" :label="t('tools.email-parser.texts.label-file')" />
<n-radio value="content" :label="t('tools.email-parser.texts.label-content')" />
</n-space>
</n-radio-group>
@@ -86,15 +77,51 @@ function onUpload(file: File) {
</c-alert>
<c-card v-if="!error && parsedEmail" :title="t('tools.email-parser.texts.title-output')">
<input-copyable v-if="fileInput?.name" :label="t('tools.email-parser.texts.label-file-name')" :value="fileInput?.name" />
<input-copyable v-if="parsedEmail.date" :label="t('tools.email-parser.texts.label-date')" :value="parsedEmail.date" />
<input-copyable v-if="parsedEmail.from?.name" :label="t('tools.email-parser.texts.label-from-name')" :value="parsedEmail.from?.name" />
<input-copyable v-if="parsedEmail.from" :label="t('tools.email-parser.texts.label-from-address')" :value="parsedEmail.from?.address || parsedEmail.from" />
<input-copyable v-if="parsedEmail.to" :label="t('tools.email-parser.texts.label-to')" :value="JSON.stringify(parsedEmail.to)" />
<input-copyable v-if="parsedEmail.cc" :label="t('tools.email-parser.texts.label-cc')" :value="JSON.stringify(parsedEmail.cc)" />
<input-copyable v-if="parsedEmail.bcc" :label="t('tools.email-parser.texts.label-bcc')" :value="JSON.stringify(parsedEmail.bcc)" />
<input-copyable v-if="parsedEmail.replyTo" :label="t('tools.email-parser.texts.label-reply-to')" :value="JSON.stringify(parsedEmail.replyTo)" />
<input-copyable v-if="parsedEmail.subject" :label="t('tools.email-parser.texts.label-subject')" :value="parsedEmail.subject" />
<input-copyable
v-if="fileInput?.name"
:label="t('tools.email-parser.texts.label-file-name')"
:value="fileInput?.name"
/>
<input-copyable
v-if="parsedEmail.date"
:label="t('tools.email-parser.texts.label-date')"
:value="parsedEmail.date"
/>
<input-copyable
v-if="parsedEmail.from?.name"
:label="t('tools.email-parser.texts.label-from-name')"
:value="parsedEmail.from?.name"
/>
<input-copyable
v-if="parsedEmail.from"
:label="t('tools.email-parser.texts.label-from-address')"
:value="parsedEmail.from?.address || String(parsedEmail.from)"
/>
<input-copyable
v-if="parsedEmail.to"
:label="t('tools.email-parser.texts.label-to')"
:value="JSON.stringify(parsedEmail.to)"
/>
<input-copyable
v-if="parsedEmail.cc"
:label="t('tools.email-parser.texts.label-cc')"
:value="JSON.stringify(parsedEmail.cc)"
/>
<input-copyable
v-if="parsedEmail.bcc"
:label="t('tools.email-parser.texts.label-bcc')"
:value="JSON.stringify(parsedEmail.bcc)"
/>
<input-copyable
v-if="parsedEmail.replyTo"
:label="t('tools.email-parser.texts.label-reply-to')"
:value="JSON.stringify(parsedEmail.replyTo)"
/>
<input-copyable
v-if="parsedEmail.subject"
:label="t('tools.email-parser.texts.label-subject')"
:value="parsedEmail.subject"
/>
<c-card v-if="parsedEmail.text" :title="t('tools.email-parser.texts.title-plain-content')" mb-2>
<details>
<summary>{{ t('tools.email-parser.texts.tag-see-content') }}</summary>
@@ -113,14 +140,12 @@ function onUpload(file: File) {
<tr>
<th scope="col">
{{ t('tools.email-parser.texts.tag-attachment') }}
</th><th scope="col" />
</th>
<th scope="col" />
</tr>
</thead>
<tbody>
<tr
v-for="(h, index) in parsedEmail.attachments || []"
:key="index"
>
<tr v-for="(h, index) in parsedEmail.attachments || []" :key="index">
<td>
{{ `${h.filename || h.contentId || 'noname'} (${h.mimeType}) / ${h.disposition}` }}
</td>
@@ -134,21 +159,44 @@ function onUpload(file: File) {
</n-table>
</c-card>
<input-copyable v-if="parsedEmail.messageId" :label="t('tools.email-parser.texts.label-message-id')" :value="parsedEmail.messageId" />
<input-copyable v-if="parsedEmail.inReplyTo" :label="t('tools.email-parser.texts.label-in-reply-to')" :value="parsedEmail.inReplyTo" />
<input-copyable v-if="parsedEmail.references" :label="t('tools.email-parser.texts.label-references')" :value="parsedEmail.references" />
<input-copyable v-if="parsedEmail.deliveredTo" :label="t('tools.email-parser.texts.label-delivered-to')" :value="parsedEmail.deliveredTo" />
<input-copyable v-if="parsedEmail.returnPath" :label="t('tools.email-parser.texts.label-return-path')" :value="parsedEmail.returnPath" />
<input-copyable v-if="parsedEmail.sender?.name" :label="t('tools.email-parser.texts.label-sender-name')" :value="parsedEmail.sender?.name" />
<input-copyable v-if="parsedEmail.sender" :label="t('tools.email-parser.texts.label-sender-address')" :value="parsedEmail.sender?.address || parsedEmail.sender" />
<input-copyable
v-if="parsedEmail.messageId"
:label="t('tools.email-parser.texts.label-message-id')"
:value="parsedEmail.messageId"
/>
<input-copyable
v-if="parsedEmail.inReplyTo"
:label="t('tools.email-parser.texts.label-in-reply-to')"
:value="parsedEmail.inReplyTo"
/>
<input-copyable
v-if="parsedEmail.references"
:label="t('tools.email-parser.texts.label-references')"
:value="parsedEmail.references"
/>
<input-copyable
v-if="parsedEmail.deliveredTo"
:label="t('tools.email-parser.texts.label-delivered-to')"
:value="parsedEmail.deliveredTo"
/>
<input-copyable
v-if="parsedEmail.returnPath"
:label="t('tools.email-parser.texts.label-return-path')"
:value="parsedEmail.returnPath"
/>
<input-copyable
v-if="parsedEmail.sender?.name"
:label="t('tools.email-parser.texts.label-sender-name')"
:value="parsedEmail.sender?.name"
/>
<input-copyable
v-if="parsedEmail.sender"
:label="t('tools.email-parser.texts.label-sender-address')"
:value="parsedEmail.sender?.address || String(parsedEmail.sender)"
/>
<c-card :title="t('tools.email-parser.texts.title-all-headers')" mt-2>
<input-copyable
v-for="(h, index) in parsedEmail.headers || []"
:key="index"
:label="h.key"
:value="h.value"
/>
<input-copyable v-for="(h, index) in parsedEmail.headers || []" :key="index" :label="h.key" :value="h.value" />
</c-card>
</c-card>
</div>
+25 -28
View File
@@ -19,10 +19,10 @@ import {
createSHA512, // (): Promise<IHasher>
createSM3, // (): Promise<IHasher>
createWhirlpool, // (): Promise<IHasher>
// createXXHash32, //(seed: number): Promise<IHasher>
// createXXHash64, //(seedLow: number, seedHigh: number): Promise<IHasher>
// createXXHash3, //(seedLow: number, seedHigh: number): Promise<IHasher>
// createXXHash128, //(seedLow: number, seedHigh: number): Promise<IHasher>
// createXXHash32, //(seed: number): Promise<IHasher>
// createXXHash64, //(seedLow: number, seedHigh: number): Promise<IHasher>
// createXXHash3, //(seedLow: number, seedHigh: number): Promise<IHasher>
// createXXHash128, //(seedLow: number, seedHigh: number): Promise<IHasher>
} from 'hash-wasm';
import type { lib } from 'crypto-js';
import { enc } from 'crypto-js';
@@ -97,7 +97,7 @@ const fileReader = new FileReader();
async function hashChunkAsync(chunk: Blob, hashers: IHasher[]) {
return new Promise<void>((resolve, _reject) => {
fileReader.onload = async (e) => {
const view = new Uint8Array((e.target?.result as ArrayBuffer)!);
const view = new Uint8Array(e.target?.result as ArrayBuffer);
for (const hasher of hashers) {
hasher.update(view);
}
@@ -116,10 +116,7 @@ async function hashFileAsync(file: File) {
const hashers = await getHashersAsync();
for (let i = 0; i <= chunkNumber; i++) {
const chunk = file.slice(
chunkSize * i,
Math.min(chunkSize * (i + 1), file.size),
);
const chunk = file.slice(chunkSize * i, Math.min(chunkSize * (i + 1), file.size));
await hashChunkAsync(chunk, Object.values(hashers));
}
@@ -138,15 +135,18 @@ async function onUpload(uploadedFile: File) {
try {
hashes.value = await hashFileAsync(uploadedFile);
status.value = 'done';
}
catch (e) {
} catch (e) {
status.value = 'error';
}
}
type Encoding = keyof typeof enc | 'Bin';
const encoding = useQueryParamOrStorage<Encoding>({ defaultValue: 'Hex', storageName: 'hash-text:encoding', name: 'encoding' });
const encoding = useQueryParamOrStorage<Encoding>({
defaultValue: 'Hex',
storageName: 'hash-text:encoding',
name: 'encoding',
});
function formatWithEncoding(words: lib.WordArray, encoding: Encoding) {
if (encoding === 'Bin') {
@@ -156,16 +156,18 @@ function formatWithEncoding(words: lib.WordArray, encoding: Encoding) {
return words.toString(enc[encoding]);
}
const hashWasmValues = computed(() => withDefaultOnError(() => {
const encodingValue = encoding.value;
const hashesValue = hashes.value;
const hashWasmValues = computed(() =>
withDefaultOnError(() => {
const encodingValue = encoding.value;
const hashesValue = hashes.value;
const ret = defaultHashWasmValues;
for (const algo of algoWasmNames) {
ret[algo] = formatWithEncoding(enc.Hex.parse(hashesValue[algo]), encodingValue);
}
return ret;
}, defaultHashWasmValues));
const ret = defaultHashWasmValues;
for (const algo of algoWasmNames) {
ret[algo] = formatWithEncoding(enc.Hex.parse(hashesValue[algo]), encodingValue);
}
return ret;
}, defaultHashWasmValues),
);
</script>
<template>
@@ -204,13 +206,8 @@ const hashWasmValues = computed(() => withDefaultOnError(() => {
</c-card>
<div mt-3 flex justify-center>
<c-alert v-if="status === 'error'" type="error">
An error occured hashing file '{{ file?.name }}'.
</c-alert>
<n-spin
v-if="status === 'processing'"
size="small"
/>
<c-alert v-if="status === 'error'" type="error"> An error occured hashing file '{{ file?.name }}'. </c-alert>
<n-spin v-if="status === 'processing'" size="small" />
</div>
<c-card v-if="status === 'done'" :title="`Hashes of ${file?.name}`">
@@ -35,7 +35,14 @@ const command = computed(() => {
<div>
<NForm label-width="120px" label-placement="left">
<NFormItem :label="t('tools.firewalld-generator.texts.label-zone')">
<NSelect v-model:value="zone" :options="[{ label: t('tools.firewalld-generator.texts.label-public'), value: 'public' }, { label: t('tools.firewalld-generator.texts.label-home'), value: 'home' }, { label: t('tools.firewalld-generator.texts.label-work'), value: 'work' }]" />
<NSelect
v-model:value="zone"
:options="[
{ label: t('tools.firewalld-generator.texts.label-public'), value: 'public' },
{ label: t('tools.firewalld-generator.texts.label-home'), value: 'home' },
{ label: t('tools.firewalld-generator.texts.label-work'), value: 'work' },
]"
/>
</NFormItem>
<NFormItem :label="t('tools.firewalld-generator.texts.label-action')">
@@ -47,11 +54,23 @@ const command = computed(() => {
</NFormItem>
<NFormItem :label="t('tools.firewalld-generator.texts.label-value')">
<NInput v-model:value="value" :placeholder="t('tools.firewalld-generator.texts.placeholder-enter-the-service-port-protocol')" />
<NInput
v-model:value="value"
:placeholder="t('tools.firewalld-generator.texts.placeholder-enter-the-service-port-protocol')"
/>
</NFormItem>
<NFormItem :label="t('tools.firewalld-generator.texts.label-permanent')">
<NSelect v-model:value="permanent" :options="[{ label: t('tools.firewalld-generator.texts.label-yes'), value: true }, { label: t('tools.firewalld-generator.texts.label-no'), value: false }]" />
<NSelect
:value="permanent as any"
:options="
[
{ label: t('tools.firewalld-generator.texts.label-yes'), value: true },
{ label: t('tools.firewalld-generator.texts.label-no'), value: false },
] as any[]
"
@update:value="(v: boolean) => (permanent = v)"
/>
</NFormItem>
</NForm>
@@ -9,45 +9,68 @@ export function convertDecimalToBinary({ value, bitCount }: { value: string; bit
}
switch (bitCount) {
case 32: { // Single precision
case 32: {
// Single precision
const uint = new Uint32Array(Float32Array.of(number).buffer);
return uint[0].toString(2).padStart(32, '0');
}
case 64: { // Double precision
case 64: {
// Double precision
const uint = new Uint32Array(Float64Array.of(number).buffer);
return [...uint].slice(0, 2).reverse().map(p => p.toString(2).padStart(32, '0')).join('');
return [...uint]
.slice(0, 2)
.reverse()
.map((p) => p.toString(2).padStart(32, '0'))
.join('');
}
default:
throw new Error(t('tools.floating-point-number-converter.model.text.unsupported-bit-count-only-32-and-64-are-allowed'));
throw new Error(
t('tools.floating-point-number-converter.model.text.unsupported-bit-count-only-32-and-64-are-allowed'),
);
}
}
export function convertBinaryToDecimal({ value, decimalPrecision, removeZeroPadding }: { value: string; decimalPrecision: string; removeZeroPadding: boolean }) {
export function convertBinaryToDecimal({
value,
decimalPrecision,
removeZeroPadding,
}: {
value: string;
decimalPrecision: string;
removeZeroPadding: boolean;
}) {
if (value.match(/[^01]/)) {
throw new Error(t('tools.floating-point-number-converter.model.text.not-a-binary-number'));
}
if (decimalPrecision.match(/[^\d]/)) {
throw new Error(t('tools.floating-point-number-converter.model.text.decimal-precision-must-be-a-positive-whole-number'));
throw new Error(
t('tools.floating-point-number-converter.model.text.decimal-precision-must-be-a-positive-whole-number'),
);
}
let result: number;
switch (value.length) {
case 32: {
const binary = [Number.parseInt(value, 2)];
result = (new Float32Array(Uint32Array.from(binary).buffer))[0];
result = new Float32Array(Uint32Array.from(binary).buffer)[0];
break;
}
case 64: {
const binary = [Number.parseInt(value.substring(32), 2), Number.parseInt(value.substring(0, 32), 2)];
result = (new Float64Array(Uint32Array.from(binary).buffer))[0];
result = new Float64Array(Uint32Array.from(binary).buffer)[0];
break;
}
default:
throw new Error(t('tools.floating-point-number-converter.model.text.invalid-length-supply-a-binary-string-with-length-32-or-64'));
throw new Error(
t(
'tools.floating-point-number-converter.model.text.invalid-length-supply-a-binary-string-with-length-32-or-64',
),
);
}
const zeroNegative = result === 0 && 2 / result === Number.NEGATIVE_INFINITY;
let resultString = decimalPrecision.length === 0 ? result.toString() : result.toFixed(Number.parseInt(decimalPrecision));
let resultString =
decimalPrecision.length === 0 ? result.toString() : result.toFixed(Number.parseInt(decimalPrecision));
if (removeZeroPadding) {
resultString = resultString.replace(/\.(\d+?)(0+)$/, '.$1');
}
@@ -55,5 +78,7 @@ export function convertBinaryToDecimal({ value, decimalPrecision, removeZeroPadd
}
export function calcErrorDueToConversion({ decimalInput, actualValue }: { decimalInput: string; actualValue: string }) {
// toFixed(32) is valid since ES2018 (0-100) and needed for sub-1e-20 conversion errors
// oxlint-disable-next-line oxc/number-arg-out-of-range
return (Number.parseFloat(decimalInput) - Number.parseFloat(actualValue)).toFixed(32).replace(/\.(\d+?)(0+)$/, '.$1');
}
+27 -27
View File
@@ -2,37 +2,37 @@
import UnitsConverter from '@/components/UnitsConverter.vue';
const supportedUnits = {
'N': 'newton',
'PN': 'petanewton',
'TN': 'teranewton',
'GN': 'giganewton',
'MN': 'meganewton',
'kN': 'kilonewton',
'hN': 'hectonewton',
'daN': 'decanewton',
'dN': 'decinewton',
'cN': 'centinewton',
'mN': 'millinewton',
'µN': 'micronewton',
'nN': 'nanonewton',
'pN': 'piconewton',
'fN': 'femtonewton',
'dyn': 'dyne',
'lbf': 'pound of force',
'kip': 'kip',
'klb': 'klb',
'kipf': 'kipf',
'klbf': 'klbf',
'pdl': 'poundal',
'kgf': 'kilogram-force',
'kp': 'kilopond',
'Mp': 'megapond',
'tf': 'tonne-force',
N: 'newton',
PN: 'petanewton',
TN: 'teranewton',
GN: 'giganewton',
MN: 'meganewton',
kN: 'kilonewton',
hN: 'hectonewton',
daN: 'decanewton',
dN: 'decinewton',
cN: 'centinewton',
mN: 'millinewton',
µN: 'micronewton',
nN: 'nanonewton',
pN: 'piconewton',
fN: 'femtonewton',
dyn: 'dyne',
lbf: 'pound of force',
kip: 'kip',
klb: 'klb',
kipf: 'kipf',
klbf: 'klbf',
pdl: 'poundal',
kgf: 'kilogram-force',
kp: 'kilopond',
Mp: 'megapond',
tf: 'tonne-force',
'metric tf': 'metric ton-force',
'megagram-force': 'megagram-force',
};
</script>
<template>
<UnitsConverter default-unit="N" :supported-units="supportedUnits" label-width="150px" />
<UnitsConverter default-unit="N" converter-type="convert" :supported-units="supportedUnits" label-width="150px" />
</template>
+15 -15
View File
@@ -18,7 +18,7 @@ ffmpeg.on('log', ({ message }) => {
const loading = ref(false);
const error = ref('');
const loop = ref('5');
const loop = ref(5);
async function loadFFmpeg() {
if (!ffmpeg.loaded) {
@@ -49,16 +49,21 @@ async function onFileUploaded(gifFile: File) {
ffmpeg.writeFile(inputName, buffer);
await ffmpeg.exec([
'-stream_loop', loop.value,
'-i', inputName,
'-movflags', 'faststart',
'-pix_fmt', 'yuv420p',
'-vf', 'scale=trunc(iw/2)*2:trunc(ih/2)*2',
'-stream_loop',
loop.value.toString(),
'-i',
inputName,
'-movflags',
'faststart',
'-pix_fmt',
'yuv420p',
'-vf',
'scale=trunc(iw/2)*2:trunc(ih/2)*2',
outputName,
]);
const data = await ffmpeg.readFile(outputName);
const blob = new Blob([data], { type: 'video/mp4' });
const blob = new Blob([data as BlobPart], { type: 'video/mp4' });
const url = URL.createObjectURL(blob);
const a = document.createElement('a');
@@ -67,11 +72,9 @@ async function onFileUploaded(gifFile: File) {
a.click();
URL.revokeObjectURL(url);
}
catch (err: any) {
} catch (err: any) {
error.value = err.toString();
}
finally {
} finally {
loading.value = false;
}
}
@@ -99,10 +102,7 @@ async function onFileUploaded(gifFile: File) {
<c-alert v-if="error" type="error">
{{ error }}
</c-alert>
<n-spin
v-if="loading"
size="small"
/>
<n-spin v-if="loading" size="small" />
</div>
<c-card :title="t('tools.gif-to-mp4.texts.title-logs')">
@@ -15,7 +15,7 @@ const CACHE_TTL = 1000 * 60 * 60 * 24; // 24h
async function loadOptions() {
const now = Date.now();
const isStale = !options.value.length || (now - lastFetched.value > CACHE_TTL);
const isStale = !options.value.length || now - lastFetched.value > CACHE_TTL;
if (!isStale) {
// Use cached options
@@ -23,7 +23,9 @@ async function loadOptions() {
}
try {
const res = await fetch('https://api.github.com/repos/alexkaratarakis/gitattributes/git/trees/master?recursive=true');
const res = await fetch(
'https://api.github.com/repos/alexkaratarakis/gitattributes/git/trees/master?recursive=true',
);
const files = await res.json();
options.value = files.tree
.filter((f: any) => f.path.endsWith('.gitattributes'))
@@ -34,8 +36,7 @@ async function loadOptions() {
value: name,
}));
lastFetched.value = now;
}
catch {
} catch {
if (!options.value?.length) {
options.value = [
'ActionScript',
@@ -61,7 +62,7 @@ async function loadOptions() {
'Servoy',
'VisualStudio',
'Web',
].map(name => ({
].map((name) => ({
label: name,
value: name,
}));
@@ -83,10 +84,10 @@ async function generateOutput() {
// Multi-command generation
const commands = computed(() => {
if (!selected.value.length) {
return {};
return { curl: '', wget: '', powershell: '', cmd: '' };
}
const urls = selected.value
.map(lang => `https://raw.githubusercontent.com/alexkaratarakis/gitattributes/master/${lang}.gitattributes`)
.map((lang) => `https://raw.githubusercontent.com/alexkaratarakis/gitattributes/master/${lang}.gitattributes`)
.join(' ');
return {
curl: `curl ${urls} > .gitattributes`,
@@ -116,11 +117,7 @@ onMounted(loadOptions);
</NButton>
</n-space>
<c-card v-if="output" :title="t('tools.gitattributes-generator.texts.title-preview')" mb-2>
<textarea-copyable
:value="output"
language="bash"
download-file-name=".gitattributes"
/>
<textarea-copyable :value="output" language="bash" download-file-name=".gitattributes" />
</c-card>
<NTabs v-if="output" type="line" animated>
+28 -28
View File
@@ -1,30 +1,30 @@
declare module 'heic-convert/browser' {
interface ConversionOptions {
/**
* the HEIC file buffer
*/
buffer: ArrayBufferLike;
/**
* output format
*/
format: "JPEG" | "PNG";
/**
* the JPEG compression quality, between 0 and 1
* @default 0.92
*/
quality?: number;
}
interface Convertible {
convert(): Promise<ArrayBuffer>;
}
interface ConversionOptions {
/**
* the HEIC file buffer
*/
buffer: ArrayBufferLike | Uint8Array;
/**
* output format
*/
format: 'JPEG' | 'PNG';
/**
* the JPEG compression quality, between 0 and 1
* @default 0.92
*/
quality?: number;
}
interface Convertible {
convert(): Promise<ArrayBuffer>;
}
/** @async */
function convert(image: ConversionOptions): Promise<ArrayBuffer>;
namespace convert {
/** @async */
declare function convert(image: ConversionOptions): Promise<ArrayBuffer>;
declare namespace convert {
/** @async */
function all(image: ConversionOptions): Promise<Convertible[]>;
}
export default convert;
}
function all(image: ConversionOptions): Promise<Convertible[]>;
}
export default convert;
}
+41 -68
View File
@@ -58,8 +58,7 @@ function urlToFilename(input: string): string {
try {
url = new URL(input);
}
catch {
} catch {
throw new Error(`Invalid URL: ${input}`);
}
@@ -91,18 +90,15 @@ async function generateFromUrl() {
isRunning.value = true;
try {
const res = await fetch(`${serverHost.value}/pdf/url`, {
...{
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(payload),
},
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(payload),
...(serverAuth.value ? { headers: { Authorization: `Basic ${Base64.encode(serverAuth.value)}` } } : {}),
});
const blob = await res.blob();
downloadBlob(blob, `${urlToFilename(url.value)}.pdf`);
}
catch (e: any) {
} catch (e: any) {
error.value = e.toString();
}
isRunning.value = false;
@@ -115,18 +111,15 @@ async function generateFromHtml() {
isRunning.value = true;
try {
const res = await fetch(`${serverHost.value}/pdf/html`, {
...{
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(payload),
},
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(payload),
...(serverAuth.value ? { headers: { Authorization: `Basic ${Base64.encode(serverAuth.value)}` } } : {}),
});
const blob = await res.blob();
downloadBlob(blob, 'printed.pdf');
}
catch (e: any) {
} catch (e: any) {
error.value = e.toString();
}
isRunning.value = false;
@@ -134,7 +127,7 @@ async function generateFromHtml() {
const batchUrls = ref('');
const batchResults = ref<{ url: string; status: 'success' | 'error' ; pdfBlob?: Blob; error?: string }[]>([]);
const batchResults = ref<{ url: string; status: 'success' | 'error'; pdfBlob?: Blob; error?: string }[]>([]);
const batchProgress = ref(0);
const batchTotal = ref(0);
const isBatchRunning = ref(false);
@@ -142,7 +135,7 @@ const isBatchRunning = ref(false);
async function generateBatch() {
const urls = batchUrls.value
.split('\n')
.map(u => u.trim())
.map((u) => u.trim())
.filter(Boolean);
batchResults.value = [];
@@ -155,11 +148,9 @@ async function generateBatch() {
try {
const res = await fetch(`${serverHost.value}/pdf/url`, {
...{
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(payload),
},
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(payload),
...(serverAuth.value ? { headers: { Authorization: `Basic ${Base64.encode(serverAuth.value)}` } } : {}),
});
@@ -170,8 +161,7 @@ async function generateBatch() {
status: 'success',
pdfBlob: blob,
});
}
catch (err: any) {
} catch (err: any) {
batchResults.value.push({
url: u,
status: 'error',
@@ -192,13 +182,27 @@ async function generateBatch() {
<summary>{{ t('tools.html-to-pdf.texts.tag-html-to-pdf-service-configuration-self-hosted') }}</summary>
<n-card>
<NFormItem :label="t('tools.html-to-pdf.texts.label-html-to-pdf-service-url')" label-placement="top">
<NInput v-model:value="serverHost" :placeholder="t('tools.html-to-pdf.texts.placeholder-http-localhost-3000')" />
<NInput
v-model:value="serverHost"
:placeholder="t('tools.html-to-pdf.texts.placeholder-http-localhost-3000')"
/>
</NFormItem>
<NFormItem :label="t('tools.html-to-pdf.texts.label-basic-authentication')" label-placement="left" label-width="auto">
<NInput v-model:value="serverAuth" :placeholder="t('tools.html-to-pdf.texts.placeholder-username-password')" />
<NFormItem
:label="t('tools.html-to-pdf.texts.label-basic-authentication')"
label-placement="left"
label-width="auto"
>
<NInput
v-model:value="serverAuth"
:placeholder="t('tools.html-to-pdf.texts.placeholder-username-password')"
/>
</NFormItem>
<n-p>
{{ t('tools.html-to-pdf.texts.tag-you-must-self-host-html-to-pdf-service-see') }}<c-link href="https://github.com/sharevb/puppeteer-htmltopdf?tab=readme-ov-file#running-in-docker" target="_blank">
{{ t('tools.html-to-pdf.texts.tag-you-must-self-host-html-to-pdf-service-see')
}}<c-link
href="https://github.com/sharevb/puppeteer-htmltopdf?tab=readme-ov-file#running-in-docker"
target="_blank"
>
{{ t('tools.html-to-pdf.texts.tag-html-to-pdf-service-install') }}
</c-link>
</n-p>
@@ -213,12 +217,7 @@ async function generateBatch() {
</NFormItem>
<n-space mb-2 justify="center">
<NButton
type="primary"
:loading="isRunning"
:disabled="isRunning"
@click="generateFromUrl"
>
<NButton type="primary" :loading="isRunning" :disabled="isRunning" @click="generateFromUrl">
{{ t('tools.html-to-pdf.texts.tag-generate-pdf') }}
</NButton>
</n-space>
@@ -232,20 +231,11 @@ async function generateBatch() {
<NTabPane name="html" :tab="t('tools.html-to-pdf.texts.tab-html-pdf')">
<NForm label-placement="top">
<NFormItem :label="t('tools.html-to-pdf.texts.label-html-content')">
<NInput
v-model:value="html"
type="textarea"
:autosize="{ minRows: 10 }"
/>
<NInput v-model:value="html" type="textarea" :autosize="{ minRows: 10 }" />
</NFormItem>
<n-space mb-2 justify="center">
<NButton
type="primary"
:loading="isRunning"
:disabled="isRunning"
@click="generateFromHtml"
>
<NButton type="primary" :loading="isRunning" :disabled="isRunning" @click="generateFromHtml">
{{ t('tools.html-to-pdf.texts.tag-generate-pdf') }}
</NButton>
</n-space>
@@ -259,20 +249,11 @@ async function generateBatch() {
<NTabPane name="batch" :tab="t('tools.html-to-pdf.texts.tab-batch-url-pdf')">
<NForm label-placement="top">
<NFormItem :label="t('tools.html-to-pdf.texts.label-urls-one-per-line')">
<NInput
v-model:value="batchUrls"
type="textarea"
:autosize="{ minRows: 8 }"
/>
<NInput v-model:value="batchUrls" type="textarea" :autosize="{ minRows: 8 }" />
</NFormItem>
<n-space mb-2 justify="center">
<NButton
type="primary"
:loading="isBatchRunning"
:disabled="isBatchRunning"
@click="generateBatch"
>
<NButton type="primary" :loading="isBatchRunning" :disabled="isBatchRunning" @click="generateBatch">
{{ t('tools.html-to-pdf.texts.tag-generate-pdfs') }}
</NButton>
</n-space>
@@ -285,9 +266,7 @@ async function generateBatch() {
indicator-placement="inside"
processing
/>
<n-space justify="center">
{{ batchProgress }} / {{ batchTotal }} processed
</n-space>
<n-space justify="center"> {{ batchProgress }} / {{ batchTotal }} processed </n-space>
</div>
<!-- Results -->
@@ -298,10 +277,7 @@ async function generateBatch() {
<th>{{ t('tools.html-to-pdf.texts.tag-download') }}</th>
</thead>
<tbody>
<tr
v-for="item in batchResults"
:key="item.url"
>
<tr v-for="item in batchResults" :key="item.url">
<td>
<strong>{{ item.url }}</strong>
</td>
@@ -336,10 +312,7 @@ async function generateBatch() {
<NTabPane name="custom-options" :tab="t('tools.html-to-pdf.texts.tab-custom-pdf-options')">
<NForm label-placement="left">
<NFormItem :label="t('tools.html-to-pdf.texts.label-format')">
<NSelect
v-model:value="options.format"
:options="pdfFormats"
/>
<NSelect v-model:value="options.format" :options="pdfFormats" />
</NFormItem>
<NFormItem :label="t('tools.html-to-pdf.texts.label-language')">
@@ -1,27 +1,34 @@
import { DomUtils, parseDocument } from 'htmlparser2';
export interface XhtmlOptions {
addNamespace?: boolean // add http://www.w3.org/1999/xhtml
indent?: number // number of spaces per indent level
addNamespace?: boolean; // add http://www.w3.org/1999/xhtml
indent?: number; // number of spaces per indent level
}
export function toStrictXhtml(html: string, options: XhtmlOptions = {}): string {
// FULL canonical void element list
const voidElements = new Set([
'area', 'base', 'br', 'col', 'embed', 'hr', 'img',
'input', 'link', 'meta', 'param', 'source', 'track', 'wbr',
'area',
'base',
'br',
'col',
'embed',
'hr',
'img',
'input',
'link',
'meta',
'param',
'source',
'track',
'wbr',
]);
const escapeXml = (value: string) =>
value
.replace(/&/g, '&amp;')
.replace(/</g, '&lt;')
.replace(/>/g, '&gt;')
.replace(/"/g, '&quot;');
value.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/"/g, '&quot;');
const indentSize = options.indent ?? 0;
const indentStr = (level: number) =>
indentSize > 0 ? ' '.repeat(level * indentSize) : '';
const indentStr = (level: number) => (indentSize > 0 ? ' '.repeat(level * indentSize) : '');
const serialize = (node: any, level = 0): string => {
if (DomUtils.isText(node)) {
@@ -38,7 +45,7 @@ export function toStrictXhtml(html: string, options: XhtmlOptions = {}): string
const tag = node.name.toLowerCase();
// Attributes
const attrsObj = { ...(node.attribs || {}) };
const attrsObj = { ...node.attribs };
// Inject namespace on root element if requested
if (options.addNamespace && node.parent?.type === 'root') {
@@ -59,7 +66,7 @@ export function toStrictXhtml(html: string, options: XhtmlOptions = {}): string
// NORMAL ELEMENT
const children = (node.children || [])
.map(child => serialize(child, level + 1))
.map((child) => serialize(child, level + 1))
.join(indentSize > 0 ? '\n' : '');
if (indentSize > 0) {
@@ -77,7 +84,5 @@ export function toStrictXhtml(html: string, options: XhtmlOptions = {}): string
const doc = parseDocument(html);
return doc.children
.map(node => serialize(node, 0))
.join(indentSize > 0 ? '\n' : '');
return doc.children.map((node) => serialize(node, 0)).join(indentSize > 0 ? '\n' : '');
}
+58 -103
View File
@@ -21,13 +21,15 @@ async function api(path: string, params: Record<string, string | number | boolea
const url = `${serverHost.value}${path}?${pathParams.toString()}`;
const response = await fetch(url,
const response = await fetch(
url,
serverAuth.value
? {
method: 'GET',
headers: { Authorization: `Basic ${Base64.encode(serverAuth.value)}` },
}
: undefined);
: undefined,
);
if (!response.ok) {
const text = await response.text();
@@ -35,11 +37,9 @@ async function api(path: string, params: Record<string, string | number | boolea
}
return await response.json();
}
catch (err: any) {
} catch (err: any) {
error.value = err.toString();
}
finally {
} finally {
loading.value = false;
}
}
@@ -47,44 +47,43 @@ async function api(path: string, params: Record<string, string | number | boolea
type AnyDict = Record<string, any>;
interface CertificateCheckResult {
ok: boolean
hostname: string
port: number
not_before?: string | null
not_after?: string | null
days_until_expiry?: number | null
subject?: AnyDict | null
issuer?: AnyDict | null
san?: any[] | null
error?: string | null
ok: boolean;
hostname: string;
port: number;
not_before?: string | null;
not_after?: string | null;
days_until_expiry?: number | null;
subject?: AnyDict | null;
issuer?: AnyDict | null;
san?: any[] | null;
error?: string | null;
}
interface HSTSCheckResult {
ok: boolean
url: string
hsts_present: boolean
max_age?: number | null
include_subdomains: boolean
preload: boolean
raw_header?: string | null
error?: string | null
ok: boolean;
url: string;
hsts_present: boolean;
max_age?: number | null;
include_subdomains: boolean;
preload: boolean;
raw_header?: string | null;
error?: string | null;
}
interface RedirectCheckResult {
ok: boolean
http_url: string
redirected: boolean
final_url?: string | null
status_code?: number | null
redirect_chain?: { status_code: number; url: string; headers: Record<string, string> }[] | null
error?: string | null
ok: boolean;
http_url: string;
redirected: boolean;
final_url?: string | null;
status_code?: number | null;
redirect_chain?: { status_code: number; url: string; headers: Record<string, string> }[] | null;
error?: string | null;
}
function prettyJSON(value: unknown): string {
try {
return JSON.stringify(value, null, 2);
}
catch {
} catch {
return String(value);
}
}
@@ -98,7 +97,7 @@ function formatDate(value: string | null | undefined): string {
}
const certHost = ref('');
const certPort = ref(443);
const certPort = ref('443');
const certResult = ref<CertificateCheckResult | null>(null);
const hstsUrl = ref('');
@@ -154,9 +153,7 @@ const labelProps = {
<c-input-text v-model:value="certHost" label="Host:" v-bind="labelProps" placeholder="example.com" mb-1 />
<c-input-text v-model:value="certPort" label="Port:" v-bind="labelProps" placeholder="443" mb-1 />
<div mb-2 flex justify-center>
<n-button type="primary" :loading="loading" @click="runCertificate">
Check Certificate
</n-button>
<n-button type="primary" :loading="loading" @click="runCertificate"> Check Certificate </n-button>
</div>
<n-card v-if="certResult" title="Result">
@@ -169,50 +166,31 @@ const labelProps = {
<input-copyable label="Hostname:" v-bind="labelProps" :value="certResult.hostname" mb-1 />
<input-copyable label="Port:" v-bind="labelProps" :value="certResult.port" mb-1 />
<input-copyable
label="Not before:"
v-bind="labelProps"
:value="formatDate(certResult.not_before)" mb-1
/>
<input-copyable label="Not before:" v-bind="labelProps" :value="formatDate(certResult.not_before)" mb-1 />
<input-copyable
label="Not after:"
v-bind="labelProps"
:value="formatDate(certResult.not_after)" mb-1
/>
<input-copyable label="Not after:" v-bind="labelProps" :value="formatDate(certResult.not_after)" mb-1 />
<input-copyable
label="Days until expiry:"
v-bind="labelProps"
:value="String(certResult.days_until_expiry)" mb-1
:value="String(certResult.days_until_expiry)"
mb-1
/>
<input-copyable
label="Subject:"
v-bind="labelProps"
:value="prettyJSON(certResult.subject)" mb-1
/>
<input-copyable label="Subject:" v-bind="labelProps" :value="prettyJSON(certResult.subject)" mb-1 />
<input-copyable
label="Issuer:"
v-bind="labelProps"
:value="prettyJSON(certResult.issuer)" mb-1
/>
<input-copyable label="Issuer:" v-bind="labelProps" :value="prettyJSON(certResult.issuer)" mb-1 />
<input-copyable
v-for="(san, index) in certResult.san"
:key="index"
label="Sub. Alt. Name:"
v-bind="labelProps"
:value="prettyJSON(san)" mb-1
:value="prettyJSON(san)"
mb-1
/>
<n-alert
v-if="certResult.error"
type="error"
:bordered="false"
show-icon
>
<n-alert v-if="certResult.error" type="error" :bordered="false" show-icon>
{{ certResult.error }}
</n-alert>
</n-card>
@@ -226,9 +204,7 @@ const labelProps = {
<n-tab-pane name="hsts" tab="HSTS">
<c-input-text v-model:value="hstsUrl" label="URL:" v-bind="labelProps" placeholder="https://example.com" mb-1 />
<div mb-2 flex justify-center>
<n-button type="primary" :loading="loading" @click="runHsts">
Check HSTS
</n-button>
<n-button type="primary" :loading="loading" @click="runHsts"> Check HSTS </n-button>
</div>
<n-card v-if="hstsResult" title="Result">
@@ -262,12 +238,7 @@ const labelProps = {
mb-1
/>
<input-copyable
label="Preload"
v-bind="labelProps"
:value="hstsResult.preload ? 'Yes' : 'No'"
mb-1
/>
<input-copyable label="Preload" v-bind="labelProps" :value="hstsResult.preload ? 'Yes' : 'No'" mb-1 />
<input-copyable
v-if="hstsResult.raw_header"
@@ -277,12 +248,7 @@ const labelProps = {
mb-1
/>
<n-alert
v-if="hstsResult.error"
type="error"
:bordered="false"
show-icon
>
<n-alert v-if="hstsResult.error" type="error" :bordered="false" show-icon>
{{ hstsResult.error }}
</n-alert>
</n-card>
@@ -295,11 +261,15 @@ const labelProps = {
<!-- REDIRECT -->
<n-tab-pane name="redirect" tab="HTTP → HTTPS Redirect">
<n-form>
<c-input-text v-model:value="redirectDomain" label="Domain:" v-bind="labelProps" placeholder="example.com" mb-1 />
<c-input-text
v-model:value="redirectDomain"
label="Domain:"
v-bind="labelProps"
placeholder="example.com"
mb-1
/>
<div mb-2 flex justify-center>
<n-button type="primary" :loading="loading" @click="runRedirect">
Check Redirect
</n-button>
<n-button type="primary" :loading="loading" @click="runRedirect"> Check Redirect </n-button>
</div>
</n-form>
@@ -319,25 +289,15 @@ const labelProps = {
mb-1
/>
<input-copyable
label="Final URL"
v-bind="labelProps"
:value="redirectResult.final_url"
mb-1
/>
<input-copyable label="Final URL" v-bind="labelProps" :value="redirectResult.final_url" mb-1 />
<input-copyable
label="Status code"
v-bind="labelProps"
:value="String(redirectResult.status_code)"
mb-1
/>
<input-copyable label="Status code" v-bind="labelProps" :value="String(redirectResult.status_code)" mb-1 />
<input-copyable
v-if="redirectResult.redirect_chain"
label="Redirect chain:"
v-bind="labelProps"
:value="redirectResult.redirect_chain.map(r => r.url).join(' → ')"
:value="redirectResult.redirect_chain.map((r) => r.url).join(' → ')"
mb-1
/>
@@ -350,12 +310,7 @@ const labelProps = {
/>
</n-card>
<n-alert
v-if="redirectResult.error"
type="error"
:bordered="false"
show-icon
>
<n-alert v-if="redirectResult.error" type="error" :bordered="false" show-icon>
{{ redirectResult.error }}
</n-alert>
</n-card>
@@ -10,16 +10,18 @@ const { t } = useI18n();
const rawIbans = useQueryParam({ tool: 'iban-validator', name: 'iban', defaultValue: '' });
interface IbanInfo {
iban: string
infos: CKeyValueListItems
iban: string;
infos: CKeyValueListItems;
}
const ibansInfo = computed<IbanInfo[]>(() => {
if (!rawIbans.value?.trim()) {
return [];
}
const ibans = rawIbans.value.toUpperCase()
.split(/\n/).map(iban => iban.replace(/\s/g, '').replace(/-/g, ''))
const ibans = rawIbans.value
.toUpperCase()
.split(/\n/)
.map((iban) => iban.replace(/\s/g, '').replace(/-/g, ''))
.filter(Boolean);
if (!ibans.length) {
@@ -70,11 +72,7 @@ const ibansInfo = computed<IbanInfo[]>(() => {
return results;
});
const ibanExamples = [
'FR7630006000011234567890189',
'DE89370400440532013000',
'GB29NWBK60161331926819',
];
const ibanExamples = ['FR7630006000011234567890189', 'DE89370400440532013000', 'GB29NWBK60161331926819'];
</script>
<template>
@@ -95,7 +93,7 @@ const ibanExamples = [
<c-card :title="t('tools.iban-validator-and-parser.texts.title-valid-iban-examples')" mt-5>
<div v-for="iban in ibanExamples" :key="iban">
<c-text-copyable :value="iban" font-mono :displayed-value="friendlyFormatIBAN(iban)" />
<c-text-copyable :value="iban" font-mono :displayed-value="friendlyFormatIBAN(iban) ?? undefined" />
</div>
</c-card>
</div>
+38 -22
View File
@@ -2,7 +2,17 @@
import { useI18n } from 'vue-i18n';
import { Base64 } from 'js-base64';
import type { MemoryImage } from 'image-in-browser';
import { decodeImage, encodeBmp, encodeGif, encodeIco, encodeJpg, encodePng, encodePvr, encodeTga, encodeTiff } from 'image-in-browser';
import {
decodeImage,
encodeBmp,
encodeGif,
encodeIco,
encodeJpg,
encodePng,
encodePvr,
encodeTga,
encodeTiff,
} from 'image-in-browser';
import { arrayBufferToWebP } from 'webp-converter-browser';
import { createSvg2png, initialize } from 'svg2png-wasm';
import { normal as robotoBase64 } from 'roboto-base64';
@@ -16,7 +26,7 @@ function readAsText(file: File) {
const reader = new FileReader();
reader.readAsText(file);
reader.onload = () => resolve(reader.result?.toString() ?? '');
reader.onerror = error => reject(error);
reader.onerror = (error) => reject(error);
});
}
@@ -27,12 +37,11 @@ const svgScale = ref(2);
const base64OutputFile = ref('');
const fileName = ref('');
const fileExtension = ref('');
const { download } = useDownloadFileFromBase64(
{
source: base64OutputFile,
filename: fileName,
extension: fileExtension,
});
const { download } = useDownloadFileFromBase64({
source: base64OutputFile,
filename: fileName,
extension: fileExtension,
});
const outputQuality = useQueryParamOrStorage({ name: 'qual', storageName: 'imgconv:q', defaultValue: 0.95 });
const outputFormats = {
@@ -95,11 +104,10 @@ async function onFileUploaded(uploadedFile: File) {
status.value = 'processing';
try {
if (outputFormatValue === 'webp') {
const encodedImage = await arrayBufferToWebP(fileBuffer);
const encodedImage = await arrayBufferToWebP(fileBuffer.buffer);
fileExtension.value = 'webp';
base64OutputFile.value = `data:image/webp;base64,${Base64.fromUint8Array(new Uint8Array(await encodedImage.arrayBuffer()))}`;
}
else {
} else {
if (uploadedFile.type === 'image/svg+xml') {
if (!svgWasmLoaded.value) {
await initialize(fetch('/svg2png_wasm_bg.wasm'));
@@ -108,7 +116,9 @@ async function onFileUploaded(uploadedFile: File) {
const svg2png = createSvg2png({
fonts: [Base64.toUint8Array(robotoBase64)],
});
fileBuffer = await svg2png(await readAsText(uploadedFile), { scale: svgScale.value });
fileBuffer = (await svg2png(await readAsText(uploadedFile), {
scale: svgScale.value,
})) as Uint8Array<ArrayBuffer>;
svg2png.dispose();
}
const decodedImage = decodeImage({
@@ -117,9 +127,9 @@ async function onFileUploaded(uploadedFile: File) {
if (decodedImage == null) {
throw new Error(t('tools.image-converter.texts.invalid-image-file'));
};
}
const outConfig = outputFormats[outputFormatValue as (keyof typeof outputFormats)];
const outConfig = outputFormats[outputFormatValue as keyof typeof outputFormats];
const encodedImage = outConfig.save(decodedImage);
fileExtension.value = outputFormatValue;
base64OutputFile.value = `data:${outConfig.mime};base64,${Base64.fromUint8Array(encodedImage!)}`;
@@ -127,8 +137,7 @@ async function onFileUploaded(uploadedFile: File) {
status.value = 'done';
download();
}
catch (e) {
} catch (e) {
status.value = 'error';
}
}
@@ -148,7 +157,11 @@ async function onFileUploaded(uploadedFile: File) {
/>
<div mb-2 flex justify-center>
<n-form-item v-if="outputFormatHasQuality" :label="t('tools.image-converter.texts.label-output-quality')" label-placement="left">
<n-form-item
v-if="outputFormatHasQuality"
:label="t('tools.image-converter.texts.label-output-quality')"
label-placement="left"
>
<n-input-number-i18n v-model:value="outputQuality" :max="100" :min="0" w-full />
</n-form-item>
<n-form-item :label="t('tools.image-converter.texts.label-svg-scaling')" label-placement="left">
@@ -156,7 +169,13 @@ async function onFileUploaded(uploadedFile: File) {
</n-form-item>
</div>
<h4>{{ t('tools.image-converter.texts.tag-then-drag-and-drop-your-images-below-and-they-will-be-converted-and-downloaded-immediately') }}</h4>
<h4>
{{
t(
'tools.image-converter.texts.tag-then-drag-and-drop-your-images-below-and-they-will-be-converted-and-downloaded-immediately',
)
}}
</h4>
<div style="flex: 0 0 100%" mb-2>
<div mx-auto max-w-600px>
@@ -175,10 +194,7 @@ async function onFileUploaded(uploadedFile: File) {
<c-alert v-if="status === 'error'" type="error">
{{ $t('tools.image-converter.texts.an-error-occured-processing') }} <span>{{ fileName }}</span>
</c-alert>
<n-spin
v-if="status === 'processing'"
size="small"
/>
<n-spin v-if="status === 'processing'" size="small" />
</div>
</div>
</template>
+9 -9
View File
@@ -1,17 +1,17 @@
declare module 'ip-bigint' {
type IPInfo = {
number: bigint;
number: bigint;
version: number;
ipv4mapped?: boolean;
scopeid?:string;
scopeid?: string;
};
type StringifyOptions = {
compress?:boolean;
hexify?:boolean;
type StringifyOptions = {
compress?: boolean;
hexify?: boolean;
};
export function normalizeIp(ip: string, options: StringifyOptions = {compress = true, hexify = false} = {})
export function stringifyIp(ip: IPInfo, options: StringifyOptions = {compress = true, hexify = false}): string;
export function normalizeIp(ip: string, options?: StringifyOptions): string;
export function stringifyIp(ip: IPInfo, options?: StringifyOptions): string;
export function ipVersion(ip: string): number;
export function parseIp(ip): IPInfo;
}
}
@@ -10,68 +10,83 @@ import { useQueryParamOrStorage } from '@/composable/queryParams';
const { t } = useI18n();
const rawIpAddress = useQueryParamOrStorage({ name: 'ip', storageName: 'ipv4-converter:ip', defaultValue: '192.168.1.1' }); // NOSONAR
const rawIpAddress = useQueryParamOrStorage({
name: 'ip',
storageName: 'ipv4-converter:ip',
defaultValue: '192.168.1.1',
}); // NOSONAR
const convertedSections = computed(() => withDefaultOnError(() => {
const ipInDecimal = ipv4ToInt({ ip: rawIpAddress.value });
const convertedSections = computed(() =>
withDefaultOnError(() => {
const ipInDecimal = ipv4ToInt({ ip: rawIpAddress.value });
return [
{
label: t('tools.ipv4-address-converter.texts.label-decimal'),
value: String(ipInDecimal),
},
{
label: t('tools.ipv4-address-converter.texts.label-hexadecimal'),
value: convertBase({ fromBase: 10, toBase: 16, value: String(ipInDecimal) }).toUpperCase(),
},
{
label: t('tools.ipv4-address-converter.texts.label-binary'),
value: convertBase({ fromBase: 10, toBase: 2, value: String(ipInDecimal) }),
},
{
label: t('tools.ipv4-address-converter.texts.label-ipv6'),
value: ipv4ToIpv6({ ip: rawIpAddress.value }),
},
{
label: t('tools.ipv4-address-converter.texts.label-ipv6-short'),
value: ipv4ToIpv6({ ip: rawIpAddress.value, prefix: '::ffff:' }),
},
{
label: t('tools.ipv4-address-converter.texts.label-ipv6-decimal'),
value: toIPv4MappedAddressDecimal(rawIpAddress.value),
},
{
label: t('tools.ipv4-address-converter.texts.label-6to4-prefix'),
value: to6to4Prefix(rawIpAddress.value),
},
{
label: t('tools.ipv4-address-converter.texts.label-cidr-notation'),
value: `${rawIpAddress.value}/32`,
},
{
label: t('tools.ipv4-address-converter.texts.label-arpa'),
value: toARPA(rawIpAddress.value),
},
{
label: t('tools.ipv4-address-converter.texts.label-ip-class'),
value: getIPClass({ ip: rawIpAddress.value }),
},
{
label: t('tools.ipv4-address-converter.texts.label-type'),
value: getIPNetworkType(rawIpAddress.value),
},
];
}, []));
return [
{
label: t('tools.ipv4-address-converter.texts.label-decimal'),
value: String(ipInDecimal),
},
{
label: t('tools.ipv4-address-converter.texts.label-hexadecimal'),
value: convertBase({ fromBase: 10, toBase: 16, value: String(ipInDecimal) }).toUpperCase(),
},
{
label: t('tools.ipv4-address-converter.texts.label-binary'),
value: convertBase({ fromBase: 10, toBase: 2, value: String(ipInDecimal) }),
},
{
label: t('tools.ipv4-address-converter.texts.label-ipv6'),
value: ipv4ToIpv6({ ip: rawIpAddress.value }),
},
{
label: t('tools.ipv4-address-converter.texts.label-ipv6-short'),
value: ipv4ToIpv6({ ip: rawIpAddress.value, prefix: '::ffff:' }),
},
{
label: t('tools.ipv4-address-converter.texts.label-ipv6-decimal'),
value: toIPv4MappedAddressDecimal(rawIpAddress.value),
},
{
label: t('tools.ipv4-address-converter.texts.label-6to4-prefix'),
value: to6to4Prefix(rawIpAddress.value),
},
{
label: t('tools.ipv4-address-converter.texts.label-cidr-notation'),
value: `${rawIpAddress.value}/32`,
},
{
label: t('tools.ipv4-address-converter.texts.label-arpa'),
value: toARPA(rawIpAddress.value),
},
{
label: t('tools.ipv4-address-converter.texts.label-ip-class'),
value: getIPClass({ ip: rawIpAddress.value }),
},
{
label: t('tools.ipv4-address-converter.texts.label-type'),
value: getIPNetworkType(rawIpAddress.value),
},
];
}, []),
);
const { attrs: validationAttrs } = useValidation({
source: rawIpAddress,
rules: [{ message: t('tools.ipv4-address-converter.texts.message-invalid-ipv4-address'), validator: ip => isValidIpv4({ ip }) }],
rules: [
{
message: t('tools.ipv4-address-converter.texts.message-invalid-ipv4-address'),
validator: (ip) => isValidIpv4({ ip }),
},
],
});
</script>
<template>
<div>
<c-input-text v-model:value="rawIpAddress" :label="t('tools.ipv4-address-converter.texts.label-the-ipv4-address')" :placeholder="t('tools.ipv4-address-converter.texts.placeholder-the-ipv4-address')" />
<c-input-text
v-model:value="rawIpAddress"
:label="t('tools.ipv4-address-converter.texts.label-the-ipv4-address')"
:placeholder="t('tools.ipv4-address-converter.texts.placeholder-the-ipv4-address')"
/>
<n-divider />
@@ -83,7 +98,7 @@ const { attrs: validationAttrs } = useValidation({
label-width="100px"
label-align="right"
mb-2
:value="validationAttrs.validationStatus === 'error' ? '' : value"
:value="validationAttrs.validationStatus === 'error' ? '' : (value ?? '')"
:placeholder="t('tools.ipv4-address-converter.texts.placeholder-set-a-correct-ipv4-address')"
/>
</div>
+9 -9
View File
@@ -1,17 +1,17 @@
declare module 'ip-bigint' {
type IPInfo = {
number: bigint;
number: bigint;
version: number;
ipv4mapped?: boolean;
scopeid?:string;
scopeid?: string;
};
type StringifyOptions = {
compress?:boolean;
hexify?:boolean;
type StringifyOptions = {
compress?: boolean;
hexify?: boolean;
};
export function normalizeIp(ip: string, options: StringifyOptions = {compress = true, hexify = false} = {})
export function stringifyIp(ip: IPInfo, options: StringifyOptions = {compress = true, hexify = false}): string;
export function normalizeIp(ip: string, options?: StringifyOptions): string;
export function stringifyIp(ip: IPInfo, options?: StringifyOptions): string;
export function ipVersion(ip: string): number;
export function parseIp(ip): IPInfo;
}
}
@@ -50,14 +50,13 @@ function isbnChecksum(isbn: string) {
for (let n = 0; n < 9; n += 1) {
check += (10 - n) * Number(isbn.charAt(n));
}
check = (11 - check % 11) % 11;
check = (11 - (check % 11)) % 11;
return check === 10 ? 'X' : String(check);
}
else if (isbn.length === 12) {
} else if (isbn.length === 12) {
for (let n = 0; n < 12; n += 2) {
check += Number(isbn.charAt(n)) + 3 * Number(isbn.charAt(n + 1));
}
return String((10 - check % 10) % 10);
return String((10 - (check % 10)) % 10);
}
return null;
@@ -67,8 +66,7 @@ const normalizedISBN = computed(() => {
let normalized = rawIsbn.value.replace(/[^\dX]/g, '');
if (normalized.length >= 13) {
normalized = normalized.substring(0, 12);
}
else if (normalized.length >= 10) {
} else if (normalized.length >= 10) {
normalized = normalized.substring(0, 9);
}
const checksum = isbnChecksum(normalized);
@@ -78,27 +76,44 @@ const normalizedISBN = computed(() => {
const isbnAuditInfos = computed<{ isValid: boolean; clues: CKeyValueListItems }>(() => {
const isbn = ISBN3.audit(rawIsbn.value);
const isValid = (isbn?.validIsbn ?? false);
const isValid = isbn?.validIsbn ?? false;
return {
isValid,
clues: Array.from((isbn?.clues ?? []),
clue => ({ label: `${clue.message} (${clue.groupname})`, value: clue.candidate })),
clues: Array.from(isbn?.clues ?? [], (clue) => ({
label: `${clue.message} (${clue.groupname})`,
value: clue.candidate,
})),
};
});
</script>
<template>
<div>
<c-input-text v-model:value="rawIsbn" :placeholder="t('tools.isbn-validator-and-parser.texts.placeholder-enter-an-isbn-to-check-for-validity')" test-id="isbn-input" />
<c-input-text
v-model:value="rawIsbn"
:placeholder="t('tools.isbn-validator-and-parser.texts.placeholder-enter-an-isbn-to-check-for-validity')"
test-id="isbn-input"
/>
<n-alert v-if="!isbnAuditInfos.isValid" type="error">
{{ t('tools.isbn-validator-and-parser.texts.tag-invalid-isbn') }}<input-copyable v-if="normalizedISBN" :label="t('tools.isbn-validator-and-parser.texts.label-probably-correct')" label-position="left" :value="normalizedISBN" disabled="true" />
{{ t('tools.isbn-validator-and-parser.texts.tag-invalid-isbn')
}}<input-copyable
v-if="normalizedISBN"
:label="t('tools.isbn-validator-and-parser.texts.label-probably-correct')"
label-position="left"
:value="normalizedISBN"
disabled="true"
/>
</n-alert>
<c-card v-if="isbnInfos.length > 0" mt-5 :title="t('tools.isbn-validator-and-parser.texts.title-isbn-infos')">
<c-key-value-list :items="isbnInfos" data-test-id="isbn-info" />
</c-card>
<c-card v-if="isbnAuditInfos.clues.length > 0" mt-5 :title="t('tools.isbn-validator-and-parser.texts.title-isbn-audit-infos')">
<c-key-value-list :items="isbnAuditInfos" data-test-id="isbn-info" />
<c-card
v-if="isbnAuditInfos.clues.length > 0"
mt-5
:title="t('tools.isbn-validator-and-parser.texts.title-isbn-audit-infos')"
>
<c-key-value-list :items="isbnAuditInfos.clues" data-test-id="isbn-info" />
</c-card>
</div>
</template>
+6 -7
View File
@@ -1,8 +1,7 @@
declare module 'jasypt' {
export default class Jasypt {
constructor() {}
setPassword(password: string): void
encrypt(value: string): string
decrypt(value: string): string
}
}
export default class Jasypt {
setPassword(password: string): void;
encrypt(value: string): string;
decrypt(value: string): string;
}
}
@@ -4,25 +4,25 @@ import { obfuscateJavascript } from './javascript-obfuscator.service';
describe('JavascriptObfuscator', () => {
it('base64 encodes and wraps with atob', () => {
const src = 'console.log(\'x\');';
const src = "console.log('x');";
const out = obfuscateJavascript(src, 'base64');
expect(out).toContain('atob(\'');
expect(out).toContain("atob('");
const m = out.match(/atob\('(.+)'\)/);
expect(m).toBeTruthy();
if (m) {
const b64 = m[1];
const decoded = decodeURIComponent(escape(Buffer.from(b64, 'base64').toString('binary')));
expect(decoded).toBe(src);
}
const b64 = m![1];
const decoded = decodeURIComponent(escape(Buffer.from(b64, 'base64').toString('binary')));
expect(decoded).toBe(src);
});
it('rot13 encodes and includes runtime decoder', () => {
const src = 'console.log(\'a\');';
const src = "console.log('a');";
const out = obfuscateJavascript(src, 'rot13');
expect(out).toContain('eval(r(s))');
const r = src.replace(/[A-Za-z]/g, c => String.fromCharCode((c <= 'Z' ? 65 : 97) + ((c.charCodeAt(0) - (c <= 'Z' ? 65 : 97) + 13) % 26)));
const r = src.replace(/[A-Za-z]/g, (c) =>
String.fromCharCode((c <= 'Z' ? 65 : 97) + ((c.charCodeAt(0) - (c <= 'Z' ? 65 : 97) + 13) % 26)),
);
expect(out).toContain(r);
});
});
@@ -15,19 +15,17 @@ const result = computedAsync(async () => {
'afterbegin',
'<meta http-equiv="Content-Security-Policy" content="default-src \'none\';">',
);
const sleep = (ms: number) => new Promise(resolve => setTimeout(resolve, ms));
const sleep = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms));
async function evalCode(code: string) {
const fn = await sandbox.addFunction(`() => ${code}`);
return Promise.race([
fn(),
sleep(10_000).then(() => Promise.reject(new Error('Sandbox timeout'))),
]).finally(() => sandbox.removeFunction(fn));
return Promise.race([fn(), sleep(10_000).then(() => Promise.reject(new Error('Sandbox timeout')))]).finally(() =>
sandbox.removeFunction(fn),
);
}
return await webcrack(inputValue, { sandbox: evalCode });
}
catch (e: any) {
} catch (e: any) {
return {
code: `/*\n${e.toString()}\n*/`,
bundle: '',
@@ -37,7 +35,7 @@ const result = computedAsync(async () => {
</script>
<template>
<iframe class="sandybox" style="display:none" :title="t('tools.js-unobfuscator.texts.title-sandbox')" />
<iframe class="sandybox" style="display: none" :title="t('tools.js-unobfuscator.texts.title-sandbox')" />
<CInputText
v-model:value="input"
:placeholder="t('tools.js-unobfuscator.texts.placeholder-your-obfuscate-javascript-code')"
@@ -53,6 +51,6 @@ const result = computedAsync(async () => {
<textarea-copyable :value="result?.code" language="javascript" download-file-name="output.js" />
</n-form-item>
<n-form-item :label="t('tools.js-unobfuscator.texts.label-bundle')">
<textarea-copyable :value="result?.bundle" language="javascript" download-file-name="output.bundle.js" />
<textarea-copyable :value="result?.bundle as string" language="javascript" download-file-name="output.bundle.js" />
</n-form-item>
</template>
+40 -28
View File
@@ -1,7 +1,21 @@
<script setup lang="ts">
import { useI18n } from 'vue-i18n';
import JsonEditorVue from 'json-editor-vue';
import { type AfterSelection, type InsideSelection, type JSONEditorSelection, type KeySelection, type MultiSelection, type ValueSelection, isAfterSelection, isInsideSelection, isKeySelection, isMultiSelection, isValueSelection, stringifyJSONPath } from 'vanilla-jsoneditor';
import {
type AfterSelection,
type InsideSelection,
type JSONEditorSelection,
type KeySelection,
Mode,
type MultiSelection,
type ValueSelection,
isAfterSelection,
isInsideSelection,
isKeySelection,
isMultiSelection,
isValueSelection,
stringifyJSONPath,
} from 'vanilla-jsoneditor';
import 'vanilla-jsoneditor/themes/jse-theme-dark.css';
import { jsonrepair } from 'jsonrepair';
import { useJsonSchemaValidation } from '../json-viewer/useJsonSchemaValidation';
@@ -16,22 +30,17 @@ const jsonText = ref('{ "a": { "array": [1, 2, 3] } }');
const jsonPath = ref('');
function updateJsonPath(selection: JSONEditorSelection) {
if (isAfterSelection (selection)) {
if (isAfterSelection(selection)) {
jsonPath.value = `$.${stringifyJSONPath((selection as AfterSelection).path)}`;
}
else if (isInsideSelection (selection)) {
} else if (isInsideSelection(selection)) {
jsonPath.value = `$.${stringifyJSONPath((selection as InsideSelection).path)}`;
}
else if (isKeySelection (selection)) {
} else if (isKeySelection(selection)) {
jsonPath.value = `$.${stringifyJSONPath((selection as KeySelection).path)}`;
}
else if (isValueSelection (selection)) {
} else if (isValueSelection(selection)) {
jsonPath.value = `$.${stringifyJSONPath((selection as ValueSelection).path)}`;
}
else if (isMultiSelection (selection)) {
} else if (isMultiSelection(selection)) {
jsonPath.value = `$.${stringifyJSONPath((selection as MultiSelection).focusPath)}`;
}
else {
} else {
jsonPath.value = 'No available in this mode';
}
}
@@ -39,25 +48,25 @@ function updateJsonPath(selection: JSONEditorSelection) {
const jsonSchemaInputElement = ref<HTMLElement>();
const schemaData = useITStorage('json-linter:schema-data', '');
const schemaUrl = useQueryParamOrStorage<string>({ name: 'schema', storageName: 'json-editor:schema', defaultValue: '' });
const schemaUrl = useQueryParamOrStorage<string>({
name: 'schema',
storageName: 'json-editor:schema',
defaultValue: '',
});
const { schemas, errors: validationErrors } = useJsonSchemaValidation({ json: jsonText, schemaUrl, schemaData });
function tryAutoRepair() {
try {
jsonText.value = jsonrepair(jsonText.value);
}
catch {}
} catch {}
}
const indentSize = useITStorage('json-editor:indent-size', 3);
const formattedJson = computed(() => {
const jsonTextValue = jsonText.value;
try {
return JSON.stringify(
JSON.parseBigNum(jsonTextValue),
null, indentSize.value);
}
catch {
return JSON.stringify(JSON.parseBigNum(jsonTextValue), null, indentSize.value);
} catch {
return jsonTextValue;
}
});
@@ -67,7 +76,7 @@ const formattedJson = computed(() => {
<div>
<JsonEditorVue
v-model="jsonText"
mode="text"
:mode="Mode.text"
:class="styleStore.isDarkTheme ? 'jse-theme-dark' : ''"
:on-select="updateJsonPath"
mb-2
@@ -92,15 +101,21 @@ const formattedJson = computed(() => {
<textarea-copyable :value="formattedJson" language="json" download-file-name="output.json" />
</n-form-item>
<n-form-item :label="t('tools.json-editor.texts.label-json-schema')" label-placement="left" label-width="130px" label-align="right">
<n-form-item
:label="t('tools.json-editor.texts.label-json-schema')"
label-placement="left"
label-width="130px"
label-align="right"
>
<n-select
v-model:value="schemaUrl"
:options="[
{ label: t('tools.json-editor.texts.label-no-validation'), value: '' },
{ label: t('tools.json-editor.texts.label-custom'), value: 'custom' },
...schemas.map(s => ({ label: `${s.name} / ${s.description}`, value: s.url })),
...schemas.map((s) => ({ label: `${s.name} / ${s.description}`, value: s.url })),
]"
filterable mb-4
filterable
mb-4
/>
</n-form-item>
<c-input-text
@@ -119,10 +134,7 @@ const formattedJson = computed(() => {
<div v-if="validationErrors.length > 0" mb-2 mt-2>
<n-alert :title="t('tools.json-editor.texts.title-schema-validation-errors')" type="error">
<ul
v-for="error in validationErrors"
:key="error"
>
<ul v-for="error in validationErrors" :key="error">
<li>{{ error }}</li>
</ul>
</n-alert>
@@ -4,11 +4,25 @@ import { convertArrayToCsv, getHeaders } from './json-to-csv.service';
describe('json-to-csv service', () => {
describe('getHeaders', () => {
it('extracts all the keys from the array of nested objects', () => {
expect(getHeaders({ array: [{ a: { c: 1, d: 1 }, b: 2 }, { a: 3, c: 4 }] })).toEqual(['a.c', 'a.d', 'b', 'a', 'c']);
expect(
getHeaders({
array: [
{ a: { c: 1, d: 1 }, b: 2 },
{ a: 3, c: 4 },
],
}),
).toEqual(['a.c', 'a.d', 'b', 'a', 'c']);
});
it('extracts all the keys from the array of objects', () => {
expect(getHeaders({ array: [{ a: 1, b: 2 }, { a: 3, c: 4 }] })).toEqual(['a', 'b', 'c']);
expect(
getHeaders({
array: [
{ a: 1, b: 2 },
{ a: 3, c: 4 },
],
}),
).toEqual(['a', 'b', 'c']);
});
it('returns an empty array if the array is empty', () => {
@@ -21,7 +35,6 @@ describe('json-to-csv service', () => {
const array = [
{ a: 1, b: 2 },
{ a: 3, b: 4 },
];
expect(convertArrayToCsv({ arrayOrObject: array })).toMatchInlineSnapshot(`
@@ -45,9 +58,7 @@ describe('json-to-csv service', () => {
});
it('when a value is null, it is converted to the string "null"', () => {
const array = [
{ a: null, b: 2 },
];
const array = [{ a: null, b: 2 }];
expect(convertArrayToCsv({ arrayOrObject: array })).toMatchInlineSnapshot(`
"a,b
@@ -56,10 +67,7 @@ describe('json-to-csv service', () => {
});
it('when a value is undefined, it is converted to an empty string', () => {
const array = [
{ a: undefined, b: 2 },
{ b: 3 },
];
const array = [{ a: undefined, b: 2 }, { b: 3 }];
expect(convertArrayToCsv({ arrayOrObject: array })).toMatchInlineSnapshot(`
"a,b
@@ -69,24 +77,20 @@ describe('json-to-csv service', () => {
});
it('when a value contains a comma, it is wrapped in double quotes', () => {
const array = [
{ a: 'hello, world', b: 2 },
];
const array = [{ a: 'hello, world', b: 2 }];
expect(convertArrayToCsv({ arrayOrObject: array })).toMatchInlineSnapshot(`
"a,b
\\"hello, world\\",2"
"hello, world",2"
`);
});
it('when a value contains a double quote, it is escaped with another double quote', () => {
const array = [
{ a: 'hello "world"', b: 2 },
];
const array = [{ a: 'hello "world"', b: 2 }];
expect(convertArrayToCsv({ arrayOrObject: array })).toMatchInlineSnapshot(`
"a,b
hello \\\\\\"world\\\\\\",2"
hello \\"world\\",2"
`);
});
@@ -53,8 +53,8 @@ describe('json-to-env service', () => {
it('serializes nested objects and arrays as JSON strings', () => {
const result = convertJsonToEnv({ json: '{"list": [1, 2, 3], "obj": {"a": 1}}' });
expect(result).toMatchInlineSnapshot(`
"LIST=\\"[1,2,3]\\"
OBJ=\\"{\\\\\\"a\\\\\\":1}\\""
"LIST="[1,2,3]"
OBJ="{\\"a\\":1}""
`);
});
@@ -31,8 +31,7 @@ function convertToMsgPack() {
try {
msgPacked.value = pack(JSON5.parse(jsonInput.value));
msgPackHex.value = msgPacked.value.toString('hex');
}
catch (e: any) {
} catch (e: any) {
error.value = e.toString();
}
}
@@ -48,7 +47,7 @@ function downloadURL(data: string, fileName: string) {
}
function downloadBlob(data: Uint8Array, fileName: string) {
const blob = new Blob([data], {
const blob = new Blob([new Uint8Array(data)], {
type: 'application/octet-stream',
});
const url = window.URL.createObjectURL(blob);
@@ -13,10 +13,9 @@ const rootName = ref<string>('RootName');
function transformer(value: string) {
try {
const object = JSON5.parse(value);
const schema = JSON.stringify({ ...{ name: rootName.value }, ...GenerateSchema.json(rootName.value, object) });
const schema = JSON.stringify({ name: rootName.value, ...GenerateSchema.json(rootName.value, object) });
return convert(schema);
}
catch (e: any) {
} catch (e: any) {
return e.toString();
}
}
@@ -30,7 +29,11 @@ const rules: UseValidationRule<string>[] = [
</script>
<template>
<c-input-text v-model:value="rootName" :label="t('tools.json-to-protobuf.texts.label-root-name')" label-placement="left" />
<c-input-text
v-model:value="rootName"
:label="t('tools.json-to-protobuf.texts.label-root-name')"
label-placement="left"
/>
<FormatTransformer
:input-label="t('tools.json-to-protobuf.texts.input-label-your-json')"
+75 -69
View File
@@ -21,7 +21,9 @@ const payload = ref(`{
}`);
const alg = useQueryParamOrStorage({ name: 'alg', storageName: 'jwt-gen:alg', defaultValue: 'HS512' });
const algInfo = computed(() => jwsAlgorithms.find(a => a.alg === alg.value) || { alg: 'UNK', keyDesc: '', key: 'secret', verify: '' });
const algInfo = computed(
() => jwsAlgorithms.find((a) => a.alg === alg.value) || { alg: 'UNK', keyDesc: '', key: 'secret', verify: '' },
);
const isSecret = computed(() => algInfo.value.key === 'secret');
const inputToken = ref('');
@@ -31,8 +33,7 @@ watch(inputToken, (value) => {
try {
payload.value = JSON.stringify(jwtDecode<JwtPayload>(value), null, 2);
alg.value = getJwtAlgorithm({ jwt: value }) || 'HS512';
}
catch (e: any) {
} catch (e: any) {
inputTokenError.value = e.toString();
}
});
@@ -50,34 +51,54 @@ const publicKeyJWK = ref('');
const privateKeyJWK = ref('');
const privateKeyPEM = ref('');
watch(publicKeyPEM, async (newValue) => {
try {
publicKeyJWK.value = JSON.stringify(await jose.exportJWK(await jose.importSPKI(newValue, alg.value, { extractable: true })), null, 2);
}
catch {
}
}, { immediate: true });
watch(privateKeyPEM, async (newValue) => {
try {
privateKeyJWK.value = JSON.stringify(await jose.exportJWK(await jose.importPKCS8(newValue, alg.value, { extractable: true })), null, 2);
}
catch {
}
}, { immediate: true });
watch(publicKeyJWK, async (newValue) => {
try {
publicKeyPEM.value = await jose.exportSPKI(await jose.importJWK({ ...JSON.parse(newValue), ...{ ext: true } }, alg.value) as KeyLike);
}
catch {
}
}, { immediate: true });
watch(privateKeyJWK, async (newValue) => {
try {
privateKeyPEM.value = await jose.exportPKCS8(await jose.importJWK({ ...JSON.parse(newValue), ...{ ext: true } }, alg.value) as KeyLike);
}
catch {
}
}, { immediate: true });
watch(
publicKeyPEM,
async (newValue) => {
try {
publicKeyJWK.value = JSON.stringify(
await jose.exportJWK(await jose.importSPKI(newValue, alg.value, { extractable: true })),
null,
2,
);
} catch {}
},
{ immediate: true },
);
watch(
privateKeyPEM,
async (newValue) => {
try {
privateKeyJWK.value = JSON.stringify(
await jose.exportJWK(await jose.importPKCS8(newValue, alg.value, { extractable: true })),
null,
2,
);
} catch {}
},
{ immediate: true },
);
watch(
publicKeyJWK,
async (newValue) => {
try {
publicKeyPEM.value = await jose.exportSPKI(
(await jose.importJWK({ ...JSON.parse(newValue), ext: true }, alg.value)) as KeyLike,
);
} catch {}
},
{ immediate: true },
);
watch(
privateKeyJWK,
async (newValue) => {
try {
privateKeyPEM.value = await jose.exportPKCS8(
(await jose.importJWK({ ...JSON.parse(newValue), ext: true }, alg.value)) as KeyLike,
);
} catch {}
},
{ immediate: true },
);
watchEffect(async () => {
if (isSecret.value) {
@@ -86,8 +107,7 @@ watchEffect(async () => {
publicKeyJWK.value = '';
privateKeyPEM.value = '';
publicKeyPEM.value = '';
}
else {
} else {
const { publicKey, privateKey } = await jose.generateKeyPair(alg.value, { extractable: true });
privateKeyJWK.value = JSON.stringify(await jose.exportJWK(privateKey), null, 2);
publicKeyJWK.value = JSON.stringify(await jose.exportJWK(publicKey), null, 2);
@@ -122,22 +142,25 @@ const encodedJWT = computedAsync(async () => {
privateKeyOrSecret = Base64.toUint8Array(secretValue);
break;
}
} catch (parseError: any) {
throw new Error(
t('tools.jwt-generator.texts.cannot-parse-secret-as-encoding', [
secretValue,
secretEncodingValue,
parseError,
]),
);
}
catch (parseError: any) {
throw new Error(t('tools.jwt-generator.texts.cannot-parse-secret-as-encoding', [secretValue, secretEncodingValue, parseError]));
}
}
else {
} else {
privateKeyOrSecret = await jose.importJWK(JSON.parse(privateKeyValue), algValue);
}
return {
token: await (new jose.SignJWT(JSON5.parse(payloadValue))
token: await new jose.SignJWT(JSON5.parse(payloadValue))
.setProtectedHeader({ alg: algValue })
.sign(privateKeyOrSecret)),
.sign(privateKeyOrSecret),
error: '',
};
}
catch (e: any) {
} catch (e: any) {
return { error: e.toString(), token: '' };
}
});
@@ -147,7 +170,7 @@ const jsonInputValidation = useValidation({
rules: [
{
message: t('tools.jwt-generator.texts.message-invalid-json-string'),
validator: value => JSON5.parse(value),
validator: (value) => JSON5.parse(value),
},
],
});
@@ -172,7 +195,7 @@ const jsonInputValidation = useValidation({
<c-select
v-model:value="alg"
:options="jwsAlgorithms.map(a => ({ value: a.alg, label: `${a.alg}: ${a.verify}` }))"
:options="jwsAlgorithms.map((a) => ({ value: a.alg, label: `${a.alg}: ${a.verify}` }))"
:placeholder="t('tools.jwt-generator.texts.placeholder-algorithms')"
mb-2
/>
@@ -196,7 +219,10 @@ const jsonInputValidation = useValidation({
/>
</c-card>
<c-card :title="isSecret ? t('tools.jwt-generator.texts.token-secret') : t('tools.jwt-generator.texts.token-keys')" mb-2>
<c-card
:title="isSecret ? t('tools.jwt-generator.texts.token-secret') : t('tools.jwt-generator.texts.token-keys')"
mb-2
>
<div v-if="isSecret">
<c-select
v-model:value="secretEncoding"
@@ -209,39 +235,19 @@ const jsonInputValidation = useValidation({
</div>
<div v-else>
<n-form-item :label="t('tools.jwt-generator.texts.label-public-key-pem')">
<c-input-text
v-model:value="publicKeyPEM"
multiline
rows="5"
autosize
/>
<c-input-text v-model:value="publicKeyPEM" multiline rows="5" autosize />
</n-form-item>
<n-form-item :label="t('tools.jwt-generator.texts.label-private-key-pem')">
<c-input-text
v-model:value="privateKeyPEM"
multiline
rows="5"
autosize
/>
<c-input-text v-model:value="privateKeyPEM" multiline rows="5" autosize />
</n-form-item>
<n-divider />
<n-form-item :label="t('tools.jwt-generator.texts.label-public-key-jwk')">
<c-input-text
v-model:value="publicKeyJWK"
multiline
rows="5"
autosize
/>
<c-input-text v-model:value="publicKeyJWK" multiline rows="5" autosize />
</n-form-item>
<n-form-item :label="t('tools.jwt-generator.texts.label-private-key-jwk')">
<c-input-text
v-model:value="privateKeyJWK"
multiline
rows="5"
autosize
/>
<c-input-text v-model:value="privateKeyJWK" multiline rows="5" autosize />
</n-form-item>
</div>
</c-card>
@@ -10,9 +10,13 @@ const { t } = useI18n();
const toolStore = useToolStore();
const unitsConversionTools = computed(() => _.orderBy(
_.filter(toolStore.tools, t => t.keywords?.includes('units')),
'name', 'asc'));
const unitsConversionTools = computed(() =>
_.orderBy(
_.filter(toolStore.tools, (t) => t.keywords?.includes('units')),
'name',
'asc',
),
);
const allUnitsSorted = _.uniq(allUnits).sort();
@@ -24,19 +28,15 @@ const result = computed(() => {
try {
return {
best,
selected: outputUnit.value
? convertMany(inputExpression.value).to(outputUnit.value as Unit)
: '',
selected: outputUnit.value ? convertMany(inputExpression.value).to(outputUnit.value as Unit) : '',
};
}
catch (e: any) {
} catch (e: any) {
return {
best,
error: e.toString(),
};
}
}
catch (e: any) {
} catch (e: any) {
return {
error: e.toString(),
};
@@ -65,8 +65,16 @@ const result = computed(() => {
<n-divider />
<c-card v-if="result.best" :title="t('tools.many-units-converter.texts.title-result')" mb-2>
<input-copyable :label="t('tools.many-units-converter.texts.label-best-target-unit')" :value="result.best" mb-1 />
<input-copyable v-if="result.selected" :label="$t('tools.many-units-converter.texts.label-selected-target-unit-outputunit', [outputUnit])" :value="result.selected" />
<input-copyable
:label="t('tools.many-units-converter.texts.label-best-target-unit')"
:value="String(result.best)"
mb-1
/>
<input-copyable
v-if="result.selected"
:label="$t('tools.many-units-converter.texts.label-selected-target-unit-outputunit', [outputUnit])"
:value="result.selected"
/>
</c-card>
<c-alert v-if="result.error && inputExpression" mb-2>
{{ result.error }}
@@ -93,7 +101,7 @@ const result = computed(() => {
</td>
<td>
{{ tool.description }}
<br>
<br />
-&gt; {{ tool.keywords?.join(', ') }}
</td>
</tr>
+6 -6
View File
@@ -1,6 +1,6 @@
declare module 'markdown-contents'{
declare class MarkdownContents {
markdown(): string;
}
export default function Create(markdown: string):MarkdownContents;
}
declare module 'markdown-contents' {
class MarkdownContents {
markdown(): string;
}
export default function Create(markdown: string): MarkdownContents;
}
@@ -7,7 +7,9 @@ test.describe('Mermaid Diagram Renderer', () => {
test('should render the initial diagram', async ({ page }) => {
const diagramContainer = page.locator('.diagram-container svg');
await expect(diagramContainer).toBeVisible();
// mermaid is a large lazy-loaded chunk; cold CI browsers (webkit
// especially) can exceed the default 5s expect timeout
await expect(diagramContainer).toBeVisible({ timeout: 30_000 });
await expect(diagramContainer).toHaveAttribute('xmlns', 'http://www.w3.org/2000/svg');
});
+8 -7
View File
@@ -6,7 +6,7 @@ const { t } = useI18n();
const mimeInfos = Object.entries(mimeTypeToExtension).map(([mimeType, extensions]) => ({ mimeType, extensions }));
const mimeToExtensionsOptions = Object.keys(mimeTypeToExtension).map(label => ({ label, value: label }));
const mimeToExtensionsOptions = Object.keys(mimeTypeToExtension).map((label) => ({ label, value: label }));
const selectedMimeType = ref(undefined);
const extensionsFound = computed(() => (selectedMimeType.value ? mimeTypeToExtension[selectedMimeType.value] : []));
@@ -38,9 +38,9 @@ const mimeTypeFound = computed(() => (selectedExtension.value ? extensionToMimeT
/>
<div v-if="extensionsFound.length > 0">
{{ t('tools.mime-types.texts.tag-extensions-of-files-with-the') }}<n-tag round :bordered="false">
{{ selectedMimeType }}
</n-tag>{{ t('tools.mime-types.texts.tag-mime-type') }}<div style="margin-top: 10px">
{{ t('tools.mime-types.texts.tag-extensions-of-files-with-the')
}}<n-tag round :bordered="false"> {{ selectedMimeType }} </n-tag>{{ t('tools.mime-types.texts.tag-mime-type') }}
<div style="margin-top: 10px">
<n-tag
v-for="extension of extensionsFound"
:key="extension"
@@ -71,10 +71,11 @@ const mimeTypeFound = computed(() => (selectedExtension.value ? extensionToMimeT
/>
<div v-if="selectedExtension">
{{ t('tools.mime-types.texts.tag-mime-type-associated-to-the-extension') }}<n-tag round :bordered="false">
{{ t('tools.mime-types.texts.tag-mime-type-associated-to-the-extension')
}}<n-tag round :bordered="false">
{{ selectedExtension }}
</n-tag> file
extension:
</n-tag>
file extension:
<div style="margin-top: 10px">
<n-tag round :bordered="false" type="primary" style="margin-right: 10px">
{{ mimeTypeFound }}
@@ -3,7 +3,14 @@ import { useI18n } from 'vue-i18n';
import { useTimestamp } from '@vueuse/core';
import { useThemeVars } from 'naive-ui';
import { useQRCode } from '../qr-code-generator/useQRCode';
import { base32toHex, buildKeyUri, generateHOTP, generateSecret, generateTOTP, getCounterFromTime } from './otp.service';
import {
base32toHex,
buildKeyUri,
generateHOTP,
generateSecret,
generateTOTP,
getCounterFromTime,
} from './otp.service';
import TokenDisplay from './token-display.vue';
import { useStyleStore } from '@/stores/style.store';
import InputCopyable from '@/components/InputCopyable.vue';
@@ -27,12 +34,15 @@ function refreshSecret() {
secret.value = generateSecret();
}
const counter = ref(0);
const counter = ref('0');
const [hotpValues] = computedRefreshable(
() =>
Object.fromEntries(
Array.from({ length: 10 }, (_, i) => [+counter.value + i, generateHOTP({ key: secret.value, counter: +counter.value + i })]),
Array.from({ length: 10 }, (_, i) => [
+counter.value + i,
generateHOTP({ key: secret.value, counter: +counter.value + i }),
]),
),
{ throttle: 500 },
);
@@ -112,7 +122,8 @@ const secretValidationRules = [
mt-5
/>
<InputCopyable
v-for="(value, currentCounter) in hotpValues" :key="currentCounter"
v-for="(value, currentCounter) in hotpValues"
:key="currentCounter"
:value="value"
readonly
:label="`HOTP ${currentCounter}:`"
@@ -141,13 +152,17 @@ const secretValidationRules = [
label-position="left"
label-width="90px"
label-align="right"
:placeholder="t('tools.otp-code-generator-and-validator.texts.placeholder-iteration-count-will-be-displayed-here')"
:placeholder="
t('tools.otp-code-generator-and-validator.texts.placeholder-iteration-count-will-be-displayed-here')
"
/>
<InputCopyable
:value="getCounterFromTime({ now, timeStep: 30 }).toString(16).padStart(16, '0')"
readonly
:placeholder="t('tools.otp-code-generator-and-validator.texts.placeholder-iteration-count-in-hex-will-be-displayed-here')"
:placeholder="
t('tools.otp-code-generator-and-validator.texts.placeholder-iteration-count-in-hex-will-be-displayed-here')
"
label-position="left"
label-width="90px"
label-align="right"
@@ -158,9 +173,7 @@ const secretValidationRules = [
<TokenDisplay :tokens="tokens" mt-5 />
<n-progress :percentage="(100 * interval) / 30" :color="theme.primaryColor" :show-indicator="false" />
<div style="text-align: center">
Next in {{ String(Math.floor(30 - interval)).padStart(2, '0') }}s
</div>
<div style="text-align: center">Next in {{ String(Math.floor(30 - interval)).padStart(2, '0') }}s</div>
</div>
</div>
</template>
+55 -27
View File
@@ -17,7 +17,7 @@ function getPropertyName(tag: string | undefined) {
return '';
}
const tagLower = tag.toLocaleLowerCase();
const prop = getProps().find(p => p.key?.toLocaleLowerCase() === tagLower);
const prop = getProps().find((p) => p.key?.toLocaleLowerCase() === tagLower);
if (!prop) {
return tag;
}
@@ -36,8 +36,7 @@ const parsedEmailRaw = computedAsync(async () => {
includeRawProps: true,
};
return msg;
}
catch (e: any) {
} catch (e: any) {
error.value = e.toString();
return null;
}
@@ -49,18 +48,13 @@ const parsedRtf = computed(() => {
}
try {
const rtfBlob = decompressRTF(Array.from(parsedEmail.value?.compressedRtf));
const rtfText = iconv.decode(
Buffer.from(rtfBlob),
'latin1',
);
const rtfText = iconv.decode(Buffer.from(rtfBlob), 'latin1');
try {
return { rtf: rtfText, html: deEncapsulateSync(rtfText, { decode: iconv.decode })?.text };
}
catch (dex: any) {
} catch (dex: any) {
return { rtf: rtfText, html: dex.toString() };
}
}
catch (ex: any) {
} catch (ex: any) {
return { rtf: ex.toString(), html: '' };
}
});
@@ -70,7 +64,7 @@ function downloadFile(attachment: FieldsData) {
if (!attachmentData) {
return;
}
const blob = new Blob([attachmentData.content], { type: 'application/octet-stream' });
const blob = new Blob([attachmentData.content as BlobPart], { type: 'application/octet-stream' });
const downloadUrl = URL.createObjectURL(blob);
const a = document.createElement('a');
a.href = downloadUrl;
@@ -101,11 +95,31 @@ function onUpload(file: File) {
</c-alert>
<c-card v-if="!error && parsedEmail" :title="t('tools.outlook-parser.texts.title-output')">
<input-copyable v-if="fileInput?.name" :label="t('tools.outlook-parser.texts.label-file-name')" :value="fileInput?.name" />
<input-copyable v-if="parsedEmail.creationTime" :label="t('tools.outlook-parser.texts.label-creation-date')" :value="parsedEmail.creationTime" />
<input-copyable v-if="parsedEmail.clientSubmitTime" :label="t('tools.outlook-parser.texts.label-submit-date')" :value="parsedEmail.clientSubmitTime" />
<input-copyable v-if="parsedEmail.messageDeliveryTime" :label="t('tools.outlook-parser.texts.label-delivery-date')" :value="parsedEmail.messageDeliveryTime" />
<input-copyable v-if="parsedEmail.lastModificationTime" :label="t('tools.outlook-parser.texts.label-last-mod-date')" :value="parsedEmail.lastModificationTime" />
<input-copyable
v-if="fileInput?.name"
:label="t('tools.outlook-parser.texts.label-file-name')"
:value="fileInput?.name"
/>
<input-copyable
v-if="parsedEmail.creationTime"
:label="t('tools.outlook-parser.texts.label-creation-date')"
:value="parsedEmail.creationTime"
/>
<input-copyable
v-if="parsedEmail.clientSubmitTime"
:label="t('tools.outlook-parser.texts.label-submit-date')"
:value="parsedEmail.clientSubmitTime"
/>
<input-copyable
v-if="parsedEmail.messageDeliveryTime"
:label="t('tools.outlook-parser.texts.label-delivery-date')"
:value="parsedEmail.messageDeliveryTime"
/>
<input-copyable
v-if="parsedEmail.lastModificationTime"
:label="t('tools.outlook-parser.texts.label-last-mod-date')"
:value="parsedEmail.lastModificationTime"
/>
<c-card :title="t('tools.outlook-parser.texts.title-recipients')" mt-2>
<input-copyable
v-for="(h, index) in parsedEmail.recipients || []"
@@ -114,7 +128,11 @@ function onUpload(file: File) {
:value="`${h.name}/${h.email}`"
/>
</c-card>
<input-copyable v-if="parsedEmail.subject" :label="t('tools.outlook-parser.texts.label-subject')" :value="parsedEmail.subject" />
<input-copyable
v-if="parsedEmail.subject"
:label="t('tools.outlook-parser.texts.label-subject')"
:value="parsedEmail.subject"
/>
<c-card v-if="parsedEmail.body" :title="t('tools.outlook-parser.texts.title-plain-content')" mb-2>
<details>
<summary>{{ t('tools.outlook-parser.texts.tag-see-content') }}</summary>
@@ -143,14 +161,12 @@ function onUpload(file: File) {
<tr>
<th scope="col">
{{ t('tools.outlook-parser.texts.tag-attachment') }}
</th><th scope="col" />
</th>
<th scope="col" />
</tr>
</thead>
<tbody>
<tr
v-for="(h, index) in parsedEmail.attachments || []"
:key="index"
>
<tr v-for="(h, index) in parsedEmail.attachments || []" :key="index">
<td>
{{ `${h.fileName || h.fileNameShort || 'noname'}` }}
</td>
@@ -164,9 +180,21 @@ function onUpload(file: File) {
</n-table>
</c-card>
<input-copyable v-if="parsedEmail.messageId" :label="t('tools.outlook-parser.texts.label-message-id')" :value="parsedEmail.messageId" />
<input-copyable v-if="parsedEmail.senderName" :label="t('tools.outlook-parser.texts.label-sender-name')" :value="parsedEmail.senderName" />
<input-copyable v-if="parsedEmail.senderEmail" :label="t('tools.outlook-parser.texts.label-sender-email')" :value="parsedEmail.senderEmail" />
<input-copyable
v-if="parsedEmail.messageId"
:label="t('tools.outlook-parser.texts.label-message-id')"
:value="parsedEmail.messageId"
/>
<input-copyable
v-if="parsedEmail.senderName"
:label="t('tools.outlook-parser.texts.label-sender-name')"
:value="parsedEmail.senderName"
/>
<input-copyable
v-if="parsedEmail.senderEmail"
:label="t('tools.outlook-parser.texts.label-sender-email')"
:value="parsedEmail.senderEmail"
/>
<c-card v-if="parsedEmail.headers" :title="t('tools.outlook-parser.texts.title-all-headers')" mt-2>
<textarea-copyable :value="parsedEmail.headers" />
@@ -177,7 +205,7 @@ function onUpload(file: File) {
v-for="(h, index) in parsedEmail.rawProps || []"
:key="index"
:label="h.propertyName || getPropertyName(h.propertyTag)"
:value="h.value"
:value="String(h.value ?? '')"
/>
</c-card>
</c-card>
+11 -8
View File
@@ -20,16 +20,18 @@ const results = computedAsync(async () => {
}
try {
return await parquetReadObjects({ file: await file.arrayBuffer(), compressors });
}
catch (e: any) {
} catch (e: any) {
error.value = e.toString();
return [];
}
});
const resultsJson = computed(() => JSON.stringify(results.value || [], (_, v) => typeof v === 'bigint' ? v.toString() : v, 2));
const resultsJson = computed(() =>
JSON.stringify(results.value || [], (_, v) => (typeof v === 'bigint' ? v.toString() : v), 2),
);
const columns = computed(() => Object.keys((results.value || [])[0] || {})
.map(h => ({ key: h.replace(/\./g, '\\.'), title: h })));
const columns = computed(() =>
Object.keys((results.value || [])[0] || {}).map((h) => ({ key: h.replace(/\\/g, '\\\\').replace(/\./g, '\\.'), title: h })),
);
function onUpload(file: File) {
if (file) {
@@ -70,9 +72,10 @@ function downloadCsv() {
ref="tableRef"
size="small"
:columns="columns"
:data="results" bordered striped
pagination
:data="results ?? []"
bordered
striped
:pagination="{}"
/>
</n-tab-pane>
</n-tabs>
+21 -24
View File
@@ -9,7 +9,7 @@ const { t } = useI18n();
const fileInputs = ref<Array<{ file: File; range: string }>>([]);
function onUploads(files: Array<File>) {
fileInputs.value = [...fileInputs.value, ...(files.map(f => ({ file: f, range: '' })))];
fileInputs.value = [...fileInputs.value, ...files.map((f) => ({ file: f, range: '' }))];
}
const status = ref<'idle' | 'done' | 'error' | 'processing'>('idle');
@@ -17,11 +17,10 @@ const status = ref<'idle' | 'done' | 'error' | 'processing'>('idle');
const base64OutputPDF = ref('');
const logs = ref<string[]>([]);
const fileName = ref('concat.pdf');
const { download } = useDownloadFileFromBase64(
{
source: base64OutputPDF,
filename: fileName,
});
const { download } = useDownloadFileFromBase64({
source: base64OutputPDF,
filename: fileName,
});
const qpdfCommand = ref('');
async function onProcessClicked() {
@@ -37,29 +36,23 @@ async function onProcessClicked() {
status.value = 'processing';
try {
const options = [
'--empty',
'--pages',
];
const options = ['--empty', '--pages'];
for (let i = 0; i < fileInputsValue.length; i++) {
options.push(`in${i}.pdf`);
if (fileInputsValue[i].range) {
options.push(`${fileInputsValue[i].range}`);
}
else {
} else {
options.push('1-z');
}
}
options.push('--');
options.push('out.pdf');
const outPdfBuffer = await callMainWithManyInOutPdf(fileBuffers,
options, 0);
const outPdfBuffer = await callMainWithManyInOutPdf(fileBuffers, options, 0);
base64OutputPDF.value = `data:application/pdf;base64,${Base64.fromUint8Array(outPdfBuffer)}`;
status.value = 'done';
download();
}
catch (e) {
} catch (e) {
status.value = 'error';
}
}
@@ -97,7 +90,11 @@ async function callMainWithManyInOutPdf(input_files: Array<ArrayBuffer>, args: s
@files-upload="onUploads"
/>
<div mt-2 text-center>
<c-input-text :value="fileName" :label="t('tools.pdf-concat.texts.label-output-file')" label-position="left" />
<c-input-text
:value="fileName"
:label="t('tools.pdf-concat.texts.label-output-file')"
label-position="left"
/>
</div>
</div>
@@ -107,7 +104,7 @@ async function callMainWithManyInOutPdf(input_files: Array<ArrayBuffer>, args: s
show-sort-button
w-full
:insertion-disabled="true"
:create-button-props="{ id: 'pdf-concat-create' }"
:create-button-props="{ id: 'pdf-concat-create' } as any"
>
<template #action="{ index, remove, move }">
<div ml-1 flex gap-1>
@@ -139,7 +136,8 @@ async function callMainWithManyInOutPdf(input_files: Array<ArrayBuffer>, args: s
</div>
<n-p>
{{ t('tools.pdf-concat.texts.tag-for-details-about-range-options-see') }}<n-a target="_blank" href="https://qpdf.readthedocs.io/en/stable/cli.html#page-selection">
{{ t('tools.pdf-concat.texts.tag-for-details-about-range-options-see')
}}<n-a target="_blank" href="https://qpdf.readthedocs.io/en/stable/cli.html#page-selection">
{{ t('tools.pdf-concat.texts.tag-qpdf-documentation') }}
</n-a>
</n-p>
@@ -156,10 +154,7 @@ async function callMainWithManyInOutPdf(input_files: Array<ArrayBuffer>, args: s
<c-alert v-if="status === 'error'" type="error">
{{ $t('tools.file-type.texts.an-error-occured-processing') }} <span>{{ fileName }}</span>
</c-alert>
<n-spin
v-if="status === 'processing'"
size="small"
/>
<n-spin v-if="status === 'processing'" size="small" />
</div>
<c-card :title="t('tools.pdf-concat.texts.title-logs')">
@@ -170,5 +165,7 @@ async function callMainWithManyInOutPdf(input_files: Array<ArrayBuffer>, args: s
</template>
<style scoped>
::v-deep(#pdf-concat-create) { display: none; }
::v-deep(#pdf-concat-create) {
display: none;
}
</style>
@@ -71,14 +71,12 @@ async function encryptStream() {
encryptProgress.value = Math.round((processed / total) * 100);
}
encryptedBlob.value = new Blob(chunks, { type: 'application/octet-stream' });
encryptedBlob.value = new Blob(chunks as BlobPart[], { type: 'application/octet-stream' });
message.success('File encrypted.');
}
catch (err: any) {
} catch (err: any) {
error.value = err.toString();
message.error('Encryption failed.');
}
finally {
} finally {
loadingEncrypt.value = false;
}
}
@@ -104,9 +102,9 @@ async function decryptStream() {
const unlockedKey = passphrase.value
? await openpgp.decryptKey({
privateKey,
passphrase: passphrase.value,
})
privateKey,
passphrase: passphrase.value,
})
: privateKey;
const source = encryptedBlob.value ?? file.value!;
@@ -138,14 +136,12 @@ async function decryptStream() {
decryptProgress.value = Math.round((processed / total) * 100);
}
decryptedBlob.value = new Blob(chunks, { type: 'application/octet-stream' });
decryptedBlob.value = new Blob(chunks as BlobPart[], { type: 'application/octet-stream' });
message.success('File decrypted.');
}
catch (err: any) {
} catch (err: any) {
error.value = err.toString();
message.error('Decryption failed.');
}
finally {
} finally {
loadingDecrypt.value = false;
}
}
@@ -186,13 +182,24 @@ function downloadBlob(blob: Blob | null, filename: string) {
<NCard :title="t('tools.pgp-file-encryption.texts.title-3-private-key-passphrase-for-decryption')">
<c-input-text v-model:value="privateKeyArmored" multiline rows="6" mb-1 />
<NFormItem :label="t('tools.pgp-file-encryption.texts.label-passphrase')" label-placement="left">
<NInput v-model:value="passphrase" type="password" show-password-on="click" :placeholder="t('tools.pgp-file-encryption.texts.placeholder-passphrase')" />
<NInput
v-model:value="passphrase"
type="password"
show-password-on="click"
:placeholder="t('tools.pgp-file-encryption.texts.placeholder-passphrase')"
/>
</NFormItem>
</NCard>
<!-- Actions -->
<NSpace justify="center" mb-1>
<NButton :disabled="!file || !publicKeyArmored" type="primary" :loading="loadingEncrypt" mr-2 @click="encryptStream">
<NButton
:disabled="!file || !publicKeyArmored"
type="primary"
:loading="loadingEncrypt"
mr-2
@click="encryptStream"
>
{{ t('tools.pgp-file-encryption.texts.tag-encrypt-stream') }}
</NButton>
@@ -232,7 +239,10 @@ function downloadBlob(blob: Blob | null, filename: string) {
{{ t('tools.pgp-file-encryption.texts.tag-decrypted-file-ready') }}
</NAlert>
<NSpace justify="center">
<NButton size="small" @click="downloadBlob(decryptedBlob, `decrypted-${((file?.name || 'file').replace(/\.pgp$/, ''))}`)">
<NButton
size="small"
@click="downloadBlob(decryptedBlob, `decrypted-${(file?.name || 'file').replace(/\.pgp$/, '')}`)"
>
{{ t('tools.pgp-file-encryption.texts.tag-download-decrypted') }}
</NButton>
</NSpace>
@@ -4,22 +4,28 @@ import { randomNumber } from './pin-code-generator.service';
describe('pin-code-generator', () => {
describe('randomNumber', () => {
it('should generate random pin code of given length', () => {
expect(randomNumber({
length: 10,
})).toHaveLength(10);
expect(randomNumber({
length: 4,
})).toHaveLength(4);
expect(randomNumber({
length: 25,
})).toHaveLength(25);
expect(
randomNumber({
length: 10,
}),
).toHaveLength(10);
expect(
randomNumber({
length: 4,
}),
).toHaveLength(4);
expect(
randomNumber({
length: 25,
}),
).toHaveLength(25);
});
it('should generate random pin code without duplicate', () => {
const pin = randomNumber({
length: 10,
});
expect(pin).toHaveLength(10);
expect(pin.length).to.eq([...new Set(pin.split(''))].length);
expect(pin.length).to.eq(new Set(pin.split('')).size);
});
it('should generate random pin code with duplicate', () => {
+7 -7
View File
@@ -44,7 +44,11 @@ export default createStore({
state.prefersAlarmSound = !state.prefersAlarmSound;
},
toggleTimer(state) {
state.isTimerRunning ? stopTimer(state) : startTimer(state);
if (state.isTimerRunning) {
stopTimer(state);
} else {
startTimer(state);
}
},
toggleResetDropup(state) {
state.isResetDropupVisible = !state.isResetDropupVisible;
@@ -76,10 +80,6 @@ export default createStore({
this.commit('updateAppColor', { propName: 'appAccentColor', propValue: '#3b83b0' });
},
},
actions: {
},
modules: {
},
actions: {},
modules: {},
});
+15 -18
View File
@@ -9,15 +9,21 @@ function msToString(ms) {
let titleInterval = null;
function startTitleAlarm(str, delay) {
titleInterval = setInterval(() => {
document.title.startsWith('⏰')
? document.title = `${str} - IT Tools`
: document.title = '⏰⏰⏰⏰⏰⏰⏰⏰⏰⏰' + ' - IT Tools';
if (document.title.startsWith('⏰')) {
document.title = `${str} - IT Tools`;
} else {
document.title = '⏰⏰⏰⏰⏰⏰⏰⏰⏰⏰' + ' - IT Tools';
}
}, delay);
}
function stopTitleAlarm() {
// eslint-disable-next-line no-alert
titleInterval ? clearInterval(titleInterval) : alert('Error: something went wrong when trying to stop the title alarm.');
if (titleInterval) {
clearInterval(titleInterval);
} else {
// eslint-disable-next-line no-alert
alert('Error: something went wrong when trying to stop the title alarm.');
}
document.title = 'Pomodoro Timer - IT Tools';
}
@@ -25,8 +31,7 @@ function getNextTimerMode(state) {
const currentMode = state.progress[state.progress.length - 1];
if (currentMode === 'workInterval') {
return state.progress.length === state.shortBreakCount * 2 + 1 ? 'longBreak' : 'shortBreak';
}
else {
} else {
return 'workInterval';
}
}
@@ -89,8 +94,7 @@ function onTimerFinished(state, alarmPlayer) {
function setupNextTimerMode(state) {
if (state.progress.length === state.shortBreakCount * 2 + 2) {
startOver(state);
}
else {
} else {
const timerMode = state.progress[state.progress.length - 1];
state.time = state[timerMode] * 60000;
state.counter = msToString(state.time);
@@ -120,7 +124,7 @@ function startTimer(state) {
}
state.time = newRemainingTime;
state.counter = msToString(newRemainingTime);
state.progressPercent = (totalModeTime - newRemainingTime) / totalModeTime * 100;
state.progressPercent = ((totalModeTime - newRemainingTime) / totalModeTime) * 100;
}, 200);
}
@@ -136,11 +140,4 @@ function setAppAccentColor(hexColor) {
root.style.setProperty('--pomodoro-app-accent-color', hexColor);
}
export {
startTimer,
stopTimer,
startOver,
setupNextTimerMode,
stopAlarms,
setAppAccentColor,
};
export { startTimer, stopTimer, startOver, setupNextTimerMode, stopAlarms, setAppAccentColor };
+3 -6
View File
@@ -1,7 +1,4 @@
declare module 'esm-potrace-wasm' {
export function potrace(
imageBitmapSource: ImageBitmapSource,
options: Object
): Promise<string>;
export function init(): Promise<void>;
}
export function potrace(imageBitmapSource: ImageBitmapSource, options: object): Promise<string>;
export function init(): Promise<void>;
}
@@ -19,9 +19,9 @@ const supportedUnits = {
fW: 'femtowatt',
horsepower: 'horsepower',
hp: 'mechanical horsepower',
}; ;
};
</script>
<template>
<UnitsConverter default-unit="W" :supported-units="supportedUnits" label-width="150px" />
<UnitsConverter default-unit="W" converter-type="convert" :supported-units="supportedUnits" label-width="150px" />
</template>
+52 -40
View File
@@ -9,16 +9,17 @@ const { t } = useI18n();
const message = useMessage();
const { data: rawText } = useIDBKeyval('rsvp:txt', '');
const words = computed(() =>
rawText.value
.replace(/\r/g, '') // clean \r
.replace(/\s+([!?:;])/g, '$1') // clean \r
.replace(/\n\s*\n/g, '¤endpara¤ ') // keep double empty lines for para breaks
.replace(/\s+/g, ' ')
.trim()
.split(' ')
.filter(Boolean)
.map((word: string) => word.replace(/¤endpara¤$/g, '\n\n')), // add double \n for para breaks
const words = computed(
() =>
rawText.value
.replace(/\r/g, '') // clean \r
.replace(/\s+([!?:;])/g, '$1') // clean \r
.replace(/\n\s*\n/g, '¤endpara¤ ') // keep double empty lines for para breaks
.replace(/\s+/g, ' ')
.trim()
.split(' ')
.filter(Boolean)
.map((word: string) => word.replace(/¤endpara¤$/g, '\n\n')), // add double \n for para breaks
);
const wpm = useQueryParamOrStorage({ name: 'wpm', storageName: 'rsvp:w', defaultValue: 300 });
@@ -107,8 +108,7 @@ function scheduleNext() {
if (next < words.value.length) {
currentIndex.value = next;
scheduleNext();
}
else {
} else {
isPlaying.value = false;
clearTimer();
}
@@ -163,8 +163,7 @@ async function onUpload(file: File) {
}
message.error(t('tools.rsvp-reader.text.unsupported-file-type'));
}
catch (err) {
} catch (err) {
message.error(`Failed to parse file: ${err}`);
}
isProcessingFile.value = false;
@@ -174,7 +173,11 @@ function handleKeydown(e: KeyboardEvent) {
// Space → Play/Pause
if (e.code === 'Space') {
e.preventDefault();
isPlaying.value ? pause() : start();
if (isPlaying.value) {
pause();
} else {
start();
}
}
// Right arrow → skip forward
@@ -215,21 +218,15 @@ function handleKeydown(e: KeyboardEvent) {
}
function moveRight() {
currentIndex.value = Math.min(
currentIndex.value + chunkSize.value,
words.value.length - 1,
);
currentIndex.value = Math.min(currentIndex.value + chunkSize.value, words.value.length - 1);
}
function moveLeft() {
currentIndex.value = Math.max(
currentIndex.value - chunkSize.value,
0,
);
currentIndex.value = Math.max(currentIndex.value - chunkSize.value, 0);
}
function progressJump(e: MouseEvent) {
let el: HTMLElement | null = (e.target as HTMLElement);
let el: HTMLElement | null = e.target as HTMLElement;
while (el && !el.className.includes('n-progress-content')) {
el = el.parentElement;
}
@@ -279,18 +276,14 @@ onBeforeUnmount(() => {
<NProgress
type="line"
:percentage="((currentIndex / words.length) * 100).toFixed(1)"
:percentage="Number(((currentIndex / words.length) * 100).toFixed(1))"
indicator-placement="inside"
style="cursor: pointer;"
style="cursor: pointer"
mb-2
@click="progressJump"
/>
<NCard
embedded
style="text-align: center; min-height: 150px;"
:style="{ backgroundColor: bgColor }"
>
<NCard embedded style="text-align: center; min-height: 150px" :style="{ backgroundColor: bgColor }">
<div
:style="{
fontSize: `${fontSize}px`,
@@ -303,7 +296,8 @@ onBeforeUnmount(() => {
</div>
</NCard>
<n-space justify="center" mt-1>
<NText>{{ currentIndex + 1 }} / {{ words.length }} {{ t('tools.rsvp-reader.text.words') }}</NText> - <NText>{{ wpm }} {{ t('tools.rsvp-reader.text.wpm') }}</NText>
<NText>{{ currentIndex + 1 }} / {{ words.length }} {{ t('tools.rsvp-reader.text.words') }}</NText> -
<NText>{{ wpm }} {{ t('tools.rsvp-reader.text.wpm') }}</NText>
</n-space>
</div>
</n-tab-pane>
@@ -382,7 +376,7 @@ onBeforeUnmount(() => {
<n-table :bordered="false" :single-line="false" size="small">
<thead>
<tr>
<th style="width: 160px;">
<th style="width: 160px">
{{ t('tools.rsvp-reader.texts.tag-shortcut') }}
</th>
<th>{{ t('tools.rsvp-reader.texts.tag-action') }}</th>
@@ -390,37 +384,55 @@ onBeforeUnmount(() => {
</thead>
<tbody>
<tr>
<td><kbd>{{ t('tools.rsvp-reader.texts.tag-space') }}</kbd></td>
<td>
<kbd>{{ t('tools.rsvp-reader.texts.tag-space') }}</kbd>
</td>
<td>{{ t('tools.rsvp-reader.texts.tag-play-pause') }}</td>
</tr>
<tr>
<td><kbd>{{ t('tools.rsvp-reader.texts.tag-') }}</kbd>{{ t('tools.rsvp-reader.texts.tag-right-arrow') }}</td>
<td>
<kbd>{{ t('tools.rsvp-reader.texts.tag-') }}</kbd
>{{ t('tools.rsvp-reader.texts.tag-right-arrow') }}
</td>
<td>{{ t('tools.rsvp-reader.texts.tag-skip-forward-one-chunk') }}</td>
</tr>
<tr>
<td><kbd>{{ t('tools.rsvp-reader.texts.tag-') }}</kbd>{{ t('tools.rsvp-reader.texts.tag-left-arrow') }}</td>
<td>
<kbd>{{ t('tools.rsvp-reader.texts.tag-') }}</kbd
>{{ t('tools.rsvp-reader.texts.tag-left-arrow') }}
</td>
<td>{{ t('tools.rsvp-reader.texts.tag-skip-backward-one-chunk') }}</td>
</tr>
<tr>
<td><kbd>{{ t('tools.rsvp-reader.texts.tag-') }}</kbd>{{ t('tools.rsvp-reader.texts.tag-up-arrow') }}</td>
<td>
<kbd>{{ t('tools.rsvp-reader.texts.tag-') }}</kbd
>{{ t('tools.rsvp-reader.texts.tag-up-arrow') }}
</td>
<td>{{ t('tools.rsvp-reader.texts.tag-increase-wpm') }}</td>
</tr>
<tr>
<td><kbd>{{ t('tools.rsvp-reader.texts.tag-') }}</kbd>{{ t('tools.rsvp-reader.texts.tag-down-arrow') }}</td>
<td>
<kbd>{{ t('tools.rsvp-reader.texts.tag-') }}</kbd
>{{ t('tools.rsvp-reader.texts.tag-down-arrow') }}
</td>
<td>{{ t('tools.rsvp-reader.texts.tag-decrease-wpm') }}</td>
</tr>
<tr>
<td><kbd>{{ t('tools.rsvp-reader.texts.tag-home') }}</kbd></td>
<td>
<kbd>{{ t('tools.rsvp-reader.texts.tag-home') }}</kbd>
</td>
<td>{{ t('tools.rsvp-reader.texts.tag-jump-to-start') }}</td>
</tr>
<tr>
<td><kbd>{{ t('tools.rsvp-reader.texts.tag-end') }}</kbd></td>
<td>
<kbd>{{ t('tools.rsvp-reader.texts.tag-end') }}</kbd>
</td>
<td>{{ t('tools.rsvp-reader.texts.tag-jump-to-end') }}</td>
</tr>
</tbody>
@@ -4,31 +4,60 @@ import ipRegex from 'ip-regex';
const jwtRegex = /\b([a-zA-Z0-9_=]{5,})\.([a-zA-Z0-9_=]{5,})\.([a-zA-Z0-9_\-\+\/=]{5,})\b/g;
const phoneRegex = /(?:(\+\d{1,4})[-.\s]?)(?:[(](\d{1,3})[)][-.\s]?)?(\d{1,4})[-.\s]?(\d{1,4})[-.\s]?(\d{1,9})\b/g;
const macRegex = /\b([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})\b/g;
const urlWithOrWithoutPrefixRegex = /\b(https?:\/\/)?(www\.)?[a-zA-Z0-9@:%._+~#=-]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_+.~#?&\/=]*)\b/g;
const urlWithOrWithoutPrefixRegex =
/\b(https?:\/\/)?(www\.)?[a-zA-Z0-9@:%._+~#=-]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_+.~#?&\/=]*)\b/g;
export type MatcherNames = 'uuid' | 'creditCard' | 'ssn' | 'url' | 'ipv4' | 'email' | 'passwordInUri' | 'mac' | 'ipv6' | 'urlWithOrWithoutPrefix' | 'jwt' | 'phone';
export type MatcherNames =
| 'uuid'
| 'creditCard'
| 'ssn'
| 'url'
| 'ipv4'
| 'email'
| 'passwordInUri'
| 'mac'
| 'ipv6'
| 'urlWithOrWithoutPrefix'
| 'jwt'
| 'phone';
export function maskSensitiveData({
value,
customRegex = '',
excludedMatchers = [],
}: {
value: string
customRegex?: string
excludedMatchers?: Array<MatcherNames>
value: string;
customRegex?: string;
excludedMatchers?: Array<MatcherNames>;
}) {
excludedMatchers = excludedMatchers || [];
const emptyRegex = /(?:)/g;
return maskString(value, null as never, {
customRegex: new RegExp((customRegex || '').split('\n').map(line => `(${line})`).join('|'), 'gi'),
macRegex: excludedMatchers.includes('mac') ? emptyRegex : macRegex,
ipv6Regex: excludedMatchers.includes('ipv6') ? emptyRegex : ipRegex.v6({ includeBoundaries: false }),
urlWithOrWithoutPrefixRegex: excludedMatchers.includes('urlWithOrWithoutPrefix') ? emptyRegex : urlWithOrWithoutPrefixRegex,
jwtRegex: excludedMatchers.includes('jwt') ? emptyRegex : jwtRegex,
phoneRegex: excludedMatchers.includes('phone') ? emptyRegex : phoneRegex,
}, {
excludeMatchers: [...excludedMatchers, ...[
'passwordMention', 'password', 'passwordSubstring',
]] as SensitiveContentKey[],
});
return maskString(
value,
null as never,
{
customRegex: new RegExp(
(customRegex || '')
.split('\n')
.map((line) => `(${line})`)
.join('|'),
'gi',
),
macRegex: excludedMatchers.includes('mac') ? emptyRegex : macRegex,
ipv6Regex: excludedMatchers.includes('ipv6') ? emptyRegex : ipRegex.v6({ includeBoundaries: false }),
urlWithOrWithoutPrefixRegex: excludedMatchers.includes('urlWithOrWithoutPrefix')
? emptyRegex
: urlWithOrWithoutPrefixRegex,
jwtRegex: excludedMatchers.includes('jwt') ? emptyRegex : jwtRegex,
phoneRegex: excludedMatchers.includes('phone') ? emptyRegex : phoneRegex,
},
{
excludeMatchers: [
...excludedMatchers,
'passwordMention',
'password',
'passwordSubstring',
] as SensitiveContentKey[],
},
);
}
+9 -16
View File
@@ -10,17 +10,8 @@ const input = ref('');
const outputRef = ref<HTMLElement | null>(null);
const selectedPort = ref<SerialPort | undefined>();
const {
isConnected,
outputLines,
baudRate,
lineEnding,
availablePorts,
connect,
disconnect,
send,
listPorts,
} = useSerialPort();
const { isConnected, outputLines, baudRate, lineEnding, availablePorts, connect, disconnect, send, listPorts } =
useSerialPort();
const baudOptions = [
{ label: t('tools.serial-console.texts.label-9600'), value: 9600 },
@@ -65,9 +56,10 @@ function isWindowSecureContext() {
<template>
<c-alert v-if="!isWindowSecureContext()" mb-2>
{{ $t('tools.pgp-encryption.texts.tag-your-browser-is-not-in') }}<n-a href="https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts" target="_blank">
{{ $t('tools.pgp-encryption.texts.tag-secure-context-https') }}
</n-a>{{ $t('tools.pgp-encryption.texts.tag-this-tool-may-not-work-correctly-and-require-https-to-work-fully') }}
{{ $t('tools.pgp-encryption.texts.tag-your-browser-is-not-in')
}}<n-a href="https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts" target="_blank">
{{ $t('tools.pgp-encryption.texts.tag-secure-context-https') }} </n-a
>{{ $t('tools.pgp-encryption.texts.tag-this-tool-may-not-work-correctly-and-require-https-to-work-fully') }}
</c-alert>
<NCard :title="t('tools.serial-console.texts.title-serial-terminal')">
@@ -85,8 +77,9 @@ function isWindowSecureContext() {
style="width: 120px"
/>
<NSelect
v-model:value="selectedPort"
:options="portOptions"
:value="selectedPort as any"
:options="portOptions as any"
@update:value="(v: any) => (selectedPort = v)"
label-field="label"
value-field="value"
:placeholder="t('tools.serial-console.texts.placeholder-select-port')"
@@ -9,7 +9,9 @@ const error = ref('');
const loading = ref(false);
const corsAnywhereUrl = useITStorage('short-urls-expander:cors-anywhere-url', '//cors.outils-libre.org');
function expandSingleUrl(url: string): Promise<{ short: string; expanded: string | null; ok: boolean; status: string }> {
function expandSingleUrl(
url: string,
): Promise<{ short: string; expanded: string | null; ok: boolean; status: string }> {
return new Promise((resolve) => {
try {
const corsUrl = `${corsAnywhereUrl.value.replace(/\/+$/g, '')}/${url}`;
@@ -20,9 +22,13 @@ function expandSingleUrl(url: string): Promise<{ short: string; expanded: string
// In browsers, xhr.responseURL gives the final resolved URL after redirects
const finalUrl = xhr.getResponseHeader('X-Final-Url') || xhr.responseURL;
if (finalUrl && finalUrl !== corsUrl) {
resolve({ short: url, expanded: finalUrl, status: t('tools.short-urls-expander.texts.expanded'), ok: true });
}
else {
resolve({
short: url,
expanded: finalUrl,
status: t('tools.short-urls-expander.texts.expanded'),
ok: true,
});
} else {
resolve({ short: url, expanded: null, status: t('tools.short-urls-expander.texts.no-redirect'), ok: true });
}
}
@@ -31,8 +37,7 @@ function expandSingleUrl(url: string): Promise<{ short: string; expanded: string
resolve({ short: url, expanded: null, status: t('tools.short-urls-expander.texts.failed'), ok: false });
};
xhr.send();
}
catch {
} catch {
resolve({ short: url, expanded: null, status: t('tools.short-urls-expander.texts.failed'), ok: false });
}
});
@@ -45,8 +50,8 @@ async function expandUrls() {
const urls = inputUrls.value
.split('\n')
.map(u => u.trim())
.filter(u => u.length > 0);
.map((u) => u.trim())
.filter((u) => u.length > 0);
try {
const promises = urls.map(async (url) => {
@@ -54,11 +59,9 @@ async function expandUrls() {
});
results.value = await Promise.all(promises);
}
catch (err) {
} catch (err) {
error.value = t('tools.short-urls-expander.texts.failed-to-expand-some-urls');
}
finally {
} finally {
loading.value = false;
}
}
@@ -68,15 +71,15 @@ function downloadCsv() {
return;
}
const header = [t('tools.short-urls-expander.texts.short-url'), t('tools.short-urls-expander.texts.expanded-url'), t('tools.short-urls-expander.texts.tag-status')];
const rows = results.value.map(r => [
r.short,
r.expanded ?? '',
r.status,
]);
const header = [
t('tools.short-urls-expander.texts.short-url'),
t('tools.short-urls-expander.texts.expanded-url'),
t('tools.short-urls-expander.texts.tag-status'),
];
const rows = results.value.map((r) => [r.short, r.expanded ?? '', r.status]);
const csvContent = [header, ...rows]
.map(row => row.map(field => `"${String(field).replace(/"/g, '""')}"`).join(','))
.map((row) => row.map((field) => `"${String(field).replace(/"/g, '""')}"`).join(','))
.join('\n');
const blob = new Blob([csvContent], { type: 'text/csv;charset=utf-8;' });
@@ -103,7 +106,11 @@ function downloadCsv() {
mb-1
/>
<n-p>
{{ t('tools.short-urls-expander.texts.this-tools-requires-a-cors-anywhere-instance-to-bypass-cors-policy-you-can-use-a') }}
{{
t(
'tools.short-urls-expander.texts.this-tools-requires-a-cors-anywhere-instance-to-bypass-cors-policy-you-can-use-a',
)
}}
<a href="https://github.com/sharevb/cors-anywhere?tab=readme-ov-file#run-with-docker" target="_blank">
{{ t('tools.short-urls-expander.texts.self-hosted-cors-anywhere') }}
</a>
@@ -148,7 +155,7 @@ function downloadCsv() {
<tr v-for="(url, index) of results" :key="index">
<td>{{ url.short }}</td>
<td>
<input-copyable :value="url.expanded" />
<input-copyable :value="url.expanded ?? ''" />
</td>
<td>
<n-a v-if="url.expanded" :href="url.expanded" target="_blank">
+2 -2
View File
@@ -9,12 +9,12 @@ function transformer(value: string) {
const Result = getAuthHeaderCheckResult({ message: value, password: password.value });
if (Result) {
return t('tools.sip-auth.sucess');
}
else {
} else {
return t('tools.sip-auth.failure');
// return `11 calculatedHash: ${calculatedHash}, response: ${response}`;
}
}
return '';
}
</script>
@@ -1,7 +1,13 @@
<script setup lang="ts">
import { useI18n } from 'vue-i18n';
import satisfies from 'spdx-satisfies';
import { type ConditionTag, type LimitationTag, type PermissionTag, getLicenseFromId, licenses } from 'safe-license-list';
import {
type ConditionTag,
type LimitationTag,
type PermissionTag,
getLicenseFromId,
licenses,
} from 'safe-license-list';
import type { VNode } from 'vue';
import { h, ref } from 'vue';
import type { SelectOption } from 'naive-ui';
@@ -17,8 +23,7 @@ const secondLicence = ref('MIT');
const compatibility = computed(() => {
try {
return satisfies(firstLicence.value.split(':')[0], [secondLicence.value.split(':')[0]]) ? 'ok' : 'nok';
}
catch (e: any) {
} catch (e: any) {
return e.toString();
}
});
@@ -36,21 +41,42 @@ const permissionsInfos = permissions.map((l) => {
const conditions = [
{ key: 'include-copyright', desc: 'A copy of the license and copyright notice must be included with the software.' },
{ key: 'include-copyright--source', desc: 'A copy of the license and copyright notice must be included with the software in source form, but is not required for binaries.' },
{
key: 'include-copyright--source',
desc: 'A copy of the license and copyright notice must be included with the software in source form, but is not required for binaries.',
},
{ key: 'document-changes', desc: 'Changes made to the code must be documented.' },
{ key: 'disclose-source', desc: 'Source code must be made available when the software is distributed.' },
{ key: 'network-use-disclose', desc: 'Users who interact with the software via network are given the right to receive a copy of the source code.' },
{ key: 'same-license', desc: 'Modifications must be released under the same license when distributing the software. In some cases a similar or related license may be used.' },
{ key: 'same-license--file', desc: 'Modifications of existing files must be released under the same license when distributing the software. In some cases a similar or related license may be used.' },
{ key: 'same-license--library', desc: 'Modifications must be released under the same license when distributing the software. In some cases a similar or related license may be used, or this condition may not apply to works that use the software as a library.' },
{
key: 'network-use-disclose',
desc: 'Users who interact with the software via network are given the right to receive a copy of the source code.',
},
{
key: 'same-license',
desc: 'Modifications must be released under the same license when distributing the software. In some cases a similar or related license may be used.',
},
{
key: 'same-license--file',
desc: 'Modifications of existing files must be released under the same license when distributing the software. In some cases a similar or related license may be used.',
},
{
key: 'same-license--library',
desc: 'Modifications must be released under the same license when distributing the software. In some cases a similar or related license may be used, or this condition may not apply to works that use the software as a library.',
},
];
const conditionsInfos = conditions.map((l) => {
return { value: l.key, label: l.key, desc: l.desc };
});
const limitations = [
{ key: 'trademark-use', desc: 'This license explicitly states that it does NOT grant trademark rights, even though licenses without such a statement probably do not grant any implicit trademark rights.' },
{
key: 'trademark-use',
desc: 'This license explicitly states that it does NOT grant trademark rights, even though licenses without such a statement probably do not grant any implicit trademark rights.',
},
{ key: 'liability', desc: 'This license includes a limitation of liability.' },
{ key: 'patent-use', desc: 'This license explicitly states that it does NOT grant any rights in the patents of contributors.' },
{
key: 'patent-use',
desc: 'This license explicitly states that it does NOT grant any rights in the patents of contributors.',
},
{ key: 'warranty', desc: 'The license explicitly states that it does NOT provide any warranty.' },
];
const limitationsInfos = limitations.map((l) => {
@@ -68,9 +94,11 @@ const currentLicence = ref('MIT');
const currentLicenceInfo = computed(() => {
return getLicenseFromId(currentLicence.value, true);
});
const licenceInfos = computed(() => licenses.map((l) => {
return { value: l.id, label: `${l.id}: ${l.title}` };
}));
const licenceInfos = computed(() =>
licenses.map((l) => {
return { value: l.id, label: `${l.id}: ${l.title}` };
}),
);
const filterAllowedPermissions = ref([]);
const filterDisallowedPermissions = ref([]);
@@ -80,26 +108,34 @@ const filterAllowedLimitations = ref([]);
const filterDisallowedLimitations = ref([]);
function includesAll(filters: string | string[], elements: string[]) {
return filters === '' || (filters as string[])?.every(e => elements.includes(e));
return filters === '' || (filters as string[])?.every((e) => elements.includes(e));
}
function includesNone(filters: string | string[], elements: string[]) {
return filters === '' || (filters as string[])?.every(e => !elements.includes(e));
return filters === '' || (filters as string[])?.every((e) => !elements.includes(e));
}
const filteredLicencesInfos = computed(() => licenses.filter(
(licence) => {
return includesAll(filterAllowedPermissions.value, licence.permissions)
&& includesNone(filterDisallowedPermissions.value, licence.permissions)
&& includesAll(filterAllowedConditions.value, licence.conditions)
&& includesNone(filterDisallowedConditions.value, licence.conditions)
&& includesAll(filterAllowedLimitations.value, licence.limitations)
&& includesNone(filterDisallowedLimitations.value, licence.limitations);
}).map((l) => {
return { value: l.id, label: `${l.id}: ${l.title}` };
}));
const filteredLicencesInfos = computed(() =>
licenses
.filter((licence) => {
return (
includesAll(filterAllowedPermissions.value, licence.permissions) &&
includesNone(filterDisallowedPermissions.value, licence.permissions) &&
includesAll(filterAllowedConditions.value, licence.conditions) &&
includesNone(filterDisallowedConditions.value, licence.conditions) &&
includesAll(filterAllowedLimitations.value, licence.limitations) &&
includesNone(filterDisallowedLimitations.value, licence.limitations)
);
})
.map((l) => {
return { value: l.id, label: `${l.id}: ${l.title}` };
}),
);
function handleLicenceFallback() {
const fallback = filteredLicencesInfos.value && filteredLicencesInfos.value.length > 0 ? filteredLicencesInfos.value[0] : { value: '', label: '' };
const fallback =
filteredLicencesInfos.value && filteredLicencesInfos.value.length > 0
? filteredLicencesInfos.value[0]
: { value: '', label: '' };
currentLicence.value = fallback.value;
return fallback;
}
@@ -108,7 +144,11 @@ function handleLicenceFallback() {
<template>
<div>
<n-card :title="t('tools.software-licence-compatibility.texts.title-software-licences-compatibility')" mb-5>
<n-form-item :label="t('tools.software-licence-compatibility.texts.label-first-license-spdx')" label-placement="left" label-width="120">
<n-form-item
:label="t('tools.software-licence-compatibility.texts.label-first-license-spdx')"
label-placement="left"
label-width="120"
>
<n-auto-complete
v-model:value="firstLicence"
:options="licenceInfos"
@@ -118,11 +158,17 @@ function handleLicenceFallback() {
/>
</n-form-item>
<n-form-item :label="t('tools.software-licence-compatibility.texts.label-second-license-spdx')" label-placement="left" label-width="120">
<n-form-item
:label="t('tools.software-licence-compatibility.texts.label-second-license-spdx')"
label-placement="left"
label-width="120"
>
<n-auto-complete
v-model:value="secondLicence"
:options="licenceInfos"
:placeholder="t('tools.software-licence-compatibility.texts.placeholder-put-your-second-licence-spdx-licence')"
:placeholder="
t('tools.software-licence-compatibility.texts.placeholder-put-your-second-licence-spdx-licence')
"
raw-text
mb-5
/>
@@ -130,13 +176,13 @@ function handleLicenceFallback() {
<div v-if="firstLicence !== '' && secondLicence !== ''" flex justify-center>
<span v-if="compatibility === 'ok'">
<n-icon color="green">
<CheckIcon />
</n-icon>{{ t('tools.software-licence-compatibility.texts.tag-compatible') }}</span>
<n-icon color="green"> <CheckIcon /> </n-icon
>{{ t('tools.software-licence-compatibility.texts.tag-compatible') }}</span
>
<span v-if="compatibility === 'nok'">
<n-icon color="red">
<CrossIcon />
</n-icon>{{ t('tools.software-licence-compatibility.texts.tag-not-compatible') }}</span>
<n-icon color="red"> <CrossIcon /> </n-icon
>{{ t('tools.software-licence-compatibility.texts.tag-not-compatible') }}</span
>
<n-alert v-if="compatibility !== 'nok' && compatibility !== 'ok'" type="error">
{{ compatibility }}
</n-alert>
@@ -152,7 +198,8 @@ function handleLicenceFallback() {
>
<n-select
v-model:value="filterAllowedPermissions"
filterable multiple
filterable
multiple
:options="permissionsInfos"
:render-option="renderTooltips"
/>
@@ -165,7 +212,8 @@ function handleLicenceFallback() {
>
<n-select
v-model:value="filterDisallowedPermissions"
multiple filterable
multiple
filterable
:options="permissionsInfos"
:render-option="renderTooltips"
/>
@@ -180,7 +228,8 @@ function handleLicenceFallback() {
>
<n-select
v-model:value="filterAllowedConditions"
multiple filterable
multiple
filterable
:options="conditionsInfos"
:render-option="renderTooltips"
/>
@@ -193,7 +242,8 @@ function handleLicenceFallback() {
>
<n-select
v-model:value="filterDisallowedConditions"
multiple filterable
multiple
filterable
:options="conditionsInfos"
:render-option="renderTooltips"
/>
@@ -208,7 +258,8 @@ function handleLicenceFallback() {
>
<n-select
v-model:value="filterAllowedLimitations"
multiple filterable
multiple
filterable
:options="limitationsInfos"
:render-option="renderTooltips"
/>
@@ -221,7 +272,8 @@ function handleLicenceFallback() {
>
<n-select
v-model:value="filterDisallowedLimitations"
multiple filterable
multiple
filterable
:options="limitationsInfos"
:render-option="renderTooltips"
/>
@@ -241,46 +293,25 @@ function handleLicenceFallback() {
:fallback-option="handleLicenceFallback"
/>
<n-p text-center>
Applicable licences: {{ filteredLicencesInfos.length }}
</n-p>
<n-p text-center> Applicable licences: {{ filteredLicencesInfos.length }} </n-p>
<n-divider />
<div v-if="filteredLicencesInfos.length > 0">
<n-form-item :label="t('tools.software-licence-compatibility.texts.label-id')" label-placement="left">
<n-input
:value="currentLicenceInfo?.id"
readonly mb-5
/>
<n-input :value="currentLicenceInfo?.id" readonly mb-5 />
</n-form-item>
<n-form-item :label="t('tools.software-licence-compatibility.texts.label-title')" label-placement="left">
<n-input
:value="currentLicenceInfo?.title"
readonly mb-5
/>
<n-input :value="currentLicenceInfo?.title" readonly mb-5 />
</n-form-item>
<n-form-item :label="t('tools.software-licence-compatibility.texts.label-description')">
<TextareaCopyable
:value="currentLicenceInfo?.description ?? ''"
readonly
word-wrap
mb-5
/>
<TextareaCopyable :value="currentLicenceInfo?.description ?? ''" readonly word-wrap mb-5 />
</n-form-item>
<n-form-item :label="t('tools.software-licence-compatibility.texts.label-how')">
<TextareaCopyable
:value="currentLicenceInfo?.how ?? ''"
word-wrap
readonly
mb-5
/>
<TextareaCopyable :value="currentLicenceInfo?.how ?? ''" word-wrap readonly mb-5 />
</n-form-item>
<n-form-item :label="t('tools.software-licence-compatibility.texts.label-used-by')">
<TextareaCopyable
:value="Object.keys(currentLicenceInfo?.using || []).join(', ')"
mb-5
/>
<TextareaCopyable :value="Object.keys(currentLicenceInfo?.using || []).join(', ')" mb-5 />
</n-form-item>
<n-card :title="t('tools.software-licence-compatibility.texts.title-permissions')" mb-5>
@@ -320,12 +351,7 @@ function handleLicenceFallback() {
</n-card>
<n-form-item :label="t('tools.software-licence-compatibility.texts.label-content')">
<TextareaCopyable
:value="currentLicenceInfo?.body ?? ''"
word-wrap
readonly
mb-5
/>
<TextareaCopyable :value="currentLicenceInfo?.body ?? ''" word-wrap readonly mb-5 />
</n-form-item>
</div>
</n-card>
Loaded 100 of 130 files, more files were not shown because too many files have changed in this diff. Show more