feat(statuspages): error page linking a home page set by admins
ci / lint (push) Skipped
ci / test (push) Skipped
ci / build (push) Skipped
ci / image (push) Skipped
ci / lint (pull_request) Successful in 6m52s
ci / test (pull_request) Successful in 15m30s
ci / build (pull_request) Successful in 16m56s
ci / image (pull_request) Successful in 6m1s
ci / lint (push) Skipped
ci / test (push) Skipped
ci / build (push) Skipped
ci / image (push) Skipped
ci / lint (pull_request) Successful in 6m52s
ci / test (pull_request) Successful in 15m30s
ci / build (pull_request) Successful in 16m56s
ci / image (pull_request) Successful in 6m1s
The bare status page domain and pages that do not exist answered with a plain "404 page not found". They now show an error page with a button to the platform's home page, which platform admins set under Admin. The status page servers receive it with the page index and keep it across restarts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
This commit is contained in:
1 parent
af992409ef
commit
1f90fe8470
17 files changed
+902
-395
No files matched your search
@@ -362,14 +362,20 @@ type PageRef struct {
|
||||
Host string `json:"host,omitempty"`
|
||||
}
|
||||
|
||||
// PageIndex lists the pages a status page server serves.
|
||||
type PageIndex struct {
|
||||
Pages []PageRef `json:"pages"`
|
||||
// HomeURL is the platform's home page, which the server links from
|
||||
// its error page; empty for none.
|
||||
HomeURL string `json:"home_url,omitempty"`
|
||||
}
|
||||
|
||||
// Pages lists every page this status page server serves, so it can keep
|
||||
// them all cached before anyone visits.
|
||||
func (c *Client) Pages(ctx context.Context) ([]PageRef, error) {
|
||||
var out struct {
|
||||
Pages []PageRef `json:"pages"`
|
||||
}
|
||||
func (c *Client) Pages(ctx context.Context) (PageIndex, error) {
|
||||
var out PageIndex
|
||||
err := c.do(ctx, http.MethodGet, "/pages/index", nil, &out)
|
||||
return out.Pages, err
|
||||
return out, err
|
||||
}
|
||||
|
||||
// ErrNotFound means no published page matches.
|
||||
|
||||
Reference in new issue
Block a user