mirror of
https://github.com/Xevion/glance.git
synced 2026-01-31 12:24:24 -06:00
Merge branch 'release/v0.6.0' into features
This commit is contained in:
@@ -21,7 +21,6 @@ type Bookmarks struct {
|
||||
HideArrow bool `yaml:"hide-arrow"`
|
||||
} `yaml:"links"`
|
||||
} `yaml:"groups"`
|
||||
Style string `yaml:"style"`
|
||||
}
|
||||
|
||||
func (widget *Bookmarks) Initialize() error {
|
||||
|
||||
@@ -14,7 +14,6 @@ type Markets struct {
|
||||
StocksRequests []feed.MarketRequest `yaml:"stocks"`
|
||||
MarketRequests []feed.MarketRequest `yaml:"markets"`
|
||||
Sort string `yaml:"sort-by"`
|
||||
Style string `yaml:"style"`
|
||||
Markets feed.Markets `yaml:"-"`
|
||||
}
|
||||
|
||||
@@ -53,7 +53,8 @@ type Monitor struct {
|
||||
StatusText string `yaml:"-"`
|
||||
StatusStyle string `yaml:"-"`
|
||||
} `yaml:"sites"`
|
||||
Style string `yaml:"style"`
|
||||
ShowFailingOnly bool `yaml:"show-failing-only"`
|
||||
HasFailing bool `yaml:"-"`
|
||||
}
|
||||
|
||||
func (widget *Monitor) Initialize() error {
|
||||
@@ -79,12 +80,17 @@ func (widget *Monitor) Update(ctx context.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
widget.HasFailing = false
|
||||
|
||||
for i := range widget.Sites {
|
||||
site := &widget.Sites[i]
|
||||
status := &statuses[i]
|
||||
|
||||
site.Status = status
|
||||
|
||||
if status.Code >= 400 || status.TimedOut || status.Error != nil {
|
||||
widget.HasFailing = true
|
||||
}
|
||||
|
||||
if !status.TimedOut {
|
||||
site.StatusText = statusCodeToText(status.Code)
|
||||
site.StatusStyle = statusCodeToStyle(status.Code)
|
||||
|
||||
Reference in New Issue
Block a user