mobile: off-canvas sidebar, responsive grids/charts/top-bar
- Sidebar becomes slide-in overlay under 768px with backdrop - Hamburger button in top-bar for mobile nav toggle - Grids stack single-column, charts shrink to 280px - Tables scroll horizontally with touch momentum - Status text hidden on mobile (dot stays visible) - Card headers/actions stack vertically - Period selectors scroll horizontally also: image size validation clamp in handleImageGenerations
This commit is contained in:
@@ -850,6 +850,31 @@ func (s *Server) handleImageGenerations(c *gin.Context) {
|
||||
}
|
||||
}
|
||||
|
||||
// ponytail: per-model valid size sets. Add new models here.
|
||||
if req.Size != nil {
|
||||
validSizes := map[string][]string{
|
||||
"gpt-image": {"1024x1024", "1024x1536", "1536x1024", "auto"},
|
||||
"dall-e-3": {"1024x1024", "1024x1792", "1792x1024", "auto"},
|
||||
"dall-e-2": {"256x256", "512x512", "1024x1024", "auto"},
|
||||
}
|
||||
for prefix, sizes := range validSizes {
|
||||
if strings.HasPrefix(req.Model, prefix) {
|
||||
valid := false
|
||||
for _, s := range sizes {
|
||||
if *req.Size == s {
|
||||
valid = true
|
||||
break
|
||||
}
|
||||
}
|
||||
if !valid {
|
||||
*req.Size = "1024x1024"
|
||||
log.Printf("[WARN] Unsupported size for %s, clamped to 1024x1024", req.Model)
|
||||
}
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
provider, ok := s.providers[providerName]
|
||||
if !ok {
|
||||
c.JSON(http.StatusInternalServerError, gin.H{"error": fmt.Sprintf("Provider %s not enabled or supported", providerName)})
|
||||
|
||||
Reference in New Issue
Block a user