Skip to content
Permalink
Browse files

Adding support for non-website things

  • Loading branch information...
Depado committed Feb 7, 2016
1 parent 07b906b commit 7256849de74455108a75f44cd74a3718e567bb69
Showing with 12 additions and 4 deletions.
  1. +2 −0 main.go
  2. +3 −1 models/service.go
  3. +7 −3 templates/index.tmpl
@@ -43,6 +43,7 @@ func main() {
cnf := configuration.C
all = make(models.Services, len(cnf.Services))
for i, s := range cnf.Services {
up := s.URL == ""
all[i] = &models.Service{
Name: s.Name,
URL: s.URL,
@@ -51,6 +52,7 @@ func main() {
BuildAPI: s.BuildAPI,
BuildURL: s.BuildURL,
RepoURL: s.RepoURL,
Up: up,
Icon: "/static/custom/" + s.Icon,
}
}
@@ -80,7 +80,9 @@ func (s *Service) CheckBuild(client *http.Client) {

// Check updates the status of the Host
func (s *Service) Check(client *http.Client) {
go s.CheckStatus(client)
if s.URL != "" {
go s.CheckStatus(client)
}
if s.BuildAPI != "" {
go s.CheckBuild(client)
}
@@ -102,17 +102,21 @@
<div class="content">
<img class="right floated mini ui image" {{ if .Icon }}src="{{ .Icon }}" alt="{{ .Name }}" {{ end }}>
<div class="header">{{ .Name }}</div>
<div class="meta"><a href="{{ .URL }}">{{ .ShortURL }}</a></div>
<div class="meta"><a href="{{ .URL }}">{{ if eq .ShortURL "" }}-{{ else }}{{ .ShortURL }}{{ end }}</a></div>
</div>
<div class="extra content">
<i class="setting icon"></i>{{ if .RespTime }}{{ .RespTime }}{{ else }}-{{ end }}
<span class="right floated">
{{ if .Host }}{{ .Host }}{{ else }}-{{ end}} <i class="server icon"></i>
</span>
<br />
<i class="wait icon"></i>{{ if .Last }}{{ .Last }}{{ else }}-{{ end }} {{ if .Up }}
<i class="wait icon"></i>{{ if .Last }}{{ .Last }}{{ else }}-{{ end }}
{{ if eq .URL ""}}
<span class="right floated">- <i class="help icon"></i></span>
{{ else }}
{{ if .Up }}
<span class="right floated" style="color:#21BA45;">{{ .Status }} <i class="check icon"></i></span> {{ else }}
<span class="right floated" style="color:#DB2828;">{{ .Status }} <i class="remove icon"></i></span> {{ end }}
<span class="right floated" style="color:#DB2828;">{{ .Status }} <i class="remove icon"></i></span> {{ end }}{{ end }}
<br /> {{ if .RepoURL }}
<a href="#" style="color:#6A6AFF;" id="commits-{{ $index }}"><i class="github alternate icon"></i> Commits</a> {{ else }}
<i class="github alternate icon"></i> No Commits{{ end }}

0 comments on commit 7256849

Please sign in to comment.
You can’t perform that action at this time.