move optional config from app info page to deploy/settings page
Users couldn't find metadata provider fields (IGDB, ScreenScraper, etc.) on the app info page. Move them to the deploy page where all other settings (integrations, geo-restriction) already live. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -418,6 +418,23 @@ func (s *Server) deployHandler(w http.ResponseWriter, r *http.Request, name stri
|
||||
data["GeoGlobalCountries"] = []string{}
|
||||
data["GeoAppOverrideCountries"] = []string{}
|
||||
}
|
||||
|
||||
// Optional config (metadata providers, etc.)
|
||||
if meta.HasOptionalConfig() {
|
||||
data["HasOptionalConfig"] = true
|
||||
data["OptionalConfig"] = meta.OptionalConfig
|
||||
optValues := make(map[string]string)
|
||||
if decryptedEnv != nil {
|
||||
for _, group := range meta.OptionalConfig {
|
||||
for _, field := range group.Fields {
|
||||
if val, ok := decryptedEnv[field.EnvVar]; ok {
|
||||
optValues[field.EnvVar] = val
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
data["CurrentValues"] = optValues
|
||||
}
|
||||
}
|
||||
|
||||
// Memory info for deploy page (only for non-deployed apps)
|
||||
@@ -482,28 +499,19 @@ func (s *Server) appDetailHandler(w http.ResponseWriter, r *http.Request, slug s
|
||||
return
|
||||
}
|
||||
|
||||
// Load current optional config values from app.yaml
|
||||
currentValues := make(map[string]string)
|
||||
if appCfg := s.stackMgr.LoadAppConfigByName(found.Name); appCfg != nil {
|
||||
for k, v := range appCfg.Env {
|
||||
currentValues[k] = v
|
||||
}
|
||||
}
|
||||
|
||||
// Determine effective subdomain (stored env > metadata fallback)
|
||||
effectiveSubdomain := found.Meta.Subdomain
|
||||
if sd, ok := currentValues["SUBDOMAIN"]; ok && sd != "" {
|
||||
effectiveSubdomain = sd
|
||||
if appCfg := s.stackMgr.LoadAppConfigByName(found.Name); appCfg != nil {
|
||||
if sd, ok := appCfg.Env["SUBDOMAIN"]; ok && sd != "" {
|
||||
effectiveSubdomain = sd
|
||||
}
|
||||
}
|
||||
|
||||
data := s.baseData("stacks", found.Meta.DisplayName)
|
||||
data["Stack"] = found
|
||||
data["Meta"] = found.Meta
|
||||
data["AppInfo"] = found.Meta.AppInfo
|
||||
data["OptionalConfig"] = found.Meta.OptionalConfig
|
||||
data["CurrentValues"] = currentValues
|
||||
data["HasAppInfo"] = found.Meta.HasAppInfo()
|
||||
data["HasOptionalConfig"] = found.Meta.HasOptionalConfig()
|
||||
data["EffectiveSubdomain"] = effectiveSubdomain
|
||||
|
||||
s.executeTemplate(w, r, "app_info", data)
|
||||
|
||||
Reference in New Issue
Block a user