fix: Sort plugins by ID in admin UI

- Add sort package to imports
- Sort plugins list by ID before rendering
- Ensures consistent display order regardless of connection order
- Plugin IDs are properly used in action link URLs (/plugins/jobs/{id}, /plugins/config/{id})
This commit is contained in:
Chris Lu committed 2026-02-17 11:12:11 -08:00
1 parent 5342328836
commit 7608b8ba44
1 file changed
+6
+6
View File
@@ -3,6 +3,7 @@ package handlers
import (
"net/http"
"net/url"
"sort"
"time"
"github.com/gin-gonic/gin"
@@ -760,6 +761,11 @@ func (h *AdminHandlers) ShowPlugins(c *gin.Context) {
}
}
// Sort plugins by ID
sort.Slice(plugins, func(i, j int) bool {
return plugins[i]["id"].(string) < plugins[j]["id"].(string)
})
component := app.PluginsOverview(app.PluginsPageData{
Plugins: plugins,
JobTypes: jobTypes,