fix: show filebrowser subdomain link on stacks page
Protected stacks like filebrowser have no .felhom.yml or app.yaml, so the subdomain lookup found nothing. Added well-known subdomain fallback map for programmatically managed protected stacks. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -20,6 +20,12 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
// protectedStackSubdomains maps programmatically managed protected stacks
|
||||||
|
// to their well-known subdomains (these stacks have no .felhom.yml or app.yaml).
|
||||||
|
var protectedStackSubdomains = map[string]string{
|
||||||
|
"filebrowser": "files",
|
||||||
|
}
|
||||||
|
|
||||||
// StorageBarInfo holds data for rendering a storage usage bar on dashboard/monitoring.
|
// StorageBarInfo holds data for rendering a storage usage bar on dashboard/monitoring.
|
||||||
type StorageBarInfo struct {
|
type StorageBarInfo struct {
|
||||||
Label string // e.g., "USB HDD 1TB", "SYS Storage 350G"
|
Label string // e.g., "USB HDD 1TB", "SYS Storage 350G"
|
||||||
@@ -182,7 +188,11 @@ func (s *Server) dashboardHandler(w http.ResponseWriter, r *http.Request) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
subdomains[stack.Name] = stack.Meta.Subdomain
|
if stack.Meta.Subdomain != "" {
|
||||||
|
subdomains[stack.Name] = stack.Meta.Subdomain
|
||||||
|
} else if sd, ok := protectedStackSubdomains[stack.Name]; ok {
|
||||||
|
subdomains[stack.Name] = sd
|
||||||
|
}
|
||||||
}
|
}
|
||||||
data["Subdomains"] = subdomains
|
data["Subdomains"] = subdomains
|
||||||
|
|
||||||
@@ -217,7 +227,7 @@ func (s *Server) stacksHandler(w http.ResponseWriter, r *http.Request) {
|
|||||||
}
|
}
|
||||||
data["StorageLabels"] = storageLabels
|
data["StorageLabels"] = storageLabels
|
||||||
|
|
||||||
// Build effective subdomain lookup (stored env > metadata fallback)
|
// Build effective subdomain lookup (stored env > metadata > well-known fallback)
|
||||||
subdomains := make(map[string]string)
|
subdomains := make(map[string]string)
|
||||||
for _, stack := range s.stackMgr.GetStacks() {
|
for _, stack := range s.stackMgr.GetStacks() {
|
||||||
if stack.Deployed {
|
if stack.Deployed {
|
||||||
@@ -228,7 +238,11 @@ func (s *Server) stacksHandler(w http.ResponseWriter, r *http.Request) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
subdomains[stack.Name] = stack.Meta.Subdomain
|
if stack.Meta.Subdomain != "" {
|
||||||
|
subdomains[stack.Name] = stack.Meta.Subdomain
|
||||||
|
} else if sd, ok := protectedStackSubdomains[stack.Name]; ok {
|
||||||
|
subdomains[stack.Name] = sd
|
||||||
|
}
|
||||||
}
|
}
|
||||||
data["Subdomains"] = subdomains
|
data["Subdomains"] = subdomains
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user