mirror of
https://github.com/sharevb/it-tools.git
synced 2026-11-22 22:02:38 +03:00
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:
130 files changed
+10665
-11797
No files matched your search
@@ -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
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -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.
|
- [ ] 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.
|
- [ ] 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`).
|
- [ ] 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.
|
- [ ] Ideally, include relevant tests that fail without this PR but pass with it.
|
||||||
@@ -11,16 +11,16 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v7.0.0
|
||||||
- run: |
|
- run: |
|
||||||
echo "Before: corepack version => $(corepack --version || echo 'not installed')"
|
echo "Before: corepack version => $(corepack --version || echo 'not installed')"
|
||||||
npm install -g corepack@latest
|
npm install -g corepack@latest
|
||||||
echo "After : corepack version => $(corepack --version)"
|
echo "After : corepack version => $(corepack --version)"
|
||||||
corepack enable
|
corepack enable
|
||||||
pnpm --version
|
pnpm --version
|
||||||
- uses: actions/setup-node@v6
|
- uses: actions/setup-node@v6.4.0
|
||||||
with:
|
with:
|
||||||
node-version: 22
|
node-version: 24
|
||||||
cache: 'pnpm'
|
cache: 'pnpm'
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
|
|||||||
@@ -37,11 +37,11 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v7.0.0
|
||||||
|
|
||||||
# Initializes the CodeQL tools for scanning.
|
# Initializes the CodeQL tools for scanning.
|
||||||
- name: Initialize CodeQL
|
- name: Initialize CodeQL
|
||||||
uses: github/codeql-action/init@v4
|
uses: github/codeql-action/init@v4.36.3
|
||||||
with:
|
with:
|
||||||
languages: ${{ matrix.language }}
|
languages: ${{ matrix.language }}
|
||||||
# If you wish to specify custom queries, you can do so here or in a config file.
|
# 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).
|
# 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)
|
# If this step fails, then you should remove it and run the build manually (see below)
|
||||||
- name: Autobuild
|
- 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.
|
# ℹ️ Command-line programs to run using the OS shell.
|
||||||
# 📚 https://git.io/JvXDl
|
# 📚 https://git.io/JvXDl
|
||||||
@@ -69,4 +69,4 @@ jobs:
|
|||||||
# make release
|
# make release
|
||||||
|
|
||||||
- name: Perform CodeQL Analysis
|
- name: Perform CodeQL Analysis
|
||||||
uses: github/codeql-action/analyze@v4
|
uses: github/codeql-action/analyze@v4.36.3
|
||||||
@@ -15,7 +15,7 @@ jobs:
|
|||||||
outputs:
|
outputs:
|
||||||
should_run: ${{ steps.should_run.outputs.should_run }}
|
should_run: ${{ steps.should_run.outputs.should_run }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v7.0.0
|
||||||
- name: print latest_commit
|
- name: print latest_commit
|
||||||
run: echo ${{ github.sha }}
|
run: echo ${{ github.sha }}
|
||||||
|
|
||||||
@@ -31,16 +31,16 @@ jobs:
|
|||||||
if: ${{ needs.check_date.outputs.should_run != 'false' }}
|
if: ${{ needs.check_date.outputs.should_run != 'false' }}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v7.0.0
|
||||||
- run: |
|
- run: |
|
||||||
echo "Before: corepack version => $(corepack --version || echo 'not installed')"
|
echo "Before: corepack version => $(corepack --version || echo 'not installed')"
|
||||||
npm install -g corepack@latest
|
npm install -g corepack@latest
|
||||||
echo "After : corepack version => $(corepack --version)"
|
echo "After : corepack version => $(corepack --version)"
|
||||||
corepack enable
|
corepack enable
|
||||||
pnpm --version
|
pnpm --version
|
||||||
- uses: actions/setup-node@v6
|
- uses: actions/setup-node@v6.4.0
|
||||||
with:
|
with:
|
||||||
node-version: 22
|
node-version: 24
|
||||||
cache: 'pnpm'
|
cache: 'pnpm'
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
@@ -63,7 +63,7 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Docker meta
|
- name: Docker meta
|
||||||
id: meta
|
id: meta
|
||||||
uses: docker/metadata-action@v6
|
uses: docker/metadata-action@v6.2.0
|
||||||
with:
|
with:
|
||||||
images: sharevb/it-tools
|
images: sharevb/it-tools
|
||||||
labels: |
|
labels: |
|
||||||
@@ -71,29 +71,29 @@ jobs:
|
|||||||
|
|
||||||
# Checkout the repository
|
# Checkout the repository
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v7.0.0
|
||||||
|
|
||||||
- name: Login to Docker Hub
|
- name: Login to Docker Hub
|
||||||
uses: docker/login-action@v4
|
uses: docker/login-action@v4.4.0
|
||||||
with:
|
with:
|
||||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||||
|
|
||||||
- name: Login to GitHub Container Registry
|
- name: Login to GitHub Container Registry
|
||||||
uses: docker/login-action@v4
|
uses: docker/login-action@v4.4.0
|
||||||
with:
|
with:
|
||||||
registry: ghcr.io
|
registry: ghcr.io
|
||||||
username: ${{ github.repository_owner }}
|
username: ${{ github.repository_owner }}
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
- name: Set up QEMU
|
- name: Set up QEMU
|
||||||
uses: docker/setup-qemu-action@v4
|
uses: docker/setup-qemu-action@v4.2.0
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v4
|
uses: docker/setup-buildx-action@v4.2.0
|
||||||
|
|
||||||
- name: Build and push
|
- name: Build and push
|
||||||
uses: docker/build-push-action@v7
|
uses: docker/build-push-action@v7.3.0
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
file: ./Dockerfile
|
file: ./Dockerfile
|
||||||
@@ -116,7 +116,7 @@ jobs:
|
|||||||
run: echo "RELEASE_VERSION=nightly" >> $GITHUB_ENV
|
run: echo "RELEASE_VERSION=nightly" >> $GITHUB_ENV
|
||||||
|
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v7.0.0
|
||||||
|
|
||||||
- run: |
|
- run: |
|
||||||
echo "Before: corepack version => $(corepack --version || echo 'not installed')"
|
echo "Before: corepack version => $(corepack --version || echo 'not installed')"
|
||||||
@@ -125,9 +125,9 @@ jobs:
|
|||||||
corepack enable
|
corepack enable
|
||||||
pnpm --version
|
pnpm --version
|
||||||
|
|
||||||
- uses: actions/setup-node@v6
|
- uses: actions/setup-node@v6.4.0
|
||||||
with:
|
with:
|
||||||
node-version: 22
|
node-version: 24
|
||||||
cache: 'pnpm'
|
cache: 'pnpm'
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
@@ -148,7 +148,7 @@ jobs:
|
|||||||
echo "$EOF" >> $GITHUB_OUTPUT
|
echo "$EOF" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: Create Release
|
- name: Create Release
|
||||||
uses: softprops/action-gh-release@v3
|
uses: softprops/action-gh-release@v3.0.1
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
files: it-tools-${{ env.RELEASE_VERSION }}.zip
|
files: it-tools-${{ env.RELEASE_VERSION }}.zip
|
||||||
|
|||||||
@@ -13,16 +13,16 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v7.0.0
|
||||||
- run: |
|
- run: |
|
||||||
echo "Before: corepack version => $(corepack --version || echo 'not installed')"
|
echo "Before: corepack version => $(corepack --version || echo 'not installed')"
|
||||||
npm install -g corepack@latest
|
npm install -g corepack@latest
|
||||||
echo "After : corepack version => $(corepack --version)"
|
echo "After : corepack version => $(corepack --version)"
|
||||||
corepack enable
|
corepack enable
|
||||||
pnpm --version
|
pnpm --version
|
||||||
- uses: actions/setup-node@v6
|
- uses: actions/setup-node@v6.4.0
|
||||||
with:
|
with:
|
||||||
node-version: 22
|
node-version: 24
|
||||||
cache: 'pnpm'
|
cache: 'pnpm'
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
@@ -44,7 +44,7 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Docker meta
|
- name: Docker meta
|
||||||
id: meta
|
id: meta
|
||||||
uses: docker/metadata-action@v6
|
uses: docker/metadata-action@v6.2.0
|
||||||
with:
|
with:
|
||||||
images: sharevb/it-tools
|
images: sharevb/it-tools
|
||||||
labels: |
|
labels: |
|
||||||
@@ -52,29 +52,29 @@ jobs:
|
|||||||
|
|
||||||
# Checkout the repository
|
# Checkout the repository
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v7.0.0
|
||||||
|
|
||||||
- name: Login to Docker Hub
|
- name: Login to Docker Hub
|
||||||
uses: docker/login-action@v4
|
uses: docker/login-action@v4.4.0
|
||||||
with:
|
with:
|
||||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||||
|
|
||||||
- name: Login to GitHub Container Registry
|
- name: Login to GitHub Container Registry
|
||||||
uses: docker/login-action@v4
|
uses: docker/login-action@v4.4.0
|
||||||
with:
|
with:
|
||||||
registry: ghcr.io
|
registry: ghcr.io
|
||||||
username: ${{ github.repository_owner }}
|
username: ${{ github.repository_owner }}
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
- name: Set up QEMU
|
- name: Set up QEMU
|
||||||
uses: docker/setup-qemu-action@v4
|
uses: docker/setup-qemu-action@v4.2.0
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
- 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)
|
- name: Build and push (BASE_URL)
|
||||||
uses: docker/build-push-action@v7
|
uses: docker/build-push-action@v7.3.0
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
file: ./Dockerfile
|
file: ./Dockerfile
|
||||||
|
|||||||
@@ -13,16 +13,16 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v7.0.0
|
||||||
- run: |
|
- run: |
|
||||||
echo "Before: corepack version => $(corepack --version || echo 'not installed')"
|
echo "Before: corepack version => $(corepack --version || echo 'not installed')"
|
||||||
npm install -g corepack@latest
|
npm install -g corepack@latest
|
||||||
echo "After : corepack version => $(corepack --version)"
|
echo "After : corepack version => $(corepack --version)"
|
||||||
corepack enable
|
corepack enable
|
||||||
pnpm --version
|
pnpm --version
|
||||||
- uses: actions/setup-node@v6
|
- uses: actions/setup-node@v6.4.0
|
||||||
with:
|
with:
|
||||||
node-version: 22
|
node-version: 24
|
||||||
cache: 'pnpm'
|
cache: 'pnpm'
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
@@ -47,7 +47,7 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Docker meta
|
- name: Docker meta
|
||||||
id: meta
|
id: meta
|
||||||
uses: docker/metadata-action@v6
|
uses: docker/metadata-action@v6.2.0
|
||||||
with:
|
with:
|
||||||
images: sharevb/it-tools
|
images: sharevb/it-tools
|
||||||
labels: |
|
labels: |
|
||||||
@@ -55,29 +55,29 @@ jobs:
|
|||||||
|
|
||||||
# Checkout the repository
|
# Checkout the repository
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v7.0.0
|
||||||
|
|
||||||
- name: Login to Docker Hub
|
- name: Login to Docker Hub
|
||||||
uses: docker/login-action@v4
|
uses: docker/login-action@v4.4.0
|
||||||
with:
|
with:
|
||||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||||
|
|
||||||
- name: Login to GitHub Container Registry
|
- name: Login to GitHub Container Registry
|
||||||
uses: docker/login-action@v4
|
uses: docker/login-action@v4.4.0
|
||||||
with:
|
with:
|
||||||
registry: ghcr.io
|
registry: ghcr.io
|
||||||
username: ${{ github.repository_owner }}
|
username: ${{ github.repository_owner }}
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
- name: Set up QEMU
|
- name: Set up QEMU
|
||||||
uses: docker/setup-qemu-action@v4
|
uses: docker/setup-qemu-action@v4.2.0
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v4
|
uses: docker/setup-buildx-action@v4.2.0
|
||||||
|
|
||||||
- name: Build and push
|
- name: Build and push
|
||||||
uses: docker/build-push-action@v7
|
uses: docker/build-push-action@v7.3.0
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
file: ./Dockerfile
|
file: ./Dockerfile
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ jobs:
|
|||||||
matrix:
|
matrix:
|
||||||
shard: [1/3, 2/3, 3/3]
|
shard: [1/3, 2/3, 3/3]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v7.0.0
|
||||||
|
|
||||||
- run: |
|
- run: |
|
||||||
echo "Before: corepack version => $(corepack --version || echo 'not installed')"
|
echo "Before: corepack version => $(corepack --version || echo 'not installed')"
|
||||||
@@ -21,9 +21,9 @@ jobs:
|
|||||||
corepack enable
|
corepack enable
|
||||||
pnpm --version
|
pnpm --version
|
||||||
|
|
||||||
- uses: actions/setup-node@v6
|
- uses: actions/setup-node@v6.4.0
|
||||||
with:
|
with:
|
||||||
node-version: 22
|
node-version: 24
|
||||||
cache: 'pnpm'
|
cache: 'pnpm'
|
||||||
|
|
||||||
- name: Get Playwright version
|
- name: Get Playwright version
|
||||||
@@ -37,7 +37,7 @@ jobs:
|
|||||||
run: pnpm build
|
run: pnpm build
|
||||||
|
|
||||||
- name: Restore Playwright browsers from cache
|
- name: Restore Playwright browsers from cache
|
||||||
uses: actions/cache@v5
|
uses: actions/cache@v6.1.0
|
||||||
with:
|
with:
|
||||||
path: ~/.cache/ms-playwright
|
path: ~/.cache/ms-playwright
|
||||||
key: ${{ runner.os }}-playwright-${{ steps.playwright-version.outputs.PLAYWRIGHT_VERSION }}-${{ hashFiles('**/playwright.config.ts') }}
|
key: ${{ runner.os }}-playwright-${{ steps.playwright-version.outputs.PLAYWRIGHT_VERSION }}-${{ hashFiles('**/playwright.config.ts') }}
|
||||||
|
|||||||
@@ -32,18 +32,17 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v7.0.0
|
||||||
|
|
||||||
- name: Install Node.js
|
- name: Install Node.js
|
||||||
uses: actions/setup-node@v6
|
uses: actions/setup-node@v6.4.0
|
||||||
with:
|
with:
|
||||||
node-version: 22
|
node-version: 24
|
||||||
|
|
||||||
- uses: pnpm/action-setup@v2
|
- uses: pnpm/action-setup@v6.0.9
|
||||||
name: Install pnpm
|
name: Install pnpm
|
||||||
id: pnpm-install
|
id: pnpm-install
|
||||||
with:
|
with:
|
||||||
version: 9
|
|
||||||
run_install: true
|
run_install: true
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
@@ -51,13 +50,13 @@ jobs:
|
|||||||
BASE_URL="/it-tools/" pnpm build
|
BASE_URL="/it-tools/" pnpm build
|
||||||
cp dist/index.html dist/404.html
|
cp dist/index.html dist/404.html
|
||||||
- name: Setup Pages
|
- name: Setup Pages
|
||||||
uses: actions/configure-pages@v6
|
uses: actions/configure-pages@v6.0.0
|
||||||
|
|
||||||
- name: Upload artifact
|
- name: Upload artifact
|
||||||
uses: actions/upload-pages-artifact@v5
|
uses: actions/upload-pages-artifact@v5.0.0
|
||||||
with:
|
with:
|
||||||
path: './dist'
|
path: './dist'
|
||||||
|
|
||||||
- name: Deploy to GitHub Pages
|
- name: Deploy to GitHub Pages
|
||||||
id: deployment
|
id: deployment
|
||||||
uses: actions/deploy-pages@v5
|
uses: actions/deploy-pages@v5.0.0
|
||||||
@@ -14,7 +14,7 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Docker meta
|
- name: Docker meta
|
||||||
id: meta
|
id: meta
|
||||||
uses: docker/metadata-action@v6
|
uses: docker/metadata-action@v6.2.0
|
||||||
with:
|
with:
|
||||||
images: sharevb/it-tools
|
images: sharevb/it-tools
|
||||||
|
|
||||||
@@ -22,29 +22,29 @@ jobs:
|
|||||||
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV
|
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV
|
||||||
|
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v7.0.0
|
||||||
|
|
||||||
- name: Login to Docker Hub
|
- name: Login to Docker Hub
|
||||||
uses: docker/login-action@v4
|
uses: docker/login-action@v4.4.0
|
||||||
with:
|
with:
|
||||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||||
|
|
||||||
- name: Login to GitHub Container Registry
|
- name: Login to GitHub Container Registry
|
||||||
uses: docker/login-action@v4
|
uses: docker/login-action@v4.4.0
|
||||||
with:
|
with:
|
||||||
registry: ghcr.io
|
registry: ghcr.io
|
||||||
username: ${{ github.repository_owner }}
|
username: ${{ github.repository_owner }}
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
- name: Set up QEMU
|
- name: Set up QEMU
|
||||||
uses: docker/setup-qemu-action@v4
|
uses: docker/setup-qemu-action@v4.2.0
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
- 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)
|
- name: Build and push (BASE_URL)
|
||||||
uses: docker/build-push-action@v7
|
uses: docker/build-push-action@v7.3.0
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
file: ./Dockerfile
|
file: ./Dockerfile
|
||||||
@@ -62,7 +62,7 @@ jobs:
|
|||||||
ghcr.io/sharevb/it-tools:${{ env.RELEASE_VERSION}}-baseurl-it-tools
|
ghcr.io/sharevb/it-tools:${{ env.RELEASE_VERSION}}-baseurl-it-tools
|
||||||
|
|
||||||
- name: Build and push
|
- name: Build and push
|
||||||
uses: docker/build-push-action@v7
|
uses: docker/build-push-action@v7.3.0
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
file: ./Dockerfile
|
file: ./Dockerfile
|
||||||
@@ -85,7 +85,7 @@ jobs:
|
|||||||
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV
|
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV
|
||||||
|
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v7.0.0
|
||||||
|
|
||||||
- run: |
|
- run: |
|
||||||
echo "Before: corepack version => $(corepack --version || echo 'not installed')"
|
echo "Before: corepack version => $(corepack --version || echo 'not installed')"
|
||||||
@@ -94,9 +94,9 @@ jobs:
|
|||||||
corepack enable
|
corepack enable
|
||||||
pnpm --version
|
pnpm --version
|
||||||
|
|
||||||
- uses: actions/setup-node@v6
|
- uses: actions/setup-node@v6.4.0
|
||||||
with:
|
with:
|
||||||
node-version: 22
|
node-version: 24
|
||||||
cache: 'pnpm'
|
cache: 'pnpm'
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
@@ -117,7 +117,7 @@ jobs:
|
|||||||
echo "$EOF" >> $GITHUB_OUTPUT
|
echo "$EOF" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: Create Release
|
- name: Create Release
|
||||||
uses: softprops/action-gh-release@v3
|
uses: softprops/action-gh-release@v3.0.1
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
files: it-tools-${{ env.RELEASE_VERSION }}.zip
|
files: it-tools-${{ env.RELEASE_VERSION }}.zip
|
||||||
|
|||||||
+3
-1
@@ -47,4 +47,6 @@ components.d.ts
|
|||||||
!*.code-workspace
|
!*.code-workspace
|
||||||
|
|
||||||
# Ignore build or packaged VS Code extensions
|
# Ignore build or packaged VS Code extensions
|
||||||
*.vsix
|
*.vsix
|
||||||
|
*.tsbuildinfo
|
||||||
|
stats.html
|
||||||
@@ -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"
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -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"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
{
|
|
||||||
"singleQuote": true,
|
|
||||||
"semi": true,
|
|
||||||
"tabWidth": 2,
|
|
||||||
"trailingComma": "all",
|
|
||||||
"printWidth": 120
|
|
||||||
}
|
|
||||||
Vendored
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"recommendations": [
|
"recommendations": [
|
||||||
"Vue.volar",
|
"Vue.volar",
|
||||||
"dbaeumer.vscode-eslint",
|
"oxc.oxc-vscode",
|
||||||
"lokalise.i18n-ally",
|
"lokalise.i18n-ally",
|
||||||
"ms-vscode-remote.remote-wsl"
|
"ms-vscode-remote.remote-wsl"
|
||||||
]
|
]
|
||||||
|
|||||||
Vendored
+4
-3
@@ -1,9 +1,10 @@
|
|||||||
{
|
{
|
||||||
"editor.formatOnSave": false,
|
"editor.formatOnSave": true,
|
||||||
|
"editor.defaultFormatter": "oxc.oxc-vscode",
|
||||||
"editor.codeActionsOnSave": {
|
"editor.codeActionsOnSave": {
|
||||||
"source.fixAll.eslint": "always",
|
"source.fixAll.oxc": "always"
|
||||||
"source.formatDocument": "always"
|
|
||||||
},
|
},
|
||||||
|
"oxc.fmt.experimental": true,
|
||||||
"i18n-ally.localesPaths": [
|
"i18n-ally.localesPaths": [
|
||||||
"locales",
|
"locales",
|
||||||
"src/modules/i18n"
|
"src/modules/i18n"
|
||||||
|
|||||||
+4
-3
@@ -1,5 +1,5 @@
|
|||||||
# build stage
|
# 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
|
# Set environment variables for non-interactive npm installs
|
||||||
ENV NPM_CONFIG_LOGLEVEL=warn
|
ENV NPM_CONFIG_LOGLEVEL=warn
|
||||||
ENV CI=true
|
ENV CI=true
|
||||||
@@ -8,9 +8,10 @@ RUN apk add --update python3 make g++\
|
|||||||
&& rm -rf /var/cache/apk/*
|
&& rm -rf /var/cache/apk/*
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY package.json pnpm-lock.yaml ./
|
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./
|
||||||
COPY patches patches
|
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 . .
|
COPY . .
|
||||||
ARG BASE_URL
|
ARG BASE_URL
|
||||||
ENV BASE_URL=${BASE_URL}
|
ENV BASE_URL=${BASE_URL}
|
||||||
|
|||||||
@@ -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)
|
- [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).
|
- [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)
|
- [i18n Ally](https://marketplace.visualstudio.com/items?itemName=lokalise.i18n-ally)
|
||||||
|
|
||||||
with the following settings:
|
with the following settings:
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"editor.formatOnSave": false,
|
"editor.formatOnSave": true,
|
||||||
|
"editor.defaultFormatter": "oxc.oxc-vscode",
|
||||||
"editor.codeActionsOnSave": {
|
"editor.codeActionsOnSave": {
|
||||||
"source.fixAll.eslint": true
|
"source.fixAll.oxc": "always"
|
||||||
},
|
},
|
||||||
"i18n-ally.localesPaths": ["locales", "src/tools/*/locales"],
|
"i18n-ally.localesPaths": ["locales", "src/tools/*/locales"],
|
||||||
"i18n-ally.keystyle": "nested"
|
"i18n-ally.keystyle": "nested"
|
||||||
@@ -320,18 +321,24 @@ pnpm build
|
|||||||
pnpm test
|
pnpm test
|
||||||
```
|
```
|
||||||
|
|
||||||
### Lint with [ESLint](https://eslint.org/)
|
### Lint with [Oxlint](https://oxc.rs/docs/guide/usage/linter)
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
pnpm lint
|
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:
|
Before submitting a PR, run:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
pnpm install --ignore-scripts && pnpm lint --fix && pnpm typecheck
|
pnpm install --ignore-scripts && pnpm lint:fix && pnpm typecheck
|
||||||
```
|
```
|
||||||
|
|
||||||
### Create a new tool
|
### Create a new tool
|
||||||
|
|||||||
Vendored
+302
-572
@@ -1,301 +1,312 @@
|
|||||||
/* eslint-disable */
|
/* eslint-disable */
|
||||||
/* prettier-ignore */
|
/* prettier-ignore */
|
||||||
// @ts-nocheck
|
// @ts-nocheck
|
||||||
|
// noinspection JSUnusedGlobalSymbols
|
||||||
// Generated by unplugin-auto-import
|
// Generated by unplugin-auto-import
|
||||||
|
// biome-ignore lint: disable
|
||||||
export {}
|
export {}
|
||||||
declare global {
|
declare global {
|
||||||
const EffectScope: typeof import('vue')['EffectScope']
|
const EffectScope: typeof import('vue').EffectScope
|
||||||
const asyncComputed: typeof import('@vueuse/core')['asyncComputed']
|
const asyncComputed: typeof import('@vueuse/core').asyncComputed
|
||||||
const autoResetRef: typeof import('@vueuse/core')['autoResetRef']
|
const autoResetRef: typeof import('@vueuse/core').autoResetRef
|
||||||
const computed: typeof import('vue')['computed']
|
const computed: typeof import('vue').computed
|
||||||
const computedAsync: typeof import('@vueuse/core')['computedAsync']
|
const computedAsync: typeof import('@vueuse/core').computedAsync
|
||||||
const computedEager: typeof import('@vueuse/core')['computedEager']
|
const computedEager: typeof import('@vueuse/core').computedEager
|
||||||
const computedInject: typeof import('@vueuse/core')['computedInject']
|
const computedInject: typeof import('@vueuse/core').computedInject
|
||||||
const computedWithControl: typeof import('@vueuse/core')['computedWithControl']
|
const computedWithControl: typeof import('@vueuse/core').computedWithControl
|
||||||
const controlledComputed: typeof import('@vueuse/core')['controlledComputed']
|
const controlledComputed: typeof import('@vueuse/core').controlledComputed
|
||||||
const controlledRef: typeof import('@vueuse/core')['controlledRef']
|
const controlledRef: typeof import('@vueuse/core').controlledRef
|
||||||
const createApp: typeof import('vue')['createApp']
|
const createApp: typeof import('vue').createApp
|
||||||
const createEventHook: typeof import('@vueuse/core')['createEventHook']
|
const createEventHook: typeof import('@vueuse/core').createEventHook
|
||||||
const createGlobalState: typeof import('@vueuse/core')['createGlobalState']
|
const createGlobalState: typeof import('@vueuse/core').createGlobalState
|
||||||
const createInjectionState: typeof import('@vueuse/core')['createInjectionState']
|
const createInjectionState: typeof import('@vueuse/core').createInjectionState
|
||||||
const createReactiveFn: typeof import('@vueuse/core')['createReactiveFn']
|
const createReactiveFn: typeof import('@vueuse/core').createReactiveFn
|
||||||
const createReusableTemplate: typeof import('@vueuse/core')['createReusableTemplate']
|
const createReusableTemplate: typeof import('@vueuse/core').createReusableTemplate
|
||||||
const createSharedComposable: typeof import('@vueuse/core')['createSharedComposable']
|
const createSharedComposable: typeof import('@vueuse/core').createSharedComposable
|
||||||
const createTemplatePromise: typeof import('@vueuse/core')['createTemplatePromise']
|
const createTemplatePromise: typeof import('@vueuse/core').createTemplatePromise
|
||||||
const createUnrefFn: typeof import('@vueuse/core')['createUnrefFn']
|
const createUnrefFn: typeof import('@vueuse/core').createUnrefFn
|
||||||
const customRef: typeof import('vue')['customRef']
|
const customRef: typeof import('vue').customRef
|
||||||
const debouncedRef: typeof import('@vueuse/core')['debouncedRef']
|
const debouncedRef: typeof import('@vueuse/core').debouncedRef
|
||||||
const debouncedWatch: typeof import('@vueuse/core')['debouncedWatch']
|
const debouncedWatch: typeof import('@vueuse/core').debouncedWatch
|
||||||
const defineAsyncComponent: typeof import('vue')['defineAsyncComponent']
|
const defineAsyncComponent: typeof import('vue').defineAsyncComponent
|
||||||
const defineComponent: typeof import('vue')['defineComponent']
|
const defineComponent: typeof import('vue').defineComponent
|
||||||
const eagerComputed: typeof import('@vueuse/core')['eagerComputed']
|
const eagerComputed: typeof import('@vueuse/core').eagerComputed
|
||||||
const effectScope: typeof import('vue')['effectScope']
|
const effectScope: typeof import('vue').effectScope
|
||||||
const extendRef: typeof import('@vueuse/core')['extendRef']
|
const extendRef: typeof import('@vueuse/core').extendRef
|
||||||
const getCurrentInstance: typeof import('vue')['getCurrentInstance']
|
const getCurrentInstance: typeof import('vue').getCurrentInstance
|
||||||
const getCurrentScope: typeof import('vue')['getCurrentScope']
|
const getCurrentScope: typeof import('vue').getCurrentScope
|
||||||
const h: typeof import('vue')['h']
|
const getCurrentWatcher: typeof import('vue').getCurrentWatcher
|
||||||
const ignorableWatch: typeof import('@vueuse/core')['ignorableWatch']
|
const h: typeof import('vue').h
|
||||||
const inject: typeof import('vue')['inject']
|
const ignorableWatch: typeof import('@vueuse/core').ignorableWatch
|
||||||
const injectLocal: typeof import('@vueuse/core')['injectLocal']
|
const inject: typeof import('vue').inject
|
||||||
const isDefined: typeof import('@vueuse/core')['isDefined']
|
const injectLocal: typeof import('@vueuse/core').injectLocal
|
||||||
const isProxy: typeof import('vue')['isProxy']
|
const isDefined: typeof import('@vueuse/core').isDefined
|
||||||
const isReactive: typeof import('vue')['isReactive']
|
const isProxy: typeof import('vue').isProxy
|
||||||
const isReadonly: typeof import('vue')['isReadonly']
|
const isReactive: typeof import('vue').isReactive
|
||||||
const isRef: typeof import('vue')['isRef']
|
const isReadonly: typeof import('vue').isReadonly
|
||||||
const makeDestructurable: typeof import('@vueuse/core')['makeDestructurable']
|
const isRef: typeof import('vue').isRef
|
||||||
const markRaw: typeof import('vue')['markRaw']
|
const isShallow: typeof import('vue').isShallow
|
||||||
const nextTick: typeof import('vue')['nextTick']
|
const makeDestructurable: typeof import('@vueuse/core').makeDestructurable
|
||||||
const onActivated: typeof import('vue')['onActivated']
|
const markRaw: typeof import('vue').markRaw
|
||||||
const onBeforeMount: typeof import('vue')['onBeforeMount']
|
const nextTick: typeof import('vue').nextTick
|
||||||
const onBeforeRouteLeave: typeof import('vue-router')['onBeforeRouteLeave']
|
const onActivated: typeof import('vue').onActivated
|
||||||
const onBeforeRouteUpdate: typeof import('vue-router')['onBeforeRouteUpdate']
|
const onBeforeMount: typeof import('vue').onBeforeMount
|
||||||
const onBeforeUnmount: typeof import('vue')['onBeforeUnmount']
|
const onBeforeRouteLeave: typeof import('vue-router').onBeforeRouteLeave
|
||||||
const onBeforeUpdate: typeof import('vue')['onBeforeUpdate']
|
const onBeforeRouteUpdate: typeof import('vue-router').onBeforeRouteUpdate
|
||||||
const onClickOutside: typeof import('@vueuse/core')['onClickOutside']
|
const onBeforeUnmount: typeof import('vue').onBeforeUnmount
|
||||||
const onDeactivated: typeof import('vue')['onDeactivated']
|
const onBeforeUpdate: typeof import('vue').onBeforeUpdate
|
||||||
const onErrorCaptured: typeof import('vue')['onErrorCaptured']
|
const onClickOutside: typeof import('@vueuse/core').onClickOutside
|
||||||
const onKeyStroke: typeof import('@vueuse/core')['onKeyStroke']
|
const onDeactivated: typeof import('vue').onDeactivated
|
||||||
const onLongPress: typeof import('@vueuse/core')['onLongPress']
|
const onErrorCaptured: typeof import('vue').onErrorCaptured
|
||||||
const onMounted: typeof import('vue')['onMounted']
|
const onKeyStroke: typeof import('@vueuse/core').onKeyStroke
|
||||||
const onRenderTracked: typeof import('vue')['onRenderTracked']
|
const onLongPress: typeof import('@vueuse/core').onLongPress
|
||||||
const onRenderTriggered: typeof import('vue')['onRenderTriggered']
|
const onMounted: typeof import('vue').onMounted
|
||||||
const onScopeDispose: typeof import('vue')['onScopeDispose']
|
const onRenderTracked: typeof import('vue').onRenderTracked
|
||||||
const onServerPrefetch: typeof import('vue')['onServerPrefetch']
|
const onRenderTriggered: typeof import('vue').onRenderTriggered
|
||||||
const onStartTyping: typeof import('@vueuse/core')['onStartTyping']
|
const onScopeDispose: typeof import('vue').onScopeDispose
|
||||||
const onUnmounted: typeof import('vue')['onUnmounted']
|
const onServerPrefetch: typeof import('vue').onServerPrefetch
|
||||||
const onUpdated: typeof import('vue')['onUpdated']
|
const onStartTyping: typeof import('@vueuse/core').onStartTyping
|
||||||
const pausableWatch: typeof import('@vueuse/core')['pausableWatch']
|
const onUnmounted: typeof import('vue').onUnmounted
|
||||||
const provide: typeof import('vue')['provide']
|
const onUpdated: typeof import('vue').onUpdated
|
||||||
const provideLocal: typeof import('@vueuse/core')['provideLocal']
|
const onWatcherCleanup: typeof import('vue').onWatcherCleanup
|
||||||
const reactify: typeof import('@vueuse/core')['reactify']
|
const pausableWatch: typeof import('@vueuse/core').pausableWatch
|
||||||
const reactifyObject: typeof import('@vueuse/core')['reactifyObject']
|
const provide: typeof import('vue').provide
|
||||||
const reactive: typeof import('vue')['reactive']
|
const provideLocal: typeof import('@vueuse/core').provideLocal
|
||||||
const reactiveComputed: typeof import('@vueuse/core')['reactiveComputed']
|
const reactify: typeof import('@vueuse/core').reactify
|
||||||
const reactiveOmit: typeof import('@vueuse/core')['reactiveOmit']
|
const reactifyObject: typeof import('@vueuse/core').reactifyObject
|
||||||
const reactivePick: typeof import('@vueuse/core')['reactivePick']
|
const reactive: typeof import('vue').reactive
|
||||||
const readonly: typeof import('vue')['readonly']
|
const reactiveComputed: typeof import('@vueuse/core').reactiveComputed
|
||||||
const ref: typeof import('vue')['ref']
|
const reactiveOmit: typeof import('@vueuse/core').reactiveOmit
|
||||||
const refAutoReset: typeof import('@vueuse/core')['refAutoReset']
|
const reactivePick: typeof import('@vueuse/core').reactivePick
|
||||||
const refDebounced: typeof import('@vueuse/core')['refDebounced']
|
const readonly: typeof import('vue').readonly
|
||||||
const refDefault: typeof import('@vueuse/core')['refDefault']
|
const ref: typeof import('vue').ref
|
||||||
const refThrottled: typeof import('@vueuse/core')['refThrottled']
|
const refAutoReset: typeof import('@vueuse/core').refAutoReset
|
||||||
const refWithControl: typeof import('@vueuse/core')['refWithControl']
|
const refDebounced: typeof import('@vueuse/core').refDebounced
|
||||||
const resolveComponent: typeof import('vue')['resolveComponent']
|
const refDefault: typeof import('@vueuse/core').refDefault
|
||||||
const resolveRef: typeof import('@vueuse/core')['resolveRef']
|
const refThrottled: typeof import('@vueuse/core').refThrottled
|
||||||
const resolveUnref: typeof import('@vueuse/core')['resolveUnref']
|
const refWithControl: typeof import('@vueuse/core').refWithControl
|
||||||
const shallowReactive: typeof import('vue')['shallowReactive']
|
const resolveComponent: typeof import('vue').resolveComponent
|
||||||
const shallowReadonly: typeof import('vue')['shallowReadonly']
|
const resolveRef: typeof import('@vueuse/core').resolveRef
|
||||||
const shallowRef: typeof import('vue')['shallowRef']
|
const resolveUnref: typeof import('@vueuse/core').resolveUnref
|
||||||
const syncRef: typeof import('@vueuse/core')['syncRef']
|
const shallowReactive: typeof import('vue').shallowReactive
|
||||||
const syncRefs: typeof import('@vueuse/core')['syncRefs']
|
const shallowReadonly: typeof import('vue').shallowReadonly
|
||||||
const templateRef: typeof import('@vueuse/core')['templateRef']
|
const shallowRef: typeof import('vue').shallowRef
|
||||||
const throttledRef: typeof import('@vueuse/core')['throttledRef']
|
const syncRef: typeof import('@vueuse/core').syncRef
|
||||||
const throttledWatch: typeof import('@vueuse/core')['throttledWatch']
|
const syncRefs: typeof import('@vueuse/core').syncRefs
|
||||||
const toRaw: typeof import('vue')['toRaw']
|
const templateRef: typeof import('@vueuse/core').templateRef
|
||||||
const toReactive: typeof import('@vueuse/core')['toReactive']
|
const throttledRef: typeof import('@vueuse/core').throttledRef
|
||||||
const toRef: typeof import('vue')['toRef']
|
const throttledWatch: typeof import('@vueuse/core').throttledWatch
|
||||||
const toRefs: typeof import('vue')['toRefs']
|
const toRaw: typeof import('vue').toRaw
|
||||||
const toValue: typeof import('vue')['toValue']
|
const toReactive: typeof import('@vueuse/core').toReactive
|
||||||
const triggerRef: typeof import('vue')['triggerRef']
|
const toRef: typeof import('vue').toRef
|
||||||
const tryOnBeforeMount: typeof import('@vueuse/core')['tryOnBeforeMount']
|
const toRefs: typeof import('vue').toRefs
|
||||||
const tryOnBeforeUnmount: typeof import('@vueuse/core')['tryOnBeforeUnmount']
|
const toValue: typeof import('vue').toValue
|
||||||
const tryOnMounted: typeof import('@vueuse/core')['tryOnMounted']
|
const triggerRef: typeof import('vue').triggerRef
|
||||||
const tryOnScopeDispose: typeof import('@vueuse/core')['tryOnScopeDispose']
|
const tryOnBeforeMount: typeof import('@vueuse/core').tryOnBeforeMount
|
||||||
const tryOnUnmounted: typeof import('@vueuse/core')['tryOnUnmounted']
|
const tryOnBeforeUnmount: typeof import('@vueuse/core').tryOnBeforeUnmount
|
||||||
const unref: typeof import('vue')['unref']
|
const tryOnMounted: typeof import('@vueuse/core').tryOnMounted
|
||||||
const unrefElement: typeof import('@vueuse/core')['unrefElement']
|
const tryOnScopeDispose: typeof import('@vueuse/core').tryOnScopeDispose
|
||||||
const until: typeof import('@vueuse/core')['until']
|
const tryOnUnmounted: typeof import('@vueuse/core').tryOnUnmounted
|
||||||
const useActiveElement: typeof import('@vueuse/core')['useActiveElement']
|
const unref: typeof import('vue').unref
|
||||||
const useAnimate: typeof import('@vueuse/core')['useAnimate']
|
const unrefElement: typeof import('@vueuse/core').unrefElement
|
||||||
const useArrayDifference: typeof import('@vueuse/core')['useArrayDifference']
|
const until: typeof import('@vueuse/core').until
|
||||||
const useArrayEvery: typeof import('@vueuse/core')['useArrayEvery']
|
const useActiveElement: typeof import('@vueuse/core').useActiveElement
|
||||||
const useArrayFilter: typeof import('@vueuse/core')['useArrayFilter']
|
const useAnimate: typeof import('@vueuse/core').useAnimate
|
||||||
const useArrayFind: typeof import('@vueuse/core')['useArrayFind']
|
const useArrayDifference: typeof import('@vueuse/core').useArrayDifference
|
||||||
const useArrayFindIndex: typeof import('@vueuse/core')['useArrayFindIndex']
|
const useArrayEvery: typeof import('@vueuse/core').useArrayEvery
|
||||||
const useArrayFindLast: typeof import('@vueuse/core')['useArrayFindLast']
|
const useArrayFilter: typeof import('@vueuse/core').useArrayFilter
|
||||||
const useArrayIncludes: typeof import('@vueuse/core')['useArrayIncludes']
|
const useArrayFind: typeof import('@vueuse/core').useArrayFind
|
||||||
const useArrayJoin: typeof import('@vueuse/core')['useArrayJoin']
|
const useArrayFindIndex: typeof import('@vueuse/core').useArrayFindIndex
|
||||||
const useArrayMap: typeof import('@vueuse/core')['useArrayMap']
|
const useArrayFindLast: typeof import('@vueuse/core').useArrayFindLast
|
||||||
const useArrayReduce: typeof import('@vueuse/core')['useArrayReduce']
|
const useArrayIncludes: typeof import('@vueuse/core').useArrayIncludes
|
||||||
const useArraySome: typeof import('@vueuse/core')['useArraySome']
|
const useArrayJoin: typeof import('@vueuse/core').useArrayJoin
|
||||||
const useArrayUnique: typeof import('@vueuse/core')['useArrayUnique']
|
const useArrayMap: typeof import('@vueuse/core').useArrayMap
|
||||||
const useAsyncQueue: typeof import('@vueuse/core')['useAsyncQueue']
|
const useArrayReduce: typeof import('@vueuse/core').useArrayReduce
|
||||||
const useAsyncState: typeof import('@vueuse/core')['useAsyncState']
|
const useArraySome: typeof import('@vueuse/core').useArraySome
|
||||||
const useAttrs: typeof import('vue')['useAttrs']
|
const useArrayUnique: typeof import('@vueuse/core').useArrayUnique
|
||||||
const useBase64: typeof import('@vueuse/core')['useBase64']
|
const useAsyncQueue: typeof import('@vueuse/core').useAsyncQueue
|
||||||
const useBattery: typeof import('@vueuse/core')['useBattery']
|
const useAsyncState: typeof import('@vueuse/core').useAsyncState
|
||||||
const useBluetooth: typeof import('@vueuse/core')['useBluetooth']
|
const useAttrs: typeof import('vue').useAttrs
|
||||||
const useBreakpoints: typeof import('@vueuse/core')['useBreakpoints']
|
const useBase64: typeof import('@vueuse/core').useBase64
|
||||||
const useBroadcastChannel: typeof import('@vueuse/core')['useBroadcastChannel']
|
const useBattery: typeof import('@vueuse/core').useBattery
|
||||||
const useBrowserLocation: typeof import('@vueuse/core')['useBrowserLocation']
|
const useBluetooth: typeof import('@vueuse/core').useBluetooth
|
||||||
const useCached: typeof import('@vueuse/core')['useCached']
|
const useBreakpoints: typeof import('@vueuse/core').useBreakpoints
|
||||||
const useClipboard: typeof import('@vueuse/core')['useClipboard']
|
const useBroadcastChannel: typeof import('@vueuse/core').useBroadcastChannel
|
||||||
const useClipboardItems: typeof import('@vueuse/core')['useClipboardItems']
|
const useBrowserLocation: typeof import('@vueuse/core').useBrowserLocation
|
||||||
const useCloned: typeof import('@vueuse/core')['useCloned']
|
const useCached: typeof import('@vueuse/core').useCached
|
||||||
const useColorMode: typeof import('@vueuse/core')['useColorMode']
|
const useClipboard: typeof import('@vueuse/core').useClipboard
|
||||||
const useConfirmDialog: typeof import('@vueuse/core')['useConfirmDialog']
|
const useClipboardItems: typeof import('@vueuse/core').useClipboardItems
|
||||||
const useCounter: typeof import('@vueuse/core')['useCounter']
|
const useCloned: typeof import('@vueuse/core').useCloned
|
||||||
const useCssModule: typeof import('vue')['useCssModule']
|
const useColorMode: typeof import('@vueuse/core').useColorMode
|
||||||
const useCssVar: typeof import('@vueuse/core')['useCssVar']
|
const useConfirmDialog: typeof import('@vueuse/core').useConfirmDialog
|
||||||
const useCssVars: typeof import('vue')['useCssVars']
|
const useCounter: typeof import('@vueuse/core').useCounter
|
||||||
const useCurrentElement: typeof import('@vueuse/core')['useCurrentElement']
|
const useCssModule: typeof import('vue').useCssModule
|
||||||
const useCycleList: typeof import('@vueuse/core')['useCycleList']
|
const useCssVar: typeof import('@vueuse/core').useCssVar
|
||||||
const useDark: typeof import('@vueuse/core')['useDark']
|
const useCssVars: typeof import('vue').useCssVars
|
||||||
const useDateFormat: typeof import('@vueuse/core')['useDateFormat']
|
const useCurrentElement: typeof import('@vueuse/core').useCurrentElement
|
||||||
const useDebounce: typeof import('@vueuse/core')['useDebounce']
|
const useCycleList: typeof import('@vueuse/core').useCycleList
|
||||||
const useDebounceFn: typeof import('@vueuse/core')['useDebounceFn']
|
const useDark: typeof import('@vueuse/core').useDark
|
||||||
const useDebouncedRefHistory: typeof import('@vueuse/core')['useDebouncedRefHistory']
|
const useDateFormat: typeof import('@vueuse/core').useDateFormat
|
||||||
const useDeviceMotion: typeof import('@vueuse/core')['useDeviceMotion']
|
const useDebounce: typeof import('@vueuse/core').useDebounce
|
||||||
const useDeviceOrientation: typeof import('@vueuse/core')['useDeviceOrientation']
|
const useDebounceFn: typeof import('@vueuse/core').useDebounceFn
|
||||||
const useDevicePixelRatio: typeof import('@vueuse/core')['useDevicePixelRatio']
|
const useDebouncedRefHistory: typeof import('@vueuse/core').useDebouncedRefHistory
|
||||||
const useDevicesList: typeof import('@vueuse/core')['useDevicesList']
|
const useDeviceMotion: typeof import('@vueuse/core').useDeviceMotion
|
||||||
const useDialog: typeof import('naive-ui')['useDialog']
|
const useDeviceOrientation: typeof import('@vueuse/core').useDeviceOrientation
|
||||||
const useDisplayMedia: typeof import('@vueuse/core')['useDisplayMedia']
|
const useDevicePixelRatio: typeof import('@vueuse/core').useDevicePixelRatio
|
||||||
const useDocumentVisibility: typeof import('@vueuse/core')['useDocumentVisibility']
|
const useDevicesList: typeof import('@vueuse/core').useDevicesList
|
||||||
const useDraggable: typeof import('@vueuse/core')['useDraggable']
|
const useDialog: typeof import('naive-ui').useDialog
|
||||||
const useDropZone: typeof import('@vueuse/core')['useDropZone']
|
const useDisplayMedia: typeof import('@vueuse/core').useDisplayMedia
|
||||||
const useElementBounding: typeof import('@vueuse/core')['useElementBounding']
|
const useDocumentVisibility: typeof import('@vueuse/core').useDocumentVisibility
|
||||||
const useElementByPoint: typeof import('@vueuse/core')['useElementByPoint']
|
const useDraggable: typeof import('@vueuse/core').useDraggable
|
||||||
const useElementHover: typeof import('@vueuse/core')['useElementHover']
|
const useDropZone: typeof import('@vueuse/core').useDropZone
|
||||||
const useElementSize: typeof import('@vueuse/core')['useElementSize']
|
const useElementBounding: typeof import('@vueuse/core').useElementBounding
|
||||||
const useElementVisibility: typeof import('@vueuse/core')['useElementVisibility']
|
const useElementByPoint: typeof import('@vueuse/core').useElementByPoint
|
||||||
const useEventBus: typeof import('@vueuse/core')['useEventBus']
|
const useElementHover: typeof import('@vueuse/core').useElementHover
|
||||||
const useEventListener: typeof import('@vueuse/core')['useEventListener']
|
const useElementSize: typeof import('@vueuse/core').useElementSize
|
||||||
const useEventSource: typeof import('@vueuse/core')['useEventSource']
|
const useElementVisibility: typeof import('@vueuse/core').useElementVisibility
|
||||||
const useEyeDropper: typeof import('@vueuse/core')['useEyeDropper']
|
const useEventBus: typeof import('@vueuse/core').useEventBus
|
||||||
const useFavicon: typeof import('@vueuse/core')['useFavicon']
|
const useEventListener: typeof import('@vueuse/core').useEventListener
|
||||||
const useFetch: typeof import('@vueuse/core')['useFetch']
|
const useEventSource: typeof import('@vueuse/core').useEventSource
|
||||||
const useFileDialog: typeof import('@vueuse/core')['useFileDialog']
|
const useEyeDropper: typeof import('@vueuse/core').useEyeDropper
|
||||||
const useFileSystemAccess: typeof import('@vueuse/core')['useFileSystemAccess']
|
const useFavicon: typeof import('@vueuse/core').useFavicon
|
||||||
const useFocus: typeof import('@vueuse/core')['useFocus']
|
const useFetch: typeof import('@vueuse/core').useFetch
|
||||||
const useFocusWithin: typeof import('@vueuse/core')['useFocusWithin']
|
const useFileDialog: typeof import('@vueuse/core').useFileDialog
|
||||||
const useFps: typeof import('@vueuse/core')['useFps']
|
const useFileSystemAccess: typeof import('@vueuse/core').useFileSystemAccess
|
||||||
const useFullscreen: typeof import('@vueuse/core')['useFullscreen']
|
const useFocus: typeof import('@vueuse/core').useFocus
|
||||||
const useGamepad: typeof import('@vueuse/core')['useGamepad']
|
const useFocusWithin: typeof import('@vueuse/core').useFocusWithin
|
||||||
const useGeolocation: typeof import('@vueuse/core')['useGeolocation']
|
const useFps: typeof import('@vueuse/core').useFps
|
||||||
const useI18n: typeof import('vue-i18n')['useI18n']
|
const useFullscreen: typeof import('@vueuse/core').useFullscreen
|
||||||
const useIdle: typeof import('@vueuse/core')['useIdle']
|
const useGamepad: typeof import('@vueuse/core').useGamepad
|
||||||
const useImage: typeof import('@vueuse/core')['useImage']
|
const useGeolocation: typeof import('@vueuse/core').useGeolocation
|
||||||
const useInfiniteScroll: typeof import('@vueuse/core')['useInfiniteScroll']
|
const useI18n: typeof import('vue-i18n').useI18n
|
||||||
const useIntersectionObserver: typeof import('@vueuse/core')['useIntersectionObserver']
|
const useId: typeof import('vue').useId
|
||||||
const useInterval: typeof import('@vueuse/core')['useInterval']
|
const useIdle: typeof import('@vueuse/core').useIdle
|
||||||
const useIntervalFn: typeof import('@vueuse/core')['useIntervalFn']
|
const useImage: typeof import('@vueuse/core').useImage
|
||||||
const useKeyModifier: typeof import('@vueuse/core')['useKeyModifier']
|
const useInfiniteScroll: typeof import('@vueuse/core').useInfiniteScroll
|
||||||
const useLastChanged: typeof import('@vueuse/core')['useLastChanged']
|
const useIntersectionObserver: typeof import('@vueuse/core').useIntersectionObserver
|
||||||
const useLink: typeof import('vue-router')['useLink']
|
const useInterval: typeof import('@vueuse/core').useInterval
|
||||||
const useLoadingBar: typeof import('naive-ui')['useLoadingBar']
|
const useIntervalFn: typeof import('@vueuse/core').useIntervalFn
|
||||||
const useLocalStorage: typeof import('@vueuse/core')['useLocalStorage']
|
const useKeyModifier: typeof import('@vueuse/core').useKeyModifier
|
||||||
const useMagicKeys: typeof import('@vueuse/core')['useMagicKeys']
|
const useLastChanged: typeof import('@vueuse/core').useLastChanged
|
||||||
const useManualRefHistory: typeof import('@vueuse/core')['useManualRefHistory']
|
const useLink: typeof import('vue-router').useLink
|
||||||
const useMediaControls: typeof import('@vueuse/core')['useMediaControls']
|
const useLoadingBar: typeof import('naive-ui').useLoadingBar
|
||||||
const useMediaQuery: typeof import('@vueuse/core')['useMediaQuery']
|
const useLocalStorage: typeof import('@vueuse/core').useLocalStorage
|
||||||
const useMemoize: typeof import('@vueuse/core')['useMemoize']
|
const useMagicKeys: typeof import('@vueuse/core').useMagicKeys
|
||||||
const useMemory: typeof import('@vueuse/core')['useMemory']
|
const useManualRefHistory: typeof import('@vueuse/core').useManualRefHistory
|
||||||
const useMessage: typeof import('naive-ui')['useMessage']
|
const useMediaControls: typeof import('@vueuse/core').useMediaControls
|
||||||
const useMounted: typeof import('@vueuse/core')['useMounted']
|
const useMediaQuery: typeof import('@vueuse/core').useMediaQuery
|
||||||
const useMouse: typeof import('@vueuse/core')['useMouse']
|
const useMemoize: typeof import('@vueuse/core').useMemoize
|
||||||
const useMouseInElement: typeof import('@vueuse/core')['useMouseInElement']
|
const useMemory: typeof import('@vueuse/core').useMemory
|
||||||
const useMousePressed: typeof import('@vueuse/core')['useMousePressed']
|
const useMessage: typeof import('naive-ui').useMessage
|
||||||
const useMutationObserver: typeof import('@vueuse/core')['useMutationObserver']
|
const useModel: typeof import('vue').useModel
|
||||||
const useNavigatorLanguage: typeof import('@vueuse/core')['useNavigatorLanguage']
|
const useMounted: typeof import('@vueuse/core').useMounted
|
||||||
const useNetwork: typeof import('@vueuse/core')['useNetwork']
|
const useMouse: typeof import('@vueuse/core').useMouse
|
||||||
const useNotification: typeof import('naive-ui')['useNotification']
|
const useMouseInElement: typeof import('@vueuse/core').useMouseInElement
|
||||||
const useNow: typeof import('@vueuse/core')['useNow']
|
const useMousePressed: typeof import('@vueuse/core').useMousePressed
|
||||||
const useObjectUrl: typeof import('@vueuse/core')['useObjectUrl']
|
const useMutationObserver: typeof import('@vueuse/core').useMutationObserver
|
||||||
const useOffsetPagination: typeof import('@vueuse/core')['useOffsetPagination']
|
const useNavigatorLanguage: typeof import('@vueuse/core').useNavigatorLanguage
|
||||||
const useOnline: typeof import('@vueuse/core')['useOnline']
|
const useNetwork: typeof import('@vueuse/core').useNetwork
|
||||||
const usePageLeave: typeof import('@vueuse/core')['usePageLeave']
|
const useNotification: typeof import('naive-ui').useNotification
|
||||||
const useParallax: typeof import('@vueuse/core')['useParallax']
|
const useNow: typeof import('@vueuse/core').useNow
|
||||||
const useParentElement: typeof import('@vueuse/core')['useParentElement']
|
const useObjectUrl: typeof import('@vueuse/core').useObjectUrl
|
||||||
const usePerformanceObserver: typeof import('@vueuse/core')['usePerformanceObserver']
|
const useOffsetPagination: typeof import('@vueuse/core').useOffsetPagination
|
||||||
const usePermission: typeof import('@vueuse/core')['usePermission']
|
const useOnline: typeof import('@vueuse/core').useOnline
|
||||||
const usePointer: typeof import('@vueuse/core')['usePointer']
|
const usePageLeave: typeof import('@vueuse/core').usePageLeave
|
||||||
const usePointerLock: typeof import('@vueuse/core')['usePointerLock']
|
const useParallax: typeof import('@vueuse/core').useParallax
|
||||||
const usePointerSwipe: typeof import('@vueuse/core')['usePointerSwipe']
|
const useParentElement: typeof import('@vueuse/core').useParentElement
|
||||||
const usePreferredColorScheme: typeof import('@vueuse/core')['usePreferredColorScheme']
|
const usePerformanceObserver: typeof import('@vueuse/core').usePerformanceObserver
|
||||||
const usePreferredContrast: typeof import('@vueuse/core')['usePreferredContrast']
|
const usePermission: typeof import('@vueuse/core').usePermission
|
||||||
const usePreferredDark: typeof import('@vueuse/core')['usePreferredDark']
|
const usePointer: typeof import('@vueuse/core').usePointer
|
||||||
const usePreferredLanguages: typeof import('@vueuse/core')['usePreferredLanguages']
|
const usePointerLock: typeof import('@vueuse/core').usePointerLock
|
||||||
const usePreferredReducedMotion: typeof import('@vueuse/core')['usePreferredReducedMotion']
|
const usePointerSwipe: typeof import('@vueuse/core').usePointerSwipe
|
||||||
const usePrevious: typeof import('@vueuse/core')['usePrevious']
|
const usePreferredColorScheme: typeof import('@vueuse/core').usePreferredColorScheme
|
||||||
const useRafFn: typeof import('@vueuse/core')['useRafFn']
|
const usePreferredContrast: typeof import('@vueuse/core').usePreferredContrast
|
||||||
const useRefHistory: typeof import('@vueuse/core')['useRefHistory']
|
const usePreferredDark: typeof import('@vueuse/core').usePreferredDark
|
||||||
const useResizeObserver: typeof import('@vueuse/core')['useResizeObserver']
|
const usePreferredLanguages: typeof import('@vueuse/core').usePreferredLanguages
|
||||||
const useRoute: typeof import('vue-router')['useRoute']
|
const usePreferredReducedMotion: typeof import('@vueuse/core').usePreferredReducedMotion
|
||||||
const useRouter: typeof import('vue-router')['useRouter']
|
const usePrevious: typeof import('@vueuse/core').usePrevious
|
||||||
const useScreenOrientation: typeof import('@vueuse/core')['useScreenOrientation']
|
const useRafFn: typeof import('@vueuse/core').useRafFn
|
||||||
const useScreenSafeArea: typeof import('@vueuse/core')['useScreenSafeArea']
|
const useRefHistory: typeof import('@vueuse/core').useRefHistory
|
||||||
const useScriptTag: typeof import('@vueuse/core')['useScriptTag']
|
const useResizeObserver: typeof import('@vueuse/core').useResizeObserver
|
||||||
const useScroll: typeof import('@vueuse/core')['useScroll']
|
const useRoute: typeof import('vue-router').useRoute
|
||||||
const useScrollLock: typeof import('@vueuse/core')['useScrollLock']
|
const useRouter: typeof import('vue-router').useRouter
|
||||||
const useSessionStorage: typeof import('@vueuse/core')['useSessionStorage']
|
const useScreenOrientation: typeof import('@vueuse/core').useScreenOrientation
|
||||||
const useShare: typeof import('@vueuse/core')['useShare']
|
const useScreenSafeArea: typeof import('@vueuse/core').useScreenSafeArea
|
||||||
const useSlots: typeof import('vue')['useSlots']
|
const useScriptTag: typeof import('@vueuse/core').useScriptTag
|
||||||
const useSorted: typeof import('@vueuse/core')['useSorted']
|
const useScroll: typeof import('@vueuse/core').useScroll
|
||||||
const useSpeechRecognition: typeof import('@vueuse/core')['useSpeechRecognition']
|
const useScrollLock: typeof import('@vueuse/core').useScrollLock
|
||||||
const useSpeechSynthesis: typeof import('@vueuse/core')['useSpeechSynthesis']
|
const useSessionStorage: typeof import('@vueuse/core').useSessionStorage
|
||||||
const useStepper: typeof import('@vueuse/core')['useStepper']
|
const useShare: typeof import('@vueuse/core').useShare
|
||||||
const useStorage: typeof import('@vueuse/core')['useStorage']
|
const useSlots: typeof import('vue').useSlots
|
||||||
const useStorageAsync: typeof import('@vueuse/core')['useStorageAsync']
|
const useSorted: typeof import('@vueuse/core').useSorted
|
||||||
const useStyleTag: typeof import('@vueuse/core')['useStyleTag']
|
const useSpeechRecognition: typeof import('@vueuse/core').useSpeechRecognition
|
||||||
const useSupported: typeof import('@vueuse/core')['useSupported']
|
const useSpeechSynthesis: typeof import('@vueuse/core').useSpeechSynthesis
|
||||||
const useSwipe: typeof import('@vueuse/core')['useSwipe']
|
const useStepper: typeof import('@vueuse/core').useStepper
|
||||||
const useTemplateRefsList: typeof import('@vueuse/core')['useTemplateRefsList']
|
const useStorage: typeof import('@vueuse/core').useStorage
|
||||||
const useTextDirection: typeof import('@vueuse/core')['useTextDirection']
|
const useStorageAsync: typeof import('@vueuse/core').useStorageAsync
|
||||||
const useTextSelection: typeof import('@vueuse/core')['useTextSelection']
|
const useStyleTag: typeof import('@vueuse/core').useStyleTag
|
||||||
const useTextareaAutosize: typeof import('@vueuse/core')['useTextareaAutosize']
|
const useSupported: typeof import('@vueuse/core').useSupported
|
||||||
const useThrottle: typeof import('@vueuse/core')['useThrottle']
|
const useSwipe: typeof import('@vueuse/core').useSwipe
|
||||||
const useThrottleFn: typeof import('@vueuse/core')['useThrottleFn']
|
const useTemplateRef: typeof import('vue').useTemplateRef
|
||||||
const useThrottledRefHistory: typeof import('@vueuse/core')['useThrottledRefHistory']
|
const useTemplateRefsList: typeof import('@vueuse/core').useTemplateRefsList
|
||||||
const useTimeAgo: typeof import('@vueuse/core')['useTimeAgo']
|
const useTextDirection: typeof import('@vueuse/core').useTextDirection
|
||||||
const useTimeout: typeof import('@vueuse/core')['useTimeout']
|
const useTextSelection: typeof import('@vueuse/core').useTextSelection
|
||||||
const useTimeoutFn: typeof import('@vueuse/core')['useTimeoutFn']
|
const useTextareaAutosize: typeof import('@vueuse/core').useTextareaAutosize
|
||||||
const useTimeoutPoll: typeof import('@vueuse/core')['useTimeoutPoll']
|
const useThrottle: typeof import('@vueuse/core').useThrottle
|
||||||
const useTimestamp: typeof import('@vueuse/core')['useTimestamp']
|
const useThrottleFn: typeof import('@vueuse/core').useThrottleFn
|
||||||
const useTitle: typeof import('@vueuse/core')['useTitle']
|
const useThrottledRefHistory: typeof import('@vueuse/core').useThrottledRefHistory
|
||||||
const useToNumber: typeof import('@vueuse/core')['useToNumber']
|
const useTimeAgo: typeof import('@vueuse/core').useTimeAgo
|
||||||
const useToString: typeof import('@vueuse/core')['useToString']
|
const useTimeout: typeof import('@vueuse/core').useTimeout
|
||||||
const useToggle: typeof import('@vueuse/core')['useToggle']
|
const useTimeoutFn: typeof import('@vueuse/core').useTimeoutFn
|
||||||
const useTransition: typeof import('@vueuse/core')['useTransition']
|
const useTimeoutPoll: typeof import('@vueuse/core').useTimeoutPoll
|
||||||
const useUrlSearchParams: typeof import('@vueuse/core')['useUrlSearchParams']
|
const useTimestamp: typeof import('@vueuse/core').useTimestamp
|
||||||
const useUserMedia: typeof import('@vueuse/core')['useUserMedia']
|
const useTitle: typeof import('@vueuse/core').useTitle
|
||||||
const useVModel: typeof import('@vueuse/core')['useVModel']
|
const useToNumber: typeof import('@vueuse/core').useToNumber
|
||||||
const useVModels: typeof import('@vueuse/core')['useVModels']
|
const useToString: typeof import('@vueuse/core').useToString
|
||||||
const useVibrate: typeof import('@vueuse/core')['useVibrate']
|
const useToggle: typeof import('@vueuse/core').useToggle
|
||||||
const useVirtualList: typeof import('@vueuse/core')['useVirtualList']
|
const useTransition: typeof import('@vueuse/core').useTransition
|
||||||
const useWakeLock: typeof import('@vueuse/core')['useWakeLock']
|
const useUrlSearchParams: typeof import('@vueuse/core').useUrlSearchParams
|
||||||
const useWebNotification: typeof import('@vueuse/core')['useWebNotification']
|
const useUserMedia: typeof import('@vueuse/core').useUserMedia
|
||||||
const useWebSocket: typeof import('@vueuse/core')['useWebSocket']
|
const useVModel: typeof import('@vueuse/core').useVModel
|
||||||
const useWebWorker: typeof import('@vueuse/core')['useWebWorker']
|
const useVModels: typeof import('@vueuse/core').useVModels
|
||||||
const useWebWorkerFn: typeof import('@vueuse/core')['useWebWorkerFn']
|
const useVibrate: typeof import('@vueuse/core').useVibrate
|
||||||
const useWindowFocus: typeof import('@vueuse/core')['useWindowFocus']
|
const useVirtualList: typeof import('@vueuse/core').useVirtualList
|
||||||
const useWindowScroll: typeof import('@vueuse/core')['useWindowScroll']
|
const useWakeLock: typeof import('@vueuse/core').useWakeLock
|
||||||
const useWindowSize: typeof import('@vueuse/core')['useWindowSize']
|
const useWebNotification: typeof import('@vueuse/core').useWebNotification
|
||||||
const watch: typeof import('vue')['watch']
|
const useWebSocket: typeof import('@vueuse/core').useWebSocket
|
||||||
const watchArray: typeof import('@vueuse/core')['watchArray']
|
const useWebWorker: typeof import('@vueuse/core').useWebWorker
|
||||||
const watchAtMost: typeof import('@vueuse/core')['watchAtMost']
|
const useWebWorkerFn: typeof import('@vueuse/core').useWebWorkerFn
|
||||||
const watchDebounced: typeof import('@vueuse/core')['watchDebounced']
|
const useWindowFocus: typeof import('@vueuse/core').useWindowFocus
|
||||||
const watchDeep: typeof import('@vueuse/core')['watchDeep']
|
const useWindowScroll: typeof import('@vueuse/core').useWindowScroll
|
||||||
const watchEffect: typeof import('vue')['watchEffect']
|
const useWindowSize: typeof import('@vueuse/core').useWindowSize
|
||||||
const watchIgnorable: typeof import('@vueuse/core')['watchIgnorable']
|
const watch: typeof import('vue').watch
|
||||||
const watchImmediate: typeof import('@vueuse/core')['watchImmediate']
|
const watchArray: typeof import('@vueuse/core').watchArray
|
||||||
const watchOnce: typeof import('@vueuse/core')['watchOnce']
|
const watchAtMost: typeof import('@vueuse/core').watchAtMost
|
||||||
const watchPausable: typeof import('@vueuse/core')['watchPausable']
|
const watchDebounced: typeof import('@vueuse/core').watchDebounced
|
||||||
const watchPostEffect: typeof import('vue')['watchPostEffect']
|
const watchDeep: typeof import('@vueuse/core').watchDeep
|
||||||
const watchSyncEffect: typeof import('vue')['watchSyncEffect']
|
const watchEffect: typeof import('vue').watchEffect
|
||||||
const watchThrottled: typeof import('@vueuse/core')['watchThrottled']
|
const watchIgnorable: typeof import('@vueuse/core').watchIgnorable
|
||||||
const watchTriggerable: typeof import('@vueuse/core')['watchTriggerable']
|
const watchImmediate: typeof import('@vueuse/core').watchImmediate
|
||||||
const watchWithFilter: typeof import('@vueuse/core')['watchWithFilter']
|
const watchOnce: typeof import('@vueuse/core').watchOnce
|
||||||
const whenever: typeof import('@vueuse/core')['whenever']
|
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
|
// for type re-export
|
||||||
declare global {
|
declare global {
|
||||||
// @ts-ignore
|
// @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
|
// for vue template auto import
|
||||||
import { UnwrapRef } from 'vue'
|
import { UnwrapRef } from 'vue'
|
||||||
declare module 'vue' {
|
declare module 'vue' {
|
||||||
|
interface GlobalComponents {}
|
||||||
interface ComponentCustomProperties {
|
interface ComponentCustomProperties {
|
||||||
readonly EffectScope: UnwrapRef<typeof import('vue')['EffectScope']>
|
readonly EffectScope: UnwrapRef<typeof import('vue')['EffectScope']>
|
||||||
readonly asyncComputed: UnwrapRef<typeof import('@vueuse/core')['asyncComputed']>
|
readonly asyncComputed: UnwrapRef<typeof import('@vueuse/core')['asyncComputed']>
|
||||||
@@ -326,6 +337,7 @@ declare module 'vue' {
|
|||||||
readonly extendRef: UnwrapRef<typeof import('@vueuse/core')['extendRef']>
|
readonly extendRef: UnwrapRef<typeof import('@vueuse/core')['extendRef']>
|
||||||
readonly getCurrentInstance: UnwrapRef<typeof import('vue')['getCurrentInstance']>
|
readonly getCurrentInstance: UnwrapRef<typeof import('vue')['getCurrentInstance']>
|
||||||
readonly getCurrentScope: UnwrapRef<typeof import('vue')['getCurrentScope']>
|
readonly getCurrentScope: UnwrapRef<typeof import('vue')['getCurrentScope']>
|
||||||
|
readonly getCurrentWatcher: UnwrapRef<typeof import('vue')['getCurrentWatcher']>
|
||||||
readonly h: UnwrapRef<typeof import('vue')['h']>
|
readonly h: UnwrapRef<typeof import('vue')['h']>
|
||||||
readonly ignorableWatch: UnwrapRef<typeof import('@vueuse/core')['ignorableWatch']>
|
readonly ignorableWatch: UnwrapRef<typeof import('@vueuse/core')['ignorableWatch']>
|
||||||
readonly inject: UnwrapRef<typeof import('vue')['inject']>
|
readonly inject: UnwrapRef<typeof import('vue')['inject']>
|
||||||
@@ -335,6 +347,7 @@ declare module 'vue' {
|
|||||||
readonly isReactive: UnwrapRef<typeof import('vue')['isReactive']>
|
readonly isReactive: UnwrapRef<typeof import('vue')['isReactive']>
|
||||||
readonly isReadonly: UnwrapRef<typeof import('vue')['isReadonly']>
|
readonly isReadonly: UnwrapRef<typeof import('vue')['isReadonly']>
|
||||||
readonly isRef: UnwrapRef<typeof import('vue')['isRef']>
|
readonly isRef: UnwrapRef<typeof import('vue')['isRef']>
|
||||||
|
readonly isShallow: UnwrapRef<typeof import('vue')['isShallow']>
|
||||||
readonly makeDestructurable: UnwrapRef<typeof import('@vueuse/core')['makeDestructurable']>
|
readonly makeDestructurable: UnwrapRef<typeof import('@vueuse/core')['makeDestructurable']>
|
||||||
readonly markRaw: UnwrapRef<typeof import('vue')['markRaw']>
|
readonly markRaw: UnwrapRef<typeof import('vue')['markRaw']>
|
||||||
readonly nextTick: UnwrapRef<typeof import('vue')['nextTick']>
|
readonly nextTick: UnwrapRef<typeof import('vue')['nextTick']>
|
||||||
@@ -357,6 +370,7 @@ declare module 'vue' {
|
|||||||
readonly onStartTyping: UnwrapRef<typeof import('@vueuse/core')['onStartTyping']>
|
readonly onStartTyping: UnwrapRef<typeof import('@vueuse/core')['onStartTyping']>
|
||||||
readonly onUnmounted: UnwrapRef<typeof import('vue')['onUnmounted']>
|
readonly onUnmounted: UnwrapRef<typeof import('vue')['onUnmounted']>
|
||||||
readonly onUpdated: UnwrapRef<typeof import('vue')['onUpdated']>
|
readonly onUpdated: UnwrapRef<typeof import('vue')['onUpdated']>
|
||||||
|
readonly onWatcherCleanup: UnwrapRef<typeof import('vue')['onWatcherCleanup']>
|
||||||
readonly pausableWatch: UnwrapRef<typeof import('@vueuse/core')['pausableWatch']>
|
readonly pausableWatch: UnwrapRef<typeof import('@vueuse/core')['pausableWatch']>
|
||||||
readonly provide: UnwrapRef<typeof import('vue')['provide']>
|
readonly provide: UnwrapRef<typeof import('vue')['provide']>
|
||||||
readonly provideLocal: UnwrapRef<typeof import('@vueuse/core')['provideLocal']>
|
readonly provideLocal: UnwrapRef<typeof import('@vueuse/core')['provideLocal']>
|
||||||
@@ -467,6 +481,7 @@ declare module 'vue' {
|
|||||||
readonly useGamepad: UnwrapRef<typeof import('@vueuse/core')['useGamepad']>
|
readonly useGamepad: UnwrapRef<typeof import('@vueuse/core')['useGamepad']>
|
||||||
readonly useGeolocation: UnwrapRef<typeof import('@vueuse/core')['useGeolocation']>
|
readonly useGeolocation: UnwrapRef<typeof import('@vueuse/core')['useGeolocation']>
|
||||||
readonly useI18n: UnwrapRef<typeof import('vue-i18n')['useI18n']>
|
readonly useI18n: UnwrapRef<typeof import('vue-i18n')['useI18n']>
|
||||||
|
readonly useId: UnwrapRef<typeof import('vue')['useId']>
|
||||||
readonly useIdle: UnwrapRef<typeof import('@vueuse/core')['useIdle']>
|
readonly useIdle: UnwrapRef<typeof import('@vueuse/core')['useIdle']>
|
||||||
readonly useImage: UnwrapRef<typeof import('@vueuse/core')['useImage']>
|
readonly useImage: UnwrapRef<typeof import('@vueuse/core')['useImage']>
|
||||||
readonly useInfiniteScroll: UnwrapRef<typeof import('@vueuse/core')['useInfiniteScroll']>
|
readonly useInfiniteScroll: UnwrapRef<typeof import('@vueuse/core')['useInfiniteScroll']>
|
||||||
@@ -485,6 +500,7 @@ declare module 'vue' {
|
|||||||
readonly useMemoize: UnwrapRef<typeof import('@vueuse/core')['useMemoize']>
|
readonly useMemoize: UnwrapRef<typeof import('@vueuse/core')['useMemoize']>
|
||||||
readonly useMemory: UnwrapRef<typeof import('@vueuse/core')['useMemory']>
|
readonly useMemory: UnwrapRef<typeof import('@vueuse/core')['useMemory']>
|
||||||
readonly useMessage: UnwrapRef<typeof import('naive-ui')['useMessage']>
|
readonly useMessage: UnwrapRef<typeof import('naive-ui')['useMessage']>
|
||||||
|
readonly useModel: UnwrapRef<typeof import('vue')['useModel']>
|
||||||
readonly useMounted: UnwrapRef<typeof import('@vueuse/core')['useMounted']>
|
readonly useMounted: UnwrapRef<typeof import('@vueuse/core')['useMounted']>
|
||||||
readonly useMouse: UnwrapRef<typeof import('@vueuse/core')['useMouse']>
|
readonly useMouse: UnwrapRef<typeof import('@vueuse/core')['useMouse']>
|
||||||
readonly useMouseInElement: UnwrapRef<typeof import('@vueuse/core')['useMouseInElement']>
|
readonly useMouseInElement: UnwrapRef<typeof import('@vueuse/core')['useMouseInElement']>
|
||||||
@@ -533,6 +549,7 @@ declare module 'vue' {
|
|||||||
readonly useStyleTag: UnwrapRef<typeof import('@vueuse/core')['useStyleTag']>
|
readonly useStyleTag: UnwrapRef<typeof import('@vueuse/core')['useStyleTag']>
|
||||||
readonly useSupported: UnwrapRef<typeof import('@vueuse/core')['useSupported']>
|
readonly useSupported: UnwrapRef<typeof import('@vueuse/core')['useSupported']>
|
||||||
readonly useSwipe: UnwrapRef<typeof import('@vueuse/core')['useSwipe']>
|
readonly useSwipe: UnwrapRef<typeof import('@vueuse/core')['useSwipe']>
|
||||||
|
readonly useTemplateRef: UnwrapRef<typeof import('vue')['useTemplateRef']>
|
||||||
readonly useTemplateRefsList: UnwrapRef<typeof import('@vueuse/core')['useTemplateRefsList']>
|
readonly useTemplateRefsList: UnwrapRef<typeof import('@vueuse/core')['useTemplateRefsList']>
|
||||||
readonly useTextDirection: UnwrapRef<typeof import('@vueuse/core')['useTextDirection']>
|
readonly useTextDirection: UnwrapRef<typeof import('@vueuse/core')['useTextDirection']>
|
||||||
readonly useTextSelection: UnwrapRef<typeof import('@vueuse/core')['useTextSelection']>
|
readonly useTextSelection: UnwrapRef<typeof import('@vueuse/core')['useTextSelection']>
|
||||||
@@ -581,291 +598,4 @@ declare module 'vue' {
|
|||||||
readonly watchWithFilter: UnwrapRef<typeof import('@vueuse/core')['watchWithFilter']>
|
readonly watchWithFilter: UnwrapRef<typeof import('@vueuse/core')['watchWithFilter']>
|
||||||
readonly whenever: UnwrapRef<typeof import('@vueuse/core')['whenever']>
|
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
@@ -2,7 +2,7 @@
|
|||||||
"name": "it-tools",
|
"name": "it-tools",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"version": "2026.1.4",
|
"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. ",
|
"description": "Collection of handy online tools for developers, with great UX. ",
|
||||||
"author": "Corentin Th <corentin.thomasset74+it-tools@gmail.com> (https://corentin.tech)",
|
"author": "Corentin Th <corentin.thomasset74+it-tools@gmail.com> (https://corentin.tech)",
|
||||||
"license": "GNU GPLv3",
|
"license": "GNU GPLv3",
|
||||||
@@ -31,7 +31,10 @@
|
|||||||
"test:e2e:dev": "TZ=UTC BASE_URL=http://localhost:5173 NO_WEB_SERVER=true playwright test",
|
"test:e2e:dev": "TZ=UTC BASE_URL=http://localhost:5173 NO_WEB_SERVER=true playwright test",
|
||||||
"coverage": "vitest run --coverage",
|
"coverage": "vitest run --coverage",
|
||||||
"typecheck": "vue-tsc --noEmit -p tsconfig.vitest.json --composite false",
|
"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:tool": "node scripts/create-tool.mjs",
|
||||||
"script:create:ui": "hygen generator ui-component",
|
"script:create:ui": "hygen generator ui-component",
|
||||||
"release": "node ./scripts/release.mjs",
|
"release": "node ./scripts/release.mjs",
|
||||||
@@ -39,7 +42,7 @@
|
|||||||
"script:extract:strings": "node ./scripts/extract-tools-strings.mjs",
|
"script:extract:strings": "node ./scripts/extract-tools-strings.mjs",
|
||||||
"script:translate-missing": "node ./scripts/translate-missings.mjs -e ./locales/en.yml -t ./locales/*.yml",
|
"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'",
|
"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": {
|
"dependencies": {
|
||||||
"@boxyhq/saml20": "^1.16.0",
|
"@boxyhq/saml20": "^1.16.0",
|
||||||
@@ -87,7 +90,7 @@
|
|||||||
"@regexper/render": "^1.0.0",
|
"@regexper/render": "^1.0.0",
|
||||||
"@sindresorhus/slugify": "^3.0.0",
|
"@sindresorhus/slugify": "^3.0.0",
|
||||||
"@skeepit/unicode-to-gsm7": "^1.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/core": "^3.22.5",
|
||||||
"@tiptap/extension-color": "^3.22.5",
|
"@tiptap/extension-color": "^3.22.5",
|
||||||
"@tiptap/extension-gapcursor": "^3.22.5",
|
"@tiptap/extension-gapcursor": "^3.22.5",
|
||||||
@@ -107,7 +110,7 @@
|
|||||||
"@vicons/material": "^0.12.0",
|
"@vicons/material": "^0.12.0",
|
||||||
"@vicons/tabler": "^0.12.0",
|
"@vicons/tabler": "^0.12.0",
|
||||||
"@vueuse/core": "^10.11.1",
|
"@vueuse/core": "^10.11.1",
|
||||||
"@vueuse/head": "^1.0.0",
|
"@vueuse/head": "^1.3.1",
|
||||||
"@vueuse/integrations": "^14.2.0",
|
"@vueuse/integrations": "^14.2.0",
|
||||||
"@vueuse/router": "^10.0.0",
|
"@vueuse/router": "^10.0.0",
|
||||||
"@xmldom/xmldom": "^0.8.13",
|
"@xmldom/xmldom": "^0.8.13",
|
||||||
@@ -153,7 +156,7 @@
|
|||||||
"creditcard-generator": "^0.0.7",
|
"creditcard-generator": "^0.0.7",
|
||||||
"cron-parser": "4.9.0",
|
"cron-parser": "4.9.0",
|
||||||
"cron-validator": "^1.4.0",
|
"cron-validator": "^1.4.0",
|
||||||
"cronstrue": "^3.0.0",
|
"cronstrue": "^3.1.0",
|
||||||
"cross-spawn": "^7.0.6",
|
"cross-spawn": "^7.0.6",
|
||||||
"crypto-js": "^4.2.0",
|
"crypto-js": "^4.2.0",
|
||||||
"csstoxpath": "^2.0.0",
|
"csstoxpath": "^2.0.0",
|
||||||
@@ -190,13 +193,13 @@
|
|||||||
"event-cron-parser": "^1.0.37",
|
"event-cron-parser": "^1.0.37",
|
||||||
"exif-be-gone": "^1.5.1",
|
"exif-be-gone": "^1.5.1",
|
||||||
"exifreader": "^4.33.1",
|
"exifreader": "^4.33.1",
|
||||||
"fanger": "^0.3.1",
|
"fanger": "0.3.1",
|
||||||
"fast-xml-parser": "^5.7.2",
|
"fast-xml-parser": "^5.7.2",
|
||||||
"fast_array_intersect": "^1.1.0",
|
"fast_array_intersect": "^1.1.0",
|
||||||
"fflate": "^0.8.2",
|
"fflate": "^0.8.2",
|
||||||
"figlet": "^1.9.4",
|
"figlet": "^1.9.4",
|
||||||
"figue": "^1.2.0",
|
"figue": "^1.2.0",
|
||||||
"file-type": "^21.2.0",
|
"file-type": "^21.3.4",
|
||||||
"flatten-anything": "^4.0.2",
|
"flatten-anything": "^4.0.2",
|
||||||
"flexsearch": "^0.8.212",
|
"flexsearch": "^0.8.212",
|
||||||
"fuse.js": "^7.1.0",
|
"fuse.js": "^7.1.0",
|
||||||
@@ -218,7 +221,7 @@
|
|||||||
"ibantools": "^4.5.1",
|
"ibantools": "^4.5.1",
|
||||||
"ical-generator": "^10.0.0",
|
"ical-generator": "^10.0.0",
|
||||||
"ical.js": "^2.2.1",
|
"ical.js": "^2.2.1",
|
||||||
"iconv-lite": "^0.7.1",
|
"iconv-lite": "^0.7.2",
|
||||||
"idb-keyval": "^6.2.2",
|
"idb-keyval": "^6.2.2",
|
||||||
"image-compare-viewer": "^1.6.2",
|
"image-compare-viewer": "^1.6.2",
|
||||||
"image-in-browser": "^3.3.0",
|
"image-in-browser": "^3.3.0",
|
||||||
@@ -270,7 +273,7 @@
|
|||||||
"long": "^5.3.2",
|
"long": "^5.3.2",
|
||||||
"lorem-ipsum-japanese": "^1.0.1",
|
"lorem-ipsum-japanese": "^1.0.1",
|
||||||
"luhn-js": "^1.1.2",
|
"luhn-js": "^1.1.2",
|
||||||
"luxon": "^3.5.0",
|
"luxon": "^3.7.1",
|
||||||
"markdown-docx": "^1.6.0",
|
"markdown-docx": "^1.6.0",
|
||||||
"markdown-it": "^14.1.1",
|
"markdown-it": "^14.1.1",
|
||||||
"markdown-it-mark": "^4.0.0",
|
"markdown-it-mark": "^4.0.0",
|
||||||
@@ -311,7 +314,7 @@
|
|||||||
"paseto-ts": "^2.0.5",
|
"paseto-ts": "^2.0.5",
|
||||||
"path2d-polyfill": "^3.1.3",
|
"path2d-polyfill": "^3.1.3",
|
||||||
"pdf-signature-reader": "^1.4.3",
|
"pdf-signature-reader": "^1.4.3",
|
||||||
"pdfjs-dist": "^4.8.69",
|
"pdfjs-dist": "^4.10.38",
|
||||||
"picomatch": "^4.0.5",
|
"picomatch": "^4.0.5",
|
||||||
"pinia": "^2.0.34",
|
"pinia": "^2.0.34",
|
||||||
"plausible-tracker": "^0.3.9",
|
"plausible-tracker": "^0.3.9",
|
||||||
@@ -375,19 +378,19 @@
|
|||||||
"units-converter": "^1.0.3",
|
"units-converter": "^1.0.3",
|
||||||
"unixcrypt-browser": "^2.0.4",
|
"unixcrypt-browser": "^2.0.4",
|
||||||
"unpdf": "^1.4.0",
|
"unpdf": "^1.4.0",
|
||||||
"unplugin-auto-import": "^0.16.4",
|
"unplugin-auto-import": "^21.0.0",
|
||||||
"utf8": "^3.0.0",
|
"utf8": "^3.0.0",
|
||||||
"uuid": "^14.0.0",
|
"uuid": "^14.0.0",
|
||||||
"vanilla-jsoneditor": "^3.11.0",
|
"vanilla-jsoneditor": "^3.11.0",
|
||||||
"vue": "^3.3.4",
|
"vue": "^3.5.39",
|
||||||
"vue-color-wheel": "^0.1.1",
|
"vue-color-wheel": "^0.1.1",
|
||||||
"vue-i18n": "^11.4.0",
|
"vue-i18n": "^11.4.0",
|
||||||
"vue-loading-overlay": "^6.0",
|
"vue-loading-overlay": "^6.0.6",
|
||||||
"vue-markdown-render": "^2.3.0",
|
"vue-markdown-render": "^2.3.0",
|
||||||
"vue-mathjax-next": "^0.0.6",
|
"vue-mathjax-next": "^0.0.6",
|
||||||
"vue-router": "^4.1.6",
|
"vue-router": "^4.1.6",
|
||||||
"vue-shadow-dom": "^4.2.0",
|
"vue-shadow-dom": "^4.2.0",
|
||||||
"vue-tsc": "^1.8.1",
|
"vue-tsc": "^3.3.6",
|
||||||
"vue3-flip-countdown": "^0.1.6",
|
"vue3-flip-countdown": "^0.1.6",
|
||||||
"vuedraggable": "^4.1.0",
|
"vuedraggable": "^4.1.0",
|
||||||
"vuex": "^4.1.0",
|
"vuex": "^4.1.0",
|
||||||
@@ -404,12 +407,10 @@
|
|||||||
"yaml": "^2.8.4"
|
"yaml": "^2.8.4"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@antfu/eslint-config": "^0.41.0",
|
"@iconify-json/mdi": "^1.2.3",
|
||||||
"@iconify-json/mdi": "^1.1.50",
|
"@intlify/unplugin-vue-i18n": "^11.2.4",
|
||||||
"@intlify/unplugin-vue-i18n": "^11.0.0",
|
|
||||||
"@playwright/test": "^1.59.1",
|
"@playwright/test": "^1.59.1",
|
||||||
"@rushstack/eslint-patch": "^1.2.0",
|
"@tsconfig/node24": "^24.0.4",
|
||||||
"@tsconfig/node18": "^18.2.0",
|
|
||||||
"@types/arr-diff": "^4.0.3",
|
"@types/arr-diff": "^4.0.3",
|
||||||
"@types/bcryptjs": "^2.4.6",
|
"@types/bcryptjs": "^2.4.6",
|
||||||
"@types/big.js": "^6.2.2",
|
"@types/big.js": "^6.2.2",
|
||||||
@@ -452,52 +453,41 @@
|
|||||||
"@types/unist": "^3.0.3",
|
"@types/unist": "^3.0.3",
|
||||||
"@types/utf8": "^3.0.3",
|
"@types/utf8": "^3.0.3",
|
||||||
"@types/uuid": "^10.0.0",
|
"@types/uuid": "^10.0.0",
|
||||||
"@unocss/eslint-config": "^0.57.1",
|
"@vitejs/plugin-vue": "^6.0.7",
|
||||||
"@vitejs/plugin-vue": "^4.3.4",
|
"@vitejs/plugin-vue-jsx": "^5.1.6",
|
||||||
"@vitejs/plugin-vue-jsx": "^3.0.2",
|
"@vue/compiler-sfc": "^3.5.39",
|
||||||
"@vue/compiler-sfc": "^3.2.47",
|
"@vue/runtime-dom": "^3.5.39",
|
||||||
"@vue/runtime-dom": "^3.3.4",
|
"@vue/test-utils": "^2.4.11",
|
||||||
"@vue/test-utils": "^2.3.2",
|
"@vue/tsconfig": "^0.9.1",
|
||||||
"@vue/tsconfig": "^0.4.0",
|
|
||||||
"axios": "^1.16.0",
|
"axios": "^1.16.0",
|
||||||
"commander": "^14.0.1",
|
"commander": "^14.0.1",
|
||||||
"consola": "^3.0.2",
|
"consola": "^3.4.2",
|
||||||
"dotenv": "^17.2.3",
|
"dotenv": "^17.2.3",
|
||||||
"eslint": "^8.47.0",
|
|
||||||
"hygen": "^6.2.11",
|
"hygen": "^6.2.11",
|
||||||
"jsdom": "^22.0.0",
|
"jsdom": "^29.1.1",
|
||||||
"less": "^4.2.2",
|
"less": "^4.2.2",
|
||||||
"prettier": "^3.0.0",
|
"oxfmt": "^0.57.0",
|
||||||
|
"oxlint": "^1.72.0",
|
||||||
"rollup-plugin-visualizer": "^7.0.1",
|
"rollup-plugin-visualizer": "^7.0.1",
|
||||||
"semver": "^7.5.2",
|
"semver": "^7.7.2",
|
||||||
"typescript": "~5.2.2",
|
"typescript": "~6.0.3",
|
||||||
"unocss": "^0.57.1",
|
"unocss": "^66.7.4",
|
||||||
"unocss-preset-scrollbar": "^0.2.1",
|
"unocss-preset-scrollbar": "^4.0.0",
|
||||||
"unplugin-icons": "^0.17.0",
|
"unplugin-icons": "^23.0.1",
|
||||||
"unplugin-vue-components": "^0.25.0",
|
"unplugin-vue-components": "^32.1.0",
|
||||||
"unplugin-vue-markdown": "^29.1.0",
|
"unplugin-vue-markdown": "^32.0.0",
|
||||||
"vite": "^4.4.9",
|
"vite": "^8.1.3",
|
||||||
"vite-plugin-node-polyfills": "^0.26.0",
|
"vite-plugin-node-polyfills": "^0.28.0",
|
||||||
"vite-plugin-pwa": "^1.1.0",
|
"vite-plugin-pwa": "^1.3.0",
|
||||||
"vite-plugin-splash-screen": "^0.2.0",
|
"vite-plugin-splash-screen": "^0.2.0",
|
||||||
"vite-plugin-wasm": "^3.6.0",
|
"vite-plugin-wasm": "^3.6.0",
|
||||||
"vite-svg-loader": "^4.0.0",
|
"vite-svg-loader": "^5.1.1",
|
||||||
"vitest": "^0.34.6",
|
"vitest": "^4.1.9",
|
||||||
"vue-i18n-extract": "^2.0.7",
|
"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"
|
"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": {
|
"scarfSettings": {
|
||||||
"enabled": false
|
"enabled": false
|
||||||
}
|
}
|
||||||
|
|||||||
+10
-9
@@ -10,6 +10,9 @@ const useWebServer = process.env.NO_WEB_SERVER !== 'true';
|
|||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
testDir: './src',
|
testDir: './src',
|
||||||
testMatch: /\.e2e\.(spec\.)?ts$/,
|
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 */
|
/* Run tests in files in parallel */
|
||||||
fullyParallel: true,
|
fullyParallel: true,
|
||||||
/* Fail the build on CI if you accidentally left test.only in the source code. */
|
/* 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 */
|
/* Run your local dev server before starting the tests */
|
||||||
|
|
||||||
...(useWebServer
|
...(useWebServer && {
|
||||||
&& {
|
webServer: {
|
||||||
webServer: {
|
command: 'npm run preview',
|
||||||
command: 'npm run preview',
|
url: 'http://localhost:5050',
|
||||||
url: 'http://localhost:5050',
|
reuseExistingServer: !isCI,
|
||||||
reuseExistingServer: !isCI,
|
},
|
||||||
},
|
}),
|
||||||
}
|
|
||||||
),
|
|
||||||
});
|
});
|
||||||
Generated
+6905
-8725
File diff suppressed because it is too large.
Load diff
@@ -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
|
||||||
@@ -50,7 +50,6 @@
|
|||||||
"groupName": "UnoCSS ecosystem",
|
"groupName": "UnoCSS ecosystem",
|
||||||
"matchPackageNames": [
|
"matchPackageNames": [
|
||||||
"unocss",
|
"unocss",
|
||||||
"@unocss/eslint-config",
|
|
||||||
"unocss-preset-scrollbar"
|
"unocss-preset-scrollbar"
|
||||||
],
|
],
|
||||||
"matchUpdateTypes": ["major", "minor", "patch"]
|
"matchUpdateTypes": ["major", "minor", "patch"]
|
||||||
|
|||||||
@@ -1,3 +1,2 @@
|
|||||||
export function readFile() {}
|
export function readFile() {}
|
||||||
export function writeFile() {}
|
export function writeFile() {}
|
||||||
export {};
|
|
||||||
@@ -4,27 +4,27 @@ import { useCopy } from '@/composable/copy';
|
|||||||
import { translate as t } from '@/plugins/i18n.plugin';
|
import { translate as t } from '@/plugins/i18n.plugin';
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
value: string
|
value?: string | number | boolean | null;
|
||||||
multiline?: boolean
|
multiline?: boolean;
|
||||||
rows?: number | string
|
rows?: number | string;
|
||||||
autosize?: boolean
|
autosize?: boolean;
|
||||||
readonly?: boolean
|
readonly?: boolean;
|
||||||
}>();
|
}>();
|
||||||
const emit = defineEmits(['update:value']);
|
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 { 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>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<c-input-text
|
<c-input-text v-model:value="value" :multiline="multiline" :rows="rows" :autosize="autosize" :readonly="readonly">
|
||||||
v-model:value="value"
|
|
||||||
:multiline="multiline"
|
|
||||||
:rows="rows"
|
|
||||||
:autosize="autosize"
|
|
||||||
:readonly="readonly"
|
|
||||||
>
|
|
||||||
<template #suffix>
|
<template #suffix>
|
||||||
<c-tooltip :tooltip="tooltipText">
|
<c-tooltip :tooltip="tooltipText">
|
||||||
<c-button circle variant="text" size="small" @click="copy()">
|
<c-button circle variant="text" size="small" @click="copy()">
|
||||||
|
|||||||
@@ -3,17 +3,20 @@ import _ from 'lodash';
|
|||||||
import convert, { type Unit } from 'convert';
|
import convert, { type Unit } from 'convert';
|
||||||
import * as unitsconverter from 'units-converter';
|
import * as unitsconverter from 'units-converter';
|
||||||
|
|
||||||
const props = withDefaults(defineProps<{
|
const props = withDefaults(
|
||||||
supportedUnits: { [key: string]: string }
|
defineProps<{
|
||||||
defaultUnit: string
|
supportedUnits: { [key: string]: string };
|
||||||
labelWidth?: string
|
defaultUnit: string;
|
||||||
unitMinWidth?: string
|
labelWidth?: string;
|
||||||
converterType: 'convert' | 'frequency' | 'volumeFlowRate' | 'speed' | 'acceleration'
|
unitMinWidth?: string;
|
||||||
}>(), {
|
converterType?: 'convert' | 'frequency' | 'volumeFlowRate' | 'speed' | 'acceleration';
|
||||||
labelWidth: '150px',
|
}>(),
|
||||||
unitMinWidth: '50px',
|
{
|
||||||
converterType: 'convert',
|
labelWidth: '150px',
|
||||||
});
|
unitMinWidth: '50px',
|
||||||
|
converterType: 'convert',
|
||||||
|
},
|
||||||
|
);
|
||||||
const { supportedUnits, defaultUnit, labelWidth, unitMinWidth, converterType } = toRefs(props);
|
const { supportedUnits, defaultUnit, labelWidth, unitMinWidth, converterType } = toRefs(props);
|
||||||
|
|
||||||
const SI_PREFIX_NAMES = [
|
const SI_PREFIX_NAMES = [
|
||||||
@@ -45,19 +48,21 @@ const SI_PREFIX_NAMES = [
|
|||||||
|
|
||||||
const SI_PREFIX_NAMES_REGEX = new RegExp(`^(${SI_PREFIX_NAMES.join('|')})`);
|
const SI_PREFIX_NAMES_REGEX = new RegExp(`^(${SI_PREFIX_NAMES.join('|')})`);
|
||||||
|
|
||||||
const units = reactive<
|
const units = reactive<Record<string, { title: string; unit: string; ref: number }>>(
|
||||||
Record<
|
Object.entries(supportedUnits.value)
|
||||||
string,
|
.map(([key, label]) => ({
|
||||||
{ title: string; unit: string; ref: number }
|
title: label,
|
||||||
>
|
unit: key,
|
||||||
>(Object.entries(supportedUnits.value).map(([key, label]) => ({
|
ref: 1,
|
||||||
title: label,
|
}))
|
||||||
unit: key,
|
.reduce(
|
||||||
ref: 1,
|
(prev, current) => ({
|
||||||
})).reduce((prev, current) => ({
|
|
||||||
...prev,
|
...prev,
|
||||||
[current.unit]: current,
|
[current.unit]: current,
|
||||||
}), {}));
|
}),
|
||||||
|
{},
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
const excludeSIPrefixes = ref(true);
|
const excludeSIPrefixes = ref(true);
|
||||||
const filteredUnits = computed(() => {
|
const filteredUnits = computed(() => {
|
||||||
@@ -65,9 +70,7 @@ const filteredUnits = computed(() => {
|
|||||||
return Object.entries(units);
|
return Object.entries(units);
|
||||||
}
|
}
|
||||||
|
|
||||||
return Object.entries(units).filter(
|
return Object.entries(units).filter(([_, { title }]) => !SI_PREFIX_NAMES_REGEX.test(title));
|
||||||
([_, { title }]) => !SI_PREFIX_NAMES_REGEX.test(title),
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
function update(key: string) {
|
function update(key: string) {
|
||||||
@@ -84,14 +87,12 @@ function update(key: string) {
|
|||||||
.forEach(({ unit }) => {
|
.forEach(({ unit }) => {
|
||||||
try {
|
try {
|
||||||
units[unit].ref = converter.to(unit as Unit);
|
units[unit].ref = converter.to(unit as Unit);
|
||||||
}
|
} catch (e: any) {
|
||||||
catch (e: any) {
|
|
||||||
units[unit].ref = 0;
|
units[unit].ref = 0;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.value();
|
.value();
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
const mapUnit = (unit: string) => {
|
const mapUnit = (unit: string) => {
|
||||||
// npm units-converter uses wrong symbol for miles per hour, so we need to fix it
|
// npm units-converter uses wrong symbol for miles per hour, so we need to fix it
|
||||||
if (converterType.value === 'speed' && unit === 'mi/h') {
|
if (converterType.value === 'speed' && unit === 'mi/h') {
|
||||||
@@ -106,8 +107,7 @@ function update(key: string) {
|
|||||||
.forEach(({ unit }) => {
|
.forEach(({ unit }) => {
|
||||||
try {
|
try {
|
||||||
units[unit].ref = converter.to(mapUnit(unit)).value;
|
units[unit].ref = converter.to(mapUnit(unit)).value;
|
||||||
}
|
} catch (e: any) {
|
||||||
catch (e: any) {
|
|
||||||
units[unit].ref = 0;
|
units[unit].ref = 0;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@@ -133,11 +133,7 @@ update(defaultUnit.value);
|
|||||||
{{ title }}
|
{{ title }}
|
||||||
</n-input-group-label>
|
</n-input-group-label>
|
||||||
|
|
||||||
<n-input-number
|
<n-input-number v-model:value="units[key].ref" style="flex: 1" @update:value="() => update(key)" />
|
||||||
v-model:value="units[key].ref"
|
|
||||||
style="flex: 1"
|
|
||||||
@update:value="() => update(key)"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<n-input-group-label :style="{ minWidth: unitMinWidth }">
|
<n-input-group-label :style="{ minWidth: unitMinWidth }">
|
||||||
{{ unit }}
|
{{ unit }}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { type MaybeRef, get } from '@vueuse/core';
|
import { type MaybeRef, get } from '@vueuse/core';
|
||||||
import { computed, ref } from 'vue';
|
import { type Ref, computed, ref } from 'vue';
|
||||||
import FlexSearch from 'flexsearch';
|
import FlexSearch from 'flexsearch';
|
||||||
|
|
||||||
// Define key types to match Fuse.js format
|
// Define key types to match Fuse.js format
|
||||||
@@ -13,20 +13,20 @@ export function useFlexSearch<Data extends Record<string, any>>({
|
|||||||
},
|
},
|
||||||
limit = -1,
|
limit = -1,
|
||||||
}: {
|
}: {
|
||||||
search: MaybeRef<string>
|
search: MaybeRef<string>;
|
||||||
data: Data[]
|
data: Data[];
|
||||||
options?: {
|
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.
|
* 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
|
* @default true
|
||||||
*/
|
*/
|
||||||
filterEmpty?: boolean
|
filterEmpty?: boolean;
|
||||||
/**
|
/**
|
||||||
* Whether the results should be sorted by similarity score using the Levenshtein distance.
|
* Whether the results should be sorted by similarity score using the Levenshtein distance.
|
||||||
* @default true
|
* @default true
|
||||||
*/
|
*/
|
||||||
shouldSort?: boolean
|
shouldSort?: boolean;
|
||||||
/**
|
/**
|
||||||
* Type of tokenization logic to use (Determines how the search logic will behave).
|
* Type of tokenization logic to use (Determines how the search logic will behave).
|
||||||
* @default 'forward'
|
* @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.
|
* 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.
|
* Resolution value for giving meaningful results when searching for partial matches.
|
||||||
* @default 9
|
* @default 9
|
||||||
* @see {@link https://github.com/nextapps-de/flexsearch?tab=readme-ov-file#resolution | FlexSearch Resolution Documentation}
|
* @see {@link https://github.com/nextapps-de/flexsearch?tab=readme-ov-file#resolution | FlexSearch Resolution Documentation}
|
||||||
*/
|
*/
|
||||||
resolution?: number
|
resolution?: number;
|
||||||
optimize?: boolean
|
optimize?: boolean;
|
||||||
/**
|
/**
|
||||||
* Value to determine if the cache should be used.
|
* 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).
|
* 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
|
* @default false
|
||||||
* @see {@link https://github.com/nextapps-de/flexsearch?tab=readme-ov-file#auto-balanced-cache-by-popularity | FlexSearch Cache Documentation}
|
* @see {@link https://github.com/nextapps-de/flexsearch?tab=readme-ov-file#auto-balanced-cache-by-popularity | FlexSearch Cache Documentation}
|
||||||
*/
|
*/
|
||||||
cache?: boolean | number
|
cache?: boolean | number;
|
||||||
}
|
};
|
||||||
limit?: MaybeRef<number>
|
limit?: MaybeRef<number>;
|
||||||
}) {
|
}) {
|
||||||
// Extract options
|
// Extract options
|
||||||
const { keys, filterEmpty = true, shouldSort = true, tokenize = 'forward', ...indexOptions } = 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);
|
const getItemKey = (item: Data, idx: number) => (item.id !== undefined ? item.id : idx);
|
||||||
|
|
||||||
// Map to store original data items by unique key
|
// 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
|
// Create separate indices for each key with weight info
|
||||||
const indices = normalizedKeys.map(({ name, weight }) => ({
|
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 };
|
const current = weightedResults.get(id) || { score: 0, maxWeight: 0 };
|
||||||
// Use the maximum weight among matching fields as the primary score
|
// Use the maximum weight among matching fields as the primary score
|
||||||
// Add a small bonus for additional field matches
|
// 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);
|
const newMaxWeight = Math.max(current.maxWeight, weight);
|
||||||
|
|
||||||
weightedResults.set(id, {
|
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 shouldn't be sorted by similarity, apply limit here and return early
|
||||||
if (!shouldSort) {
|
if (!shouldSort) {
|
||||||
const limitedIds = searchLimit > 0 ? sortedIds.slice(0, searchLimit) : sortedIds;
|
const limitedIds = searchLimit > 0 ? sortedIds.slice(0, searchLimit) : sortedIds;
|
||||||
return limitedIds
|
return limitedIds.map((id) => dataMap.value.get(id)).filter(Boolean) as Data[];
|
||||||
.map(id => dataMap.value.get(id))
|
|
||||||
.filter(Boolean) as Data[];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Calculate Levenshtein distance
|
// Calculate Levenshtein distance
|
||||||
const levenshteinDistance = (str1: string, str2: string): number => {
|
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++) {
|
for (let i = 0; i <= str1.length; i++) {
|
||||||
matrix[0][i] = i;
|
matrix[0][i] = i;
|
||||||
@@ -218,7 +218,7 @@ export function useFlexSearch<Data extends Record<string, any>>({
|
|||||||
}
|
}
|
||||||
|
|
||||||
const distance = levenshteinDistance(str1.toLowerCase(), str2.toLowerCase());
|
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
|
// 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;
|
return b!.similarity - a!.similarity;
|
||||||
})
|
})
|
||||||
.map(result => result!.item);
|
.map((result) => result!.item);
|
||||||
|
|
||||||
// Apply limit after final sorting
|
// Apply limit after final sorting
|
||||||
return searchLimit > 0 ? sortedResults.slice(0, searchLimit) : sortedResults;
|
return searchLimit > 0 ? sortedResults.slice(0, searchLimit) : sortedResults;
|
||||||
|
|||||||
+22
-32
@@ -65,13 +65,13 @@ const toolFooter = computed<string>(() => {
|
|||||||
if (footer === 'undefined') {
|
if (footer === 'undefined') {
|
||||||
footer = '';
|
footer = '';
|
||||||
}
|
}
|
||||||
const npmPackages = (route.meta.npmPackages as string[] || [])
|
const npmPackages = ((route.meta.npmPackages as string[]) || []).map((packageName) =>
|
||||||
.map(
|
createLink(packageName, packageName.includes('://') ? packageName : `https://www.npmjs.com/package/${packageName}`),
|
||||||
packageName => createLink(
|
);
|
||||||
packageName,
|
return (
|
||||||
packageName.includes('://') ? packageName : `https://www.npmjs.com/package/${packageName}`),
|
(npmPackages.length > 0 ? `${t('tools.tool.layout.text.made-with-npmpackages', [npmPackages.join(', ')])}\n` : '') +
|
||||||
);
|
footer
|
||||||
return ((npmPackages.length > 0 ? `${t('tools.tool.layout.text.made-with-npmpackages', [npmPackages.join(', ')])}\n` : '') + footer).trim();
|
).trim();
|
||||||
});
|
});
|
||||||
const themeVars = useThemeVars();
|
const themeVars = useThemeVars();
|
||||||
|
|
||||||
@@ -85,24 +85,14 @@ const linkTheme = useTheme();
|
|||||||
<div flex flex-nowrap items-center justify-between>
|
<div flex flex-nowrap items-center justify-between>
|
||||||
<n-h1>
|
<n-h1>
|
||||||
{{ toolTitle }}
|
{{ toolTitle }}
|
||||||
<n-tooltip
|
<n-tooltip placement="right" trigger="click" content-class="tool-privacy-info">
|
||||||
placement="right"
|
|
||||||
trigger="click"
|
|
||||||
content-class="tool-privacy-info"
|
|
||||||
>
|
|
||||||
<template #trigger>
|
<template #trigger>
|
||||||
<World
|
<World v-if="route.meta.externAccessDescription" class="tool-privacy-icon" />
|
||||||
v-if="route.meta.externAccessDescription"
|
<DeviceDesktop v-else class="tool-privacy-icon" />
|
||||||
class="tool-privacy-icon"
|
|
||||||
/>
|
|
||||||
<DeviceDesktop
|
|
||||||
v-else
|
|
||||||
class="tool-privacy-icon"
|
|
||||||
/>
|
|
||||||
</template>
|
</template>
|
||||||
<VueMarkdown
|
<VueMarkdown
|
||||||
v-if="route.meta.externAccessDescription"
|
v-if="route.meta.externAccessDescription"
|
||||||
:source="route.meta.externAccessDescription"
|
:source="route.meta.externAccessDescription as string"
|
||||||
:options="{ linkify: true }"
|
:options="{ linkify: true }"
|
||||||
/>
|
/>
|
||||||
<template v-else>
|
<template v-else>
|
||||||
@@ -139,7 +129,7 @@ const linkTheme = useTheme();
|
|||||||
<style lang="less">
|
<style lang="less">
|
||||||
.tool-privacy-info {
|
.tool-privacy-info {
|
||||||
p {
|
p {
|
||||||
margin:0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
a {
|
a {
|
||||||
color: inherit !important;
|
color: inherit !important;
|
||||||
@@ -151,7 +141,7 @@ const linkTheme = useTheme();
|
|||||||
<style lang="less" scoped>
|
<style lang="less" scoped>
|
||||||
.tool-privacy-icon {
|
.tool-privacy-icon {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
height: .6em;
|
height: 0.6em;
|
||||||
}
|
}
|
||||||
.tool-content {
|
.tool-content {
|
||||||
display: flex;
|
display: flex;
|
||||||
@@ -164,7 +154,7 @@ const linkTheme = useTheme();
|
|||||||
|
|
||||||
::v-deep(& > *) {
|
::v-deep(& > *) {
|
||||||
flex: 0 1 1200px;
|
flex: 0 1 1200px;
|
||||||
min-width:0;
|
min-width: 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -186,7 +176,7 @@ const linkTheme = useTheme();
|
|||||||
}
|
}
|
||||||
|
|
||||||
.separator {
|
.separator {
|
||||||
width:'100%';
|
width: '100%';
|
||||||
height: 2px;
|
height: 2px;
|
||||||
background: rgb(161, 161, 161);
|
background: rgb(161, 161, 161);
|
||||||
opacity: 0.2;
|
opacity: 0.2;
|
||||||
@@ -202,15 +192,15 @@ const linkTheme = useTheme();
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
.tool-footer {
|
.tool-footer {
|
||||||
opacity: 0.7;
|
opacity: 0.7;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
|
||||||
::v-deep(a) {
|
::v-deep(a) {
|
||||||
color: v-bind('themeVars.textColor1');
|
color: v-bind('themeVars.textColor1');
|
||||||
font-style: italic;
|
font-style: italic;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
::v-deep(.external-tool) a {
|
::v-deep(.external-tool) a {
|
||||||
line-height: inherit;
|
line-height: inherit;
|
||||||
font-family: inherit;
|
font-family: inherit;
|
||||||
|
|||||||
+7
-8
@@ -9,7 +9,9 @@ const { t } = useI18n();
|
|||||||
|
|
||||||
const toolStore = useToolStore();
|
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');
|
const title = t('about.text.about-it-tools');
|
||||||
useHead({
|
useHead({
|
||||||
title,
|
title,
|
||||||
@@ -17,7 +19,7 @@ useHead({
|
|||||||
{
|
{
|
||||||
itemprop: 'name',
|
itemprop: 'name',
|
||||||
content: title,
|
content: title,
|
||||||
},
|
} as never,
|
||||||
{
|
{
|
||||||
property: 'og:title',
|
property: 'og:title',
|
||||||
content: title,
|
content: title,
|
||||||
@@ -33,7 +35,7 @@ useHead({
|
|||||||
{
|
{
|
||||||
itemprop: 'description',
|
itemprop: 'description',
|
||||||
content: desc,
|
content: desc,
|
||||||
},
|
} as never,
|
||||||
{
|
{
|
||||||
property: 'og:description',
|
property: 'og:description',
|
||||||
content: desc,
|
content: desc,
|
||||||
@@ -54,8 +56,7 @@ function importFavorites() {
|
|||||||
try {
|
try {
|
||||||
favoriteToolsName.value = JSON.parse(importFavoritesJson.value);
|
favoriteToolsName.value = JSON.parse(importFavoritesJson.value);
|
||||||
message.success(t('about.favorites-imported-successfully'));
|
message.success(t('about.favorites-imported-successfully'));
|
||||||
}
|
} catch (e: any) {
|
||||||
catch (e: any) {
|
|
||||||
message.error(t('about.error-importing-favorites-e', [e]));
|
message.error(t('about.error-importing-favorites-e', [e]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -79,9 +80,7 @@ const favoritesJson = computed(() => JSON.stringify(favoriteToolsName.value));
|
|||||||
</n-card>
|
</n-card>
|
||||||
|
|
||||||
<n-card :title="$t('about.export-favorites')" mx-auto mt-50px>
|
<n-card :title="$t('about.export-favorites')" mx-auto mt-50px>
|
||||||
<textarea-copyable
|
<textarea-copyable v-model:value="favoritesJson" />
|
||||||
v-model:value="favoritesJson"
|
|
||||||
/>
|
|
||||||
</n-card>
|
</n-card>
|
||||||
|
|
||||||
<n-card :title="$t('about.alltools-title', { toolsCount: toolStore.tools.length })" mx-auto mt-50px>
|
<n-card :title="$t('about.alltools-title', { toolsCount: toolStore.tools.length })" mx-auto mt-50px>
|
||||||
|
|||||||
@@ -12,7 +12,9 @@ import { config } from '@/config';
|
|||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
|
||||||
const toolStore = useToolStore();
|
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');
|
const title = t('home.page.text.it-tools-handy-online-tools-for-developers');
|
||||||
|
|
||||||
useHead({
|
useHead({
|
||||||
@@ -21,7 +23,7 @@ useHead({
|
|||||||
{
|
{
|
||||||
itemprop: 'name',
|
itemprop: 'name',
|
||||||
content: title,
|
content: title,
|
||||||
},
|
} as never,
|
||||||
{
|
{
|
||||||
property: 'og:title',
|
property: 'og:title',
|
||||||
content: title,
|
content: title,
|
||||||
@@ -37,7 +39,7 @@ useHead({
|
|||||||
{
|
{
|
||||||
itemprop: 'description',
|
itemprop: 'description',
|
||||||
content: desc,
|
content: desc,
|
||||||
},
|
} as never,
|
||||||
{
|
{
|
||||||
property: 'og:description',
|
property: 'og:description',
|
||||||
content: desc,
|
content: desc,
|
||||||
@@ -87,10 +89,7 @@ const visibleTools = computed(() => {
|
|||||||
// Function to load next batch
|
// Function to load next batch
|
||||||
function loadNextBatch() {
|
function loadNextBatch() {
|
||||||
if (visibleToolsCount.value < toolStore.tools.length) {
|
if (visibleToolsCount.value < toolStore.tools.length) {
|
||||||
visibleToolsCount.value = Math.min(
|
visibleToolsCount.value = Math.min(visibleToolsCount.value + TOOLS_PER_BATCH, toolStore.tools.length);
|
||||||
visibleToolsCount.value + TOOLS_PER_BATCH,
|
|
||||||
toolStore.tools.length,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -136,7 +135,8 @@ onUnmounted(() => {
|
|||||||
rel="noopener"
|
rel="noopener"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
:aria-label="$t('home.follow.githubRepository')"
|
:aria-label="$t('home.follow.githubRepository')"
|
||||||
>GitHub</a>
|
>GitHub</a
|
||||||
|
>
|
||||||
{{ $t('home.follow.thankYou') }}
|
{{ $t('home.follow.thankYou') }}
|
||||||
<n-icon :component="IconHeart" />
|
<n-icon :component="IconHeart" />
|
||||||
</ColoredCard>
|
</ColoredCard>
|
||||||
@@ -228,7 +228,7 @@ onUnmounted(() => {
|
|||||||
}
|
}
|
||||||
100% {
|
100% {
|
||||||
opacity: 0.4;
|
opacity: 0.4;
|
||||||
transform: scale(1.0);
|
transform: scale(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
@@ -8,19 +8,25 @@ const { t } = useI18n();
|
|||||||
declare global {
|
declare global {
|
||||||
interface Window {
|
interface Window {
|
||||||
generateX25519Identity: () => {
|
generateX25519Identity: () => {
|
||||||
privateKey: string
|
privateKey: string;
|
||||||
publicKey: string
|
publicKey: string;
|
||||||
}
|
};
|
||||||
encrypt: (publicKeys: string, message: string) => {
|
encrypt: (
|
||||||
error?: string
|
publicKeys: string,
|
||||||
output: string
|
message: string,
|
||||||
}
|
) => {
|
||||||
decrypt: (privateKeys: string, message: string) => {
|
error?: string;
|
||||||
error?: string
|
output: string;
|
||||||
output: string
|
};
|
||||||
}
|
decrypt: (
|
||||||
encryptBinary: (publicKeys: string, buffer: Uint8Array) => string | Uint8Array
|
privateKeys: string,
|
||||||
decryptBinary: (privateKeys: string, buffer: Uint8Array) => string | Uint8Array
|
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) {
|
function downloadBlob(data: Uint8Array, fileName: string) {
|
||||||
const blob = new Blob([data], {
|
const blob = new Blob([new Uint8Array(data)], {
|
||||||
type: 'application/octet-stream',
|
type: 'application/octet-stream',
|
||||||
});
|
});
|
||||||
const url = window.URL.createObjectURL(blob);
|
const url = window.URL.createObjectURL(blob);
|
||||||
@@ -91,8 +97,7 @@ function encrypt() {
|
|||||||
const result = window.encrypt(recipients.value, message.value);
|
const result = window.encrypt(recipients.value, message.value);
|
||||||
if (result.error) {
|
if (result.error) {
|
||||||
error.value = result.error;
|
error.value = result.error;
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
encryptedOutput.value = result.output;
|
encryptedOutput.value = result.output;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -111,8 +116,7 @@ function encryptBinary() {
|
|||||||
const result = window.encryptBinary(recipientsBinary.value, buffer);
|
const result = window.encryptBinary(recipientsBinary.value, buffer);
|
||||||
if (typeof result === 'string') {
|
if (typeof result === 'string') {
|
||||||
error.value = result;
|
error.value = result;
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
downloadBlob(result, `${f.name}.age`);
|
downloadBlob(result, `${f.name}.age`);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -127,8 +131,7 @@ function decrypt() {
|
|||||||
const result = window.decrypt(identities.value, encryptedText.value);
|
const result = window.decrypt(identities.value, encryptedText.value);
|
||||||
if (result.error) {
|
if (result.error) {
|
||||||
error.value = result.error;
|
error.value = result.error;
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
decryptedOutput.value = result.output;
|
decryptedOutput.value = result.output;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -147,8 +150,7 @@ function decryptBinary() {
|
|||||||
const result = window.decryptBinary(identitiesBinary.value, buffer);
|
const result = window.decryptBinary(identitiesBinary.value, buffer);
|
||||||
if (typeof result === 'string') {
|
if (typeof result === 'string') {
|
||||||
error.value = result;
|
error.value = result;
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
downloadBlob(result, f.name.replace('.age', ''));
|
downloadBlob(result, f.name.replace('.age', ''));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -171,10 +173,20 @@ function onDecryptFilesUploaded(uploadedFiles: File[]) {
|
|||||||
<!-- Generate Keys -->
|
<!-- Generate Keys -->
|
||||||
<n-tab-pane name="keys" :tab="t('tools.age-crypto.text.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>
|
<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>
|
||||||
<n-card :title="t('tools.age-crypto.texts.title-public-key')" mb-1>
|
<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-card>
|
||||||
<n-button type="primary" @click="generateKeys">
|
<n-button type="primary" @click="generateKeys">
|
||||||
{{ t('tools.age-crypto.texts.tag-generate-keys') }}
|
{{ t('tools.age-crypto.texts.tag-generate-keys') }}
|
||||||
@@ -184,13 +196,28 @@ function onDecryptFilesUploaded(uploadedFiles: File[]) {
|
|||||||
<!-- Encrypt Text -->
|
<!-- Encrypt Text -->
|
||||||
<n-tab-pane name="encrypt" :tab="t('tools.age-crypto.text.encrypt')">
|
<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-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>
|
||||||
<n-card :title="t('tools.age-crypto.texts.title-message')" mb-1>
|
<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>
|
||||||
<n-card :title="t('tools.age-crypto.texts.title-output')" mb-1>
|
<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-card>
|
||||||
<n-button type="primary" @click="encrypt">
|
<n-button type="primary" @click="encrypt">
|
||||||
{{ t('tools.age-crypto.texts.tag-encrypt') }}
|
{{ t('tools.age-crypto.texts.tag-encrypt') }}
|
||||||
@@ -200,7 +227,12 @@ function onDecryptFilesUploaded(uploadedFiles: File[]) {
|
|||||||
<!-- Encrypt Binary -->
|
<!-- Encrypt Binary -->
|
||||||
<n-tab-pane name="encryptBinary" :tab="t('tools.age-crypto.text.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-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>
|
||||||
<n-card :title="t('tools.age-crypto.texts.title-files')" mb-1>
|
<n-card :title="t('tools.age-crypto.texts.title-files')" mb-1>
|
||||||
<c-file-upload
|
<c-file-upload
|
||||||
@@ -225,13 +257,28 @@ function onDecryptFilesUploaded(uploadedFiles: File[]) {
|
|||||||
<!-- Decrypt Text -->
|
<!-- Decrypt Text -->
|
||||||
<n-tab-pane name="decrypt" :tab="t('tools.age-crypto.text.decrypt')">
|
<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-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>
|
||||||
<n-card :title="t('tools.age-crypto.texts.title-encrypted-text')" mb-1>
|
<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>
|
||||||
<n-card :title="t('tools.age-crypto.texts.title-output')" mb-1>
|
<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-card>
|
||||||
<n-button type="primary" @click="decrypt">
|
<n-button type="primary" @click="decrypt">
|
||||||
{{ t('tools.age-crypto.texts.tag-decrypt') }}
|
{{ t('tools.age-crypto.texts.tag-decrypt') }}
|
||||||
@@ -241,7 +288,12 @@ function onDecryptFilesUploaded(uploadedFiles: File[]) {
|
|||||||
<!-- Decrypt Binary -->
|
<!-- Decrypt Binary -->
|
||||||
<n-tab-pane name="decryptBinary" :tab="t('tools.age-crypto.text.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-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>
|
||||||
<n-card :title="t('tools.age-crypto.texts.title-encrypted-files')" mb-1>
|
<n-card :title="t('tools.age-crypto.texts.title-encrypted-files')" mb-1>
|
||||||
<c-file-upload
|
<c-file-upload
|
||||||
|
|||||||
@@ -11,25 +11,184 @@ const amortizationCalculator = ref(new StandardAmortizationCalculator());
|
|||||||
|
|
||||||
const currencyDisplayNames = computed(() => new Intl.DisplayNames(locale.value, { type: 'currency' }));
|
const currencyDisplayNames = computed(() => new Intl.DisplayNames(locale.value, { type: 'currency' }));
|
||||||
|
|
||||||
const historicalCodes = ['AFA', 'FIM', 'ALK', 'ADP', 'ESP', 'FRF', 'AOK', 'AON', 'AOR', 'ARA', 'ARP', 'ARY',
|
const historicalCodes = [
|
||||||
'RUR', 'ATS', 'AYM', 'AZM', 'RUR', 'BYB', 'BYR', 'RUR', 'BEC', 'BEF', 'BEL', 'BOP', 'BAD', 'BRB', 'BRC',
|
'AFA',
|
||||||
'BRE', 'BRN', 'BRR', 'BGJ', 'BGK', 'BGL', 'BGN', 'BUK', 'HRD', 'HRK', 'HRK', 'CUC', 'ANG', 'CYP', 'CSJ',
|
'FIM',
|
||||||
'CSK', 'ECS', 'ECV', 'GQE', 'EEK', 'XEU', 'FIM', 'FRF', 'FRF', 'FRF', 'GEK', 'RUR', 'DDM', 'DEM', 'GHC',
|
'ALK',
|
||||||
'GHP', 'GRD', 'FRF', 'GNE', 'GNS', 'GWE', 'GWP', 'ITL', 'ISJ', 'IEP', 'ILP', 'ILR', 'ITL', 'RUR', 'RUR',
|
'ADP',
|
||||||
'LAJ', 'LVL', 'LVR', 'LSM', 'ZAL', 'LTL', 'LTT', 'LUC', 'LUF', 'LUL', 'MGF', 'MWK', 'MVQ', 'MLF', 'MTL',
|
'ESP',
|
||||||
'MTP', 'FRF', 'MRO', 'FRF', 'MXP', 'RUR', 'FRF', 'MZE', 'MZM', 'NLG', 'ANG', 'NIC', 'PEH', 'PEI', 'PEN',
|
'FRF',
|
||||||
'PES', 'PLZ', 'PTE', 'FRF', 'ROK', 'ROL', 'RON', 'RUR', 'FRF', 'FRF', 'FRF', 'ITL', 'STD', 'CSD', 'EUR',
|
'AOK',
|
||||||
'SLL', 'ANG', 'SKK', 'SIT', 'ZAL', 'SDG', 'RHD', 'ESA', 'ESB', 'ESP', 'SDD', 'SDP', 'SRG', 'SZL', 'CHC',
|
'AON',
|
||||||
'RUR', 'TJR', 'IDR', 'TPE', 'TRL', 'TRY', 'RUR', 'TMM', 'UGS', 'UGW', 'UAK', 'SUR', 'USS', 'UYN', 'UYP',
|
'AOR',
|
||||||
'RUR', 'VEB', 'VEF', 'VEF', 'VEF', 'VNC', 'YDD', 'YUD', 'YUM', 'YUN', 'ZRN', 'ZRZ', 'ZMK', 'ZWC', 'ZWD',
|
'ARA',
|
||||||
'ZWD', 'ZWN', 'ZWR', 'ZWL', 'XFO', 'XRE', 'XFU'];
|
'ARP',
|
||||||
|
'ARY',
|
||||||
|
'RUR',
|
||||||
|
'ATS',
|
||||||
|
'AYM',
|
||||||
|
'AZM',
|
||||||
|
'RUR',
|
||||||
|
'BYB',
|
||||||
|
'BYR',
|
||||||
|
'RUR',
|
||||||
|
'BEC',
|
||||||
|
'BEF',
|
||||||
|
'BEL',
|
||||||
|
'BOP',
|
||||||
|
'BAD',
|
||||||
|
'BRB',
|
||||||
|
'BRC',
|
||||||
|
'BRE',
|
||||||
|
'BRN',
|
||||||
|
'BRR',
|
||||||
|
'BGJ',
|
||||||
|
'BGK',
|
||||||
|
'BGL',
|
||||||
|
'BGN',
|
||||||
|
'BUK',
|
||||||
|
'HRD',
|
||||||
|
'HRK',
|
||||||
|
'HRK',
|
||||||
|
'CUC',
|
||||||
|
'ANG',
|
||||||
|
'CYP',
|
||||||
|
'CSJ',
|
||||||
|
'CSK',
|
||||||
|
'ECS',
|
||||||
|
'ECV',
|
||||||
|
'GQE',
|
||||||
|
'EEK',
|
||||||
|
'XEU',
|
||||||
|
'FIM',
|
||||||
|
'FRF',
|
||||||
|
'FRF',
|
||||||
|
'FRF',
|
||||||
|
'GEK',
|
||||||
|
'RUR',
|
||||||
|
'DDM',
|
||||||
|
'DEM',
|
||||||
|
'GHC',
|
||||||
|
'GHP',
|
||||||
|
'GRD',
|
||||||
|
'FRF',
|
||||||
|
'GNE',
|
||||||
|
'GNS',
|
||||||
|
'GWE',
|
||||||
|
'GWP',
|
||||||
|
'ITL',
|
||||||
|
'ISJ',
|
||||||
|
'IEP',
|
||||||
|
'ILP',
|
||||||
|
'ILR',
|
||||||
|
'ITL',
|
||||||
|
'RUR',
|
||||||
|
'RUR',
|
||||||
|
'LAJ',
|
||||||
|
'LVL',
|
||||||
|
'LVR',
|
||||||
|
'LSM',
|
||||||
|
'ZAL',
|
||||||
|
'LTL',
|
||||||
|
'LTT',
|
||||||
|
'LUC',
|
||||||
|
'LUF',
|
||||||
|
'LUL',
|
||||||
|
'MGF',
|
||||||
|
'MWK',
|
||||||
|
'MVQ',
|
||||||
|
'MLF',
|
||||||
|
'MTL',
|
||||||
|
'MTP',
|
||||||
|
'FRF',
|
||||||
|
'MRO',
|
||||||
|
'FRF',
|
||||||
|
'MXP',
|
||||||
|
'RUR',
|
||||||
|
'FRF',
|
||||||
|
'MZE',
|
||||||
|
'MZM',
|
||||||
|
'NLG',
|
||||||
|
'ANG',
|
||||||
|
'NIC',
|
||||||
|
'PEH',
|
||||||
|
'PEI',
|
||||||
|
'PEN',
|
||||||
|
'PES',
|
||||||
|
'PLZ',
|
||||||
|
'PTE',
|
||||||
|
'FRF',
|
||||||
|
'ROK',
|
||||||
|
'ROL',
|
||||||
|
'RON',
|
||||||
|
'RUR',
|
||||||
|
'FRF',
|
||||||
|
'FRF',
|
||||||
|
'FRF',
|
||||||
|
'ITL',
|
||||||
|
'STD',
|
||||||
|
'CSD',
|
||||||
|
'EUR',
|
||||||
|
'SLL',
|
||||||
|
'ANG',
|
||||||
|
'SKK',
|
||||||
|
'SIT',
|
||||||
|
'ZAL',
|
||||||
|
'SDG',
|
||||||
|
'RHD',
|
||||||
|
'ESA',
|
||||||
|
'ESB',
|
||||||
|
'ESP',
|
||||||
|
'SDD',
|
||||||
|
'SDP',
|
||||||
|
'SRG',
|
||||||
|
'SZL',
|
||||||
|
'CHC',
|
||||||
|
'RUR',
|
||||||
|
'TJR',
|
||||||
|
'IDR',
|
||||||
|
'TPE',
|
||||||
|
'TRL',
|
||||||
|
'TRY',
|
||||||
|
'RUR',
|
||||||
|
'TMM',
|
||||||
|
'UGS',
|
||||||
|
'UGW',
|
||||||
|
'UAK',
|
||||||
|
'SUR',
|
||||||
|
'USS',
|
||||||
|
'UYN',
|
||||||
|
'UYP',
|
||||||
|
'RUR',
|
||||||
|
'VEB',
|
||||||
|
'VEF',
|
||||||
|
'VEF',
|
||||||
|
'VEF',
|
||||||
|
'VNC',
|
||||||
|
'YDD',
|
||||||
|
'YUD',
|
||||||
|
'YUM',
|
||||||
|
'YUN',
|
||||||
|
'ZRN',
|
||||||
|
'ZRZ',
|
||||||
|
'ZMK',
|
||||||
|
'ZWC',
|
||||||
|
'ZWD',
|
||||||
|
'ZWD',
|
||||||
|
'ZWN',
|
||||||
|
'ZWR',
|
||||||
|
'ZWL',
|
||||||
|
'XFO',
|
||||||
|
'XRE',
|
||||||
|
'XFU',
|
||||||
|
];
|
||||||
|
|
||||||
const supportedCurrencies = ref(
|
const supportedCurrencies = ref(
|
||||||
Intl.supportedValuesOf('currency')
|
Intl.supportedValuesOf('currency')
|
||||||
.filter(value => !historicalCodes.includes(value))
|
.filter((value) => !historicalCodes.includes(value))
|
||||||
.map(value => ({
|
.map((value) => ({
|
||||||
value,
|
value,
|
||||||
label: currencyDisplayNames.value.of(value),
|
label: currencyDisplayNames.value.of(value) ?? value,
|
||||||
})),
|
})),
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -151,7 +310,12 @@ function formatCurrency(num: number): string {
|
|||||||
:validation="interestRateValidation"
|
: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>
|
</c-card>
|
||||||
|
|
||||||
<div v-if="allValid">
|
<div v-if="allValid">
|
||||||
|
|||||||
@@ -12,5 +12,5 @@ const supportedUnits = {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<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>
|
</template>
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import figlet from 'figlet';
|
import figlet, { type FigletOptions, type FontName } from 'figlet';
|
||||||
import TextareaCopyable from '@/components/TextareaCopyable.vue';
|
import TextareaCopyable from '@/components/TextareaCopyable.vue';
|
||||||
import { languages, printToLanguage } from '@/utils/ascii-lang-utils';
|
import { languages, printToLanguage } from '@/utils/ascii-lang-utils';
|
||||||
import { useITStorage } from '@/composable/queryParams';
|
import { useITStorage } from '@/composable/queryParams';
|
||||||
@@ -17,7 +17,7 @@ const base = import.meta.env.BASE_URL ?? '/';
|
|||||||
|
|
||||||
figlet.defaults({ fontPath: `${base}figlet-fonts` });
|
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 () => {
|
watchEffect(async () => {
|
||||||
const inputValue = input.value;
|
const inputValue = input.value;
|
||||||
@@ -26,32 +26,319 @@ watchEffect(async () => {
|
|||||||
const widthValue = width.value;
|
const widthValue = width.value;
|
||||||
processing.value = true;
|
processing.value = true;
|
||||||
try {
|
try {
|
||||||
const options: figlet.FigletOptions = {
|
const options: FigletOptions = {
|
||||||
font: fontValue as figlet.FontName,
|
font: fontValue as FontName,
|
||||||
width: widthValue,
|
width: widthValue,
|
||||||
whitespaceBreak: true,
|
whitespaceBreak: true,
|
||||||
};
|
};
|
||||||
const rawOutput = await (new Promise<string>((resolve, reject) =>
|
const rawOutput = await new Promise<string>((resolve, reject) =>
|
||||||
figlet.text(inputValue, options,
|
figlet.text(inputValue, options, (err, text) => {
|
||||||
(err, text) => {
|
if (err) {
|
||||||
if (err) {
|
reject(err);
|
||||||
reject(err);
|
return;
|
||||||
return;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
resolve(text ?? '');
|
resolve(text ?? '');
|
||||||
})));
|
}),
|
||||||
|
);
|
||||||
|
|
||||||
output.value = printToLanguage(rawOutput, languageValue);
|
output.value = printToLanguage(rawOutput, languageValue);
|
||||||
errored.value = false;
|
errored.value = false;
|
||||||
}
|
} catch (e: any) {
|
||||||
catch (e: any) {
|
|
||||||
errored.value = true;
|
errored.value = true;
|
||||||
}
|
}
|
||||||
processing.value = false;
|
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>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
@@ -75,13 +362,24 @@ const fonts = ['1Row', '3-D', '3D Diagonal', '3D-ASCII', '3x5', '4Max', '5 Line
|
|||||||
label-position="top"
|
label-position="top"
|
||||||
:label="t('tools.ascii-text-drawer.font')"
|
:label="t('tools.ascii-text-drawer.font')"
|
||||||
:options="fonts"
|
:options="fonts"
|
||||||
searchable="true"
|
searchable
|
||||||
:placeholder="t('tools.ascii-text-drawer.texts.placeholder-select-font-to-use')"
|
:placeholder="t('tools.ascii-text-drawer.texts.placeholder-select-font-to-use')"
|
||||||
/>
|
/>
|
||||||
</n-gi>
|
</n-gi>
|
||||||
<n-gi span="2">
|
<n-gi span="2">
|
||||||
<n-form-item :label="t('tools.ascii-text-drawer.width')" label-placement="top" label-width="100" :show-feedback="false">
|
<n-form-item
|
||||||
<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')" />
|
: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-form-item>
|
||||||
</n-gi>
|
</n-gi>
|
||||||
</n-grid>
|
</n-grid>
|
||||||
@@ -98,11 +396,7 @@ const fonts = ['1Row', '3-D', '3D Diagonal', '3D-ASCII', '3x5', '4Max', '5 Line
|
|||||||
</c-alert>
|
</c-alert>
|
||||||
|
|
||||||
<n-form-item v-if="!processing && !errored" :label="t('tools.ascii-text-drawer.output')">
|
<n-form-item v-if="!processing && !errored" :label="t('tools.ascii-text-drawer.output')">
|
||||||
<TextareaCopyable
|
<TextareaCopyable :value="output" mb-1 mt-1 copy-placement="outside" />
|
||||||
:value="output"
|
|
||||||
mb-1 mt-1
|
|
||||||
copy-placement="outside"
|
|
||||||
/>
|
|
||||||
</n-form-item>
|
</n-form-item>
|
||||||
</c-card>
|
</c-card>
|
||||||
</template>
|
</template>
|
||||||
@@ -21,7 +21,7 @@ function checkProgressAndGetResult<T>(updates: Update<T>[]) {
|
|||||||
const last = updates.at(-1);
|
const last = updates.at(-1);
|
||||||
const allExceptLast = updates.slice(0, -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(first).toEqual({ kind: 'progress', progress: 0 });
|
||||||
expect(penultimate).toEqual({ kind: 'progress', progress: 1 });
|
expect(penultimate).toEqual({ kind: 'progress', progress: 1 });
|
||||||
|
|
||||||
@@ -31,7 +31,7 @@ function checkProgressAndGetResult<T>(updates: Update<T>[]) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
describe('bcrypt models', () => {
|
describe('bcrypt models', () => {
|
||||||
describe(bcryptWithProgressUpdates.name, () => {
|
describe('bcryptWithProgressUpdates', () => {
|
||||||
test('with bcrypt hash function', async () => {
|
test('with bcrypt hash function', async () => {
|
||||||
const updates = await fromAsync(bcryptWithProgressUpdates(hash, ['abc', 5]));
|
const updates = await fromAsync(bcryptWithProgressUpdates(hash, ['abc', 5]));
|
||||||
const result = checkProgressAndGetResult(updates);
|
const result = checkProgressAndGetResult(updates);
|
||||||
|
|||||||
+69
-49
@@ -24,11 +24,11 @@ const encodeError = ref('');
|
|||||||
const bechOutput = ref('');
|
const bechOutput = ref('');
|
||||||
|
|
||||||
interface DecodedRow {
|
interface DecodedRow {
|
||||||
input: string
|
input: string;
|
||||||
hrp: string
|
hrp: string;
|
||||||
variant: string
|
variant: string;
|
||||||
hex: string
|
hex: string;
|
||||||
status: string
|
status: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Batch state
|
// Batch state
|
||||||
@@ -37,7 +37,10 @@ const batchRows = ref<DecodedRow[]>([]);
|
|||||||
|
|
||||||
// Helpers
|
// Helpers
|
||||||
function wordsToHex(words: number[]): string {
|
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[] {
|
function hexToWords(hex: string): number[] {
|
||||||
@@ -46,15 +49,14 @@ function hexToWords(hex: string): number[] {
|
|||||||
throw new Error(t('tools.bech32.texts.invalid-hex-payload'));
|
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) {
|
function detectVariant(input: string) {
|
||||||
try {
|
try {
|
||||||
const r = bech32.decode(input);
|
const r = bech32.decode(input);
|
||||||
return { variant: 'bech32', ...r };
|
return { variant: 'bech32', ...r };
|
||||||
}
|
} catch {}
|
||||||
catch {}
|
|
||||||
const r = bech32m.decode(input);
|
const r = bech32m.decode(input);
|
||||||
return { variant: 'bech32m', ...r };
|
return { variant: 'bech32m', ...r };
|
||||||
}
|
}
|
||||||
@@ -79,8 +81,7 @@ function decode() {
|
|||||||
decodedHex.value = wordsToHex(res.words);
|
decodedHex.value = wordsToHex(res.words);
|
||||||
detectedVariant.value = res.variant;
|
detectedVariant.value = res.variant;
|
||||||
checksumValid.value = true;
|
checksumValid.value = true;
|
||||||
}
|
} catch (err: any) {
|
||||||
catch (err: any) {
|
|
||||||
checksumValid.value = false;
|
checksumValid.value = false;
|
||||||
decodeError.value = err.toString();
|
decodeError.value = err.toString();
|
||||||
}
|
}
|
||||||
@@ -91,15 +92,16 @@ function validateChecksum() {
|
|||||||
const input = bechInput.value.trim();
|
const input = bechInput.value.trim();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
autoDetect.value
|
if (autoDetect.value) {
|
||||||
? detectVariant(input)
|
detectVariant(input);
|
||||||
: encodingVariant.value === 'bech32'
|
} else if (encodingVariant.value === 'bech32') {
|
||||||
? bech32.decode(input)
|
bech32.decode(input);
|
||||||
: bech32m.decode(input);
|
} else {
|
||||||
|
bech32m.decode(input);
|
||||||
|
}
|
||||||
|
|
||||||
checksumValid.value = true;
|
checksumValid.value = true;
|
||||||
}
|
} catch (err: any) {
|
||||||
catch (err: any) {
|
|
||||||
checksumValid.value = false;
|
checksumValid.value = false;
|
||||||
decodeError.value = err.toString();
|
decodeError.value = err.toString();
|
||||||
}
|
}
|
||||||
@@ -108,14 +110,10 @@ function validateChecksum() {
|
|||||||
function encode() {
|
function encode() {
|
||||||
try {
|
try {
|
||||||
const words = hexToWords(hexPayload.value);
|
const words = hexToWords(hexPayload.value);
|
||||||
const enc
|
const enc = encodingVariant.value === 'bech32' ? bech32.encode(hrp.value, words) : bech32m.encode(hrp.value, words);
|
||||||
= encodingVariant.value === 'bech32'
|
|
||||||
? bech32.encode(hrp.value, words)
|
|
||||||
: bech32m.encode(hrp.value, words);
|
|
||||||
|
|
||||||
bechOutput.value = enc;
|
bechOutput.value = enc;
|
||||||
}
|
} catch (err: any) {
|
||||||
catch (err: any) {
|
|
||||||
encodeError.value = err.toString();
|
encodeError.value = err.toString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -123,7 +121,7 @@ function encode() {
|
|||||||
function batchConvert() {
|
function batchConvert() {
|
||||||
const lines = batchInput.value
|
const lines = batchInput.value
|
||||||
.split('\n')
|
.split('\n')
|
||||||
.map(l => l.trim())
|
.map((l) => l.trim())
|
||||||
.filter(Boolean);
|
.filter(Boolean);
|
||||||
|
|
||||||
const rows: DecodedRow[] = [];
|
const rows: DecodedRow[] = [];
|
||||||
@@ -138,8 +136,7 @@ function batchConvert() {
|
|||||||
hex: wordsToHex(r.words),
|
hex: wordsToHex(r.words),
|
||||||
status: 'OK',
|
status: 'OK',
|
||||||
});
|
});
|
||||||
}
|
} catch (err: any) {
|
||||||
catch (err: any) {
|
|
||||||
rows.push({
|
rows.push({
|
||||||
input: line,
|
input: line,
|
||||||
hrp: '',
|
hrp: '',
|
||||||
@@ -165,18 +162,9 @@ function exportCsv() {
|
|||||||
t('tools.bech32.texts.hex'),
|
t('tools.bech32.texts.hex'),
|
||||||
t('tools.bech32.texts.status'),
|
t('tools.bech32.texts.status'),
|
||||||
];
|
];
|
||||||
const rows = batchRows.value.map(r => [
|
const rows = batchRows.value.map((r) => [r.input, r.hrp, r.variant, r.hex, r.status]);
|
||||||
r.input,
|
|
||||||
r.hrp,
|
|
||||||
r.variant,
|
|
||||||
r.hex,
|
|
||||||
r.status,
|
|
||||||
]);
|
|
||||||
|
|
||||||
const csv
|
const csv = `${header.join(',')}\n${rows.map((r) => r.map((v) => `"${v}"`).join(',')).join('\n')}`;
|
||||||
= `${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 blob = new Blob([csv], { type: 'text/csv;charset=utf-8;' });
|
||||||
const url = URL.createObjectURL(blob);
|
const url = URL.createObjectURL(blob);
|
||||||
@@ -234,10 +222,7 @@ function exportCsv() {
|
|||||||
</n-space>
|
</n-space>
|
||||||
|
|
||||||
<n-space justify="center" mb-2>
|
<n-space justify="center" mb-2>
|
||||||
<n-button
|
<n-button type="primary" @click="checksumOnly ? validateChecksum() : decode()">
|
||||||
type="primary"
|
|
||||||
@click="checksumOnly ? validateChecksum() : decode()"
|
|
||||||
>
|
|
||||||
{{ checksumOnly ? 'Validate' : 'Decode' }}
|
{{ checksumOnly ? 'Validate' : 'Decode' }}
|
||||||
</n-button>
|
</n-button>
|
||||||
</n-space>
|
</n-space>
|
||||||
@@ -254,18 +239,47 @@ function exportCsv() {
|
|||||||
</c-alert>
|
</c-alert>
|
||||||
|
|
||||||
<div v-if="decodedHex">
|
<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
|
||||||
<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')" />
|
v-model:value="decodedHrp"
|
||||||
<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')" />
|
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>
|
</div>
|
||||||
</n-tab-pane>
|
</n-tab-pane>
|
||||||
|
|
||||||
<!-- ENCODE TAB -->
|
<!-- ENCODE TAB -->
|
||||||
<n-tab-pane name="encode" :tab="t('tools.bech32.texts.tab-encode')">
|
<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
|
<c-input-text
|
||||||
v-model:value="hexPayload"
|
v-model:value="hexPayload"
|
||||||
label-position="left" label-width="110px"
|
label-position="left"
|
||||||
|
label-width="110px"
|
||||||
:label="t('tools.bech32.texts.label-payload')"
|
:label="t('tools.bech32.texts.label-payload')"
|
||||||
:placeholder="t('tools.bech32.texts.placeholder-hex-payload')"
|
:placeholder="t('tools.bech32.texts.placeholder-hex-payload')"
|
||||||
mb-1
|
mb-1
|
||||||
@@ -273,7 +287,8 @@ function exportCsv() {
|
|||||||
|
|
||||||
<c-select
|
<c-select
|
||||||
v-model:value="encodingVariant"
|
v-model:value="encodingVariant"
|
||||||
label-position="left" label-width="110px"
|
label-position="left"
|
||||||
|
label-width="110px"
|
||||||
:label="t('tools.bech32.texts.label-variant')"
|
:label="t('tools.bech32.texts.label-variant')"
|
||||||
:options="[
|
:options="[
|
||||||
{ label: t('tools.bech32.texts.label-bech32'), value: 'bech32' },
|
{ label: t('tools.bech32.texts.label-bech32'), value: 'bech32' },
|
||||||
@@ -293,7 +308,12 @@ function exportCsv() {
|
|||||||
</c-alert>
|
</c-alert>
|
||||||
|
|
||||||
<div v-else>
|
<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>
|
</div>
|
||||||
</n-tab-pane>
|
</n-tab-pane>
|
||||||
|
|
||||||
|
|||||||
@@ -23,13 +23,17 @@ import { useValidation } from '@/composable/validation';
|
|||||||
|
|
||||||
const { t } = useI18n();
|
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({
|
const cleaningRegexValidation = useValidation({
|
||||||
source: cleaningRegex,
|
source: cleaningRegex,
|
||||||
rules: [
|
rules: [
|
||||||
{
|
{
|
||||||
message: t('tools.case-converter.texts.message-invalid-cleaning-regex-0'),
|
message: t('tools.case-converter.texts.message-invalid-cleaning-regex-0'),
|
||||||
validator: value => new RegExp(value),
|
validator: (value) => new RegExp(value),
|
||||||
getErrorMessage: (value) => {
|
getErrorMessage: (value) => {
|
||||||
const _ = new RegExp(value);
|
const _ = new RegExp(value);
|
||||||
return '';
|
return '';
|
||||||
@@ -49,74 +53,76 @@ const inputCleaned = computed(() => {
|
|||||||
const formats = computed(() => [
|
const formats = computed(() => [
|
||||||
{
|
{
|
||||||
label: t('tools.case-converter.texts.label-lowercase'),
|
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'),
|
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'),
|
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'),
|
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'),
|
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'),
|
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'),
|
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'),
|
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'),
|
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'),
|
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'),
|
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'),
|
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'),
|
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'),
|
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'),
|
label: t('tools.case-converter.texts.label-mockingcase'),
|
||||||
value: inputCleaned.value.map(s => s
|
value: inputCleaned.value.map((s) =>
|
||||||
.split('')
|
s
|
||||||
.map((char, index) => (index % 2 === 0 ? char.toUpperCase() : char.toLowerCase()))
|
.split('')
|
||||||
.join('')),
|
.map((char, index) => (index % 2 === 0 ? char.toUpperCase() : char.toLowerCase()))
|
||||||
|
.join(''),
|
||||||
|
),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: t('tools.case-converter.texts.label-spongecase'),
|
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'),
|
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',
|
labelPosition: 'left',
|
||||||
labelWidth: '125px',
|
labelWidth: '125px',
|
||||||
labelAlign: 'right',
|
labelAlign: 'right',
|
||||||
};
|
} as const;
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
@@ -156,7 +162,8 @@ const inputLabelAlignmentConfig = {
|
|||||||
:value="format.value?.join('\n')"
|
:value="format.value?.join('\n')"
|
||||||
:label="format.label"
|
:label="format.label"
|
||||||
v-bind="inputLabelAlignmentConfig"
|
v-bind="inputLabelAlignmentConfig"
|
||||||
multiline mb-1
|
multiline
|
||||||
|
mb-1
|
||||||
/>
|
/>
|
||||||
</c-card>
|
</c-card>
|
||||||
</template>
|
</template>
|
||||||
@@ -1,10 +1,4 @@
|
|||||||
import type {
|
import type { AlgorithmHashType, Certificate, Fingerprint, Key, PrivateKey, Signature } from 'sshpk';
|
||||||
AlgorithmHashType,
|
|
||||||
Certificate,
|
|
||||||
Fingerprint,
|
|
||||||
Key,
|
|
||||||
PrivateKey, Signature,
|
|
||||||
} from 'sshpk';
|
|
||||||
import 'webcrypto-liner-shim';
|
import 'webcrypto-liner-shim';
|
||||||
import type * as openpgp from 'openpgp';
|
import type * as openpgp from 'openpgp';
|
||||||
import * as forge from 'node-forge';
|
import * as forge from 'node-forge';
|
||||||
@@ -13,24 +7,22 @@ import oids from './oids.json';
|
|||||||
import { translate as t } from '@/plugins/i18n.plugin';
|
import { translate as t } from '@/plugins/i18n.plugin';
|
||||||
|
|
||||||
export interface LabelValue {
|
export interface LabelValue {
|
||||||
label: string
|
label: string;
|
||||||
value: string
|
value: string;
|
||||||
multiline?: boolean
|
multiline?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
function onErrorReturnErrorMessage(func: () => any) {
|
function onErrorReturnErrorMessage(func: () => any) {
|
||||||
try {
|
try {
|
||||||
return func();
|
return func();
|
||||||
}
|
} catch (e: any) {
|
||||||
catch (e: any) {
|
|
||||||
return e.toString();
|
return e.toString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function buf2Hex(buffer: ArrayBuffer) { // buffer is an ArrayBuffer
|
function buf2Hex(buffer: ArrayBuffer | Uint8Array) {
|
||||||
return [...new Uint8Array(buffer)]
|
// buffer is an ArrayBuffer
|
||||||
.map(x => x.toString(16).padStart(2, '0'))
|
return [...new Uint8Array(buffer)].map((x) => x.toString(16).padStart(2, '0')).join('');
|
||||||
.join('');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getPublicKeyLabelValues(publicKey: Key) {
|
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'),
|
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,
|
multiline: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -176,38 +168,43 @@ export function getCertificateLabelValues(cert: Certificate, forgeCertificate: f
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: t('tools.certificate-key-parser.texts.label-extensions-parsed'),
|
label: t('tools.certificate-key-parser.texts.label-extensions-parsed'),
|
||||||
value: JSON.stringify(cert.getExtensions().map(ext => ({
|
value: JSON.stringify(
|
||||||
oid: (<any>ext).oid,
|
cert.getExtensions().map((ext) => ({
|
||||||
name: (<any>ext).name || (<any>oids)[(<any>ext).oid],
|
oid: (<any>ext).oid,
|
||||||
critical: (<any>ext).critical,
|
name: (<any>ext).name || (<any>oids)[(<any>ext).oid],
|
||||||
data: ext.data?.toString('hex') || (<any>ext).bits?.toString('hex'),
|
critical: (<any>ext).critical,
|
||||||
})), null, 2),
|
data: ext.data?.toString('hex') || (<any>ext).bits?.toString('hex'),
|
||||||
|
})),
|
||||||
|
null,
|
||||||
|
2,
|
||||||
|
),
|
||||||
multiline: true,
|
multiline: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: t('tools.certificate-key-parser.texts.label-extensions-raw'),
|
label: t('tools.certificate-key-parser.texts.label-extensions-raw'),
|
||||||
value: JSON.stringify(forgeCertificate?.extensions.map(ext => ({
|
value: JSON.stringify(
|
||||||
id: (<any>ext).id,
|
forgeCertificate?.extensions.map((ext) => ({
|
||||||
name: (<any>ext).id || (<any>oids)[(<any>ext).id],
|
id: (<any>ext).id,
|
||||||
...ext,
|
name: (<any>ext).id || (<any>oids)[(<any>ext).id],
|
||||||
})), null, 2),
|
...ext,
|
||||||
|
})),
|
||||||
|
null,
|
||||||
|
2,
|
||||||
|
),
|
||||||
multiline: true,
|
multiline: true,
|
||||||
},
|
},
|
||||||
...['sha1', 'sha256', 'sha512'].flatMap(algorithm =>
|
...['sha1', 'sha256', 'sha512'].flatMap((algorithm) => [
|
||||||
[
|
{
|
||||||
|
label: `Fingerprint (${algorithm}):`,
|
||||||
{
|
value: onErrorReturnErrorMessage(() => cert.fingerprint(algorithm as AlgorithmHashType)),
|
||||||
label: `Fingerprint (${algorithm}):`,
|
multiline: true,
|
||||||
value: onErrorReturnErrorMessage(() => cert.fingerprint(algorithm as AlgorithmHashType)),
|
},
|
||||||
multiline: true,
|
{
|
||||||
},
|
label: `Fingerprint HEX (${algorithm}):`,
|
||||||
{
|
value: onErrorReturnErrorMessage(() => cert.fingerprint(algorithm as AlgorithmHashType).toString('hex')),
|
||||||
label: `Fingerprint HEX (${algorithm}):`,
|
multiline: true,
|
||||||
value: onErrorReturnErrorMessage(() => cert.fingerprint(algorithm as AlgorithmHashType).toString('hex')),
|
},
|
||||||
multiline: true,
|
]),
|
||||||
},
|
|
||||||
],
|
|
||||||
),
|
|
||||||
{
|
{
|
||||||
label: t('tools.certificate-key-parser.texts.label-certificate-pem'),
|
label: t('tools.certificate-key-parser.texts.label-certificate-pem'),
|
||||||
value: onErrorReturnErrorMessage(() => cert.toString('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'),
|
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[];
|
] as LabelValue[];
|
||||||
}
|
}
|
||||||
@@ -277,7 +277,10 @@ export async function getPGPPrivateKeyLabelValuesAsync(pgpPrivateKey: openpgp.Ke
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: t('tools.certificate-key-parser.texts.label-key-id-s'),
|
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[];
|
] as LabelValue[];
|
||||||
}
|
}
|
||||||
@@ -290,7 +293,7 @@ export function getCSRLabelValues(csr: forge.pki.CertificateSigningRequest) {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: t('tools.certificate-key-parser.texts.label-subject'),
|
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,
|
multiline: true,
|
||||||
},
|
},
|
||||||
// {
|
// {
|
||||||
|
|||||||
@@ -10,12 +10,23 @@ import { useQueryParamOrStorage } from '@/composable/queryParams';
|
|||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
|
||||||
const baseRange = useQueryParamOrStorage({ name: 'range', storageName: 'cidr-in-cidr:range', defaultValue: '192.168.0.1/24' }); // NOSONAR
|
const baseRange = useQueryParamOrStorage({
|
||||||
const ipOrRangeToTest = useQueryParamOrStorage({ name: 'ip', storageName: 'cidr-in-cidr:ip', defaultValue: '192.168.0.1' }); // NOSONAR
|
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(
|
const matchResult = computed(() =>
|
||||||
() => cidrInCidr({ baseRange: baseRange.value, ipOrRangeToTest: ipOrRangeToTest.value }),
|
withDefaultOnError(() => cidrInCidr({ baseRange: baseRange.value, ipOrRangeToTest: ipOrRangeToTest.value }), {
|
||||||
{ baseSubnets: [], isIncluded: false }));
|
baseSubnets: [],
|
||||||
|
isIncluded: false,
|
||||||
|
}),
|
||||||
|
);
|
||||||
|
|
||||||
const rangeValidationRules = [
|
const rangeValidationRules = [
|
||||||
{
|
{
|
||||||
@@ -47,13 +58,11 @@ const rangeValidationRules = [
|
|||||||
|
|
||||||
<div flex justify-center>
|
<div flex justify-center>
|
||||||
<span v-if="matchResult.isIncluded">
|
<span v-if="matchResult.isIncluded">
|
||||||
<n-icon color="green">
|
<n-icon color="green"> <CheckIcon /> </n-icon>{{ t('tools.cidr-in-cidr.texts.tag-included') }}</span
|
||||||
<CheckIcon />
|
>
|
||||||
</n-icon>{{ t('tools.cidr-in-cidr.texts.tag-included') }}</span>
|
|
||||||
<span v-else>
|
<span v-else>
|
||||||
<n-icon color="red">
|
<n-icon color="red"> <CrossIcon /> </n-icon>{{ t('tools.cidr-in-cidr.texts.tag-not-included') }}</span
|
||||||
<CrossIcon />
|
>
|
||||||
</n-icon>{{ t('tools.cidr-in-cidr.texts.tag-not-included') }}</span>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<n-divider />
|
<n-divider />
|
||||||
|
|||||||
@@ -10,22 +10,22 @@ const citationData = ref({
|
|||||||
authors: [''],
|
authors: [''],
|
||||||
title: '',
|
title: '',
|
||||||
publisher: '',
|
publisher: '',
|
||||||
year: '',
|
year: null as number | null,
|
||||||
url: '',
|
url: '',
|
||||||
});
|
});
|
||||||
|
|
||||||
const style = ref('apa');
|
const style = ref('apa');
|
||||||
const formattedCitation = computed(() => {
|
const formattedCitation = computed(() => {
|
||||||
try {
|
try {
|
||||||
const authors = citationData.value.authors.filter(a => a.trim() !== '').map((a) => {
|
const authors = citationData.value.authors
|
||||||
const [first, last] = a.split(/,\s*/, 2);
|
.filter((a) => a.trim() !== '')
|
||||||
return { first, last };
|
.map((a) => {
|
||||||
});
|
const [first, last] = a.split(/,\s*/, 2);
|
||||||
if (!citationData.value.title
|
return { first, last };
|
||||||
|| !citationData.value.publisher
|
});
|
||||||
|| !citationData.value.year
|
if (!citationData.value.title || !citationData.value.publisher || !citationData.value.year || !authors.length) {
|
||||||
|| !authors.length
|
return '### Please fill Title, Publisher, Year and authors';
|
||||||
) { return '### Please fill Title, Publisher, Year and authors'; }
|
}
|
||||||
|
|
||||||
const citationInData = {
|
const citationInData = {
|
||||||
authors,
|
authors,
|
||||||
@@ -38,20 +38,20 @@ const formattedCitation = computed(() => {
|
|||||||
if (style.value === 'vancouver') {
|
if (style.value === 'vancouver') {
|
||||||
return formatVancouverCitation(citationInData);
|
return formatVancouverCitation(citationInData);
|
||||||
}
|
}
|
||||||
return (style.value === 'apa' ? APA : MLA)([
|
return (style.value === 'apa' ? APA : MLA)([citationInData]);
|
||||||
citationInData,
|
} catch (e: any) {
|
||||||
]);
|
|
||||||
}
|
|
||||||
catch (e: any) {
|
|
||||||
return e.toString();
|
return e.toString();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<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 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
|
<n-dynamic-input
|
||||||
v-model:value="citationData.authors"
|
v-model:value="citationData.authors"
|
||||||
:placeholder="t('tools.citation-generator.texts.placeholder-enter-author-name')"
|
:placeholder="t('tools.citation-generator.texts.placeholder-enter-author-name')"
|
||||||
@@ -59,19 +59,34 @@ const formattedCitation = computed(() => {
|
|||||||
</n-form-item>
|
</n-form-item>
|
||||||
|
|
||||||
<n-form-item :label="t('tools.citation-generator.texts.label-title')">
|
<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>
|
||||||
|
|
||||||
<n-form-item :label="t('tools.citation-generator.texts.label-publisher')">
|
<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>
|
||||||
|
|
||||||
<n-form-item :label="t('tools.citation-generator.texts.label-publication-year')">
|
<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>
|
||||||
|
|
||||||
<n-form-item :label="t('tools.citation-generator.texts.label-url-optional')">
|
<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>
|
||||||
|
|
||||||
<n-form-item :label="t('tools.citation-generator.texts.label-citation-style')">
|
<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,
|
aaaNormal: wcag(bgHex, fgHex, { level: 'AAA', size: 'normal' }).pass,
|
||||||
aaLarge: wcag(bgHex, fgHex, { level: 'AA', size: 'large' }).pass,
|
aaLarge: wcag(bgHex, fgHex, { level: 'AA', size: 'large' }).pass,
|
||||||
aaaLarge: wcag(bgHex, fgHex, { level: 'AAA', size: 'large' }).pass,
|
aaaLarge: wcag(bgHex, fgHex, { level: 'AAA', size: 'large' }).pass,
|
||||||
level: levels.find(l => wcagLevel < l.score),
|
level: levels.find((l) => wcagLevel < l.score),
|
||||||
largeLevel: largeLevels.find(l => wcagLevel < l.score),
|
largeLevel: largeLevels.find((l) => wcagLevel < l.score),
|
||||||
smallLevel: smallLevels.find(l => wcagLevel < l.score),
|
smallLevel: smallLevels.find((l) => wcagLevel < l.score),
|
||||||
apcaContrastValue: apcaContrastValue(bgHex, fgHex),
|
apcaContrastValue: apcaContrastValue(bgHex, fgHex),
|
||||||
error: '',
|
error: '',
|
||||||
};
|
};
|
||||||
}
|
} catch (e: any) {
|
||||||
catch (e: any) {
|
|
||||||
return {
|
return {
|
||||||
error: e.toString(),
|
error: e.toString(),
|
||||||
};
|
};
|
||||||
@@ -55,27 +54,11 @@ const result = computed(() => {
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div max-w-600px>
|
<div max-w-600px>
|
||||||
<n-form-item
|
<n-form-item :label="t('tools.color-contrast-checker.texts.label-forecolor')" label-placement="left" mb-1>
|
||||||
:label="t('tools.color-contrast-checker.texts.label-forecolor')"
|
<n-color-picker v-model:value="forecolor" :modes="['hex']" :show-alpha="false" />
|
||||||
label-placement="left"
|
|
||||||
mb-1
|
|
||||||
>
|
|
||||||
<n-color-picker
|
|
||||||
v-model:value="forecolor"
|
|
||||||
:modes="['hex']"
|
|
||||||
:show-alpha="false"
|
|
||||||
/>
|
|
||||||
</n-form-item>
|
</n-form-item>
|
||||||
<n-form-item
|
<n-form-item :label="t('tools.color-contrast-checker.texts.label-backcolor')" label-placement="left" mb-1>
|
||||||
:label="t('tools.color-contrast-checker.texts.label-backcolor')"
|
<n-color-picker v-model:value="backcolor" :modes="['hex']" :show-alpha="false" />
|
||||||
label-placement="left"
|
|
||||||
mb-1
|
|
||||||
>
|
|
||||||
<n-color-picker
|
|
||||||
v-model:value="backcolor"
|
|
||||||
:modes="['hex']"
|
|
||||||
:show-alpha="false"
|
|
||||||
/>
|
|
||||||
</n-form-item>
|
</n-form-item>
|
||||||
|
|
||||||
<n-divider />
|
<n-divider />
|
||||||
@@ -85,47 +68,99 @@ const result = computed(() => {
|
|||||||
</c-alert>
|
</c-alert>
|
||||||
|
|
||||||
<c-card v-if="!result.error" :title="t('tools.color-contrast-checker.texts.title-wcag-2-1')">
|
<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-form-item
|
||||||
<n-tag :max="5" :color="{ color: result.level.bg, textColor: result.level.fg, borderColor: result.level.fg }" mr-2>
|
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>
|
<span>{{ result.wcag21ConstrastValue.toFixed(2) }} - {{ result.level.text }}</span>
|
||||||
</n-tag>
|
</n-tag>
|
||||||
<n-tag :max="5" :color="{ color: result.level.bg, textColor: result.level.fg, borderColor: result.level.fg }">
|
<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-rate :count="5" readonly :default-value="result.level.stars" :color="result.level.fg" />
|
||||||
</n-tag>
|
</n-tag>
|
||||||
</n-form-item>
|
</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-form-item
|
||||||
<n-tag :color="{ color: result.smallLevel.bg, textColor: result.smallLevel.fg, borderColor: result.smallLevel.fg }">
|
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-rate :count="3" readonly :default-value="result.smallLevel.stars" :color="result.smallLevel.fg" />
|
||||||
</n-tag>
|
</n-tag>
|
||||||
</n-form-item>
|
</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-form-item
|
||||||
<n-tag :color="{ color: result.largeLevel.bg, textColor: result.largeLevel.fg, borderColor: result.largeLevel.fg }">
|
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-rate :count="3" readonly :default-value="result.largeLevel.stars" :color="result.largeLevel.fg" />
|
||||||
</n-tag>
|
</n-tag>
|
||||||
</n-form-item>
|
</n-form-item>
|
||||||
|
|
||||||
<c-card :title="t('tools.color-contrast-checker.texts.title-normal-text')">
|
<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'">
|
<n-tag :bordered="false" :type="result.aaNormal ? 'success' : 'error'">
|
||||||
{{ result.aaNormal ? 'Pass' : 'Fail' }}
|
{{ result.aaNormal ? 'Pass' : 'Fail' }}
|
||||||
</n-tag>
|
</n-tag>
|
||||||
</n-form-item>
|
</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'">
|
<n-tag :bordered="false" :type="result.aaaNormal ? 'success' : 'error'">
|
||||||
{{ result.aaaNormal ? 'Pass' : 'Fail' }}
|
{{ result.aaaNormal ? 'Pass' : 'Fail' }}
|
||||||
</n-tag>
|
</n-tag>
|
||||||
</n-form-item>
|
</n-form-item>
|
||||||
</c-card>
|
</c-card>
|
||||||
<c-card :title="t('tools.color-contrast-checker.texts.title-large-text')">
|
<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-p
|
||||||
<n-form-item :label="t('tools.color-contrast-checker.texts.label-wcag-2-1-aa')" label-width="130px" label-placement="left">
|
><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'">
|
<n-tag :bordered="false" :type="result.aaLarge ? 'success' : 'error'">
|
||||||
{{ result.aaLarge ? 'Pass' : 'Fail' }}
|
{{ result.aaLarge ? 'Pass' : 'Fail' }}
|
||||||
</n-tag>
|
</n-tag>
|
||||||
</n-form-item>
|
</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'">
|
<n-tag :bordered="false" :type="result.aaaLarge ? 'success' : 'error'">
|
||||||
{{ result.aaaLarge ? 'Pass' : 'Fail' }}
|
{{ result.aaaLarge ? 'Pass' : 'Fail' }}
|
||||||
</n-tag>
|
</n-tag>
|
||||||
@@ -134,7 +169,14 @@ const result = computed(() => {
|
|||||||
</c-card>
|
</c-card>
|
||||||
|
|
||||||
<c-card v-if="!result.error" :title="t('tools.color-contrast-checker.texts.title-apca')">
|
<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>
|
</c-card>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -7,10 +7,10 @@ import { useQueryParam } from '@/composable/queryParams';
|
|||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
|
||||||
interface CountDown {
|
interface CountDown {
|
||||||
d: number
|
d: number;
|
||||||
h: number
|
h: number;
|
||||||
m: number
|
m: number;
|
||||||
s: number
|
s: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getCountDownHref(c: CountDown) {
|
function getCountDownHref(c: CountDown) {
|
||||||
@@ -40,12 +40,7 @@ watchEffect(() => {
|
|||||||
|
|
||||||
const now = ref(moment());
|
const now = ref(moment());
|
||||||
const deadlineDate = computed(() => {
|
const deadlineDate = computed(() => {
|
||||||
return now.value
|
return now.value.add(days.value, 'd').add(hours.value, 'h').add(minutes.value, 'm').add(seconds.value, 's').toDate();
|
||||||
.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 fmt = 'YYYY-MM-DD HH:mm:ss';
|
||||||
const deadlineFormatted = computed(() => {
|
const deadlineFormatted = computed(() => {
|
||||||
@@ -61,7 +56,11 @@ function start() {
|
|||||||
now.value = moment();
|
now.value = moment();
|
||||||
status.value = 'running';
|
status.value = 'running';
|
||||||
const histoEntry = { d: days.value, h: hours.value, m: minutes.value, s: seconds.value };
|
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];
|
history.value = [histoEntry, ...history.value];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -88,8 +87,7 @@ function toggleFullScreen() {
|
|||||||
}
|
}
|
||||||
if (!document.fullscreenElement) {
|
if (!document.fullscreenElement) {
|
||||||
element?.requestFullscreen();
|
element?.requestFullscreen();
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
document.exitFullscreen?.();
|
document.exitFullscreen?.();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -124,9 +122,7 @@ const isEnded = computed(() => status.value === 'ended');
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div flex justify-center>
|
<div flex justify-center>
|
||||||
<c-button
|
<c-button @click="start">
|
||||||
@click="start"
|
|
||||||
>
|
|
||||||
{{ t('tools.countdown.texts.tag-start') }}
|
{{ t('tools.countdown.texts.tag-start') }}
|
||||||
</c-button>
|
</c-button>
|
||||||
</div>
|
</div>
|
||||||
@@ -134,20 +130,23 @@ const isEnded = computed(() => status.value === 'ended');
|
|||||||
|
|
||||||
<div id="fullScreenElement" ref="fullScreenElement" mb-2>
|
<div id="fullScreenElement" ref="fullScreenElement" mb-2>
|
||||||
<div>
|
<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>
|
<div mb-2 flex justify-center>
|
||||||
<c-button
|
<c-button :disabled="status === 'stopped'" @click="toggleFullScreen">
|
||||||
:disabled="status === 'stopped'"
|
|
||||||
@click="toggleFullScreen"
|
|
||||||
>
|
|
||||||
{{ t('tools.countdown.texts.tag-toggle-fullscreen') }}
|
{{ t('tools.countdown.texts.tag-toggle-fullscreen') }}
|
||||||
</c-button>
|
</c-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<n-modal v-model:show="isEnded" mask-closable="false">
|
<n-modal v-model:show="isEnded" :mask-closable="false">
|
||||||
<n-card
|
<n-card
|
||||||
style="width: 600px"
|
style="width: 600px"
|
||||||
:title="t('tools.countdown.texts.title-timer-finished')"
|
:title="t('tools.countdown.texts.title-timer-finished')"
|
||||||
@@ -166,17 +165,12 @@ const isEnded = computed(() => status.value === 'ended');
|
|||||||
</n-modal>
|
</n-modal>
|
||||||
|
|
||||||
<div mb-2 flex justify-center>
|
<div mb-2 flex justify-center>
|
||||||
<c-button
|
<c-button :disabled="status === 'stopped'" @click="stop">
|
||||||
:disabled="status === 'stopped'"
|
|
||||||
@click="stop"
|
|
||||||
>
|
|
||||||
{{ t('tools.countdown.texts.tag-stop') }}
|
{{ t('tools.countdown.texts.tag-stop') }}
|
||||||
</c-button>
|
</c-button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<n-p align="center">
|
<n-p align="center"> Alarm at: {{ deadlineDate }} </n-p>
|
||||||
Alarm at: {{ deadlineDate }}
|
|
||||||
</n-p>
|
|
||||||
|
|
||||||
<c-card v-if="history" :title="t('tools.countdown.texts.title-history')">
|
<c-card v-if="history" :title="t('tools.countdown.texts.title-history')">
|
||||||
<div flex justify-center gap-1>
|
<div flex justify-center gap-1>
|
||||||
|
|||||||
@@ -32,7 +32,8 @@ const defaultCRCValues = {
|
|||||||
};
|
};
|
||||||
type AlgoNames = keyof typeof defaultCRCValues;
|
type AlgoNames = keyof typeof defaultCRCValues;
|
||||||
|
|
||||||
function getCRCs(content: Uint8Array | string) {
|
function getCRCs(rawContent: Uint8Array | string) {
|
||||||
|
const content = rawContent as Buffer | string;
|
||||||
return {
|
return {
|
||||||
crc1: crc.crc1(content).toString(16),
|
crc1: crc.crc1(content).toString(16),
|
||||||
crc8: crc.crc8(content).toString(16),
|
crc8: crc.crc8(content).toString(16),
|
||||||
@@ -60,8 +61,7 @@ async function onUpload(uploadedFile: File) {
|
|||||||
try {
|
try {
|
||||||
hashes.value = getCRCs(new Uint8Array(buffer));
|
hashes.value = getCRCs(new Uint8Array(buffer));
|
||||||
status.value = 'done';
|
status.value = 'done';
|
||||||
}
|
} catch (e) {
|
||||||
catch (e) {
|
|
||||||
status.value = 'error';
|
status.value = 'error';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -69,7 +69,11 @@ async function onUpload(uploadedFile: File) {
|
|||||||
const algoWasmNames = Object.keys(defaultCRCValues) as AlgoNames[];
|
const algoWasmNames = Object.keys(defaultCRCValues) as AlgoNames[];
|
||||||
type Encoding = keyof typeof enc | 'Bin';
|
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) {
|
function formatWithEncoding(words: lib.WordArray, encoding: Encoding) {
|
||||||
if (encoding === 'Bin') {
|
if (encoding === 'Bin') {
|
||||||
@@ -79,24 +83,24 @@ function formatWithEncoding(words: lib.WordArray, encoding: Encoding) {
|
|||||||
return words.toString(enc[encoding]);
|
return words.toString(enc[encoding]);
|
||||||
}
|
}
|
||||||
|
|
||||||
const CRCValues = computed(() => withDefaultOnError(() => {
|
const CRCValues = computed(() =>
|
||||||
const encodingValue = encoding.value;
|
withDefaultOnError(() => {
|
||||||
const hashesValue = hashes.value;
|
const encodingValue = encoding.value;
|
||||||
|
const hashesValue = hashes.value;
|
||||||
|
|
||||||
const ret = defaultCRCValues;
|
const ret = defaultCRCValues;
|
||||||
for (const algo of algoWasmNames) {
|
for (const algo of algoWasmNames) {
|
||||||
ret[algo] = formatWithEncoding(enc.Hex.parse(hashesValue[algo]), encodingValue);
|
ret[algo] = formatWithEncoding(enc.Hex.parse(hashesValue[algo]), encodingValue);
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}, defaultCRCValues));
|
}, defaultCRCValues),
|
||||||
|
|
||||||
watch(text,
|
|
||||||
(newValue) => {
|
|
||||||
file.value = null;
|
|
||||||
hashes.value = getCRCs(newValue);
|
|
||||||
status.value = 'done';
|
|
||||||
},
|
|
||||||
);
|
);
|
||||||
|
|
||||||
|
watch(text, (newValue) => {
|
||||||
|
file.value = null;
|
||||||
|
hashes.value = getCRCs(newValue);
|
||||||
|
status.value = 'done';
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
@@ -111,9 +115,13 @@ watch(text,
|
|||||||
|
|
||||||
<c-input-text
|
<c-input-text
|
||||||
v-model:value="text"
|
v-model:value="text"
|
||||||
multiline raw-text
|
multiline
|
||||||
:placeholder="t('tools.crc-calculator.texts.placeholder-paste-string-to-crc')" rows="3"
|
raw-text
|
||||||
autosize autofocus :label="t('tools.crc-calculator.texts.label-your-text-to-crc')"
|
:placeholder="t('tools.crc-calculator.texts.placeholder-paste-string-to-crc')"
|
||||||
|
rows="3"
|
||||||
|
autosize
|
||||||
|
autofocus
|
||||||
|
:label="t('tools.crc-calculator.texts.label-your-text-to-crc')"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<n-divider />
|
<n-divider />
|
||||||
@@ -147,10 +155,7 @@ watch(text,
|
|||||||
<c-alert v-if="status === 'error'" type="error">
|
<c-alert v-if="status === 'error'" type="error">
|
||||||
{{ t('tools.crc-calculator.texts.tag-an-error-occured-hashing-file') }}
|
{{ t('tools.crc-calculator.texts.tag-an-error-occured-hashing-file') }}
|
||||||
</c-alert>
|
</c-alert>
|
||||||
<n-spin
|
<n-spin v-if="status === 'processing'" size="small" />
|
||||||
v-if="status === 'processing'"
|
|
||||||
size="small"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<c-card v-if="status === 'done'" :title="file === null ? 'CRC of text' : `CRC of ${file?.name}`">
|
<c-card v-if="status === 'done'" :title="file === null ? 'CRC of text' : `CRC of ${file?.name}`">
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ watchEffect(() => {
|
|||||||
const now = ref(moment());
|
const now = ref(moment());
|
||||||
const daysArray = computed<string[]>({
|
const daysArray = computed<string[]>({
|
||||||
get() {
|
get() {
|
||||||
return (alarmDays.value || allDays).split(',').map(s => s.trim());
|
return (alarmDays.value || allDays).split(',').map((s) => s.trim());
|
||||||
},
|
},
|
||||||
set(newValue) {
|
set(newValue) {
|
||||||
alarmDays.value = newValue.join(',');
|
alarmDays.value = newValue.join(',');
|
||||||
@@ -56,7 +56,7 @@ function start() {
|
|||||||
now.value = moment();
|
now.value = moment();
|
||||||
status.value = 'running';
|
status.value = 'running';
|
||||||
const histoEntry = { at: alarmAt.value, days: alarmDays.value };
|
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];
|
history.value = [histoEntry, ...history.value];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -83,8 +83,7 @@ function toggleFullScreen() {
|
|||||||
}
|
}
|
||||||
if (!document.fullscreenElement) {
|
if (!document.fullscreenElement) {
|
||||||
element?.requestFullscreen();
|
element?.requestFullscreen();
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
document.exitFullscreen?.();
|
document.exitFullscreen?.();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -115,9 +114,7 @@ const isEnded = computed(() => status.value === 'ended');
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div flex justify-center>
|
<div flex justify-center>
|
||||||
<c-button
|
<c-button @click="start">
|
||||||
@click="start"
|
|
||||||
>
|
|
||||||
{{ t('tools.cron-alarm.texts.tag-start') }}
|
{{ t('tools.cron-alarm.texts.tag-start') }}
|
||||||
</c-button>
|
</c-button>
|
||||||
</div>
|
</div>
|
||||||
@@ -127,10 +124,7 @@ const isEnded = computed(() => status.value === 'ended');
|
|||||||
<div>
|
<div>
|
||||||
<Countdown :deadline="alarmAtFormatted" :stop="status !== 'running'" mb-2 @time-elapsed="ended()" />
|
<Countdown :deadline="alarmAtFormatted" :stop="status !== 'running'" mb-2 @time-elapsed="ended()" />
|
||||||
<div mb-2 flex justify-center>
|
<div mb-2 flex justify-center>
|
||||||
<c-button
|
<c-button :disabled="status === 'stopped'" @click="toggleFullScreen">
|
||||||
:disabled="status === 'stopped'"
|
|
||||||
@click="toggleFullScreen"
|
|
||||||
>
|
|
||||||
{{ t('tools.cron-alarm.texts.tag-toggle-fullscreen') }}
|
{{ t('tools.cron-alarm.texts.tag-toggle-fullscreen') }}
|
||||||
</c-button>
|
</c-button>
|
||||||
</div>
|
</div>
|
||||||
@@ -138,19 +132,14 @@ const isEnded = computed(() => status.value === 'ended');
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div mb-2 flex justify-center>
|
<div mb-2 flex justify-center>
|
||||||
<c-button
|
<c-button :disabled="status === 'stopped'" @click="stop">
|
||||||
:disabled="status === 'stopped'"
|
|
||||||
@click="stop"
|
|
||||||
>
|
|
||||||
{{ t('tools.cron-alarm.texts.tag-stop') }}
|
{{ t('tools.cron-alarm.texts.tag-stop') }}
|
||||||
</c-button>
|
</c-button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<n-p align="center">
|
<n-p align="center"> Next alarm at: {{ alarmAtDate }} </n-p>
|
||||||
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
|
<n-card
|
||||||
style="width: 600px"
|
style="width: 600px"
|
||||||
:title="t('tools.cron-alarm.texts.title-timer-finished')"
|
: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>
|
<div flex justify-center gap-1>
|
||||||
<template v-for="(entry, index) in history" :key="index">
|
<template v-for="(entry, index) in history" :key="index">
|
||||||
{{ index > 0 ? ' / ' : '' }}
|
{{ index > 0 ? ' / ' : '' }}
|
||||||
<n-a :href="getTimeHref(entry.at, entry.days)">
|
<n-a :href="getTimeHref(entry.at, entry.days)"> At: {{ entry.at }} ; Days: {{ entry.days || '*' }} </n-a>
|
||||||
At: {{ entry.at }} ; Days: {{ entry.days || '*' }}
|
|
||||||
</n-a>
|
|
||||||
</template>
|
</template>
|
||||||
</div>
|
</div>
|
||||||
</c-card>
|
</c-card>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import cronstrue from 'cronstrue';
|
import cronstrue from 'cronstrue';
|
||||||
import ctz from 'countries-and-timezones';
|
import * as ctz from 'countries-and-timezones';
|
||||||
import getTimezoneOffset from 'get-timezone-offset';
|
import getTimezoneOffset from 'get-timezone-offset';
|
||||||
import { type CronType, getLastExecutionTimes, isCronValid } from './crontab-generator.service';
|
import { type CronType, getLastExecutionTimes, isCronValid } from './crontab-generator.service';
|
||||||
import { useStyleStore } from '@/stores/style.store';
|
import { useStyleStore } from '@/stores/style.store';
|
||||||
@@ -18,19 +18,24 @@ const cronstrueConfig = reactive({
|
|||||||
use24HourTimeFormat: true,
|
use24HourTimeFormat: true,
|
||||||
throwExceptionOnParseError: true,
|
throwExceptionOnParseError: true,
|
||||||
monthStartIndexZero: false,
|
monthStartIndexZero: false,
|
||||||
tzOffset: (new Date()).getTimezoneOffset() / 60,
|
tzOffset: new Date().getTimezoneOffset() / 60,
|
||||||
});
|
});
|
||||||
|
|
||||||
// getTimezoneOffset(tz.name, now) / 60
|
// getTimezoneOffset(tz.name, now) / 60
|
||||||
const browserTimezone = Intl.DateTimeFormat().resolvedOptions().timeZone;
|
const browserTimezone = Intl.DateTimeFormat().resolvedOptions().timeZone;
|
||||||
const allTimezones = Object.values(ctz.getAllTimezones()).map((tz) => {
|
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 {
|
return {
|
||||||
value: tz.name,
|
value: tz.name,
|
||||||
label: `${tz.name === browserTimezone ? 'Browser TZ - ' : ''}${tz.name} (${timezoneUTCDSTOffset})`,
|
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(() => {
|
watchEffect(() => {
|
||||||
cronstrueConfig.tzOffset = -getTimezoneOffset(currentTimezone.value, new Date()) / 60;
|
cronstrueConfig.tzOffset = -getTimezoneOffset(currentTimezone.value, new Date()) / 60;
|
||||||
});
|
});
|
||||||
@@ -118,7 +123,8 @@ const awsHelpers = [
|
|||||||
...commonHelpers,
|
...commonHelpers,
|
||||||
{
|
{
|
||||||
symbol: '?',
|
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',
|
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',
|
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',
|
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.',
|
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',
|
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',
|
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',
|
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',
|
equivalent: 'At 04:19 AM, on the weekday nearest day 3 of the month, only in September, only in 2019 and 2020',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
symbol: '#',
|
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',
|
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 defaultAWSCronExpression = '0 0 ? * 1 *';
|
||||||
const defaultStandardCronExpression = '40 * * * *';
|
const defaultStandardCronExpression = '40 * * * *';
|
||||||
const cronType = ref<CronType>('standard');
|
const cronType = ref<CronType>('standard');
|
||||||
watch(cronType,
|
watch(cronType, (newCronType) => {
|
||||||
(newCronType) => {
|
if (newCronType === 'aws') {
|
||||||
if (newCronType === 'aws') {
|
if (!cron.value || cron.value === defaultStandardCronExpression) {
|
||||||
if (!cron.value || cron.value === defaultStandardCronExpression) {
|
cron.value = defaultAWSCronExpression;
|
||||||
cron.value = defaultAWSCronExpression;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else if (newCronType === 'standard') {
|
} else if (newCronType === 'standard') {
|
||||||
if (!cron.value || cron.value === defaultAWSCronExpression) {
|
if (!cron.value || cron.value === defaultAWSCronExpression) {
|
||||||
cron.value = defaultStandardCronExpression;
|
cron.value = defaultStandardCronExpression;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
);
|
});
|
||||||
|
|
||||||
const getHelpers = computed(() => {
|
const getHelpers = computed(() => {
|
||||||
if (cronType.value === 'aws') {
|
if (cronType.value === 'aws') {
|
||||||
@@ -171,8 +178,7 @@ const cronString = computed(() => {
|
|||||||
if (isCronValid(cron.value)) {
|
if (isCronValid(cron.value)) {
|
||||||
try {
|
try {
|
||||||
return cronstrue.toString(cron.value, cronstrueConfig);
|
return cronstrue.toString(cron.value, cronstrueConfig);
|
||||||
}
|
} catch (e: any) {
|
||||||
catch (e: any) {
|
|
||||||
return e.toString();
|
return e.toString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -192,8 +198,7 @@ const executionTimesString = computed(() => {
|
|||||||
const lastExecutionTimes = getLastExecutionTimes(cron.value, currentTimezone.value);
|
const lastExecutionTimes = getLastExecutionTimes(cron.value, currentTimezone.value);
|
||||||
const executionTimesString = lastExecutionTimes.join('\n');
|
const executionTimesString = lastExecutionTimes.join('\n');
|
||||||
return `Next 5 execution times:\n${executionTimesString}`;
|
return `Next 5 execution times:\n${executionTimesString}`;
|
||||||
}
|
} catch (e: any) {
|
||||||
catch (e: any) {
|
|
||||||
return e.toString();
|
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-radio-group v-model:value="cronType" name="radiogroup" mb-2 flex justify-center>
|
||||||
<n-space>
|
<n-space>
|
||||||
<n-radio
|
<n-radio value="standard" :label="t('tools.crontab-generator.texts.label-unix-standard')" />
|
||||||
value="standard"
|
<n-radio value="aws" :label="t('tools.crontab-generator.texts.label-aws')" />
|
||||||
:label="t('tools.crontab-generator.texts.label-unix-standard')"
|
|
||||||
/>
|
|
||||||
<n-radio
|
|
||||||
value="aws"
|
|
||||||
:label="t('tools.crontab-generator.texts.label-aws')"
|
|
||||||
/>
|
|
||||||
</n-space>
|
</n-space>
|
||||||
</n-radio-group>
|
</n-radio-group>
|
||||||
|
|
||||||
@@ -269,7 +268,8 @@ const executionTimesString = computed(() => {
|
|||||||
| | | | ┌──── month (1 - 12) OR jan,feb,mar,apr ...
|
| | | | ┌──── month (1 - 12) OR jan,feb,mar,apr ...
|
||||||
| | | | | ┌── day of week (0 - 6, sunday=0) OR sun,mon ...
|
| | | | | ┌── day of week (0 - 6, sunday=0) OR sun,mon ...
|
||||||
| | | | | |
|
| | | | | |
|
||||||
* * * * * * command</pre>
|
* * * * * * command</pre
|
||||||
|
>
|
||||||
|
|
||||||
<pre v-if="cronType === 'aws'">
|
<pre v-if="cronType === 'aws'">
|
||||||
-- AWS CRON Syntax --
|
-- AWS CRON Syntax --
|
||||||
@@ -280,7 +280,8 @@ const executionTimesString = computed(() => {
|
|||||||
| | | | ┌──── day of week (0 - 6, sunday=0) OR sun,mon OR L ...
|
| | | | ┌──── day of week (0 - 6, sunday=0) OR sun,mon OR L ...
|
||||||
| | | | | ┌── year
|
| | | | | ┌── year
|
||||||
| | | | | |
|
| | | | | |
|
||||||
* * * * * *</pre>
|
* * * * * *</pre
|
||||||
|
>
|
||||||
|
|
||||||
<div v-if="styleStore.isSmallScreen">
|
<div v-if="styleStore.isSmallScreen">
|
||||||
<c-card v-for="{ symbol, meaning, example, equivalent } in getHelpers" :key="symbol" mb-3 important:border-none>
|
<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>
|
{{ t('tools.crontab-generator.texts.tag-meaning') }}<strong>{{ meaning }}</strong>
|
||||||
</div>
|
</div>
|
||||||
<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>
|
||||||
<div>
|
<div>
|
||||||
{{ t('tools.crontab-generator.texts.tag-equivalent') }}<strong>{{ equivalent }}</strong>
|
{{ t('tools.crontab-generator.texts.tag-equivalent') }}<strong>{{ equivalent }}</strong>
|
||||||
@@ -323,7 +327,7 @@ pre {
|
|||||||
padding: 10px 0;
|
padding: 10px 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.cron-execution-string{
|
.cron-execution-string {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
opacity: 0.8;
|
opacity: 0.8;
|
||||||
|
|||||||
@@ -156,8 +156,7 @@ function fitToViewport() {
|
|||||||
if (iRatio > vRatio) {
|
if (iRatio > vRatio) {
|
||||||
// Fit width
|
// Fit width
|
||||||
bW = vW;
|
bW = vW;
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
// Fit height
|
// Fit height
|
||||||
bW = vH * iRatio;
|
bW = vH * iRatio;
|
||||||
}
|
}
|
||||||
@@ -252,8 +251,7 @@ function handleWheel(e: WheelEvent) {
|
|||||||
let newZoom = zoom.value;
|
let newZoom = zoom.value;
|
||||||
if (e.deltaY < 0) {
|
if (e.deltaY < 0) {
|
||||||
newZoom = Math.min(zoom.value + zoomStep, 10.0);
|
newZoom = Math.min(zoom.value + zoomStep, 10.0);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
newZoom = Math.max(zoom.value - zoomStep, 0.05);
|
newZoom = Math.max(zoom.value - zoomStep, 0.05);
|
||||||
}
|
}
|
||||||
zoom.value = newZoom;
|
zoom.value = newZoom;
|
||||||
@@ -278,8 +276,7 @@ function exportImage() {
|
|||||||
const scaleFactor = imgNaturalWidth.value / bW;
|
const scaleFactor = imgNaturalWidth.value / bW;
|
||||||
canvasWidth = vW * scaleFactor;
|
canvasWidth = vW * scaleFactor;
|
||||||
canvasHeight = vH * scaleFactor;
|
canvasHeight = vH * scaleFactor;
|
||||||
}
|
} else if (exportWidthMode.value === 'custom') {
|
||||||
else if (exportWidthMode.value === 'custom') {
|
|
||||||
canvasWidth = customExportWidth.value;
|
canvasWidth = customExportWidth.value;
|
||||||
canvasHeight = customExportWidth.value / currentRatio.value;
|
canvasHeight = customExportWidth.value / currentRatio.value;
|
||||||
}
|
}
|
||||||
@@ -296,8 +293,7 @@ function exportImage() {
|
|||||||
if (backgroundColor.value !== '#00000000') {
|
if (backgroundColor.value !== '#00000000') {
|
||||||
ctx.fillStyle = backgroundColor.value;
|
ctx.fillStyle = backgroundColor.value;
|
||||||
ctx.fillRect(0, 0, canvasWidth, canvasHeight);
|
ctx.fillRect(0, 0, canvasWidth, canvasHeight);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
ctx.clearRect(0, 0, canvasWidth, canvasHeight);
|
ctx.clearRect(0, 0, canvasWidth, canvasHeight);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -309,7 +305,7 @@ function exportImage() {
|
|||||||
const bH = baseDimensions.value.height;
|
const bH = baseDimensions.value.height;
|
||||||
const ox = offsetX.value;
|
const ox = offsetX.value;
|
||||||
const oy = offsetY.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 sx = zoom.value * (flipH.value ? -1 : 1);
|
||||||
const sy = zoom.value * (flipV.value ? -1 : 1);
|
const sy = zoom.value * (flipV.value ? -1 : 1);
|
||||||
|
|
||||||
@@ -324,7 +320,8 @@ function exportImage() {
|
|||||||
ctx.restore();
|
ctx.restore();
|
||||||
|
|
||||||
// Trigger Download
|
// 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 extension = exportFormat.value;
|
||||||
const dataUrl = canvas.toDataURL(mime, exportQuality.value);
|
const dataUrl = canvas.toDataURL(mime, exportQuality.value);
|
||||||
|
|
||||||
@@ -347,12 +344,7 @@ function exportImage() {
|
|||||||
<!-- Drop Zone Mode -->
|
<!-- Drop Zone Mode -->
|
||||||
<c-card v-if="!imageSrc">
|
<c-card v-if="!imageSrc">
|
||||||
<div flex flex-col items-center justify-center gap-6 py-12>
|
<div flex flex-col items-center justify-center gap-6 py-12>
|
||||||
<c-file-upload
|
<c-file-upload accept="image/*" :title="t('tools.crop-image.texts.drag-drop')" w-full @file-upload="onUpload" />
|
||||||
accept="image/*"
|
|
||||||
:title="t('tools.crop-image.texts.drag-drop')"
|
|
||||||
w-full
|
|
||||||
@file-upload="onUpload"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
</c-card>
|
</c-card>
|
||||||
|
|
||||||
@@ -389,7 +381,10 @@ function exportImage() {
|
|||||||
>
|
>
|
||||||
<!-- Transparent checkerboard background -->
|
<!-- Transparent checkerboard background -->
|
||||||
<div
|
<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"
|
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)})`,
|
transform: `translate(${offsetX}px, ${offsetY}px) rotate(${rotation}deg) scale(${zoom * (flipH ? -1 : 1)}, ${zoom * (flipV ? -1 : 1)})`,
|
||||||
transformOrigin: 'center center',
|
transformOrigin: 'center center',
|
||||||
}"
|
}"
|
||||||
>
|
/>
|
||||||
|
|
||||||
<!-- 3x3 rule of thirds grid overlay -->
|
<!-- 3x3 rule of thirds grid overlay -->
|
||||||
<div
|
<div
|
||||||
@@ -478,11 +473,7 @@ function exportImage() {
|
|||||||
<n-form label-placement="left" label-width="140" label-align="right">
|
<n-form label-placement="left" label-width="140" label-align="right">
|
||||||
<!-- Aspect Ratio Presets -->
|
<!-- Aspect Ratio Presets -->
|
||||||
<n-form-item :label="t('tools.crop-image.texts.aspect-ratio')">
|
<n-form-item :label="t('tools.crop-image.texts.aspect-ratio')">
|
||||||
<c-select
|
<c-select v-model:value="aspectRatio" :options="aspectRatioOptions" w-full />
|
||||||
v-model:value="aspectRatio"
|
|
||||||
:options="aspectRatioOptions"
|
|
||||||
w-full
|
|
||||||
/>
|
|
||||||
</n-form-item>
|
</n-form-item>
|
||||||
|
|
||||||
<!-- Custom Aspect Ratio Inputs -->
|
<!-- Custom Aspect Ratio Inputs -->
|
||||||
@@ -497,7 +488,7 @@ function exportImage() {
|
|||||||
<!-- Background Color Picker -->
|
<!-- Background Color Picker -->
|
||||||
<n-form-item :label="t('tools.crop-image.texts.background-color')">
|
<n-form-item :label="t('tools.crop-image.texts.background-color')">
|
||||||
<div w-full flex items-center gap-4>
|
<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'">
|
<c-button size="small" @click="backgroundColor = '#00000000'">
|
||||||
{{ t('tools.crop-image.texts.transparent') }}
|
{{ t('tools.crop-image.texts.transparent') }}
|
||||||
</c-button>
|
</c-button>
|
||||||
@@ -535,15 +526,14 @@ function exportImage() {
|
|||||||
<n-form label-placement="left" label-width="140" label-align="right">
|
<n-form label-placement="left" label-width="140" label-align="right">
|
||||||
<!-- Export Format select -->
|
<!-- Export Format select -->
|
||||||
<n-form-item :label="t('tools.crop-image.texts.export-format')">
|
<n-form-item :label="t('tools.crop-image.texts.export-format')">
|
||||||
<c-select
|
<c-select v-model:value="exportFormat" :options="exportFormatOptions" w-full />
|
||||||
v-model:value="exportFormat"
|
|
||||||
:options="exportFormatOptions"
|
|
||||||
w-full
|
|
||||||
/>
|
|
||||||
</n-form-item>
|
</n-form-item>
|
||||||
|
|
||||||
<!-- Quality slider for lossy formats -->
|
<!-- 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>
|
<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" />
|
<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>
|
<span w-50px text-right font-mono>{{ Math.round(exportQuality * 100) }}%</span>
|
||||||
@@ -552,11 +542,7 @@ function exportImage() {
|
|||||||
|
|
||||||
<!-- Export width options -->
|
<!-- Export width options -->
|
||||||
<n-form-item :label="t('tools.crop-image.texts.export-width')">
|
<n-form-item :label="t('tools.crop-image.texts.export-width')">
|
||||||
<c-select
|
<c-select v-model:value="exportWidthMode" :options="exportWidthOptions" w-full />
|
||||||
v-model:value="exportWidthMode"
|
|
||||||
:options="exportWidthOptions"
|
|
||||||
w-full
|
|
||||||
/>
|
|
||||||
</n-form-item>
|
</n-form-item>
|
||||||
|
|
||||||
<!-- Custom Export Width Input -->
|
<!-- Custom Export Width Input -->
|
||||||
@@ -584,19 +570,20 @@ function exportImage() {
|
|||||||
|
|
||||||
.checkerboard-bg {
|
.checkerboard-bg {
|
||||||
background-image:
|
background-image:
|
||||||
linear-gradient(45deg, #e5e7eb 25%, transparent 25%),
|
linear-gradient(45deg, #e5e7eb 25%, transparent 25%), 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, transparent 75%, #e5e7eb 75%),
|
|
||||||
linear-gradient(-45deg, transparent 75%, #e5e7eb 75%);
|
|
||||||
background-size: 16px 16px;
|
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:
|
background-image:
|
||||||
linear-gradient(45deg, #374151 25%, transparent 25%),
|
linear-gradient(45deg, #374151 25%, transparent 25%), 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, transparent 75%, #374151 75%),
|
|
||||||
linear-gradient(-45deg, transparent 75%, #374151 75%);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,14 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import ctz from 'countries-and-timezones';
|
import * as ctz from 'countries-and-timezones';
|
||||||
import { type Weekdays, allWeekDays, diffDateTimes, getSupportedCountries, getSupportedRegions, getSupportedStates } from './days-calculator.service';
|
import {
|
||||||
|
type Weekdays,
|
||||||
|
allWeekDays,
|
||||||
|
diffDateTimes,
|
||||||
|
getSupportedCountries,
|
||||||
|
getSupportedRegions,
|
||||||
|
getSupportedStates,
|
||||||
|
} from './days-calculator.service';
|
||||||
import { useQueryParamOrStorage } from '@/composable/queryParams';
|
import { useQueryParamOrStorage } from '@/composable/queryParams';
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
@@ -11,7 +18,7 @@ const now = Date.now();
|
|||||||
const inputDateRange = ref<[number, number]>([now, now + 86400]);
|
const inputDateRange = ref<[number, number]>([now, now + 86400]);
|
||||||
|
|
||||||
const browserTimezone = Intl.DateTimeFormat().resolvedOptions().timeZone;
|
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,
|
value: tz.name,
|
||||||
label: `${tz.name === browserTimezone ? 'Browser TZ - ' : ''}${tz.name} (${tz.utcOffset === tz.dstOffset ? tz.utcOffsetStr : `${tz.utcOffsetStr}/${tz.dstOffsetStr}`})`,
|
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 state = useQueryParamOrStorage({ name: 'state', storageName: 'days-calc:st', defaultValue: '' });
|
||||||
const possibleRegions = computed(() => getSupportedRegions(country.value, state.value));
|
const possibleRegions = computed(() => getSupportedRegions(country.value, state.value));
|
||||||
const region = useQueryParamOrStorage({ name: 'region', storageName: 'days-calc:reg', defaultValue: '' });
|
const region = useQueryParamOrStorage({ name: 'region', storageName: 'days-calc:reg', defaultValue: '' });
|
||||||
const includeEndDate = useQueryParamOrStorage({ name: 'includeend', storageName: 'days-calc:end', defaultValue: false });
|
const includeEndDate = useQueryParamOrStorage({
|
||||||
const includeWeekDays = useQueryParamOrStorage<Weekdays[]>({ name: 'days', storageName: 'days-calc:days', defaultValue: allWeekDays });
|
name: 'includeend',
|
||||||
const includeHolidays = useQueryParamOrStorage({ name: 'includehol', storageName: 'days-calc:hol', defaultValue: true });
|
storageName: 'days-calc:end',
|
||||||
const businessStartHour = useQueryParamOrStorage({ name: 'businessstart', storageName: 'days-calc:bss', defaultValue: 9 });
|
defaultValue: false,
|
||||||
const businessEndHour = useQueryParamOrStorage({ name: 'businessstend', storageName: 'days-calc:bse', defaultValue: 18 });
|
});
|
||||||
const businessTimezone = useQueryParamOrStorage({ name: 'tz', storageName: 'days-calc:tz', defaultValue: browserTimezone });
|
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 error = ref('');
|
||||||
const resultDaysDiff = computed(() => {
|
const resultDaysDiff = computed(() => {
|
||||||
try {
|
try {
|
||||||
return diffDateTimes({
|
return diffDateTimes({
|
||||||
date1: new Date(inputDateRange.value[0] / 1000 * 1000),
|
date1: new Date((inputDateRange.value[0] / 1000) * 1000),
|
||||||
date2: new Date(inputDateRange.value[1] / 1000 * 1000),
|
date2: new Date((inputDateRange.value[1] / 1000) * 1000),
|
||||||
country: country.value,
|
country: country.value,
|
||||||
state: state.value,
|
state: state.value,
|
||||||
region: region.value,
|
region: region.value,
|
||||||
@@ -43,17 +74,16 @@ const resultDaysDiff = computed(() => {
|
|||||||
businessStartHour: businessStartHour.value,
|
businessStartHour: businessStartHour.value,
|
||||||
businessEndHour: businessEndHour.value,
|
businessEndHour: businessEndHour.value,
|
||||||
});
|
});
|
||||||
}
|
} catch (e: any) {
|
||||||
catch (e: any) {
|
|
||||||
error.value = e.toString();
|
error.value = e.toString();
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
const inputProps = {
|
const inputProps = {
|
||||||
'labelPosition': 'left',
|
labelPosition: 'left',
|
||||||
'labelWidth': '170px',
|
labelWidth: '170px',
|
||||||
'readonly': true,
|
readonly: true,
|
||||||
'mb-2': '',
|
'mb-2': '',
|
||||||
} as const;
|
} as const;
|
||||||
</script>
|
</script>
|
||||||
@@ -61,7 +91,13 @@ const inputProps = {
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<c-card :title="t('tools.days-calculator.texts.title-dates-interval')" mb-2>
|
<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-date-picker v-model:value="inputDateRange" type="datetimerange" />
|
||||||
</n-form-item>
|
</n-form-item>
|
||||||
|
|
||||||
@@ -82,7 +118,9 @@ const inputProps = {
|
|||||||
searchable
|
searchable
|
||||||
:label="t('tools.days-calculator.texts.label-state')"
|
:label="t('tools.days-calculator.texts.label-state')"
|
||||||
:options="possibleStates"
|
: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
|
mb-1
|
||||||
/>
|
/>
|
||||||
<c-select
|
<c-select
|
||||||
@@ -144,39 +182,157 @@ const inputProps = {
|
|||||||
</c-alert>
|
</c-alert>
|
||||||
|
|
||||||
<c-card v-if="resultDaysDiff" :title="t('tools.days-calculator.texts.title-result')">
|
<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
|
||||||
<input-copyable v-bind="inputProps" :label="t('tools.days-calculator.texts.label-start-date-iso')" :value="resultDaysDiff.startDate.toISOString()" />
|
v-bind="inputProps"
|
||||||
<input-copyable v-bind="inputProps" :label="t('tools.days-calculator.texts.label-end-date')" :value="resultDaysDiff.endDate" />
|
:label="t('tools.days-calculator.texts.label-start-date')"
|
||||||
<input-copyable v-bind="inputProps" :label="t('tools.days-calculator.texts.label-end-date-iso')" :value="resultDaysDiff.endDate.toISOString()" />
|
: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 />
|
<n-divider />
|
||||||
<input-copyable v-bind="inputProps" :label="t('tools.days-calculator.texts.label-total-difference-seconds')" :value="resultDaysDiff.totalDifference.seconds" />
|
<input-copyable
|
||||||
<input-copyable v-bind="inputProps" :label="t('tools.days-calculator.texts.label-total-difference-minutes')" :value="resultDaysDiff.totalDifference.minutes" />
|
v-bind="inputProps"
|
||||||
<input-copyable v-bind="inputProps" :label="t('tools.days-calculator.texts.label-total-difference-hours')" :value="resultDaysDiff.totalDifference.hours" />
|
:label="t('tools.days-calculator.texts.label-total-difference-seconds')"
|
||||||
<input-copyable v-bind="inputProps" :label="t('tools.days-calculator.texts.label-total-difference-days')" :value="resultDaysDiff.totalDifference.days" />
|
:value="resultDaysDiff.totalDifference.seconds"
|
||||||
<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
|
||||||
<input-copyable v-bind="inputProps" :label="t('tools.days-calculator.texts.label-total-difference-years')" :value="resultDaysDiff.totalDifference.years" />
|
v-bind="inputProps"
|
||||||
<input-copyable v-bind="inputProps" :label="t('tools.days-calculator.texts.label-total-difference')" :value="resultDaysDiff.totalDifferenceFormatted" />
|
: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 />
|
<n-divider />
|
||||||
<input-copyable v-bind="inputProps" :label="t('tools.days-calculator.texts.label-difference-seconds')" :value="resultDaysDiff.differenceSeconds" />
|
<input-copyable
|
||||||
<input-copyable v-bind="inputProps" :label="t('tools.days-calculator.texts.label-difference')" :value="resultDaysDiff.differenceFormatted" />
|
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 />
|
<n-divider />
|
||||||
<input-copyable v-bind="inputProps" :label="t('tools.days-calculator.texts.label-business-seconds')" :value="resultDaysDiff.businessSeconds" />
|
<input-copyable
|
||||||
<input-copyable v-bind="inputProps" :label="t('tools.days-calculator.texts.label-business-time')" :value="resultDaysDiff.businessSecondsFormatted" />
|
v-bind="inputProps"
|
||||||
<input-copyable v-bind="inputProps" :label="t('tools.days-calculator.texts.label-business-hours')" :value="resultDaysDiff.businessHours" />
|
:label="t('tools.days-calculator.texts.label-business-seconds')"
|
||||||
<input-copyable v-bind="inputProps" :label="t('tools.days-calculator.texts.label-business-days')" :value="resultDaysDiff.businessDays" />
|
: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 />
|
<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
|
||||||
<input-copyable v-bind="inputProps" :placeholder="t('tools.days-calculator.texts.placeholder-none')" :label="t('tools.days-calculator.texts.label-tuesdays')" :value="resultDaysDiff.tuesdays" />
|
v-bind="inputProps"
|
||||||
<input-copyable v-bind="inputProps" :placeholder="t('tools.days-calculator.texts.placeholder-none')" :label="t('tools.days-calculator.texts.label-wednesdays')" :value="resultDaysDiff.wednesdays" />
|
:placeholder="t('tools.days-calculator.texts.placeholder-none')"
|
||||||
<input-copyable v-bind="inputProps" :placeholder="t('tools.days-calculator.texts.placeholder-none')" :label="t('tools.days-calculator.texts.label-thursdays')" :value="resultDaysDiff.thursdays" />
|
:label="t('tools.days-calculator.texts.label-mondays')"
|
||||||
<input-copyable v-bind="inputProps" :placeholder="t('tools.days-calculator.texts.placeholder-none')" :label="t('tools.days-calculator.texts.label-fridays')" :value="resultDaysDiff.fridays" />
|
:value="resultDaysDiff.mondays.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" />
|
/>
|
||||||
<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-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 />
|
<n-divider />
|
||||||
<input-copyable v-bind="inputProps" :label="t('tools.days-calculator.texts.label-weekend-days')" :value="resultDaysDiff.weekendDays" />
|
<input-copyable
|
||||||
<input-copyable v-bind="inputProps" :label="t('tools.days-calculator.texts.label-full-weekends')" :value="resultDaysDiff.weekends" />
|
v-bind="inputProps"
|
||||||
<c-card v-if="resultDaysDiff.holidays?.length" :title="t('tools.days-calculator.texts.title-holidays-in-period')">
|
: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>
|
<ul>
|
||||||
<li v-for="(holiday, index) in resultDaysDiff.holidays" :key="index">
|
<li v-for="(holiday, index) in resultDaysDiff.holidays" :key="index">
|
||||||
{{ holiday.date }}: {{ holiday.name }} ({{ holiday.type }})
|
{{ holiday.date }}: {{ holiday.name }} ({{ holiday.type }})
|
||||||
|
|||||||
@@ -17,8 +17,7 @@ async function startDeadPixel() {
|
|||||||
iframe.onload = async () => {
|
iframe.onload = async () => {
|
||||||
try {
|
try {
|
||||||
await iframe.requestFullscreen();
|
await iframe.requestFullscreen();
|
||||||
}
|
} catch (e) {
|
||||||
catch (e) {
|
|
||||||
console.warn('Fullscreen failed', e);
|
console.warn('Fullscreen failed', e);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -104,19 +103,33 @@ const iframeHTML = `
|
|||||||
<template>
|
<template>
|
||||||
<div class="flex flex-col">
|
<div class="flex flex-col">
|
||||||
<p>
|
<p>
|
||||||
{{ t('tools.dead-pixel.texts.tag-keyboard-shortcuts') }}<ul>
|
{{ t('tools.dead-pixel.texts.tag-keyboard-shortcuts') }}
|
||||||
<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>
|
|
||||||
</p>
|
</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">
|
<c-button v-if="!showIframe" class="mx-auto" @click="startDeadPixel">
|
||||||
{{ t('tools.dead-pixel.texts.tag-start-dead-pixel') }}
|
{{ t('tools.dead-pixel.texts.tag-start-dead-pixel') }}
|
||||||
</c-button>
|
</c-button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<iframe
|
<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"
|
allow="fullscreen"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ function readAsText(file: File) {
|
|||||||
const reader = new FileReader();
|
const reader = new FileReader();
|
||||||
reader.readAsText(file);
|
reader.readAsText(file);
|
||||||
reader.onload = () => resolve(reader.result?.toString() ?? '');
|
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 {
|
try {
|
||||||
if (inputType.value === 'file' && file) {
|
if (inputType.value === 'file' && file) {
|
||||||
return await parseDmarcReportsFromXml([await readAsText(file)]);
|
return await parseDmarcReportsFromXml([await readAsText(file)]);
|
||||||
}
|
} else if (inputType.value === 'content' && emailContentValue) {
|
||||||
else if (inputType.value === 'content' && emailContentValue) {
|
|
||||||
return await parseDmarcReportFromEmail(emailContentValue);
|
return await parseDmarcReportFromEmail(emailContentValue);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
} catch (e: any) {
|
||||||
catch (e: any) {
|
|
||||||
error.value = e.toString();
|
error.value = e.toString();
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@@ -55,7 +52,7 @@ function toDate(dt: number | undefined) {
|
|||||||
if (!dt) {
|
if (!dt) {
|
||||||
return 'NA';
|
return 'NA';
|
||||||
}
|
}
|
||||||
return (new Date(dt)).toString();
|
return new Date(dt).toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
function policyResultClass(policyResult: string) {
|
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>
|
<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-radio-group v-model:value="inputType" name="radiogroup" mb-2 flex justify-center>
|
||||||
<n-space>
|
<n-space>
|
||||||
<n-radio
|
<n-radio value="file" :label="t('tools.dmarc-report-analyzer.texts.label-dmarc-xml-file')" />
|
||||||
value="file"
|
<n-radio value="content" :label="t('tools.dmarc-report-analyzer.texts.label-eml-content')" />
|
||||||
: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-space>
|
||||||
</n-radio-group>
|
</n-radio-group>
|
||||||
|
|
||||||
<c-file-upload
|
<c-file-upload
|
||||||
v-if="inputType === 'file'"
|
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"
|
@file-upload="onUpload"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
@@ -107,19 +102,59 @@ function policyResultClass(policyResult: string) {
|
|||||||
</c-alert>
|
</c-alert>
|
||||||
|
|
||||||
<c-card v-if="!error && parsedReport" :title="t('tools.dmarc-report-analyzer.texts.title-output')">
|
<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
|
<c-card
|
||||||
v-for="(report, reportIndex) in parsedReport.reports || []"
|
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
|
||||||
<input-copyable v-bind="inputLabelAlignmentConfig" mb-1 :label="t('tools.dmarc-report-analyzer.texts.label-email')" :value="report.reportMetadata?.email" />
|
v-bind="inputLabelAlignmentConfig"
|
||||||
<input-copyable v-bind="inputLabelAlignmentConfig" mb-1 :label="t('tools.dmarc-report-analyzer.texts.label-extracontactinfo')" :value="report.reportMetadata?.extraContactInfo" />
|
mb-1
|
||||||
<input-copyable v-bind="inputLabelAlignmentConfig" mb-1 :label="t('tools.dmarc-report-analyzer.texts.label-reportid')" :value="report.reportMetadata?.reportId" />
|
:label="t('tools.dmarc-report-analyzer.texts.label-orgname')"
|
||||||
<input-copyable v-bind="inputLabelAlignmentConfig" mb-1 :label="t('tools.dmarc-report-analyzer.texts.label-date-begin')" :value="toDate(report.reportMetadata?.dateRange?.begin)" />
|
:value="report.reportMetadata?.orgName ?? ''"
|
||||||
<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-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>
|
<c-card :title="t('tools.dmarc-report-analyzer.texts.title-policy-published')" mb-2>
|
||||||
<textarea-copyable :value="JSON.stringify(report.policyPublished, null, 2)" />
|
<textarea-copyable :value="JSON.stringify(report.policyPublished, null, 2)" />
|
||||||
</c-card>
|
</c-card>
|
||||||
@@ -148,14 +183,22 @@ function policyResultClass(policyResult: string) {
|
|||||||
{{ record.row.policyEvaluated.disposition }}
|
{{ record.row.policyEvaluated.disposition }}
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<span :class="policyResultClass(record.row.policyEvaluated.dkim)">{{ record.row.policyEvaluated.dkim }}</span>
|
<span :class="policyResultClass(record.row.policyEvaluated.dkim)">{{
|
||||||
<br>
|
record.row.policyEvaluated.dkim
|
||||||
{{ (record.authResults.dkim || []).map(dkim => `${dkim.domain}: ${dkim.result} ${dkim.humanResult}`.trim()).join(', ') }}
|
}}</span>
|
||||||
|
<br />
|
||||||
|
{{
|
||||||
|
(record.authResults.dkim || [])
|
||||||
|
.map((dkim) => `${dkim.domain}: ${dkim.result} ${dkim.humanResult}`.trim())
|
||||||
|
.join(', ')
|
||||||
|
}}
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<span :class="policyResultClass(record.row.policyEvaluated.spf)">{{ record.row.policyEvaluated.spf }}</span>
|
<span :class="policyResultClass(record.row.policyEvaluated.spf)">{{
|
||||||
<br>
|
record.row.policyEvaluated.spf
|
||||||
{{ (record.authResults.spf || []).map(spf => `${spf.domain}: ${spf.result}`.trim()).join(', ') }}
|
}}</span>
|
||||||
|
<br />
|
||||||
|
{{ (record.authResults.spf || []).map((spf) => `${spf.domain}: ${spf.result}`.trim()).join(', ') }}
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<textarea-copyable :value="JSON.stringify(record.identifiers, null, 2)" />
|
<textarea-copyable :value="JSON.stringify(record.identifiers, null, 2)" />
|
||||||
|
|||||||
+5
-5
@@ -10,10 +10,10 @@ declare module 'composeverter' {
|
|||||||
helpLink?: string;
|
helpLink?: string;
|
||||||
}
|
}
|
||||||
export function validateDockerComposeToCommonSpec(content: string): DockerComposeValidatioError[];
|
export function validateDockerComposeToCommonSpec(content: string): DockerComposeValidatioError[];
|
||||||
export function migrateFromV2xToV3x(content: string, configuration?: Configuration = null): string;
|
export function migrateFromV2xToV3x(content: string, configuration?: Configuration): string;
|
||||||
export function migrateFromV3xToV2x(content: string, configuration?: Configuration = null): string;
|
export function migrateFromV3xToV2x(content: string, configuration?: Configuration): string;
|
||||||
export function migrateFromV1ToV2x(content: string, configuration?: Configuration = null): string;
|
export function migrateFromV1ToV2x(content: string, configuration?: Configuration): string;
|
||||||
export function migrateToCommonSpec(content: string, configuration?: Configuration = null): string;
|
export function migrateToCommonSpec(content: string, configuration?: Configuration): string;
|
||||||
export function migrateFromV2xToV3x(content: string, configuration?: Configuration = null): string;
|
export function migrateFromV2xToV3x(content: string, configuration?: Configuration): string;
|
||||||
export function getDockerComposeSchemaWithoutFormats(): object;
|
export function getDockerComposeSchemaWithoutFormats(): object;
|
||||||
}
|
}
|
||||||
+18
-18
@@ -1,19 +1,19 @@
|
|||||||
declare module 'composeverter' {
|
declare module 'composeverter' {
|
||||||
interface Configuration {
|
interface Configuration {
|
||||||
expandVolumes?: boolean;
|
expandVolumes?: boolean;
|
||||||
expandPorts?: boolean;
|
expandPorts?: boolean;
|
||||||
indent?: number;
|
indent?: number;
|
||||||
}
|
}
|
||||||
interface DockerComposeValidatioError {
|
interface DockerComposeValidatioError {
|
||||||
line?: number;
|
line?: number;
|
||||||
message: string;
|
message: string;
|
||||||
helpLink?: string;
|
helpLink?: string;
|
||||||
}
|
}
|
||||||
export function validateDockerComposeToCommonSpec(content: string): DockerComposeValidatioError[];
|
export function validateDockerComposeToCommonSpec(content: string): DockerComposeValidatioError[];
|
||||||
export function migrateFromV2xToV3x(content: string, configuration?: Configuration = null): string;
|
export function migrateFromV2xToV3x(content: string, configuration?: Configuration): string;
|
||||||
export function migrateFromV3xToV2x(content: string, configuration?: Configuration = null): string;
|
export function migrateFromV3xToV2x(content: string, configuration?: Configuration): string;
|
||||||
export function migrateFromV1ToV2x(content: string, configuration?: Configuration = null): string;
|
export function migrateFromV1ToV2x(content: string, configuration?: Configuration): string;
|
||||||
export function migrateToCommonSpec(content: string, configuration?: Configuration = null): string;
|
export function migrateToCommonSpec(content: string, configuration?: Configuration): string;
|
||||||
export function migrateFromV2xToV3x(content: string, configuration?: Configuration = null): string;
|
export function migrateFromV2xToV3x(content: string, configuration?: Configuration): string;
|
||||||
export function getDockerComposeSchemaWithoutFormats(): object;
|
export function getDockerComposeSchemaWithoutFormats(): object;
|
||||||
}
|
}
|
||||||
@@ -1,15 +1,15 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
export interface OciGithubLabels {
|
export interface OciGithubLabels {
|
||||||
title: string
|
title: string;
|
||||||
description: string
|
description: string;
|
||||||
url: string
|
url: string;
|
||||||
source: string
|
source: string;
|
||||||
documentation: string
|
documentation: string;
|
||||||
licenses: string
|
licenses: string;
|
||||||
version: string
|
version: string;
|
||||||
revision: string
|
revision: string;
|
||||||
created: Date | null
|
created: number | null;
|
||||||
authors: string
|
authors: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
const form = ref<OciGithubLabels>({
|
const form = ref<OciGithubLabels>({
|
||||||
@@ -37,13 +37,13 @@ const dockerfileLabels = computed(() => {
|
|||||||
['org.opencontainers.image.licenses', f.licenses],
|
['org.opencontainers.image.licenses', f.licenses],
|
||||||
['org.opencontainers.image.version', f.version],
|
['org.opencontainers.image.version', f.version],
|
||||||
['org.opencontainers.image.revision', f.revision],
|
['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],
|
['org.opencontainers.image.authors', f.authors],
|
||||||
];
|
];
|
||||||
|
|
||||||
const lines = entries
|
const lines = entries
|
||||||
.filter(([_, v]) => v.trim() !== '')
|
.filter(([_, v]) => v.trim() !== '')
|
||||||
.map(([k, v]) => ` ${k}="${v.replace(/"/g, '\\"')}"`);
|
.map(([k, v]) => ` ${k}="${v.replace(/\\/g, '\\\\').replace(/"/g, '\\"')}"`);
|
||||||
|
|
||||||
if (lines.length === 0) {
|
if (lines.length === 0) {
|
||||||
return '';
|
return '';
|
||||||
@@ -61,11 +61,7 @@ const dockerfileLabels = computed(() => {
|
|||||||
</n-form-item>
|
</n-form-item>
|
||||||
|
|
||||||
<n-form-item label="Description:">
|
<n-form-item label="Description:">
|
||||||
<n-input
|
<n-input v-model:value="form.description" type="textarea" placeholder="Short project description" />
|
||||||
v-model:value="form.description"
|
|
||||||
type="textarea"
|
|
||||||
placeholder="Short project description"
|
|
||||||
/>
|
|
||||||
</n-form-item>
|
</n-form-item>
|
||||||
|
|
||||||
<n-form-item label="Repository URL:">
|
<n-form-item label="Repository URL:">
|
||||||
@@ -77,10 +73,7 @@ const dockerfileLabels = computed(() => {
|
|||||||
</n-form-item>
|
</n-form-item>
|
||||||
|
|
||||||
<n-form-item label="Documentation URL:">
|
<n-form-item label="Documentation URL:">
|
||||||
<n-input
|
<n-input v-model:value="form.documentation" placeholder="https://github.com/username/repo#readme" />
|
||||||
v-model:value="form.documentation"
|
|
||||||
placeholder="https://github.com/username/repo#readme"
|
|
||||||
/>
|
|
||||||
</n-form-item>
|
</n-form-item>
|
||||||
|
|
||||||
<n-form-item label="License (SPDX):">
|
<n-form-item label="License (SPDX):">
|
||||||
|
|||||||
@@ -16,22 +16,19 @@ const parsedEmail = computedAsync(async () => {
|
|||||||
try {
|
try {
|
||||||
if (inputType.value === 'file' && file) {
|
if (inputType.value === 'file' && file) {
|
||||||
return await PostalMime.parse(await file.arrayBuffer());
|
return await PostalMime.parse(await file.arrayBuffer());
|
||||||
}
|
} else if (inputType.value === 'content' && emailContentValue) {
|
||||||
else if (inputType.value === 'content' && emailContentValue) {
|
|
||||||
return await PostalMime.parse(emailContentValue);
|
return await PostalMime.parse(emailContentValue);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
} catch (e: any) {
|
||||||
catch (e: any) {
|
|
||||||
error.value = e.toString();
|
error.value = e.toString();
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
function downloadFile(data: ArrayBuffer | string, fileName: string, fileType: string) {
|
function downloadFile(data: ArrayBuffer | Uint8Array | string, fileName: string, fileType: string) {
|
||||||
const blob = new Blob([data], { type: fileType || 'application/octet-stream' });
|
const blob = new Blob([data as BlobPart], { type: fileType || 'application/octet-stream' });
|
||||||
const downloadUrl = URL.createObjectURL(blob);
|
const downloadUrl = URL.createObjectURL(blob);
|
||||||
const a = document.createElement('a');
|
const a = document.createElement('a');
|
||||||
a.href = downloadUrl;
|
a.href = downloadUrl;
|
||||||
@@ -53,14 +50,8 @@ function onUpload(file: File) {
|
|||||||
<c-card :title="t('tools.email-parser.texts.title-input')" mb-2>
|
<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-radio-group v-model:value="inputType" name="radiogroup" mb-2 flex justify-center>
|
||||||
<n-space>
|
<n-space>
|
||||||
<n-radio
|
<n-radio value="file" :label="t('tools.email-parser.texts.label-file')" />
|
||||||
value="file"
|
<n-radio value="content" :label="t('tools.email-parser.texts.label-content')" />
|
||||||
:label="t('tools.email-parser.texts.label-file')"
|
|
||||||
/>
|
|
||||||
<n-radio
|
|
||||||
value="content"
|
|
||||||
:label="t('tools.email-parser.texts.label-content')"
|
|
||||||
/>
|
|
||||||
</n-space>
|
</n-space>
|
||||||
</n-radio-group>
|
</n-radio-group>
|
||||||
|
|
||||||
@@ -86,15 +77,51 @@ function onUpload(file: File) {
|
|||||||
</c-alert>
|
</c-alert>
|
||||||
|
|
||||||
<c-card v-if="!error && parsedEmail" :title="t('tools.email-parser.texts.title-output')">
|
<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
|
||||||
<input-copyable v-if="parsedEmail.date" :label="t('tools.email-parser.texts.label-date')" :value="parsedEmail.date" />
|
v-if="fileInput?.name"
|
||||||
<input-copyable v-if="parsedEmail.from?.name" :label="t('tools.email-parser.texts.label-from-name')" :value="parsedEmail.from?.name" />
|
:label="t('tools.email-parser.texts.label-file-name')"
|
||||||
<input-copyable v-if="parsedEmail.from" :label="t('tools.email-parser.texts.label-from-address')" :value="parsedEmail.from?.address || parsedEmail.from" />
|
:value="fileInput?.name"
|
||||||
<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
|
||||||
<input-copyable v-if="parsedEmail.bcc" :label="t('tools.email-parser.texts.label-bcc')" :value="JSON.stringify(parsedEmail.bcc)" />
|
v-if="parsedEmail.date"
|
||||||
<input-copyable v-if="parsedEmail.replyTo" :label="t('tools.email-parser.texts.label-reply-to')" :value="JSON.stringify(parsedEmail.replyTo)" />
|
:label="t('tools.email-parser.texts.label-date')"
|
||||||
<input-copyable v-if="parsedEmail.subject" :label="t('tools.email-parser.texts.label-subject')" :value="parsedEmail.subject" />
|
: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>
|
<c-card v-if="parsedEmail.text" :title="t('tools.email-parser.texts.title-plain-content')" mb-2>
|
||||||
<details>
|
<details>
|
||||||
<summary>{{ t('tools.email-parser.texts.tag-see-content') }}</summary>
|
<summary>{{ t('tools.email-parser.texts.tag-see-content') }}</summary>
|
||||||
@@ -113,14 +140,12 @@ function onUpload(file: File) {
|
|||||||
<tr>
|
<tr>
|
||||||
<th scope="col">
|
<th scope="col">
|
||||||
{{ t('tools.email-parser.texts.tag-attachment') }}
|
{{ t('tools.email-parser.texts.tag-attachment') }}
|
||||||
</th><th scope="col" />
|
</th>
|
||||||
|
<th scope="col" />
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr
|
<tr v-for="(h, index) in parsedEmail.attachments || []" :key="index">
|
||||||
v-for="(h, index) in parsedEmail.attachments || []"
|
|
||||||
:key="index"
|
|
||||||
>
|
|
||||||
<td>
|
<td>
|
||||||
{{ `${h.filename || h.contentId || 'noname'} (${h.mimeType}) / ${h.disposition}` }}
|
{{ `${h.filename || h.contentId || 'noname'} (${h.mimeType}) / ${h.disposition}` }}
|
||||||
</td>
|
</td>
|
||||||
@@ -134,21 +159,44 @@ function onUpload(file: File) {
|
|||||||
</n-table>
|
</n-table>
|
||||||
</c-card>
|
</c-card>
|
||||||
|
|
||||||
<input-copyable v-if="parsedEmail.messageId" :label="t('tools.email-parser.texts.label-message-id')" :value="parsedEmail.messageId" />
|
<input-copyable
|
||||||
<input-copyable v-if="parsedEmail.inReplyTo" :label="t('tools.email-parser.texts.label-in-reply-to')" :value="parsedEmail.inReplyTo" />
|
v-if="parsedEmail.messageId"
|
||||||
<input-copyable v-if="parsedEmail.references" :label="t('tools.email-parser.texts.label-references')" :value="parsedEmail.references" />
|
:label="t('tools.email-parser.texts.label-message-id')"
|
||||||
<input-copyable v-if="parsedEmail.deliveredTo" :label="t('tools.email-parser.texts.label-delivered-to')" :value="parsedEmail.deliveredTo" />
|
:value="parsedEmail.messageId"
|
||||||
<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
|
||||||
<input-copyable v-if="parsedEmail.sender" :label="t('tools.email-parser.texts.label-sender-address')" :value="parsedEmail.sender?.address || parsedEmail.sender" />
|
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>
|
<c-card :title="t('tools.email-parser.texts.title-all-headers')" mt-2>
|
||||||
<input-copyable
|
<input-copyable v-for="(h, index) in parsedEmail.headers || []" :key="index" :label="h.key" :value="h.value" />
|
||||||
v-for="(h, index) in parsedEmail.headers || []"
|
|
||||||
:key="index"
|
|
||||||
:label="h.key"
|
|
||||||
:value="h.value"
|
|
||||||
/>
|
|
||||||
</c-card>
|
</c-card>
|
||||||
</c-card>
|
</c-card>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -19,10 +19,10 @@ import {
|
|||||||
createSHA512, // (): Promise<IHasher>
|
createSHA512, // (): Promise<IHasher>
|
||||||
createSM3, // (): Promise<IHasher>
|
createSM3, // (): Promise<IHasher>
|
||||||
createWhirlpool, // (): Promise<IHasher>
|
createWhirlpool, // (): Promise<IHasher>
|
||||||
// createXXHash32, //(seed: number): Promise<IHasher>
|
// createXXHash32, //(seed: number): Promise<IHasher>
|
||||||
// createXXHash64, //(seedLow: number, seedHigh: number): Promise<IHasher>
|
// createXXHash64, //(seedLow: number, seedHigh: number): Promise<IHasher>
|
||||||
// createXXHash3, //(seedLow: number, seedHigh: number): Promise<IHasher>
|
// createXXHash3, //(seedLow: number, seedHigh: number): Promise<IHasher>
|
||||||
// createXXHash128, //(seedLow: number, seedHigh: number): Promise<IHasher>
|
// createXXHash128, //(seedLow: number, seedHigh: number): Promise<IHasher>
|
||||||
} from 'hash-wasm';
|
} from 'hash-wasm';
|
||||||
import type { lib } from 'crypto-js';
|
import type { lib } from 'crypto-js';
|
||||||
import { enc } from 'crypto-js';
|
import { enc } from 'crypto-js';
|
||||||
@@ -97,7 +97,7 @@ const fileReader = new FileReader();
|
|||||||
async function hashChunkAsync(chunk: Blob, hashers: IHasher[]) {
|
async function hashChunkAsync(chunk: Blob, hashers: IHasher[]) {
|
||||||
return new Promise<void>((resolve, _reject) => {
|
return new Promise<void>((resolve, _reject) => {
|
||||||
fileReader.onload = async (e) => {
|
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) {
|
for (const hasher of hashers) {
|
||||||
hasher.update(view);
|
hasher.update(view);
|
||||||
}
|
}
|
||||||
@@ -116,10 +116,7 @@ async function hashFileAsync(file: File) {
|
|||||||
|
|
||||||
const hashers = await getHashersAsync();
|
const hashers = await getHashersAsync();
|
||||||
for (let i = 0; i <= chunkNumber; i++) {
|
for (let i = 0; i <= chunkNumber; i++) {
|
||||||
const chunk = file.slice(
|
const chunk = file.slice(chunkSize * i, Math.min(chunkSize * (i + 1), file.size));
|
||||||
chunkSize * i,
|
|
||||||
Math.min(chunkSize * (i + 1), file.size),
|
|
||||||
);
|
|
||||||
await hashChunkAsync(chunk, Object.values(hashers));
|
await hashChunkAsync(chunk, Object.values(hashers));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -138,15 +135,18 @@ async function onUpload(uploadedFile: File) {
|
|||||||
try {
|
try {
|
||||||
hashes.value = await hashFileAsync(uploadedFile);
|
hashes.value = await hashFileAsync(uploadedFile);
|
||||||
status.value = 'done';
|
status.value = 'done';
|
||||||
}
|
} catch (e) {
|
||||||
catch (e) {
|
|
||||||
status.value = 'error';
|
status.value = 'error';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
type Encoding = keyof typeof enc | 'Bin';
|
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) {
|
function formatWithEncoding(words: lib.WordArray, encoding: Encoding) {
|
||||||
if (encoding === 'Bin') {
|
if (encoding === 'Bin') {
|
||||||
@@ -156,16 +156,18 @@ function formatWithEncoding(words: lib.WordArray, encoding: Encoding) {
|
|||||||
return words.toString(enc[encoding]);
|
return words.toString(enc[encoding]);
|
||||||
}
|
}
|
||||||
|
|
||||||
const hashWasmValues = computed(() => withDefaultOnError(() => {
|
const hashWasmValues = computed(() =>
|
||||||
const encodingValue = encoding.value;
|
withDefaultOnError(() => {
|
||||||
const hashesValue = hashes.value;
|
const encodingValue = encoding.value;
|
||||||
|
const hashesValue = hashes.value;
|
||||||
|
|
||||||
const ret = defaultHashWasmValues;
|
const ret = defaultHashWasmValues;
|
||||||
for (const algo of algoWasmNames) {
|
for (const algo of algoWasmNames) {
|
||||||
ret[algo] = formatWithEncoding(enc.Hex.parse(hashesValue[algo]), encodingValue);
|
ret[algo] = formatWithEncoding(enc.Hex.parse(hashesValue[algo]), encodingValue);
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}, defaultHashWasmValues));
|
}, defaultHashWasmValues),
|
||||||
|
);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
@@ -204,13 +206,8 @@ const hashWasmValues = computed(() => withDefaultOnError(() => {
|
|||||||
</c-card>
|
</c-card>
|
||||||
|
|
||||||
<div mt-3 flex justify-center>
|
<div mt-3 flex justify-center>
|
||||||
<c-alert v-if="status === 'error'" type="error">
|
<c-alert v-if="status === 'error'" type="error"> An error occured hashing file '{{ file?.name }}'. </c-alert>
|
||||||
An error occured hashing file '{{ file?.name }}'.
|
<n-spin v-if="status === 'processing'" size="small" />
|
||||||
</c-alert>
|
|
||||||
<n-spin
|
|
||||||
v-if="status === 'processing'"
|
|
||||||
size="small"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<c-card v-if="status === 'done'" :title="`Hashes of ${file?.name}`">
|
<c-card v-if="status === 'done'" :title="`Hashes of ${file?.name}`">
|
||||||
|
|||||||
@@ -35,7 +35,14 @@ const command = computed(() => {
|
|||||||
<div>
|
<div>
|
||||||
<NForm label-width="120px" label-placement="left">
|
<NForm label-width="120px" label-placement="left">
|
||||||
<NFormItem :label="t('tools.firewalld-generator.texts.label-zone')">
|
<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>
|
||||||
|
|
||||||
<NFormItem :label="t('tools.firewalld-generator.texts.label-action')">
|
<NFormItem :label="t('tools.firewalld-generator.texts.label-action')">
|
||||||
@@ -47,11 +54,23 @@ const command = computed(() => {
|
|||||||
</NFormItem>
|
</NFormItem>
|
||||||
|
|
||||||
<NFormItem :label="t('tools.firewalld-generator.texts.label-value')">
|
<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>
|
||||||
|
|
||||||
<NFormItem :label="t('tools.firewalld-generator.texts.label-permanent')">
|
<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>
|
</NFormItem>
|
||||||
</NForm>
|
</NForm>
|
||||||
|
|
||||||
|
|||||||
+35
-10
@@ -9,45 +9,68 @@ export function convertDecimalToBinary({ value, bitCount }: { value: string; bit
|
|||||||
}
|
}
|
||||||
|
|
||||||
switch (bitCount) {
|
switch (bitCount) {
|
||||||
case 32: { // Single precision
|
case 32: {
|
||||||
|
// Single precision
|
||||||
const uint = new Uint32Array(Float32Array.of(number).buffer);
|
const uint = new Uint32Array(Float32Array.of(number).buffer);
|
||||||
return uint[0].toString(2).padStart(32, '0');
|
return uint[0].toString(2).padStart(32, '0');
|
||||||
}
|
}
|
||||||
case 64: { // Double precision
|
case 64: {
|
||||||
|
// Double precision
|
||||||
const uint = new Uint32Array(Float64Array.of(number).buffer);
|
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:
|
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]/)) {
|
if (value.match(/[^01]/)) {
|
||||||
throw new Error(t('tools.floating-point-number-converter.model.text.not-a-binary-number'));
|
throw new Error(t('tools.floating-point-number-converter.model.text.not-a-binary-number'));
|
||||||
}
|
}
|
||||||
if (decimalPrecision.match(/[^\d]/)) {
|
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;
|
let result: number;
|
||||||
switch (value.length) {
|
switch (value.length) {
|
||||||
case 32: {
|
case 32: {
|
||||||
const binary = [Number.parseInt(value, 2)];
|
const binary = [Number.parseInt(value, 2)];
|
||||||
result = (new Float32Array(Uint32Array.from(binary).buffer))[0];
|
result = new Float32Array(Uint32Array.from(binary).buffer)[0];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 64: {
|
case 64: {
|
||||||
const binary = [Number.parseInt(value.substring(32), 2), Number.parseInt(value.substring(0, 32), 2)];
|
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;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
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;
|
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) {
|
if (removeZeroPadding) {
|
||||||
resultString = resultString.replace(/\.(\d+?)(0+)$/, '.$1');
|
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 }) {
|
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');
|
return (Number.parseFloat(decimalInput) - Number.parseFloat(actualValue)).toFixed(32).replace(/\.(\d+?)(0+)$/, '.$1');
|
||||||
}
|
}
|
||||||
@@ -2,37 +2,37 @@
|
|||||||
import UnitsConverter from '@/components/UnitsConverter.vue';
|
import UnitsConverter from '@/components/UnitsConverter.vue';
|
||||||
|
|
||||||
const supportedUnits = {
|
const supportedUnits = {
|
||||||
'N': 'newton',
|
N: 'newton',
|
||||||
'PN': 'petanewton',
|
PN: 'petanewton',
|
||||||
'TN': 'teranewton',
|
TN: 'teranewton',
|
||||||
'GN': 'giganewton',
|
GN: 'giganewton',
|
||||||
'MN': 'meganewton',
|
MN: 'meganewton',
|
||||||
'kN': 'kilonewton',
|
kN: 'kilonewton',
|
||||||
'hN': 'hectonewton',
|
hN: 'hectonewton',
|
||||||
'daN': 'decanewton',
|
daN: 'decanewton',
|
||||||
'dN': 'decinewton',
|
dN: 'decinewton',
|
||||||
'cN': 'centinewton',
|
cN: 'centinewton',
|
||||||
'mN': 'millinewton',
|
mN: 'millinewton',
|
||||||
'µN': 'micronewton',
|
µN: 'micronewton',
|
||||||
'nN': 'nanonewton',
|
nN: 'nanonewton',
|
||||||
'pN': 'piconewton',
|
pN: 'piconewton',
|
||||||
'fN': 'femtonewton',
|
fN: 'femtonewton',
|
||||||
'dyn': 'dyne',
|
dyn: 'dyne',
|
||||||
'lbf': 'pound of force',
|
lbf: 'pound of force',
|
||||||
'kip': 'kip',
|
kip: 'kip',
|
||||||
'klb': 'klb',
|
klb: 'klb',
|
||||||
'kipf': 'kipf',
|
kipf: 'kipf',
|
||||||
'klbf': 'klbf',
|
klbf: 'klbf',
|
||||||
'pdl': 'poundal',
|
pdl: 'poundal',
|
||||||
'kgf': 'kilogram-force',
|
kgf: 'kilogram-force',
|
||||||
'kp': 'kilopond',
|
kp: 'kilopond',
|
||||||
'Mp': 'megapond',
|
Mp: 'megapond',
|
||||||
'tf': 'tonne-force',
|
tf: 'tonne-force',
|
||||||
'metric tf': 'metric ton-force',
|
'metric tf': 'metric ton-force',
|
||||||
'megagram-force': 'megagram-force',
|
'megagram-force': 'megagram-force',
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<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>
|
</template>
|
||||||
@@ -18,7 +18,7 @@ ffmpeg.on('log', ({ message }) => {
|
|||||||
|
|
||||||
const loading = ref(false);
|
const loading = ref(false);
|
||||||
const error = ref('');
|
const error = ref('');
|
||||||
const loop = ref('5');
|
const loop = ref(5);
|
||||||
|
|
||||||
async function loadFFmpeg() {
|
async function loadFFmpeg() {
|
||||||
if (!ffmpeg.loaded) {
|
if (!ffmpeg.loaded) {
|
||||||
@@ -49,16 +49,21 @@ async function onFileUploaded(gifFile: File) {
|
|||||||
ffmpeg.writeFile(inputName, buffer);
|
ffmpeg.writeFile(inputName, buffer);
|
||||||
|
|
||||||
await ffmpeg.exec([
|
await ffmpeg.exec([
|
||||||
'-stream_loop', loop.value,
|
'-stream_loop',
|
||||||
'-i', inputName,
|
loop.value.toString(),
|
||||||
'-movflags', 'faststart',
|
'-i',
|
||||||
'-pix_fmt', 'yuv420p',
|
inputName,
|
||||||
'-vf', 'scale=trunc(iw/2)*2:trunc(ih/2)*2',
|
'-movflags',
|
||||||
|
'faststart',
|
||||||
|
'-pix_fmt',
|
||||||
|
'yuv420p',
|
||||||
|
'-vf',
|
||||||
|
'scale=trunc(iw/2)*2:trunc(ih/2)*2',
|
||||||
outputName,
|
outputName,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const data = await ffmpeg.readFile(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 url = URL.createObjectURL(blob);
|
||||||
|
|
||||||
const a = document.createElement('a');
|
const a = document.createElement('a');
|
||||||
@@ -67,11 +72,9 @@ async function onFileUploaded(gifFile: File) {
|
|||||||
a.click();
|
a.click();
|
||||||
|
|
||||||
URL.revokeObjectURL(url);
|
URL.revokeObjectURL(url);
|
||||||
}
|
} catch (err: any) {
|
||||||
catch (err: any) {
|
|
||||||
error.value = err.toString();
|
error.value = err.toString();
|
||||||
}
|
} finally {
|
||||||
finally {
|
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -99,10 +102,7 @@ async function onFileUploaded(gifFile: File) {
|
|||||||
<c-alert v-if="error" type="error">
|
<c-alert v-if="error" type="error">
|
||||||
{{ error }}
|
{{ error }}
|
||||||
</c-alert>
|
</c-alert>
|
||||||
<n-spin
|
<n-spin v-if="loading" size="small" />
|
||||||
v-if="loading"
|
|
||||||
size="small"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<c-card :title="t('tools.gif-to-mp4.texts.title-logs')">
|
<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() {
|
async function loadOptions() {
|
||||||
const now = Date.now();
|
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) {
|
if (!isStale) {
|
||||||
// Use cached options
|
// Use cached options
|
||||||
@@ -23,7 +23,9 @@ async function loadOptions() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
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();
|
const files = await res.json();
|
||||||
options.value = files.tree
|
options.value = files.tree
|
||||||
.filter((f: any) => f.path.endsWith('.gitattributes'))
|
.filter((f: any) => f.path.endsWith('.gitattributes'))
|
||||||
@@ -34,8 +36,7 @@ async function loadOptions() {
|
|||||||
value: name,
|
value: name,
|
||||||
}));
|
}));
|
||||||
lastFetched.value = now;
|
lastFetched.value = now;
|
||||||
}
|
} catch {
|
||||||
catch {
|
|
||||||
if (!options.value?.length) {
|
if (!options.value?.length) {
|
||||||
options.value = [
|
options.value = [
|
||||||
'ActionScript',
|
'ActionScript',
|
||||||
@@ -61,7 +62,7 @@ async function loadOptions() {
|
|||||||
'Servoy',
|
'Servoy',
|
||||||
'VisualStudio',
|
'VisualStudio',
|
||||||
'Web',
|
'Web',
|
||||||
].map(name => ({
|
].map((name) => ({
|
||||||
label: name,
|
label: name,
|
||||||
value: name,
|
value: name,
|
||||||
}));
|
}));
|
||||||
@@ -83,10 +84,10 @@ async function generateOutput() {
|
|||||||
// Multi-command generation
|
// Multi-command generation
|
||||||
const commands = computed(() => {
|
const commands = computed(() => {
|
||||||
if (!selected.value.length) {
|
if (!selected.value.length) {
|
||||||
return {};
|
return { curl: '', wget: '', powershell: '', cmd: '' };
|
||||||
}
|
}
|
||||||
const urls = selected.value
|
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(' ');
|
.join(' ');
|
||||||
return {
|
return {
|
||||||
curl: `curl ${urls} > .gitattributes`,
|
curl: `curl ${urls} > .gitattributes`,
|
||||||
@@ -116,11 +117,7 @@ onMounted(loadOptions);
|
|||||||
</NButton>
|
</NButton>
|
||||||
</n-space>
|
</n-space>
|
||||||
<c-card v-if="output" :title="t('tools.gitattributes-generator.texts.title-preview')" mb-2>
|
<c-card v-if="output" :title="t('tools.gitattributes-generator.texts.title-preview')" mb-2>
|
||||||
<textarea-copyable
|
<textarea-copyable :value="output" language="bash" download-file-name=".gitattributes" />
|
||||||
:value="output"
|
|
||||||
language="bash"
|
|
||||||
download-file-name=".gitattributes"
|
|
||||||
/>
|
|
||||||
</c-card>
|
</c-card>
|
||||||
|
|
||||||
<NTabs v-if="output" type="line" animated>
|
<NTabs v-if="output" type="line" animated>
|
||||||
|
|||||||
+28
-28
@@ -1,30 +1,30 @@
|
|||||||
declare module 'heic-convert/browser' {
|
declare module 'heic-convert/browser' {
|
||||||
interface ConversionOptions {
|
interface ConversionOptions {
|
||||||
/**
|
/**
|
||||||
* the HEIC file buffer
|
* the HEIC file buffer
|
||||||
*/
|
*/
|
||||||
buffer: ArrayBufferLike;
|
buffer: ArrayBufferLike | Uint8Array;
|
||||||
/**
|
/**
|
||||||
* output format
|
* output format
|
||||||
*/
|
*/
|
||||||
format: "JPEG" | "PNG";
|
format: 'JPEG' | 'PNG';
|
||||||
/**
|
/**
|
||||||
* the JPEG compression quality, between 0 and 1
|
* the JPEG compression quality, between 0 and 1
|
||||||
* @default 0.92
|
* @default 0.92
|
||||||
*/
|
*/
|
||||||
quality?: number;
|
quality?: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface Convertible {
|
interface Convertible {
|
||||||
convert(): Promise<ArrayBuffer>;
|
convert(): Promise<ArrayBuffer>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @async */
|
||||||
|
function convert(image: ConversionOptions): Promise<ArrayBuffer>;
|
||||||
|
namespace convert {
|
||||||
/** @async */
|
/** @async */
|
||||||
declare function convert(image: ConversionOptions): Promise<ArrayBuffer>;
|
function all(image: ConversionOptions): Promise<Convertible[]>;
|
||||||
declare namespace convert {
|
}
|
||||||
/** @async */
|
|
||||||
function all(image: ConversionOptions): Promise<Convertible[]>;
|
export default convert;
|
||||||
}
|
}
|
||||||
|
|
||||||
export default convert;
|
|
||||||
}
|
|
||||||
@@ -58,8 +58,7 @@ function urlToFilename(input: string): string {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
url = new URL(input);
|
url = new URL(input);
|
||||||
}
|
} catch {
|
||||||
catch {
|
|
||||||
throw new Error(`Invalid URL: ${input}`);
|
throw new Error(`Invalid URL: ${input}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -91,18 +90,15 @@ async function generateFromUrl() {
|
|||||||
isRunning.value = true;
|
isRunning.value = true;
|
||||||
try {
|
try {
|
||||||
const res = await fetch(`${serverHost.value}/pdf/url`, {
|
const res = await fetch(`${serverHost.value}/pdf/url`, {
|
||||||
...{
|
method: 'POST',
|
||||||
method: 'POST',
|
headers: { 'Content-Type': 'application/json' },
|
||||||
headers: { 'Content-Type': 'application/json' },
|
body: JSON.stringify(payload),
|
||||||
body: JSON.stringify(payload),
|
|
||||||
},
|
|
||||||
...(serverAuth.value ? { headers: { Authorization: `Basic ${Base64.encode(serverAuth.value)}` } } : {}),
|
...(serverAuth.value ? { headers: { Authorization: `Basic ${Base64.encode(serverAuth.value)}` } } : {}),
|
||||||
});
|
});
|
||||||
|
|
||||||
const blob = await res.blob();
|
const blob = await res.blob();
|
||||||
downloadBlob(blob, `${urlToFilename(url.value)}.pdf`);
|
downloadBlob(blob, `${urlToFilename(url.value)}.pdf`);
|
||||||
}
|
} catch (e: any) {
|
||||||
catch (e: any) {
|
|
||||||
error.value = e.toString();
|
error.value = e.toString();
|
||||||
}
|
}
|
||||||
isRunning.value = false;
|
isRunning.value = false;
|
||||||
@@ -115,18 +111,15 @@ async function generateFromHtml() {
|
|||||||
isRunning.value = true;
|
isRunning.value = true;
|
||||||
try {
|
try {
|
||||||
const res = await fetch(`${serverHost.value}/pdf/html`, {
|
const res = await fetch(`${serverHost.value}/pdf/html`, {
|
||||||
...{
|
method: 'POST',
|
||||||
method: 'POST',
|
headers: { 'Content-Type': 'application/json' },
|
||||||
headers: { 'Content-Type': 'application/json' },
|
body: JSON.stringify(payload),
|
||||||
body: JSON.stringify(payload),
|
|
||||||
},
|
|
||||||
...(serverAuth.value ? { headers: { Authorization: `Basic ${Base64.encode(serverAuth.value)}` } } : {}),
|
...(serverAuth.value ? { headers: { Authorization: `Basic ${Base64.encode(serverAuth.value)}` } } : {}),
|
||||||
});
|
});
|
||||||
|
|
||||||
const blob = await res.blob();
|
const blob = await res.blob();
|
||||||
downloadBlob(blob, 'printed.pdf');
|
downloadBlob(blob, 'printed.pdf');
|
||||||
}
|
} catch (e: any) {
|
||||||
catch (e: any) {
|
|
||||||
error.value = e.toString();
|
error.value = e.toString();
|
||||||
}
|
}
|
||||||
isRunning.value = false;
|
isRunning.value = false;
|
||||||
@@ -134,7 +127,7 @@ async function generateFromHtml() {
|
|||||||
|
|
||||||
const batchUrls = ref('');
|
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 batchProgress = ref(0);
|
||||||
const batchTotal = ref(0);
|
const batchTotal = ref(0);
|
||||||
const isBatchRunning = ref(false);
|
const isBatchRunning = ref(false);
|
||||||
@@ -142,7 +135,7 @@ const isBatchRunning = ref(false);
|
|||||||
async function generateBatch() {
|
async function generateBatch() {
|
||||||
const urls = batchUrls.value
|
const urls = batchUrls.value
|
||||||
.split('\n')
|
.split('\n')
|
||||||
.map(u => u.trim())
|
.map((u) => u.trim())
|
||||||
.filter(Boolean);
|
.filter(Boolean);
|
||||||
|
|
||||||
batchResults.value = [];
|
batchResults.value = [];
|
||||||
@@ -155,11 +148,9 @@ async function generateBatch() {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
const res = await fetch(`${serverHost.value}/pdf/url`, {
|
const res = await fetch(`${serverHost.value}/pdf/url`, {
|
||||||
...{
|
method: 'POST',
|
||||||
method: 'POST',
|
headers: { 'Content-Type': 'application/json' },
|
||||||
headers: { 'Content-Type': 'application/json' },
|
body: JSON.stringify(payload),
|
||||||
body: JSON.stringify(payload),
|
|
||||||
},
|
|
||||||
...(serverAuth.value ? { headers: { Authorization: `Basic ${Base64.encode(serverAuth.value)}` } } : {}),
|
...(serverAuth.value ? { headers: { Authorization: `Basic ${Base64.encode(serverAuth.value)}` } } : {}),
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -170,8 +161,7 @@ async function generateBatch() {
|
|||||||
status: 'success',
|
status: 'success',
|
||||||
pdfBlob: blob,
|
pdfBlob: blob,
|
||||||
});
|
});
|
||||||
}
|
} catch (err: any) {
|
||||||
catch (err: any) {
|
|
||||||
batchResults.value.push({
|
batchResults.value.push({
|
||||||
url: u,
|
url: u,
|
||||||
status: 'error',
|
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>
|
<summary>{{ t('tools.html-to-pdf.texts.tag-html-to-pdf-service-configuration-self-hosted') }}</summary>
|
||||||
<n-card>
|
<n-card>
|
||||||
<NFormItem :label="t('tools.html-to-pdf.texts.label-html-to-pdf-service-url')" label-placement="top">
|
<NFormItem :label="t('tools.html-to-pdf.texts.label-html-to-pdf-service-url')" label-placement="top">
|
||||||
<NInput v-model:value="serverHost" :placeholder="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>
|
||||||
<NFormItem :label="t('tools.html-to-pdf.texts.label-basic-authentication')" label-placement="left" label-width="auto">
|
<NFormItem
|
||||||
<NInput v-model:value="serverAuth" :placeholder="t('tools.html-to-pdf.texts.placeholder-username-password')" />
|
: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>
|
</NFormItem>
|
||||||
<n-p>
|
<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') }}
|
{{ t('tools.html-to-pdf.texts.tag-html-to-pdf-service-install') }}
|
||||||
</c-link>
|
</c-link>
|
||||||
</n-p>
|
</n-p>
|
||||||
@@ -213,12 +217,7 @@ async function generateBatch() {
|
|||||||
</NFormItem>
|
</NFormItem>
|
||||||
|
|
||||||
<n-space mb-2 justify="center">
|
<n-space mb-2 justify="center">
|
||||||
<NButton
|
<NButton type="primary" :loading="isRunning" :disabled="isRunning" @click="generateFromUrl">
|
||||||
type="primary"
|
|
||||||
:loading="isRunning"
|
|
||||||
:disabled="isRunning"
|
|
||||||
@click="generateFromUrl"
|
|
||||||
>
|
|
||||||
{{ t('tools.html-to-pdf.texts.tag-generate-pdf') }}
|
{{ t('tools.html-to-pdf.texts.tag-generate-pdf') }}
|
||||||
</NButton>
|
</NButton>
|
||||||
</n-space>
|
</n-space>
|
||||||
@@ -232,20 +231,11 @@ async function generateBatch() {
|
|||||||
<NTabPane name="html" :tab="t('tools.html-to-pdf.texts.tab-html-pdf')">
|
<NTabPane name="html" :tab="t('tools.html-to-pdf.texts.tab-html-pdf')">
|
||||||
<NForm label-placement="top">
|
<NForm label-placement="top">
|
||||||
<NFormItem :label="t('tools.html-to-pdf.texts.label-html-content')">
|
<NFormItem :label="t('tools.html-to-pdf.texts.label-html-content')">
|
||||||
<NInput
|
<NInput v-model:value="html" type="textarea" :autosize="{ minRows: 10 }" />
|
||||||
v-model:value="html"
|
|
||||||
type="textarea"
|
|
||||||
:autosize="{ minRows: 10 }"
|
|
||||||
/>
|
|
||||||
</NFormItem>
|
</NFormItem>
|
||||||
|
|
||||||
<n-space mb-2 justify="center">
|
<n-space mb-2 justify="center">
|
||||||
<NButton
|
<NButton type="primary" :loading="isRunning" :disabled="isRunning" @click="generateFromHtml">
|
||||||
type="primary"
|
|
||||||
:loading="isRunning"
|
|
||||||
:disabled="isRunning"
|
|
||||||
@click="generateFromHtml"
|
|
||||||
>
|
|
||||||
{{ t('tools.html-to-pdf.texts.tag-generate-pdf') }}
|
{{ t('tools.html-to-pdf.texts.tag-generate-pdf') }}
|
||||||
</NButton>
|
</NButton>
|
||||||
</n-space>
|
</n-space>
|
||||||
@@ -259,20 +249,11 @@ async function generateBatch() {
|
|||||||
<NTabPane name="batch" :tab="t('tools.html-to-pdf.texts.tab-batch-url-pdf')">
|
<NTabPane name="batch" :tab="t('tools.html-to-pdf.texts.tab-batch-url-pdf')">
|
||||||
<NForm label-placement="top">
|
<NForm label-placement="top">
|
||||||
<NFormItem :label="t('tools.html-to-pdf.texts.label-urls-one-per-line')">
|
<NFormItem :label="t('tools.html-to-pdf.texts.label-urls-one-per-line')">
|
||||||
<NInput
|
<NInput v-model:value="batchUrls" type="textarea" :autosize="{ minRows: 8 }" />
|
||||||
v-model:value="batchUrls"
|
|
||||||
type="textarea"
|
|
||||||
:autosize="{ minRows: 8 }"
|
|
||||||
/>
|
|
||||||
</NFormItem>
|
</NFormItem>
|
||||||
|
|
||||||
<n-space mb-2 justify="center">
|
<n-space mb-2 justify="center">
|
||||||
<NButton
|
<NButton type="primary" :loading="isBatchRunning" :disabled="isBatchRunning" @click="generateBatch">
|
||||||
type="primary"
|
|
||||||
:loading="isBatchRunning"
|
|
||||||
:disabled="isBatchRunning"
|
|
||||||
@click="generateBatch"
|
|
||||||
>
|
|
||||||
{{ t('tools.html-to-pdf.texts.tag-generate-pdfs') }}
|
{{ t('tools.html-to-pdf.texts.tag-generate-pdfs') }}
|
||||||
</NButton>
|
</NButton>
|
||||||
</n-space>
|
</n-space>
|
||||||
@@ -285,9 +266,7 @@ async function generateBatch() {
|
|||||||
indicator-placement="inside"
|
indicator-placement="inside"
|
||||||
processing
|
processing
|
||||||
/>
|
/>
|
||||||
<n-space justify="center">
|
<n-space justify="center"> {{ batchProgress }} / {{ batchTotal }} processed </n-space>
|
||||||
{{ batchProgress }} / {{ batchTotal }} processed
|
|
||||||
</n-space>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Results -->
|
<!-- Results -->
|
||||||
@@ -298,10 +277,7 @@ async function generateBatch() {
|
|||||||
<th>{{ t('tools.html-to-pdf.texts.tag-download') }}</th>
|
<th>{{ t('tools.html-to-pdf.texts.tag-download') }}</th>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr
|
<tr v-for="item in batchResults" :key="item.url">
|
||||||
v-for="item in batchResults"
|
|
||||||
:key="item.url"
|
|
||||||
>
|
|
||||||
<td>
|
<td>
|
||||||
<strong>{{ item.url }}</strong>
|
<strong>{{ item.url }}</strong>
|
||||||
</td>
|
</td>
|
||||||
@@ -336,10 +312,7 @@ async function generateBatch() {
|
|||||||
<NTabPane name="custom-options" :tab="t('tools.html-to-pdf.texts.tab-custom-pdf-options')">
|
<NTabPane name="custom-options" :tab="t('tools.html-to-pdf.texts.tab-custom-pdf-options')">
|
||||||
<NForm label-placement="left">
|
<NForm label-placement="left">
|
||||||
<NFormItem :label="t('tools.html-to-pdf.texts.label-format')">
|
<NFormItem :label="t('tools.html-to-pdf.texts.label-format')">
|
||||||
<NSelect
|
<NSelect v-model:value="options.format" :options="pdfFormats" />
|
||||||
v-model:value="options.format"
|
|
||||||
:options="pdfFormats"
|
|
||||||
/>
|
|
||||||
</NFormItem>
|
</NFormItem>
|
||||||
|
|
||||||
<NFormItem :label="t('tools.html-to-pdf.texts.label-language')">
|
<NFormItem :label="t('tools.html-to-pdf.texts.label-language')">
|
||||||
|
|||||||
@@ -1,27 +1,34 @@
|
|||||||
import { DomUtils, parseDocument } from 'htmlparser2';
|
import { DomUtils, parseDocument } from 'htmlparser2';
|
||||||
|
|
||||||
export interface XhtmlOptions {
|
export interface XhtmlOptions {
|
||||||
addNamespace?: boolean // add http://www.w3.org/1999/xhtml
|
addNamespace?: boolean; // add http://www.w3.org/1999/xhtml
|
||||||
indent?: number // number of spaces per indent level
|
indent?: number; // number of spaces per indent level
|
||||||
}
|
}
|
||||||
|
|
||||||
export function toStrictXhtml(html: string, options: XhtmlOptions = {}): string {
|
export function toStrictXhtml(html: string, options: XhtmlOptions = {}): string {
|
||||||
// FULL canonical void element list
|
// FULL canonical void element list
|
||||||
const voidElements = new Set([
|
const voidElements = new Set([
|
||||||
'area', 'base', 'br', 'col', 'embed', 'hr', 'img',
|
'area',
|
||||||
'input', 'link', 'meta', 'param', 'source', 'track', 'wbr',
|
'base',
|
||||||
|
'br',
|
||||||
|
'col',
|
||||||
|
'embed',
|
||||||
|
'hr',
|
||||||
|
'img',
|
||||||
|
'input',
|
||||||
|
'link',
|
||||||
|
'meta',
|
||||||
|
'param',
|
||||||
|
'source',
|
||||||
|
'track',
|
||||||
|
'wbr',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const escapeXml = (value: string) =>
|
const escapeXml = (value: string) =>
|
||||||
value
|
value.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"');
|
||||||
.replace(/&/g, '&')
|
|
||||||
.replace(/</g, '<')
|
|
||||||
.replace(/>/g, '>')
|
|
||||||
.replace(/"/g, '"');
|
|
||||||
|
|
||||||
const indentSize = options.indent ?? 0;
|
const indentSize = options.indent ?? 0;
|
||||||
const indentStr = (level: number) =>
|
const indentStr = (level: number) => (indentSize > 0 ? ' '.repeat(level * indentSize) : '');
|
||||||
indentSize > 0 ? ' '.repeat(level * indentSize) : '';
|
|
||||||
|
|
||||||
const serialize = (node: any, level = 0): string => {
|
const serialize = (node: any, level = 0): string => {
|
||||||
if (DomUtils.isText(node)) {
|
if (DomUtils.isText(node)) {
|
||||||
@@ -38,7 +45,7 @@ export function toStrictXhtml(html: string, options: XhtmlOptions = {}): string
|
|||||||
const tag = node.name.toLowerCase();
|
const tag = node.name.toLowerCase();
|
||||||
|
|
||||||
// Attributes
|
// Attributes
|
||||||
const attrsObj = { ...(node.attribs || {}) };
|
const attrsObj = { ...node.attribs };
|
||||||
|
|
||||||
// Inject namespace on root element if requested
|
// Inject namespace on root element if requested
|
||||||
if (options.addNamespace && node.parent?.type === 'root') {
|
if (options.addNamespace && node.parent?.type === 'root') {
|
||||||
@@ -59,7 +66,7 @@ export function toStrictXhtml(html: string, options: XhtmlOptions = {}): string
|
|||||||
|
|
||||||
// NORMAL ELEMENT
|
// NORMAL ELEMENT
|
||||||
const children = (node.children || [])
|
const children = (node.children || [])
|
||||||
.map(child => serialize(child, level + 1))
|
.map((child) => serialize(child, level + 1))
|
||||||
.join(indentSize > 0 ? '\n' : '');
|
.join(indentSize > 0 ? '\n' : '');
|
||||||
|
|
||||||
if (indentSize > 0) {
|
if (indentSize > 0) {
|
||||||
@@ -77,7 +84,5 @@ export function toStrictXhtml(html: string, options: XhtmlOptions = {}): string
|
|||||||
|
|
||||||
const doc = parseDocument(html);
|
const doc = parseDocument(html);
|
||||||
|
|
||||||
return doc.children
|
return doc.children.map((node) => serialize(node, 0)).join(indentSize > 0 ? '\n' : '');
|
||||||
.map(node => serialize(node, 0))
|
|
||||||
.join(indentSize > 0 ? '\n' : '');
|
|
||||||
}
|
}
|
||||||
@@ -21,13 +21,15 @@ async function api(path: string, params: Record<string, string | number | boolea
|
|||||||
|
|
||||||
const url = `${serverHost.value}${path}?${pathParams.toString()}`;
|
const url = `${serverHost.value}${path}?${pathParams.toString()}`;
|
||||||
|
|
||||||
const response = await fetch(url,
|
const response = await fetch(
|
||||||
|
url,
|
||||||
serverAuth.value
|
serverAuth.value
|
||||||
? {
|
? {
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
headers: { Authorization: `Basic ${Base64.encode(serverAuth.value)}` },
|
headers: { Authorization: `Basic ${Base64.encode(serverAuth.value)}` },
|
||||||
}
|
}
|
||||||
: undefined);
|
: undefined,
|
||||||
|
);
|
||||||
|
|
||||||
if (!response.ok) {
|
if (!response.ok) {
|
||||||
const text = await response.text();
|
const text = await response.text();
|
||||||
@@ -35,11 +37,9 @@ async function api(path: string, params: Record<string, string | number | boolea
|
|||||||
}
|
}
|
||||||
|
|
||||||
return await response.json();
|
return await response.json();
|
||||||
}
|
} catch (err: any) {
|
||||||
catch (err: any) {
|
|
||||||
error.value = err.toString();
|
error.value = err.toString();
|
||||||
}
|
} finally {
|
||||||
finally {
|
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -47,44 +47,43 @@ async function api(path: string, params: Record<string, string | number | boolea
|
|||||||
type AnyDict = Record<string, any>;
|
type AnyDict = Record<string, any>;
|
||||||
|
|
||||||
interface CertificateCheckResult {
|
interface CertificateCheckResult {
|
||||||
ok: boolean
|
ok: boolean;
|
||||||
hostname: string
|
hostname: string;
|
||||||
port: number
|
port: number;
|
||||||
not_before?: string | null
|
not_before?: string | null;
|
||||||
not_after?: string | null
|
not_after?: string | null;
|
||||||
days_until_expiry?: number | null
|
days_until_expiry?: number | null;
|
||||||
subject?: AnyDict | null
|
subject?: AnyDict | null;
|
||||||
issuer?: AnyDict | null
|
issuer?: AnyDict | null;
|
||||||
san?: any[] | null
|
san?: any[] | null;
|
||||||
error?: string | null
|
error?: string | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface HSTSCheckResult {
|
interface HSTSCheckResult {
|
||||||
ok: boolean
|
ok: boolean;
|
||||||
url: string
|
url: string;
|
||||||
hsts_present: boolean
|
hsts_present: boolean;
|
||||||
max_age?: number | null
|
max_age?: number | null;
|
||||||
include_subdomains: boolean
|
include_subdomains: boolean;
|
||||||
preload: boolean
|
preload: boolean;
|
||||||
raw_header?: string | null
|
raw_header?: string | null;
|
||||||
error?: string | null
|
error?: string | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface RedirectCheckResult {
|
interface RedirectCheckResult {
|
||||||
ok: boolean
|
ok: boolean;
|
||||||
http_url: string
|
http_url: string;
|
||||||
redirected: boolean
|
redirected: boolean;
|
||||||
final_url?: string | null
|
final_url?: string | null;
|
||||||
status_code?: number | null
|
status_code?: number | null;
|
||||||
redirect_chain?: { status_code: number; url: string; headers: Record<string, string> }[] | null
|
redirect_chain?: { status_code: number; url: string; headers: Record<string, string> }[] | null;
|
||||||
error?: string | null
|
error?: string | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
function prettyJSON(value: unknown): string {
|
function prettyJSON(value: unknown): string {
|
||||||
try {
|
try {
|
||||||
return JSON.stringify(value, null, 2);
|
return JSON.stringify(value, null, 2);
|
||||||
}
|
} catch {
|
||||||
catch {
|
|
||||||
return String(value);
|
return String(value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -98,7 +97,7 @@ function formatDate(value: string | null | undefined): string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const certHost = ref('');
|
const certHost = ref('');
|
||||||
const certPort = ref(443);
|
const certPort = ref('443');
|
||||||
const certResult = ref<CertificateCheckResult | null>(null);
|
const certResult = ref<CertificateCheckResult | null>(null);
|
||||||
|
|
||||||
const hstsUrl = ref('');
|
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="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 />
|
<c-input-text v-model:value="certPort" label="Port:" v-bind="labelProps" placeholder="443" mb-1 />
|
||||||
<div mb-2 flex justify-center>
|
<div mb-2 flex justify-center>
|
||||||
<n-button type="primary" :loading="loading" @click="runCertificate">
|
<n-button type="primary" :loading="loading" @click="runCertificate"> Check Certificate </n-button>
|
||||||
Check Certificate
|
|
||||||
</n-button>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<n-card v-if="certResult" title="Result">
|
<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="Hostname:" v-bind="labelProps" :value="certResult.hostname" mb-1 />
|
||||||
<input-copyable label="Port:" v-bind="labelProps" :value="certResult.port" mb-1 />
|
<input-copyable label="Port:" v-bind="labelProps" :value="certResult.port" mb-1 />
|
||||||
|
|
||||||
<input-copyable
|
<input-copyable label="Not before:" v-bind="labelProps" :value="formatDate(certResult.not_before)" mb-1 />
|
||||||
label="Not before:"
|
|
||||||
v-bind="labelProps"
|
|
||||||
:value="formatDate(certResult.not_before)" mb-1
|
|
||||||
/>
|
|
||||||
|
|
||||||
<input-copyable
|
<input-copyable label="Not after:" v-bind="labelProps" :value="formatDate(certResult.not_after)" mb-1 />
|
||||||
label="Not after:"
|
|
||||||
v-bind="labelProps"
|
|
||||||
:value="formatDate(certResult.not_after)" mb-1
|
|
||||||
/>
|
|
||||||
|
|
||||||
<input-copyable
|
<input-copyable
|
||||||
label="Days until expiry:"
|
label="Days until expiry:"
|
||||||
v-bind="labelProps"
|
v-bind="labelProps"
|
||||||
:value="String(certResult.days_until_expiry)" mb-1
|
:value="String(certResult.days_until_expiry)"
|
||||||
|
mb-1
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<input-copyable
|
<input-copyable label="Subject:" v-bind="labelProps" :value="prettyJSON(certResult.subject)" mb-1 />
|
||||||
label="Subject:"
|
|
||||||
v-bind="labelProps"
|
|
||||||
:value="prettyJSON(certResult.subject)" mb-1
|
|
||||||
/>
|
|
||||||
|
|
||||||
<input-copyable
|
<input-copyable label="Issuer:" v-bind="labelProps" :value="prettyJSON(certResult.issuer)" mb-1 />
|
||||||
label="Issuer:"
|
|
||||||
v-bind="labelProps"
|
|
||||||
:value="prettyJSON(certResult.issuer)" mb-1
|
|
||||||
/>
|
|
||||||
|
|
||||||
<input-copyable
|
<input-copyable
|
||||||
v-for="(san, index) in certResult.san"
|
v-for="(san, index) in certResult.san"
|
||||||
:key="index"
|
:key="index"
|
||||||
label="Sub. Alt. Name:"
|
label="Sub. Alt. Name:"
|
||||||
v-bind="labelProps"
|
v-bind="labelProps"
|
||||||
:value="prettyJSON(san)" mb-1
|
:value="prettyJSON(san)"
|
||||||
|
mb-1
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<n-alert
|
<n-alert v-if="certResult.error" type="error" :bordered="false" show-icon>
|
||||||
v-if="certResult.error"
|
|
||||||
type="error"
|
|
||||||
:bordered="false"
|
|
||||||
show-icon
|
|
||||||
>
|
|
||||||
{{ certResult.error }}
|
{{ certResult.error }}
|
||||||
</n-alert>
|
</n-alert>
|
||||||
</n-card>
|
</n-card>
|
||||||
@@ -226,9 +204,7 @@ const labelProps = {
|
|||||||
<n-tab-pane name="hsts" tab="HSTS">
|
<n-tab-pane name="hsts" tab="HSTS">
|
||||||
<c-input-text v-model:value="hstsUrl" label="URL:" v-bind="labelProps" placeholder="https://example.com" mb-1 />
|
<c-input-text v-model:value="hstsUrl" label="URL:" v-bind="labelProps" placeholder="https://example.com" mb-1 />
|
||||||
<div mb-2 flex justify-center>
|
<div mb-2 flex justify-center>
|
||||||
<n-button type="primary" :loading="loading" @click="runHsts">
|
<n-button type="primary" :loading="loading" @click="runHsts"> Check HSTS </n-button>
|
||||||
Check HSTS
|
|
||||||
</n-button>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<n-card v-if="hstsResult" title="Result">
|
<n-card v-if="hstsResult" title="Result">
|
||||||
@@ -262,12 +238,7 @@ const labelProps = {
|
|||||||
mb-1
|
mb-1
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<input-copyable
|
<input-copyable label="Preload" v-bind="labelProps" :value="hstsResult.preload ? 'Yes' : 'No'" mb-1 />
|
||||||
label="Preload"
|
|
||||||
v-bind="labelProps"
|
|
||||||
:value="hstsResult.preload ? 'Yes' : 'No'"
|
|
||||||
mb-1
|
|
||||||
/>
|
|
||||||
|
|
||||||
<input-copyable
|
<input-copyable
|
||||||
v-if="hstsResult.raw_header"
|
v-if="hstsResult.raw_header"
|
||||||
@@ -277,12 +248,7 @@ const labelProps = {
|
|||||||
mb-1
|
mb-1
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<n-alert
|
<n-alert v-if="hstsResult.error" type="error" :bordered="false" show-icon>
|
||||||
v-if="hstsResult.error"
|
|
||||||
type="error"
|
|
||||||
:bordered="false"
|
|
||||||
show-icon
|
|
||||||
>
|
|
||||||
{{ hstsResult.error }}
|
{{ hstsResult.error }}
|
||||||
</n-alert>
|
</n-alert>
|
||||||
</n-card>
|
</n-card>
|
||||||
@@ -295,11 +261,15 @@ const labelProps = {
|
|||||||
<!-- REDIRECT -->
|
<!-- REDIRECT -->
|
||||||
<n-tab-pane name="redirect" tab="HTTP → HTTPS Redirect">
|
<n-tab-pane name="redirect" tab="HTTP → HTTPS Redirect">
|
||||||
<n-form>
|
<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>
|
<div mb-2 flex justify-center>
|
||||||
<n-button type="primary" :loading="loading" @click="runRedirect">
|
<n-button type="primary" :loading="loading" @click="runRedirect"> Check Redirect </n-button>
|
||||||
Check Redirect
|
|
||||||
</n-button>
|
|
||||||
</div>
|
</div>
|
||||||
</n-form>
|
</n-form>
|
||||||
|
|
||||||
@@ -319,25 +289,15 @@ const labelProps = {
|
|||||||
mb-1
|
mb-1
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<input-copyable
|
<input-copyable label="Final URL" v-bind="labelProps" :value="redirectResult.final_url" mb-1 />
|
||||||
label="Final URL"
|
|
||||||
v-bind="labelProps"
|
|
||||||
:value="redirectResult.final_url"
|
|
||||||
mb-1
|
|
||||||
/>
|
|
||||||
|
|
||||||
<input-copyable
|
<input-copyable label="Status code" v-bind="labelProps" :value="String(redirectResult.status_code)" mb-1 />
|
||||||
label="Status code"
|
|
||||||
v-bind="labelProps"
|
|
||||||
:value="String(redirectResult.status_code)"
|
|
||||||
mb-1
|
|
||||||
/>
|
|
||||||
|
|
||||||
<input-copyable
|
<input-copyable
|
||||||
v-if="redirectResult.redirect_chain"
|
v-if="redirectResult.redirect_chain"
|
||||||
label="Redirect chain:"
|
label="Redirect chain:"
|
||||||
v-bind="labelProps"
|
v-bind="labelProps"
|
||||||
:value="redirectResult.redirect_chain.map(r => r.url).join(' → ')"
|
:value="redirectResult.redirect_chain.map((r) => r.url).join(' → ')"
|
||||||
mb-1
|
mb-1
|
||||||
/>
|
/>
|
||||||
|
|
||||||
@@ -350,12 +310,7 @@ const labelProps = {
|
|||||||
/>
|
/>
|
||||||
</n-card>
|
</n-card>
|
||||||
|
|
||||||
<n-alert
|
<n-alert v-if="redirectResult.error" type="error" :bordered="false" show-icon>
|
||||||
v-if="redirectResult.error"
|
|
||||||
type="error"
|
|
||||||
:bordered="false"
|
|
||||||
show-icon
|
|
||||||
>
|
|
||||||
{{ redirectResult.error }}
|
{{ redirectResult.error }}
|
||||||
</n-alert>
|
</n-alert>
|
||||||
</n-card>
|
</n-card>
|
||||||
|
|||||||
@@ -10,16 +10,18 @@ const { t } = useI18n();
|
|||||||
const rawIbans = useQueryParam({ tool: 'iban-validator', name: 'iban', defaultValue: '' });
|
const rawIbans = useQueryParam({ tool: 'iban-validator', name: 'iban', defaultValue: '' });
|
||||||
|
|
||||||
interface IbanInfo {
|
interface IbanInfo {
|
||||||
iban: string
|
iban: string;
|
||||||
infos: CKeyValueListItems
|
infos: CKeyValueListItems;
|
||||||
}
|
}
|
||||||
|
|
||||||
const ibansInfo = computed<IbanInfo[]>(() => {
|
const ibansInfo = computed<IbanInfo[]>(() => {
|
||||||
if (!rawIbans.value?.trim()) {
|
if (!rawIbans.value?.trim()) {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
const ibans = rawIbans.value.toUpperCase()
|
const ibans = rawIbans.value
|
||||||
.split(/\n/).map(iban => iban.replace(/\s/g, '').replace(/-/g, ''))
|
.toUpperCase()
|
||||||
|
.split(/\n/)
|
||||||
|
.map((iban) => iban.replace(/\s/g, '').replace(/-/g, ''))
|
||||||
.filter(Boolean);
|
.filter(Boolean);
|
||||||
|
|
||||||
if (!ibans.length) {
|
if (!ibans.length) {
|
||||||
@@ -70,11 +72,7 @@ const ibansInfo = computed<IbanInfo[]>(() => {
|
|||||||
return results;
|
return results;
|
||||||
});
|
});
|
||||||
|
|
||||||
const ibanExamples = [
|
const ibanExamples = ['FR7630006000011234567890189', 'DE89370400440532013000', 'GB29NWBK60161331926819'];
|
||||||
'FR7630006000011234567890189',
|
|
||||||
'DE89370400440532013000',
|
|
||||||
'GB29NWBK60161331926819',
|
|
||||||
];
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
@@ -95,7 +93,7 @@ const ibanExamples = [
|
|||||||
|
|
||||||
<c-card :title="t('tools.iban-validator-and-parser.texts.title-valid-iban-examples')" mt-5>
|
<c-card :title="t('tools.iban-validator-and-parser.texts.title-valid-iban-examples')" mt-5>
|
||||||
<div v-for="iban in ibanExamples" :key="iban">
|
<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>
|
</div>
|
||||||
</c-card>
|
</c-card>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -2,7 +2,17 @@
|
|||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import { Base64 } from 'js-base64';
|
import { Base64 } from 'js-base64';
|
||||||
import type { MemoryImage } from 'image-in-browser';
|
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 { arrayBufferToWebP } from 'webp-converter-browser';
|
||||||
import { createSvg2png, initialize } from 'svg2png-wasm';
|
import { createSvg2png, initialize } from 'svg2png-wasm';
|
||||||
import { normal as robotoBase64 } from 'roboto-base64';
|
import { normal as robotoBase64 } from 'roboto-base64';
|
||||||
@@ -16,7 +26,7 @@ function readAsText(file: File) {
|
|||||||
const reader = new FileReader();
|
const reader = new FileReader();
|
||||||
reader.readAsText(file);
|
reader.readAsText(file);
|
||||||
reader.onload = () => resolve(reader.result?.toString() ?? '');
|
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 base64OutputFile = ref('');
|
||||||
const fileName = ref('');
|
const fileName = ref('');
|
||||||
const fileExtension = ref('');
|
const fileExtension = ref('');
|
||||||
const { download } = useDownloadFileFromBase64(
|
const { download } = useDownloadFileFromBase64({
|
||||||
{
|
source: base64OutputFile,
|
||||||
source: base64OutputFile,
|
filename: fileName,
|
||||||
filename: fileName,
|
extension: fileExtension,
|
||||||
extension: fileExtension,
|
});
|
||||||
});
|
|
||||||
|
|
||||||
const outputQuality = useQueryParamOrStorage({ name: 'qual', storageName: 'imgconv:q', defaultValue: 0.95 });
|
const outputQuality = useQueryParamOrStorage({ name: 'qual', storageName: 'imgconv:q', defaultValue: 0.95 });
|
||||||
const outputFormats = {
|
const outputFormats = {
|
||||||
@@ -95,11 +104,10 @@ async function onFileUploaded(uploadedFile: File) {
|
|||||||
status.value = 'processing';
|
status.value = 'processing';
|
||||||
try {
|
try {
|
||||||
if (outputFormatValue === 'webp') {
|
if (outputFormatValue === 'webp') {
|
||||||
const encodedImage = await arrayBufferToWebP(fileBuffer);
|
const encodedImage = await arrayBufferToWebP(fileBuffer.buffer);
|
||||||
fileExtension.value = 'webp';
|
fileExtension.value = 'webp';
|
||||||
base64OutputFile.value = `data:image/webp;base64,${Base64.fromUint8Array(new Uint8Array(await encodedImage.arrayBuffer()))}`;
|
base64OutputFile.value = `data:image/webp;base64,${Base64.fromUint8Array(new Uint8Array(await encodedImage.arrayBuffer()))}`;
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
if (uploadedFile.type === 'image/svg+xml') {
|
if (uploadedFile.type === 'image/svg+xml') {
|
||||||
if (!svgWasmLoaded.value) {
|
if (!svgWasmLoaded.value) {
|
||||||
await initialize(fetch('/svg2png_wasm_bg.wasm'));
|
await initialize(fetch('/svg2png_wasm_bg.wasm'));
|
||||||
@@ -108,7 +116,9 @@ async function onFileUploaded(uploadedFile: File) {
|
|||||||
const svg2png = createSvg2png({
|
const svg2png = createSvg2png({
|
||||||
fonts: [Base64.toUint8Array(robotoBase64)],
|
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();
|
svg2png.dispose();
|
||||||
}
|
}
|
||||||
const decodedImage = decodeImage({
|
const decodedImage = decodeImage({
|
||||||
@@ -117,9 +127,9 @@ async function onFileUploaded(uploadedFile: File) {
|
|||||||
|
|
||||||
if (decodedImage == null) {
|
if (decodedImage == null) {
|
||||||
throw new Error(t('tools.image-converter.texts.invalid-image-file'));
|
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);
|
const encodedImage = outConfig.save(decodedImage);
|
||||||
fileExtension.value = outputFormatValue;
|
fileExtension.value = outputFormatValue;
|
||||||
base64OutputFile.value = `data:${outConfig.mime};base64,${Base64.fromUint8Array(encodedImage!)}`;
|
base64OutputFile.value = `data:${outConfig.mime};base64,${Base64.fromUint8Array(encodedImage!)}`;
|
||||||
@@ -127,8 +137,7 @@ async function onFileUploaded(uploadedFile: File) {
|
|||||||
status.value = 'done';
|
status.value = 'done';
|
||||||
|
|
||||||
download();
|
download();
|
||||||
}
|
} catch (e) {
|
||||||
catch (e) {
|
|
||||||
status.value = 'error';
|
status.value = 'error';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -148,7 +157,11 @@ async function onFileUploaded(uploadedFile: File) {
|
|||||||
/>
|
/>
|
||||||
|
|
||||||
<div mb-2 flex justify-center>
|
<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-input-number-i18n v-model:value="outputQuality" :max="100" :min="0" w-full />
|
||||||
</n-form-item>
|
</n-form-item>
|
||||||
<n-form-item :label="t('tools.image-converter.texts.label-svg-scaling')" label-placement="left">
|
<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>
|
</n-form-item>
|
||||||
</div>
|
</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 style="flex: 0 0 100%" mb-2>
|
||||||
<div mx-auto max-w-600px>
|
<div mx-auto max-w-600px>
|
||||||
@@ -175,10 +194,7 @@ async function onFileUploaded(uploadedFile: File) {
|
|||||||
<c-alert v-if="status === 'error'" type="error">
|
<c-alert v-if="status === 'error'" type="error">
|
||||||
{{ $t('tools.image-converter.texts.an-error-occured-processing') }} <span>{{ fileName }}</span>
|
{{ $t('tools.image-converter.texts.an-error-occured-processing') }} <span>{{ fileName }}</span>
|
||||||
</c-alert>
|
</c-alert>
|
||||||
<n-spin
|
<n-spin v-if="status === 'processing'" size="small" />
|
||||||
v-if="status === 'processing'"
|
|
||||||
size="small"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
+9
-9
@@ -1,17 +1,17 @@
|
|||||||
declare module 'ip-bigint' {
|
declare module 'ip-bigint' {
|
||||||
type IPInfo = {
|
type IPInfo = {
|
||||||
number: bigint;
|
number: bigint;
|
||||||
version: number;
|
version: number;
|
||||||
ipv4mapped?: boolean;
|
ipv4mapped?: boolean;
|
||||||
scopeid?:string;
|
scopeid?: string;
|
||||||
};
|
};
|
||||||
type StringifyOptions = {
|
type StringifyOptions = {
|
||||||
compress?:boolean;
|
compress?: boolean;
|
||||||
hexify?:boolean;
|
hexify?: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
export function normalizeIp(ip: string, options: StringifyOptions = {compress = true, hexify = false} = {})
|
export function normalizeIp(ip: string, options?: StringifyOptions): string;
|
||||||
export function stringifyIp(ip: IPInfo, options: StringifyOptions = {compress = true, hexify = false}): string;
|
export function stringifyIp(ip: IPInfo, options?: StringifyOptions): string;
|
||||||
export function ipVersion(ip: string): number;
|
export function ipVersion(ip: string): number;
|
||||||
export function parseIp(ip): IPInfo;
|
export function parseIp(ip): IPInfo;
|
||||||
}
|
}
|
||||||
@@ -10,68 +10,83 @@ import { useQueryParamOrStorage } from '@/composable/queryParams';
|
|||||||
|
|
||||||
const { t } = useI18n();
|
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 convertedSections = computed(() =>
|
||||||
const ipInDecimal = ipv4ToInt({ ip: rawIpAddress.value });
|
withDefaultOnError(() => {
|
||||||
|
const ipInDecimal = ipv4ToInt({ ip: rawIpAddress.value });
|
||||||
|
|
||||||
return [
|
return [
|
||||||
{
|
{
|
||||||
label: t('tools.ipv4-address-converter.texts.label-decimal'),
|
label: t('tools.ipv4-address-converter.texts.label-decimal'),
|
||||||
value: String(ipInDecimal),
|
value: String(ipInDecimal),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: t('tools.ipv4-address-converter.texts.label-hexadecimal'),
|
label: t('tools.ipv4-address-converter.texts.label-hexadecimal'),
|
||||||
value: convertBase({ fromBase: 10, toBase: 16, value: String(ipInDecimal) }).toUpperCase(),
|
value: convertBase({ fromBase: 10, toBase: 16, value: String(ipInDecimal) }).toUpperCase(),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: t('tools.ipv4-address-converter.texts.label-binary'),
|
label: t('tools.ipv4-address-converter.texts.label-binary'),
|
||||||
value: convertBase({ fromBase: 10, toBase: 2, value: String(ipInDecimal) }),
|
value: convertBase({ fromBase: 10, toBase: 2, value: String(ipInDecimal) }),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: t('tools.ipv4-address-converter.texts.label-ipv6'),
|
label: t('tools.ipv4-address-converter.texts.label-ipv6'),
|
||||||
value: ipv4ToIpv6({ ip: rawIpAddress.value }),
|
value: ipv4ToIpv6({ ip: rawIpAddress.value }),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: t('tools.ipv4-address-converter.texts.label-ipv6-short'),
|
label: t('tools.ipv4-address-converter.texts.label-ipv6-short'),
|
||||||
value: ipv4ToIpv6({ ip: rawIpAddress.value, prefix: '::ffff:' }),
|
value: ipv4ToIpv6({ ip: rawIpAddress.value, prefix: '::ffff:' }),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: t('tools.ipv4-address-converter.texts.label-ipv6-decimal'),
|
label: t('tools.ipv4-address-converter.texts.label-ipv6-decimal'),
|
||||||
value: toIPv4MappedAddressDecimal(rawIpAddress.value),
|
value: toIPv4MappedAddressDecimal(rawIpAddress.value),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: t('tools.ipv4-address-converter.texts.label-6to4-prefix'),
|
label: t('tools.ipv4-address-converter.texts.label-6to4-prefix'),
|
||||||
value: to6to4Prefix(rawIpAddress.value),
|
value: to6to4Prefix(rawIpAddress.value),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: t('tools.ipv4-address-converter.texts.label-cidr-notation'),
|
label: t('tools.ipv4-address-converter.texts.label-cidr-notation'),
|
||||||
value: `${rawIpAddress.value}/32`,
|
value: `${rawIpAddress.value}/32`,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: t('tools.ipv4-address-converter.texts.label-arpa'),
|
label: t('tools.ipv4-address-converter.texts.label-arpa'),
|
||||||
value: toARPA(rawIpAddress.value),
|
value: toARPA(rawIpAddress.value),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: t('tools.ipv4-address-converter.texts.label-ip-class'),
|
label: t('tools.ipv4-address-converter.texts.label-ip-class'),
|
||||||
value: getIPClass({ ip: rawIpAddress.value }),
|
value: getIPClass({ ip: rawIpAddress.value }),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: t('tools.ipv4-address-converter.texts.label-type'),
|
label: t('tools.ipv4-address-converter.texts.label-type'),
|
||||||
value: getIPNetworkType(rawIpAddress.value),
|
value: getIPNetworkType(rawIpAddress.value),
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
}, []));
|
}, []),
|
||||||
|
);
|
||||||
|
|
||||||
const { attrs: validationAttrs } = useValidation({
|
const { attrs: validationAttrs } = useValidation({
|
||||||
source: rawIpAddress,
|
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>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<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 />
|
<n-divider />
|
||||||
|
|
||||||
@@ -83,7 +98,7 @@ const { attrs: validationAttrs } = useValidation({
|
|||||||
label-width="100px"
|
label-width="100px"
|
||||||
label-align="right"
|
label-align="right"
|
||||||
mb-2
|
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')"
|
:placeholder="t('tools.ipv4-address-converter.texts.placeholder-set-a-correct-ipv4-address')"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
+9
-9
@@ -1,17 +1,17 @@
|
|||||||
declare module 'ip-bigint' {
|
declare module 'ip-bigint' {
|
||||||
type IPInfo = {
|
type IPInfo = {
|
||||||
number: bigint;
|
number: bigint;
|
||||||
version: number;
|
version: number;
|
||||||
ipv4mapped?: boolean;
|
ipv4mapped?: boolean;
|
||||||
scopeid?:string;
|
scopeid?: string;
|
||||||
};
|
};
|
||||||
type StringifyOptions = {
|
type StringifyOptions = {
|
||||||
compress?:boolean;
|
compress?: boolean;
|
||||||
hexify?:boolean;
|
hexify?: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
export function normalizeIp(ip: string, options: StringifyOptions = {compress = true, hexify = false} = {})
|
export function normalizeIp(ip: string, options?: StringifyOptions): string;
|
||||||
export function stringifyIp(ip: IPInfo, options: StringifyOptions = {compress = true, hexify = false}): string;
|
export function stringifyIp(ip: IPInfo, options?: StringifyOptions): string;
|
||||||
export function ipVersion(ip: string): number;
|
export function ipVersion(ip: string): number;
|
||||||
export function parseIp(ip): IPInfo;
|
export function parseIp(ip): IPInfo;
|
||||||
}
|
}
|
||||||
@@ -50,14 +50,13 @@ function isbnChecksum(isbn: string) {
|
|||||||
for (let n = 0; n < 9; n += 1) {
|
for (let n = 0; n < 9; n += 1) {
|
||||||
check += (10 - n) * Number(isbn.charAt(n));
|
check += (10 - n) * Number(isbn.charAt(n));
|
||||||
}
|
}
|
||||||
check = (11 - check % 11) % 11;
|
check = (11 - (check % 11)) % 11;
|
||||||
return check === 10 ? 'X' : String(check);
|
return check === 10 ? 'X' : String(check);
|
||||||
}
|
} else if (isbn.length === 12) {
|
||||||
else if (isbn.length === 12) {
|
|
||||||
for (let n = 0; n < 12; n += 2) {
|
for (let n = 0; n < 12; n += 2) {
|
||||||
check += Number(isbn.charAt(n)) + 3 * Number(isbn.charAt(n + 1));
|
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;
|
return null;
|
||||||
@@ -67,8 +66,7 @@ const normalizedISBN = computed(() => {
|
|||||||
let normalized = rawIsbn.value.replace(/[^\dX]/g, '');
|
let normalized = rawIsbn.value.replace(/[^\dX]/g, '');
|
||||||
if (normalized.length >= 13) {
|
if (normalized.length >= 13) {
|
||||||
normalized = normalized.substring(0, 12);
|
normalized = normalized.substring(0, 12);
|
||||||
}
|
} else if (normalized.length >= 10) {
|
||||||
else if (normalized.length >= 10) {
|
|
||||||
normalized = normalized.substring(0, 9);
|
normalized = normalized.substring(0, 9);
|
||||||
}
|
}
|
||||||
const checksum = isbnChecksum(normalized);
|
const checksum = isbnChecksum(normalized);
|
||||||
@@ -78,27 +76,44 @@ const normalizedISBN = computed(() => {
|
|||||||
const isbnAuditInfos = computed<{ isValid: boolean; clues: CKeyValueListItems }>(() => {
|
const isbnAuditInfos = computed<{ isValid: boolean; clues: CKeyValueListItems }>(() => {
|
||||||
const isbn = ISBN3.audit(rawIsbn.value);
|
const isbn = ISBN3.audit(rawIsbn.value);
|
||||||
|
|
||||||
const isValid = (isbn?.validIsbn ?? false);
|
const isValid = isbn?.validIsbn ?? false;
|
||||||
return {
|
return {
|
||||||
isValid,
|
isValid,
|
||||||
clues: Array.from((isbn?.clues ?? []),
|
clues: Array.from(isbn?.clues ?? [], (clue) => ({
|
||||||
clue => ({ label: `${clue.message} (${clue.groupname})`, value: clue.candidate })),
|
label: `${clue.message} (${clue.groupname})`,
|
||||||
|
value: clue.candidate,
|
||||||
|
})),
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<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">
|
<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>
|
</n-alert>
|
||||||
|
|
||||||
<c-card v-if="isbnInfos.length > 0" mt-5 :title="t('tools.isbn-validator-and-parser.texts.title-isbn-infos')">
|
<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-key-value-list :items="isbnInfos" data-test-id="isbn-info" />
|
||||||
</c-card>
|
</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-card
|
||||||
<c-key-value-list :items="isbnAuditInfos" data-test-id="isbn-info" />
|
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>
|
</c-card>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
+6
-7
@@ -1,8 +1,7 @@
|
|||||||
declare module 'jasypt' {
|
declare module 'jasypt' {
|
||||||
export default class Jasypt {
|
export default class Jasypt {
|
||||||
constructor() {}
|
setPassword(password: string): void;
|
||||||
setPassword(password: string): void
|
encrypt(value: string): string;
|
||||||
encrypt(value: string): string
|
decrypt(value: string): string;
|
||||||
decrypt(value: string): string
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
@@ -4,25 +4,25 @@ import { obfuscateJavascript } from './javascript-obfuscator.service';
|
|||||||
|
|
||||||
describe('JavascriptObfuscator', () => {
|
describe('JavascriptObfuscator', () => {
|
||||||
it('base64 encodes and wraps with atob', () => {
|
it('base64 encodes and wraps with atob', () => {
|
||||||
const src = 'console.log(\'x\');';
|
const src = "console.log('x');";
|
||||||
const out = obfuscateJavascript(src, 'base64');
|
const out = obfuscateJavascript(src, 'base64');
|
||||||
|
|
||||||
expect(out).toContain('atob(\'');
|
expect(out).toContain("atob('");
|
||||||
const m = out.match(/atob\('(.+)'\)/);
|
const m = out.match(/atob\('(.+)'\)/);
|
||||||
expect(m).toBeTruthy();
|
expect(m).toBeTruthy();
|
||||||
if (m) {
|
const b64 = m![1];
|
||||||
const b64 = m[1];
|
const decoded = decodeURIComponent(escape(Buffer.from(b64, 'base64').toString('binary')));
|
||||||
const decoded = decodeURIComponent(escape(Buffer.from(b64, 'base64').toString('binary')));
|
expect(decoded).toBe(src);
|
||||||
expect(decoded).toBe(src);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('rot13 encodes and includes runtime decoder', () => {
|
it('rot13 encodes and includes runtime decoder', () => {
|
||||||
const src = 'console.log(\'a\');';
|
const src = "console.log('a');";
|
||||||
const out = obfuscateJavascript(src, 'rot13');
|
const out = obfuscateJavascript(src, 'rot13');
|
||||||
|
|
||||||
expect(out).toContain('eval(r(s))');
|
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);
|
expect(out).toContain(r);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -15,19 +15,17 @@ const result = computedAsync(async () => {
|
|||||||
'afterbegin',
|
'afterbegin',
|
||||||
'<meta http-equiv="Content-Security-Policy" content="default-src \'none\';">',
|
'<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) {
|
async function evalCode(code: string) {
|
||||||
const fn = await sandbox.addFunction(`() => ${code}`);
|
const fn = await sandbox.addFunction(`() => ${code}`);
|
||||||
return Promise.race([
|
return Promise.race([fn(), sleep(10_000).then(() => Promise.reject(new Error('Sandbox timeout')))]).finally(() =>
|
||||||
fn(),
|
sandbox.removeFunction(fn),
|
||||||
sleep(10_000).then(() => Promise.reject(new Error('Sandbox timeout'))),
|
);
|
||||||
]).finally(() => sandbox.removeFunction(fn));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return await webcrack(inputValue, { sandbox: evalCode });
|
return await webcrack(inputValue, { sandbox: evalCode });
|
||||||
}
|
} catch (e: any) {
|
||||||
catch (e: any) {
|
|
||||||
return {
|
return {
|
||||||
code: `/*\n${e.toString()}\n*/`,
|
code: `/*\n${e.toString()}\n*/`,
|
||||||
bundle: '',
|
bundle: '',
|
||||||
@@ -37,7 +35,7 @@ const result = computedAsync(async () => {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<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
|
<CInputText
|
||||||
v-model:value="input"
|
v-model:value="input"
|
||||||
:placeholder="t('tools.js-unobfuscator.texts.placeholder-your-obfuscate-javascript-code')"
|
: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" />
|
<textarea-copyable :value="result?.code" language="javascript" download-file-name="output.js" />
|
||||||
</n-form-item>
|
</n-form-item>
|
||||||
<n-form-item :label="t('tools.js-unobfuscator.texts.label-bundle')">
|
<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>
|
</n-form-item>
|
||||||
</template>
|
</template>
|
||||||
@@ -1,7 +1,21 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import JsonEditorVue from 'json-editor-vue';
|
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 'vanilla-jsoneditor/themes/jse-theme-dark.css';
|
||||||
import { jsonrepair } from 'jsonrepair';
|
import { jsonrepair } from 'jsonrepair';
|
||||||
import { useJsonSchemaValidation } from '../json-viewer/useJsonSchemaValidation';
|
import { useJsonSchemaValidation } from '../json-viewer/useJsonSchemaValidation';
|
||||||
@@ -16,22 +30,17 @@ const jsonText = ref('{ "a": { "array": [1, 2, 3] } }');
|
|||||||
const jsonPath = ref('');
|
const jsonPath = ref('');
|
||||||
|
|
||||||
function updateJsonPath(selection: JSONEditorSelection) {
|
function updateJsonPath(selection: JSONEditorSelection) {
|
||||||
if (isAfterSelection (selection)) {
|
if (isAfterSelection(selection)) {
|
||||||
jsonPath.value = `$.${stringifyJSONPath((selection as AfterSelection).path)}`;
|
jsonPath.value = `$.${stringifyJSONPath((selection as AfterSelection).path)}`;
|
||||||
}
|
} else if (isInsideSelection(selection)) {
|
||||||
else if (isInsideSelection (selection)) {
|
|
||||||
jsonPath.value = `$.${stringifyJSONPath((selection as InsideSelection).path)}`;
|
jsonPath.value = `$.${stringifyJSONPath((selection as InsideSelection).path)}`;
|
||||||
}
|
} else if (isKeySelection(selection)) {
|
||||||
else if (isKeySelection (selection)) {
|
|
||||||
jsonPath.value = `$.${stringifyJSONPath((selection as KeySelection).path)}`;
|
jsonPath.value = `$.${stringifyJSONPath((selection as KeySelection).path)}`;
|
||||||
}
|
} else if (isValueSelection(selection)) {
|
||||||
else if (isValueSelection (selection)) {
|
|
||||||
jsonPath.value = `$.${stringifyJSONPath((selection as ValueSelection).path)}`;
|
jsonPath.value = `$.${stringifyJSONPath((selection as ValueSelection).path)}`;
|
||||||
}
|
} else if (isMultiSelection(selection)) {
|
||||||
else if (isMultiSelection (selection)) {
|
|
||||||
jsonPath.value = `$.${stringifyJSONPath((selection as MultiSelection).focusPath)}`;
|
jsonPath.value = `$.${stringifyJSONPath((selection as MultiSelection).focusPath)}`;
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
jsonPath.value = 'No available in this mode';
|
jsonPath.value = 'No available in this mode';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -39,25 +48,25 @@ function updateJsonPath(selection: JSONEditorSelection) {
|
|||||||
const jsonSchemaInputElement = ref<HTMLElement>();
|
const jsonSchemaInputElement = ref<HTMLElement>();
|
||||||
const schemaData = useITStorage('json-linter:schema-data', '');
|
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 });
|
const { schemas, errors: validationErrors } = useJsonSchemaValidation({ json: jsonText, schemaUrl, schemaData });
|
||||||
|
|
||||||
function tryAutoRepair() {
|
function tryAutoRepair() {
|
||||||
try {
|
try {
|
||||||
jsonText.value = jsonrepair(jsonText.value);
|
jsonText.value = jsonrepair(jsonText.value);
|
||||||
}
|
} catch {}
|
||||||
catch {}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const indentSize = useITStorage('json-editor:indent-size', 3);
|
const indentSize = useITStorage('json-editor:indent-size', 3);
|
||||||
const formattedJson = computed(() => {
|
const formattedJson = computed(() => {
|
||||||
const jsonTextValue = jsonText.value;
|
const jsonTextValue = jsonText.value;
|
||||||
try {
|
try {
|
||||||
return JSON.stringify(
|
return JSON.stringify(JSON.parseBigNum(jsonTextValue), null, indentSize.value);
|
||||||
JSON.parseBigNum(jsonTextValue),
|
} catch {
|
||||||
null, indentSize.value);
|
|
||||||
}
|
|
||||||
catch {
|
|
||||||
return jsonTextValue;
|
return jsonTextValue;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -67,7 +76,7 @@ const formattedJson = computed(() => {
|
|||||||
<div>
|
<div>
|
||||||
<JsonEditorVue
|
<JsonEditorVue
|
||||||
v-model="jsonText"
|
v-model="jsonText"
|
||||||
mode="text"
|
:mode="Mode.text"
|
||||||
:class="styleStore.isDarkTheme ? 'jse-theme-dark' : ''"
|
:class="styleStore.isDarkTheme ? 'jse-theme-dark' : ''"
|
||||||
:on-select="updateJsonPath"
|
:on-select="updateJsonPath"
|
||||||
mb-2
|
mb-2
|
||||||
@@ -92,15 +101,21 @@ const formattedJson = computed(() => {
|
|||||||
<textarea-copyable :value="formattedJson" language="json" download-file-name="output.json" />
|
<textarea-copyable :value="formattedJson" language="json" download-file-name="output.json" />
|
||||||
</n-form-item>
|
</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
|
<n-select
|
||||||
v-model:value="schemaUrl"
|
v-model:value="schemaUrl"
|
||||||
:options="[
|
:options="[
|
||||||
{ label: t('tools.json-editor.texts.label-no-validation'), value: '' },
|
{ label: t('tools.json-editor.texts.label-no-validation'), value: '' },
|
||||||
{ label: t('tools.json-editor.texts.label-custom'), value: 'custom' },
|
{ 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>
|
</n-form-item>
|
||||||
<c-input-text
|
<c-input-text
|
||||||
@@ -119,10 +134,7 @@ const formattedJson = computed(() => {
|
|||||||
|
|
||||||
<div v-if="validationErrors.length > 0" mb-2 mt-2>
|
<div v-if="validationErrors.length > 0" mb-2 mt-2>
|
||||||
<n-alert :title="t('tools.json-editor.texts.title-schema-validation-errors')" type="error">
|
<n-alert :title="t('tools.json-editor.texts.title-schema-validation-errors')" type="error">
|
||||||
<ul
|
<ul v-for="error in validationErrors" :key="error">
|
||||||
v-for="error in validationErrors"
|
|
||||||
:key="error"
|
|
||||||
>
|
|
||||||
<li>{{ error }}</li>
|
<li>{{ error }}</li>
|
||||||
</ul>
|
</ul>
|
||||||
</n-alert>
|
</n-alert>
|
||||||
|
|||||||
@@ -4,11 +4,25 @@ import { convertArrayToCsv, getHeaders } from './json-to-csv.service';
|
|||||||
describe('json-to-csv service', () => {
|
describe('json-to-csv service', () => {
|
||||||
describe('getHeaders', () => {
|
describe('getHeaders', () => {
|
||||||
it('extracts all the keys from the array of nested objects', () => {
|
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', () => {
|
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', () => {
|
it('returns an empty array if the array is empty', () => {
|
||||||
@@ -21,7 +35,6 @@ describe('json-to-csv service', () => {
|
|||||||
const array = [
|
const array = [
|
||||||
{ a: 1, b: 2 },
|
{ a: 1, b: 2 },
|
||||||
{ a: 3, b: 4 },
|
{ a: 3, b: 4 },
|
||||||
|
|
||||||
];
|
];
|
||||||
|
|
||||||
expect(convertArrayToCsv({ arrayOrObject: array })).toMatchInlineSnapshot(`
|
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"', () => {
|
it('when a value is null, it is converted to the string "null"', () => {
|
||||||
const array = [
|
const array = [{ a: null, b: 2 }];
|
||||||
{ a: null, b: 2 },
|
|
||||||
];
|
|
||||||
|
|
||||||
expect(convertArrayToCsv({ arrayOrObject: array })).toMatchInlineSnapshot(`
|
expect(convertArrayToCsv({ arrayOrObject: array })).toMatchInlineSnapshot(`
|
||||||
"a,b
|
"a,b
|
||||||
@@ -56,10 +67,7 @@ describe('json-to-csv service', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('when a value is undefined, it is converted to an empty string', () => {
|
it('when a value is undefined, it is converted to an empty string', () => {
|
||||||
const array = [
|
const array = [{ a: undefined, b: 2 }, { b: 3 }];
|
||||||
{ a: undefined, b: 2 },
|
|
||||||
{ b: 3 },
|
|
||||||
];
|
|
||||||
|
|
||||||
expect(convertArrayToCsv({ arrayOrObject: array })).toMatchInlineSnapshot(`
|
expect(convertArrayToCsv({ arrayOrObject: array })).toMatchInlineSnapshot(`
|
||||||
"a,b
|
"a,b
|
||||||
@@ -69,24 +77,20 @@ describe('json-to-csv service', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('when a value contains a comma, it is wrapped in double quotes', () => {
|
it('when a value contains a comma, it is wrapped in double quotes', () => {
|
||||||
const array = [
|
const array = [{ a: 'hello, world', b: 2 }];
|
||||||
{ a: 'hello, world', b: 2 },
|
|
||||||
];
|
|
||||||
|
|
||||||
expect(convertArrayToCsv({ arrayOrObject: array })).toMatchInlineSnapshot(`
|
expect(convertArrayToCsv({ arrayOrObject: array })).toMatchInlineSnapshot(`
|
||||||
"a,b
|
"a,b
|
||||||
\\"hello, world\\",2"
|
"hello, world",2"
|
||||||
`);
|
`);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('when a value contains a double quote, it is escaped with another double quote', () => {
|
it('when a value contains a double quote, it is escaped with another double quote', () => {
|
||||||
const array = [
|
const array = [{ a: 'hello "world"', b: 2 }];
|
||||||
{ a: 'hello "world"', b: 2 },
|
|
||||||
];
|
|
||||||
|
|
||||||
expect(convertArrayToCsv({ arrayOrObject: array })).toMatchInlineSnapshot(`
|
expect(convertArrayToCsv({ arrayOrObject: array })).toMatchInlineSnapshot(`
|
||||||
"a,b
|
"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', () => {
|
it('serializes nested objects and arrays as JSON strings', () => {
|
||||||
const result = convertJsonToEnv({ json: '{"list": [1, 2, 3], "obj": {"a": 1}}' });
|
const result = convertJsonToEnv({ json: '{"list": [1, 2, 3], "obj": {"a": 1}}' });
|
||||||
expect(result).toMatchInlineSnapshot(`
|
expect(result).toMatchInlineSnapshot(`
|
||||||
"LIST=\\"[1,2,3]\\"
|
"LIST="[1,2,3]"
|
||||||
OBJ=\\"{\\\\\\"a\\\\\\":1}\\""
|
OBJ="{\\"a\\":1}""
|
||||||
`);
|
`);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -31,8 +31,7 @@ function convertToMsgPack() {
|
|||||||
try {
|
try {
|
||||||
msgPacked.value = pack(JSON5.parse(jsonInput.value));
|
msgPacked.value = pack(JSON5.parse(jsonInput.value));
|
||||||
msgPackHex.value = msgPacked.value.toString('hex');
|
msgPackHex.value = msgPacked.value.toString('hex');
|
||||||
}
|
} catch (e: any) {
|
||||||
catch (e: any) {
|
|
||||||
error.value = e.toString();
|
error.value = e.toString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -48,7 +47,7 @@ function downloadURL(data: string, fileName: string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function downloadBlob(data: Uint8Array, fileName: string) {
|
function downloadBlob(data: Uint8Array, fileName: string) {
|
||||||
const blob = new Blob([data], {
|
const blob = new Blob([new Uint8Array(data)], {
|
||||||
type: 'application/octet-stream',
|
type: 'application/octet-stream',
|
||||||
});
|
});
|
||||||
const url = window.URL.createObjectURL(blob);
|
const url = window.URL.createObjectURL(blob);
|
||||||
|
|||||||
@@ -13,10 +13,9 @@ const rootName = ref<string>('RootName');
|
|||||||
function transformer(value: string) {
|
function transformer(value: string) {
|
||||||
try {
|
try {
|
||||||
const object = JSON5.parse(value);
|
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);
|
return convert(schema);
|
||||||
}
|
} catch (e: any) {
|
||||||
catch (e: any) {
|
|
||||||
return e.toString();
|
return e.toString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -30,7 +29,11 @@ const rules: UseValidationRule<string>[] = [
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<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
|
<FormatTransformer
|
||||||
:input-label="t('tools.json-to-protobuf.texts.input-label-your-json')"
|
:input-label="t('tools.json-to-protobuf.texts.input-label-your-json')"
|
||||||
|
|||||||
@@ -21,7 +21,9 @@ const payload = ref(`{
|
|||||||
}`);
|
}`);
|
||||||
|
|
||||||
const alg = useQueryParamOrStorage({ name: 'alg', storageName: 'jwt-gen:alg', defaultValue: 'HS512' });
|
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 isSecret = computed(() => algInfo.value.key === 'secret');
|
||||||
|
|
||||||
const inputToken = ref('');
|
const inputToken = ref('');
|
||||||
@@ -31,8 +33,7 @@ watch(inputToken, (value) => {
|
|||||||
try {
|
try {
|
||||||
payload.value = JSON.stringify(jwtDecode<JwtPayload>(value), null, 2);
|
payload.value = JSON.stringify(jwtDecode<JwtPayload>(value), null, 2);
|
||||||
alg.value = getJwtAlgorithm({ jwt: value }) || 'HS512';
|
alg.value = getJwtAlgorithm({ jwt: value }) || 'HS512';
|
||||||
}
|
} catch (e: any) {
|
||||||
catch (e: any) {
|
|
||||||
inputTokenError.value = e.toString();
|
inputTokenError.value = e.toString();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -50,34 +51,54 @@ const publicKeyJWK = ref('');
|
|||||||
const privateKeyJWK = ref('');
|
const privateKeyJWK = ref('');
|
||||||
const privateKeyPEM = ref('');
|
const privateKeyPEM = ref('');
|
||||||
|
|
||||||
watch(publicKeyPEM, async (newValue) => {
|
watch(
|
||||||
try {
|
publicKeyPEM,
|
||||||
publicKeyJWK.value = JSON.stringify(await jose.exportJWK(await jose.importSPKI(newValue, alg.value, { extractable: true })), null, 2);
|
async (newValue) => {
|
||||||
}
|
try {
|
||||||
catch {
|
publicKeyJWK.value = JSON.stringify(
|
||||||
}
|
await jose.exportJWK(await jose.importSPKI(newValue, alg.value, { extractable: true })),
|
||||||
}, { immediate: true });
|
null,
|
||||||
watch(privateKeyPEM, async (newValue) => {
|
2,
|
||||||
try {
|
);
|
||||||
privateKeyJWK.value = JSON.stringify(await jose.exportJWK(await jose.importPKCS8(newValue, alg.value, { extractable: true })), null, 2);
|
} catch {}
|
||||||
}
|
},
|
||||||
catch {
|
{ immediate: true },
|
||||||
}
|
);
|
||||||
}, { immediate: true });
|
watch(
|
||||||
watch(publicKeyJWK, async (newValue) => {
|
privateKeyPEM,
|
||||||
try {
|
async (newValue) => {
|
||||||
publicKeyPEM.value = await jose.exportSPKI(await jose.importJWK({ ...JSON.parse(newValue), ...{ ext: true } }, alg.value) as KeyLike);
|
try {
|
||||||
}
|
privateKeyJWK.value = JSON.stringify(
|
||||||
catch {
|
await jose.exportJWK(await jose.importPKCS8(newValue, alg.value, { extractable: true })),
|
||||||
}
|
null,
|
||||||
}, { immediate: true });
|
2,
|
||||||
watch(privateKeyJWK, async (newValue) => {
|
);
|
||||||
try {
|
} catch {}
|
||||||
privateKeyPEM.value = await jose.exportPKCS8(await jose.importJWK({ ...JSON.parse(newValue), ...{ ext: true } }, alg.value) as KeyLike);
|
},
|
||||||
}
|
{ immediate: true },
|
||||||
catch {
|
);
|
||||||
}
|
watch(
|
||||||
}, { immediate: true });
|
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 () => {
|
watchEffect(async () => {
|
||||||
if (isSecret.value) {
|
if (isSecret.value) {
|
||||||
@@ -86,8 +107,7 @@ watchEffect(async () => {
|
|||||||
publicKeyJWK.value = '';
|
publicKeyJWK.value = '';
|
||||||
privateKeyPEM.value = '';
|
privateKeyPEM.value = '';
|
||||||
publicKeyPEM.value = '';
|
publicKeyPEM.value = '';
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
const { publicKey, privateKey } = await jose.generateKeyPair(alg.value, { extractable: true });
|
const { publicKey, privateKey } = await jose.generateKeyPair(alg.value, { extractable: true });
|
||||||
privateKeyJWK.value = JSON.stringify(await jose.exportJWK(privateKey), null, 2);
|
privateKeyJWK.value = JSON.stringify(await jose.exportJWK(privateKey), null, 2);
|
||||||
publicKeyJWK.value = JSON.stringify(await jose.exportJWK(publicKey), null, 2);
|
publicKeyJWK.value = JSON.stringify(await jose.exportJWK(publicKey), null, 2);
|
||||||
@@ -122,22 +142,25 @@ const encodedJWT = computedAsync(async () => {
|
|||||||
privateKeyOrSecret = Base64.toUint8Array(secretValue);
|
privateKeyOrSecret = Base64.toUint8Array(secretValue);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
} catch (parseError: any) {
|
||||||
|
throw new Error(
|
||||||
|
t('tools.jwt-generator.texts.cannot-parse-secret-as-encoding', [
|
||||||
|
secretValue,
|
||||||
|
secretEncodingValue,
|
||||||
|
parseError,
|
||||||
|
]),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
catch (parseError: any) {
|
} else {
|
||||||
throw new Error(t('tools.jwt-generator.texts.cannot-parse-secret-as-encoding', [secretValue, secretEncodingValue, parseError]));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
privateKeyOrSecret = await jose.importJWK(JSON.parse(privateKeyValue), algValue);
|
privateKeyOrSecret = await jose.importJWK(JSON.parse(privateKeyValue), algValue);
|
||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
token: await (new jose.SignJWT(JSON5.parse(payloadValue))
|
token: await new jose.SignJWT(JSON5.parse(payloadValue))
|
||||||
.setProtectedHeader({ alg: algValue })
|
.setProtectedHeader({ alg: algValue })
|
||||||
.sign(privateKeyOrSecret)),
|
.sign(privateKeyOrSecret),
|
||||||
error: '',
|
error: '',
|
||||||
};
|
};
|
||||||
}
|
} catch (e: any) {
|
||||||
catch (e: any) {
|
|
||||||
return { error: e.toString(), token: '' };
|
return { error: e.toString(), token: '' };
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -147,7 +170,7 @@ const jsonInputValidation = useValidation({
|
|||||||
rules: [
|
rules: [
|
||||||
{
|
{
|
||||||
message: t('tools.jwt-generator.texts.message-invalid-json-string'),
|
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
|
<c-select
|
||||||
v-model:value="alg"
|
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')"
|
:placeholder="t('tools.jwt-generator.texts.placeholder-algorithms')"
|
||||||
mb-2
|
mb-2
|
||||||
/>
|
/>
|
||||||
@@ -196,7 +219,10 @@ const jsonInputValidation = useValidation({
|
|||||||
/>
|
/>
|
||||||
</c-card>
|
</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">
|
<div v-if="isSecret">
|
||||||
<c-select
|
<c-select
|
||||||
v-model:value="secretEncoding"
|
v-model:value="secretEncoding"
|
||||||
@@ -209,39 +235,19 @@ const jsonInputValidation = useValidation({
|
|||||||
</div>
|
</div>
|
||||||
<div v-else>
|
<div v-else>
|
||||||
<n-form-item :label="t('tools.jwt-generator.texts.label-public-key-pem')">
|
<n-form-item :label="t('tools.jwt-generator.texts.label-public-key-pem')">
|
||||||
<c-input-text
|
<c-input-text v-model:value="publicKeyPEM" multiline rows="5" autosize />
|
||||||
v-model:value="publicKeyPEM"
|
|
||||||
multiline
|
|
||||||
rows="5"
|
|
||||||
autosize
|
|
||||||
/>
|
|
||||||
</n-form-item>
|
</n-form-item>
|
||||||
<n-form-item :label="t('tools.jwt-generator.texts.label-private-key-pem')">
|
<n-form-item :label="t('tools.jwt-generator.texts.label-private-key-pem')">
|
||||||
<c-input-text
|
<c-input-text v-model:value="privateKeyPEM" multiline rows="5" autosize />
|
||||||
v-model:value="privateKeyPEM"
|
|
||||||
multiline
|
|
||||||
rows="5"
|
|
||||||
autosize
|
|
||||||
/>
|
|
||||||
</n-form-item>
|
</n-form-item>
|
||||||
|
|
||||||
<n-divider />
|
<n-divider />
|
||||||
|
|
||||||
<n-form-item :label="t('tools.jwt-generator.texts.label-public-key-jwk')">
|
<n-form-item :label="t('tools.jwt-generator.texts.label-public-key-jwk')">
|
||||||
<c-input-text
|
<c-input-text v-model:value="publicKeyJWK" multiline rows="5" autosize />
|
||||||
v-model:value="publicKeyJWK"
|
|
||||||
multiline
|
|
||||||
rows="5"
|
|
||||||
autosize
|
|
||||||
/>
|
|
||||||
</n-form-item>
|
</n-form-item>
|
||||||
<n-form-item :label="t('tools.jwt-generator.texts.label-private-key-jwk')">
|
<n-form-item :label="t('tools.jwt-generator.texts.label-private-key-jwk')">
|
||||||
<c-input-text
|
<c-input-text v-model:value="privateKeyJWK" multiline rows="5" autosize />
|
||||||
v-model:value="privateKeyJWK"
|
|
||||||
multiline
|
|
||||||
rows="5"
|
|
||||||
autosize
|
|
||||||
/>
|
|
||||||
</n-form-item>
|
</n-form-item>
|
||||||
</div>
|
</div>
|
||||||
</c-card>
|
</c-card>
|
||||||
|
|||||||
@@ -10,9 +10,13 @@ const { t } = useI18n();
|
|||||||
|
|
||||||
const toolStore = useToolStore();
|
const toolStore = useToolStore();
|
||||||
|
|
||||||
const unitsConversionTools = computed(() => _.orderBy(
|
const unitsConversionTools = computed(() =>
|
||||||
_.filter(toolStore.tools, t => t.keywords?.includes('units')),
|
_.orderBy(
|
||||||
'name', 'asc'));
|
_.filter(toolStore.tools, (t) => t.keywords?.includes('units')),
|
||||||
|
'name',
|
||||||
|
'asc',
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
const allUnitsSorted = _.uniq(allUnits).sort();
|
const allUnitsSorted = _.uniq(allUnits).sort();
|
||||||
|
|
||||||
@@ -24,19 +28,15 @@ const result = computed(() => {
|
|||||||
try {
|
try {
|
||||||
return {
|
return {
|
||||||
best,
|
best,
|
||||||
selected: outputUnit.value
|
selected: outputUnit.value ? convertMany(inputExpression.value).to(outputUnit.value as Unit) : '',
|
||||||
? convertMany(inputExpression.value).to(outputUnit.value as Unit)
|
|
||||||
: '',
|
|
||||||
};
|
};
|
||||||
}
|
} catch (e: any) {
|
||||||
catch (e: any) {
|
|
||||||
return {
|
return {
|
||||||
best,
|
best,
|
||||||
error: e.toString(),
|
error: e.toString(),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
} catch (e: any) {
|
||||||
catch (e: any) {
|
|
||||||
return {
|
return {
|
||||||
error: e.toString(),
|
error: e.toString(),
|
||||||
};
|
};
|
||||||
@@ -65,8 +65,16 @@ const result = computed(() => {
|
|||||||
<n-divider />
|
<n-divider />
|
||||||
|
|
||||||
<c-card v-if="result.best" :title="t('tools.many-units-converter.texts.title-result')" mb-2>
|
<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
|
||||||
<input-copyable v-if="result.selected" :label="$t('tools.many-units-converter.texts.label-selected-target-unit-outputunit', [outputUnit])" :value="result.selected" />
|
: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-card>
|
||||||
<c-alert v-if="result.error && inputExpression" mb-2>
|
<c-alert v-if="result.error && inputExpression" mb-2>
|
||||||
{{ result.error }}
|
{{ result.error }}
|
||||||
@@ -93,7 +101,7 @@ const result = computed(() => {
|
|||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
{{ tool.description }}
|
{{ tool.description }}
|
||||||
<br>
|
<br />
|
||||||
-> {{ tool.keywords?.join(', ') }}
|
-> {{ tool.keywords?.join(', ') }}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|||||||
+6
-6
@@ -1,6 +1,6 @@
|
|||||||
declare module 'markdown-contents'{
|
declare module 'markdown-contents' {
|
||||||
declare class MarkdownContents {
|
class MarkdownContents {
|
||||||
markdown(): string;
|
markdown(): string;
|
||||||
}
|
}
|
||||||
export default function Create(markdown: string):MarkdownContents;
|
export default function Create(markdown: string): MarkdownContents;
|
||||||
}
|
}
|
||||||
@@ -7,7 +7,9 @@ test.describe('Mermaid Diagram Renderer', () => {
|
|||||||
|
|
||||||
test('should render the initial diagram', async ({ page }) => {
|
test('should render the initial diagram', async ({ page }) => {
|
||||||
const diagramContainer = page.locator('.diagram-container svg');
|
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');
|
await expect(diagramContainer).toHaveAttribute('xmlns', 'http://www.w3.org/2000/svg');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ const { t } = useI18n();
|
|||||||
|
|
||||||
const mimeInfos = Object.entries(mimeTypeToExtension).map(([mimeType, extensions]) => ({ mimeType, extensions }));
|
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 selectedMimeType = ref(undefined);
|
||||||
|
|
||||||
const extensionsFound = computed(() => (selectedMimeType.value ? mimeTypeToExtension[selectedMimeType.value] : []));
|
const extensionsFound = computed(() => (selectedMimeType.value ? mimeTypeToExtension[selectedMimeType.value] : []));
|
||||||
@@ -38,9 +38,9 @@ const mimeTypeFound = computed(() => (selectedExtension.value ? extensionToMimeT
|
|||||||
/>
|
/>
|
||||||
|
|
||||||
<div v-if="extensionsFound.length > 0">
|
<div v-if="extensionsFound.length > 0">
|
||||||
{{ t('tools.mime-types.texts.tag-extensions-of-files-with-the') }}<n-tag round :bordered="false">
|
{{ t('tools.mime-types.texts.tag-extensions-of-files-with-the')
|
||||||
{{ selectedMimeType }}
|
}}<n-tag round :bordered="false"> {{ selectedMimeType }} </n-tag>{{ t('tools.mime-types.texts.tag-mime-type') }}
|
||||||
</n-tag>{{ t('tools.mime-types.texts.tag-mime-type') }}<div style="margin-top: 10px">
|
<div style="margin-top: 10px">
|
||||||
<n-tag
|
<n-tag
|
||||||
v-for="extension of extensionsFound"
|
v-for="extension of extensionsFound"
|
||||||
:key="extension"
|
:key="extension"
|
||||||
@@ -71,10 +71,11 @@ const mimeTypeFound = computed(() => (selectedExtension.value ? extensionToMimeT
|
|||||||
/>
|
/>
|
||||||
|
|
||||||
<div v-if="selectedExtension">
|
<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 }}
|
{{ selectedExtension }}
|
||||||
</n-tag> file
|
</n-tag>
|
||||||
extension:
|
file extension:
|
||||||
<div style="margin-top: 10px">
|
<div style="margin-top: 10px">
|
||||||
<n-tag round :bordered="false" type="primary" style="margin-right: 10px">
|
<n-tag round :bordered="false" type="primary" style="margin-right: 10px">
|
||||||
{{ mimeTypeFound }}
|
{{ mimeTypeFound }}
|
||||||
|
|||||||
@@ -3,7 +3,14 @@ import { useI18n } from 'vue-i18n';
|
|||||||
import { useTimestamp } from '@vueuse/core';
|
import { useTimestamp } from '@vueuse/core';
|
||||||
import { useThemeVars } from 'naive-ui';
|
import { useThemeVars } from 'naive-ui';
|
||||||
import { useQRCode } from '../qr-code-generator/useQRCode';
|
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 TokenDisplay from './token-display.vue';
|
||||||
import { useStyleStore } from '@/stores/style.store';
|
import { useStyleStore } from '@/stores/style.store';
|
||||||
import InputCopyable from '@/components/InputCopyable.vue';
|
import InputCopyable from '@/components/InputCopyable.vue';
|
||||||
@@ -27,12 +34,15 @@ function refreshSecret() {
|
|||||||
secret.value = generateSecret();
|
secret.value = generateSecret();
|
||||||
}
|
}
|
||||||
|
|
||||||
const counter = ref(0);
|
const counter = ref('0');
|
||||||
|
|
||||||
const [hotpValues] = computedRefreshable(
|
const [hotpValues] = computedRefreshable(
|
||||||
() =>
|
() =>
|
||||||
Object.fromEntries(
|
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 },
|
{ throttle: 500 },
|
||||||
);
|
);
|
||||||
@@ -112,7 +122,8 @@ const secretValidationRules = [
|
|||||||
mt-5
|
mt-5
|
||||||
/>
|
/>
|
||||||
<InputCopyable
|
<InputCopyable
|
||||||
v-for="(value, currentCounter) in hotpValues" :key="currentCounter"
|
v-for="(value, currentCounter) in hotpValues"
|
||||||
|
:key="currentCounter"
|
||||||
:value="value"
|
:value="value"
|
||||||
readonly
|
readonly
|
||||||
:label="`HOTP ${currentCounter}:`"
|
:label="`HOTP ${currentCounter}:`"
|
||||||
@@ -141,13 +152,17 @@ const secretValidationRules = [
|
|||||||
label-position="left"
|
label-position="left"
|
||||||
label-width="90px"
|
label-width="90px"
|
||||||
label-align="right"
|
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
|
<InputCopyable
|
||||||
:value="getCounterFromTime({ now, timeStep: 30 }).toString(16).padStart(16, '0')"
|
:value="getCounterFromTime({ now, timeStep: 30 }).toString(16).padStart(16, '0')"
|
||||||
readonly
|
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-position="left"
|
||||||
label-width="90px"
|
label-width="90px"
|
||||||
label-align="right"
|
label-align="right"
|
||||||
@@ -158,9 +173,7 @@ const secretValidationRules = [
|
|||||||
<TokenDisplay :tokens="tokens" mt-5 />
|
<TokenDisplay :tokens="tokens" mt-5 />
|
||||||
|
|
||||||
<n-progress :percentage="(100 * interval) / 30" :color="theme.primaryColor" :show-indicator="false" />
|
<n-progress :percentage="(100 * interval) / 30" :color="theme.primaryColor" :show-indicator="false" />
|
||||||
<div style="text-align: center">
|
<div style="text-align: center">Next in {{ String(Math.floor(30 - interval)).padStart(2, '0') }}s</div>
|
||||||
Next in {{ String(Math.floor(30 - interval)).padStart(2, '0') }}s
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ function getPropertyName(tag: string | undefined) {
|
|||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
const tagLower = tag.toLocaleLowerCase();
|
const tagLower = tag.toLocaleLowerCase();
|
||||||
const prop = getProps().find(p => p.key?.toLocaleLowerCase() === tagLower);
|
const prop = getProps().find((p) => p.key?.toLocaleLowerCase() === tagLower);
|
||||||
if (!prop) {
|
if (!prop) {
|
||||||
return tag;
|
return tag;
|
||||||
}
|
}
|
||||||
@@ -36,8 +36,7 @@ const parsedEmailRaw = computedAsync(async () => {
|
|||||||
includeRawProps: true,
|
includeRawProps: true,
|
||||||
};
|
};
|
||||||
return msg;
|
return msg;
|
||||||
}
|
} catch (e: any) {
|
||||||
catch (e: any) {
|
|
||||||
error.value = e.toString();
|
error.value = e.toString();
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@@ -49,18 +48,13 @@ const parsedRtf = computed(() => {
|
|||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
const rtfBlob = decompressRTF(Array.from(parsedEmail.value?.compressedRtf));
|
const rtfBlob = decompressRTF(Array.from(parsedEmail.value?.compressedRtf));
|
||||||
const rtfText = iconv.decode(
|
const rtfText = iconv.decode(Buffer.from(rtfBlob), 'latin1');
|
||||||
Buffer.from(rtfBlob),
|
|
||||||
'latin1',
|
|
||||||
);
|
|
||||||
try {
|
try {
|
||||||
return { rtf: rtfText, html: deEncapsulateSync(rtfText, { decode: iconv.decode })?.text };
|
return { rtf: rtfText, html: deEncapsulateSync(rtfText, { decode: iconv.decode })?.text };
|
||||||
}
|
} catch (dex: any) {
|
||||||
catch (dex: any) {
|
|
||||||
return { rtf: rtfText, html: dex.toString() };
|
return { rtf: rtfText, html: dex.toString() };
|
||||||
}
|
}
|
||||||
}
|
} catch (ex: any) {
|
||||||
catch (ex: any) {
|
|
||||||
return { rtf: ex.toString(), html: '' };
|
return { rtf: ex.toString(), html: '' };
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -70,7 +64,7 @@ function downloadFile(attachment: FieldsData) {
|
|||||||
if (!attachmentData) {
|
if (!attachmentData) {
|
||||||
return;
|
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 downloadUrl = URL.createObjectURL(blob);
|
||||||
const a = document.createElement('a');
|
const a = document.createElement('a');
|
||||||
a.href = downloadUrl;
|
a.href = downloadUrl;
|
||||||
@@ -101,11 +95,31 @@ function onUpload(file: File) {
|
|||||||
</c-alert>
|
</c-alert>
|
||||||
|
|
||||||
<c-card v-if="!error && parsedEmail" :title="t('tools.outlook-parser.texts.title-output')">
|
<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
|
||||||
<input-copyable v-if="parsedEmail.creationTime" :label="t('tools.outlook-parser.texts.label-creation-date')" :value="parsedEmail.creationTime" />
|
v-if="fileInput?.name"
|
||||||
<input-copyable v-if="parsedEmail.clientSubmitTime" :label="t('tools.outlook-parser.texts.label-submit-date')" :value="parsedEmail.clientSubmitTime" />
|
:label="t('tools.outlook-parser.texts.label-file-name')"
|
||||||
<input-copyable v-if="parsedEmail.messageDeliveryTime" :label="t('tools.outlook-parser.texts.label-delivery-date')" :value="parsedEmail.messageDeliveryTime" />
|
:value="fileInput?.name"
|
||||||
<input-copyable v-if="parsedEmail.lastModificationTime" :label="t('tools.outlook-parser.texts.label-last-mod-date')" :value="parsedEmail.lastModificationTime" />
|
/>
|
||||||
|
<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>
|
<c-card :title="t('tools.outlook-parser.texts.title-recipients')" mt-2>
|
||||||
<input-copyable
|
<input-copyable
|
||||||
v-for="(h, index) in parsedEmail.recipients || []"
|
v-for="(h, index) in parsedEmail.recipients || []"
|
||||||
@@ -114,7 +128,11 @@ function onUpload(file: File) {
|
|||||||
:value="`${h.name}/${h.email}`"
|
:value="`${h.name}/${h.email}`"
|
||||||
/>
|
/>
|
||||||
</c-card>
|
</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>
|
<c-card v-if="parsedEmail.body" :title="t('tools.outlook-parser.texts.title-plain-content')" mb-2>
|
||||||
<details>
|
<details>
|
||||||
<summary>{{ t('tools.outlook-parser.texts.tag-see-content') }}</summary>
|
<summary>{{ t('tools.outlook-parser.texts.tag-see-content') }}</summary>
|
||||||
@@ -143,14 +161,12 @@ function onUpload(file: File) {
|
|||||||
<tr>
|
<tr>
|
||||||
<th scope="col">
|
<th scope="col">
|
||||||
{{ t('tools.outlook-parser.texts.tag-attachment') }}
|
{{ t('tools.outlook-parser.texts.tag-attachment') }}
|
||||||
</th><th scope="col" />
|
</th>
|
||||||
|
<th scope="col" />
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr
|
<tr v-for="(h, index) in parsedEmail.attachments || []" :key="index">
|
||||||
v-for="(h, index) in parsedEmail.attachments || []"
|
|
||||||
:key="index"
|
|
||||||
>
|
|
||||||
<td>
|
<td>
|
||||||
{{ `${h.fileName || h.fileNameShort || 'noname'}` }}
|
{{ `${h.fileName || h.fileNameShort || 'noname'}` }}
|
||||||
</td>
|
</td>
|
||||||
@@ -164,9 +180,21 @@ function onUpload(file: File) {
|
|||||||
</n-table>
|
</n-table>
|
||||||
</c-card>
|
</c-card>
|
||||||
|
|
||||||
<input-copyable v-if="parsedEmail.messageId" :label="t('tools.outlook-parser.texts.label-message-id')" :value="parsedEmail.messageId" />
|
<input-copyable
|
||||||
<input-copyable v-if="parsedEmail.senderName" :label="t('tools.outlook-parser.texts.label-sender-name')" :value="parsedEmail.senderName" />
|
v-if="parsedEmail.messageId"
|
||||||
<input-copyable v-if="parsedEmail.senderEmail" :label="t('tools.outlook-parser.texts.label-sender-email')" :value="parsedEmail.senderEmail" />
|
: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>
|
<c-card v-if="parsedEmail.headers" :title="t('tools.outlook-parser.texts.title-all-headers')" mt-2>
|
||||||
<textarea-copyable :value="parsedEmail.headers" />
|
<textarea-copyable :value="parsedEmail.headers" />
|
||||||
@@ -177,7 +205,7 @@ function onUpload(file: File) {
|
|||||||
v-for="(h, index) in parsedEmail.rawProps || []"
|
v-for="(h, index) in parsedEmail.rawProps || []"
|
||||||
:key="index"
|
:key="index"
|
||||||
:label="h.propertyName || getPropertyName(h.propertyTag)"
|
:label="h.propertyName || getPropertyName(h.propertyTag)"
|
||||||
:value="h.value"
|
:value="String(h.value ?? '')"
|
||||||
/>
|
/>
|
||||||
</c-card>
|
</c-card>
|
||||||
</c-card>
|
</c-card>
|
||||||
|
|||||||
@@ -20,16 +20,18 @@ const results = computedAsync(async () => {
|
|||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
return await parquetReadObjects({ file: await file.arrayBuffer(), compressors });
|
return await parquetReadObjects({ file: await file.arrayBuffer(), compressors });
|
||||||
}
|
} catch (e: any) {
|
||||||
catch (e: any) {
|
|
||||||
error.value = e.toString();
|
error.value = e.toString();
|
||||||
return [];
|
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] || {})
|
const columns = computed(() =>
|
||||||
.map(h => ({ key: h.replace(/\./g, '\\.'), title: h })));
|
Object.keys((results.value || [])[0] || {}).map((h) => ({ key: h.replace(/\\/g, '\\\\').replace(/\./g, '\\.'), title: h })),
|
||||||
|
);
|
||||||
|
|
||||||
function onUpload(file: File) {
|
function onUpload(file: File) {
|
||||||
if (file) {
|
if (file) {
|
||||||
@@ -70,9 +72,10 @@ function downloadCsv() {
|
|||||||
ref="tableRef"
|
ref="tableRef"
|
||||||
size="small"
|
size="small"
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
|
:data="results ?? []"
|
||||||
:data="results" bordered striped
|
bordered
|
||||||
pagination
|
striped
|
||||||
|
:pagination="{}"
|
||||||
/>
|
/>
|
||||||
</n-tab-pane>
|
</n-tab-pane>
|
||||||
</n-tabs>
|
</n-tabs>
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ const { t } = useI18n();
|
|||||||
|
|
||||||
const fileInputs = ref<Array<{ file: File; range: string }>>([]);
|
const fileInputs = ref<Array<{ file: File; range: string }>>([]);
|
||||||
function onUploads(files: Array<File>) {
|
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');
|
const status = ref<'idle' | 'done' | 'error' | 'processing'>('idle');
|
||||||
@@ -17,11 +17,10 @@ const status = ref<'idle' | 'done' | 'error' | 'processing'>('idle');
|
|||||||
const base64OutputPDF = ref('');
|
const base64OutputPDF = ref('');
|
||||||
const logs = ref<string[]>([]);
|
const logs = ref<string[]>([]);
|
||||||
const fileName = ref('concat.pdf');
|
const fileName = ref('concat.pdf');
|
||||||
const { download } = useDownloadFileFromBase64(
|
const { download } = useDownloadFileFromBase64({
|
||||||
{
|
source: base64OutputPDF,
|
||||||
source: base64OutputPDF,
|
filename: fileName,
|
||||||
filename: fileName,
|
});
|
||||||
});
|
|
||||||
const qpdfCommand = ref('');
|
const qpdfCommand = ref('');
|
||||||
|
|
||||||
async function onProcessClicked() {
|
async function onProcessClicked() {
|
||||||
@@ -37,29 +36,23 @@ async function onProcessClicked() {
|
|||||||
|
|
||||||
status.value = 'processing';
|
status.value = 'processing';
|
||||||
try {
|
try {
|
||||||
const options = [
|
const options = ['--empty', '--pages'];
|
||||||
'--empty',
|
|
||||||
'--pages',
|
|
||||||
];
|
|
||||||
for (let i = 0; i < fileInputsValue.length; i++) {
|
for (let i = 0; i < fileInputsValue.length; i++) {
|
||||||
options.push(`in${i}.pdf`);
|
options.push(`in${i}.pdf`);
|
||||||
if (fileInputsValue[i].range) {
|
if (fileInputsValue[i].range) {
|
||||||
options.push(`${fileInputsValue[i].range}`);
|
options.push(`${fileInputsValue[i].range}`);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
options.push('1-z');
|
options.push('1-z');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
options.push('--');
|
options.push('--');
|
||||||
options.push('out.pdf');
|
options.push('out.pdf');
|
||||||
const outPdfBuffer = await callMainWithManyInOutPdf(fileBuffers,
|
const outPdfBuffer = await callMainWithManyInOutPdf(fileBuffers, options, 0);
|
||||||
options, 0);
|
|
||||||
base64OutputPDF.value = `data:application/pdf;base64,${Base64.fromUint8Array(outPdfBuffer)}`;
|
base64OutputPDF.value = `data:application/pdf;base64,${Base64.fromUint8Array(outPdfBuffer)}`;
|
||||||
status.value = 'done';
|
status.value = 'done';
|
||||||
|
|
||||||
download();
|
download();
|
||||||
}
|
} catch (e) {
|
||||||
catch (e) {
|
|
||||||
status.value = 'error';
|
status.value = 'error';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -97,7 +90,11 @@ async function callMainWithManyInOutPdf(input_files: Array<ArrayBuffer>, args: s
|
|||||||
@files-upload="onUploads"
|
@files-upload="onUploads"
|
||||||
/>
|
/>
|
||||||
<div mt-2 text-center>
|
<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>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -107,7 +104,7 @@ async function callMainWithManyInOutPdf(input_files: Array<ArrayBuffer>, args: s
|
|||||||
show-sort-button
|
show-sort-button
|
||||||
w-full
|
w-full
|
||||||
:insertion-disabled="true"
|
:insertion-disabled="true"
|
||||||
:create-button-props="{ id: 'pdf-concat-create' }"
|
:create-button-props="{ id: 'pdf-concat-create' } as any"
|
||||||
>
|
>
|
||||||
<template #action="{ index, remove, move }">
|
<template #action="{ index, remove, move }">
|
||||||
<div ml-1 flex gap-1>
|
<div ml-1 flex gap-1>
|
||||||
@@ -139,7 +136,8 @@ async function callMainWithManyInOutPdf(input_files: Array<ArrayBuffer>, args: s
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<n-p>
|
<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') }}
|
{{ t('tools.pdf-concat.texts.tag-qpdf-documentation') }}
|
||||||
</n-a>
|
</n-a>
|
||||||
</n-p>
|
</n-p>
|
||||||
@@ -156,10 +154,7 @@ async function callMainWithManyInOutPdf(input_files: Array<ArrayBuffer>, args: s
|
|||||||
<c-alert v-if="status === 'error'" type="error">
|
<c-alert v-if="status === 'error'" type="error">
|
||||||
{{ $t('tools.file-type.texts.an-error-occured-processing') }} <span>{{ fileName }}</span>
|
{{ $t('tools.file-type.texts.an-error-occured-processing') }} <span>{{ fileName }}</span>
|
||||||
</c-alert>
|
</c-alert>
|
||||||
<n-spin
|
<n-spin v-if="status === 'processing'" size="small" />
|
||||||
v-if="status === 'processing'"
|
|
||||||
size="small"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<c-card :title="t('tools.pdf-concat.texts.title-logs')">
|
<c-card :title="t('tools.pdf-concat.texts.title-logs')">
|
||||||
@@ -170,5 +165,7 @@ async function callMainWithManyInOutPdf(input_files: Array<ArrayBuffer>, args: s
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
::v-deep(#pdf-concat-create) { display: none; }
|
::v-deep(#pdf-concat-create) {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
@@ -71,14 +71,12 @@ async function encryptStream() {
|
|||||||
encryptProgress.value = Math.round((processed / total) * 100);
|
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.');
|
message.success('File encrypted.');
|
||||||
}
|
} catch (err: any) {
|
||||||
catch (err: any) {
|
|
||||||
error.value = err.toString();
|
error.value = err.toString();
|
||||||
message.error('Encryption failed.');
|
message.error('Encryption failed.');
|
||||||
}
|
} finally {
|
||||||
finally {
|
|
||||||
loadingEncrypt.value = false;
|
loadingEncrypt.value = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -104,9 +102,9 @@ async function decryptStream() {
|
|||||||
|
|
||||||
const unlockedKey = passphrase.value
|
const unlockedKey = passphrase.value
|
||||||
? await openpgp.decryptKey({
|
? await openpgp.decryptKey({
|
||||||
privateKey,
|
privateKey,
|
||||||
passphrase: passphrase.value,
|
passphrase: passphrase.value,
|
||||||
})
|
})
|
||||||
: privateKey;
|
: privateKey;
|
||||||
|
|
||||||
const source = encryptedBlob.value ?? file.value!;
|
const source = encryptedBlob.value ?? file.value!;
|
||||||
@@ -138,14 +136,12 @@ async function decryptStream() {
|
|||||||
decryptProgress.value = Math.round((processed / total) * 100);
|
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.');
|
message.success('File decrypted.');
|
||||||
}
|
} catch (err: any) {
|
||||||
catch (err: any) {
|
|
||||||
error.value = err.toString();
|
error.value = err.toString();
|
||||||
message.error('Decryption failed.');
|
message.error('Decryption failed.');
|
||||||
}
|
} finally {
|
||||||
finally {
|
|
||||||
loadingDecrypt.value = false;
|
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')">
|
<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 />
|
<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">
|
<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>
|
</NFormItem>
|
||||||
</NCard>
|
</NCard>
|
||||||
|
|
||||||
<!-- Actions -->
|
<!-- Actions -->
|
||||||
<NSpace justify="center" mb-1>
|
<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') }}
|
{{ t('tools.pgp-file-encryption.texts.tag-encrypt-stream') }}
|
||||||
</NButton>
|
</NButton>
|
||||||
|
|
||||||
@@ -232,7 +239,10 @@ function downloadBlob(blob: Blob | null, filename: string) {
|
|||||||
{{ t('tools.pgp-file-encryption.texts.tag-decrypted-file-ready') }}
|
{{ t('tools.pgp-file-encryption.texts.tag-decrypted-file-ready') }}
|
||||||
</NAlert>
|
</NAlert>
|
||||||
<NSpace justify="center">
|
<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') }}
|
{{ t('tools.pgp-file-encryption.texts.tag-download-decrypted') }}
|
||||||
</NButton>
|
</NButton>
|
||||||
</NSpace>
|
</NSpace>
|
||||||
|
|||||||
@@ -4,22 +4,28 @@ import { randomNumber } from './pin-code-generator.service';
|
|||||||
describe('pin-code-generator', () => {
|
describe('pin-code-generator', () => {
|
||||||
describe('randomNumber', () => {
|
describe('randomNumber', () => {
|
||||||
it('should generate random pin code of given length', () => {
|
it('should generate random pin code of given length', () => {
|
||||||
expect(randomNumber({
|
expect(
|
||||||
length: 10,
|
randomNumber({
|
||||||
})).toHaveLength(10);
|
length: 10,
|
||||||
expect(randomNumber({
|
}),
|
||||||
length: 4,
|
).toHaveLength(10);
|
||||||
})).toHaveLength(4);
|
expect(
|
||||||
expect(randomNumber({
|
randomNumber({
|
||||||
length: 25,
|
length: 4,
|
||||||
})).toHaveLength(25);
|
}),
|
||||||
|
).toHaveLength(4);
|
||||||
|
expect(
|
||||||
|
randomNumber({
|
||||||
|
length: 25,
|
||||||
|
}),
|
||||||
|
).toHaveLength(25);
|
||||||
});
|
});
|
||||||
it('should generate random pin code without duplicate', () => {
|
it('should generate random pin code without duplicate', () => {
|
||||||
const pin = randomNumber({
|
const pin = randomNumber({
|
||||||
length: 10,
|
length: 10,
|
||||||
});
|
});
|
||||||
expect(pin).toHaveLength(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', () => {
|
it('should generate random pin code with duplicate', () => {
|
||||||
|
|||||||
@@ -44,7 +44,11 @@ export default createStore({
|
|||||||
state.prefersAlarmSound = !state.prefersAlarmSound;
|
state.prefersAlarmSound = !state.prefersAlarmSound;
|
||||||
},
|
},
|
||||||
toggleTimer(state) {
|
toggleTimer(state) {
|
||||||
state.isTimerRunning ? stopTimer(state) : startTimer(state);
|
if (state.isTimerRunning) {
|
||||||
|
stopTimer(state);
|
||||||
|
} else {
|
||||||
|
startTimer(state);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
toggleResetDropup(state) {
|
toggleResetDropup(state) {
|
||||||
state.isResetDropupVisible = !state.isResetDropupVisible;
|
state.isResetDropupVisible = !state.isResetDropupVisible;
|
||||||
@@ -76,10 +80,6 @@ export default createStore({
|
|||||||
this.commit('updateAppColor', { propName: 'appAccentColor', propValue: '#3b83b0' });
|
this.commit('updateAppColor', { propName: 'appAccentColor', propValue: '#3b83b0' });
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
actions: {
|
actions: {},
|
||||||
|
modules: {},
|
||||||
},
|
|
||||||
modules: {
|
|
||||||
|
|
||||||
},
|
|
||||||
});
|
});
|
||||||
@@ -9,15 +9,21 @@ function msToString(ms) {
|
|||||||
let titleInterval = null;
|
let titleInterval = null;
|
||||||
function startTitleAlarm(str, delay) {
|
function startTitleAlarm(str, delay) {
|
||||||
titleInterval = setInterval(() => {
|
titleInterval = setInterval(() => {
|
||||||
document.title.startsWith('⏰')
|
if (document.title.startsWith('⏰')) {
|
||||||
? document.title = `${str} - IT Tools`
|
document.title = `${str} - IT Tools`;
|
||||||
: document.title = '⏰⏰⏰⏰⏰⏰⏰⏰⏰⏰' + ' - IT Tools';
|
} else {
|
||||||
|
document.title = '⏰⏰⏰⏰⏰⏰⏰⏰⏰⏰' + ' - IT Tools';
|
||||||
|
}
|
||||||
}, delay);
|
}, delay);
|
||||||
}
|
}
|
||||||
|
|
||||||
function stopTitleAlarm() {
|
function stopTitleAlarm() {
|
||||||
// eslint-disable-next-line no-alert
|
if (titleInterval) {
|
||||||
titleInterval ? clearInterval(titleInterval) : alert('Error: something went wrong when trying to stop the title alarm.');
|
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';
|
document.title = 'Pomodoro Timer - IT Tools';
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -25,8 +31,7 @@ function getNextTimerMode(state) {
|
|||||||
const currentMode = state.progress[state.progress.length - 1];
|
const currentMode = state.progress[state.progress.length - 1];
|
||||||
if (currentMode === 'workInterval') {
|
if (currentMode === 'workInterval') {
|
||||||
return state.progress.length === state.shortBreakCount * 2 + 1 ? 'longBreak' : 'shortBreak';
|
return state.progress.length === state.shortBreakCount * 2 + 1 ? 'longBreak' : 'shortBreak';
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
return 'workInterval';
|
return 'workInterval';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -89,8 +94,7 @@ function onTimerFinished(state, alarmPlayer) {
|
|||||||
function setupNextTimerMode(state) {
|
function setupNextTimerMode(state) {
|
||||||
if (state.progress.length === state.shortBreakCount * 2 + 2) {
|
if (state.progress.length === state.shortBreakCount * 2 + 2) {
|
||||||
startOver(state);
|
startOver(state);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
const timerMode = state.progress[state.progress.length - 1];
|
const timerMode = state.progress[state.progress.length - 1];
|
||||||
state.time = state[timerMode] * 60000;
|
state.time = state[timerMode] * 60000;
|
||||||
state.counter = msToString(state.time);
|
state.counter = msToString(state.time);
|
||||||
@@ -120,7 +124,7 @@ function startTimer(state) {
|
|||||||
}
|
}
|
||||||
state.time = newRemainingTime;
|
state.time = newRemainingTime;
|
||||||
state.counter = msToString(newRemainingTime);
|
state.counter = msToString(newRemainingTime);
|
||||||
state.progressPercent = (totalModeTime - newRemainingTime) / totalModeTime * 100;
|
state.progressPercent = ((totalModeTime - newRemainingTime) / totalModeTime) * 100;
|
||||||
}, 200);
|
}, 200);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -136,11 +140,4 @@ function setAppAccentColor(hexColor) {
|
|||||||
root.style.setProperty('--pomodoro-app-accent-color', hexColor);
|
root.style.setProperty('--pomodoro-app-accent-color', hexColor);
|
||||||
}
|
}
|
||||||
|
|
||||||
export {
|
export { startTimer, stopTimer, startOver, setupNextTimerMode, stopAlarms, setAppAccentColor };
|
||||||
startTimer,
|
|
||||||
stopTimer,
|
|
||||||
startOver,
|
|
||||||
setupNextTimerMode,
|
|
||||||
stopAlarms,
|
|
||||||
setAppAccentColor,
|
|
||||||
};
|
|
||||||
+3
-6
@@ -1,7 +1,4 @@
|
|||||||
declare module 'esm-potrace-wasm' {
|
declare module 'esm-potrace-wasm' {
|
||||||
export function potrace(
|
export function potrace(imageBitmapSource: ImageBitmapSource, options: object): Promise<string>;
|
||||||
imageBitmapSource: ImageBitmapSource,
|
export function init(): Promise<void>;
|
||||||
options: Object
|
}
|
||||||
): Promise<string>;
|
|
||||||
export function init(): Promise<void>;
|
|
||||||
}
|
|
||||||
@@ -19,9 +19,9 @@ const supportedUnits = {
|
|||||||
fW: 'femtowatt',
|
fW: 'femtowatt',
|
||||||
horsepower: 'horsepower',
|
horsepower: 'horsepower',
|
||||||
hp: 'mechanical horsepower',
|
hp: 'mechanical horsepower',
|
||||||
}; ;
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<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>
|
</template>
|
||||||
@@ -9,16 +9,17 @@ const { t } = useI18n();
|
|||||||
const message = useMessage();
|
const message = useMessage();
|
||||||
|
|
||||||
const { data: rawText } = useIDBKeyval('rsvp:txt', '');
|
const { data: rawText } = useIDBKeyval('rsvp:txt', '');
|
||||||
const words = computed(() =>
|
const words = computed(
|
||||||
rawText.value
|
() =>
|
||||||
.replace(/\r/g, '') // clean \r
|
rawText.value
|
||||||
.replace(/\s+([!?:;])/g, '$1') // clean \r
|
.replace(/\r/g, '') // clean \r
|
||||||
.replace(/\n\s*\n/g, '¤endpara¤ ') // keep double empty lines for para breaks
|
.replace(/\s+([!?:;])/g, '$1') // clean \r
|
||||||
.replace(/\s+/g, ' ')
|
.replace(/\n\s*\n/g, '¤endpara¤ ') // keep double empty lines for para breaks
|
||||||
.trim()
|
.replace(/\s+/g, ' ')
|
||||||
.split(' ')
|
.trim()
|
||||||
.filter(Boolean)
|
.split(' ')
|
||||||
.map((word: string) => word.replace(/¤endpara¤$/g, '\n\n')), // add double \n for para breaks
|
.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 });
|
const wpm = useQueryParamOrStorage({ name: 'wpm', storageName: 'rsvp:w', defaultValue: 300 });
|
||||||
@@ -107,8 +108,7 @@ function scheduleNext() {
|
|||||||
if (next < words.value.length) {
|
if (next < words.value.length) {
|
||||||
currentIndex.value = next;
|
currentIndex.value = next;
|
||||||
scheduleNext();
|
scheduleNext();
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
isPlaying.value = false;
|
isPlaying.value = false;
|
||||||
clearTimer();
|
clearTimer();
|
||||||
}
|
}
|
||||||
@@ -163,8 +163,7 @@ async function onUpload(file: File) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
message.error(t('tools.rsvp-reader.text.unsupported-file-type'));
|
message.error(t('tools.rsvp-reader.text.unsupported-file-type'));
|
||||||
}
|
} catch (err) {
|
||||||
catch (err) {
|
|
||||||
message.error(`Failed to parse file: ${err}`);
|
message.error(`Failed to parse file: ${err}`);
|
||||||
}
|
}
|
||||||
isProcessingFile.value = false;
|
isProcessingFile.value = false;
|
||||||
@@ -174,7 +173,11 @@ function handleKeydown(e: KeyboardEvent) {
|
|||||||
// Space → Play/Pause
|
// Space → Play/Pause
|
||||||
if (e.code === 'Space') {
|
if (e.code === 'Space') {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
isPlaying.value ? pause() : start();
|
if (isPlaying.value) {
|
||||||
|
pause();
|
||||||
|
} else {
|
||||||
|
start();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Right arrow → skip forward
|
// Right arrow → skip forward
|
||||||
@@ -215,21 +218,15 @@ function handleKeydown(e: KeyboardEvent) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function moveRight() {
|
function moveRight() {
|
||||||
currentIndex.value = Math.min(
|
currentIndex.value = Math.min(currentIndex.value + chunkSize.value, words.value.length - 1);
|
||||||
currentIndex.value + chunkSize.value,
|
|
||||||
words.value.length - 1,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function moveLeft() {
|
function moveLeft() {
|
||||||
currentIndex.value = Math.max(
|
currentIndex.value = Math.max(currentIndex.value - chunkSize.value, 0);
|
||||||
currentIndex.value - chunkSize.value,
|
|
||||||
0,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function progressJump(e: MouseEvent) {
|
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')) {
|
while (el && !el.className.includes('n-progress-content')) {
|
||||||
el = el.parentElement;
|
el = el.parentElement;
|
||||||
}
|
}
|
||||||
@@ -279,18 +276,14 @@ onBeforeUnmount(() => {
|
|||||||
|
|
||||||
<NProgress
|
<NProgress
|
||||||
type="line"
|
type="line"
|
||||||
:percentage="((currentIndex / words.length) * 100).toFixed(1)"
|
:percentage="Number(((currentIndex / words.length) * 100).toFixed(1))"
|
||||||
indicator-placement="inside"
|
indicator-placement="inside"
|
||||||
style="cursor: pointer;"
|
style="cursor: pointer"
|
||||||
mb-2
|
mb-2
|
||||||
@click="progressJump"
|
@click="progressJump"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<NCard
|
<NCard embedded style="text-align: center; min-height: 150px" :style="{ backgroundColor: bgColor }">
|
||||||
embedded
|
|
||||||
style="text-align: center; min-height: 150px;"
|
|
||||||
:style="{ backgroundColor: bgColor }"
|
|
||||||
>
|
|
||||||
<div
|
<div
|
||||||
:style="{
|
:style="{
|
||||||
fontSize: `${fontSize}px`,
|
fontSize: `${fontSize}px`,
|
||||||
@@ -303,7 +296,8 @@ onBeforeUnmount(() => {
|
|||||||
</div>
|
</div>
|
||||||
</NCard>
|
</NCard>
|
||||||
<n-space justify="center" mt-1>
|
<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>
|
</n-space>
|
||||||
</div>
|
</div>
|
||||||
</n-tab-pane>
|
</n-tab-pane>
|
||||||
@@ -382,7 +376,7 @@ onBeforeUnmount(() => {
|
|||||||
<n-table :bordered="false" :single-line="false" size="small">
|
<n-table :bordered="false" :single-line="false" size="small">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th style="width: 160px;">
|
<th style="width: 160px">
|
||||||
{{ t('tools.rsvp-reader.texts.tag-shortcut') }}
|
{{ t('tools.rsvp-reader.texts.tag-shortcut') }}
|
||||||
</th>
|
</th>
|
||||||
<th>{{ t('tools.rsvp-reader.texts.tag-action') }}</th>
|
<th>{{ t('tools.rsvp-reader.texts.tag-action') }}</th>
|
||||||
@@ -390,37 +384,55 @@ onBeforeUnmount(() => {
|
|||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<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>
|
<td>{{ t('tools.rsvp-reader.texts.tag-play-pause') }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<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>
|
<td>{{ t('tools.rsvp-reader.texts.tag-skip-forward-one-chunk') }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<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>
|
<td>{{ t('tools.rsvp-reader.texts.tag-skip-backward-one-chunk') }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<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>
|
<td>{{ t('tools.rsvp-reader.texts.tag-increase-wpm') }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<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>
|
<td>{{ t('tools.rsvp-reader.texts.tag-decrease-wpm') }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<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>
|
<td>{{ t('tools.rsvp-reader.texts.tag-jump-to-start') }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<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>
|
<td>{{ t('tools.rsvp-reader.texts.tag-jump-to-end') }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</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 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 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 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({
|
export function maskSensitiveData({
|
||||||
value,
|
value,
|
||||||
customRegex = '',
|
customRegex = '',
|
||||||
excludedMatchers = [],
|
excludedMatchers = [],
|
||||||
}: {
|
}: {
|
||||||
value: string
|
value: string;
|
||||||
customRegex?: string
|
customRegex?: string;
|
||||||
excludedMatchers?: Array<MatcherNames>
|
excludedMatchers?: Array<MatcherNames>;
|
||||||
}) {
|
}) {
|
||||||
excludedMatchers = excludedMatchers || [];
|
excludedMatchers = excludedMatchers || [];
|
||||||
const emptyRegex = /(?:)/g;
|
const emptyRegex = /(?:)/g;
|
||||||
return maskString(value, null as never, {
|
return maskString(
|
||||||
customRegex: new RegExp((customRegex || '').split('\n').map(line => `(${line})`).join('|'), 'gi'),
|
value,
|
||||||
macRegex: excludedMatchers.includes('mac') ? emptyRegex : macRegex,
|
null as never,
|
||||||
ipv6Regex: excludedMatchers.includes('ipv6') ? emptyRegex : ipRegex.v6({ includeBoundaries: false }),
|
{
|
||||||
urlWithOrWithoutPrefixRegex: excludedMatchers.includes('urlWithOrWithoutPrefix') ? emptyRegex : urlWithOrWithoutPrefixRegex,
|
customRegex: new RegExp(
|
||||||
jwtRegex: excludedMatchers.includes('jwt') ? emptyRegex : jwtRegex,
|
(customRegex || '')
|
||||||
phoneRegex: excludedMatchers.includes('phone') ? emptyRegex : phoneRegex,
|
.split('\n')
|
||||||
}, {
|
.map((line) => `(${line})`)
|
||||||
excludeMatchers: [...excludedMatchers, ...[
|
.join('|'),
|
||||||
'passwordMention', 'password', 'passwordSubstring',
|
'gi',
|
||||||
]] as SensitiveContentKey[],
|
),
|
||||||
});
|
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[],
|
||||||
|
},
|
||||||
|
);
|
||||||
}
|
}
|
||||||
@@ -10,17 +10,8 @@ const input = ref('');
|
|||||||
const outputRef = ref<HTMLElement | null>(null);
|
const outputRef = ref<HTMLElement | null>(null);
|
||||||
const selectedPort = ref<SerialPort | undefined>();
|
const selectedPort = ref<SerialPort | undefined>();
|
||||||
|
|
||||||
const {
|
const { isConnected, outputLines, baudRate, lineEnding, availablePorts, connect, disconnect, send, listPorts } =
|
||||||
isConnected,
|
useSerialPort();
|
||||||
outputLines,
|
|
||||||
baudRate,
|
|
||||||
lineEnding,
|
|
||||||
availablePorts,
|
|
||||||
connect,
|
|
||||||
disconnect,
|
|
||||||
send,
|
|
||||||
listPorts,
|
|
||||||
} = useSerialPort();
|
|
||||||
|
|
||||||
const baudOptions = [
|
const baudOptions = [
|
||||||
{ label: t('tools.serial-console.texts.label-9600'), value: 9600 },
|
{ label: t('tools.serial-console.texts.label-9600'), value: 9600 },
|
||||||
@@ -65,9 +56,10 @@ function isWindowSecureContext() {
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<c-alert v-if="!isWindowSecureContext()" mb-2>
|
<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-your-browser-is-not-in')
|
||||||
{{ $t('tools.pgp-encryption.texts.tag-secure-context-https') }}
|
}}<n-a href="https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts" target="_blank">
|
||||||
</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-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>
|
</c-alert>
|
||||||
|
|
||||||
<NCard :title="t('tools.serial-console.texts.title-serial-terminal')">
|
<NCard :title="t('tools.serial-console.texts.title-serial-terminal')">
|
||||||
@@ -85,8 +77,9 @@ function isWindowSecureContext() {
|
|||||||
style="width: 120px"
|
style="width: 120px"
|
||||||
/>
|
/>
|
||||||
<NSelect
|
<NSelect
|
||||||
v-model:value="selectedPort"
|
:value="selectedPort as any"
|
||||||
:options="portOptions"
|
:options="portOptions as any"
|
||||||
|
@update:value="(v: any) => (selectedPort = v)"
|
||||||
label-field="label"
|
label-field="label"
|
||||||
value-field="value"
|
value-field="value"
|
||||||
:placeholder="t('tools.serial-console.texts.placeholder-select-port')"
|
:placeholder="t('tools.serial-console.texts.placeholder-select-port')"
|
||||||
|
|||||||
@@ -9,7 +9,9 @@ const error = ref('');
|
|||||||
const loading = ref(false);
|
const loading = ref(false);
|
||||||
const corsAnywhereUrl = useITStorage('short-urls-expander:cors-anywhere-url', '//cors.outils-libre.org');
|
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) => {
|
return new Promise((resolve) => {
|
||||||
try {
|
try {
|
||||||
const corsUrl = `${corsAnywhereUrl.value.replace(/\/+$/g, '')}/${url}`;
|
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
|
// In browsers, xhr.responseURL gives the final resolved URL after redirects
|
||||||
const finalUrl = xhr.getResponseHeader('X-Final-Url') || xhr.responseURL;
|
const finalUrl = xhr.getResponseHeader('X-Final-Url') || xhr.responseURL;
|
||||||
if (finalUrl && finalUrl !== corsUrl) {
|
if (finalUrl && finalUrl !== corsUrl) {
|
||||||
resolve({ short: url, expanded: finalUrl, status: t('tools.short-urls-expander.texts.expanded'), ok: true });
|
resolve({
|
||||||
}
|
short: url,
|
||||||
else {
|
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 });
|
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 });
|
resolve({ short: url, expanded: null, status: t('tools.short-urls-expander.texts.failed'), ok: false });
|
||||||
};
|
};
|
||||||
xhr.send();
|
xhr.send();
|
||||||
}
|
} catch {
|
||||||
catch {
|
|
||||||
resolve({ short: url, expanded: null, status: t('tools.short-urls-expander.texts.failed'), ok: false });
|
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
|
const urls = inputUrls.value
|
||||||
.split('\n')
|
.split('\n')
|
||||||
.map(u => u.trim())
|
.map((u) => u.trim())
|
||||||
.filter(u => u.length > 0);
|
.filter((u) => u.length > 0);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const promises = urls.map(async (url) => {
|
const promises = urls.map(async (url) => {
|
||||||
@@ -54,11 +59,9 @@ async function expandUrls() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
results.value = await Promise.all(promises);
|
results.value = await Promise.all(promises);
|
||||||
}
|
} catch (err) {
|
||||||
catch (err) {
|
|
||||||
error.value = t('tools.short-urls-expander.texts.failed-to-expand-some-urls');
|
error.value = t('tools.short-urls-expander.texts.failed-to-expand-some-urls');
|
||||||
}
|
} finally {
|
||||||
finally {
|
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -68,15 +71,15 @@ function downloadCsv() {
|
|||||||
return;
|
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 header = [
|
||||||
const rows = results.value.map(r => [
|
t('tools.short-urls-expander.texts.short-url'),
|
||||||
r.short,
|
t('tools.short-urls-expander.texts.expanded-url'),
|
||||||
r.expanded ?? '',
|
t('tools.short-urls-expander.texts.tag-status'),
|
||||||
r.status,
|
];
|
||||||
]);
|
const rows = results.value.map((r) => [r.short, r.expanded ?? '', r.status]);
|
||||||
|
|
||||||
const csvContent = [header, ...rows]
|
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');
|
.join('\n');
|
||||||
|
|
||||||
const blob = new Blob([csvContent], { type: 'text/csv;charset=utf-8;' });
|
const blob = new Blob([csvContent], { type: 'text/csv;charset=utf-8;' });
|
||||||
@@ -103,7 +106,11 @@ function downloadCsv() {
|
|||||||
mb-1
|
mb-1
|
||||||
/>
|
/>
|
||||||
<n-p>
|
<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">
|
<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') }}
|
{{ t('tools.short-urls-expander.texts.self-hosted-cors-anywhere') }}
|
||||||
</a>
|
</a>
|
||||||
@@ -148,7 +155,7 @@ function downloadCsv() {
|
|||||||
<tr v-for="(url, index) of results" :key="index">
|
<tr v-for="(url, index) of results" :key="index">
|
||||||
<td>{{ url.short }}</td>
|
<td>{{ url.short }}</td>
|
||||||
<td>
|
<td>
|
||||||
<input-copyable :value="url.expanded" />
|
<input-copyable :value="url.expanded ?? ''" />
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<n-a v-if="url.expanded" :href="url.expanded" target="_blank">
|
<n-a v-if="url.expanded" :href="url.expanded" target="_blank">
|
||||||
|
|||||||
@@ -9,12 +9,12 @@ function transformer(value: string) {
|
|||||||
const Result = getAuthHeaderCheckResult({ message: value, password: password.value });
|
const Result = getAuthHeaderCheckResult({ message: value, password: password.value });
|
||||||
if (Result) {
|
if (Result) {
|
||||||
return t('tools.sip-auth.sucess');
|
return t('tools.sip-auth.sucess');
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
return t('tools.sip-auth.failure');
|
return t('tools.sip-auth.failure');
|
||||||
// return `11 calculatedHash: ${calculatedHash}, response: ${response}`;
|
// return `11 calculatedHash: ${calculatedHash}, response: ${response}`;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return '';
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,13 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import satisfies from 'spdx-satisfies';
|
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 type { VNode } from 'vue';
|
||||||
import { h, ref } from 'vue';
|
import { h, ref } from 'vue';
|
||||||
import type { SelectOption } from 'naive-ui';
|
import type { SelectOption } from 'naive-ui';
|
||||||
@@ -17,8 +23,7 @@ const secondLicence = ref('MIT');
|
|||||||
const compatibility = computed(() => {
|
const compatibility = computed(() => {
|
||||||
try {
|
try {
|
||||||
return satisfies(firstLicence.value.split(':')[0], [secondLicence.value.split(':')[0]]) ? 'ok' : 'nok';
|
return satisfies(firstLicence.value.split(':')[0], [secondLicence.value.split(':')[0]]) ? 'ok' : 'nok';
|
||||||
}
|
} catch (e: any) {
|
||||||
catch (e: any) {
|
|
||||||
return e.toString();
|
return e.toString();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -36,21 +41,42 @@ const permissionsInfos = permissions.map((l) => {
|
|||||||
|
|
||||||
const conditions = [
|
const conditions = [
|
||||||
{ key: 'include-copyright', desc: 'A copy of the license and copyright notice must be included with the software.' },
|
{ 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: '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: '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: 'network-use-disclose',
|
||||||
{ 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.' },
|
desc: 'Users who interact with the software via network are given the right to receive a copy of the source code.',
|
||||||
{ 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: '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) => {
|
const conditionsInfos = conditions.map((l) => {
|
||||||
return { value: l.key, label: l.key, desc: l.desc };
|
return { value: l.key, label: l.key, desc: l.desc };
|
||||||
});
|
});
|
||||||
const limitations = [
|
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: '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.' },
|
{ key: 'warranty', desc: 'The license explicitly states that it does NOT provide any warranty.' },
|
||||||
];
|
];
|
||||||
const limitationsInfos = limitations.map((l) => {
|
const limitationsInfos = limitations.map((l) => {
|
||||||
@@ -68,9 +94,11 @@ const currentLicence = ref('MIT');
|
|||||||
const currentLicenceInfo = computed(() => {
|
const currentLicenceInfo = computed(() => {
|
||||||
return getLicenseFromId(currentLicence.value, true);
|
return getLicenseFromId(currentLicence.value, true);
|
||||||
});
|
});
|
||||||
const licenceInfos = computed(() => licenses.map((l) => {
|
const licenceInfos = computed(() =>
|
||||||
return { value: l.id, label: `${l.id}: ${l.title}` };
|
licenses.map((l) => {
|
||||||
}));
|
return { value: l.id, label: `${l.id}: ${l.title}` };
|
||||||
|
}),
|
||||||
|
);
|
||||||
|
|
||||||
const filterAllowedPermissions = ref([]);
|
const filterAllowedPermissions = ref([]);
|
||||||
const filterDisallowedPermissions = ref([]);
|
const filterDisallowedPermissions = ref([]);
|
||||||
@@ -80,26 +108,34 @@ const filterAllowedLimitations = ref([]);
|
|||||||
const filterDisallowedLimitations = ref([]);
|
const filterDisallowedLimitations = ref([]);
|
||||||
|
|
||||||
function includesAll(filters: string | string[], elements: string[]) {
|
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[]) {
|
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(
|
const filteredLicencesInfos = computed(() =>
|
||||||
(licence) => {
|
licenses
|
||||||
return includesAll(filterAllowedPermissions.value, licence.permissions)
|
.filter((licence) => {
|
||||||
&& includesNone(filterDisallowedPermissions.value, licence.permissions)
|
return (
|
||||||
&& includesAll(filterAllowedConditions.value, licence.conditions)
|
includesAll(filterAllowedPermissions.value, licence.permissions) &&
|
||||||
&& includesNone(filterDisallowedConditions.value, licence.conditions)
|
includesNone(filterDisallowedPermissions.value, licence.permissions) &&
|
||||||
&& includesAll(filterAllowedLimitations.value, licence.limitations)
|
includesAll(filterAllowedConditions.value, licence.conditions) &&
|
||||||
&& includesNone(filterDisallowedLimitations.value, licence.limitations);
|
includesNone(filterDisallowedConditions.value, licence.conditions) &&
|
||||||
}).map((l) => {
|
includesAll(filterAllowedLimitations.value, licence.limitations) &&
|
||||||
return { value: l.id, label: `${l.id}: ${l.title}` };
|
includesNone(filterDisallowedLimitations.value, licence.limitations)
|
||||||
}));
|
);
|
||||||
|
})
|
||||||
|
.map((l) => {
|
||||||
|
return { value: l.id, label: `${l.id}: ${l.title}` };
|
||||||
|
}),
|
||||||
|
);
|
||||||
|
|
||||||
function handleLicenceFallback() {
|
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;
|
currentLicence.value = fallback.value;
|
||||||
return fallback;
|
return fallback;
|
||||||
}
|
}
|
||||||
@@ -108,7 +144,11 @@ function handleLicenceFallback() {
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<n-card :title="t('tools.software-licence-compatibility.texts.title-software-licences-compatibility')" mb-5>
|
<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
|
<n-auto-complete
|
||||||
v-model:value="firstLicence"
|
v-model:value="firstLicence"
|
||||||
:options="licenceInfos"
|
:options="licenceInfos"
|
||||||
@@ -118,11 +158,17 @@ function handleLicenceFallback() {
|
|||||||
/>
|
/>
|
||||||
</n-form-item>
|
</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
|
<n-auto-complete
|
||||||
v-model:value="secondLicence"
|
v-model:value="secondLicence"
|
||||||
:options="licenceInfos"
|
: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
|
raw-text
|
||||||
mb-5
|
mb-5
|
||||||
/>
|
/>
|
||||||
@@ -130,13 +176,13 @@ function handleLicenceFallback() {
|
|||||||
|
|
||||||
<div v-if="firstLicence !== '' && secondLicence !== ''" flex justify-center>
|
<div v-if="firstLicence !== '' && secondLicence !== ''" flex justify-center>
|
||||||
<span v-if="compatibility === 'ok'">
|
<span v-if="compatibility === 'ok'">
|
||||||
<n-icon color="green">
|
<n-icon color="green"> <CheckIcon /> </n-icon
|
||||||
<CheckIcon />
|
>{{ t('tools.software-licence-compatibility.texts.tag-compatible') }}</span
|
||||||
</n-icon>{{ t('tools.software-licence-compatibility.texts.tag-compatible') }}</span>
|
>
|
||||||
<span v-if="compatibility === 'nok'">
|
<span v-if="compatibility === 'nok'">
|
||||||
<n-icon color="red">
|
<n-icon color="red"> <CrossIcon /> </n-icon
|
||||||
<CrossIcon />
|
>{{ t('tools.software-licence-compatibility.texts.tag-not-compatible') }}</span
|
||||||
</n-icon>{{ t('tools.software-licence-compatibility.texts.tag-not-compatible') }}</span>
|
>
|
||||||
<n-alert v-if="compatibility !== 'nok' && compatibility !== 'ok'" type="error">
|
<n-alert v-if="compatibility !== 'nok' && compatibility !== 'ok'" type="error">
|
||||||
{{ compatibility }}
|
{{ compatibility }}
|
||||||
</n-alert>
|
</n-alert>
|
||||||
@@ -152,7 +198,8 @@ function handleLicenceFallback() {
|
|||||||
>
|
>
|
||||||
<n-select
|
<n-select
|
||||||
v-model:value="filterAllowedPermissions"
|
v-model:value="filterAllowedPermissions"
|
||||||
filterable multiple
|
filterable
|
||||||
|
multiple
|
||||||
:options="permissionsInfos"
|
:options="permissionsInfos"
|
||||||
:render-option="renderTooltips"
|
:render-option="renderTooltips"
|
||||||
/>
|
/>
|
||||||
@@ -165,7 +212,8 @@ function handleLicenceFallback() {
|
|||||||
>
|
>
|
||||||
<n-select
|
<n-select
|
||||||
v-model:value="filterDisallowedPermissions"
|
v-model:value="filterDisallowedPermissions"
|
||||||
multiple filterable
|
multiple
|
||||||
|
filterable
|
||||||
:options="permissionsInfos"
|
:options="permissionsInfos"
|
||||||
:render-option="renderTooltips"
|
:render-option="renderTooltips"
|
||||||
/>
|
/>
|
||||||
@@ -180,7 +228,8 @@ function handleLicenceFallback() {
|
|||||||
>
|
>
|
||||||
<n-select
|
<n-select
|
||||||
v-model:value="filterAllowedConditions"
|
v-model:value="filterAllowedConditions"
|
||||||
multiple filterable
|
multiple
|
||||||
|
filterable
|
||||||
:options="conditionsInfos"
|
:options="conditionsInfos"
|
||||||
:render-option="renderTooltips"
|
:render-option="renderTooltips"
|
||||||
/>
|
/>
|
||||||
@@ -193,7 +242,8 @@ function handleLicenceFallback() {
|
|||||||
>
|
>
|
||||||
<n-select
|
<n-select
|
||||||
v-model:value="filterDisallowedConditions"
|
v-model:value="filterDisallowedConditions"
|
||||||
multiple filterable
|
multiple
|
||||||
|
filterable
|
||||||
:options="conditionsInfos"
|
:options="conditionsInfos"
|
||||||
:render-option="renderTooltips"
|
:render-option="renderTooltips"
|
||||||
/>
|
/>
|
||||||
@@ -208,7 +258,8 @@ function handleLicenceFallback() {
|
|||||||
>
|
>
|
||||||
<n-select
|
<n-select
|
||||||
v-model:value="filterAllowedLimitations"
|
v-model:value="filterAllowedLimitations"
|
||||||
multiple filterable
|
multiple
|
||||||
|
filterable
|
||||||
:options="limitationsInfos"
|
:options="limitationsInfos"
|
||||||
:render-option="renderTooltips"
|
:render-option="renderTooltips"
|
||||||
/>
|
/>
|
||||||
@@ -221,7 +272,8 @@ function handleLicenceFallback() {
|
|||||||
>
|
>
|
||||||
<n-select
|
<n-select
|
||||||
v-model:value="filterDisallowedLimitations"
|
v-model:value="filterDisallowedLimitations"
|
||||||
multiple filterable
|
multiple
|
||||||
|
filterable
|
||||||
:options="limitationsInfos"
|
:options="limitationsInfos"
|
||||||
:render-option="renderTooltips"
|
:render-option="renderTooltips"
|
||||||
/>
|
/>
|
||||||
@@ -241,46 +293,25 @@ function handleLicenceFallback() {
|
|||||||
:fallback-option="handleLicenceFallback"
|
:fallback-option="handleLicenceFallback"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<n-p text-center>
|
<n-p text-center> Applicable licences: {{ filteredLicencesInfos.length }} </n-p>
|
||||||
Applicable licences: {{ filteredLicencesInfos.length }}
|
|
||||||
</n-p>
|
|
||||||
|
|
||||||
<n-divider />
|
<n-divider />
|
||||||
|
|
||||||
<div v-if="filteredLicencesInfos.length > 0">
|
<div v-if="filteredLicencesInfos.length > 0">
|
||||||
<n-form-item :label="t('tools.software-licence-compatibility.texts.label-id')" label-placement="left">
|
<n-form-item :label="t('tools.software-licence-compatibility.texts.label-id')" label-placement="left">
|
||||||
<n-input
|
<n-input :value="currentLicenceInfo?.id" readonly mb-5 />
|
||||||
:value="currentLicenceInfo?.id"
|
|
||||||
readonly mb-5
|
|
||||||
/>
|
|
||||||
</n-form-item>
|
</n-form-item>
|
||||||
<n-form-item :label="t('tools.software-licence-compatibility.texts.label-title')" label-placement="left">
|
<n-form-item :label="t('tools.software-licence-compatibility.texts.label-title')" label-placement="left">
|
||||||
<n-input
|
<n-input :value="currentLicenceInfo?.title" readonly mb-5 />
|
||||||
:value="currentLicenceInfo?.title"
|
|
||||||
readonly mb-5
|
|
||||||
/>
|
|
||||||
</n-form-item>
|
</n-form-item>
|
||||||
<n-form-item :label="t('tools.software-licence-compatibility.texts.label-description')">
|
<n-form-item :label="t('tools.software-licence-compatibility.texts.label-description')">
|
||||||
<TextareaCopyable
|
<TextareaCopyable :value="currentLicenceInfo?.description ?? ''" readonly word-wrap mb-5 />
|
||||||
:value="currentLicenceInfo?.description ?? ''"
|
|
||||||
readonly
|
|
||||||
word-wrap
|
|
||||||
mb-5
|
|
||||||
/>
|
|
||||||
</n-form-item>
|
</n-form-item>
|
||||||
<n-form-item :label="t('tools.software-licence-compatibility.texts.label-how')">
|
<n-form-item :label="t('tools.software-licence-compatibility.texts.label-how')">
|
||||||
<TextareaCopyable
|
<TextareaCopyable :value="currentLicenceInfo?.how ?? ''" word-wrap readonly mb-5 />
|
||||||
:value="currentLicenceInfo?.how ?? ''"
|
|
||||||
word-wrap
|
|
||||||
readonly
|
|
||||||
mb-5
|
|
||||||
/>
|
|
||||||
</n-form-item>
|
</n-form-item>
|
||||||
<n-form-item :label="t('tools.software-licence-compatibility.texts.label-used-by')">
|
<n-form-item :label="t('tools.software-licence-compatibility.texts.label-used-by')">
|
||||||
<TextareaCopyable
|
<TextareaCopyable :value="Object.keys(currentLicenceInfo?.using || []).join(', ')" mb-5 />
|
||||||
:value="Object.keys(currentLicenceInfo?.using || []).join(', ')"
|
|
||||||
mb-5
|
|
||||||
/>
|
|
||||||
</n-form-item>
|
</n-form-item>
|
||||||
|
|
||||||
<n-card :title="t('tools.software-licence-compatibility.texts.title-permissions')" mb-5>
|
<n-card :title="t('tools.software-licence-compatibility.texts.title-permissions')" mb-5>
|
||||||
@@ -320,12 +351,7 @@ function handleLicenceFallback() {
|
|||||||
</n-card>
|
</n-card>
|
||||||
|
|
||||||
<n-form-item :label="t('tools.software-licence-compatibility.texts.label-content')">
|
<n-form-item :label="t('tools.software-licence-compatibility.texts.label-content')">
|
||||||
<TextareaCopyable
|
<TextareaCopyable :value="currentLicenceInfo?.body ?? ''" word-wrap readonly mb-5 />
|
||||||
:value="currentLicenceInfo?.body ?? ''"
|
|
||||||
word-wrap
|
|
||||||
readonly
|
|
||||||
mb-5
|
|
||||||
/>
|
|
||||||
</n-form-item>
|
</n-form-item>
|
||||||
</div>
|
</div>
|
||||||
</n-card>
|
</n-card>
|
||||||
|
|||||||
Loaded 100 of 130 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user