mirror of
https://github.com/taigrr/wtf
synced 2025-01-18 04:03:14 -08:00
Merge pull request #639 from wtfutil/20190831-focusable-override
Add a focusable over-ride setting for modules
This commit is contained in:
commit
00f56a5f3a
@ -49,6 +49,7 @@ type Common struct {
|
|||||||
|
|
||||||
Bordered bool `help:"Whether or not the module should be displayed with a border." values:"true, false" optional:"true" default:"true"`
|
Bordered bool `help:"Whether or not the module should be displayed with a border." values:"true, false" optional:"true" default:"true"`
|
||||||
Enabled bool `help:"Whether or not this module is executed and if its data displayed onscreen." values:"true, false" optional:"true" default:"false"`
|
Enabled bool `help:"Whether or not this module is executed and if its data displayed onscreen." values:"true, false" optional:"true" default:"false"`
|
||||||
|
Focusable bool `help:"Whether or not this module is focusable." values:"true, false" optional:"true" default:"false"`
|
||||||
RefreshInterval int `help:"How often, in seconds, this module will update its data." values:"A positive integer, 0..n." optional:"true"`
|
RefreshInterval int `help:"How often, in seconds, this module will update its data." values:"A positive integer, 0..n." optional:"true"`
|
||||||
Title string `help:"The title string to show when displaying this module" optional:"true"`
|
Title string `help:"The title string to show when displaying this module" optional:"true"`
|
||||||
Config *config.Config
|
Config *config.Config
|
||||||
@ -56,7 +57,7 @@ type Common struct {
|
|||||||
focusChar int `help:"Define one of the number keys as a short cut key to access the widget." optional:"true"`
|
focusChar int `help:"Define one of the number keys as a short cut key to access the widget." optional:"true"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewCommonSettingsFromModule(name, defaultTitle string, moduleConfig *config.Config, globalSettings *config.Config) *Common {
|
func NewCommonSettingsFromModule(name, defaultTitle string, defaultFocusable bool, moduleConfig *config.Config, globalSettings *config.Config) *Common {
|
||||||
colorsConfig, _ := globalSettings.Get("wtf.colors")
|
colorsConfig, _ := globalSettings.Get("wtf.colors")
|
||||||
sigilsPath := "wtf.sigils"
|
sigilsPath := "wtf.sigils"
|
||||||
|
|
||||||
@ -83,6 +84,7 @@ func NewCommonSettingsFromModule(name, defaultTitle string, moduleConfig *config
|
|||||||
|
|
||||||
Bordered: moduleConfig.UBool("border", true),
|
Bordered: moduleConfig.UBool("border", true),
|
||||||
Enabled: moduleConfig.UBool("enabled", false),
|
Enabled: moduleConfig.UBool("enabled", false),
|
||||||
|
Focusable: moduleConfig.UBool("focusable", defaultFocusable),
|
||||||
RefreshInterval: moduleConfig.UInt("refreshInterval", 300),
|
RefreshInterval: moduleConfig.UInt("refreshInterval", 300),
|
||||||
Title: moduleConfig.UString("title", defaultTitle),
|
Title: moduleConfig.UString("title", defaultTitle),
|
||||||
Config: moduleConfig,
|
Config: moduleConfig,
|
||||||
|
@ -7,7 +7,10 @@ import (
|
|||||||
"github.com/wtfutil/wtf/cfg"
|
"github.com/wtfutil/wtf/cfg"
|
||||||
)
|
)
|
||||||
|
|
||||||
const defaultTitle = "azuredevops"
|
const (
|
||||||
|
defaultFocus = false
|
||||||
|
defaultTitle = "azuredevops"
|
||||||
|
)
|
||||||
|
|
||||||
// Settings defines the configuration options for this module
|
// Settings defines the configuration options for this module
|
||||||
type Settings struct {
|
type Settings struct {
|
||||||
@ -23,7 +26,7 @@ type Settings struct {
|
|||||||
// NewSettingsFromYAML creates and returns an instance of Settings with configuration options populated
|
// NewSettingsFromYAML creates and returns an instance of Settings with configuration options populated
|
||||||
func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *config.Config) *Settings {
|
func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *config.Config) *Settings {
|
||||||
settings := Settings{
|
settings := Settings{
|
||||||
common: cfg.NewCommonSettingsFromModule(name, defaultTitle, ymlConfig, globalConfig),
|
common: cfg.NewCommonSettingsFromModule(name, defaultTitle, defaultFocus, ymlConfig, globalConfig),
|
||||||
|
|
||||||
labelColor: ymlConfig.UString("labelColor", "white"),
|
labelColor: ymlConfig.UString("labelColor", "white"),
|
||||||
apiToken: ymlConfig.UString("apiToken", os.Getenv("WTF_AZURE DEVOPS_API_TOKEN")),
|
apiToken: ymlConfig.UString("apiToken", os.Getenv("WTF_AZURE DEVOPS_API_TOKEN")),
|
||||||
|
@ -21,7 +21,7 @@ type Widget struct {
|
|||||||
|
|
||||||
func NewWidget(app *tview.Application, pages *tview.Pages, settings *Settings) *Widget {
|
func NewWidget(app *tview.Application, pages *tview.Pages, settings *Settings) *Widget {
|
||||||
widget := Widget{
|
widget := Widget{
|
||||||
TextWidget: view.NewTextWidget(app, settings.common, false),
|
TextWidget: view.NewTextWidget(app, settings.common),
|
||||||
settings: settings,
|
settings: settings,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7,7 +7,10 @@ import (
|
|||||||
"github.com/wtfutil/wtf/cfg"
|
"github.com/wtfutil/wtf/cfg"
|
||||||
)
|
)
|
||||||
|
|
||||||
const defaultTitle = "BambooHR"
|
const (
|
||||||
|
defaultFocusable = false
|
||||||
|
defaultTitle = "BambooHR"
|
||||||
|
)
|
||||||
|
|
||||||
type Settings struct {
|
type Settings struct {
|
||||||
common *cfg.Common
|
common *cfg.Common
|
||||||
@ -18,7 +21,7 @@ type Settings struct {
|
|||||||
|
|
||||||
func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *config.Config) *Settings {
|
func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *config.Config) *Settings {
|
||||||
settings := 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"))),
|
apiKey: ymlConfig.UString("apiKey", ymlConfig.UString("apikey", os.Getenv("WTF_BAMBOO_HR_TOKEN"))),
|
||||||
subdomain: ymlConfig.UString("subdomain", os.Getenv("WTF_BAMBOO_HR_SUBDOMAIN")),
|
subdomain: ymlConfig.UString("subdomain", os.Getenv("WTF_BAMBOO_HR_SUBDOMAIN")),
|
||||||
|
@ -10,7 +10,7 @@ import (
|
|||||||
"github.com/wtfutil/wtf/wtf"
|
"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 {
|
type Widget struct {
|
||||||
view.TextWidget
|
view.TextWidget
|
||||||
@ -21,7 +21,7 @@ type Widget struct {
|
|||||||
|
|
||||||
func NewWidget(app *tview.Application, settings *Settings) *Widget {
|
func NewWidget(app *tview.Application, settings *Settings) *Widget {
|
||||||
widget := Widget{
|
widget := Widget{
|
||||||
TextWidget: view.NewTextWidget(app, settings.common, false),
|
TextWidget: view.NewTextWidget(app, settings.common),
|
||||||
|
|
||||||
settings: settings,
|
settings: settings,
|
||||||
}
|
}
|
||||||
@ -33,7 +33,7 @@ func NewWidget(app *tview.Application, settings *Settings) *Widget {
|
|||||||
|
|
||||||
func (widget *Widget) Refresh() {
|
func (widget *Widget) Refresh() {
|
||||||
client := NewClient(
|
client := NewClient(
|
||||||
APIURI,
|
apiURI,
|
||||||
widget.settings.apiKey,
|
widget.settings.apiKey,
|
||||||
widget.settings.subdomain,
|
widget.settings.subdomain,
|
||||||
)
|
)
|
||||||
|
@ -5,7 +5,10 @@ import (
|
|||||||
"github.com/wtfutil/wtf/cfg"
|
"github.com/wtfutil/wtf/cfg"
|
||||||
)
|
)
|
||||||
|
|
||||||
const defaultTitle = "Bargraph"
|
const (
|
||||||
|
defaultFocusable = false
|
||||||
|
defaultTitle = "Bargraph"
|
||||||
|
)
|
||||||
|
|
||||||
type Settings struct {
|
type Settings struct {
|
||||||
common *cfg.Common
|
common *cfg.Common
|
||||||
@ -13,7 +16,7 @@ type Settings struct {
|
|||||||
|
|
||||||
func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *config.Config) *Settings {
|
func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *config.Config) *Settings {
|
||||||
settings := Settings{
|
settings := Settings{
|
||||||
common: cfg.NewCommonSettingsFromModule(name, defaultTitle, ymlConfig, globalConfig),
|
common: cfg.NewCommonSettingsFromModule(name, defaultTitle, defaultFocusable, ymlConfig, globalConfig),
|
||||||
}
|
}
|
||||||
|
|
||||||
return &settings
|
return &settings
|
||||||
|
@ -12,8 +12,10 @@ import (
|
|||||||
"github.com/wtfutil/wtf/view"
|
"github.com/wtfutil/wtf/view"
|
||||||
)
|
)
|
||||||
|
|
||||||
var started = false
|
var (
|
||||||
var ok = true
|
ok = true
|
||||||
|
started = false
|
||||||
|
)
|
||||||
|
|
||||||
// Widget define wtf widget to register widget later
|
// Widget define wtf widget to register widget later
|
||||||
type Widget struct {
|
type Widget struct {
|
||||||
@ -25,7 +27,7 @@ type Widget struct {
|
|||||||
// NewWidget Make new instance of widget
|
// NewWidget Make new instance of widget
|
||||||
func NewWidget(app *tview.Application, settings *Settings) *Widget {
|
func NewWidget(app *tview.Application, settings *Settings) *Widget {
|
||||||
widget := Widget{
|
widget := Widget{
|
||||||
BarGraph: view.NewBarGraph(app, "Sample Bar Graph", settings.common, false),
|
BarGraph: view.NewBarGraph(app, "Sample Bar Graph", settings.common),
|
||||||
|
|
||||||
app: app,
|
app: app,
|
||||||
}
|
}
|
||||||
|
@ -7,7 +7,10 @@ import (
|
|||||||
"github.com/wtfutil/wtf/cfg"
|
"github.com/wtfutil/wtf/cfg"
|
||||||
)
|
)
|
||||||
|
|
||||||
const defaultTitle = "CircleCI"
|
const (
|
||||||
|
defaultFocusable = false
|
||||||
|
defaultTitle = "CircleCI"
|
||||||
|
)
|
||||||
|
|
||||||
type Settings struct {
|
type Settings struct {
|
||||||
common *cfg.Common
|
common *cfg.Common
|
||||||
@ -18,7 +21,7 @@ type Settings struct {
|
|||||||
func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *config.Config) *Settings {
|
func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *config.Config) *Settings {
|
||||||
|
|
||||||
settings := 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_CIRCLE_API_KEY"))),
|
apiKey: ymlConfig.UString("apiKey", ymlConfig.UString("apikey", os.Getenv("WTF_CIRCLE_API_KEY"))),
|
||||||
}
|
}
|
||||||
|
@ -16,7 +16,7 @@ type Widget struct {
|
|||||||
|
|
||||||
func NewWidget(app *tview.Application, settings *Settings) *Widget {
|
func NewWidget(app *tview.Application, settings *Settings) *Widget {
|
||||||
widget := Widget{
|
widget := Widget{
|
||||||
TextWidget: view.NewTextWidget(app, settings.common, false),
|
TextWidget: view.NewTextWidget(app, settings.common),
|
||||||
Client: NewClient(settings.apiKey),
|
Client: NewClient(settings.apiKey),
|
||||||
|
|
||||||
settings: settings,
|
settings: settings,
|
||||||
|
@ -6,7 +6,10 @@ import (
|
|||||||
"github.com/wtfutil/wtf/utils"
|
"github.com/wtfutil/wtf/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
const defaultTitle = "Clocks"
|
const (
|
||||||
|
defaultFocusable = false
|
||||||
|
defaultTitle = "Clocks"
|
||||||
|
)
|
||||||
|
|
||||||
type colors struct {
|
type colors struct {
|
||||||
rows struct {
|
rows struct {
|
||||||
@ -26,9 +29,8 @@ type Settings struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *config.Config) *Settings {
|
func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *config.Config) *Settings {
|
||||||
|
|
||||||
settings := Settings{
|
settings := Settings{
|
||||||
common: cfg.NewCommonSettingsFromModule(name, defaultTitle, ymlConfig, globalConfig),
|
common: cfg.NewCommonSettingsFromModule(name, defaultTitle, defaultFocusable, ymlConfig, globalConfig),
|
||||||
|
|
||||||
dateFormat: ymlConfig.UString("dateFormat", utils.SimpleDateFormat),
|
dateFormat: ymlConfig.UString("dateFormat", utils.SimpleDateFormat),
|
||||||
timeFormat: ymlConfig.UString("timeFormat", utils.SimpleTimeFormat),
|
timeFormat: ymlConfig.UString("timeFormat", utils.SimpleTimeFormat),
|
||||||
|
@ -20,7 +20,7 @@ type Widget struct {
|
|||||||
|
|
||||||
func NewWidget(app *tview.Application, settings *Settings) *Widget {
|
func NewWidget(app *tview.Application, settings *Settings) *Widget {
|
||||||
widget := Widget{
|
widget := Widget{
|
||||||
TextWidget: view.NewTextWidget(app, settings.common, false),
|
TextWidget: view.NewTextWidget(app, settings.common),
|
||||||
|
|
||||||
app: app,
|
app: app,
|
||||||
settings: settings,
|
settings: settings,
|
||||||
|
@ -6,7 +6,10 @@ import (
|
|||||||
"github.com/wtfutil/wtf/utils"
|
"github.com/wtfutil/wtf/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
const defaultTitle = "CmdRunner"
|
const (
|
||||||
|
defaultFocusable = false
|
||||||
|
defaultTitle = "CmdRunner"
|
||||||
|
)
|
||||||
|
|
||||||
type Settings struct {
|
type Settings struct {
|
||||||
common *cfg.Common
|
common *cfg.Common
|
||||||
@ -18,7 +21,7 @@ type Settings struct {
|
|||||||
func NewSettingsFromYAML(name string, moduleConfig *config.Config, globalConfig *config.Config) *Settings {
|
func NewSettingsFromYAML(name string, moduleConfig *config.Config, globalConfig *config.Config) *Settings {
|
||||||
|
|
||||||
settings := Settings{
|
settings := Settings{
|
||||||
common: cfg.NewCommonSettingsFromModule(name, defaultTitle, moduleConfig, globalConfig),
|
common: cfg.NewCommonSettingsFromModule(name, defaultTitle, defaultFocusable, moduleConfig, globalConfig),
|
||||||
|
|
||||||
args: utils.ToStrs(moduleConfig.UList("args")),
|
args: utils.ToStrs(moduleConfig.UList("args")),
|
||||||
cmd: moduleConfig.UString("cmd"),
|
cmd: moduleConfig.UString("cmd"),
|
||||||
|
@ -21,7 +21,7 @@ type Widget struct {
|
|||||||
// NewWidget creates a new instance of the widget
|
// NewWidget creates a new instance of the widget
|
||||||
func NewWidget(app *tview.Application, settings *Settings) *Widget {
|
func NewWidget(app *tview.Application, settings *Settings) *Widget {
|
||||||
widget := Widget{
|
widget := Widget{
|
||||||
TextWidget: view.NewTextWidget(app, settings.common, false),
|
TextWidget: view.NewTextWidget(app, settings.common),
|
||||||
|
|
||||||
args: settings.args,
|
args: settings.args,
|
||||||
cmd: settings.cmd,
|
cmd: settings.cmd,
|
||||||
|
@ -5,7 +5,10 @@ import (
|
|||||||
"github.com/wtfutil/wtf/cfg"
|
"github.com/wtfutil/wtf/cfg"
|
||||||
)
|
)
|
||||||
|
|
||||||
const defaultTitle = "Bittrex"
|
const (
|
||||||
|
defaultFocusable = false
|
||||||
|
defaultTitle = "Bittrex"
|
||||||
|
)
|
||||||
|
|
||||||
type colors struct {
|
type colors struct {
|
||||||
base struct {
|
base struct {
|
||||||
@ -37,7 +40,7 @@ type Settings struct {
|
|||||||
func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *config.Config) *Settings {
|
func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *config.Config) *Settings {
|
||||||
|
|
||||||
settings := Settings{
|
settings := Settings{
|
||||||
common: cfg.NewCommonSettingsFromModule(name, defaultTitle, ymlConfig, globalConfig),
|
common: cfg.NewCommonSettingsFromModule(name, defaultTitle, defaultFocusable, ymlConfig, globalConfig),
|
||||||
}
|
}
|
||||||
|
|
||||||
settings.colors.base.name = ymlConfig.UString("colors.base.name")
|
settings.colors.base.name = ymlConfig.UString("colors.base.name")
|
||||||
|
@ -11,10 +11,14 @@ import (
|
|||||||
"github.com/wtfutil/wtf/view"
|
"github.com/wtfutil/wtf/view"
|
||||||
)
|
)
|
||||||
|
|
||||||
var ok = true
|
const (
|
||||||
var errorText = ""
|
baseURL = "https://bittrex.com/api/v1.1/public/getmarketsummary"
|
||||||
|
)
|
||||||
|
|
||||||
const baseURL = "https://bittrex.com/api/v1.1/public/getmarketsummary"
|
var (
|
||||||
|
errorText = ""
|
||||||
|
ok = true
|
||||||
|
)
|
||||||
|
|
||||||
// Widget define wtf widget to register widget later
|
// Widget define wtf widget to register widget later
|
||||||
type Widget struct {
|
type Widget struct {
|
||||||
@ -27,7 +31,7 @@ type Widget struct {
|
|||||||
// NewWidget Make new instance of widget
|
// NewWidget Make new instance of widget
|
||||||
func NewWidget(app *tview.Application, settings *Settings) *Widget {
|
func NewWidget(app *tview.Application, settings *Settings) *Widget {
|
||||||
widget := Widget{
|
widget := Widget{
|
||||||
TextWidget: view.NewTextWidget(app, settings.common, false),
|
TextWidget: view.NewTextWidget(app, settings.common),
|
||||||
|
|
||||||
settings: settings,
|
settings: settings,
|
||||||
summaryList: summaryList{},
|
summaryList: summaryList{},
|
||||||
|
@ -5,7 +5,10 @@ import (
|
|||||||
"github.com/wtfutil/wtf/cfg"
|
"github.com/wtfutil/wtf/cfg"
|
||||||
)
|
)
|
||||||
|
|
||||||
const defaultTitle = "Blockfolio"
|
const (
|
||||||
|
defaultFocusable = false
|
||||||
|
defaultTitle = "Blockfolio"
|
||||||
|
)
|
||||||
|
|
||||||
type colors struct {
|
type colors struct {
|
||||||
name string
|
name string
|
||||||
@ -24,7 +27,7 @@ type Settings struct {
|
|||||||
func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *config.Config) *Settings {
|
func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *config.Config) *Settings {
|
||||||
|
|
||||||
settings := Settings{
|
settings := Settings{
|
||||||
common: cfg.NewCommonSettingsFromModule(name, defaultTitle, ymlConfig, globalConfig),
|
common: cfg.NewCommonSettingsFromModule(name, defaultTitle, defaultFocusable, ymlConfig, globalConfig),
|
||||||
|
|
||||||
deviceToken: ymlConfig.UString("device_token"),
|
deviceToken: ymlConfig.UString("device_token"),
|
||||||
displayHoldings: ymlConfig.UBool("displayHoldings", true),
|
displayHoldings: ymlConfig.UBool("displayHoldings", true),
|
||||||
|
@ -20,7 +20,7 @@ type Widget struct {
|
|||||||
|
|
||||||
func NewWidget(app *tview.Application, settings *Settings) *Widget {
|
func NewWidget(app *tview.Application, settings *Settings) *Widget {
|
||||||
widget := Widget{
|
widget := Widget{
|
||||||
TextWidget: view.NewTextWidget(app, settings.common, false),
|
TextWidget: view.NewTextWidget(app, settings.common),
|
||||||
|
|
||||||
device_token: settings.deviceToken,
|
device_token: settings.deviceToken,
|
||||||
settings: settings,
|
settings: settings,
|
||||||
|
@ -5,7 +5,10 @@ import (
|
|||||||
"github.com/wtfutil/wtf/cfg"
|
"github.com/wtfutil/wtf/cfg"
|
||||||
)
|
)
|
||||||
|
|
||||||
const defaultTitle = "CryptoLive"
|
const (
|
||||||
|
defaultFocusable = false
|
||||||
|
defaultTitle = "CryptoLive"
|
||||||
|
)
|
||||||
|
|
||||||
type colors struct {
|
type colors struct {
|
||||||
from struct {
|
from struct {
|
||||||
@ -43,7 +46,7 @@ type Settings struct {
|
|||||||
func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *config.Config) *Settings {
|
func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *config.Config) *Settings {
|
||||||
|
|
||||||
settings := Settings{
|
settings := Settings{
|
||||||
common: cfg.NewCommonSettingsFromModule(name, defaultTitle, ymlConfig, globalConfig),
|
common: cfg.NewCommonSettingsFromModule(name, defaultTitle, defaultFocusable, ymlConfig, globalConfig),
|
||||||
}
|
}
|
||||||
|
|
||||||
settings.colors.from.name = ymlConfig.UString("colors.from.name")
|
settings.colors.from.name = ymlConfig.UString("colors.from.name")
|
||||||
|
@ -7,7 +7,10 @@ import (
|
|||||||
"github.com/wtfutil/wtf/modules/cryptoexchanges/cryptolive/toplist"
|
"github.com/wtfutil/wtf/modules/cryptoexchanges/cryptolive/toplist"
|
||||||
)
|
)
|
||||||
|
|
||||||
const defaultTitle = "CryptolLive"
|
const (
|
||||||
|
defaultFocusable = false
|
||||||
|
defaultTitle = "CryptolLive"
|
||||||
|
)
|
||||||
|
|
||||||
type colors struct {
|
type colors struct {
|
||||||
from struct {
|
from struct {
|
||||||
@ -43,12 +46,11 @@ type Settings struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *config.Config) *Settings {
|
func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *config.Config) *Settings {
|
||||||
|
|
||||||
currencies, _ := ymlConfig.Map("currencies")
|
currencies, _ := ymlConfig.Map("currencies")
|
||||||
top, _ := ymlConfig.Map("top")
|
top, _ := ymlConfig.Map("top")
|
||||||
|
|
||||||
settings := Settings{
|
settings := Settings{
|
||||||
common: cfg.NewCommonSettingsFromModule(name, defaultTitle, ymlConfig, globalConfig),
|
common: cfg.NewCommonSettingsFromModule(name, defaultTitle, defaultFocusable, ymlConfig, globalConfig),
|
||||||
|
|
||||||
currencies: currencies,
|
currencies: currencies,
|
||||||
top: top,
|
top: top,
|
||||||
|
@ -5,7 +5,10 @@ import (
|
|||||||
"github.com/wtfutil/wtf/cfg"
|
"github.com/wtfutil/wtf/cfg"
|
||||||
)
|
)
|
||||||
|
|
||||||
const defaultTitle = "CryptoLive"
|
const (
|
||||||
|
defaultFocusable = false
|
||||||
|
defaultTitle = "CryptoLive"
|
||||||
|
)
|
||||||
|
|
||||||
type colors struct {
|
type colors struct {
|
||||||
from struct {
|
from struct {
|
||||||
@ -44,7 +47,7 @@ type Settings struct {
|
|||||||
func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *config.Config) *Settings {
|
func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *config.Config) *Settings {
|
||||||
|
|
||||||
settings := Settings{
|
settings := Settings{
|
||||||
common: cfg.NewCommonSettingsFromModule(name, defaultTitle, ymlConfig, globalConfig),
|
common: cfg.NewCommonSettingsFromModule(name, defaultTitle, defaultFocusable, ymlConfig, globalConfig),
|
||||||
}
|
}
|
||||||
|
|
||||||
settings.colors.from.name = ymlConfig.UString("colors.from.name")
|
settings.colors.from.name = ymlConfig.UString("colors.from.name")
|
||||||
|
@ -22,7 +22,7 @@ type Widget struct {
|
|||||||
// NewWidget Make new instance of widget
|
// NewWidget Make new instance of widget
|
||||||
func NewWidget(app *tview.Application, settings *Settings) *Widget {
|
func NewWidget(app *tview.Application, settings *Settings) *Widget {
|
||||||
widget := Widget{
|
widget := Widget{
|
||||||
TextWidget: view.NewTextWidget(app, settings.common, false),
|
TextWidget: view.NewTextWidget(app, settings.common),
|
||||||
|
|
||||||
priceWidget: price.NewWidget(settings.priceSettings),
|
priceWidget: price.NewWidget(settings.priceSettings),
|
||||||
toplistWidget: toplist.NewWidget(settings.toplistSettings),
|
toplistWidget: toplist.NewWidget(settings.toplistSettings),
|
||||||
|
@ -7,7 +7,10 @@ import (
|
|||||||
"github.com/wtfutil/wtf/cfg"
|
"github.com/wtfutil/wtf/cfg"
|
||||||
)
|
)
|
||||||
|
|
||||||
const defaultTitle = "DataDog"
|
const (
|
||||||
|
defaultFocusable = true
|
||||||
|
defaultTitle = "DataDog"
|
||||||
|
)
|
||||||
|
|
||||||
type Settings struct {
|
type Settings struct {
|
||||||
common *cfg.Common
|
common *cfg.Common
|
||||||
@ -20,7 +23,7 @@ type Settings struct {
|
|||||||
func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *config.Config) *Settings {
|
func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *config.Config) *Settings {
|
||||||
|
|
||||||
settings := 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_DATADOG_API_KEY"))),
|
apiKey: ymlConfig.UString("apiKey", ymlConfig.UString("apikey", os.Getenv("WTF_DATADOG_API_KEY"))),
|
||||||
applicationKey: ymlConfig.UString("applicationKey", os.Getenv("WTF_DATADOG_APPLICATION_KEY")),
|
applicationKey: ymlConfig.UString("applicationKey", os.Getenv("WTF_DATADOG_APPLICATION_KEY")),
|
||||||
|
@ -21,7 +21,7 @@ type Widget struct {
|
|||||||
func NewWidget(app *tview.Application, pages *tview.Pages, settings *Settings) *Widget {
|
func NewWidget(app *tview.Application, pages *tview.Pages, settings *Settings) *Widget {
|
||||||
widget := Widget{
|
widget := Widget{
|
||||||
KeyboardWidget: view.NewKeyboardWidget(app, pages, settings.common),
|
KeyboardWidget: view.NewKeyboardWidget(app, pages, settings.common),
|
||||||
ScrollableWidget: view.NewScrollableWidget(app, settings.common, true),
|
ScrollableWidget: view.NewScrollableWidget(app, settings.common),
|
||||||
|
|
||||||
settings: settings,
|
settings: settings,
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,10 @@ import (
|
|||||||
"github.com/wtfutil/wtf/cfg"
|
"github.com/wtfutil/wtf/cfg"
|
||||||
)
|
)
|
||||||
|
|
||||||
const defaultTitle = "dev.to | News Feed"
|
const (
|
||||||
|
defaultFocusable = true
|
||||||
|
defaultTitle = "dev.to | News Feed"
|
||||||
|
)
|
||||||
|
|
||||||
// Settings defines the configuration options for this module
|
// Settings defines the configuration options for this module
|
||||||
type Settings struct {
|
type Settings struct {
|
||||||
@ -21,7 +24,7 @@ type Settings struct {
|
|||||||
// NewSettingsFromYAML creates and returns an instance of Settings with configuration options populated
|
// NewSettingsFromYAML creates and returns an instance of Settings with configuration options populated
|
||||||
func NewSettingsFromYAML(name string, yamlConfig *config.Config, globalConfig *config.Config) *Settings {
|
func NewSettingsFromYAML(name string, yamlConfig *config.Config, globalConfig *config.Config) *Settings {
|
||||||
settings := Settings{
|
settings := Settings{
|
||||||
common: cfg.NewCommonSettingsFromModule(name, defaultTitle, yamlConfig, globalConfig),
|
common: cfg.NewCommonSettingsFromModule(name, defaultTitle, defaultFocusable, yamlConfig, globalConfig),
|
||||||
numberOfArticles: yamlConfig.UInt("numberOfArticles", 10),
|
numberOfArticles: yamlConfig.UInt("numberOfArticles", 10),
|
||||||
contentTag: yamlConfig.UString("contentTag", ""),
|
contentTag: yamlConfig.UString("contentTag", ""),
|
||||||
contentUsername: yamlConfig.UString("contentUsername", ""),
|
contentUsername: yamlConfig.UString("contentUsername", ""),
|
||||||
|
@ -22,7 +22,7 @@ type Widget struct {
|
|||||||
func NewWidget(app *tview.Application, pages *tview.Pages, settings *Settings) *Widget {
|
func NewWidget(app *tview.Application, pages *tview.Pages, settings *Settings) *Widget {
|
||||||
widget := &Widget{
|
widget := &Widget{
|
||||||
KeyboardWidget: view.NewKeyboardWidget(app, pages, settings.common),
|
KeyboardWidget: view.NewKeyboardWidget(app, pages, settings.common),
|
||||||
ScrollableWidget: view.NewScrollableWidget(app, settings.common, true),
|
ScrollableWidget: view.NewScrollableWidget(app, settings.common),
|
||||||
|
|
||||||
settings: settings,
|
settings: settings,
|
||||||
}
|
}
|
||||||
|
@ -5,7 +5,10 @@ import (
|
|||||||
"github.com/wtfutil/wtf/cfg"
|
"github.com/wtfutil/wtf/cfg"
|
||||||
)
|
)
|
||||||
|
|
||||||
const defaultTitle = "Clocks"
|
const (
|
||||||
|
defaultFocusable = false
|
||||||
|
defaultTitle = "Clocks"
|
||||||
|
)
|
||||||
|
|
||||||
// Settings struct to define settings got digital clock
|
// Settings struct to define settings got digital clock
|
||||||
type Settings struct {
|
type Settings struct {
|
||||||
@ -21,7 +24,7 @@ type Settings struct {
|
|||||||
func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *config.Config) *Settings {
|
func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *config.Config) *Settings {
|
||||||
|
|
||||||
settings := Settings{
|
settings := Settings{
|
||||||
common: cfg.NewCommonSettingsFromModule(name, defaultTitle, ymlConfig, globalConfig),
|
common: cfg.NewCommonSettingsFromModule(name, defaultTitle, defaultFocusable, ymlConfig, globalConfig),
|
||||||
color: ymlConfig.UString("color"),
|
color: ymlConfig.UString("color"),
|
||||||
font: ymlConfig.UString("font"),
|
font: ymlConfig.UString("font"),
|
||||||
hourFormat: ymlConfig.UString("hourFormat"),
|
hourFormat: ymlConfig.UString("hourFormat"),
|
||||||
|
@ -17,7 +17,7 @@ type Widget struct {
|
|||||||
func NewWidget(app *tview.Application, settings *Settings) *Widget {
|
func NewWidget(app *tview.Application, settings *Settings) *Widget {
|
||||||
|
|
||||||
widget := Widget{
|
widget := Widget{
|
||||||
TextWidget: view.NewTextWidget(app, settings.common, false),
|
TextWidget: view.NewTextWidget(app, settings.common),
|
||||||
|
|
||||||
app: app,
|
app: app,
|
||||||
settings: settings,
|
settings: settings,
|
||||||
|
@ -5,7 +5,10 @@ import (
|
|||||||
"github.com/wtfutil/wtf/cfg"
|
"github.com/wtfutil/wtf/cfg"
|
||||||
)
|
)
|
||||||
|
|
||||||
const defaultTitle = "docker"
|
const (
|
||||||
|
defaultFocusable = false
|
||||||
|
defaultTitle = "docker"
|
||||||
|
)
|
||||||
|
|
||||||
// Settings defines the configuration options for this module
|
// Settings defines the configuration options for this module
|
||||||
type Settings struct {
|
type Settings struct {
|
||||||
@ -16,7 +19,7 @@ type Settings struct {
|
|||||||
// NewSettingsFromYAML creates and returns an instance of Settings with configuration options populated
|
// NewSettingsFromYAML creates and returns an instance of Settings with configuration options populated
|
||||||
func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *config.Config) *Settings {
|
func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *config.Config) *Settings {
|
||||||
settings := Settings{
|
settings := Settings{
|
||||||
common: cfg.NewCommonSettingsFromModule(name, defaultTitle, ymlConfig, globalConfig),
|
common: cfg.NewCommonSettingsFromModule(name, defaultTitle, defaultFocusable, ymlConfig, globalConfig),
|
||||||
labelColor: ymlConfig.UString("labelColor", "white"),
|
labelColor: ymlConfig.UString("labelColor", "white"),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@ type Widget struct {
|
|||||||
|
|
||||||
func NewWidget(app *tview.Application, pages *tview.Pages, settings *Settings) *Widget {
|
func NewWidget(app *tview.Application, pages *tview.Pages, settings *Settings) *Widget {
|
||||||
widget := Widget{
|
widget := Widget{
|
||||||
TextWidget: view.NewTextWidget(app, settings.common, false),
|
TextWidget: view.NewTextWidget(app, settings.common),
|
||||||
settings: settings,
|
settings: settings,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7,6 +7,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
defaultFocusable = true
|
||||||
defaultTitle = "Feed Reader"
|
defaultTitle = "Feed Reader"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -21,7 +22,7 @@ type Settings struct {
|
|||||||
// NewSettingsFromYAML creates a new settings instance from a YAML config block
|
// NewSettingsFromYAML creates a new settings instance from a YAML config block
|
||||||
func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *config.Config) *Settings {
|
func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *config.Config) *Settings {
|
||||||
settings := &Settings{
|
settings := &Settings{
|
||||||
common: cfg.NewCommonSettingsFromModule(name, defaultTitle, ymlConfig, globalConfig),
|
common: cfg.NewCommonSettingsFromModule(name, defaultTitle, defaultFocusable, ymlConfig, globalConfig),
|
||||||
|
|
||||||
feeds: utils.ToStrs(ymlConfig.UList("feeds")),
|
feeds: utils.ToStrs(ymlConfig.UList("feeds")),
|
||||||
feedLimit: ymlConfig.UInt("feedLimit", -1),
|
feedLimit: ymlConfig.UInt("feedLimit", -1),
|
||||||
|
@ -36,7 +36,7 @@ type Widget struct {
|
|||||||
func NewWidget(app *tview.Application, pages *tview.Pages, settings *Settings) *Widget {
|
func NewWidget(app *tview.Application, pages *tview.Pages, settings *Settings) *Widget {
|
||||||
widget := &Widget{
|
widget := &Widget{
|
||||||
KeyboardWidget: view.NewKeyboardWidget(app, pages, settings.common),
|
KeyboardWidget: view.NewKeyboardWidget(app, pages, settings.common),
|
||||||
ScrollableWidget: view.NewScrollableWidget(app, settings.common, true),
|
ScrollableWidget: view.NewScrollableWidget(app, settings.common),
|
||||||
|
|
||||||
parser: gofeed.NewParser(),
|
parser: gofeed.NewParser(),
|
||||||
settings: settings,
|
settings: settings,
|
||||||
|
@ -5,7 +5,10 @@ import (
|
|||||||
"github.com/wtfutil/wtf/cfg"
|
"github.com/wtfutil/wtf/cfg"
|
||||||
)
|
)
|
||||||
|
|
||||||
const defaultTitle = "Calendar"
|
const (
|
||||||
|
defaultFocusable = true
|
||||||
|
defaultTitle = "Calendar"
|
||||||
|
)
|
||||||
|
|
||||||
type colors struct {
|
type colors struct {
|
||||||
day string
|
day string
|
||||||
@ -37,9 +40,8 @@ type Settings struct {
|
|||||||
|
|
||||||
// NewSettingsFromYAML creates and returns an instance of Settings with configuration options populated
|
// NewSettingsFromYAML creates and returns an instance of Settings with configuration options populated
|
||||||
func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *config.Config) *Settings {
|
func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *config.Config) *Settings {
|
||||||
|
|
||||||
settings := Settings{
|
settings := Settings{
|
||||||
common: cfg.NewCommonSettingsFromModule(name, defaultTitle, ymlConfig, globalConfig),
|
common: cfg.NewCommonSettingsFromModule(name, defaultTitle, defaultFocusable, ymlConfig, globalConfig),
|
||||||
|
|
||||||
conflictIcon: ymlConfig.UString("conflictIcon", "🚨"),
|
conflictIcon: ymlConfig.UString("conflictIcon", "🚨"),
|
||||||
currentIcon: ymlConfig.UString("currentIcon", "🔸"),
|
currentIcon: ymlConfig.UString("currentIcon", "🔸"),
|
||||||
|
@ -16,7 +16,7 @@ type Widget struct {
|
|||||||
|
|
||||||
func NewWidget(app *tview.Application, settings *Settings) *Widget {
|
func NewWidget(app *tview.Application, settings *Settings) *Widget {
|
||||||
widget := Widget{
|
widget := Widget{
|
||||||
TextWidget: view.NewTextWidget(app, settings.common, true),
|
TextWidget: view.NewTextWidget(app, settings.common),
|
||||||
|
|
||||||
app: app,
|
app: app,
|
||||||
settings: settings,
|
settings: settings,
|
||||||
|
@ -7,6 +7,11 @@ import (
|
|||||||
"github.com/wtfutil/wtf/cfg"
|
"github.com/wtfutil/wtf/cfg"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
defaultFocusable = true
|
||||||
|
defaultTitle = "Gerrit"
|
||||||
|
)
|
||||||
|
|
||||||
type colors struct {
|
type colors struct {
|
||||||
rows struct {
|
rows struct {
|
||||||
even string `help:"Define the foreground color for even-numbered rows." values:"Any X11 color name." optional:"true"`
|
even string `help:"Define the foreground color for even-numbered rows." values:"Any X11 color name." optional:"true"`
|
||||||
@ -14,8 +19,6 @@ type colors struct {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const defaultTitle = "Gerrit"
|
|
||||||
|
|
||||||
type Settings struct {
|
type Settings struct {
|
||||||
colors
|
colors
|
||||||
common *cfg.Common
|
common *cfg.Common
|
||||||
@ -28,9 +31,8 @@ type Settings struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *config.Config) *Settings {
|
func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *config.Config) *Settings {
|
||||||
|
|
||||||
settings := Settings{
|
settings := Settings{
|
||||||
common: cfg.NewCommonSettingsFromModule(name, defaultTitle, ymlConfig, globalConfig),
|
common: cfg.NewCommonSettingsFromModule(name, defaultTitle, defaultFocusable, ymlConfig, globalConfig),
|
||||||
|
|
||||||
domain: ymlConfig.UString("domain", ""),
|
domain: ymlConfig.UString("domain", ""),
|
||||||
password: ymlConfig.UString("password", os.Getenv("WTF_GERRIT_PASSWORD")),
|
password: ymlConfig.UString("password", os.Getenv("WTF_GERRIT_PASSWORD")),
|
||||||
|
@ -33,7 +33,7 @@ var (
|
|||||||
func NewWidget(app *tview.Application, pages *tview.Pages, settings *Settings) *Widget {
|
func NewWidget(app *tview.Application, pages *tview.Pages, settings *Settings) *Widget {
|
||||||
widget := Widget{
|
widget := Widget{
|
||||||
KeyboardWidget: view.NewKeyboardWidget(app, pages, settings.common),
|
KeyboardWidget: view.NewKeyboardWidget(app, pages, settings.common),
|
||||||
TextWidget: view.NewTextWidget(app, settings.common, true),
|
TextWidget: view.NewTextWidget(app, settings.common),
|
||||||
|
|
||||||
Idx: 0,
|
Idx: 0,
|
||||||
|
|
||||||
|
@ -6,7 +6,10 @@ import (
|
|||||||
"github.com/wtfutil/wtf/utils"
|
"github.com/wtfutil/wtf/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
const defaultTitle = "Git"
|
const (
|
||||||
|
defaultFocusable = true
|
||||||
|
defaultTitle = "Git"
|
||||||
|
)
|
||||||
|
|
||||||
type Settings struct {
|
type Settings struct {
|
||||||
common *cfg.Common
|
common *cfg.Common
|
||||||
@ -18,9 +21,8 @@ type Settings struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *config.Config) *Settings {
|
func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *config.Config) *Settings {
|
||||||
|
|
||||||
settings := Settings{
|
settings := Settings{
|
||||||
common: cfg.NewCommonSettingsFromModule(name, defaultTitle, ymlConfig, globalConfig),
|
common: cfg.NewCommonSettingsFromModule(name, defaultTitle, defaultFocusable, ymlConfig, globalConfig),
|
||||||
|
|
||||||
commitCount: ymlConfig.UInt("commitCount", 10),
|
commitCount: ymlConfig.UInt("commitCount", 10),
|
||||||
commitFormat: ymlConfig.UString("commitFormat", "[forestgreen]%h [white]%s [grey]%an on %cd[white]"),
|
commitFormat: ymlConfig.UString("commitFormat", "[forestgreen]%h [white]%s [grey]%an on %cd[white]"),
|
||||||
|
@ -11,9 +11,11 @@ import (
|
|||||||
"github.com/wtfutil/wtf/view"
|
"github.com/wtfutil/wtf/view"
|
||||||
)
|
)
|
||||||
|
|
||||||
const offscreen = -1000
|
const (
|
||||||
const modalWidth = 80
|
modalHeight = 7
|
||||||
const modalHeight = 7
|
modalWidth = 80
|
||||||
|
offscreen = -1000
|
||||||
|
)
|
||||||
|
|
||||||
type Widget struct {
|
type Widget struct {
|
||||||
view.KeyboardWidget
|
view.KeyboardWidget
|
||||||
@ -31,7 +33,7 @@ func NewWidget(app *tview.Application, pages *tview.Pages, settings *Settings) *
|
|||||||
widget := Widget{
|
widget := Widget{
|
||||||
KeyboardWidget: view.NewKeyboardWidget(app, pages, settings.common),
|
KeyboardWidget: view.NewKeyboardWidget(app, pages, settings.common),
|
||||||
MultiSourceWidget: view.NewMultiSourceWidget(settings.common, "repository", "repositories"),
|
MultiSourceWidget: view.NewMultiSourceWidget(settings.common, "repository", "repositories"),
|
||||||
TextWidget: view.NewTextWidget(app, settings.common, true),
|
TextWidget: view.NewTextWidget(app, settings.common),
|
||||||
|
|
||||||
app: app,
|
app: app,
|
||||||
pages: pages,
|
pages: pages,
|
||||||
|
@ -7,7 +7,10 @@ import (
|
|||||||
"github.com/wtfutil/wtf/cfg"
|
"github.com/wtfutil/wtf/cfg"
|
||||||
)
|
)
|
||||||
|
|
||||||
const defaultTitle = "GitHub"
|
const (
|
||||||
|
defaultFocusable = true
|
||||||
|
defaultTitle = "GitHub"
|
||||||
|
)
|
||||||
|
|
||||||
// Settings defines the configuration properties for this module
|
// Settings defines the configuration properties for this module
|
||||||
type Settings struct {
|
type Settings struct {
|
||||||
@ -30,9 +33,8 @@ type customQuery struct {
|
|||||||
|
|
||||||
// NewSettingsFromYAML creates a new settings instance from a YAML config block
|
// NewSettingsFromYAML creates a new settings instance from a YAML config block
|
||||||
func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *config.Config) *Settings {
|
func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *config.Config) *Settings {
|
||||||
|
|
||||||
settings := 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_GITHUB_TOKEN"))),
|
apiKey: ymlConfig.UString("apiKey", ymlConfig.UString("apikey", os.Getenv("WTF_GITHUB_TOKEN"))),
|
||||||
baseURL: ymlConfig.UString("baseURL", os.Getenv("WTF_GITHUB_BASE_URL")),
|
baseURL: ymlConfig.UString("baseURL", os.Getenv("WTF_GITHUB_BASE_URL")),
|
||||||
|
@ -28,7 +28,7 @@ func NewWidget(app *tview.Application, pages *tview.Pages, settings *Settings) *
|
|||||||
widget := Widget{
|
widget := Widget{
|
||||||
KeyboardWidget: view.NewKeyboardWidget(app, pages, settings.common),
|
KeyboardWidget: view.NewKeyboardWidget(app, pages, settings.common),
|
||||||
MultiSourceWidget: view.NewMultiSourceWidget(settings.common, "repository", "repositories"),
|
MultiSourceWidget: view.NewMultiSourceWidget(settings.common, "repository", "repositories"),
|
||||||
TextWidget: view.NewTextWidget(app, settings.common, true),
|
TextWidget: view.NewTextWidget(app, settings.common),
|
||||||
|
|
||||||
settings: settings,
|
settings: settings,
|
||||||
}
|
}
|
||||||
|
@ -7,7 +7,10 @@ import (
|
|||||||
"github.com/wtfutil/wtf/cfg"
|
"github.com/wtfutil/wtf/cfg"
|
||||||
)
|
)
|
||||||
|
|
||||||
const defaultTitle = "GitLab"
|
const (
|
||||||
|
defaultFocusable = true
|
||||||
|
defaultTitle = "GitLab"
|
||||||
|
)
|
||||||
|
|
||||||
// Settings defines the configuration properties for this module
|
// Settings defines the configuration properties for this module
|
||||||
type Settings struct {
|
type Settings struct {
|
||||||
@ -22,7 +25,7 @@ type Settings struct {
|
|||||||
// NewSettingsFromYAML creates a new settings instance from a YAML config block
|
// NewSettingsFromYAML creates a new settings instance from a YAML config block
|
||||||
func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *config.Config) *Settings {
|
func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *config.Config) *Settings {
|
||||||
settings := 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_GITLAB_TOKEN"))),
|
apiKey: ymlConfig.UString("apiKey", ymlConfig.UString("apikey", os.Getenv("WTF_GITLAB_TOKEN"))),
|
||||||
domain: ymlConfig.UString("domain"),
|
domain: ymlConfig.UString("domain"),
|
||||||
|
@ -28,7 +28,7 @@ func NewWidget(app *tview.Application, pages *tview.Pages, settings *Settings) *
|
|||||||
widget := Widget{
|
widget := Widget{
|
||||||
KeyboardWidget: view.NewKeyboardWidget(app, pages, settings.common),
|
KeyboardWidget: view.NewKeyboardWidget(app, pages, settings.common),
|
||||||
MultiSourceWidget: view.NewMultiSourceWidget(settings.common, "repository", "repositories"),
|
MultiSourceWidget: view.NewMultiSourceWidget(settings.common, "repository", "repositories"),
|
||||||
TextWidget: view.NewTextWidget(app, settings.common, true),
|
TextWidget: view.NewTextWidget(app, settings.common),
|
||||||
|
|
||||||
gitlab: gitlab,
|
gitlab: gitlab,
|
||||||
settings: settings,
|
settings: settings,
|
||||||
|
@ -7,7 +7,10 @@ import (
|
|||||||
"github.com/wtfutil/wtf/cfg"
|
"github.com/wtfutil/wtf/cfg"
|
||||||
)
|
)
|
||||||
|
|
||||||
const defaultTitle = "Gitter"
|
const (
|
||||||
|
defaultFocusable = true
|
||||||
|
defaultTitle = "Gitter"
|
||||||
|
)
|
||||||
|
|
||||||
type Settings struct {
|
type Settings struct {
|
||||||
common *cfg.Common
|
common *cfg.Common
|
||||||
@ -20,7 +23,7 @@ type Settings struct {
|
|||||||
func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *config.Config) *Settings {
|
func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *config.Config) *Settings {
|
||||||
|
|
||||||
settings := Settings{
|
settings := Settings{
|
||||||
common: cfg.NewCommonSettingsFromModule(name, defaultTitle, ymlConfig, globalConfig),
|
common: cfg.NewCommonSettingsFromModule(name, defaultTitle, defaultFocusable, ymlConfig, globalConfig),
|
||||||
|
|
||||||
apiToken: ymlConfig.UString("apiToken", os.Getenv("WTF_GITTER_API_TOKEN")),
|
apiToken: ymlConfig.UString("apiToken", os.Getenv("WTF_GITTER_API_TOKEN")),
|
||||||
numberOfMessages: ymlConfig.UInt("numberOfMessages", 10),
|
numberOfMessages: ymlConfig.UInt("numberOfMessages", 10),
|
||||||
|
@ -21,7 +21,7 @@ type Widget struct {
|
|||||||
func NewWidget(app *tview.Application, pages *tview.Pages, settings *Settings) *Widget {
|
func NewWidget(app *tview.Application, pages *tview.Pages, settings *Settings) *Widget {
|
||||||
widget := Widget{
|
widget := Widget{
|
||||||
KeyboardWidget: view.NewKeyboardWidget(app, pages, settings.common),
|
KeyboardWidget: view.NewKeyboardWidget(app, pages, settings.common),
|
||||||
ScrollableWidget: view.NewScrollableWidget(app, settings.common, true),
|
ScrollableWidget: view.NewScrollableWidget(app, settings.common),
|
||||||
|
|
||||||
settings: settings,
|
settings: settings,
|
||||||
}
|
}
|
||||||
|
@ -5,7 +5,10 @@ import (
|
|||||||
"github.com/wtfutil/wtf/cfg"
|
"github.com/wtfutil/wtf/cfg"
|
||||||
)
|
)
|
||||||
|
|
||||||
const defaultTitle = "Google Analytics"
|
const (
|
||||||
|
defaultFocusable = false
|
||||||
|
defaultTitle = "Google Analytics"
|
||||||
|
)
|
||||||
|
|
||||||
type Settings struct {
|
type Settings struct {
|
||||||
common *cfg.Common
|
common *cfg.Common
|
||||||
@ -19,7 +22,7 @@ type Settings struct {
|
|||||||
func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *config.Config) *Settings {
|
func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *config.Config) *Settings {
|
||||||
|
|
||||||
settings := Settings{
|
settings := Settings{
|
||||||
common: cfg.NewCommonSettingsFromModule(name, defaultTitle, ymlConfig, globalConfig),
|
common: cfg.NewCommonSettingsFromModule(name, defaultTitle, defaultFocusable, ymlConfig, globalConfig),
|
||||||
|
|
||||||
months: ymlConfig.UInt("months"),
|
months: ymlConfig.UInt("months"),
|
||||||
secretFile: ymlConfig.UString("secretFile"),
|
secretFile: ymlConfig.UString("secretFile"),
|
||||||
|
@ -13,7 +13,7 @@ type Widget struct {
|
|||||||
|
|
||||||
func NewWidget(app *tview.Application, settings *Settings) *Widget {
|
func NewWidget(app *tview.Application, settings *Settings) *Widget {
|
||||||
widget := Widget{
|
widget := Widget{
|
||||||
TextWidget: view.NewTextWidget(app, settings.common, false),
|
TextWidget: view.NewTextWidget(app, settings.common),
|
||||||
|
|
||||||
settings: settings,
|
settings: settings,
|
||||||
}
|
}
|
||||||
|
@ -5,7 +5,10 @@ import (
|
|||||||
"github.com/wtfutil/wtf/cfg"
|
"github.com/wtfutil/wtf/cfg"
|
||||||
)
|
)
|
||||||
|
|
||||||
const defaultTitle = "Google Spreadsheets"
|
const (
|
||||||
|
defaultFocusable = false
|
||||||
|
defaultTitle = "Google Spreadsheets"
|
||||||
|
)
|
||||||
|
|
||||||
type colors struct {
|
type colors struct {
|
||||||
values string
|
values string
|
||||||
@ -24,7 +27,7 @@ type Settings struct {
|
|||||||
func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *config.Config) *Settings {
|
func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *config.Config) *Settings {
|
||||||
|
|
||||||
settings := Settings{
|
settings := Settings{
|
||||||
common: cfg.NewCommonSettingsFromModule(name, defaultTitle, ymlConfig, globalConfig),
|
common: cfg.NewCommonSettingsFromModule(name, defaultTitle, defaultFocusable, ymlConfig, globalConfig),
|
||||||
|
|
||||||
cellNames: ymlConfig.UList("cells.names"),
|
cellNames: ymlConfig.UList("cells.names"),
|
||||||
secretFile: ymlConfig.UString("secretFile"),
|
secretFile: ymlConfig.UString("secretFile"),
|
||||||
|
@ -19,7 +19,7 @@ type Widget struct {
|
|||||||
|
|
||||||
func NewWidget(app *tview.Application, settings *Settings) *Widget {
|
func NewWidget(app *tview.Application, settings *Settings) *Widget {
|
||||||
widget := Widget{
|
widget := Widget{
|
||||||
TextWidget: view.NewTextWidget(app, settings.common, false),
|
TextWidget: view.NewTextWidget(app, settings.common),
|
||||||
|
|
||||||
settings: settings,
|
settings: settings,
|
||||||
}
|
}
|
||||||
|
@ -5,7 +5,10 @@ import (
|
|||||||
"github.com/wtfutil/wtf/cfg"
|
"github.com/wtfutil/wtf/cfg"
|
||||||
)
|
)
|
||||||
|
|
||||||
const defaultTitle = "HackerNews"
|
const (
|
||||||
|
defaultFocusable = true
|
||||||
|
defaultTitle = "HackerNews"
|
||||||
|
)
|
||||||
|
|
||||||
type Settings struct {
|
type Settings struct {
|
||||||
common *cfg.Common
|
common *cfg.Common
|
||||||
@ -17,7 +20,7 @@ type Settings struct {
|
|||||||
func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *config.Config) *Settings {
|
func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *config.Config) *Settings {
|
||||||
|
|
||||||
settings := Settings{
|
settings := Settings{
|
||||||
common: cfg.NewCommonSettingsFromModule(name, defaultTitle, ymlConfig, globalConfig),
|
common: cfg.NewCommonSettingsFromModule(name, defaultTitle, defaultFocusable, ymlConfig, globalConfig),
|
||||||
|
|
||||||
numberOfStories: ymlConfig.UInt("numberOfStories", 10),
|
numberOfStories: ymlConfig.UInt("numberOfStories", 10),
|
||||||
storyType: ymlConfig.UString("storyType", "top"),
|
storyType: ymlConfig.UString("storyType", "top"),
|
||||||
|
@ -22,7 +22,7 @@ type Widget struct {
|
|||||||
func NewWidget(app *tview.Application, pages *tview.Pages, settings *Settings) *Widget {
|
func NewWidget(app *tview.Application, pages *tview.Pages, settings *Settings) *Widget {
|
||||||
widget := &Widget{
|
widget := &Widget{
|
||||||
KeyboardWidget: view.NewKeyboardWidget(app, pages, settings.common),
|
KeyboardWidget: view.NewKeyboardWidget(app, pages, settings.common),
|
||||||
ScrollableWidget: view.NewScrollableWidget(app, settings.common, true),
|
ScrollableWidget: view.NewScrollableWidget(app, settings.common),
|
||||||
|
|
||||||
settings: settings,
|
settings: settings,
|
||||||
}
|
}
|
||||||
|
@ -10,6 +10,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
defaultFocusable = false
|
||||||
defaultTitle = "HIBP"
|
defaultTitle = "HIBP"
|
||||||
minRefreshInterval = 21600 // Six hours
|
minRefreshInterval = 21600 // Six hours
|
||||||
)
|
)
|
||||||
@ -32,7 +33,7 @@ type Settings struct {
|
|||||||
// NewSettingsFromYAML creates a new settings instance from a YAML config block
|
// NewSettingsFromYAML creates a new settings instance from a YAML config block
|
||||||
func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *config.Config) *Settings {
|
func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *config.Config) *Settings {
|
||||||
settings := &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_HIBP_TOKEN"))),
|
apiKey: ymlConfig.UString("apiKey", ymlConfig.UString("apikey", os.Getenv("WTF_HIBP_TOKEN"))),
|
||||||
accounts: utils.ToStrs(ymlConfig.UList("accounts")),
|
accounts: utils.ToStrs(ymlConfig.UList("accounts")),
|
||||||
|
@ -19,7 +19,7 @@ type Widget struct {
|
|||||||
// NewWidget creates a new instance of a widget
|
// NewWidget creates a new instance of a widget
|
||||||
func NewWidget(app *tview.Application, settings *Settings) *Widget {
|
func NewWidget(app *tview.Application, settings *Settings) *Widget {
|
||||||
widget := &Widget{
|
widget := &Widget{
|
||||||
TextWidget: view.NewTextWidget(app, settings.common, false),
|
TextWidget: view.NewTextWidget(app, settings.common),
|
||||||
|
|
||||||
settings: settings,
|
settings: settings,
|
||||||
}
|
}
|
||||||
|
@ -5,7 +5,10 @@ import (
|
|||||||
"github.com/wtfutil/wtf/cfg"
|
"github.com/wtfutil/wtf/cfg"
|
||||||
)
|
)
|
||||||
|
|
||||||
const defaultTitle = "IP API"
|
const (
|
||||||
|
defaultFocusable = false
|
||||||
|
defaultTitle = "IP API"
|
||||||
|
)
|
||||||
|
|
||||||
type colors struct {
|
type colors struct {
|
||||||
name string
|
name string
|
||||||
@ -20,7 +23,7 @@ type Settings struct {
|
|||||||
func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *config.Config) *Settings {
|
func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *config.Config) *Settings {
|
||||||
|
|
||||||
settings := Settings{
|
settings := Settings{
|
||||||
common: cfg.NewCommonSettingsFromModule(name, defaultTitle, ymlConfig, globalConfig),
|
common: cfg.NewCommonSettingsFromModule(name, defaultTitle, defaultFocusable, ymlConfig, globalConfig),
|
||||||
}
|
}
|
||||||
|
|
||||||
settings.colors.name = ymlConfig.UString("colors.name", "red")
|
settings.colors.name = ymlConfig.UString("colors.name", "red")
|
||||||
|
@ -38,7 +38,7 @@ type ipinfo struct {
|
|||||||
// NewWidget constructor
|
// NewWidget constructor
|
||||||
func NewWidget(app *tview.Application, settings *Settings) *Widget {
|
func NewWidget(app *tview.Application, settings *Settings) *Widget {
|
||||||
widget := Widget{
|
widget := Widget{
|
||||||
TextWidget: view.NewTextWidget(app, settings.common, false),
|
TextWidget: view.NewTextWidget(app, settings.common),
|
||||||
|
|
||||||
settings: settings,
|
settings: settings,
|
||||||
}
|
}
|
||||||
|
@ -5,7 +5,10 @@ import (
|
|||||||
"github.com/wtfutil/wtf/cfg"
|
"github.com/wtfutil/wtf/cfg"
|
||||||
)
|
)
|
||||||
|
|
||||||
const defaultTitle = "IPInfo"
|
const (
|
||||||
|
defaultFocusable = false
|
||||||
|
defaultTitle = "IPInfo"
|
||||||
|
)
|
||||||
|
|
||||||
type colors struct {
|
type colors struct {
|
||||||
name string
|
name string
|
||||||
@ -20,7 +23,7 @@ type Settings struct {
|
|||||||
func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *config.Config) *Settings {
|
func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *config.Config) *Settings {
|
||||||
|
|
||||||
settings := Settings{
|
settings := Settings{
|
||||||
common: cfg.NewCommonSettingsFromModule(name, defaultTitle, ymlConfig, globalConfig),
|
common: cfg.NewCommonSettingsFromModule(name, defaultTitle, defaultFocusable, ymlConfig, globalConfig),
|
||||||
}
|
}
|
||||||
|
|
||||||
settings.colors.name = ymlConfig.UString("colors.name", "red")
|
settings.colors.name = ymlConfig.UString("colors.name", "red")
|
||||||
|
@ -31,7 +31,7 @@ type ipinfo struct {
|
|||||||
|
|
||||||
func NewWidget(app *tview.Application, settings *Settings) *Widget {
|
func NewWidget(app *tview.Application, settings *Settings) *Widget {
|
||||||
widget := Widget{
|
widget := Widget{
|
||||||
TextWidget: view.NewTextWidget(app, settings.common, false),
|
TextWidget: view.NewTextWidget(app, settings.common),
|
||||||
|
|
||||||
settings: settings,
|
settings: settings,
|
||||||
}
|
}
|
||||||
|
@ -7,7 +7,10 @@ import (
|
|||||||
"github.com/wtfutil/wtf/cfg"
|
"github.com/wtfutil/wtf/cfg"
|
||||||
)
|
)
|
||||||
|
|
||||||
const defaultTitle = "Jenkins"
|
const (
|
||||||
|
defaultFocusable = true
|
||||||
|
defaultTitle = "Jenkins"
|
||||||
|
)
|
||||||
|
|
||||||
type Settings struct {
|
type Settings struct {
|
||||||
common *cfg.Common
|
common *cfg.Common
|
||||||
@ -23,7 +26,7 @@ type Settings struct {
|
|||||||
func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *config.Config) *Settings {
|
func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *config.Config) *Settings {
|
||||||
|
|
||||||
settings := 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_JENKINS_API_KEY"))),
|
apiKey: ymlConfig.UString("apiKey", ymlConfig.UString("apikey", os.Getenv("WTF_JENKINS_API_KEY"))),
|
||||||
jobNameRegex: ymlConfig.UString("jobNameRegex", ".*"),
|
jobNameRegex: ymlConfig.UString("jobNameRegex", ".*"),
|
||||||
|
@ -20,7 +20,7 @@ type Widget struct {
|
|||||||
func NewWidget(app *tview.Application, pages *tview.Pages, settings *Settings) *Widget {
|
func NewWidget(app *tview.Application, pages *tview.Pages, settings *Settings) *Widget {
|
||||||
widget := Widget{
|
widget := Widget{
|
||||||
KeyboardWidget: view.NewKeyboardWidget(app, pages, settings.common),
|
KeyboardWidget: view.NewKeyboardWidget(app, pages, settings.common),
|
||||||
ScrollableWidget: view.NewScrollableWidget(app, settings.common, true),
|
ScrollableWidget: view.NewScrollableWidget(app, settings.common),
|
||||||
|
|
||||||
settings: settings,
|
settings: settings,
|
||||||
}
|
}
|
||||||
|
@ -7,7 +7,10 @@ import (
|
|||||||
"github.com/wtfutil/wtf/cfg"
|
"github.com/wtfutil/wtf/cfg"
|
||||||
)
|
)
|
||||||
|
|
||||||
const defaultTitle = "Jira"
|
const (
|
||||||
|
defaultFocusable = true
|
||||||
|
defaultTitle = "Jira"
|
||||||
|
)
|
||||||
|
|
||||||
type colors struct {
|
type colors struct {
|
||||||
rows struct {
|
rows struct {
|
||||||
@ -32,7 +35,7 @@ type Settings struct {
|
|||||||
func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *config.Config) *Settings {
|
func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *config.Config) *Settings {
|
||||||
|
|
||||||
settings := 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_JIRA_API_KEY"))),
|
apiKey: ymlConfig.UString("apiKey", ymlConfig.UString("apikey", os.Getenv("WTF_JIRA_API_KEY"))),
|
||||||
domain: ymlConfig.UString("domain"),
|
domain: ymlConfig.UString("domain"),
|
||||||
|
@ -19,7 +19,7 @@ type Widget struct {
|
|||||||
func NewWidget(app *tview.Application, pages *tview.Pages, settings *Settings) *Widget {
|
func NewWidget(app *tview.Application, pages *tview.Pages, settings *Settings) *Widget {
|
||||||
widget := Widget{
|
widget := Widget{
|
||||||
KeyboardWidget: view.NewKeyboardWidget(app, pages, settings.common),
|
KeyboardWidget: view.NewKeyboardWidget(app, pages, settings.common),
|
||||||
ScrollableWidget: view.NewScrollableWidget(app, settings.common, true),
|
ScrollableWidget: view.NewScrollableWidget(app, settings.common),
|
||||||
|
|
||||||
settings: settings,
|
settings: settings,
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,10 @@ import (
|
|||||||
"github.com/wtfutil/wtf/utils"
|
"github.com/wtfutil/wtf/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
const defaultTitle = "Kubernetes"
|
const (
|
||||||
|
defaultFocusable = false
|
||||||
|
defaultTitle = "Kubernetes"
|
||||||
|
)
|
||||||
|
|
||||||
type Settings struct {
|
type Settings struct {
|
||||||
common *cfg.Common
|
common *cfg.Common
|
||||||
@ -20,7 +23,7 @@ type Settings struct {
|
|||||||
func NewSettingsFromYAML(name string, moduleConfig *config.Config, globalConfig *config.Config) *Settings {
|
func NewSettingsFromYAML(name string, moduleConfig *config.Config, globalConfig *config.Config) *Settings {
|
||||||
|
|
||||||
settings := Settings{
|
settings := Settings{
|
||||||
common: cfg.NewCommonSettingsFromModule(name, defaultTitle, moduleConfig, globalConfig),
|
common: cfg.NewCommonSettingsFromModule(name, defaultTitle, defaultFocusable, moduleConfig, globalConfig),
|
||||||
|
|
||||||
objects: utils.ToStrs(moduleConfig.UList("objects")),
|
objects: utils.ToStrs(moduleConfig.UList("objects")),
|
||||||
title: moduleConfig.UString("title"),
|
title: moduleConfig.UString("title"),
|
||||||
|
@ -24,7 +24,7 @@ type Widget struct {
|
|||||||
// NewWidget creates a new instance of the widget
|
// NewWidget creates a new instance of the widget
|
||||||
func NewWidget(app *tview.Application, settings *Settings) *Widget {
|
func NewWidget(app *tview.Application, settings *Settings) *Widget {
|
||||||
widget := Widget{
|
widget := Widget{
|
||||||
TextWidget: view.NewTextWidget(app, settings.common, false),
|
TextWidget: view.NewTextWidget(app, settings.common),
|
||||||
|
|
||||||
objects: settings.objects,
|
objects: settings.objects,
|
||||||
title: settings.title,
|
title: settings.title,
|
||||||
|
@ -5,7 +5,10 @@ import (
|
|||||||
"github.com/wtfutil/wtf/cfg"
|
"github.com/wtfutil/wtf/cfg"
|
||||||
)
|
)
|
||||||
|
|
||||||
const defaultTitle = "Logger"
|
const (
|
||||||
|
defaultFocusable = true
|
||||||
|
defaultTitle = "Logger"
|
||||||
|
)
|
||||||
|
|
||||||
type Settings struct {
|
type Settings struct {
|
||||||
common *cfg.Common
|
common *cfg.Common
|
||||||
@ -13,7 +16,7 @@ type Settings struct {
|
|||||||
|
|
||||||
func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *config.Config) *Settings {
|
func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *config.Config) *Settings {
|
||||||
settings := Settings{
|
settings := Settings{
|
||||||
common: cfg.NewCommonSettingsFromModule(name, defaultTitle, ymlConfig, globalConfig),
|
common: cfg.NewCommonSettingsFromModule(name, defaultTitle, defaultFocusable, ymlConfig, globalConfig),
|
||||||
}
|
}
|
||||||
|
|
||||||
return &settings
|
return &settings
|
||||||
|
@ -10,7 +10,9 @@ import (
|
|||||||
"github.com/wtfutil/wtf/view"
|
"github.com/wtfutil/wtf/view"
|
||||||
)
|
)
|
||||||
|
|
||||||
const maxBufferSize int64 = 1024
|
const (
|
||||||
|
maxBufferSize int64 = 1024
|
||||||
|
)
|
||||||
|
|
||||||
type Widget struct {
|
type Widget struct {
|
||||||
view.TextWidget
|
view.TextWidget
|
||||||
@ -22,7 +24,7 @@ type Widget struct {
|
|||||||
|
|
||||||
func NewWidget(app *tview.Application, settings *Settings) *Widget {
|
func NewWidget(app *tview.Application, settings *Settings) *Widget {
|
||||||
widget := Widget{
|
widget := Widget{
|
||||||
TextWidget: view.NewTextWidget(app, settings.common, true),
|
TextWidget: view.NewTextWidget(app, settings.common),
|
||||||
|
|
||||||
app: app,
|
app: app,
|
||||||
filePath: log.LogFilePath(),
|
filePath: log.LogFilePath(),
|
||||||
|
@ -5,7 +5,10 @@ import (
|
|||||||
"github.com/wtfutil/wtf/cfg"
|
"github.com/wtfutil/wtf/cfg"
|
||||||
)
|
)
|
||||||
|
|
||||||
const defaultTitle = "Mercurial"
|
const (
|
||||||
|
defaultFocusable = true
|
||||||
|
defaultTitle = "Mercurial"
|
||||||
|
)
|
||||||
|
|
||||||
type Settings struct {
|
type Settings struct {
|
||||||
common *cfg.Common
|
common *cfg.Common
|
||||||
@ -18,7 +21,7 @@ type Settings struct {
|
|||||||
func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *config.Config) *Settings {
|
func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *config.Config) *Settings {
|
||||||
|
|
||||||
settings := Settings{
|
settings := Settings{
|
||||||
common: cfg.NewCommonSettingsFromModule(name, defaultTitle, ymlConfig, globalConfig),
|
common: cfg.NewCommonSettingsFromModule(name, defaultTitle, defaultFocusable, ymlConfig, globalConfig),
|
||||||
|
|
||||||
commitCount: ymlConfig.UInt("commitCount", 10),
|
commitCount: ymlConfig.UInt("commitCount", 10),
|
||||||
commitFormat: ymlConfig.UString("commitFormat", "[forestgreen]{rev}:{phase} [white]{desc|firstline|strip} [grey]{author|person} {date|age}[white]"),
|
commitFormat: ymlConfig.UString("commitFormat", "[forestgreen]{rev}:{phase} [white]{desc|firstline|strip} [grey]{author|person} {date|age}[white]"),
|
||||||
|
@ -7,9 +7,11 @@ import (
|
|||||||
"github.com/wtfutil/wtf/view"
|
"github.com/wtfutil/wtf/view"
|
||||||
)
|
)
|
||||||
|
|
||||||
const offscreen = -1000
|
const (
|
||||||
const modalWidth = 80
|
modalHeight = 7
|
||||||
const modalHeight = 7
|
modalWidth = 80
|
||||||
|
offscreen = -1000
|
||||||
|
)
|
||||||
|
|
||||||
// A Widget represents a Mercurial widget
|
// A Widget represents a Mercurial widget
|
||||||
type Widget struct {
|
type Widget struct {
|
||||||
@ -28,7 +30,7 @@ func NewWidget(app *tview.Application, pages *tview.Pages, settings *Settings) *
|
|||||||
widget := Widget{
|
widget := Widget{
|
||||||
KeyboardWidget: view.NewKeyboardWidget(app, pages, settings.common),
|
KeyboardWidget: view.NewKeyboardWidget(app, pages, settings.common),
|
||||||
MultiSourceWidget: view.NewMultiSourceWidget(settings.common, "repository", "repositories"),
|
MultiSourceWidget: view.NewMultiSourceWidget(settings.common, "repository", "repositories"),
|
||||||
TextWidget: view.NewTextWidget(app, settings.common, true),
|
TextWidget: view.NewTextWidget(app, settings.common),
|
||||||
|
|
||||||
app: app,
|
app: app,
|
||||||
pages: pages,
|
pages: pages,
|
||||||
|
@ -5,7 +5,10 @@ import (
|
|||||||
"github.com/wtfutil/wtf/cfg"
|
"github.com/wtfutil/wtf/cfg"
|
||||||
)
|
)
|
||||||
|
|
||||||
const defaultTitle = "NBA Score"
|
const (
|
||||||
|
defaultFocusable = true
|
||||||
|
defaultTitle = "NBA Score"
|
||||||
|
)
|
||||||
|
|
||||||
type Settings struct {
|
type Settings struct {
|
||||||
common *cfg.Common
|
common *cfg.Common
|
||||||
@ -13,7 +16,7 @@ type Settings struct {
|
|||||||
|
|
||||||
func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *config.Config) *Settings {
|
func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *config.Config) *Settings {
|
||||||
settings := Settings{
|
settings := Settings{
|
||||||
common: cfg.NewCommonSettingsFromModule(name, defaultTitle, ymlConfig, globalConfig),
|
common: cfg.NewCommonSettingsFromModule(name, defaultTitle, defaultFocusable, ymlConfig, globalConfig),
|
||||||
}
|
}
|
||||||
|
|
||||||
return &settings
|
return &settings
|
||||||
|
@ -13,6 +13,8 @@ import (
|
|||||||
"github.com/wtfutil/wtf/view"
|
"github.com/wtfutil/wtf/view"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
var offset = 0
|
||||||
|
|
||||||
// A Widget represents an NBA Score widget
|
// A Widget represents an NBA Score widget
|
||||||
type Widget struct {
|
type Widget struct {
|
||||||
view.KeyboardWidget
|
view.KeyboardWidget
|
||||||
@ -23,13 +25,11 @@ type Widget struct {
|
|||||||
settings *Settings
|
settings *Settings
|
||||||
}
|
}
|
||||||
|
|
||||||
var offset = 0
|
|
||||||
|
|
||||||
// NewWidget creates a new instance of a widget
|
// NewWidget creates a new instance of a widget
|
||||||
func NewWidget(app *tview.Application, pages *tview.Pages, settings *Settings) *Widget {
|
func NewWidget(app *tview.Application, pages *tview.Pages, settings *Settings) *Widget {
|
||||||
widget := Widget{
|
widget := Widget{
|
||||||
KeyboardWidget: view.NewKeyboardWidget(app, pages, settings.common),
|
KeyboardWidget: view.NewKeyboardWidget(app, pages, settings.common),
|
||||||
TextWidget: view.NewTextWidget(app, settings.common, true),
|
TextWidget: view.NewTextWidget(app, settings.common),
|
||||||
|
|
||||||
settings: settings,
|
settings: settings,
|
||||||
}
|
}
|
||||||
|
@ -7,7 +7,10 @@ import (
|
|||||||
"github.com/wtfutil/wtf/cfg"
|
"github.com/wtfutil/wtf/cfg"
|
||||||
)
|
)
|
||||||
|
|
||||||
const defaultTitle = "NewRelic"
|
const (
|
||||||
|
defaultFocusable = true
|
||||||
|
defaultTitle = "NewRelic"
|
||||||
|
)
|
||||||
|
|
||||||
type Settings struct {
|
type Settings struct {
|
||||||
common *cfg.Common
|
common *cfg.Common
|
||||||
@ -20,7 +23,7 @@ type Settings struct {
|
|||||||
func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *config.Config) *Settings {
|
func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *config.Config) *Settings {
|
||||||
|
|
||||||
settings := Settings{
|
settings := Settings{
|
||||||
common: cfg.NewCommonSettingsFromModule(name, defaultTitle, ymlConfig, globalConfig),
|
common: cfg.NewCommonSettingsFromModule(name, defaultTitle, defaultFocusable, ymlConfig, globalConfig),
|
||||||
|
|
||||||
apiKey: ymlConfig.UString("apiKey", os.Getenv("WTF_NEW_RELIC_API_KEY")),
|
apiKey: ymlConfig.UString("apiKey", os.Getenv("WTF_NEW_RELIC_API_KEY")),
|
||||||
deployCount: ymlConfig.UInt("deployCount", 5),
|
deployCount: ymlConfig.UInt("deployCount", 5),
|
||||||
|
@ -22,7 +22,7 @@ func NewWidget(app *tview.Application, pages *tview.Pages, settings *Settings) *
|
|||||||
widget := Widget{
|
widget := Widget{
|
||||||
KeyboardWidget: view.NewKeyboardWidget(app, pages, settings.common),
|
KeyboardWidget: view.NewKeyboardWidget(app, pages, settings.common),
|
||||||
MultiSourceWidget: view.NewMultiSourceWidget(settings.common, "applicationID", "applicationIDs"),
|
MultiSourceWidget: view.NewMultiSourceWidget(settings.common, "applicationID", "applicationIDs"),
|
||||||
TextWidget: view.NewTextWidget(app, settings.common, true),
|
TextWidget: view.NewTextWidget(app, settings.common),
|
||||||
|
|
||||||
settings: settings,
|
settings: settings,
|
||||||
}
|
}
|
||||||
|
@ -7,7 +7,10 @@ import (
|
|||||||
"github.com/wtfutil/wtf/cfg"
|
"github.com/wtfutil/wtf/cfg"
|
||||||
)
|
)
|
||||||
|
|
||||||
const defaultTitle = "OpsGenie"
|
const (
|
||||||
|
defaultFocusable = false
|
||||||
|
defaultTitle = "OpsGenie"
|
||||||
|
)
|
||||||
|
|
||||||
type Settings struct {
|
type Settings struct {
|
||||||
common *cfg.Common
|
common *cfg.Common
|
||||||
@ -22,7 +25,7 @@ type Settings struct {
|
|||||||
func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *config.Config) *Settings {
|
func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *config.Config) *Settings {
|
||||||
|
|
||||||
settings := 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_OPS_GENIE_API_KEY"))),
|
apiKey: ymlConfig.UString("apiKey", ymlConfig.UString("apikey", os.Getenv("WTF_OPS_GENIE_API_KEY"))),
|
||||||
region: ymlConfig.UString("region", "us"),
|
region: ymlConfig.UString("region", "us"),
|
||||||
|
@ -17,7 +17,7 @@ type Widget struct {
|
|||||||
|
|
||||||
func NewWidget(app *tview.Application, settings *Settings) *Widget {
|
func NewWidget(app *tview.Application, settings *Settings) *Widget {
|
||||||
widget := Widget{
|
widget := Widget{
|
||||||
TextWidget: view.NewTextWidget(app, settings.common, false),
|
TextWidget: view.NewTextWidget(app, settings.common),
|
||||||
|
|
||||||
settings: settings,
|
settings: settings,
|
||||||
}
|
}
|
||||||
|
@ -7,7 +7,10 @@ import (
|
|||||||
"github.com/wtfutil/wtf/cfg"
|
"github.com/wtfutil/wtf/cfg"
|
||||||
)
|
)
|
||||||
|
|
||||||
const defaultTitle = "PagerDuty"
|
const (
|
||||||
|
defaultFocusable = false
|
||||||
|
defaultTitle = "PagerDuty"
|
||||||
|
)
|
||||||
|
|
||||||
type Settings struct {
|
type Settings struct {
|
||||||
common *cfg.Common
|
common *cfg.Common
|
||||||
@ -22,7 +25,7 @@ type Settings struct {
|
|||||||
func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *config.Config) *Settings {
|
func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *config.Config) *Settings {
|
||||||
|
|
||||||
settings := 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_PAGERDUTY_API_KEY"))),
|
apiKey: ymlConfig.UString("apiKey", ymlConfig.UString("apikey", os.Getenv("WTF_PAGERDUTY_API_KEY"))),
|
||||||
escalationFilter: ymlConfig.UList("escalationFilter"),
|
escalationFilter: ymlConfig.UList("escalationFilter"),
|
||||||
|
@ -18,7 +18,7 @@ type Widget struct {
|
|||||||
|
|
||||||
func NewWidget(app *tview.Application, settings *Settings) *Widget {
|
func NewWidget(app *tview.Application, settings *Settings) *Widget {
|
||||||
widget := Widget{
|
widget := Widget{
|
||||||
TextWidget: view.NewTextWidget(app, settings.common, false),
|
TextWidget: view.NewTextWidget(app, settings.common),
|
||||||
|
|
||||||
settings: settings,
|
settings: settings,
|
||||||
}
|
}
|
||||||
|
@ -5,7 +5,10 @@ import (
|
|||||||
"github.com/wtfutil/wtf/cfg"
|
"github.com/wtfutil/wtf/cfg"
|
||||||
)
|
)
|
||||||
|
|
||||||
const defaultTitle = "Power"
|
const (
|
||||||
|
defaultFocusable = false
|
||||||
|
defaultTitle = "Power"
|
||||||
|
)
|
||||||
|
|
||||||
type Settings struct {
|
type Settings struct {
|
||||||
common *cfg.Common
|
common *cfg.Common
|
||||||
@ -13,7 +16,7 @@ type Settings struct {
|
|||||||
|
|
||||||
func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *config.Config) *Settings {
|
func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *config.Config) *Settings {
|
||||||
settings := Settings{
|
settings := Settings{
|
||||||
common: cfg.NewCommonSettingsFromModule(name, defaultTitle, ymlConfig, globalConfig),
|
common: cfg.NewCommonSettingsFromModule(name, defaultTitle, defaultFocusable, ymlConfig, globalConfig),
|
||||||
}
|
}
|
||||||
|
|
||||||
return &settings
|
return &settings
|
||||||
|
@ -17,7 +17,7 @@ type Widget struct {
|
|||||||
|
|
||||||
func NewWidget(app *tview.Application, settings *Settings) *Widget {
|
func NewWidget(app *tview.Application, settings *Settings) *Widget {
|
||||||
widget := Widget{
|
widget := Widget{
|
||||||
TextWidget: view.NewTextWidget(app, settings.common, false),
|
TextWidget: view.NewTextWidget(app, settings.common),
|
||||||
|
|
||||||
Battery: NewBattery(),
|
Battery: NewBattery(),
|
||||||
|
|
||||||
|
@ -5,7 +5,10 @@ import (
|
|||||||
"github.com/wtfutil/wtf/cfg"
|
"github.com/wtfutil/wtf/cfg"
|
||||||
)
|
)
|
||||||
|
|
||||||
const defaultTitle = "ResourceUsage"
|
const (
|
||||||
|
defaultFocusable = false
|
||||||
|
defaultTitle = "ResourceUsage"
|
||||||
|
)
|
||||||
|
|
||||||
type Settings struct {
|
type Settings struct {
|
||||||
common *cfg.Common
|
common *cfg.Common
|
||||||
@ -13,7 +16,7 @@ type Settings struct {
|
|||||||
|
|
||||||
func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *config.Config) *Settings {
|
func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *config.Config) *Settings {
|
||||||
settings := Settings{
|
settings := Settings{
|
||||||
common: cfg.NewCommonSettingsFromModule(name, defaultTitle, ymlConfig, globalConfig),
|
common: cfg.NewCommonSettingsFromModule(name, defaultTitle, defaultFocusable, ymlConfig, globalConfig),
|
||||||
}
|
}
|
||||||
|
|
||||||
return &settings
|
return &settings
|
||||||
|
@ -12,8 +12,10 @@ import (
|
|||||||
"github.com/wtfutil/wtf/view"
|
"github.com/wtfutil/wtf/view"
|
||||||
)
|
)
|
||||||
|
|
||||||
var started = false
|
var (
|
||||||
var ok = true
|
ok = true
|
||||||
|
started = false
|
||||||
|
)
|
||||||
|
|
||||||
// Widget define wtf widget to register widget later
|
// Widget define wtf widget to register widget later
|
||||||
type Widget struct {
|
type Widget struct {
|
||||||
@ -26,7 +28,7 @@ type Widget struct {
|
|||||||
// NewWidget Make new instance of widget
|
// NewWidget Make new instance of widget
|
||||||
func NewWidget(app *tview.Application, settings *Settings) *Widget {
|
func NewWidget(app *tview.Application, settings *Settings) *Widget {
|
||||||
widget := Widget{
|
widget := Widget{
|
||||||
BarGraph: view.NewBarGraph(app, settings.common.Name, settings.common, false),
|
BarGraph: view.NewBarGraph(app, settings.common.Name, settings.common),
|
||||||
|
|
||||||
app: app,
|
app: app,
|
||||||
settings: settings,
|
settings: settings,
|
||||||
|
@ -5,7 +5,10 @@ import (
|
|||||||
"github.com/wtfutil/wtf/cfg"
|
"github.com/wtfutil/wtf/cfg"
|
||||||
)
|
)
|
||||||
|
|
||||||
const defaultTitle = "Rollbar"
|
const (
|
||||||
|
defaultFocusable = true
|
||||||
|
defaultTitle = "Rollbar"
|
||||||
|
)
|
||||||
|
|
||||||
type Settings struct {
|
type Settings struct {
|
||||||
common *cfg.Common
|
common *cfg.Common
|
||||||
@ -21,7 +24,7 @@ type Settings struct {
|
|||||||
func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *config.Config) *Settings {
|
func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *config.Config) *Settings {
|
||||||
|
|
||||||
settings := Settings{
|
settings := Settings{
|
||||||
common: cfg.NewCommonSettingsFromModule(name, defaultTitle, ymlConfig, globalConfig),
|
common: cfg.NewCommonSettingsFromModule(name, defaultTitle, defaultFocusable, ymlConfig, globalConfig),
|
||||||
|
|
||||||
accessToken: ymlConfig.UString("accessToken"),
|
accessToken: ymlConfig.UString("accessToken"),
|
||||||
activeOnly: ymlConfig.UBool("activeOnly", false),
|
activeOnly: ymlConfig.UBool("activeOnly", false),
|
||||||
|
@ -22,7 +22,7 @@ type Widget struct {
|
|||||||
func NewWidget(app *tview.Application, pages *tview.Pages, settings *Settings) *Widget {
|
func NewWidget(app *tview.Application, pages *tview.Pages, settings *Settings) *Widget {
|
||||||
widget := Widget{
|
widget := Widget{
|
||||||
KeyboardWidget: view.NewKeyboardWidget(app, pages, settings.common),
|
KeyboardWidget: view.NewKeyboardWidget(app, pages, settings.common),
|
||||||
ScrollableWidget: view.NewScrollableWidget(app, settings.common, true),
|
ScrollableWidget: view.NewScrollableWidget(app, settings.common),
|
||||||
|
|
||||||
settings: settings,
|
settings: settings,
|
||||||
}
|
}
|
||||||
|
@ -5,7 +5,10 @@ import (
|
|||||||
"github.com/wtfutil/wtf/cfg"
|
"github.com/wtfutil/wtf/cfg"
|
||||||
)
|
)
|
||||||
|
|
||||||
const defaultTitle = "Security"
|
const (
|
||||||
|
defaultFocusable = false
|
||||||
|
defaultTitle = "Security"
|
||||||
|
)
|
||||||
|
|
||||||
type Settings struct {
|
type Settings struct {
|
||||||
common *cfg.Common
|
common *cfg.Common
|
||||||
@ -13,7 +16,7 @@ type Settings struct {
|
|||||||
|
|
||||||
func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *config.Config) *Settings {
|
func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *config.Config) *Settings {
|
||||||
settings := Settings{
|
settings := Settings{
|
||||||
common: cfg.NewCommonSettingsFromModule(name, defaultTitle, ymlConfig, globalConfig),
|
common: cfg.NewCommonSettingsFromModule(name, defaultTitle, defaultFocusable, ymlConfig, globalConfig),
|
||||||
}
|
}
|
||||||
|
|
||||||
return &settings
|
return &settings
|
||||||
|
@ -16,7 +16,7 @@ type Widget struct {
|
|||||||
|
|
||||||
func NewWidget(app *tview.Application, settings *Settings) *Widget {
|
func NewWidget(app *tview.Application, settings *Settings) *Widget {
|
||||||
widget := Widget{
|
widget := Widget{
|
||||||
TextWidget: view.NewTextWidget(app, settings.common, false),
|
TextWidget: view.NewTextWidget(app, settings.common),
|
||||||
|
|
||||||
settings: settings,
|
settings: settings,
|
||||||
}
|
}
|
||||||
|
@ -5,7 +5,10 @@ import (
|
|||||||
"github.com/wtfutil/wtf/cfg"
|
"github.com/wtfutil/wtf/cfg"
|
||||||
)
|
)
|
||||||
|
|
||||||
const defaultTitle = "Spotify"
|
const (
|
||||||
|
defaultFocusable = true
|
||||||
|
defaultTitle = "Spotify"
|
||||||
|
)
|
||||||
|
|
||||||
type Settings struct {
|
type Settings struct {
|
||||||
common *cfg.Common
|
common *cfg.Common
|
||||||
@ -13,7 +16,7 @@ type Settings struct {
|
|||||||
|
|
||||||
func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *config.Config) *Settings {
|
func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *config.Config) *Settings {
|
||||||
settings := Settings{
|
settings := Settings{
|
||||||
common: cfg.NewCommonSettingsFromModule(name, defaultTitle, ymlConfig, globalConfig),
|
common: cfg.NewCommonSettingsFromModule(name, defaultTitle, defaultFocusable, ymlConfig, globalConfig),
|
||||||
}
|
}
|
||||||
|
|
||||||
return &settings
|
return &settings
|
||||||
|
@ -23,7 +23,7 @@ type Widget struct {
|
|||||||
func NewWidget(app *tview.Application, pages *tview.Pages, settings *Settings) *Widget {
|
func NewWidget(app *tview.Application, pages *tview.Pages, settings *Settings) *Widget {
|
||||||
widget := Widget{
|
widget := Widget{
|
||||||
KeyboardWidget: view.NewKeyboardWidget(app, pages, settings.common),
|
KeyboardWidget: view.NewKeyboardWidget(app, pages, settings.common),
|
||||||
TextWidget: view.NewTextWidget(app, settings.common, true),
|
TextWidget: view.NewTextWidget(app, settings.common),
|
||||||
|
|
||||||
Info: spotigopher.Info{},
|
Info: spotigopher.Info{},
|
||||||
client: spotigopher.NewClient(),
|
client: spotigopher.NewClient(),
|
||||||
|
@ -7,7 +7,10 @@ import (
|
|||||||
"github.com/wtfutil/wtf/cfg"
|
"github.com/wtfutil/wtf/cfg"
|
||||||
)
|
)
|
||||||
|
|
||||||
const defaultTitle = "Spotify Web"
|
const (
|
||||||
|
defaultFocusable = true
|
||||||
|
defaultTitle = "Spotify Web"
|
||||||
|
)
|
||||||
|
|
||||||
type Settings struct {
|
type Settings struct {
|
||||||
common *cfg.Common
|
common *cfg.Common
|
||||||
@ -20,7 +23,7 @@ type Settings struct {
|
|||||||
func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *config.Config) *Settings {
|
func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *config.Config) *Settings {
|
||||||
|
|
||||||
settings := Settings{
|
settings := Settings{
|
||||||
common: cfg.NewCommonSettingsFromModule(name, defaultTitle, ymlConfig, globalConfig),
|
common: cfg.NewCommonSettingsFromModule(name, defaultTitle, defaultFocusable, ymlConfig, globalConfig),
|
||||||
|
|
||||||
callbackPort: ymlConfig.UString("callbackPort", "8080"),
|
callbackPort: ymlConfig.UString("callbackPort", "8080"),
|
||||||
clientID: ymlConfig.UString("clientID", os.Getenv("SPOTIFY_ID")),
|
clientID: ymlConfig.UString("clientID", os.Getenv("SPOTIFY_ID")),
|
||||||
|
@ -12,6 +12,15 @@ import (
|
|||||||
"github.com/zmb3/spotify"
|
"github.com/zmb3/spotify"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
var (
|
||||||
|
auth spotify.Authenticator
|
||||||
|
tempClientChan = make(chan *spotify.Client)
|
||||||
|
state = "wtfSpotifyWebStateString"
|
||||||
|
authURL string
|
||||||
|
callbackPort string
|
||||||
|
redirectURI string
|
||||||
|
)
|
||||||
|
|
||||||
// Info is the struct that contains all the information the Spotify player displays to the user
|
// Info is the struct that contains all the information the Spotify player displays to the user
|
||||||
type Info struct {
|
type Info struct {
|
||||||
Artists string
|
Artists string
|
||||||
@ -34,15 +43,6 @@ type Widget struct {
|
|||||||
settings *Settings
|
settings *Settings
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
|
||||||
auth spotify.Authenticator
|
|
||||||
tempClientChan = make(chan *spotify.Client)
|
|
||||||
state = "wtfSpotifyWebStateString"
|
|
||||||
authURL string
|
|
||||||
callbackPort string
|
|
||||||
redirectURI string
|
|
||||||
)
|
|
||||||
|
|
||||||
func authHandler(w http.ResponseWriter, r *http.Request) {
|
func authHandler(w http.ResponseWriter, r *http.Request) {
|
||||||
tok, err := auth.Token(state, r)
|
tok, err := auth.Token(state, r)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -70,7 +70,7 @@ func NewWidget(app *tview.Application, pages *tview.Pages, settings *Settings) *
|
|||||||
|
|
||||||
widget := Widget{
|
widget := Widget{
|
||||||
KeyboardWidget: view.NewKeyboardWidget(app, pages, settings.common),
|
KeyboardWidget: view.NewKeyboardWidget(app, pages, settings.common),
|
||||||
TextWidget: view.NewTextWidget(app, settings.common, true),
|
TextWidget: view.NewTextWidget(app, settings.common),
|
||||||
|
|
||||||
Info: Info{},
|
Info: Info{},
|
||||||
|
|
||||||
|
@ -5,7 +5,10 @@ import (
|
|||||||
"github.com/wtfutil/wtf/cfg"
|
"github.com/wtfutil/wtf/cfg"
|
||||||
)
|
)
|
||||||
|
|
||||||
const defaultTitle = "Status"
|
const (
|
||||||
|
defaultFocusable = false
|
||||||
|
defaultTitle = "Status"
|
||||||
|
)
|
||||||
|
|
||||||
type Settings struct {
|
type Settings struct {
|
||||||
common *cfg.Common
|
common *cfg.Common
|
||||||
@ -13,7 +16,7 @@ type Settings struct {
|
|||||||
|
|
||||||
func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *config.Config) *Settings {
|
func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *config.Config) *Settings {
|
||||||
settings := Settings{
|
settings := Settings{
|
||||||
common: cfg.NewCommonSettingsFromModule(name, defaultTitle, ymlConfig, globalConfig),
|
common: cfg.NewCommonSettingsFromModule(name, defaultTitle, defaultFocusable, ymlConfig, globalConfig),
|
||||||
}
|
}
|
||||||
|
|
||||||
return &settings
|
return &settings
|
||||||
|
@ -15,7 +15,7 @@ type Widget struct {
|
|||||||
|
|
||||||
func NewWidget(app *tview.Application, settings *Settings) *Widget {
|
func NewWidget(app *tview.Application, settings *Settings) *Widget {
|
||||||
widget := Widget{
|
widget := Widget{
|
||||||
TextWidget: view.NewTextWidget(app, settings.common, false),
|
TextWidget: view.NewTextWidget(app, settings.common),
|
||||||
|
|
||||||
CurrentIcon: 0,
|
CurrentIcon: 0,
|
||||||
|
|
||||||
|
@ -5,7 +5,10 @@ import (
|
|||||||
"github.com/wtfutil/wtf/cfg"
|
"github.com/wtfutil/wtf/cfg"
|
||||||
)
|
)
|
||||||
|
|
||||||
const defaultTitle = "System"
|
const (
|
||||||
|
defaultFocusable = false
|
||||||
|
defaultTitle = "System"
|
||||||
|
)
|
||||||
|
|
||||||
type Settings struct {
|
type Settings struct {
|
||||||
common *cfg.Common
|
common *cfg.Common
|
||||||
@ -13,7 +16,7 @@ type Settings struct {
|
|||||||
|
|
||||||
func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *config.Config) *Settings {
|
func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *config.Config) *Settings {
|
||||||
settings := Settings{
|
settings := Settings{
|
||||||
common: cfg.NewCommonSettingsFromModule(name, defaultTitle, ymlConfig, globalConfig),
|
common: cfg.NewCommonSettingsFromModule(name, defaultTitle, defaultFocusable, ymlConfig, globalConfig),
|
||||||
}
|
}
|
||||||
|
|
||||||
return &settings
|
return &settings
|
||||||
|
@ -21,7 +21,7 @@ type Widget struct {
|
|||||||
|
|
||||||
func NewWidget(app *tview.Application, date, version string, settings *Settings) *Widget {
|
func NewWidget(app *tview.Application, date, version string, settings *Settings) *Widget {
|
||||||
widget := Widget{
|
widget := Widget{
|
||||||
TextWidget: view.NewTextWidget(app, settings.common, false),
|
TextWidget: view.NewTextWidget(app, settings.common),
|
||||||
|
|
||||||
Date: date,
|
Date: date,
|
||||||
|
|
||||||
|
@ -5,7 +5,10 @@ import (
|
|||||||
"github.com/wtfutil/wtf/cfg"
|
"github.com/wtfutil/wtf/cfg"
|
||||||
)
|
)
|
||||||
|
|
||||||
const defaultTitle = "Textfile"
|
const (
|
||||||
|
defaultFocusable = true
|
||||||
|
defaultTitle = "Textfile"
|
||||||
|
)
|
||||||
|
|
||||||
// Settings defines the configuration properties for this module
|
// Settings defines the configuration properties for this module
|
||||||
type Settings struct {
|
type Settings struct {
|
||||||
@ -21,7 +24,7 @@ type Settings struct {
|
|||||||
func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *config.Config) *Settings {
|
func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *config.Config) *Settings {
|
||||||
|
|
||||||
settings := Settings{
|
settings := Settings{
|
||||||
common: cfg.NewCommonSettingsFromModule(name, defaultTitle, ymlConfig, globalConfig),
|
common: cfg.NewCommonSettingsFromModule(name, defaultTitle, defaultFocusable, ymlConfig, globalConfig),
|
||||||
|
|
||||||
filePaths: ymlConfig.UList("filePaths"),
|
filePaths: ymlConfig.UList("filePaths"),
|
||||||
format: ymlConfig.UBool("format", false),
|
format: ymlConfig.UBool("format", false),
|
||||||
|
@ -34,7 +34,7 @@ func NewWidget(app *tview.Application, pages *tview.Pages, settings *Settings) *
|
|||||||
widget := Widget{
|
widget := Widget{
|
||||||
KeyboardWidget: view.NewKeyboardWidget(app, pages, settings.common),
|
KeyboardWidget: view.NewKeyboardWidget(app, pages, settings.common),
|
||||||
MultiSourceWidget: view.NewMultiSourceWidget(settings.common, "filePath", "filePaths"),
|
MultiSourceWidget: view.NewMultiSourceWidget(settings.common, "filePath", "filePaths"),
|
||||||
TextWidget: view.NewTextWidget(app, settings.common, true),
|
TextWidget: view.NewTextWidget(app, settings.common),
|
||||||
|
|
||||||
settings: settings,
|
settings: settings,
|
||||||
}
|
}
|
||||||
|
@ -5,7 +5,10 @@ import (
|
|||||||
"github.com/wtfutil/wtf/cfg"
|
"github.com/wtfutil/wtf/cfg"
|
||||||
)
|
)
|
||||||
|
|
||||||
const defaultTitle = "Todo"
|
const (
|
||||||
|
defaultFocusable = true
|
||||||
|
defaultTitle = "Todo"
|
||||||
|
)
|
||||||
|
|
||||||
type Settings struct {
|
type Settings struct {
|
||||||
common *cfg.Common
|
common *cfg.Common
|
||||||
@ -16,7 +19,7 @@ type Settings struct {
|
|||||||
func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *config.Config) *Settings {
|
func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *config.Config) *Settings {
|
||||||
|
|
||||||
settings := Settings{
|
settings := Settings{
|
||||||
common: cfg.NewCommonSettingsFromModule(name, defaultTitle, ymlConfig, globalConfig),
|
common: cfg.NewCommonSettingsFromModule(name, defaultTitle, defaultFocusable, ymlConfig, globalConfig),
|
||||||
|
|
||||||
filePath: ymlConfig.UString("filename"),
|
filePath: ymlConfig.UString("filename"),
|
||||||
}
|
}
|
||||||
|
@ -15,9 +15,9 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
offscreen = -1000
|
|
||||||
modalWidth = 80
|
|
||||||
modalHeight = 7
|
modalHeight = 7
|
||||||
|
modalWidth = 80
|
||||||
|
offscreen = -1000
|
||||||
)
|
)
|
||||||
|
|
||||||
// A Widget represents a Todo widget
|
// A Widget represents a Todo widget
|
||||||
@ -36,7 +36,7 @@ type Widget struct {
|
|||||||
func NewWidget(app *tview.Application, pages *tview.Pages, settings *Settings) *Widget {
|
func NewWidget(app *tview.Application, pages *tview.Pages, settings *Settings) *Widget {
|
||||||
widget := Widget{
|
widget := Widget{
|
||||||
KeyboardWidget: view.NewKeyboardWidget(app, pages, settings.common),
|
KeyboardWidget: view.NewKeyboardWidget(app, pages, settings.common),
|
||||||
TextWidget: view.NewTextWidget(app, settings.common, true),
|
TextWidget: view.NewTextWidget(app, settings.common),
|
||||||
|
|
||||||
app: app,
|
app: app,
|
||||||
settings: settings,
|
settings: settings,
|
||||||
|
@ -7,7 +7,10 @@ import (
|
|||||||
"github.com/wtfutil/wtf/cfg"
|
"github.com/wtfutil/wtf/cfg"
|
||||||
)
|
)
|
||||||
|
|
||||||
const defaultTitle = "Todoist"
|
const (
|
||||||
|
defaultFocusable = true
|
||||||
|
defaultTitle = "Todoist"
|
||||||
|
)
|
||||||
|
|
||||||
type Settings struct {
|
type Settings struct {
|
||||||
common *cfg.Common
|
common *cfg.Common
|
||||||
@ -19,7 +22,7 @@ type Settings struct {
|
|||||||
func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *config.Config) *Settings {
|
func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *config.Config) *Settings {
|
||||||
|
|
||||||
settings := 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_TODOIST_TOKEN"))),
|
apiKey: ymlConfig.UString("apiKey", ymlConfig.UString("apikey", os.Getenv("WTF_TODOIST_TOKEN"))),
|
||||||
projects: ymlConfig.UList("projects"),
|
projects: ymlConfig.UList("projects"),
|
||||||
|
@ -21,7 +21,7 @@ func NewWidget(app *tview.Application, pages *tview.Pages, settings *Settings) *
|
|||||||
widget := Widget{
|
widget := Widget{
|
||||||
KeyboardWidget: view.NewKeyboardWidget(app, pages, settings.common),
|
KeyboardWidget: view.NewKeyboardWidget(app, pages, settings.common),
|
||||||
MultiSourceWidget: view.NewMultiSourceWidget(settings.common, "project", "projects"),
|
MultiSourceWidget: view.NewMultiSourceWidget(settings.common, "project", "projects"),
|
||||||
ScrollableWidget: view.NewScrollableWidget(app, settings.common, true),
|
ScrollableWidget: view.NewScrollableWidget(app, settings.common),
|
||||||
|
|
||||||
settings: settings,
|
settings: settings,
|
||||||
}
|
}
|
||||||
|
@ -5,6 +5,11 @@ import (
|
|||||||
"github.com/wtfutil/wtf/cfg"
|
"github.com/wtfutil/wtf/cfg"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
defaultFocusable = true
|
||||||
|
defaultTitle = "Transmission"
|
||||||
|
)
|
||||||
|
|
||||||
// Settings defines the configuration properties for this module
|
// Settings defines the configuration properties for this module
|
||||||
type Settings struct {
|
type Settings struct {
|
||||||
common *cfg.Common
|
common *cfg.Common
|
||||||
@ -17,14 +22,10 @@ type Settings struct {
|
|||||||
username string `help:"The username of the Transmission user"`
|
username string `help:"The username of the Transmission user"`
|
||||||
}
|
}
|
||||||
|
|
||||||
const (
|
|
||||||
defaultTitle = "Transmission"
|
|
||||||
)
|
|
||||||
|
|
||||||
// NewSettingsFromYAML creates a new settings instance from a YAML config block
|
// NewSettingsFromYAML creates a new settings instance from a YAML config block
|
||||||
func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *config.Config) *Settings {
|
func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *config.Config) *Settings {
|
||||||
settings := Settings{
|
settings := Settings{
|
||||||
common: cfg.NewCommonSettingsFromModule(name, defaultTitle, ymlConfig, globalConfig),
|
common: cfg.NewCommonSettingsFromModule(name, defaultTitle, defaultFocusable, ymlConfig, globalConfig),
|
||||||
|
|
||||||
host: ymlConfig.UString("host"),
|
host: ymlConfig.UString("host"),
|
||||||
https: ymlConfig.UBool("https", false),
|
https: ymlConfig.UBool("https", false),
|
||||||
|
@ -23,7 +23,7 @@ type Widget struct {
|
|||||||
func NewWidget(app *tview.Application, pages *tview.Pages, settings *Settings) *Widget {
|
func NewWidget(app *tview.Application, pages *tview.Pages, settings *Settings) *Widget {
|
||||||
widget := Widget{
|
widget := Widget{
|
||||||
KeyboardWidget: view.NewKeyboardWidget(app, pages, settings.common),
|
KeyboardWidget: view.NewKeyboardWidget(app, pages, settings.common),
|
||||||
ScrollableWidget: view.NewScrollableWidget(app, settings.common, true),
|
ScrollableWidget: view.NewScrollableWidget(app, settings.common),
|
||||||
|
|
||||||
settings: settings,
|
settings: settings,
|
||||||
}
|
}
|
||||||
|
@ -7,7 +7,10 @@ import (
|
|||||||
"github.com/wtfutil/wtf/cfg"
|
"github.com/wtfutil/wtf/cfg"
|
||||||
)
|
)
|
||||||
|
|
||||||
const defaultTitle = "TravisCI"
|
const (
|
||||||
|
defaultFocusable = true
|
||||||
|
defaultTitle = "TravisCI"
|
||||||
|
)
|
||||||
|
|
||||||
type Settings struct {
|
type Settings struct {
|
||||||
common *cfg.Common
|
common *cfg.Common
|
||||||
@ -20,9 +23,8 @@ type Settings struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *config.Config) *Settings {
|
func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *config.Config) *Settings {
|
||||||
|
|
||||||
settings := 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_TRAVIS_API_TOKEN"))),
|
apiKey: ymlConfig.UString("apiKey", ymlConfig.UString("apikey", os.Getenv("WTF_TRAVIS_API_TOKEN"))),
|
||||||
pro: ymlConfig.UBool("pro", false),
|
pro: ymlConfig.UBool("pro", false),
|
||||||
|
@ -21,7 +21,7 @@ type Widget struct {
|
|||||||
func NewWidget(app *tview.Application, pages *tview.Pages, settings *Settings) *Widget {
|
func NewWidget(app *tview.Application, pages *tview.Pages, settings *Settings) *Widget {
|
||||||
widget := Widget{
|
widget := Widget{
|
||||||
KeyboardWidget: view.NewKeyboardWidget(app, pages, settings.common),
|
KeyboardWidget: view.NewKeyboardWidget(app, pages, settings.common),
|
||||||
ScrollableWidget: view.NewScrollableWidget(app, settings.common, true),
|
ScrollableWidget: view.NewScrollableWidget(app, settings.common),
|
||||||
|
|
||||||
settings: settings,
|
settings: settings,
|
||||||
}
|
}
|
||||||
|
@ -7,7 +7,10 @@ import (
|
|||||||
"github.com/wtfutil/wtf/cfg"
|
"github.com/wtfutil/wtf/cfg"
|
||||||
)
|
)
|
||||||
|
|
||||||
const defaultTitle = "Trello"
|
const (
|
||||||
|
defaultFocusable = false
|
||||||
|
defaultTitle = "Trello"
|
||||||
|
)
|
||||||
|
|
||||||
type Settings struct {
|
type Settings struct {
|
||||||
common *cfg.Common
|
common *cfg.Common
|
||||||
@ -20,9 +23,8 @@ type Settings struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *config.Config) *Settings {
|
func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *config.Config) *Settings {
|
||||||
|
|
||||||
settings := Settings{
|
settings := Settings{
|
||||||
common: cfg.NewCommonSettingsFromModule(name, defaultTitle, ymlConfig, globalConfig),
|
common: cfg.NewCommonSettingsFromModule(name, defaultTitle, defaultFocusable, ymlConfig, globalConfig),
|
||||||
|
|
||||||
accessToken: ymlConfig.UString("accessToken", ymlConfig.UString("apikey", os.Getenv("WTF_TRELLO_ACCESS_TOKEN"))),
|
accessToken: ymlConfig.UString("accessToken", ymlConfig.UString("apikey", os.Getenv("WTF_TRELLO_ACCESS_TOKEN"))),
|
||||||
apiKey: ymlConfig.UString("apiKey", os.Getenv("WTF_TRELLO_APP_KEY")),
|
apiKey: ymlConfig.UString("apiKey", os.Getenv("WTF_TRELLO_APP_KEY")),
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user