feat: auto refresh completion
This commit is contained in:
@@ -2,10 +2,13 @@
|
|||||||
|
|
||||||
## TODO
|
## TODO
|
||||||
|
|
||||||
- [ ] auto refresh task completion
|
- [x] auto refresh task completion
|
||||||
- [x] validate cron string
|
- [x] validate cron string
|
||||||
- [ ] clone task
|
- [ ] clone task
|
||||||
- [ ] delete task
|
- [ ] delete task
|
||||||
|
- [ ] list option: sort
|
||||||
|
- [ ] list option: show last completion
|
||||||
|
- [ ] list option: show next refresh
|
||||||
- [ ] list per URL
|
- [ ] list per URL
|
||||||
- [ ] home screen
|
- [ ] home screen
|
||||||
- [ ] change lang
|
- [ ] change lang
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ const editMode = ref<boolean>(false);
|
|||||||
const task = defineModel<Task>({ required: true });
|
const task = defineModel<Task>({ required: true });
|
||||||
const editName = ref<string>('');
|
const editName = ref<string>('');
|
||||||
const editCron = ref<string|null>(null);
|
const editCron = ref<string|null>(null);
|
||||||
|
const refreshKey = ref<number>(0);
|
||||||
const checked = computed<boolean>(() => {
|
const checked = computed<boolean>(() => {
|
||||||
if (task.value.check_date === null) {
|
if (task.value.check_date === null) {
|
||||||
return false;
|
return false;
|
||||||
@@ -54,6 +55,9 @@ function check() {
|
|||||||
onBeforeMount(() => {
|
onBeforeMount(() => {
|
||||||
editName.value = task.value.name;
|
editName.value = task.value.name;
|
||||||
editCron.value = task.value.reset_cron;
|
editCron.value = task.value.reset_cron;
|
||||||
|
setInterval(() => {
|
||||||
|
refreshKey.value++;
|
||||||
|
}, 60000);
|
||||||
});
|
});
|
||||||
watch(task, () => {
|
watch(task, () => {
|
||||||
if (!editMode.value && task.value.name !== editName.value) {
|
if (!editMode.value && task.value.name !== editName.value) {
|
||||||
@@ -68,7 +72,7 @@ watch(task, () => {
|
|||||||
<template>
|
<template>
|
||||||
<div class="list-row text-left">
|
<div class="list-row text-left">
|
||||||
<div class="content-center">
|
<div class="content-center">
|
||||||
<input type="checkbox" class="checkbox" :checked="checked" @click.prevent="check" />
|
<input :id="refreshKey.toFixed(0)" type="checkbox" class="checkbox" :checked="checked" @click.prevent="check" />
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
v-if="!editMode"
|
v-if="!editMode"
|
||||||
|
|||||||
Reference in New Issue
Block a user