feat: 部署向导自动应用production_*覆盖层
This commit is contained in:
parent
7b8cf92b87
commit
6f8d4e8c93
@ -230,9 +230,22 @@ func (s *ConfigPreviewService) RenderDeviceAssignment(deviceID string) (*ConfigP
|
||||
ConfigID: "assignment_" + deviceID,
|
||||
ConfigVersion: time.Now().Format("20060102.150405"),
|
||||
DeviceID: deviceID,
|
||||
Overlays: s.listAutoOverlays(),
|
||||
})
|
||||
}
|
||||
|
||||
func (s *ConfigPreviewService) listAutoOverlays() []string {
|
||||
// Auto-apply overlays whose name starts with "production_"
|
||||
var out []string
|
||||
overlays, _ := s.assets.ListOverlays()
|
||||
for _, o := range overlays {
|
||||
if strings.HasPrefix(o.Name, "production_") {
|
||||
out = append(out, o.Name)
|
||||
}
|
||||
}
|
||||
return out
|
||||
}
|
||||
|
||||
func profileOverlayNames(raw map[string]any) []string {
|
||||
items, _ := raw["overlays"].([]any)
|
||||
if len(items) == 0 {
|
||||
|
||||
Binary file not shown.
Loading…
Reference in New Issue
Block a user