Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2b89111cbb | ||
|
|
6b11de258a | ||
|
|
4fc303e5e3 | ||
|
|
cbf0b3d699 | ||
|
|
71f79a5bbf | ||
|
|
4112fa532e | ||
|
|
a14cac6d5c |
16
CHANGELOG.md
16
CHANGELOG.md
@@ -2,6 +2,22 @@
|
||||
|
||||
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.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)
|
||||
|
||||
|
||||
|
||||
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "it-tools",
|
||||
"version": "2.0.1",
|
||||
"version": "2.0.2",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "it-tools",
|
||||
"version": "2.0.1",
|
||||
"version": "2.0.2",
|
||||
"dependencies": {
|
||||
"@it-tools/bip39": "^0.0.4",
|
||||
"@vicons/material": "^0.12.0",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "it-tools",
|
||||
"version": "2.0.1",
|
||||
"version": "2.0.2",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
"build": "vue-tsc --noEmit && vite build",
|
||||
|
||||
@@ -9,8 +9,6 @@
|
||||
:show-trigger="false"
|
||||
:native-scrollbar="false"
|
||||
:position="siderPosition"
|
||||
@collapse="isMenuCollapsed = true"
|
||||
@expand="isMenuCollapsed = false"
|
||||
>
|
||||
<slot name="sider" />
|
||||
</n-layout-sider>
|
||||
@@ -36,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,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,
|
||||
};
|
||||
},
|
||||
});
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
pre {
|
||||
overflow: auto;
|
||||
padding: 10px 0;
|
||||
}
|
||||
</style>
|
||||
@@ -73,7 +73,7 @@ function onDateInputChanged(value: string) {
|
||||
const formatted: Date | string = toDate(value)
|
||||
|
||||
if (!isDate(formatted) || isNaN(formatted.getTime())) {
|
||||
throw 'invalid date'
|
||||
throw new Error('Invalid date')
|
||||
}
|
||||
|
||||
baseDate.value = formatted
|
||||
@@ -126,6 +126,3 @@ const formats = [
|
||||
]
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
</style>
|
||||
@@ -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>
|
||||
@@ -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>
|
||||
@@ -130,6 +130,3 @@ const { copy: copyDecoded } = useCopy({ source: decodeOutput, text: 'Decoded str
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
</style>
|
||||
@@ -65,6 +65,3 @@ const { copy } = useCopy({ source: uuids, text: 'UUIDs copied to the clipboard'
|
||||
|
||||
refreshUUIDs()
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
</style>
|
||||
Reference in New Issue
Block a user