diff --git a/weed/admin/handlers/admin_handlers.go b/weed/admin/handlers/admin_handlers.go index 5bf4c6a5e..216e4801b 100644 --- a/weed/admin/handlers/admin_handlers.go +++ b/weed/admin/handlers/admin_handlers.go @@ -85,12 +85,14 @@ func (h *AdminHandlers) SetupRoutes(r *gin.Engine, authRequired bool, adminUser, protected.GET("/cluster/masters", h.clusterHandlers.ShowClusterMasters) protected.GET("/cluster/filers", h.clusterHandlers.ShowClusterFilers) protected.GET("/cluster/volume-servers", h.clusterHandlers.ShowClusterVolumeServers) - protected.GET("/cluster/volumes", h.clusterHandlers.ShowClusterVolumes) - protected.GET("/cluster/volumes/:id/:server", h.clusterHandlers.ShowVolumeDetails) - protected.GET("/cluster/collections", h.clusterHandlers.ShowClusterCollections) - protected.GET("/cluster/collections/:name", h.clusterHandlers.ShowCollectionDetails) - protected.GET("/cluster/ec-shards", h.clusterHandlers.ShowClusterEcShards) - protected.GET("/cluster/ec-volumes/:id", h.clusterHandlers.ShowEcVolumeDetails) + + // Storage management routes + protected.GET("/storage/volumes", h.clusterHandlers.ShowClusterVolumes) + protected.GET("/storage/volumes/:id/:server", h.clusterHandlers.ShowVolumeDetails) + protected.GET("/storage/collections", h.clusterHandlers.ShowClusterCollections) + protected.GET("/storage/collections/:name", h.clusterHandlers.ShowCollectionDetails) + protected.GET("/storage/ec-shards", h.clusterHandlers.ShowClusterEcShards) + protected.GET("/storage/ec-volumes/:id", h.clusterHandlers.ShowEcVolumeDetails) // Message Queue management routes protected.GET("/mq/brokers", h.mqHandlers.ShowBrokers) @@ -213,12 +215,14 @@ func (h *AdminHandlers) SetupRoutes(r *gin.Engine, authRequired bool, adminUser, r.GET("/cluster/masters", h.clusterHandlers.ShowClusterMasters) r.GET("/cluster/filers", h.clusterHandlers.ShowClusterFilers) r.GET("/cluster/volume-servers", h.clusterHandlers.ShowClusterVolumeServers) - r.GET("/cluster/volumes", h.clusterHandlers.ShowClusterVolumes) - r.GET("/cluster/volumes/:id/:server", h.clusterHandlers.ShowVolumeDetails) - r.GET("/cluster/collections", h.clusterHandlers.ShowClusterCollections) - r.GET("/cluster/collections/:name", h.clusterHandlers.ShowCollectionDetails) - r.GET("/cluster/ec-shards", h.clusterHandlers.ShowClusterEcShards) - r.GET("/cluster/ec-volumes/:id", h.clusterHandlers.ShowEcVolumeDetails) + + // Storage management routes + r.GET("/storage/volumes", h.clusterHandlers.ShowClusterVolumes) + r.GET("/storage/volumes/:id/:server", h.clusterHandlers.ShowVolumeDetails) + r.GET("/storage/collections", h.clusterHandlers.ShowClusterCollections) + r.GET("/storage/collections/:name", h.clusterHandlers.ShowCollectionDetails) + r.GET("/storage/ec-shards", h.clusterHandlers.ShowClusterEcShards) + r.GET("/storage/ec-volumes/:id", h.clusterHandlers.ShowEcVolumeDetails) // Message Queue management routes r.GET("/mq/brokers", h.mqHandlers.ShowBrokers) diff --git a/weed/admin/view/app/cluster_collections.templ b/weed/admin/view/app/cluster_collections.templ index d4765ea86..52482927f 100644 --- a/weed/admin/view/app/cluster_collections.templ +++ b/weed/admin/view/app/cluster_collections.templ @@ -149,12 +149,12 @@ templ ClusterCollections(data dash.ClusterCollectionsData) { for _, collection := range data.Collections { - + {collection.Name} - +
if collection.VolumeCount > 0 { @@ -166,7 +166,7 @@ templ ClusterCollections(data dash.ClusterCollectionsData) { - +
if collection.EcVolumeCount > 0 { @@ -330,10 +330,10 @@ templ ClusterCollections(data dash.ClusterCollectionsData) { '
' + '
Quick Actions
' + '
' + - '' + + '' + 'View Volumes' + '' + - '' + + '' + 'View EC Volumes' + '' + '' + diff --git a/weed/admin/view/app/cluster_collections_templ.go b/weed/admin/view/app/cluster_collections_templ.go index e3630d7a6..1e0234cbd 100644 --- a/weed/admin/view/app/cluster_collections_templ.go +++ b/weed/admin/view/app/cluster_collections_templ.go @@ -114,7 +114,7 @@ func ClusterCollections(data dash.ClusterCollectionsData) templ.Component { return templ_7745c5c3_Err } var templ_7745c5c3_Var7 templ.SafeURL - templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(fmt.Sprintf("/cluster/collections/%s", collection.Name))) + templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(fmt.Sprintf("/storage/collections/%s", collection.Name))) if templ_7745c5c3_Err != nil { return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/cluster_collections.templ`, Line: 152, Col: 123} } @@ -140,7 +140,7 @@ func ClusterCollections(data dash.ClusterCollectionsData) templ.Component { return templ_7745c5c3_Err } var templ_7745c5c3_Var9 templ.SafeURL - templ_7745c5c3_Var9, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(fmt.Sprintf("/cluster/volumes?collection=%s", collection.Name))) + templ_7745c5c3_Var9, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(fmt.Sprintf("/storage/volumes?collection=%s", collection.Name))) if templ_7745c5c3_Err != nil { return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/cluster_collections.templ`, Line: 157, Col: 130} } @@ -173,7 +173,7 @@ func ClusterCollections(data dash.ClusterCollectionsData) templ.Component { return templ_7745c5c3_Err } var templ_7745c5c3_Var11 templ.SafeURL - templ_7745c5c3_Var11, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(fmt.Sprintf("/cluster/ec-shards?collection=%s", collection.Name))) + templ_7745c5c3_Var11, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(fmt.Sprintf("/storage/ec-shards?collection=%s", collection.Name))) if templ_7745c5c3_Err != nil { return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/cluster_collections.templ`, Line: 169, Col: 132} } @@ -403,7 +403,7 @@ func ClusterCollections(data dash.ClusterCollectionsData) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 36, "
") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 36, "
") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } diff --git a/weed/admin/view/app/cluster_ec_shards.templ b/weed/admin/view/app/cluster_ec_shards.templ index a3e8fc0ec..19f6fd2d6 100644 --- a/weed/admin/view/app/cluster_ec_shards.templ +++ b/weed/admin/view/app/cluster_ec_shards.templ @@ -22,7 +22,7 @@ templ ClusterEcShards(data dash.ClusterEcShardsData) { Collection: {data.FilterCollection} } - + Clear Filter @@ -205,11 +205,11 @@ templ ClusterEcShards(data dash.ClusterEcShardsData) { if data.ShowCollectionColumn { if shard.Collection != "" { - + {shard.Collection} } else { - + default } @@ -366,7 +366,7 @@ templ ClusterEcShards(data dash.ClusterEcShardsData) { } function exportEcShards() { - const url = new URL('/api/cluster/ec-shards/export', window.location.origin); + const url = new URL('/api/storage/ec-shards/export', window.location.origin); const params = new URLSearchParams(window.location.search); params.forEach((value, key) => { url.searchParams.set(key, value); @@ -380,7 +380,7 @@ templ ClusterEcShards(data dash.ClusterEcShardsData) { const volumeId = button.getAttribute('data-volume-id'); // Navigate to the EC volume details page - window.location.href = `/cluster/ec-volumes/${volumeId}`; + window.location.href = `/storage/ec-volumes/${volumeId}`; } function repairVolume(event) { @@ -388,7 +388,7 @@ templ ClusterEcShards(data dash.ClusterEcShardsData) { const button = event.target.closest('button'); const volumeId = button.getAttribute('data-volume-id'); if (confirm(`Are you sure you want to repair missing shards for volume ${volumeId}?`)) { - fetch(`/api/cluster/volumes/${volumeId}/repair`, { + fetch(`/api/storage/volumes/${volumeId}/repair`, { method: 'POST', headers: { 'Content-Type': 'application/json', diff --git a/weed/admin/view/app/cluster_ec_shards_templ.go b/weed/admin/view/app/cluster_ec_shards_templ.go index f995e5ef4..b7c169d1e 100644 --- a/weed/admin/view/app/cluster_ec_shards_templ.go +++ b/weed/admin/view/app/cluster_ec_shards_templ.go @@ -67,7 +67,7 @@ func ClusterEcShards(data dash.ClusterEcShardsData) templ.Component { return templ_7745c5c3_Err } } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 6, "Clear Filter") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 6, "Clear Filter") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -328,7 +328,7 @@ func ClusterEcShards(data dash.ClusterEcShardsData) templ.Component { return templ_7745c5c3_Err } if shard.Collection != "" { - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 48, "") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 48, "") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -346,7 +346,7 @@ func ClusterEcShards(data dash.ClusterEcShardsData) templ.Component { return templ_7745c5c3_Err } } else { - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 50, "default") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 50, "default") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -663,7 +663,7 @@ func ClusterEcShards(data dash.ClusterEcShardsData) templ.Component { return templ_7745c5c3_Err } } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 89, "") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 89, "") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } diff --git a/weed/admin/view/app/cluster_ec_volumes.templ b/weed/admin/view/app/cluster_ec_volumes.templ index f5210082e..6e94443ae 100644 --- a/weed/admin/view/app/cluster_ec_volumes.templ +++ b/weed/admin/view/app/cluster_ec_volumes.templ @@ -25,7 +25,7 @@ templ ClusterEcVolumes(data dash.ClusterEcVolumesData) { Collection: {data.Collection} } - + Clear Filter @@ -201,11 +201,11 @@ templ ClusterEcVolumes(data dash.ClusterEcVolumesData) { if data.ShowCollectionColumn { if volume.Collection != "" { - + {volume.Collection} } else { - + default } @@ -373,13 +373,13 @@ templ ClusterEcVolumes(data dash.ClusterEcVolumesData) { function showVolumeDetails(event) { const volumeId = event.target.closest('button').getAttribute('data-volume-id'); - window.location.href = `/cluster/ec-volumes/${volumeId}`; + window.location.href = `/storage/ec-volumes/${volumeId}`; } function repairVolume(event) { const volumeId = event.target.closest('button').getAttribute('data-volume-id'); if (confirm(`Are you sure you want to repair missing shards for volume ${volumeId}?`)) { - fetch(`/api/cluster/ec-volumes/${volumeId}/repair`, { + fetch(`/api/storage/ec-volumes/${volumeId}/repair`, { method: 'POST', headers: { 'Content-Type': 'application/json', diff --git a/weed/admin/view/app/cluster_ec_volumes_templ.go b/weed/admin/view/app/cluster_ec_volumes_templ.go index ddfd0795a..9103607a8 100644 --- a/weed/admin/view/app/cluster_ec_volumes_templ.go +++ b/weed/admin/view/app/cluster_ec_volumes_templ.go @@ -70,7 +70,7 @@ func ClusterEcVolumes(data dash.ClusterEcVolumesData) templ.Component { return templ_7745c5c3_Err } } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 6, "Clear Filter") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 6, "Clear Filter") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -383,7 +383,7 @@ func ClusterEcVolumes(data dash.ClusterEcVolumesData) templ.Component { return templ_7745c5c3_Err } var templ_7745c5c3_Var13 templ.SafeURL - templ_7745c5c3_Var13, templ_7745c5c3_Err = templ.JoinURLErrs(templ.URL(fmt.Sprintf("/cluster/ec-shards?collection=%s", volume.Collection))) + templ_7745c5c3_Var13, templ_7745c5c3_Err = templ.JoinURLErrs(templ.URL(fmt.Sprintf("/storage/ec-shards?collection=%s", volume.Collection))) if templ_7745c5c3_Err != nil { return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/cluster_ec_volumes.templ`, Line: 204, Col: 123} } @@ -414,7 +414,7 @@ func ClusterEcVolumes(data dash.ClusterEcVolumesData) templ.Component { return templ_7745c5c3_Err } var templ_7745c5c3_Var15 templ.SafeURL - templ_7745c5c3_Var15, templ_7745c5c3_Err = templ.JoinURLErrs(templ.URL("/cluster/ec-shards?collection=default")) + templ_7745c5c3_Var15, templ_7745c5c3_Err = templ.JoinURLErrs(templ.URL("/storage/ec-shards?collection=default")) if templ_7745c5c3_Err != nil { return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/cluster_ec_volumes.templ`, Line: 208, Col: 96} } @@ -757,7 +757,7 @@ func ClusterEcVolumes(data dash.ClusterEcVolumesData) templ.Component { return templ_7745c5c3_Err } } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 96, "") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 96, "") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } diff --git a/weed/admin/view/app/cluster_volume_servers.templ b/weed/admin/view/app/cluster_volume_servers.templ index b6de9ad12..65b7f08a1 100644 --- a/weed/admin/view/app/cluster_volume_servers.templ +++ b/weed/admin/view/app/cluster_volume_servers.templ @@ -337,7 +337,7 @@ templ ClusterVolumeServers(data dash.ClusterVolumeServersData) { '' + 'Open Volume Server UI' + '' + - '' + + '' + 'View Volumes' + '' + '' + diff --git a/weed/admin/view/app/cluster_volume_servers_templ.go b/weed/admin/view/app/cluster_volume_servers_templ.go index c7a4ec80b..3a47df7d9 100644 --- a/weed/admin/view/app/cluster_volume_servers_templ.go +++ b/weed/admin/view/app/cluster_volume_servers_templ.go @@ -656,7 +656,7 @@ func ClusterVolumeServers(data dash.ClusterVolumeServersData) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 58, "") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 58, "") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } diff --git a/weed/admin/view/app/cluster_volumes.templ b/weed/admin/view/app/cluster_volumes.templ index 8f0b59698..c3b2591da 100644 --- a/weed/admin/view/app/cluster_volumes.templ +++ b/weed/admin/view/app/cluster_volumes.templ @@ -17,7 +17,7 @@ templ ClusterVolumes(data dash.ClusterVolumesData) { Collection: {data.FilterCollection} - + Clear Filter @@ -338,11 +338,11 @@ templ ClusterVolumes(data dash.ClusterVolumesData) { if data.ShowCollectionColumn { if volume.Collection == "" { - + default } else { - + {volume.Collection} } @@ -597,7 +597,7 @@ templ ClusterVolumes(data dash.ClusterVolumesData) { const serverCell = row.querySelector('td:nth-child(2) a'); const server = serverCell ? serverCell.textContent.trim() : 'unknown'; - window.location.href = `/cluster/volumes/${volumeId}/${encodeURIComponent(server)}`; + window.location.href = `/storage/volumes/${volumeId}/${encodeURIComponent(server)}`; } function performVacuum(volumeId, server, button) { diff --git a/weed/admin/view/app/cluster_volumes_templ.go b/weed/admin/view/app/cluster_volumes_templ.go index d96a991ce..117ae8585 100644 --- a/weed/admin/view/app/cluster_volumes_templ.go +++ b/weed/admin/view/app/cluster_volumes_templ.go @@ -53,7 +53,7 @@ func ClusterVolumes(data dash.ClusterVolumesData) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 3, " Clear Filter") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 3, " Clear Filter") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -557,7 +557,7 @@ func ClusterVolumes(data dash.ClusterVolumesData) templ.Component { return templ_7745c5c3_Err } var templ_7745c5c3_Var21 templ.SafeURL - templ_7745c5c3_Var21, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL("/cluster/volumes?collection=default")) + templ_7745c5c3_Var21, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL("/storage/volumes?collection=default")) if templ_7745c5c3_Err != nil { return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/cluster_volumes.templ`, Line: 341, Col: 113} } @@ -575,7 +575,7 @@ func ClusterVolumes(data dash.ClusterVolumesData) templ.Component { return templ_7745c5c3_Err } var templ_7745c5c3_Var22 templ.SafeURL - templ_7745c5c3_Var22, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(fmt.Sprintf("/cluster/volumes?collection=%s", volume.Collection))) + templ_7745c5c3_Var22, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(fmt.Sprintf("/storage/volumes?collection=%s", volume.Collection))) if templ_7745c5c3_Err != nil { return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/cluster_volumes.templ`, Line: 345, Col: 140} } @@ -1035,7 +1035,7 @@ func ClusterVolumes(data dash.ClusterVolumesData) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 111, "") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 111, "") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } diff --git a/weed/admin/view/app/collection_details.templ b/weed/admin/view/app/collection_details.templ index b5c86ba18..296839b93 100644 --- a/weed/admin/view/app/collection_details.templ +++ b/weed/admin/view/app/collection_details.templ @@ -15,7 +15,7 @@ templ CollectionDetails(data dash.CollectionDetailsData) { @@ -360,13 +360,13 @@ templ CollectionDetails(data dash.CollectionDetailsData) { function showVolumeDetails(event) { const volumeId = event.target.closest('button').getAttribute('data-volume-id'); const server = event.target.closest('button').getAttribute('data-server'); - window.location.href = `/cluster/volumes/${volumeId}/${server}`; + window.location.href = `/storage/volumes/${volumeId}/${server}`; } // EC Volume details function showEcVolumeDetails(event) { const volumeId = event.target.closest('button').getAttribute('data-volume-id'); - window.location.href = `/cluster/ec-volumes/${volumeId}`; + window.location.href = `/storage/ec-volumes/${volumeId}`; } // Repair EC Volume diff --git a/weed/admin/view/app/collection_details_templ.go b/weed/admin/view/app/collection_details_templ.go index a0e781637..f2ff0ab13 100644 --- a/weed/admin/view/app/collection_details_templ.go +++ b/weed/admin/view/app/collection_details_templ.go @@ -48,7 +48,7 @@ func CollectionDetails(data dash.CollectionDetailsData) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 2, "