From 67d62ee4568523c68394a99bc9615bb0475b2764 Mon Sep 17 00:00:00 2001 From: avery Date: Tue, 20 Jan 2026 22:09:11 +0100 Subject: [PATCH] fix: "disable router log" indicator on configuration summary page (#10356) ## Summary Currently, on `{INSTANCE_URL}/admin/config`, the "Disable router log" indicator is completely meaningless, as nothing is assigned to `ctx.Data["DisableRouterLog"]` in [`routers/web/admin/config.go`](https://codeberg.org/forgejo/forgejo/src/branch/forgejo/routers/web/admin/config.go#L121). This makes the indicator useful without changing any Go code by querying the `Loggers` item that has already been dumped to the context. Some pictures :) --- ### Before (always) ![image0](/attachments/451c9742-df4b-451a-8144-9d852dcd139f) ### After (with default log config) ![image0](/attachments/451c9742-df4b-451a-8144-9d852dcd139f) ### After (with `LOGGER_ROUTER_MODE` set to empty) ![image](/attachments/df04e085-9a32-402c-8e56-51a311a2a470) --- ## Checklist The [contributor guide](https://forgejo.org/docs/next/contributor/) contains information that will be helpful to first time contributors. There also are a few [conditions for merging Pull Requests in Forgejo repositories](https://codeberg.org/forgejo/governance/src/branch/main/PullRequestsAgreement.md). You are also welcome to join the [Forgejo development chatroom](https://matrix.to/#/#forgejo-development:matrix.org). ### Tests As far as I can tell, there aren't tests for TMPL template rendering, if I have overlooked them I'll be happy to add. - I added test coverage for Go changes... - [ ] in their respective `*_test.go` for unit tests. - [ ] in the `tests/integration` directory if it involves interactions with a live Forgejo server. - I added test coverage for JavaScript changes... - [ ] in `web_src/js/*.test.js` if it can be unit tested. - [ ] in `tests/e2e/*.test.e2e.js` if it requires interactions with a live Forgejo server (see also the [developer guide for JavaScript testing](https://codeberg.org/forgejo/forgejo/src/branch/forgejo/tests/e2e/README.md#end-to-end-tests)). ### Documentation - [ ] I created a pull request [to the documentation](https://codeberg.org/forgejo/docs) to explain to Forgejo users how to use this change. - [x] I did not document these changes and I do not expect someone else to do it. ### Release notes (I don't really mind) - [x] I do not want this change to show in the release notes. - [x] I want the title to show in the release notes with a link to this pull request. - [ ] I want the content of the `release-notes/.md` to be be used for the release notes instead of the title. Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/10356 Reviewed-by: Michael Kriese Co-authored-by: avery Co-committed-by: avery --- templates/admin/config.tmpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/admin/config.tmpl b/templates/admin/config.tmpl index 43bf3db37a..0962c6bfc7 100644 --- a/templates/admin/config.tmpl +++ b/templates/admin/config.tmpl @@ -20,7 +20,7 @@
{{ctx.Locale.Tr "admin.config.offline_mode"}}
{{if .OfflineMode}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}
{{ctx.Locale.Tr "admin.config.disable_router_log"}}
-
{{if .DisableRouterLog}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}
+
{{if .Loggers.router.IsEnabled}}{{svg "octicon-x"}}{{else}}{{svg "octicon-check"}}{{end}}