diff options
| author | Horus3 | 2015-02-27 19:57:24 +0100 |
|---|---|---|
| committer | Horus3 | 2015-02-27 19:57:24 +0100 |
| commit | d62b3e273c98049511c1c09892b50f631f0665a5 (patch) | |
| tree | 267a2e463488f468292aa19446c02555e8311f4d /app/fetch.go | |
| parent | 6837ddf68f13a1633ea868ab55d71389ca5bc175 (diff) | |
| download | statuspage-d62b3e273c98049511c1c09892b50f631f0665a5.tar.gz | |
Checks error now on resonse code. Refactoring and styling.
Diffstat (limited to 'app/fetch.go')
| -rw-r--r-- | app/fetch.go | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/app/fetch.go b/app/fetch.go index f4be5c0..e56205a 100644 --- a/app/fetch.go +++ b/app/fetch.go @@ -60,9 +60,14 @@ func CheckAllPages(h []Host) []Host { } else { h[k].Status = resp.Status h[k].StatusCode = int64(resp.StatusCode) - h[k].Success = true + if h[k].StatusCode < 400 { + h[k].Success = true + h[k].Class = "success" + } else { + h[k].Success = false + h[k].Class = "danger" + } h[k].Reason = "" - h[k].Class = "success" } } |
