diff --git a/v1_1/check.go b/v1_1/check.go index 6d27d81..c961cb3 100644 --- a/v1_1/check.go +++ b/v1_1/check.go @@ -1,6 +1,9 @@ package v1_1 -import "time" +import ( + "strings" + "time" +) type Check struct { ID string @@ -20,6 +23,7 @@ func (ch *Check) runChecker() CheckResult { BusinessImpact: ch.BusinessImpact, TechnicalSummary: ch.TechnicalSummary, PanicGuide: ch.PanicGuide, + PanicGuideIsLink: strings.HasPrefix(ch.PanicGuide, "http"), LastUpdated: time.Now(), } out, err := ch.Checker() diff --git a/v1_1/handler.go b/v1_1/handler.go index 9ad4d6e..f518414 100644 --- a/v1_1/handler.go +++ b/v1_1/handler.go @@ -66,7 +66,8 @@ func writeHTMLResp(w http.ResponseWriter, health HealthResult) error {
  • Severity: {{ $value.Severity }}
  • Business impact: {{ $value.BusinessImpact }}
  • Technical summary: {{ $value.TechnicalSummary }}
  • -
  • Panic guide: {{ $value.PanicGuide }}
  • + {{if $value.PanicGuideIsLink }}
  • Panic guide: {{ $value.PanicGuide }}
  • + {{ else }}
  • Panic guide:
    {{ $value.PanicGuide }}
  • {{ end }}
  • Output: {{ $value.CheckOutput }}
  • Last updated: {{ $value.LastUpdated }}
  • diff --git a/v1_1/result.go b/v1_1/result.go index a06dc6e..4fd5e5a 100644 --- a/v1_1/result.go +++ b/v1_1/result.go @@ -15,6 +15,7 @@ type CheckResult struct { CheckOutput string `json:"checkOutput"` LastUpdated time.Time `json:"lastUpdated"` Ack string `json:"ack,omitempty"` + PanicGuideIsLink bool `json:"-"` } type HealthResult struct {