refactor(proxy): bind routes through zone domains

This commit is contained in:
ryan
2026-07-12 14:52:19 +08:00
parent e51f1e583d
commit d0536fcdd5
13 changed files with 332 additions and 638 deletions
+9 -1
View File
@@ -74,9 +74,17 @@ func GetOriginDetail(ctx context.Context, id uint) (*DetailView, error) {
}
items := make([]RouteSummary, 0, len(routes))
for _, route := range routes {
domains, err := model.ListZoneDomainsByRouteID(ctx, route.ID)
if err != nil {
return nil, err
}
domain := ""
if len(domains) > 0 {
domain = domains[0].Domain
}
items = append(items, RouteSummary{
ID: route.ID,
Domain: route.Domain,
Domain: domain,
OriginURL: route.OriginURL,
Enabled: route.Enabled,
UpdatedAt: route.UpdatedAt.Format("2006-01-02T15:04:05Z07:00"),