From 8a277e7bd91bb762f68d1f19d1fc8c582dd71b09 Mon Sep 17 00:00:00 2001
From: qwerty287 <80460567+qwerty287@users.noreply.github.com>
Date: Sat, 20 Jul 2024 18:15:38 +0200
Subject: [PATCH] Improve cron list (#3947)
---
server/store/datastore/cron.go | 2 +-
web/src/components/repo/settings/CronTab.vue | 12 +++++++-----
2 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/server/store/datastore/cron.go b/server/store/datastore/cron.go
index ce2609269..89cf91e3e 100644
--- a/server/store/datastore/cron.go
+++ b/server/store/datastore/cron.go
@@ -35,7 +35,7 @@ func (s storage) CronFind(repo *model.Repo, id int64) (*model.Cron, error) {
func (s storage) CronList(repo *model.Repo, p *model.ListOptions) ([]*model.Cron, error) {
var crons []*model.Cron
- return crons, s.paginate(p).Where("repo_id = ?", repo.ID).Find(&crons)
+ return crons, s.paginate(p).Where("repo_id = ?", repo.ID).OrderBy("name").Find(&crons)
}
func (s storage) CronUpdate(_ *model.Repo, cron *model.Cron) error {
diff --git a/web/src/components/repo/settings/CronTab.vue b/web/src/components/repo/settings/CronTab.vue
index 4e2e5ca8f..98d27cdef 100644
--- a/web/src/components/repo/settings/CronTab.vue
+++ b/web/src/components/repo/settings/CronTab.vue
@@ -16,12 +16,14 @@
:key="cron.id"
class="items-center !bg-wp-background-200 !dark:bg-wp-background-100"
>
- {{ cron.name }}
-
-
- {{ $t('repo.settings.crons.next_exec') }}: {{ date.toLocaleString(new Date(cron.next_exec * 1000)) }}
+
+ {{ cron.name }}
+
+
+ {{ $t('repo.settings.crons.next_exec') }}: {{ date.toLocaleString(new Date(cron.next_exec * 1000)) }}
+
+ {{ $t('repo.settings.crons.not_executed_yet') }}
- {{ $t('repo.settings.crons.not_executed_yet') }}