Merge branch 'release/v0.6.0' into features

This commit is contained in:
Svilen Markov
2024-09-03 00:26:33 +01:00
14 changed files with 145 additions and 137 deletions
-1
View File
@@ -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:"-"`
}
+8 -2
View File
@@ -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)