Improve admin urls (#7370)

* Improve Master and Volume URLs in admin dashboard

- Add clickable URL for master node.
- Refactor Volume server URL to use PublicURL if set. 'address' is used
  as fallback.

* Make volume servers show in consistent order

- Sort servers by name to ensure predictable order after each refresh.

* address comment

---------

Co-authored-by: chrislu <chris.lu@gmail.com>
This commit is contained in:
Yavor Konstantinovandchrislu authored and GitHub committed 2025-10-24 01:38:01 -07:00
1 parent 7d147f238c
commit 1d0471aebb
4 files changed
+170 -137

No files matched your search

+8
View File
@@ -3,6 +3,7 @@ package dash
import (
"context"
"net/http"
"sort"
"time"
"github.com/gin-gonic/gin"
@@ -108,6 +109,13 @@ func (s *AdminServer) GetAdminData(username string) (AdminData, error) {
glog.Errorf("Failed to get cluster volume servers: %v", err)
return AdminData{}, err
}
// Sort the servers so they show up in consistent order after each reload
sort.Slice(volumeServersData.VolumeServers, func(i, j int) bool {
s1Name := volumeServersData.VolumeServers[i].GetDisplayAddress()
s2Name := volumeServersData.VolumeServers[j].GetDisplayAddress()
return s1Name < s2Name
})
// Get master nodes status
masterNodes := s.getMasterNodesStatus()