mirror of
https://github.com/taigrr/wtf
synced 2025-01-18 04:03:14 -08:00
Constantize the defaultFocus value for each module
This commit is contained in:
@@ -7,7 +7,10 @@ import (
|
||||
"github.com/wtfutil/wtf/cfg"
|
||||
)
|
||||
|
||||
const defaultTitle = "BambooHR"
|
||||
const (
|
||||
defaultFocusable = false
|
||||
defaultTitle = "BambooHR"
|
||||
)
|
||||
|
||||
type Settings struct {
|
||||
common *cfg.Common
|
||||
@@ -18,7 +21,7 @@ type Settings struct {
|
||||
|
||||
func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *config.Config) *Settings {
|
||||
settings := Settings{
|
||||
common: cfg.NewCommonSettingsFromModule(name, defaultTitle, ymlConfig, globalConfig),
|
||||
common: cfg.NewCommonSettingsFromModule(name, defaultTitle, defaultFocusable, ymlConfig, globalConfig),
|
||||
|
||||
apiKey: ymlConfig.UString("apiKey", ymlConfig.UString("apikey", os.Getenv("WTF_BAMBOO_HR_TOKEN"))),
|
||||
subdomain: ymlConfig.UString("subdomain", os.Getenv("WTF_BAMBOO_HR_SUBDOMAIN")),
|
||||
|
||||
@@ -10,7 +10,7 @@ import (
|
||||
"github.com/wtfutil/wtf/wtf"
|
||||
)
|
||||
|
||||
const APIURI = "https://api.bamboohr.com/api/gateway.php"
|
||||
const apiURI = "https://api.bamboohr.com/api/gateway.php"
|
||||
|
||||
type Widget struct {
|
||||
view.TextWidget
|
||||
@@ -21,7 +21,7 @@ type Widget struct {
|
||||
|
||||
func NewWidget(app *tview.Application, settings *Settings) *Widget {
|
||||
widget := Widget{
|
||||
TextWidget: view.NewTextWidget(app, settings.common, false),
|
||||
TextWidget: view.NewTextWidget(app, settings.common),
|
||||
|
||||
settings: settings,
|
||||
}
|
||||
@@ -33,7 +33,7 @@ func NewWidget(app *tview.Application, settings *Settings) *Widget {
|
||||
|
||||
func (widget *Widget) Refresh() {
|
||||
client := NewClient(
|
||||
APIURI,
|
||||
apiURI,
|
||||
widget.settings.apiKey,
|
||||
widget.settings.subdomain,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user