Align console behavior with operator routing and image workflow expectations
Constraint: Must preserve current exchange-rate logic, same-group routing boundary, and temporary image-file behavior while fixing UX-visible inconsistencies. Rejected: Large frontend chunk refactor | introduced risky circular chunking and did not improve deliverability for this rollout. Confidence: medium Scope-risk: moderate Directive: Keep channel failover constrained to the selected group and preserve Beijing-day semantics for user cache dashboard metrics. Tested: go test ./controller ./model ./service ./common -count=1; npm run build; remote smoke on source deployment at http://38.76.218.56:18081/ plus /api/status and /api/image-studio/settings. Not-tested: Browser-driven end-to-end verification of every console page interaction.
This commit is contained in:
@@ -89,6 +89,32 @@ func GetOptions(c *gin.Context) {
|
||||
Key: "CompletionRatioMeta",
|
||||
Value: buildCompletionRatioMetaValue(optionValues),
|
||||
})
|
||||
pricingItems := model.GetPricing()
|
||||
imageStudioModels := make([]string, 0)
|
||||
seenImageStudioModels := make(map[string]struct{})
|
||||
for _, item := range pricingItems {
|
||||
enabledForImage := false
|
||||
for _, group := range item.EnableGroup {
|
||||
if strings.TrimSpace(group) == "image" {
|
||||
enabledForImage = true
|
||||
break
|
||||
}
|
||||
}
|
||||
if !enabledForImage {
|
||||
continue
|
||||
}
|
||||
if _, ok := seenImageStudioModels[item.ModelName]; ok {
|
||||
continue
|
||||
}
|
||||
seenImageStudioModels[item.ModelName] = struct{}{}
|
||||
imageStudioModels = append(imageStudioModels, item.ModelName)
|
||||
}
|
||||
if encoded, err := common.Marshal(imageStudioModels); err == nil {
|
||||
options = append(options, &model.Option{
|
||||
Key: "ImageStudioAvailableModels",
|
||||
Value: string(encoded),
|
||||
})
|
||||
}
|
||||
c.JSON(http.StatusOK, gin.H{
|
||||
"success": true,
|
||||
"message": "",
|
||||
|
||||
Reference in New Issue
Block a user