mirror of
https://github.com/portainer/portainer.git
synced 2025-07-24 07:49:41 +02:00
feat(motd): add the ability to display motd and dimiss information panels (#2191)
* feat(api): add motd handler * feat(app): add the motd api layer * feat(motd): display motd and add the ability to dismiss information messages * style(home): relocate important message before info01 * feat(api): silently fail when an error occurs during motd retrieval
This commit is contained in:
parent
74ca908759
commit
6ab6cfafb7
20 changed files with 269 additions and 108 deletions
|
@ -13,6 +13,10 @@ import (
|
|||
"github.com/portainer/portainer"
|
||||
)
|
||||
|
||||
const (
|
||||
errInvalidResponseStatus = portainer.Error("Invalid response status (expecting 200)")
|
||||
)
|
||||
|
||||
// HTTPClient represents a client to send HTTP requests.
|
||||
type HTTPClient struct {
|
||||
*http.Client
|
||||
|
@ -75,6 +79,10 @@ func Get(url string) ([]byte, error) {
|
|||
}
|
||||
defer response.Body.Close()
|
||||
|
||||
if response.StatusCode != http.StatusOK {
|
||||
return nil, errInvalidResponseStatus
|
||||
}
|
||||
|
||||
body, err := ioutil.ReadAll(response.Body)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue