Skip to content
Snippets Groups Projects
Commit 50da65d5 authored by ale's avatar ale
Browse files

Add links to the public endpoints

Fixes issue #3.
parent 482903f9
No related branches found
No related tags found
No related merge requests found
......@@ -5,10 +5,11 @@ import (
"strconv"
"strings"
"git.autistici.org/ai3/tools/float-dashboard/schema/float"
floatschema "git.autistici.org/ai3/tools/float-dashboard/schema/float"
)
const (
LinkRelSelf = "self"
LinkRelDashboard = "grafana"
LinkRelLogs = "logs"
LinkRelOther = "other"
......
......@@ -96,6 +96,14 @@ func serviceAlertsLink(publicDomain, service string) Link {
}
}
func selfLink(vhost string) Link {
return Link{
Name: "visit site",
Rel: LinkRelSelf,
URL: "https://" + vhost,
}
}
func (s *Service) addLinks(publicDomain string) {
s.Links = []Link{
grafanaServiceLink(publicDomain, s.Name),
......@@ -115,6 +123,7 @@ func (e *Endpoint) addLinks(publicDomain string) {
switch e.Type {
case EndpointTypePublic:
e.Links = []Link{
selfLink(publicDomain, e.DNSNames[0]),
grafanaQPSLink(publicDomain, e.DNSNames[0]),
httpLogsLink(publicDomain, e.DNSNames[0]),
}
......
{{##def.linkicon:rel:
{{= {grafana: 'pulse', logs: 'copywriting', other: 'external-link'}[rel] }}
{{= {grafana: 'pulse', logs: 'copywriting', other: 'external-link', self: 'external-link'}[rel] }}
#}}
{{##def.extlink:link:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment