Add explain crontab tool

This commit is contained in:
Illya Marchenko 2023-12-14 10:16:40 +02:00
parent c3f68c9d77
commit 02bc94d10c
Signed by: stuzer05
GPG Key ID: A6ABAAA9268F9F4F
5 changed files with 59 additions and 40 deletions

45
package-lock.json generated

@ -26,46 +26,6 @@
"strip-json-comments": "^3.1.1"
}
},
"@fortawesome/fontawesome-common-types": {
"version": "6.1.1",
"resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-common-types/-/fontawesome-common-types-6.1.1.tgz",
"integrity": "sha512-wVn5WJPirFTnzN6tR95abCx+ocH+3IFLXAgyavnf9hUmN0CfWoDjPT/BAWsUVwSlYYVBeCLJxaqi7ZGe4uSjBA=="
},
"@fortawesome/fontawesome-free": {
"version": "6.1.1",
"resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-free/-/fontawesome-free-6.1.1.tgz",
"integrity": "sha512-J/3yg2AIXc9wznaVqpHVX3Wa5jwKovVF0AMYSnbmcXTiL3PpRPfF58pzWucCwEiCJBp+hCNRLWClTomD8SseKg==",
"dev": true
},
"@fortawesome/fontawesome-svg-core": {
"version": "6.1.1",
"resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-svg-core/-/fontawesome-svg-core-6.1.1.tgz",
"integrity": "sha512-NCg0w2YIp81f4V6cMGD9iomfsIj7GWrqmsa0ZsPh59G7PKiGN1KymZNxmF00ssuAlo/VZmpK6xazsGOwzKYUMg==",
"requires": {
"@fortawesome/fontawesome-common-types": "6.1.1"
}
},
"@fortawesome/free-regular-svg-icons": {
"version": "6.1.1",
"resolved": "https://registry.npmjs.org/@fortawesome/free-regular-svg-icons/-/free-regular-svg-icons-6.1.1.tgz",
"integrity": "sha512-xXiW7hcpgwmWtndKPOzG+43fPH7ZjxOaoeyooptSztGmJxCAflHZxXNK0GcT0uEsR4jTGQAfGklDZE5NHoBhKg==",
"requires": {
"@fortawesome/fontawesome-common-types": "6.1.1"
}
},
"@fortawesome/free-solid-svg-icons": {
"version": "6.1.1",
"resolved": "https://registry.npmjs.org/@fortawesome/free-solid-svg-icons/-/free-solid-svg-icons-6.1.1.tgz",
"integrity": "sha512-0/5exxavOhI/D4Ovm2r3vxNojGZioPwmFrKg0ZUH69Q68uFhFPs6+dhAToh6VEQBntxPRYPuT5Cg1tpNa9JUPg==",
"requires": {
"@fortawesome/fontawesome-common-types": "6.1.1"
}
},
"@fortawesome/vue-fontawesome": {
"version": "3.0.0-5",
"resolved": "https://registry.npmjs.org/@fortawesome/vue-fontawesome/-/vue-fontawesome-3.0.0-5.tgz",
"integrity": "sha512-aNmBT4bOecrFsZTog1l6AJDQHPP3ocXV+WQ3Ogy8WZCqstB/ahfhH4CPu5i4N9Hw0MBKXqE+LX+NbUxcj8cVTw=="
},
"@humanwhocodes/config-array": {
"version": "0.9.5",
"resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.9.5.tgz",
@ -466,6 +426,11 @@
"integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==",
"dev": true
},
"cronstrue": {
"version": "2.47.0",
"resolved": "https://registry.npmjs.org/cronstrue/-/cronstrue-2.47.0.tgz",
"integrity": "sha512-fnFwJy7zslTEz6h7O7BkwgHNBvuuPmkhAYKqPDxK5mBQLz2nG08T9afbnjm+yrvcc/wxrd+otaVSnoXT9ulUOw=="
},
"cross-spawn": {
"version": "7.0.3",
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz",

@ -10,6 +10,7 @@
"dependencies": {
"autoprefixer": "^10",
"axios": "^0.27.2",
"cronstrue": "^2.47.0",
"mitt": "^3.0.0",
"pinia": "^2.0.14",
"postcss": "^8",

@ -27,6 +27,7 @@ export default {
let menuRoutes = {
'General': {
'home': 'Home',
'explain_crontab': 'Explain crontab',
},
'Strings': {
'fix_ru_en_keyboard': 'Fix ru-en keyboard',

@ -11,6 +11,11 @@ const router = createRouter({
name: 'home',
component: () => import('../views/HomeView.vue'),
},
{
path: '/explain_crontab',
name: 'explain_crontab',
component: () => import('../views/ExplainCrontab.vue'),
},
/**
* String manipulation

@ -0,0 +1,47 @@
<template>
<h2 class="tool-title">Explain crontab</h2>
<hr class="mt-5 mb-5">
<div class="input-group">
<label for="data">Data</label>
<input id="data" class="input" v-model="toolData.data" placeholder="* * * * *" type="text">
</div>
<hr class="mt-5 mb-5">
<div class="input-group">
<label for="result">Result</label>
<textarea id="result" v-model="toolResult" style="height: 150px"></textarea>
</div>
</template>
<script>
import cronstrue from 'cronstrue';
import { unproxy } from "@/utils/unproxy";
export default {
data() {
return {
toolData: {
data: '* * * * *',
},
};
},
computed: {
toolResult() {
try {
return cronstrue.toString(this.toolData.data, {
use24HourTimeFormat: true,
verbose: true,
});
} catch (e) {
return 'invalid syntax';
}
},
},
}
</script>
<style lang="scss">
</style>