aboutsummaryrefslogtreecommitdiff
path: root/weed/admin/dash/admin_server.go
diff options
context:
space:
mode:
Diffstat (limited to 'weed/admin/dash/admin_server.go')
-rw-r--r--weed/admin/dash/admin_server.go38
1 files changed, 28 insertions, 10 deletions
diff --git a/weed/admin/dash/admin_server.go b/weed/admin/dash/admin_server.go
index 79bce365b..e4fa0c768 100644
--- a/weed/admin/dash/admin_server.go
+++ b/weed/admin/dash/admin_server.go
@@ -141,15 +141,15 @@ type ClusterVolumesData struct {
}
type CollectionInfo struct {
- Name string `json:"name"`
- DataCenter string `json:"datacenter"`
- Replication string `json:"replication"`
- VolumeCount int `json:"volume_count"`
- FileCount int64 `json:"file_count"`
- TotalSize int64 `json:"total_size"`
- TTL string `json:"ttl"`
- DiskType string `json:"disk_type"`
- Status string `json:"status"`
+ Name string `json:"name"`
+ DataCenter string `json:"datacenter"`
+ Replication string `json:"replication"`
+ VolumeCount int `json:"volume_count"`
+ FileCount int64 `json:"file_count"`
+ TotalSize int64 `json:"total_size"`
+ TTL string `json:"ttl"`
+ DiskTypes []string `json:"disk_types"`
+ Status string `json:"status"`
}
type ClusterCollectionsData struct {
@@ -879,6 +879,12 @@ func (s *AdminServer) GetClusterCollections() (*ClusterCollectionsData, error) {
collectionName = "default" // Default collection for volumes without explicit collection
}
+ // Get disk type from volume info, default to hdd if empty
+ diskType := volInfo.DiskType
+ if diskType == "" {
+ diskType = "hdd"
+ }
+
// Get or create collection info
if collection, exists := collectionMap[collectionName]; exists {
collection.VolumeCount++
@@ -890,6 +896,18 @@ func (s *AdminServer) GetClusterCollections() (*ClusterCollectionsData, error) {
collection.DataCenter = "multi"
}
+ // Add disk type if not already present
+ diskTypeExists := false
+ for _, existingDiskType := range collection.DiskTypes {
+ if existingDiskType == diskType {
+ diskTypeExists = true
+ break
+ }
+ }
+ if !diskTypeExists {
+ collection.DiskTypes = append(collection.DiskTypes, diskType)
+ }
+
totalVolumes++
totalFiles += int64(volInfo.FileCount)
totalSize += int64(volInfo.Size)
@@ -910,7 +928,7 @@ func (s *AdminServer) GetClusterCollections() (*ClusterCollectionsData, error) {
FileCount: int64(volInfo.FileCount),
TotalSize: int64(volInfo.Size),
TTL: ttlStr,
- DiskType: "hdd", // Default disk type
+ DiskTypes: []string{diskType},
Status: "active",
}
collectionMap[collectionName] = &newCollection