aboutsummaryrefslogtreecommitdiffstats
path: root/templates/admin
diff options
context:
space:
mode:
authorzeripath <art27@cantab.net>2022-03-29 02:31:07 +0100
committerGitHub <noreply@github.com>2022-03-29 02:31:07 +0100
commit90e0a402c1185827fd3d5352ca915c531ce1e7b1 (patch)
treeaa27fa1774c1c3af797d86a08e829d30bdb8010a /templates/admin
parente69b7a92ed91a4b078d216581a24497a72363494 (diff)
downloadgitea-90e0a402c1185827fd3d5352ca915c531ce1e7b1.tar.gz
gitea-90e0a402c1185827fd3d5352ca915c531ce1e7b1.zip
Show last cron messages on monitor page (#19223)
As discussed on #19221 we should store the results of the last task message on the crontask and show them on the monitor page. Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Diffstat (limited to 'templates/admin')
-rw-r--r--templates/admin/cron.tmpl35
-rw-r--r--templates/admin/monitor.tmpl35
2 files changed, 36 insertions, 34 deletions
diff --git a/templates/admin/cron.tmpl b/templates/admin/cron.tmpl
new file mode 100644
index 0000000000..30277177ed
--- /dev/null
+++ b/templates/admin/cron.tmpl
@@ -0,0 +1,35 @@
+<h4 class="ui top attached header">
+ {{.i18n.Tr "admin.monitor.cron"}}
+</h4>
+<div class="ui attached table segment">
+ <form method="post" action="{{AppSubUrl}}/admin">
+ <table class="ui very basic striped table">
+ <thead>
+ <tr>
+ <th></th>
+ <th>{{.i18n.Tr "admin.monitor.name"}}</th>
+ <th>{{.i18n.Tr "admin.monitor.schedule"}}</th>
+ <th>{{.i18n.Tr "admin.monitor.next"}}</th>
+ <th>{{.i18n.Tr "admin.monitor.previous"}}</th>
+ <th>{{.i18n.Tr "admin.monitor.execute_times"}}</th>
+ <th>{{.i18n.Tr "admin.monitor.last_execution_result"}}</th>
+ </tr>
+ </thead>
+ <tbody>
+ {{range .Entries}}
+ <tr>
+ <td><button type="submit" class="ui green button" name="op" value="{{.Name}}" title="{{$.i18n.Tr "admin.dashboard.operation_run"}}">{{svg "octicon-triangle-right"}}</button></td>
+ <td>{{$.i18n.Tr (printf "admin.dashboard.%s" .Name)}}</td>
+ <td>{{.Spec}}</td>
+ <td>{{DateFmtLong .Next}}</td>
+ <td>{{if gt .Prev.Year 1 }}{{DateFmtLong .Prev}}{{else}}N/A{{end}}</td>
+ <td>{{.ExecTimes}}</td>
+ <td {{if ne .Status ""}}class="tooltip" data-content="{{.FormatLastMessage $.i18n.Language}}"{{end}} >{{if eq .Status "" }}—{{else if eq .Status "finished"}}{{svg "octicon-check" 16}}{{else}}{{svg "octicon-x" 16}}{{end}}</td>
+ </tr>
+ {{end}}
+ </tbody>
+ </table>
+ <input type="hidden" name="from" value="monitor"/>
+ {{.CsrfTokenHtml}}
+ </form>
+</div>
diff --git a/templates/admin/monitor.tmpl b/templates/admin/monitor.tmpl
index a35b587bd5..443159f8ce 100644
--- a/templates/admin/monitor.tmpl
+++ b/templates/admin/monitor.tmpl
@@ -3,40 +3,7 @@
{{template "admin/navbar" .}}
<div class="ui container">
{{template "base/alert" .}}
- <h4 class="ui top attached header">
- {{.i18n.Tr "admin.monitor.cron"}}
- </h4>
- <div class="ui attached table segment">
- <form method="post" action="{{AppSubUrl}}/admin">
- <table class="ui very basic striped table">
- <thead>
- <tr>
- <th></th>
- <th>{{.i18n.Tr "admin.monitor.name"}}</th>
- <th>{{.i18n.Tr "admin.monitor.schedule"}}</th>
- <th>{{.i18n.Tr "admin.monitor.next"}}</th>
- <th>{{.i18n.Tr "admin.monitor.previous"}}</th>
- <th>{{.i18n.Tr "admin.monitor.execute_times"}}</th>
- </tr>
- </thead>
- <tbody>
- {{range .Entries}}
- <tr>
- <td><button type="submit" class="ui green button" name="op" value="{{.Name}}" title="{{$.i18n.Tr "admin.dashboard.operation_run"}}">{{svg "octicon-triangle-right"}}</button></td>
- <td>{{$.i18n.Tr (printf "admin.dashboard.%s" .Name)}}</td>
- <td>{{.Spec}}</td>
- <td>{{DateFmtLong .Next}}</td>
- <td>{{if gt .Prev.Year 1 }}{{DateFmtLong .Prev}}{{else}}N/A{{end}}</td>
- <td>{{.ExecTimes}}</td>
- </tr>
- {{end}}
- </tbody>
- </table>
- <input type="hidden" name="from" value="monitor"/>
- {{.CsrfTokenHtml}}
- </form>
- </div>
-
+ {{template "admin/cron" .}}
<h4 class="ui top attached header">
{{.i18n.Tr "admin.monitor.queues"}}
</h4>