mirror of
https://github.com/CorentinTh/it-tools.git
synced 2025-10-23 16:14:04 +00:00
Compare commits
23 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
eb2755c8ae | ||
|
2b38d6f81e | ||
|
ed9046d3e1 | ||
|
3f8c345981 | ||
|
277bd5f0da | ||
|
09abffbcf9 | ||
|
6d5856fa93 | ||
|
2b89111cbb | ||
|
6b11de258a | ||
|
4fc303e5e3 | ||
|
cbf0b3d699 | ||
|
71f79a5bbf | ||
|
4112fa532e | ||
|
a14cac6d5c | ||
|
dc768561f7 | ||
|
a58ae24d94 | ||
|
582808597c | ||
|
724e142222 | ||
|
d066319b45 | ||
|
2e046ad09f | ||
|
34480b4e25 | ||
|
1a18b744dc | ||
|
70a3df044e |
66
CHANGELOG.md
66
CHANGELOG.md
@@ -2,6 +2,72 @@
|
||||
|
||||
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
||||
|
||||
## [2.2.0](https://github.com/CorentinTh/it-tools/compare/v2.1.0...v2.2.0) (2022-04-18)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **new-tool:** url parser ([2b38d6f](https://github.com/CorentinTh/it-tools/commit/2b38d6f81e34845f896b858513e35209cba29f98))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **sider-footer:** fixed commit sha url ([ed9046d](https://github.com/CorentinTh/it-tools/commit/ed9046d3e1f5a7dc01c722ed139a2ae477a2d48f))
|
||||
|
||||
## [2.1.0](https://github.com/CorentinTh/it-tools/compare/v2.0.2...v2.1.0) (2022-04-18)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **new-tool:** bcrypt ([6d5856f](https://github.com/CorentinTh/it-tools/commit/6d5856fa93d1ffbf71856c75adc24ad87dc4b49b))
|
||||
* **new-tool:** device information ([277bd5f](https://github.com/CorentinTh/it-tools/commit/277bd5f0da359fd54c5164b376007d182a9fabde))
|
||||
|
||||
|
||||
### Refactors
|
||||
|
||||
* **menu:** removed burger menu icon tooltip ([09abffb](https://github.com/CorentinTh/it-tools/commit/09abffbcf9b09cb5adc34f8754b019d0c8b60854))
|
||||
|
||||
### [2.0.2](https://github.com/CorentinTh/it-tools/compare/v2.0.1...v2.0.2) (2022-04-18)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **git-memo:** pre scroll on overflow ([4fc303e](https://github.com/CorentinTh/it-tools/commit/4fc303e5e3f0bef9201cc002963e244a5d3be7b5))
|
||||
* **menu:** menu auto closed on mobile ([71f79a5](https://github.com/CorentinTh/it-tools/commit/71f79a5bbfe0dd5451a435c0a55e8b77ee7d3848))
|
||||
* **qr-code:** responsive layout ([cbf0b3d](https://github.com/CorentinTh/it-tools/commit/cbf0b3d6995e47d371a8fbcfccd65ba304fb08dc))
|
||||
|
||||
|
||||
### Refactors
|
||||
|
||||
* **crontab:** list instead of table on small screen ([6b11de2](https://github.com/CorentinTh/it-tools/commit/6b11de258a8039fe7729130ede35d47592be7cbe))
|
||||
* removed empty sources ([a14cac6](https://github.com/CorentinTh/it-tools/commit/a14cac6d5c5967a47ca76a1d1a420115114c3bbf))
|
||||
* throw an error object instead of string ([4112fa5](https://github.com/CorentinTh/it-tools/commit/4112fa532e3d4be190d52bf3b11e0d4c3625a402))
|
||||
|
||||
### [2.0.1](https://github.com/CorentinTh/it-tools/compare/v2.0.0...v2.0.1) (2022-04-16)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **config:** added vercel.json ([2e046ad](https://github.com/CorentinTh/it-tools/commit/2e046ad09fed4a55bbf4449e3683a4150839c461))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* remove duplicate property ([d066319](https://github.com/CorentinTh/it-tools/commit/d066319b45dee35df0212c7ff407013bd7449ae3))
|
||||
* **style:** url encode/decode layout ([34480b4](https://github.com/CorentinTh/it-tools/commit/34480b4e25ffc33536b03a0ba711c480219ad553))
|
||||
|
||||
|
||||
### Documentation
|
||||
|
||||
* updated description ([70a3df0](https://github.com/CorentinTh/it-tools/commit/70a3df044ea86ac35c1839ac5ab624f694fdd845))
|
||||
|
||||
|
||||
### Refactors
|
||||
|
||||
* clean imports ([724e142](https://github.com/CorentinTh/it-tools/commit/724e142222202798ea3df7d0fb34da1e7a5216a1))
|
||||
* lint fix ([a58ae24](https://github.com/CorentinTh/it-tools/commit/a58ae24d9409728ac12fb780f2c64643087de5be))
|
||||
* ref name ([5828085](https://github.com/CorentinTh/it-tools/commit/582808597c6aadf0feb48f6aae0a29b839e0dd54))
|
||||
|
||||
## 2.0.0 (2022-04-16)
|
||||
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||

|
||||
|
||||
Aggregated set of useful tools that every developer may need once in a while. Available [here](https://dev.it-tools.tech).
|
||||
Useful tools for developer and people working in IT. [Have a look !](https://it-tools.tech).
|
||||
|
||||
## Functionalities and roadmap
|
||||
|
||||
@@ -15,7 +15,9 @@ You have an idea of a tool? Submit a [feature request](https://github.com/Corent
|
||||
[VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=johnsoncodehk.volar) (and disable Vetur) + [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=johnsoncodehk.vscode-typescript-vue-plugin).
|
||||
|
||||
### Node version
|
||||
|
||||
Ensure you have the correct node/npm version
|
||||
|
||||
```sh
|
||||
nvm use
|
||||
```
|
||||
@@ -51,6 +53,7 @@ npm run lint
|
||||
```
|
||||
|
||||
### Create a new tool
|
||||
|
||||
To create a new tool, there is a script that generate the boilerplate of the new tool, simply run:
|
||||
|
||||
```sh
|
||||
|
28
package-lock.json
generated
28
package-lock.json
generated
@@ -1,18 +1,19 @@
|
||||
{
|
||||
"name": "it-tools",
|
||||
"version": "2.0.0",
|
||||
"version": "2.2.0",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "it-tools",
|
||||
"version": "2.0.0",
|
||||
"version": "2.2.0",
|
||||
"dependencies": {
|
||||
"@it-tools/bip39": "^0.0.4",
|
||||
"@vicons/material": "^0.12.0",
|
||||
"@vicons/tabler": "^0.12.0",
|
||||
"@vueuse/core": "^8.2.1",
|
||||
"@vueuse/head": "^0.7.5",
|
||||
"bcryptjs": "^2.4.3",
|
||||
"change-case": "^4.1.2",
|
||||
"colord": "^2.9.2",
|
||||
"cron-validator": "^1.3.1",
|
||||
@@ -31,6 +32,7 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@rushstack/eslint-patch": "^1.1.0",
|
||||
"@types/bcryptjs": "^2.4.2",
|
||||
"@types/crypto-js": "^4.1.1",
|
||||
"@types/jsdom": "^16.2.14",
|
||||
"@types/node": "^16.11.25",
|
||||
@@ -2112,6 +2114,12 @@
|
||||
"node": ">=10.13.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/bcryptjs": {
|
||||
"version": "2.4.2",
|
||||
"resolved": "https://registry.npmjs.org/@types/bcryptjs/-/bcryptjs-2.4.2.tgz",
|
||||
"integrity": "sha512-LiMQ6EOPob/4yUL66SZzu6Yh77cbzJFYll+ZfaPiPPFswtIlA/Fs1MzdKYA7JApHU49zQTbJGX3PDmCpIdDBRQ==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/@types/chai": {
|
||||
"version": "4.3.0",
|
||||
"resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.3.0.tgz",
|
||||
@@ -3173,6 +3181,11 @@
|
||||
"integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/bcryptjs": {
|
||||
"version": "2.4.3",
|
||||
"resolved": "https://registry.npmjs.org/bcryptjs/-/bcryptjs-2.4.3.tgz",
|
||||
"integrity": "sha1-mrVie5PmBiH/fNrF2pczAn3x0Ms="
|
||||
},
|
||||
"node_modules/bluebird": {
|
||||
"version": "3.7.2",
|
||||
"resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz",
|
||||
@@ -12690,6 +12703,12 @@
|
||||
"integrity": "sha512-L7z9BgrNEcYyUYtF+HaEfiS5ebkh9jXqbszz7pC0hRBPaatV0XjSD3+eHrpqFemQfgwiFF0QPIarnIihIDn7OA==",
|
||||
"dev": true
|
||||
},
|
||||
"@types/bcryptjs": {
|
||||
"version": "2.4.2",
|
||||
"resolved": "https://registry.npmjs.org/@types/bcryptjs/-/bcryptjs-2.4.2.tgz",
|
||||
"integrity": "sha512-LiMQ6EOPob/4yUL66SZzu6Yh77cbzJFYll+ZfaPiPPFswtIlA/Fs1MzdKYA7JApHU49zQTbJGX3PDmCpIdDBRQ==",
|
||||
"dev": true
|
||||
},
|
||||
"@types/chai": {
|
||||
"version": "4.3.0",
|
||||
"resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.3.0.tgz",
|
||||
@@ -13526,6 +13545,11 @@
|
||||
"integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==",
|
||||
"dev": true
|
||||
},
|
||||
"bcryptjs": {
|
||||
"version": "2.4.3",
|
||||
"resolved": "https://registry.npmjs.org/bcryptjs/-/bcryptjs-2.4.3.tgz",
|
||||
"integrity": "sha1-mrVie5PmBiH/fNrF2pczAn3x0Ms="
|
||||
},
|
||||
"bluebird": {
|
||||
"version": "3.7.2",
|
||||
"resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz",
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "it-tools",
|
||||
"version": "2.0.0",
|
||||
"version": "2.2.0",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
"build": "vue-tsc --noEmit && vite build",
|
||||
@@ -18,6 +18,7 @@
|
||||
"@vicons/tabler": "^0.12.0",
|
||||
"@vueuse/core": "^8.2.1",
|
||||
"@vueuse/head": "^0.7.5",
|
||||
"bcryptjs": "^2.4.3",
|
||||
"change-case": "^4.1.2",
|
||||
"colord": "^2.9.2",
|
||||
"cron-validator": "^1.3.1",
|
||||
@@ -36,6 +37,7 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@rushstack/eslint-patch": "^1.1.0",
|
||||
"@types/bcryptjs": "^2.4.2",
|
||||
"@types/crypto-js": "^4.1.1",
|
||||
"@types/jsdom": "^16.2.14",
|
||||
"@types/node": "^16.11.25",
|
||||
|
@@ -1,14 +1,9 @@
|
||||
<script setup lang="ts">
|
||||
import { RouterView } from 'vue-router'
|
||||
import { layouts } from './layouts';
|
||||
import { computed } from 'vue';
|
||||
import { useRoute } from 'vue-router'
|
||||
import { useRoute, RouterView } from 'vue-router'
|
||||
import { darkThemeOverrides, lightThemeOverrides } from './themes'
|
||||
import {
|
||||
darkTheme,
|
||||
NConfigProvider,
|
||||
NGlobalStyle,
|
||||
} from 'naive-ui'
|
||||
import { darkTheme, NGlobalStyle, NMessageProvider } from 'naive-ui'
|
||||
import { useStyleStore } from './stores/style.store';
|
||||
|
||||
const route = useRoute();
|
||||
|
@@ -18,10 +18,8 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { useVModel } from '@vueuse/core'
|
||||
import { useVModel, useClipboard } from '@vueuse/core'
|
||||
import { ContentCopyFilled } from '@vicons/material'
|
||||
|
||||
import { useClipboard } from '@vueuse/core';
|
||||
import { ref } from 'vue';
|
||||
|
||||
const props = defineProps<{ value: string, }>()
|
||||
|
@@ -9,8 +9,6 @@
|
||||
:show-trigger="false"
|
||||
:native-scrollbar="false"
|
||||
:position="siderPosition"
|
||||
@collapse="isMenuCollapsed = true"
|
||||
@expand="isMenuCollapsed = false"
|
||||
>
|
||||
<slot name="sider" />
|
||||
</n-layout-sider>
|
||||
@@ -27,8 +25,7 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import { useStyleStore } from '@/stores/style.store';
|
||||
import { toRefs } from 'vue';
|
||||
import { computed } from 'vue';
|
||||
import { toRefs, computed } from 'vue';
|
||||
|
||||
const styleStore = useStyleStore()
|
||||
const { isMenuCollapsed, isSmallScreen } = toRefs(styleStore)
|
||||
@@ -37,24 +34,24 @@ const siderPosition = computed(() => isSmallScreen.value ? 'absolute' : 'static'
|
||||
|
||||
<style lang="less" scoped>
|
||||
.overlay {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-color: #00000080;
|
||||
cursor: pointer;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-color: #00000080;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.content {
|
||||
|
||||
// background-color: #f1f5f9;
|
||||
::v-deep(.n-layout-scroll-container) {
|
||||
padding: 26px;
|
||||
}
|
||||
// background-color: #f1f5f9;
|
||||
::v-deep(.n-layout-scroll-container) {
|
||||
padding: 26px;
|
||||
}
|
||||
}
|
||||
|
||||
.n-layout {
|
||||
height: 100vh;
|
||||
height: 100vh;
|
||||
}
|
||||
</style>
|
@@ -1,5 +1,5 @@
|
||||
<script lang="ts" setup>
|
||||
import { NIcon } from 'naive-ui';
|
||||
import { NIcon, useThemeVars } from 'naive-ui';
|
||||
import { h, ref, type Component } from 'vue';
|
||||
import { RouterLink, useRoute } from 'vue-router';
|
||||
import { Heart, Menu2, Home2 } from '@vicons/tabler'
|
||||
@@ -7,7 +7,6 @@ import { toolsByCategory } from '@/tools';
|
||||
import SearchBar from '../components/SearchBar.vue';
|
||||
import { useStyleStore } from '@/stores/style.store';
|
||||
import HeroGradient from '../assets/hero-gradient.svg?component'
|
||||
import { useThemeVars } from 'naive-ui'
|
||||
import MenuLayout from '../components/MenuLayout.vue'
|
||||
import NavbarButtons from '../components/NavbarButtons.vue'
|
||||
|
||||
@@ -99,7 +98,7 @@ const m = toolsByCategory.map(category => ({
|
||||
rel="noopener"
|
||||
type="primary"
|
||||
depth="3"
|
||||
:href="`https://github.com/CorentinTh/it-tools/tree/v${commitSha}`"
|
||||
:href="`https://github.com/CorentinTh/it-tools/tree/${commitSha}`"
|
||||
>
|
||||
{{ commitSha }}
|
||||
</n-button>
|
||||
@@ -123,26 +122,19 @@ const m = toolsByCategory.map(category => ({
|
||||
|
||||
<template #content>
|
||||
<div class="navigation">
|
||||
<n-tooltip
|
||||
trigger="hover"
|
||||
placement="bottom-start"
|
||||
<n-button
|
||||
:size="styleStore.isSmallScreen ? 'medium' : 'large'"
|
||||
circle
|
||||
quaternary
|
||||
aria-label="Toogle menu"
|
||||
@click="styleStore.isMenuCollapsed = !styleStore.isMenuCollapsed"
|
||||
>
|
||||
<template #trigger>
|
||||
<n-button
|
||||
:size="styleStore.isSmallScreen ? 'medium' : 'large'"
|
||||
circle
|
||||
quaternary
|
||||
aria-label="Toogle menu"
|
||||
@click="styleStore.isMenuCollapsed = !styleStore.isMenuCollapsed"
|
||||
>
|
||||
<n-icon
|
||||
size="25"
|
||||
:component="Menu2"
|
||||
/>
|
||||
</n-button>
|
||||
</template>
|
||||
Toggle menu
|
||||
</n-tooltip>
|
||||
<n-icon
|
||||
size="25"
|
||||
:component="Menu2"
|
||||
/>
|
||||
</n-button>
|
||||
|
||||
|
||||
<router-link
|
||||
to="/"
|
||||
@@ -226,7 +218,6 @@ const m = toolsByCategory.map(category => ({
|
||||
.hero-wrapper {
|
||||
position: absolute;
|
||||
display: block;
|
||||
position: absolute;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
z-index: 10;
|
||||
|
@@ -1,11 +1,27 @@
|
||||
import { useMediaQuery, useStorage } from '@vueuse/core';
|
||||
import { useMediaQuery, useStorage, whenever } from '@vueuse/core';
|
||||
import { defineStore } from 'pinia';
|
||||
import type { Ref } from 'vue';
|
||||
|
||||
export const useStyleStore = defineStore('style', {
|
||||
state: () => ({
|
||||
isDarkTheme: useStorage('isDarkTheme', true) as Ref<boolean>,
|
||||
isMenuCollapsed: useStorage('isMenuCollapsed', false) as Ref<boolean>,
|
||||
isSmallScreen: useMediaQuery('(max-width: 700px)'),
|
||||
}),
|
||||
state: () => {
|
||||
const isDarkTheme = useStorage('isDarkTheme', true) as Ref<boolean>;
|
||||
const isSmallScreen = useMediaQuery('(max-width: 700px)');
|
||||
const isMenuCollapsed = useStorage('isMenuCollapsed', !isSmallScreen.value) as Ref<boolean>;
|
||||
|
||||
whenever(
|
||||
() => !isSmallScreen.value,
|
||||
() => (isMenuCollapsed.value = false)
|
||||
);
|
||||
|
||||
whenever(
|
||||
() => isSmallScreen.value,
|
||||
() => (isMenuCollapsed.value = true)
|
||||
);
|
||||
|
||||
return {
|
||||
isDarkTheme,
|
||||
isMenuCollapsed,
|
||||
isSmallScreen,
|
||||
};
|
||||
},
|
||||
});
|
||||
|
118
src/tools/bcrypt/bcrypt.vue
Normal file
118
src/tools/bcrypt/bcrypt.vue
Normal file
@@ -0,0 +1,118 @@
|
||||
<template>
|
||||
<n-card title="Hash">
|
||||
<n-form label-width="120">
|
||||
<n-form-item
|
||||
label="Your string: "
|
||||
label-placement="left"
|
||||
>
|
||||
<n-input
|
||||
v-model:value="input"
|
||||
placeholder="Your string to bcrypt..."
|
||||
autocomplete="off"
|
||||
autocorrect="off"
|
||||
autocapitalize="off"
|
||||
spellcheck="false"
|
||||
/>
|
||||
</n-form-item>
|
||||
<n-form-item
|
||||
label="Salt count: "
|
||||
label-placement="left"
|
||||
>
|
||||
<n-input-number
|
||||
v-model:value="saltCount"
|
||||
placeholder="Salt rounds..."
|
||||
:max="10"
|
||||
:min="0"
|
||||
style="width: 100%;"
|
||||
/>
|
||||
</n-form-item>
|
||||
<n-input
|
||||
:value="hashed"
|
||||
readonly
|
||||
style="text-align: center;"
|
||||
/>
|
||||
</n-form>
|
||||
<br>
|
||||
<n-space justify="center">
|
||||
<n-button
|
||||
secondary
|
||||
@click="copy"
|
||||
>
|
||||
Copy hash
|
||||
</n-button>
|
||||
</n-space>
|
||||
</n-card>
|
||||
|
||||
<br>
|
||||
<n-card title="Compare string with hash">
|
||||
<n-form label-width="120">
|
||||
<n-form-item
|
||||
label="Your string: "
|
||||
label-placement="left"
|
||||
>
|
||||
<n-input
|
||||
v-model:value="compareString"
|
||||
placeholder="Your string to compare..."
|
||||
autocomplete="off"
|
||||
autocorrect="off"
|
||||
autocapitalize="off"
|
||||
spellcheck="false"
|
||||
/>
|
||||
</n-form-item>
|
||||
<n-form-item
|
||||
label="Your hash: "
|
||||
label-placement="left"
|
||||
>
|
||||
<n-input
|
||||
v-model:value="compareHash"
|
||||
placeholder="Your hahs to compare..."
|
||||
autocomplete="off"
|
||||
autocorrect="off"
|
||||
autocapitalize="off"
|
||||
spellcheck="false"
|
||||
/>
|
||||
</n-form-item>
|
||||
<n-form-item
|
||||
label="Do they match ? "
|
||||
label-placement="left"
|
||||
:show-feedback="false"
|
||||
>
|
||||
<div
|
||||
class="compare-result"
|
||||
:class="{positive:compareMatch}"
|
||||
>
|
||||
{{ compareMatch ? 'Yes' : 'No' }}
|
||||
</div>
|
||||
</n-form-item>
|
||||
</n-form>
|
||||
</n-card>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { computed, ref } from 'vue';
|
||||
import {hashSync, compareSync} from 'bcryptjs'
|
||||
import { useCopy } from '@/composable/copy';
|
||||
import { useThemeVars } from 'naive-ui';
|
||||
|
||||
const themeVars = useThemeVars()
|
||||
|
||||
const input = ref('')
|
||||
const saltCount = ref(10)
|
||||
const hashed = computed(() => hashSync(input.value, saltCount.value))
|
||||
const {copy} = useCopy({source: hashed, text:'Hashed string copied to the clipboard'})
|
||||
|
||||
const compareString = ref('')
|
||||
const compareHash = ref('')
|
||||
const compareMatch = computed(() => compareSync(compareString.value, compareHash.value))
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.compare-result {
|
||||
color: v-bind('themeVars.errorColor');
|
||||
|
||||
&.positive {
|
||||
color: v-bind('themeVars.successColor')
|
||||
}
|
||||
}
|
||||
</style>
|
11
src/tools/bcrypt/index.ts
Normal file
11
src/tools/bcrypt/index.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import { LockSquare } from '@vicons/tabler';
|
||||
import type { ITool } from './../Tool';
|
||||
|
||||
export const tool: ITool = {
|
||||
name: 'Bcrypt',
|
||||
path: '/bcrypt',
|
||||
description: 'Hash and compare text string using bcrypt. Bcrypt is a password-hashing function based on the Blowfish cipher.',
|
||||
keywords: ['bcrypt', 'hash', 'compare', 'password', 'salt', 'round', 'storage', 'crypto'],
|
||||
component: () => import('./bcrypt.vue'),
|
||||
icon: LockSquare,
|
||||
};
|
@@ -164,6 +164,3 @@ const { copy: copyEntropy } = useCopy({ source: entropy, text: 'Entropy copied t
|
||||
const { copy: copyPassphrase } = useCopy({ source: passphrase, text: 'Passphrase copied to the clipboard' })
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
</style>
|
@@ -92,6 +92,3 @@ function onInputUpdated(value: string, omit: string) {
|
||||
onInputUpdated(hex.value, 'hex')
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
</style>
|
@@ -49,7 +49,26 @@
|
||||
* * * * * * command</pre>
|
||||
|
||||
|
||||
<n-table size="small">
|
||||
<n-space
|
||||
v-if="styleStore.isSmallScreen"
|
||||
vertical
|
||||
>
|
||||
<n-card
|
||||
v-for="{symbol, meaning, example, equivalent} in helpers"
|
||||
:key="symbol"
|
||||
embedded
|
||||
:bordered="false"
|
||||
>
|
||||
<div>Symbol: <strong>{{ symbol }}</strong></div>
|
||||
<div>Meaning: <strong>{{ meaning }}</strong></div>
|
||||
<div>Example: <strong><code>{{ example }}</code></strong></div>
|
||||
<div>Equivalent: <strong>{{ equivalent }}</strong></div>
|
||||
</n-card>
|
||||
</n-space>
|
||||
<n-table
|
||||
v-else
|
||||
size="small"
|
||||
>
|
||||
<thead>
|
||||
<tr>
|
||||
<th
|
||||
@@ -79,99 +98,16 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>*</td>
|
||||
<td>Any value</td>
|
||||
<tr
|
||||
v-for="{symbol, meaning, example, equivalent} in helpers"
|
||||
:key="symbol"
|
||||
>
|
||||
<td>{{ symbol }}</td>
|
||||
<td>{{ meaning }}</td>
|
||||
<td>
|
||||
<code>* * * *</code>
|
||||
<code>{{ example }}</code>
|
||||
</td>
|
||||
<td>Every minute</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>-</td>
|
||||
<td>Range of values</td>
|
||||
<td>
|
||||
<code>1-10 * * *</code>
|
||||
</td>
|
||||
<td>Minutes 1 through 10</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>,</td>
|
||||
<td>List of values</td>
|
||||
<td>
|
||||
<code>1,10 * * *</code>
|
||||
</td>
|
||||
<td>At minutes 1 and 10</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>/</td>
|
||||
<td>Step values</td>
|
||||
<td>
|
||||
<code>*/10 * * *</code>
|
||||
</td>
|
||||
<td>Every 10 minutes</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>@yearly</td>
|
||||
<td>Once every year at midnight of 1 January</td>
|
||||
<td>
|
||||
<code>@yearly</code>
|
||||
</td>
|
||||
<td>0 0 1 1 *</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>@annually</td>
|
||||
<td>Same as @yearly</td>
|
||||
<td>
|
||||
<code>@annually</code>
|
||||
</td>
|
||||
<td>0 0 1 1 *</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>@monthly</td>
|
||||
<td>Once a month at midnight on the first day</td>
|
||||
<td>
|
||||
<code>@monthly</code>
|
||||
</td>
|
||||
<td>0 0 1 * *</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>@weekly</td>
|
||||
<td>Once a week at midnight on Sunday morning</td>
|
||||
<td>
|
||||
<code>@weekly</code>
|
||||
</td>
|
||||
<td>0 0 * * 0</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>@daily</td>
|
||||
<td>Once a day at midnight</td>
|
||||
<td>
|
||||
<code>@daily</code>
|
||||
</td>
|
||||
<td>0 0 * * *</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>@midnight</td>
|
||||
<td>Same as @daily</td>
|
||||
<td>
|
||||
<code>@midnight</code>
|
||||
</td>
|
||||
<td>0 0 * * *</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>@hourly</td>
|
||||
<td>Once an hour at the beginning of the hour</td>
|
||||
<td>
|
||||
<code>@hourly</code>
|
||||
</td>
|
||||
<td>0 * * * *</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>@reboot</td>
|
||||
<td>Run at startup</td>
|
||||
<td />
|
||||
<td />
|
||||
<td>{{ equivalent }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</n-table>
|
||||
@@ -183,12 +119,15 @@ import cronstrue from 'cronstrue'
|
||||
import { isValidCron } from 'cron-validator'
|
||||
import { computed, reactive, ref } from 'vue';
|
||||
import { useValidation } from '@/composable/validation';
|
||||
import { useStyleStore } from '@/stores/style.store';
|
||||
|
||||
|
||||
function isCronValid(v: string) {
|
||||
return isValidCron(v, { allowBlankDay: true, alias: true, seconds: true })
|
||||
}
|
||||
|
||||
const styleStore = useStyleStore()
|
||||
|
||||
const cron = ref('40 * * * *')
|
||||
const cronstrueConfig = reactive({
|
||||
verbose: true,
|
||||
@@ -197,6 +136,81 @@ const cronstrueConfig = reactive({
|
||||
throwExceptionOnParseError: true
|
||||
})
|
||||
|
||||
const helpers = [
|
||||
{
|
||||
"symbol": "*",
|
||||
"meaning": "Any value",
|
||||
"example": "* * * *",
|
||||
"equivalent": "Every minute"
|
||||
},
|
||||
{
|
||||
"symbol": "-",
|
||||
"meaning": "Range of values",
|
||||
"example": "1-10 * * *",
|
||||
"equivalent": "Minutes 1 through 10"
|
||||
},
|
||||
{
|
||||
"symbol": ",",
|
||||
"meaning": "List of values",
|
||||
"example": "1,10 * * *",
|
||||
"equivalent": "At minutes 1 and 10"
|
||||
},
|
||||
{
|
||||
"symbol": "/",
|
||||
"meaning": "Step values",
|
||||
"example": "*/10 * * *",
|
||||
"equivalent": "Every 10 minutes"
|
||||
},
|
||||
{
|
||||
"symbol": "@yearly",
|
||||
"meaning": "Once every year at midnight of 1 January",
|
||||
"example": "@yearly",
|
||||
"equivalent": "0 0 1 1 *"
|
||||
},
|
||||
{
|
||||
"symbol": "@annually",
|
||||
"meaning": "Same as @yearly",
|
||||
"example": "@annually",
|
||||
"equivalent": "0 0 1 1 *"
|
||||
},
|
||||
{
|
||||
"symbol": "@monthly",
|
||||
"meaning": "Once a month at midnight on the first day",
|
||||
"example": "@monthly",
|
||||
"equivalent": "0 0 1 * *"
|
||||
},
|
||||
{
|
||||
"symbol": "@weekly",
|
||||
"meaning": "Once a week at midnight on Sunday morning",
|
||||
"example": "@weekly",
|
||||
"equivalent": "0 0 * * 0"
|
||||
},
|
||||
{
|
||||
"symbol": "@daily",
|
||||
"meaning": "Once a day at midnight",
|
||||
"example": "@daily",
|
||||
"equivalent": "0 0 * * *"
|
||||
},
|
||||
{
|
||||
"symbol": "@midnight",
|
||||
"meaning": "Same as @daily",
|
||||
"example": "@midnight",
|
||||
"equivalent": "0 0 * * *"
|
||||
},
|
||||
{
|
||||
"symbol": "@hourly",
|
||||
"meaning": "Once an hour at the beginning of the hour",
|
||||
"example": "@hourly",
|
||||
"equivalent": "0 * * * *"
|
||||
},
|
||||
{
|
||||
"symbol": "@reboot",
|
||||
"meaning": "Run at startup",
|
||||
"example": "",
|
||||
"equivalent": ""
|
||||
}
|
||||
]
|
||||
|
||||
const cronString = computed(() => {
|
||||
if (isCronValid(cron.value)) {
|
||||
return cronstrue.toString(cron.value, cronstrueConfig)
|
||||
@@ -235,4 +249,9 @@ const cronValidation = useValidation({
|
||||
opacity: 0.8;
|
||||
margin: 5px 0 15px;
|
||||
}
|
||||
</style>
|
||||
|
||||
pre {
|
||||
overflow: auto;
|
||||
padding: 10px 0;
|
||||
}
|
||||
</style>
|
||||
|
@@ -40,7 +40,7 @@
|
||||
<n-input-group-label style="width: 200px;">
|
||||
{{ name }}
|
||||
</n-input-group-label>
|
||||
<input-copyable :value="fromDate(date)" />
|
||||
<input-copyable :value="fromDate(baseDate)" />
|
||||
</n-input-group>
|
||||
</div>
|
||||
</n-card>
|
||||
@@ -57,11 +57,11 @@ const useCurrentDate = ref(true)
|
||||
const inputDate = ref('')
|
||||
const inputFormat = ref(6)
|
||||
const inputInvalid = ref(false)
|
||||
const date = ref(new Date())
|
||||
const baseDate = ref(new Date())
|
||||
|
||||
useRafFn(() => {
|
||||
if (useCurrentDate.value) {
|
||||
date.value = new Date()
|
||||
baseDate.value = new Date()
|
||||
}
|
||||
})
|
||||
|
||||
@@ -73,10 +73,10 @@ function onDateInputChanged(value: string) {
|
||||
const formatted: Date | string = toDate(value)
|
||||
|
||||
if (!isDate(formatted) || isNaN(formatted.getTime())) {
|
||||
throw 'invalid date'
|
||||
throw new Error('Invalid date')
|
||||
}
|
||||
|
||||
date.value = formatted
|
||||
baseDate.value = formatted
|
||||
} catch (_) {
|
||||
inputInvalid.value = true
|
||||
}
|
||||
@@ -126,6 +126,3 @@ const formats = [
|
||||
]
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
</style>
|
114
src/tools/device-information/device-information.vue
Normal file
114
src/tools/device-information/device-information.vue
Normal file
@@ -0,0 +1,114 @@
|
||||
<template>
|
||||
<n-card
|
||||
v-for="{name, information} in sections"
|
||||
:key="name"
|
||||
:title="name"
|
||||
style="margin-bottom: 15px;"
|
||||
>
|
||||
<n-grid
|
||||
cols="1 400:2"
|
||||
x-gap="12"
|
||||
y-gap="12"
|
||||
>
|
||||
<n-gi
|
||||
v-for="{label, value} in information"
|
||||
:key="label"
|
||||
class="information"
|
||||
>
|
||||
<n-card
|
||||
:bordered="false"
|
||||
embedded
|
||||
>
|
||||
<div class="label">
|
||||
{{ label }}
|
||||
</div>
|
||||
|
||||
<div class="value">
|
||||
<n-ellipsis>
|
||||
{{ value.value }}
|
||||
</n-ellipsis>
|
||||
</div>
|
||||
</n-card>
|
||||
</n-gi>
|
||||
</n-grid>
|
||||
</n-card>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { useWindowSize } from '@vueuse/core'
|
||||
import { computed } from 'vue';
|
||||
|
||||
const { width, height } = useWindowSize()
|
||||
|
||||
const sections = [
|
||||
{
|
||||
name: 'Screen',
|
||||
information: [
|
||||
{
|
||||
label: 'Screen size',
|
||||
value: computed(() => `${window.screen.availWidth} x ${window.screen.availHeight}`)
|
||||
},
|
||||
{
|
||||
label: 'Orientation',
|
||||
value: computed(() => window.screen.orientation.type)
|
||||
},
|
||||
{
|
||||
label: 'Orientation angle',
|
||||
value: computed(() => `${window.screen.orientation.angle}°`)
|
||||
},
|
||||
{
|
||||
label: 'Color depth',
|
||||
value: computed(() => `${window.screen.colorDepth} bits`)
|
||||
},
|
||||
{
|
||||
label: 'Pixel ratio',
|
||||
value: computed(() => `${window.devicePixelRatio} dppx`)
|
||||
},
|
||||
{
|
||||
label: 'Window size',
|
||||
value: computed(() => `${width.value} x ${height.value}`)
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: 'Device',
|
||||
information: [
|
||||
{
|
||||
label: 'Browser vendor',
|
||||
value: computed(() => navigator.vendor)
|
||||
},
|
||||
{
|
||||
label: 'Languages',
|
||||
value: computed(() => navigator.languages.join(', '))
|
||||
},
|
||||
{
|
||||
label: 'Plateform',
|
||||
value: computed(() => navigator.platform)
|
||||
},
|
||||
{
|
||||
label: 'User agent',
|
||||
value: computed(() => navigator.userAgent)
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.information {
|
||||
|
||||
.label {
|
||||
font-size: 14px;
|
||||
opacity: 0.8;
|
||||
line-height: 1;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
.value {
|
||||
font-size: 20px;
|
||||
font-weight: 400;
|
||||
line-height: 1;
|
||||
}
|
||||
}
|
||||
</style>
|
11
src/tools/device-information/index.ts
Normal file
11
src/tools/device-information/index.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import { DeviceDesktop } from '@vicons/tabler';
|
||||
import type { ITool } from './../Tool';
|
||||
|
||||
export const tool: ITool = {
|
||||
name: 'Device information',
|
||||
path: '/device-information',
|
||||
description: 'Get information about your current device (screen size, pixel-ratio, user agent, ...)',
|
||||
keywords: ['device', 'information', 'screen', 'pixel', 'ratio', 'status', 'data', 'computer', 'size', 'user', 'agent'],
|
||||
component: () => import('./device-information.vue'),
|
||||
icon: DeviceDesktop,
|
||||
};
|
@@ -121,6 +121,3 @@ const decryptOutput = computed(() => algos[decryptAlgo.value].decrypt(decryptInp
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
</style>
|
@@ -17,5 +17,6 @@ const themeVars = useThemeVars()
|
||||
padding: 15px 22px;
|
||||
background-color: v-bind('themeVars.cardColor');
|
||||
border-radius: 4px;
|
||||
overflow: auto;
|
||||
}
|
||||
</style>
|
@@ -73,6 +73,3 @@ const hashedText = computed(() => algos[algo.value](clearText.value).toString())
|
||||
|
||||
const { copy } = useCopy({ source: hashedText, text: 'Hash copied to the clipboard' })
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
</style>
|
@@ -1,6 +1,9 @@
|
||||
import { LockOpen } from '@vicons/tabler';
|
||||
import type { ToolCategory } from './Tool';
|
||||
|
||||
import { tool as urlParser } from './url-parser';
|
||||
import { tool as deviceInformation } from './device-information';
|
||||
import { tool as bcrypt } from './bcrypt';
|
||||
import { tool as caseConverter } from './case-converter';
|
||||
import { tool as colorConverter } from './color-converter';
|
||||
import { tool as qrCodeGenerator } from './qr-code-generator';
|
||||
@@ -24,7 +27,7 @@ export const toolsByCategory: ToolCategory[] = [
|
||||
{
|
||||
name: 'Crypto',
|
||||
icon: LockOpen,
|
||||
components: [tokenGenerator, hashText, uuidGenerator, cypher, bip39],
|
||||
components: [tokenGenerator, hashText, bcrypt, uuidGenerator, cypher, bip39],
|
||||
},
|
||||
{
|
||||
name: 'Converter',
|
||||
@@ -34,7 +37,7 @@ export const toolsByCategory: ToolCategory[] = [
|
||||
{
|
||||
name: 'Web',
|
||||
icon: LockOpen,
|
||||
components: [urlEncoder, qrCodeGenerator],
|
||||
components: [urlEncoder, qrCodeGenerator, urlParser, deviceInformation],
|
||||
},
|
||||
{
|
||||
name: 'Development',
|
||||
|
@@ -104,6 +104,3 @@ const { copy } = useCopy({ source: loremIpsumText, text: 'Lorem ipsum copied to
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
</style>
|
@@ -1,8 +1,9 @@
|
||||
<template>
|
||||
<n-card>
|
||||
<n-grid
|
||||
cols="3"
|
||||
x-gap="12"
|
||||
y-gap="12"
|
||||
cols="1 600:3"
|
||||
>
|
||||
<n-gi span="2">
|
||||
<n-form
|
||||
@@ -84,6 +85,3 @@ const { qrcode } = useQRCode({
|
||||
const { download } = useDownloadFileFromBase64({ source: qrcode, filename: 'qr-code.png' })
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
</style>
|
@@ -36,6 +36,3 @@ import { getStringSizeInBytes } from './text-statistics.service'
|
||||
|
||||
const text = ref('Lorem ipsum dolor sit amet, consectetur adipiscing elit. Commodo risus faucibus varius volutpat habitasse suspendisse justo inceptos primis mi. Fusce molestie lorem bibendum habitasse litora adipiscing turpis egestas quis nec. Non id conubia vulputate etiam iaculis vitae venenatis hac fusce condimentum. Adipiscing pellentesque venenatis ornare pulvinar tempus hac montes velit erat convallis.')
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
</style>
|
@@ -106,6 +106,3 @@ function refreshToken() {
|
||||
|
||||
refreshToken()
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
</style>
|
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<n-space item-style="flex:1">
|
||||
<div>
|
||||
<n-card title="Encode">
|
||||
<n-form-item
|
||||
label="Your string :"
|
||||
@@ -10,7 +10,7 @@
|
||||
v-model:value="encodeInput"
|
||||
type="textarea"
|
||||
placeholder="The string to encode"
|
||||
:autosize="{ minRows: 3 }"
|
||||
:autosize="{ minRows: 2 }"
|
||||
/>
|
||||
</n-form-item>
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
type="textarea"
|
||||
readonly
|
||||
placeholder="Your string encoded"
|
||||
:autosize="{ minRows: 3 }"
|
||||
:autosize="{ minRows: 2 }"
|
||||
/>
|
||||
</n-form-item>
|
||||
|
||||
@@ -33,9 +33,10 @@
|
||||
</n-button>
|
||||
</n-space>
|
||||
</n-card>
|
||||
<n-card title="Encode">
|
||||
<br>
|
||||
<n-card title="Decode">
|
||||
<n-form-item
|
||||
label="Your encode string :"
|
||||
label="Your encoded string :"
|
||||
:feedback="decodeValidation.message"
|
||||
:validation-status="decodeValidation.status"
|
||||
>
|
||||
@@ -43,17 +44,17 @@
|
||||
v-model:value="decodeInput"
|
||||
type="textarea"
|
||||
placeholder="The string to decode"
|
||||
:autosize="{ minRows: 3 }"
|
||||
:autosize="{ minRows: 2 }"
|
||||
/>
|
||||
</n-form-item>
|
||||
|
||||
<n-form-item label="Your string decoded :">
|
||||
<n-form-item label="Your string decoded :">
|
||||
<n-input
|
||||
:value="decodeOutput"
|
||||
type="textarea"
|
||||
readonly
|
||||
placeholder="Your string decoded"
|
||||
:autosize="{ minRows: 3 }"
|
||||
:autosize="{ minRows: 2 }"
|
||||
/>
|
||||
</n-form-item>
|
||||
|
||||
@@ -66,7 +67,7 @@
|
||||
</n-button>
|
||||
</n-space>
|
||||
</n-card>
|
||||
</n-space>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
@@ -76,25 +77,25 @@ import { computed, ref } from 'vue'
|
||||
|
||||
const encodeInput = ref('Hello world :)')
|
||||
const encodeOutput = computed(() => {
|
||||
try {
|
||||
return encodeURIComponent(encodeInput.value)
|
||||
} catch (_) {
|
||||
return ''
|
||||
}
|
||||
try {
|
||||
return encodeURIComponent(encodeInput.value)
|
||||
} catch (_) {
|
||||
return ''
|
||||
}
|
||||
})
|
||||
|
||||
const encodedValidation = useValidation({
|
||||
source: encodeInput, rules: [{
|
||||
validator: (value) => {
|
||||
try {
|
||||
encodeURIComponent(value)
|
||||
return true
|
||||
} catch (_) {
|
||||
return false
|
||||
}
|
||||
},
|
||||
message: 'Impossible to parse this string'
|
||||
}]
|
||||
source: encodeInput, rules: [{
|
||||
validator: (value) => {
|
||||
try {
|
||||
encodeURIComponent(value)
|
||||
return true
|
||||
} catch (_) {
|
||||
return false
|
||||
}
|
||||
},
|
||||
message: 'Impossible to parse this string'
|
||||
}]
|
||||
})
|
||||
|
||||
const { copy: copyEncoded } = useCopy({ source: encodeOutput, text: 'Encoded string copied to the clipboard' })
|
||||
@@ -103,25 +104,25 @@ const { copy: copyEncoded } = useCopy({ source: encodeOutput, text: 'Encoded str
|
||||
const decodeInput = ref('Hello%20world%20%3A)')
|
||||
|
||||
const decodeOutput = computed(() => {
|
||||
try {
|
||||
return decodeURIComponent(decodeInput.value)
|
||||
} catch (_) {
|
||||
return ''
|
||||
}
|
||||
try {
|
||||
return decodeURIComponent(decodeInput.value)
|
||||
} catch (_) {
|
||||
return ''
|
||||
}
|
||||
})
|
||||
|
||||
const decodeValidation = useValidation({
|
||||
source: encodeInput, rules: [{
|
||||
validator: (value) => {
|
||||
try {
|
||||
decodeURIComponent(value)
|
||||
return true
|
||||
} catch (_) {
|
||||
return false
|
||||
}
|
||||
},
|
||||
message: 'Impossible to parse this string'
|
||||
}]
|
||||
source: encodeInput, rules: [{
|
||||
validator: (value) => {
|
||||
try {
|
||||
decodeURIComponent(value)
|
||||
return true
|
||||
} catch (_) {
|
||||
return false
|
||||
}
|
||||
},
|
||||
message: 'Impossible to parse this string'
|
||||
}]
|
||||
})
|
||||
|
||||
const { copy: copyDecoded } = useCopy({ source: decodeOutput, text: 'Decoded string copied to the clipboard' })
|
||||
@@ -129,6 +130,3 @@ const { copy: copyDecoded } = useCopy({ source: decodeOutput, text: 'Decoded str
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
</style>
|
11
src/tools/url-parser/index.ts
Normal file
11
src/tools/url-parser/index.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import { Unlink } from '@vicons/tabler';
|
||||
import type { ITool } from './../Tool';
|
||||
|
||||
export const tool: ITool = {
|
||||
name: 'Url parser',
|
||||
path: '/url-parser',
|
||||
description: 'Parse an url string to get all the differents parts (protocol, origin, params, port, username-password, ...)',
|
||||
keywords: ['url', 'parser', 'protocol', 'origin', 'params', 'port', 'username', 'password', 'href'],
|
||||
component: () => import('./url-parser.vue'),
|
||||
icon: Unlink,
|
||||
};
|
118
src/tools/url-parser/url-parser.vue
Normal file
118
src/tools/url-parser/url-parser.vue
Normal file
@@ -0,0 +1,118 @@
|
||||
<template>
|
||||
<n-card>
|
||||
<n-form-item
|
||||
label="Your url to parse:"
|
||||
:feedback="validation.message"
|
||||
:validation-status="validation.status"
|
||||
>
|
||||
<n-input
|
||||
v-model:value="urlToParse"
|
||||
placeholder="Your url to parse..."
|
||||
/>
|
||||
</n-form-item>
|
||||
|
||||
<n-divider style="margin-top: 0;" />
|
||||
|
||||
<n-form>
|
||||
<n-input-group
|
||||
v-for="{title, key} in properties"
|
||||
:key="key"
|
||||
>
|
||||
<n-input-group-label
|
||||
style="flex: 0 0 120px;"
|
||||
>
|
||||
{{ title }}:
|
||||
</n-input-group-label>
|
||||
<input-copyable
|
||||
:value="(urlParsed?.[key] as string) ?? ''"
|
||||
readonly
|
||||
placeholder=" "
|
||||
/>
|
||||
</n-input-group>
|
||||
|
||||
<n-input-group
|
||||
v-for="[k, v] in Object.entries(Object.fromEntries(urlParsed?.searchParams.entries() ?? []))"
|
||||
:key="k"
|
||||
>
|
||||
<n-input-group-label
|
||||
style="flex: 0 0 120px;"
|
||||
>
|
||||
<n-icon :component="SubdirectoryArrowRightRound" />
|
||||
</n-input-group-label>
|
||||
<input-copyable
|
||||
:value="k"
|
||||
readonly
|
||||
/>
|
||||
<input-copyable
|
||||
:value="v"
|
||||
readonly
|
||||
/>
|
||||
</n-input-group>
|
||||
</n-form>
|
||||
</n-card>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { computed, ref } from 'vue';
|
||||
import { SubdirectoryArrowRightRound } from '@vicons/material';
|
||||
import InputCopyable from '../../components/InputCopyable.vue';
|
||||
import { useValidation } from '@/composable/validation';
|
||||
|
||||
const urlToParse = ref('https://me:pwd@it-tools.tech:3000/url-parser?key1=value&key2=value2#the-hash')
|
||||
const urlParsed = computed<URL | undefined>(() => {
|
||||
try {
|
||||
return new URL(urlToParse.value)
|
||||
} catch (_) {
|
||||
return undefined
|
||||
}
|
||||
})
|
||||
const validation = useValidation({source: urlToParse, rules: [
|
||||
{validator: (value) => {
|
||||
try {
|
||||
new URL(value)
|
||||
return true;
|
||||
} catch (_) {
|
||||
return false
|
||||
}
|
||||
}, message: 'Invalid url'}
|
||||
]})
|
||||
|
||||
|
||||
const properties: {title: string, key: keyof URL}[] = [
|
||||
{title: 'Protocol', key: 'protocol'},
|
||||
{title: 'Username', key: 'username'},
|
||||
{title: 'Password', key: 'password'},
|
||||
{title: 'Hostname', key: 'hostname'},
|
||||
{title: 'Port', key: 'port'},
|
||||
{title: 'Path', key: 'pathname'},
|
||||
{title: 'Params', key: 'search'},
|
||||
]
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
|
||||
.n-input-group-label {
|
||||
text-align: right;
|
||||
}
|
||||
.n-input-group {
|
||||
|
||||
&:not(:first-child) > * {
|
||||
|
||||
::v-deep(.n-input__border), ::v-deep(.n-input-group-label__border) {
|
||||
border-radius: 0;
|
||||
border-top: none;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
&:first-child > * {
|
||||
|
||||
::v-deep(.n-input__border), ::v-deep(.n-input-group-label__border) {
|
||||
border-bottom-left-radius: 0;
|
||||
border-bottom-right-radius: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
@@ -65,6 +65,3 @@ const { copy } = useCopy({ source: uuids, text: 'UUIDs copied to the clipboard'
|
||||
|
||||
refreshUUIDs()
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
</style>
|
3
vercel.json
Normal file
3
vercel.json
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"routes": [{ "handle": "filesystem" }, { "src": "/(.*)", "dest": "/index.html" }]
|
||||
}
|
Reference in New Issue
Block a user