remove service03 type; consolidated service type (#119)

This commit is contained in:
Michael Quigley
2022-12-01 12:54:14 -05:00
parent b80eb4f837
commit 44f4e37e83
10 changed files with 62 additions and 167 deletions

View File

@ -45,22 +45,30 @@ func overviewHandler(_ metadata.OverviewParams, principal *rest_model_zrok.Princ
return metadata.NewOverviewInternalServerError()
}
for _, svc := range svcs {
fe := ""
feEndpoint := ""
if svc.FrontendEndpoint != nil {
fe = *svc.FrontendEndpoint
feEndpoint = *svc.FrontendEndpoint
}
be := ""
feSelection := ""
if svc.FrontendSelection != nil {
feSelection = *svc.FrontendSelection
}
beProxyEndpoint := ""
if svc.BackendProxyEndpoint != nil {
be = *svc.BackendProxyEndpoint
beProxyEndpoint = *svc.BackendProxyEndpoint
}
es.Services = append(es.Services, &rest_model_zrok.Service{
CreatedAt: svc.CreatedAt.UnixMilli(),
FrontendEndpoint: fe,
BackendProxyEndpoint: be,
UpdatedAt: svc.UpdatedAt.UnixMilli(),
ZID: svc.ZId,
Token: svc.Token,
ZID: svc.ZId,
ShareMode: svc.ShareMode,
BackendMode: svc.BackendMode,
FrontendSelection: feSelection,
FrontendEndpoint: feEndpoint,
BackendProxyEndpoint: beProxyEndpoint,
Reserved: svc.Reserved,
Metrics: sparkData[svc.Token],
CreatedAt: svc.CreatedAt.UnixMilli(),
UpdatedAt: svc.UpdatedAt.UnixMilli(),
})
}
out = append(out, es)