Browse Source

Multiple small admin dashboard fixes (#12153)

* Remove spurious spacing between Maintenance Operations and its table on dashboard
* Prevent (EXTRA string) comments in Task headers
* Redirect tasks started from monitor page back to monitor
* Fix #12107 - redirects from process cancel should use AppSubUrl
* When wrapping queues set the name correctly

Signed-off-by: Andrew Thornton <art27@cantab.net>
tags/v1.13.0-rc1
zeripath 3 years ago
parent
commit
217647f331
No account linked to committer's email address

+ 2
- 1
modules/auth/admin.go View File



// AdminDashboardForm form for admin dashboard operations // AdminDashboardForm form for admin dashboard operations
type AdminDashboardForm struct { type AdminDashboardForm struct {
Op string `binding:"required"`
Op string `binding:"required"`
From string
} }


// Validate validates form fields // Validate validates form fields

+ 1
- 0
modules/queue/setting.go View File

MaxAttempts: q.MaxAttempts, MaxAttempts: q.MaxAttempts,
Config: cfg, Config: cfg,
QueueLength: q.Length, QueueLength: q.Length,
Name: name,
}, exemplar) }, exemplar)
} }
if err != nil { if err != nil {

+ 6
- 6
options/locale/locale_en-US.ini View File

dashboard.operation_run = Run dashboard.operation_run = Run
dashboard.clean_unbind_oauth = Clean unbound OAuth connections dashboard.clean_unbind_oauth = Clean unbound OAuth connections
dashboard.clean_unbind_oauth_success = All unbound OAuth connections have been deleted. dashboard.clean_unbind_oauth_success = All unbound OAuth connections have been deleted.
dashboard.task.started=Started Task: %s
dashboard.task.process=Task: %s
dashboard.task.cancelled=Task: %s cancelled: %[3]s
dashboard.task.error=Error in Task: %s: %[3]s
dashboard.task.finished=Task: %s started by %s has finished
dashboard.task.unknown=Unknown task: %s
dashboard.task.started=Started Task: %[1]s
dashboard.task.process=Task: %[1]s
dashboard.task.cancelled=Task: %[1]s cancelled: %[3]s
dashboard.task.error=Error in Task: %[1]s: %[3]s
dashboard.task.finished=Task: %[1]s started by %[2]s has finished
dashboard.task.unknown=Unknown task: %[1]s
dashboard.cron.started=Started Cron: %[1]s dashboard.cron.started=Started Cron: %[1]s
dashboard.cron.process=Cron: %[1]s dashboard.cron.process=Cron: %[1]s
dashboard.cron.cancelled=Cron: %s cancelled: %[3]s dashboard.cron.cancelled=Cron: %s cancelled: %[3]s

+ 6
- 3
routers/admin/admin.go View File

ctx.Flash.Error(ctx.Tr("admin.dashboard.task.unknown", form.Op)) ctx.Flash.Error(ctx.Tr("admin.dashboard.task.unknown", form.Op))
} }
} }

ctx.Redirect(setting.AppSubURL + "/admin")
if form.From == "monitor" {
ctx.Redirect(setting.AppSubURL + "/admin/monitor")
} else {
ctx.Redirect(setting.AppSubURL + "/admin")
}
} }


// SendTestMail send test mail to confirm mail service is OK // SendTestMail send test mail to confirm mail service is OK
pid := ctx.ParamsInt64("pid") pid := ctx.ParamsInt64("pid")
process.GetManager().Cancel(pid) process.GetManager().Cancel(pid)
ctx.JSON(200, map[string]interface{}{ ctx.JSON(200, map[string]interface{}{
"redirect": ctx.Repo.RepoLink + "/admin/monitor",
"redirect": setting.AppSubURL + "/admin/monitor",
}) })
} }



+ 5
- 5
templates/admin/dashboard.tmpl View File

<h4 class="ui top attached header"> <h4 class="ui top attached header">
{{.i18n.Tr "admin.dashboard.operations"}} {{.i18n.Tr "admin.dashboard.operations"}}
</h4> </h4>
<div class="ui attached table segment">
<form method="post" action="{{AppSubUrl}}/admin">
{{.CsrfTokenHtml}}
<form method="post" action="{{AppSubUrl}}/admin">
{{.CsrfTokenHtml}}
<div class="ui attached table segment">
<table class="ui very basic table"> <table class="ui very basic table">
<tbody> <tbody>
<tr> <tr>
</tr> </tr>
</tbody> </tbody>
</table> </table>
</form>
</div>
</div>
</form>


<h4 class="ui top attached header"> <h4 class="ui top attached header">
{{.i18n.Tr "admin.dashboard.system_status"}} {{.i18n.Tr "admin.dashboard.system_status"}}

+ 1
- 0
templates/admin/monitor.tmpl View File

</h4> </h4>
<div class="ui attached table segment"> <div class="ui attached table segment">
<form method="post" action="{{AppSubUrl}}/admin"> <form method="post" action="{{AppSubUrl}}/admin">
<input type="hidden" name="from" value="monitor"/>
{{.CsrfTokenHtml}} {{.CsrfTokenHtml}}
<table class="ui very basic striped table"> <table class="ui very basic striped table">
<thead> <thead>

Loading…
Cancel
Save