[GITEA] admin: "Self Check" should only show for some db types

The "Self Check" menu essentially runs the collation check that is also
performed at startup, and displays the results. This is only a thing for
MariaDB/MySQL and MSSQL. As such, the menu item should only be available
for these database types.

Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
(cherry picked from commit 0ca118fdc3c39c0e7adf9285e074e5878a0ca1c1)
This commit is contained in:
Gergely Nagy 2024-02-04 09:43:59 +01:00 committed by Earl Warren
parent 76c2f5bf92
commit c335d076aa
No known key found for this signature in database
GPG key ID: 0579CB2928A78A00
3 changed files with 30 additions and 1 deletions

View file

@ -676,7 +676,9 @@ func registerRoutes(m *web.Route) {
m.Get("", admin.Dashboard)
m.Post("", web.Bind(forms.AdminDashboardForm{}), admin.DashboardPost)
m.Get("/self_check", admin.SelfCheck)
if setting.Database.Type.IsMySQL() || setting.Database.Type.IsMSSQL() {
m.Get("/self_check", admin.SelfCheck)
}
m.Group("/config", func() {
m.Get("", admin.Config)