mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
feat: add dismissed property to the healthcheck section (#10940)
This commit is contained in:
@@ -16,9 +16,10 @@ import (
|
||||
// @typescript-generate AccessURLReport
|
||||
type AccessURLReport struct {
|
||||
// Healthy is deprecated and left for backward compatibility purposes, use `Severity` instead.
|
||||
Healthy bool `json:"healthy"`
|
||||
Severity health.Severity `json:"severity" enums:"ok,warning,error"`
|
||||
Warnings []string `json:"warnings"`
|
||||
Healthy bool `json:"healthy"`
|
||||
Severity health.Severity `json:"severity" enums:"ok,warning,error"`
|
||||
Warnings []string `json:"warnings"`
|
||||
Dismissed bool `json:"dismissed"`
|
||||
|
||||
AccessURL string `json:"access_url"`
|
||||
Reachable bool `json:"reachable"`
|
||||
@@ -30,6 +31,8 @@ type AccessURLReport struct {
|
||||
type AccessURLReportOptions struct {
|
||||
AccessURL *url.URL
|
||||
Client *http.Client
|
||||
|
||||
Dismissed bool
|
||||
}
|
||||
|
||||
func (r *AccessURLReport) Run(ctx context.Context, opts *AccessURLReportOptions) {
|
||||
@@ -38,6 +41,8 @@ func (r *AccessURLReport) Run(ctx context.Context, opts *AccessURLReportOptions)
|
||||
|
||||
r.Severity = health.SeverityOK
|
||||
r.Warnings = []string{}
|
||||
r.Dismissed = opts.Dismissed
|
||||
|
||||
if opts.AccessURL == nil {
|
||||
r.Error = ptr.Ref("access URL is nil")
|
||||
r.Severity = health.SeverityError
|
||||
|
||||
Reference in New Issue
Block a user