Skip to content

Commit

Permalink
Merge pull request #2 from NethServer/displayCron
Browse files Browse the repository at this point in the history
Display the task frequency in the table
  • Loading branch information
stephdl authored Nov 16, 2023
2 parents 4c21d37 + 4d370b1 commit 922305b
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 21 deletions.
1 change: 1 addition & 0 deletions imageroot/actions/create-task/validate-input.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
"enum": [
"",
"5m",
"10m",
"15m",
"30m",
"45m",
Expand Down
5 changes: 3 additions & 2 deletions ui/public/i18n/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
"col_remotehostname": "IMAP server",
"col_task_status": "Task status",
"col_task_id": "Task ID",
"col_task_cron": "Task frequency",
"create": "Create",
"edit": "Edit",
"start": "Start",
Expand Down Expand Up @@ -82,7 +83,7 @@
"choose_the_user_to_sync": "Choose a user managed by your email server to synchronize the remote messages",
"hour":"hour",
"minutes":"minutes",
"no_cron": "No Scheduled",
"no_cron": "Not scheduled",
"select_your_cron": "select your task frequency",
"set_when_you_want_the_task_start": "Select when to start your task",
"remove_mails":"Messages removal",
Expand All @@ -109,7 +110,7 @@
"something_wrong_cannot_list_informations": "Something went wront we cannot list the remote and account informations",
"informations": "Informations",
"fetching_statistic_please_wait":"Waiting to retrieve statictics, please wait",
"every":"every",
"every_minutes":"Every {num} minutes",
"configure_imapsync": "Go to the settings"

},
Expand Down
37 changes: 18 additions & 19 deletions ui/src/components/CreateOrEditTask.vue
Original file line number Diff line number Diff line change
Expand Up @@ -182,25 +182,24 @@
<cv-dropdown-item selected value="">{{
$t("tasks.no_cron")
}}</cv-dropdown-item>
<cv-dropdown-item value="5m"
>{{ $t("tasks.every") }} 5
{{ $t("tasks.minutes") }}</cv-dropdown-item
>
<cv-dropdown-item value="15m"
>{{ $t("tasks.every") }} 15
{{ $t("tasks.minutes") }}</cv-dropdown-item
>
<cv-dropdown-item value="30m"
>{{ $t("tasks.every") }} 30
{{ $t("tasks.minutes") }}</cv-dropdown-item
>
<cv-dropdown-item value="45m"
>{{ $t("tasks.every") }} 45
{{ $t("tasks.minutes") }}</cv-dropdown-item
>
<cv-dropdown-item value="1h"
>{{ $t("tasks.every") }} 1 {{ $t("tasks.hour") }}</cv-dropdown-item
>
<cv-dropdown-item value="5m">{{
$t("tasks.every_minutes", { num: 5 })
}}</cv-dropdown-item>
<cv-dropdown-item value="10m">{{
$t("tasks.every_minutes", { num: 10 })
}}</cv-dropdown-item>
<cv-dropdown-item value="15m">{{
$t("tasks.every_minutes", { num: 15 })
}}</cv-dropdown-item>
<cv-dropdown-item value="30m">{{
$t("tasks.every_minutes", { num: 30 })
}}</cv-dropdown-item>
<cv-dropdown-item value="45m">{{
$t("tasks.every_minutes", { num: 45 })
}}</cv-dropdown-item>
<cv-dropdown-item value="1h">{{
$t("tasks.every_minutes", { num: 60 })
}}</cv-dropdown-item>
</cv-dropdown>
</cv-form>
<cv-row v-if="error.createTask">
Expand Down
10 changes: 10 additions & 0 deletions ui/src/views/Tasks.vue
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,15 @@
<cv-data-table-cell>
{{ row.remotehostname }}
</cv-data-table-cell>
<cv-data-table-cell>
{{
row.cron === ""
? $t("tasks.no_cron")
: row.cron === "1h"
? parseInt(row.cron) + " " + $t("tasks.hour")
: parseInt(row.cron) + " " + $t("tasks.minutes")
}}
</cv-data-table-cell>
<cv-data-table-cell>
{{
row.service ? $t("tasks.running") : $t("tasks.stopped")
Expand Down Expand Up @@ -270,6 +279,7 @@ export default {
"localuser",
"remoteusername",
"remotehostname",
"task_cron",
"task_status",
"task_id",
],
Expand Down

0 comments on commit 922305b

Please sign in to comment.