random-web-tools/src/views/ExplainCrontab.vue
2023-12-15 12:11:46 +02:00

47 lines
911 B
Vue

<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"></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>