Load heatmap data asynchronously (#36622)
Fixes: https://github.com/go-gitea/gitea/issues/21045 - Move heatmap data loading from synchronous server-side rendering to async client-side fetch via dedicated JSON endpoints - Dashboard and user profile pages no longer block on the expensive heatmap DB query during HTML generation - Use compact `[[timestamp,count]]` JSON format instead of `[{"timestamp":N,"contributions":N}]` to reduce payload size - Public API (`/api/v1/users/{username}/heatmap`) remains unchanged - Heatmap rendering is unchanged, still shows a spinner as before, which will now spin a litte bit longer. Signed-off-by: silverwind <me@silverwind.io> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
@@ -888,6 +888,8 @@ func registerWebRoutes(m *web.Router) {
|
||||
m.Group("/{org}", func() {
|
||||
m.Get("/dashboard", user.Dashboard)
|
||||
m.Get("/dashboard/{team}", user.Dashboard)
|
||||
m.Get("/dashboard/-/heatmap", user.DashboardHeatmap)
|
||||
m.Get("/dashboard/-/heatmap/{team}", user.DashboardHeatmap)
|
||||
m.Get("/issues", user.Issues)
|
||||
m.Get("/issues/{team}", user.Issues)
|
||||
m.Get("/pulls", user.Pulls)
|
||||
@@ -1024,6 +1026,7 @@ func registerWebRoutes(m *web.Router) {
|
||||
}
|
||||
|
||||
m.Get("/repositories", org.Repositories)
|
||||
m.Get("/heatmap", user.DashboardHeatmap)
|
||||
|
||||
m.Group("/projects", func() {
|
||||
m.Group("", func() {
|
||||
|
||||
Reference in New Issue
Block a user