1
0
mirror of https://github.com/taigrr/wtf synced 2025-01-18 04:03:14 -08:00

refreshInterval config added to BambooHR and Status

This commit is contained in:
Chris Cummer
2018-04-03 18:03:34 -07:00
committed by Chris Cummer
parent 39cf8c6e1c
commit b91e1be8df
4 changed files with 29 additions and 9 deletions

View File

@@ -5,21 +5,29 @@ import (
"time"
"github.com/gdamore/tcell"
"github.com/olebedev/config"
"github.com/rivo/tview"
"github.com/senorprogrammer/wtf/wtf"
)
type Widget struct {
wtf.BaseWidget
View *tview.TextView
Config *config.Config
View *tview.TextView
}
func NewWidget() *Widget {
func NewWidget(config *config.Config) *Widget {
refreshInterval, err := config.Int("wtf.bamboohr.refreshInterval")
if err != nil {
refreshInterval = 1
}
widget := Widget{
BaseWidget: wtf.BaseWidget{
Name: "BambooHR",
RefreshedAt: time.Now(),
RefreshInt: 15,
RefreshInt: refreshInterval,
},
}