Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
ai3
tools
float-dashboard
Commits
01acff6d
Commit
01acff6d
authored
Aug 11, 2018
by
ale
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a link to vhost grafana dashboards
parent
4e7b43f7
Pipeline
#1136
passed with stages
in 52 seconds
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
35 additions
and
24 deletions
+35
-24
bindata.go
bindata.go
+10
-9
dash.go
dash.go
+1
-1
service.go
service.go
+13
-4
sri_auto.go
sri_auto.go
+2
-2
templates/index.html
templates/index.html
+9
-8
No files found.
bindata.go
View file @
01acff6d
...
...
@@ -952,14 +952,15 @@ var _templatesIndexHtml = []byte(`{{template "header" "float services"}}
{{range $i, $p := $svc.PublicEndpoints}}
{{if gt $i 0}}<br>{{end}}
{{$p.Name}}
<span class="muted">
<a href="{{$p.URL}}" target="_blank">
<span class="oi oi-globe" title="view site"></span>
</a>
<a href="{{$p.LogsURL}}">
<span class="oi oi-spreadsheet" title="http logs"></span>
</a>
</span>
<a href="{{$p.URL}}" target="_blank">
<span class="oi oi-globe" title="view site"></span>
</a>
<a href="{{$p.QpsGraphURL}}">
<span class="oi oi-graph" title="traffic"></span>
</a>
<a href="{{$p.LogsURL}}">
<span class="oi oi-spreadsheet" title="http logs"></span>
</a>
{{end}}
</td>
...
...
@@ -1012,7 +1013,7 @@ func templatesIndexHtml() (*asset, error) {
return nil, err
}
info := bindataFileInfo{name: "templates/index.html", size: 2
081
, mode: os.FileMode(436), modTime: time.Unix(15339
28534
, 0)}
info := bindataFileInfo{name: "templates/index.html", size: 2
135
, mode: os.FileMode(436), modTime: time.Unix(15339
76440
, 0)}
a := &asset{bytes: bytes, info: info}
return a, nil
}
dash.go
View file @
01acff6d
...
...
@@ -38,7 +38,7 @@ func getenv(k, dflt string) string {
// Config for the application.
type
Config
struct
{
Domain
string
`yaml:"domain"`
PublicDomain
s
[]
string
`yaml:"public_domain
s
"`
PublicDomain
string
`yaml:"public_domain"`
LogoImagePath
string
`yaml:"logo_image"`
HTTP
*
serverutil
.
ServerConfig
`yaml:"http_server"`
}
...
...
service.go
View file @
01acff6d
...
...
@@ -12,11 +12,12 @@ type MonitoringEndpoint struct {
}
func
(
m
MonitoringEndpoint
)
TargetStatusURL
()
string
{
return
fmt
.
Sprintf
(
"https://monitor.%s/graph?expr=ok{job=%s}"
,
config
.
Domain
,
m
.
JobName
)
return
fmt
.
Sprintf
(
"https://monitor.%s/graph?expr=ok{job=%s}"
,
config
.
Public
Domain
,
m
.
JobName
)
}
func
(
m
MonitoringEndpoint
)
ServiceDashboardURL
()
string
{
return
fmt
.
Sprintf
(
"https://grafana.%s/service-dashboard?service=%s"
,
config
.
Domain
,
m
.
JobName
)
//return fmt.Sprintf("https://grafana.%s/d/xfV2rd7ik/service-overview?refresh=5s&orgId=1&from=now-3h&to=now&var-service=%s&var-vhosts=%s", config.PublicDomain, m.JobName, serviceName, vhostName)
return
fmt
.
Sprintf
(
"https://grafana.%s/service-dashboard?service=%s"
,
config
.
PublicDomain
,
m
.
JobName
)
}
type
PublicEndpoint
struct
{
...
...
@@ -27,12 +28,20 @@ type PublicEndpoint struct {
EnableSSOProxy
bool
`yaml:"enable_sso_proxy,omitempty"`
}
func
(
p
PublicEndpoint
)
FQDN
()
string
{
return
fmt
.
Sprintf
(
"%s.%s"
,
p
.
Name
,
config
.
PublicDomain
)
}
func
(
p
PublicEndpoint
)
URL
()
string
{
return
fmt
.
Sprintf
(
"https://%s
.%s
/"
,
p
.
Name
,
config
.
PublicDomains
[
0
]
)
return
fmt
.
Sprintf
(
"https://%s/"
,
p
.
FQDN
()
)
}
func
(
p
PublicEndpoint
)
LogsURL
()
string
{
return
fmt
.
Sprintf
(
"https://logs.%s/kibana/bla/bla/?vhost=%s.%s"
,
config
.
Domain
,
p
.
Name
,
config
.
PublicDomains
[
0
])
return
fmt
.
Sprintf
(
"https://logs.%s/kibana/bla/bla/?vhost=%s"
,
config
.
PublicDomain
,
p
.
FQDN
())
}
func
(
p
PublicEndpoint
)
QpsGraphURL
()
string
{
return
fmt
.
Sprintf
(
"https://grafana.%s/d/xCSUMFnmz/http?orgId=1&var-vhost=%s:443"
,
config
.
PublicDomain
,
p
.
FQDN
())
}
// Boolean fields that default to true are problematic, so we use
...
...
sri_auto.go
View file @
01acff6d
...
...
@@ -6,11 +6,11 @@ import (
)
var
sriMap
=
map
[
string
]
string
{
"/static/js/jquery.slim.min.js"
:
"sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo"
,
"/static/css/bootstrap.min.css"
:
"sha384-Smlep5jCw/wG7hdkwQ/Z5nLIefveQRIY9nfy6xoR1uRYBtpZgI6339F5dgvm/e9B"
,
"/static/css/open-iconic-bootstrap.min.css"
:
"sha384-wWci3BOzr88l+HNsAtr3+e5bk9qh5KfjU6gl/rbzfTYdsAVHBEbxB33veLYmFg/a"
,
"/static/css/style.css"
:
"sha384-OLBgp1GsljhM2TJ+sbHjaiH9txEUvgdDTAzHv2P24donTt6/529l+9Ua0vFImLlb"
,
"/static/js/bootstrap.bundle.min.js"
:
"sha384-CS0nxkpPy+xUkNGhObAISrkg/xjb3USVCwy+0/NMzd5VxgY4CMCyTkItmy5n0voC"
,
"/static/js/jquery.slim.min.js"
:
"sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo"
,
"/static/css/bootstrap.min.css"
:
"sha384-Smlep5jCw/wG7hdkwQ/Z5nLIefveQRIY9nfy6xoR1uRYBtpZgI6339F5dgvm/e9B"
,
}
// SRIScript returns a <script> tag with resource integrity attributes.
...
...
templates/index.html
View file @
01acff6d
...
...
@@ -39,14 +39,15 @@
{{range $i, $p := $svc.PublicEndpoints}}
{{if gt $i 0}}
<br>
{{end}}
{{$p.Name}}
<span
class=
"muted"
>
<a
href=
"{{$p.URL}}"
target=
"_blank"
>
<span
class=
"oi oi-globe"
title=
"view site"
></span>
</a>
<a
href=
"{{$p.LogsURL}}"
>
<span
class=
"oi oi-spreadsheet"
title=
"http logs"
></span>
</a>
</span>
<a
href=
"{{$p.URL}}"
target=
"_blank"
>
<span
class=
"oi oi-globe"
title=
"view site"
></span>
</a>
<a
href=
"{{$p.QpsGraphURL}}"
>
<span
class=
"oi oi-graph"
title=
"traffic"
></span>
</a>
<a
href=
"{{$p.LogsURL}}"
>
<span
class=
"oi oi-spreadsheet"
title=
"http logs"
></span>
</a>
{{end}}
</td>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment