mirror of
https://github.com/taigrr/wtf
synced 2025-01-18 04:03:14 -08:00
Merge pull request #418 from Seanstoppable/dupespoc2
Allow duplicates of modules
This commit is contained in:
commit
3e727c52ff
@ -61,7 +61,7 @@ type Common struct {
|
|||||||
focusChar int
|
focusChar int
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewCommonSettingsFromModule(name string, moduleConfig *config.Config, globalSettings *config.Config) *Common {
|
func NewCommonSettingsFromModule(name, defaultTitle string, moduleConfig *config.Config, globalSettings *config.Config) *Common {
|
||||||
colorsConfig, _ := globalSettings.Get("wtf.colors")
|
colorsConfig, _ := globalSettings.Get("wtf.colors")
|
||||||
positionPath := "position"
|
positionPath := "position"
|
||||||
sigilsPath := "wtf.sigils"
|
sigilsPath := "wtf.sigils"
|
||||||
@ -93,7 +93,7 @@ func NewCommonSettingsFromModule(name string, moduleConfig *config.Config, globa
|
|||||||
|
|
||||||
Enabled: moduleConfig.UBool("enabled", false),
|
Enabled: moduleConfig.UBool("enabled", false),
|
||||||
RefreshInterval: moduleConfig.UInt("refreshInterval", 300),
|
RefreshInterval: moduleConfig.UInt("refreshInterval", 300),
|
||||||
Title: moduleConfig.UString("title", name),
|
Title: moduleConfig.UString("title", defaultTitle),
|
||||||
Config: moduleConfig,
|
Config: moduleConfig,
|
||||||
|
|
||||||
focusChar: moduleConfig.UInt("focusChar", -1),
|
focusChar: moduleConfig.UInt("focusChar", -1),
|
||||||
|
@ -59,7 +59,7 @@ func (widget *Widget) Refresh() {
|
|||||||
logLines := widget.tailFile()
|
logLines := widget.tailFile()
|
||||||
|
|
||||||
widget.app.QueueUpdateDraw(func() {
|
widget.app.QueueUpdateDraw(func() {
|
||||||
widget.View.SetTitle(widget.Name())
|
widget.View.SetTitle(widget.CommonSettings.Title)
|
||||||
widget.View.SetText(widget.contentFrom(logLines))
|
widget.View.SetText(widget.contentFrom(logLines))
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -5,7 +5,7 @@ import (
|
|||||||
"github.com/wtfutil/wtf/cfg"
|
"github.com/wtfutil/wtf/cfg"
|
||||||
)
|
)
|
||||||
|
|
||||||
const configKey = "logger"
|
const defaultTitle = "Logger"
|
||||||
|
|
||||||
type Settings struct {
|
type Settings struct {
|
||||||
common *cfg.Common
|
common *cfg.Common
|
||||||
@ -13,7 +13,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, ymlConfig, globalConfig),
|
common: cfg.NewCommonSettingsFromModule(name, defaultTitle, ymlConfig, globalConfig),
|
||||||
}
|
}
|
||||||
|
|
||||||
return &settings
|
return &settings
|
||||||
|
@ -56,147 +56,148 @@ func MakeWidget(
|
|||||||
app *tview.Application,
|
app *tview.Application,
|
||||||
pages *tview.Pages,
|
pages *tview.Pages,
|
||||||
widgetName string,
|
widgetName string,
|
||||||
|
widgetType string,
|
||||||
moduleConfig *config.Config,
|
moduleConfig *config.Config,
|
||||||
globalConfig *config.Config,
|
globalConfig *config.Config,
|
||||||
) wtf.Wtfable {
|
) wtf.Wtfable {
|
||||||
var widget wtf.Wtfable
|
var widget wtf.Wtfable
|
||||||
|
|
||||||
// Always in alphabetical order
|
// Always in alphabetical order
|
||||||
switch widgetName {
|
switch widgetType {
|
||||||
case "bamboohr":
|
case "bamboohr":
|
||||||
settings := bamboohr.NewSettingsFromYAML("BambooHR", moduleConfig, globalConfig)
|
settings := bamboohr.NewSettingsFromYAML(widgetName, moduleConfig, globalConfig)
|
||||||
widget = bamboohr.NewWidget(app, settings)
|
widget = bamboohr.NewWidget(app, settings)
|
||||||
case "bargraph":
|
case "bargraph":
|
||||||
settings := bargraph.NewSettingsFromYAML(widgetName, moduleConfig, globalConfig)
|
settings := bargraph.NewSettingsFromYAML(widgetName, moduleConfig, globalConfig)
|
||||||
widget = bargraph.NewWidget(app, settings)
|
widget = bargraph.NewWidget(app, settings)
|
||||||
case "bittrex":
|
case "bittrex":
|
||||||
settings := bittrex.NewSettingsFromYAML("Bittrex", moduleConfig, globalConfig)
|
settings := bittrex.NewSettingsFromYAML(widgetName, moduleConfig, globalConfig)
|
||||||
widget = bittrex.NewWidget(app, settings)
|
widget = bittrex.NewWidget(app, settings)
|
||||||
case "blockfolio":
|
case "blockfolio":
|
||||||
settings := blockfolio.NewSettingsFromYAML("Blockfolio", moduleConfig, globalConfig)
|
settings := blockfolio.NewSettingsFromYAML(widgetName, moduleConfig, globalConfig)
|
||||||
widget = blockfolio.NewWidget(app, settings)
|
widget = blockfolio.NewWidget(app, settings)
|
||||||
case "circleci":
|
case "circleci":
|
||||||
settings := circleci.NewSettingsFromYAML("CircleCI", moduleConfig, globalConfig)
|
settings := circleci.NewSettingsFromYAML(widgetName, moduleConfig, globalConfig)
|
||||||
widget = circleci.NewWidget(app, settings)
|
widget = circleci.NewWidget(app, settings)
|
||||||
case "clocks":
|
case "clocks":
|
||||||
settings := clocks.NewSettingsFromYAML("Clocks", moduleConfig, globalConfig)
|
settings := clocks.NewSettingsFromYAML(widgetName, moduleConfig, globalConfig)
|
||||||
widget = clocks.NewWidget(app, settings)
|
widget = clocks.NewWidget(app, settings)
|
||||||
case "cmdrunner":
|
case "cmdrunner":
|
||||||
settings := cmdrunner.NewSettingsFromYAML("CmdRunner", moduleConfig, globalConfig)
|
settings := cmdrunner.NewSettingsFromYAML(widgetName, moduleConfig, globalConfig)
|
||||||
widget = cmdrunner.NewWidget(app, settings)
|
widget = cmdrunner.NewWidget(app, settings)
|
||||||
case "cryptolive":
|
case "cryptolive":
|
||||||
settings := cryptolive.NewSettingsFromYAML("CryptoLive", moduleConfig, globalConfig)
|
settings := cryptolive.NewSettingsFromYAML(widgetName, moduleConfig, globalConfig)
|
||||||
widget = cryptolive.NewWidget(app, settings)
|
widget = cryptolive.NewWidget(app, settings)
|
||||||
case "datadog":
|
case "datadog":
|
||||||
settings := datadog.NewSettingsFromYAML("DataDog", moduleConfig, globalConfig)
|
settings := datadog.NewSettingsFromYAML(widgetName, moduleConfig, globalConfig)
|
||||||
widget = datadog.NewWidget(app, settings)
|
widget = datadog.NewWidget(app, settings)
|
||||||
case "gcal":
|
case "gcal":
|
||||||
settings := gcal.NewSettingsFromYAML("Calendar", moduleConfig, globalConfig)
|
settings := gcal.NewSettingsFromYAML(widgetName, moduleConfig, globalConfig)
|
||||||
widget = gcal.NewWidget(app, settings)
|
widget = gcal.NewWidget(app, settings)
|
||||||
case "gerrit":
|
case "gerrit":
|
||||||
settings := gerrit.NewSettingsFromYAML("Gerrit", moduleConfig, globalConfig)
|
settings := gerrit.NewSettingsFromYAML(widgetName, moduleConfig, globalConfig)
|
||||||
widget = gerrit.NewWidget(app, pages, settings)
|
widget = gerrit.NewWidget(app, pages, settings)
|
||||||
case "git":
|
case "git":
|
||||||
settings := git.NewSettingsFromYAML("Git", moduleConfig, globalConfig)
|
settings := git.NewSettingsFromYAML(widgetName, moduleConfig, globalConfig)
|
||||||
widget = git.NewWidget(app, pages, settings)
|
widget = git.NewWidget(app, pages, settings)
|
||||||
case "github":
|
case "github":
|
||||||
settings := github.NewSettingsFromYAML("GitHub", moduleConfig, globalConfig)
|
settings := github.NewSettingsFromYAML(widgetName, moduleConfig, globalConfig)
|
||||||
widget = github.NewWidget(app, pages, settings)
|
widget = github.NewWidget(app, pages, settings)
|
||||||
case "gitlab":
|
case "gitlab":
|
||||||
settings := gitlab.NewSettingsFromYAML("GitLab", moduleConfig, globalConfig)
|
settings := gitlab.NewSettingsFromYAML(widgetName, moduleConfig, globalConfig)
|
||||||
widget = gitlab.NewWidget(app, pages, settings)
|
widget = gitlab.NewWidget(app, pages, settings)
|
||||||
case "gitter":
|
case "gitter":
|
||||||
settings := gitter.NewSettingsFromYAML("Gitter", moduleConfig, globalConfig)
|
settings := gitter.NewSettingsFromYAML(widgetName, moduleConfig, globalConfig)
|
||||||
widget = gitter.NewWidget(app, pages, settings)
|
widget = gitter.NewWidget(app, pages, settings)
|
||||||
case "gspreadsheets":
|
case "gspreadsheets":
|
||||||
settings := gspreadsheets.NewSettingsFromYAML("Google Spreadsheets", moduleConfig, globalConfig)
|
settings := gspreadsheets.NewSettingsFromYAML(widgetName, moduleConfig, globalConfig)
|
||||||
widget = gspreadsheets.NewWidget(app, settings)
|
widget = gspreadsheets.NewWidget(app, settings)
|
||||||
case "hackernews":
|
case "hackernews":
|
||||||
settings := hackernews.NewSettingsFromYAML("HackerNews", moduleConfig, globalConfig)
|
settings := hackernews.NewSettingsFromYAML(widgetName, moduleConfig, globalConfig)
|
||||||
widget = hackernews.NewWidget(app, pages, settings)
|
widget = hackernews.NewWidget(app, pages, settings)
|
||||||
case "ipapi":
|
case "ipapi":
|
||||||
settings := ipapi.NewSettingsFromYAML("IPAPI", moduleConfig, globalConfig)
|
settings := ipapi.NewSettingsFromYAML(widgetName, moduleConfig, globalConfig)
|
||||||
widget = ipapi.NewWidget(app, settings)
|
widget = ipapi.NewWidget(app, settings)
|
||||||
case "ipinfo":
|
case "ipinfo":
|
||||||
settings := ipinfo.NewSettingsFromYAML("IPInfo", moduleConfig, globalConfig)
|
settings := ipinfo.NewSettingsFromYAML(widgetName, moduleConfig, globalConfig)
|
||||||
widget = ipinfo.NewWidget(app, settings)
|
widget = ipinfo.NewWidget(app, settings)
|
||||||
case "jenkins":
|
case "jenkins":
|
||||||
settings := jenkins.NewSettingsFromYAML("Jenkins", moduleConfig, globalConfig)
|
settings := jenkins.NewSettingsFromYAML(widgetName, moduleConfig, globalConfig)
|
||||||
widget = jenkins.NewWidget(app, pages, settings)
|
widget = jenkins.NewWidget(app, pages, settings)
|
||||||
case "jira":
|
case "jira":
|
||||||
settings := jira.NewSettingsFromYAML("Jira", moduleConfig, globalConfig)
|
settings := jira.NewSettingsFromYAML(widgetName, moduleConfig, globalConfig)
|
||||||
widget = jira.NewWidget(app, pages, settings)
|
widget = jira.NewWidget(app, pages, settings)
|
||||||
case "logger":
|
case "logger":
|
||||||
settings := logger.NewSettingsFromYAML("Log", moduleConfig, globalConfig)
|
settings := logger.NewSettingsFromYAML(widgetName, moduleConfig, globalConfig)
|
||||||
widget = logger.NewWidget(app, settings)
|
widget = logger.NewWidget(app, settings)
|
||||||
case "mercurial":
|
case "mercurial":
|
||||||
settings := mercurial.NewSettingsFromYAML("Mercurial", moduleConfig, globalConfig)
|
settings := mercurial.NewSettingsFromYAML(widgetName, moduleConfig, globalConfig)
|
||||||
widget = mercurial.NewWidget(app, pages, settings)
|
widget = mercurial.NewWidget(app, pages, settings)
|
||||||
case "nbascore":
|
case "nbascore":
|
||||||
settings := nbascore.NewSettingsFromYAML("NBA Score", moduleConfig, globalConfig)
|
settings := nbascore.NewSettingsFromYAML(widgetName, moduleConfig, globalConfig)
|
||||||
widget = nbascore.NewWidget(app, pages, settings)
|
widget = nbascore.NewWidget(app, pages, settings)
|
||||||
case "newrelic":
|
case "newrelic":
|
||||||
settings := newrelic.NewSettingsFromYAML("NewRelic", moduleConfig, globalConfig)
|
settings := newrelic.NewSettingsFromYAML(widgetName, moduleConfig, globalConfig)
|
||||||
widget = newrelic.NewWidget(app, settings)
|
widget = newrelic.NewWidget(app, settings)
|
||||||
case "opsgenie":
|
case "opsgenie":
|
||||||
settings := opsgenie.NewSettingsFromYAML("OpsGenie", moduleConfig, globalConfig)
|
settings := opsgenie.NewSettingsFromYAML(widgetName, moduleConfig, globalConfig)
|
||||||
widget = opsgenie.NewWidget(app, settings)
|
widget = opsgenie.NewWidget(app, settings)
|
||||||
case "pagerduty":
|
case "pagerduty":
|
||||||
settings := pagerduty.NewSettingsFromYAML("PagerDuty", moduleConfig, globalConfig)
|
settings := pagerduty.NewSettingsFromYAML(widgetName, moduleConfig, globalConfig)
|
||||||
widget = pagerduty.NewWidget(app, settings)
|
widget = pagerduty.NewWidget(app, settings)
|
||||||
case "power":
|
case "power":
|
||||||
settings := power.NewSettingsFromYAML("Power", moduleConfig, globalConfig)
|
settings := power.NewSettingsFromYAML(widgetName, moduleConfig, globalConfig)
|
||||||
widget = power.NewWidget(app, settings)
|
widget = power.NewWidget(app, settings)
|
||||||
case "prettyweather":
|
case "prettyweather":
|
||||||
settings := prettyweather.NewSettingsFromYAML("Pretty Weather", moduleConfig, globalConfig)
|
settings := prettyweather.NewSettingsFromYAML(widgetName, moduleConfig, globalConfig)
|
||||||
widget = prettyweather.NewWidget(app, settings)
|
widget = prettyweather.NewWidget(app, settings)
|
||||||
case "resourceusage":
|
case "resourceusage":
|
||||||
settings := resourceusage.NewSettingsFromYAML("Resource Usage", moduleConfig, globalConfig)
|
settings := resourceusage.NewSettingsFromYAML(widgetName, moduleConfig, globalConfig)
|
||||||
widget = resourceusage.NewWidget(app, settings)
|
widget = resourceusage.NewWidget(app, settings)
|
||||||
case "rollbar":
|
case "rollbar":
|
||||||
settings := rollbar.NewSettingsFromYAML("Rollbar", moduleConfig, globalConfig)
|
settings := rollbar.NewSettingsFromYAML(widgetName, moduleConfig, globalConfig)
|
||||||
widget = rollbar.NewWidget(app, pages, settings)
|
widget = rollbar.NewWidget(app, pages, settings)
|
||||||
case "security":
|
case "security":
|
||||||
settings := security.NewSettingsFromYAML("Security", moduleConfig, globalConfig)
|
settings := security.NewSettingsFromYAML(widgetName, moduleConfig, globalConfig)
|
||||||
widget = security.NewWidget(app, settings)
|
widget = security.NewWidget(app, settings)
|
||||||
case "spotify":
|
case "spotify":
|
||||||
settings := spotify.NewSettingsFromYAML("Spotify", moduleConfig, globalConfig)
|
settings := spotify.NewSettingsFromYAML(widgetName, moduleConfig, globalConfig)
|
||||||
widget = spotify.NewWidget(app, pages, settings)
|
widget = spotify.NewWidget(app, pages, settings)
|
||||||
case "spotifyweb":
|
case "spotifyweb":
|
||||||
settings := spotifyweb.NewSettingsFromYAML("Spotify Web", moduleConfig, globalConfig)
|
settings := spotifyweb.NewSettingsFromYAML(widgetName, moduleConfig, globalConfig)
|
||||||
widget = spotifyweb.NewWidget(app, pages, settings)
|
widget = spotifyweb.NewWidget(app, pages, settings)
|
||||||
case "status":
|
case "status":
|
||||||
settings := status.NewSettingsFromYAML("Status", moduleConfig, globalConfig)
|
settings := status.NewSettingsFromYAML(widgetName, moduleConfig, globalConfig)
|
||||||
widget = status.NewWidget(app, settings)
|
widget = status.NewWidget(app, settings)
|
||||||
// case "system":
|
// case "system":
|
||||||
// settings := system.NewSettingsFromYAML("System", moduleConfig, globalConfig)
|
// settings := system.NewSettingsFromYAML(widgetName, moduleConfig, globalConfig)
|
||||||
// widget = system.NewWidget(app, date, version, settings)
|
// widget = system.NewWidget(app, date, version, settings)
|
||||||
case "textfile":
|
case "textfile":
|
||||||
settings := textfile.NewSettingsFromYAML("Textfile", moduleConfig, globalConfig)
|
settings := textfile.NewSettingsFromYAML(widgetName, moduleConfig, globalConfig)
|
||||||
widget = textfile.NewWidget(app, pages, settings)
|
widget = textfile.NewWidget(app, pages, settings)
|
||||||
case "todo":
|
case "todo":
|
||||||
settings := todo.NewSettingsFromYAML("Todo", moduleConfig, globalConfig)
|
settings := todo.NewSettingsFromYAML(widgetName, moduleConfig, globalConfig)
|
||||||
widget = todo.NewWidget(app, pages, settings)
|
widget = todo.NewWidget(app, pages, settings)
|
||||||
case "todoist":
|
case "todoist":
|
||||||
settings := todoist.NewSettingsFromYAML("Todoist", moduleConfig, globalConfig)
|
settings := todoist.NewSettingsFromYAML(widgetName, moduleConfig, globalConfig)
|
||||||
widget = todoist.NewWidget(app, pages, settings)
|
widget = todoist.NewWidget(app, pages, settings)
|
||||||
case "travisci":
|
case "travisci":
|
||||||
settings := travisci.NewSettingsFromYAML("TravisCI", moduleConfig, globalConfig)
|
settings := travisci.NewSettingsFromYAML(widgetName, moduleConfig, globalConfig)
|
||||||
widget = travisci.NewWidget(app, pages, settings)
|
widget = travisci.NewWidget(app, pages, settings)
|
||||||
case "trello":
|
case "trello":
|
||||||
settings := trello.NewSettingsFromYAML("Trello", moduleConfig, globalConfig)
|
settings := trello.NewSettingsFromYAML(widgetName, moduleConfig, globalConfig)
|
||||||
widget = trello.NewWidget(app, settings)
|
widget = trello.NewWidget(app, settings)
|
||||||
case "twitter":
|
case "twitter":
|
||||||
settings := twitter.NewSettingsFromYAML("Twitter", moduleConfig, globalConfig)
|
settings := twitter.NewSettingsFromYAML(widgetName, moduleConfig, globalConfig)
|
||||||
widget = twitter.NewWidget(app, pages, settings)
|
widget = twitter.NewWidget(app, pages, settings)
|
||||||
case "victorops":
|
case "victorops":
|
||||||
settings := victorops.NewSettingsFromYAML("VictorOps - OnCall", moduleConfig, globalConfig)
|
settings := victorops.NewSettingsFromYAML(widgetName, moduleConfig, globalConfig)
|
||||||
widget = victorops.NewWidget(app, settings)
|
widget = victorops.NewWidget(app, settings)
|
||||||
case "weather":
|
case "weather":
|
||||||
settings := weather.NewSettingsFromYAML("Weather", moduleConfig, globalConfig)
|
settings := weather.NewSettingsFromYAML(widgetName, moduleConfig, globalConfig)
|
||||||
widget = weather.NewWidget(app, pages, settings)
|
widget = weather.NewWidget(app, pages, settings)
|
||||||
case "zendesk":
|
case "zendesk":
|
||||||
settings := zendesk.NewSettingsFromYAML("Zendesk", moduleConfig, globalConfig)
|
settings := zendesk.NewSettingsFromYAML(widgetName, moduleConfig, globalConfig)
|
||||||
widget = zendesk.NewWidget(app, settings)
|
widget = zendesk.NewWidget(app, settings)
|
||||||
default:
|
default:
|
||||||
settings := unknown.NewSettingsFromYAML(widgetName, moduleConfig, globalConfig)
|
settings := unknown.NewSettingsFromYAML(widgetName, moduleConfig, globalConfig)
|
||||||
@ -213,8 +214,9 @@ func MakeWidgets(app *tview.Application, pages *tview.Pages, config *config.Conf
|
|||||||
|
|
||||||
for mod := range mods {
|
for mod := range mods {
|
||||||
modConfig, _ := config.Get("wtf.mods." + mod)
|
modConfig, _ := config.Get("wtf.mods." + mod)
|
||||||
|
widgetType := modConfig.UString("type", mod)
|
||||||
if enabled := modConfig.UBool("enabled", false); enabled {
|
if enabled := modConfig.UBool("enabled", false); enabled {
|
||||||
widget := MakeWidget(app, pages, mod, modConfig, config)
|
widget := MakeWidget(app, pages, mod, widgetType, modConfig, config)
|
||||||
widgets = append(widgets, widget)
|
widgets = append(widgets, widget)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -7,7 +7,7 @@ import (
|
|||||||
"github.com/wtfutil/wtf/cfg"
|
"github.com/wtfutil/wtf/cfg"
|
||||||
)
|
)
|
||||||
|
|
||||||
const configKey = "bamboohr"
|
const defaultTitle = "BambooHR"
|
||||||
|
|
||||||
type Settings struct {
|
type Settings struct {
|
||||||
common *cfg.Common
|
common *cfg.Common
|
||||||
@ -19,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, ymlConfig, globalConfig),
|
common: cfg.NewCommonSettingsFromModule(name, defaultTitle, ymlConfig, globalConfig),
|
||||||
|
|
||||||
apiKey: ymlConfig.UString("apiKey", os.Getenv("WTF_BAMBOO_HR_TOKEN")),
|
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")),
|
||||||
|
@ -5,13 +5,15 @@ import (
|
|||||||
"github.com/wtfutil/wtf/cfg"
|
"github.com/wtfutil/wtf/cfg"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const defaultTitle = "Bargraph"
|
||||||
|
|
||||||
type Settings struct {
|
type Settings struct {
|
||||||
common *cfg.Common
|
common *cfg.Common
|
||||||
}
|
}
|
||||||
|
|
||||||
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, ymlConfig, globalConfig),
|
common: cfg.NewCommonSettingsFromModule(name, defaultTitle, ymlConfig, globalConfig),
|
||||||
}
|
}
|
||||||
|
|
||||||
return &settings
|
return &settings
|
||||||
|
@ -7,7 +7,7 @@ import (
|
|||||||
"github.com/wtfutil/wtf/cfg"
|
"github.com/wtfutil/wtf/cfg"
|
||||||
)
|
)
|
||||||
|
|
||||||
const configKey = "circleci"
|
const defaultTitle = "CircleCI"
|
||||||
|
|
||||||
type Settings struct {
|
type Settings struct {
|
||||||
common *cfg.Common
|
common *cfg.Common
|
||||||
@ -18,7 +18,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, ymlConfig, globalConfig),
|
common: cfg.NewCommonSettingsFromModule(name, defaultTitle, ymlConfig, globalConfig),
|
||||||
|
|
||||||
apiKey: ymlConfig.UString("apiKey", os.Getenv("WTF_CIRCLE_API_KEY")),
|
apiKey: ymlConfig.UString("apiKey", os.Getenv("WTF_CIRCLE_API_KEY")),
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,7 @@ import (
|
|||||||
"github.com/wtfutil/wtf/wtf"
|
"github.com/wtfutil/wtf/wtf"
|
||||||
)
|
)
|
||||||
|
|
||||||
const configKey = "clocks"
|
const defaultTitle = "Clocks"
|
||||||
|
|
||||||
type colors struct {
|
type colors struct {
|
||||||
rows struct {
|
rows struct {
|
||||||
@ -28,7 +28,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, ymlConfig, globalConfig),
|
common: cfg.NewCommonSettingsFromModule(name, defaultTitle, ymlConfig, globalConfig),
|
||||||
|
|
||||||
dateFormat: ymlConfig.UString("dateFormat", wtf.SimpleDateFormat),
|
dateFormat: ymlConfig.UString("dateFormat", wtf.SimpleDateFormat),
|
||||||
timeFormat: ymlConfig.UString("timeFormat", wtf.SimpleTimeFormat),
|
timeFormat: ymlConfig.UString("timeFormat", wtf.SimpleTimeFormat),
|
@ -6,7 +6,7 @@ import (
|
|||||||
"github.com/wtfutil/wtf/wtf"
|
"github.com/wtfutil/wtf/wtf"
|
||||||
)
|
)
|
||||||
|
|
||||||
const configKey = "cmdrunner"
|
const defaultTitle = "CmdRunner"
|
||||||
|
|
||||||
type Settings struct {
|
type Settings struct {
|
||||||
common *cfg.Common
|
common *cfg.Common
|
||||||
@ -15,13 +15,13 @@ type Settings struct {
|
|||||||
cmd string
|
cmd string
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewSettingsFromYAML(name string, ymlConfig *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, ymlConfig, globalConfig),
|
common: cfg.NewCommonSettingsFromModule(name, defaultTitle, moduleConfig, globalConfig),
|
||||||
|
|
||||||
args: wtf.ToStrs(ymlConfig.UList("args")),
|
args: wtf.ToStrs(moduleConfig.UList("args")),
|
||||||
cmd: ymlConfig.UString("cmd"),
|
cmd: moduleConfig.UString("cmd"),
|
||||||
}
|
}
|
||||||
|
|
||||||
return &settings
|
return &settings
|
||||||
|
@ -5,7 +5,7 @@ import (
|
|||||||
"github.com/wtfutil/wtf/cfg"
|
"github.com/wtfutil/wtf/cfg"
|
||||||
)
|
)
|
||||||
|
|
||||||
const configKey = "bittrex"
|
const defaultTitle = "Bittrex"
|
||||||
|
|
||||||
type colors struct {
|
type colors struct {
|
||||||
base struct {
|
base struct {
|
||||||
@ -37,7 +37,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, ymlConfig, globalConfig),
|
common: cfg.NewCommonSettingsFromModule(name, defaultTitle, ymlConfig, globalConfig),
|
||||||
}
|
}
|
||||||
|
|
||||||
settings.colors.base.name = ymlConfig.UString("colors.base.name")
|
settings.colors.base.name = ymlConfig.UString("colors.base.name")
|
||||||
|
@ -5,7 +5,7 @@ import (
|
|||||||
"github.com/wtfutil/wtf/cfg"
|
"github.com/wtfutil/wtf/cfg"
|
||||||
)
|
)
|
||||||
|
|
||||||
const configKey = "blockfolio"
|
const defaultTitle = "Blockfolio"
|
||||||
|
|
||||||
type colors struct {
|
type colors struct {
|
||||||
name string
|
name string
|
||||||
@ -24,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, ymlConfig, globalConfig),
|
common: cfg.NewCommonSettingsFromModule(name, defaultTitle, ymlConfig, globalConfig),
|
||||||
|
|
||||||
deviceToken: ymlConfig.UString("device_token"),
|
deviceToken: ymlConfig.UString("device_token"),
|
||||||
displayHoldings: ymlConfig.UBool("displayHoldings", true),
|
displayHoldings: ymlConfig.UBool("displayHoldings", true),
|
||||||
|
@ -42,7 +42,7 @@ func (widget *Widget) Refresh() {
|
|||||||
content := widget.contentFrom(positions)
|
content := widget.contentFrom(positions)
|
||||||
|
|
||||||
widget.app.QueueUpdateDraw(func() {
|
widget.app.QueueUpdateDraw(func() {
|
||||||
widget.View.SetTitle(" Blockfolio ")
|
widget.View.SetTitle(widget.CommonSettings.Title)
|
||||||
widget.View.SetText(content)
|
widget.View.SetText(content)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -5,7 +5,7 @@ import (
|
|||||||
"github.com/wtfutil/wtf/cfg"
|
"github.com/wtfutil/wtf/cfg"
|
||||||
)
|
)
|
||||||
|
|
||||||
const configKey = "cryptolive"
|
const defaultTitle = "CryptoLive"
|
||||||
|
|
||||||
type colors struct {
|
type colors struct {
|
||||||
from struct {
|
from struct {
|
||||||
@ -43,7 +43,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, ymlConfig, globalConfig),
|
common: cfg.NewCommonSettingsFromModule(name, defaultTitle, ymlConfig, globalConfig),
|
||||||
}
|
}
|
||||||
|
|
||||||
settings.colors.from.name = ymlConfig.UString("colors.from.name")
|
settings.colors.from.name = ymlConfig.UString("colors.from.name")
|
||||||
|
@ -7,7 +7,7 @@ import (
|
|||||||
"github.com/wtfutil/wtf/modules/cryptoexchanges/cryptolive/toplist"
|
"github.com/wtfutil/wtf/modules/cryptoexchanges/cryptolive/toplist"
|
||||||
)
|
)
|
||||||
|
|
||||||
const configKey = "cryptolive"
|
const defaultTitle = "CryptolLive"
|
||||||
|
|
||||||
type colors struct {
|
type colors struct {
|
||||||
from struct {
|
from struct {
|
||||||
@ -48,7 +48,7 @@ func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *co
|
|||||||
top, _ := ymlConfig.Map("top")
|
top, _ := ymlConfig.Map("top")
|
||||||
|
|
||||||
settings := Settings{
|
settings := Settings{
|
||||||
common: cfg.NewCommonSettingsFromModule(name, ymlConfig, globalConfig),
|
common: cfg.NewCommonSettingsFromModule(name, defaultTitle, ymlConfig, globalConfig),
|
||||||
|
|
||||||
currencies: currencies,
|
currencies: currencies,
|
||||||
top: top,
|
top: top,
|
||||||
|
@ -5,7 +5,7 @@ import (
|
|||||||
"github.com/wtfutil/wtf/cfg"
|
"github.com/wtfutil/wtf/cfg"
|
||||||
)
|
)
|
||||||
|
|
||||||
const configKey = "cryptolive"
|
const defaultTitle = "CryptoLive"
|
||||||
|
|
||||||
type colors struct {
|
type colors struct {
|
||||||
from struct {
|
from struct {
|
||||||
@ -45,7 +45,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, ymlConfig, globalConfig),
|
common: cfg.NewCommonSettingsFromModule(name, defaultTitle, ymlConfig, globalConfig),
|
||||||
}
|
}
|
||||||
|
|
||||||
settings.colors.from.name = ymlConfig.UString("colors.from.name")
|
settings.colors.from.name = ymlConfig.UString("colors.from.name")
|
||||||
|
@ -7,7 +7,7 @@ import (
|
|||||||
"github.com/wtfutil/wtf/cfg"
|
"github.com/wtfutil/wtf/cfg"
|
||||||
)
|
)
|
||||||
|
|
||||||
const configKey = "datadog"
|
const defaultTitle = "DataDog"
|
||||||
|
|
||||||
type Settings struct {
|
type Settings struct {
|
||||||
common *cfg.Common
|
common *cfg.Common
|
||||||
@ -20,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, ymlConfig, globalConfig),
|
common: cfg.NewCommonSettingsFromModule(name, defaultTitle, ymlConfig, globalConfig),
|
||||||
|
|
||||||
apiKey: ymlConfig.UString("apiKey", os.Getenv("WTF_DATADOG_API_KEY")),
|
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")),
|
||||||
|
@ -5,7 +5,7 @@ import (
|
|||||||
"github.com/wtfutil/wtf/cfg"
|
"github.com/wtfutil/wtf/cfg"
|
||||||
)
|
)
|
||||||
|
|
||||||
const configKey = "gcal"
|
const defaultTitle = "Calendar"
|
||||||
|
|
||||||
type colors struct {
|
type colors struct {
|
||||||
day string
|
day string
|
||||||
@ -35,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, ymlConfig, globalConfig),
|
common: cfg.NewCommonSettingsFromModule(name, defaultTitle, ymlConfig, globalConfig),
|
||||||
|
|
||||||
conflictIcon: ymlConfig.UString("conflictIcon", "🚨"),
|
conflictIcon: ymlConfig.UString("conflictIcon", "🚨"),
|
||||||
currentIcon: ymlConfig.UString("currentIcon", "🔸"),
|
currentIcon: ymlConfig.UString("currentIcon", "🔸"),
|
||||||
|
@ -14,7 +14,7 @@ type colors struct {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const configKey = "gerrit"
|
const defaultTitle = "Gerrit"
|
||||||
|
|
||||||
type Settings struct {
|
type Settings struct {
|
||||||
colors
|
colors
|
||||||
@ -30,7 +30,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, ymlConfig, globalConfig),
|
common: cfg.NewCommonSettingsFromModule(name, defaultTitle, 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")),
|
||||||
|
@ -5,7 +5,7 @@ import (
|
|||||||
"github.com/wtfutil/wtf/cfg"
|
"github.com/wtfutil/wtf/cfg"
|
||||||
)
|
)
|
||||||
|
|
||||||
const configKey = "git"
|
const defaultTitle = "Git"
|
||||||
|
|
||||||
type Settings struct {
|
type Settings struct {
|
||||||
common *cfg.Common
|
common *cfg.Common
|
||||||
@ -19,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, ymlConfig, globalConfig),
|
common: cfg.NewCommonSettingsFromModule(name, defaultTitle, 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]"),
|
||||||
|
@ -7,7 +7,7 @@ import (
|
|||||||
"github.com/wtfutil/wtf/cfg"
|
"github.com/wtfutil/wtf/cfg"
|
||||||
)
|
)
|
||||||
|
|
||||||
const configKey = "github"
|
const defaultTitle = "GitHub"
|
||||||
|
|
||||||
type Settings struct {
|
type Settings struct {
|
||||||
common *cfg.Common
|
common *cfg.Common
|
||||||
@ -23,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, ymlConfig, globalConfig),
|
common: cfg.NewCommonSettingsFromModule(name, defaultTitle, ymlConfig, globalConfig),
|
||||||
|
|
||||||
apiKey: ymlConfig.UString("apiKey", os.Getenv("WTF_GITHUB_TOKEN")),
|
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")),
|
||||||
|
@ -7,7 +7,7 @@ import (
|
|||||||
"github.com/wtfutil/wtf/cfg"
|
"github.com/wtfutil/wtf/cfg"
|
||||||
)
|
)
|
||||||
|
|
||||||
const configKey = "gitlab"
|
const defaultTitle = "GitLab"
|
||||||
|
|
||||||
type Settings struct {
|
type Settings struct {
|
||||||
common *cfg.Common
|
common *cfg.Common
|
||||||
@ -21,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, ymlConfig, globalConfig),
|
common: cfg.NewCommonSettingsFromModule(name, defaultTitle, ymlConfig, globalConfig),
|
||||||
|
|
||||||
apiKey: ymlConfig.UString("apiKey", os.Getenv("WTF_GITLAB_TOKEN")),
|
apiKey: ymlConfig.UString("apiKey", os.Getenv("WTF_GITLAB_TOKEN")),
|
||||||
domain: ymlConfig.UString("domain"),
|
domain: ymlConfig.UString("domain"),
|
||||||
|
@ -7,7 +7,7 @@ import (
|
|||||||
"github.com/wtfutil/wtf/cfg"
|
"github.com/wtfutil/wtf/cfg"
|
||||||
)
|
)
|
||||||
|
|
||||||
const configKey = "gitter"
|
const defaultTitle = "Gitter"
|
||||||
|
|
||||||
type Settings struct {
|
type Settings struct {
|
||||||
common *cfg.Common
|
common *cfg.Common
|
||||||
@ -20,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, ymlConfig, globalConfig),
|
common: cfg.NewCommonSettingsFromModule(name, defaultTitle, 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),
|
||||||
|
@ -59,6 +59,7 @@ func (widget *Widget) Refresh() {
|
|||||||
room, err := GetRoom(widget.settings.roomURI, widget.settings.apiToken)
|
room, err := GetRoom(widget.settings.roomURI, widget.settings.apiToken)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
widget.View.SetWrap(true)
|
widget.View.SetWrap(true)
|
||||||
|
widget.View.SetTitle(widget.CommonSettings.Title)
|
||||||
widget.View.SetText(err.Error())
|
widget.View.SetText(err.Error())
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -73,6 +74,7 @@ func (widget *Widget) Refresh() {
|
|||||||
widget.View.SetWrap(true)
|
widget.View.SetWrap(true)
|
||||||
|
|
||||||
widget.app.QueueUpdateDraw(func() {
|
widget.app.QueueUpdateDraw(func() {
|
||||||
|
widget.View.SetTitle(widget.CommonSettings.Title)
|
||||||
widget.View.SetText(err.Error())
|
widget.View.SetText(err.Error())
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
|
@ -5,7 +5,7 @@ import (
|
|||||||
"github.com/wtfutil/wtf/cfg"
|
"github.com/wtfutil/wtf/cfg"
|
||||||
)
|
)
|
||||||
|
|
||||||
const configKey = "gspreadsheets"
|
const defaultTitle = "Google Spreadsheets"
|
||||||
|
|
||||||
type colors struct {
|
type colors struct {
|
||||||
values string
|
values string
|
||||||
@ -24,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, ymlConfig, globalConfig),
|
common: cfg.NewCommonSettingsFromModule(name, defaultTitle, ymlConfig, globalConfig),
|
||||||
|
|
||||||
cellNames: ymlConfig.UList("cells.names"),
|
cellNames: ymlConfig.UList("cells.names"),
|
||||||
secretFile: ymlConfig.UString("secretFile"),
|
secretFile: ymlConfig.UString("secretFile"),
|
||||||
|
@ -5,7 +5,7 @@ import (
|
|||||||
"github.com/wtfutil/wtf/cfg"
|
"github.com/wtfutil/wtf/cfg"
|
||||||
)
|
)
|
||||||
|
|
||||||
const configKey = "hackernews"
|
const defaultTitle = "HackerNews"
|
||||||
|
|
||||||
type Settings struct {
|
type Settings struct {
|
||||||
common *cfg.Common
|
common *cfg.Common
|
||||||
@ -17,7 +17,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, ymlConfig, globalConfig),
|
common: cfg.NewCommonSettingsFromModule(name, defaultTitle, ymlConfig, globalConfig),
|
||||||
|
|
||||||
numberOfStories: ymlConfig.UInt("numberOfStories", 10),
|
numberOfStories: ymlConfig.UInt("numberOfStories", 10),
|
||||||
storyType: ymlConfig.UString("storyType", "top"),
|
storyType: ymlConfig.UString("storyType", "top"),
|
||||||
|
@ -5,7 +5,7 @@ import (
|
|||||||
"github.com/wtfutil/wtf/cfg"
|
"github.com/wtfutil/wtf/cfg"
|
||||||
)
|
)
|
||||||
|
|
||||||
const configKey = "ipapi"
|
const defaultTitle = "IP API"
|
||||||
|
|
||||||
type colors struct {
|
type colors struct {
|
||||||
name string
|
name string
|
||||||
@ -20,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, ymlConfig, globalConfig),
|
common: cfg.NewCommonSettingsFromModule(name, defaultTitle, ymlConfig, globalConfig),
|
||||||
}
|
}
|
||||||
|
|
||||||
settings.colors.name = ymlConfig.UString("colors.name", "red")
|
settings.colors.name = ymlConfig.UString("colors.name", "red")
|
||||||
|
@ -5,7 +5,7 @@ import (
|
|||||||
"github.com/wtfutil/wtf/cfg"
|
"github.com/wtfutil/wtf/cfg"
|
||||||
)
|
)
|
||||||
|
|
||||||
const configKey = "ipinfo"
|
const defaultTitle = "IPInfo"
|
||||||
|
|
||||||
type colors struct {
|
type colors struct {
|
||||||
name string
|
name string
|
||||||
@ -20,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, ymlConfig, globalConfig),
|
common: cfg.NewCommonSettingsFromModule(name, defaultTitle, ymlConfig, globalConfig),
|
||||||
}
|
}
|
||||||
|
|
||||||
settings.colors.name = ymlConfig.UString("colors.name", "red")
|
settings.colors.name = ymlConfig.UString("colors.name", "red")
|
||||||
|
@ -7,7 +7,7 @@ import (
|
|||||||
"github.com/wtfutil/wtf/cfg"
|
"github.com/wtfutil/wtf/cfg"
|
||||||
)
|
)
|
||||||
|
|
||||||
const configKey = "jenkins"
|
const defaultTitle = "Jenkins"
|
||||||
|
|
||||||
type Settings struct {
|
type Settings struct {
|
||||||
common *cfg.Common
|
common *cfg.Common
|
||||||
@ -23,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, ymlConfig, globalConfig),
|
common: cfg.NewCommonSettingsFromModule(name, defaultTitle, ymlConfig, globalConfig),
|
||||||
|
|
||||||
apiKey: ymlConfig.UString("apiKey", os.Getenv("WTF_JENKINS_API_KEY")),
|
apiKey: ymlConfig.UString("apiKey", os.Getenv("WTF_JENKINS_API_KEY")),
|
||||||
jobNameRegex: ymlConfig.UString("jobNameRegex", ".*"),
|
jobNameRegex: ymlConfig.UString("jobNameRegex", ".*"),
|
||||||
|
@ -7,7 +7,7 @@ import (
|
|||||||
"github.com/wtfutil/wtf/cfg"
|
"github.com/wtfutil/wtf/cfg"
|
||||||
)
|
)
|
||||||
|
|
||||||
const configKey = "jira"
|
const defaultTitle = "Jira"
|
||||||
|
|
||||||
type colors struct {
|
type colors struct {
|
||||||
rows struct {
|
rows struct {
|
||||||
@ -32,7 +32,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, ymlConfig, globalConfig),
|
common: cfg.NewCommonSettingsFromModule(name, defaultTitle, ymlConfig, globalConfig),
|
||||||
|
|
||||||
apiKey: ymlConfig.UString("apiKey", os.Getenv("WTF_JIRA_API_KEY")),
|
apiKey: ymlConfig.UString("apiKey", os.Getenv("WTF_JIRA_API_KEY")),
|
||||||
domain: ymlConfig.UString("domain"),
|
domain: ymlConfig.UString("domain"),
|
||||||
|
@ -5,7 +5,7 @@ import (
|
|||||||
"github.com/wtfutil/wtf/cfg"
|
"github.com/wtfutil/wtf/cfg"
|
||||||
)
|
)
|
||||||
|
|
||||||
const configKey = "mercurial"
|
const defaultTitle = "Mercurial"
|
||||||
|
|
||||||
type Settings struct {
|
type Settings struct {
|
||||||
common *cfg.Common
|
common *cfg.Common
|
||||||
@ -18,7 +18,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, ymlConfig, globalConfig),
|
common: cfg.NewCommonSettingsFromModule(name, defaultTitle, 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]"),
|
||||||
|
@ -5,7 +5,7 @@ import (
|
|||||||
"github.com/wtfutil/wtf/cfg"
|
"github.com/wtfutil/wtf/cfg"
|
||||||
)
|
)
|
||||||
|
|
||||||
const configKey = "nbascore"
|
const defaultTitle = "NBA Score"
|
||||||
|
|
||||||
type Settings struct {
|
type Settings struct {
|
||||||
common *cfg.Common
|
common *cfg.Common
|
||||||
@ -13,7 +13,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, ymlConfig, globalConfig),
|
common: cfg.NewCommonSettingsFromModule(name, defaultTitle, ymlConfig, globalConfig),
|
||||||
}
|
}
|
||||||
|
|
||||||
return &settings
|
return &settings
|
||||||
|
@ -7,7 +7,7 @@ import (
|
|||||||
"github.com/wtfutil/wtf/cfg"
|
"github.com/wtfutil/wtf/cfg"
|
||||||
)
|
)
|
||||||
|
|
||||||
const configKey = "newrelic"
|
const defaultTitle = "NewRelic"
|
||||||
|
|
||||||
type Settings struct {
|
type Settings struct {
|
||||||
common *cfg.Common
|
common *cfg.Common
|
||||||
@ -20,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, ymlConfig, globalConfig),
|
common: cfg.NewCommonSettingsFromModule(name, defaultTitle, ymlConfig, globalConfig),
|
||||||
|
|
||||||
apiKey: ymlConfig.UString("apiKey", os.Getenv("WTF_NEW_RELIC_API_KEY")),
|
apiKey: ymlConfig.UString("apiKey", os.Getenv("WTF_NEW_RELIC_API_KEY")),
|
||||||
applicationID: ymlConfig.UInt("applicationID"),
|
applicationID: ymlConfig.UInt("applicationID"),
|
||||||
|
@ -7,7 +7,7 @@ import (
|
|||||||
"github.com/wtfutil/wtf/cfg"
|
"github.com/wtfutil/wtf/cfg"
|
||||||
)
|
)
|
||||||
|
|
||||||
const configKey = "opsgenie"
|
const defaultTitle = "OpsGenie"
|
||||||
|
|
||||||
type Settings struct {
|
type Settings struct {
|
||||||
common *cfg.Common
|
common *cfg.Common
|
||||||
@ -21,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, ymlConfig, globalConfig),
|
common: cfg.NewCommonSettingsFromModule(name, defaultTitle, ymlConfig, globalConfig),
|
||||||
|
|
||||||
apiKey: ymlConfig.UString("apiKey", os.Getenv("WTF_OPS_GENIE_API_KEY")),
|
apiKey: ymlConfig.UString("apiKey", os.Getenv("WTF_OPS_GENIE_API_KEY")),
|
||||||
displayEmpty: ymlConfig.UBool("displayEmpty", true),
|
displayEmpty: ymlConfig.UBool("displayEmpty", true),
|
||||||
|
@ -7,7 +7,7 @@ import (
|
|||||||
"github.com/wtfutil/wtf/cfg"
|
"github.com/wtfutil/wtf/cfg"
|
||||||
)
|
)
|
||||||
|
|
||||||
const configKey = "pagerduty"
|
const defaultTitle = "PagerDuty"
|
||||||
|
|
||||||
type Settings struct {
|
type Settings struct {
|
||||||
common *cfg.Common
|
common *cfg.Common
|
||||||
@ -21,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, ymlConfig, globalConfig),
|
common: cfg.NewCommonSettingsFromModule(name, defaultTitle, ymlConfig, globalConfig),
|
||||||
|
|
||||||
apiKey: ymlConfig.UString("apiKey", os.Getenv("WTF_PAGERDUTY_API_KEY")),
|
apiKey: ymlConfig.UString("apiKey", os.Getenv("WTF_PAGERDUTY_API_KEY")),
|
||||||
escalationFilter: ymlConfig.UList("escalationFilter"),
|
escalationFilter: ymlConfig.UList("escalationFilter"),
|
||||||
|
@ -5,7 +5,7 @@ import (
|
|||||||
"github.com/wtfutil/wtf/cfg"
|
"github.com/wtfutil/wtf/cfg"
|
||||||
)
|
)
|
||||||
|
|
||||||
const configKey = "power"
|
const defaultTitle = "Power"
|
||||||
|
|
||||||
type Settings struct {
|
type Settings struct {
|
||||||
common *cfg.Common
|
common *cfg.Common
|
||||||
@ -15,7 +15,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, ymlConfig, globalConfig),
|
common: cfg.NewCommonSettingsFromModule(name, defaultTitle, ymlConfig, globalConfig),
|
||||||
}
|
}
|
||||||
|
|
||||||
return &settings
|
return &settings
|
||||||
|
@ -5,7 +5,7 @@ import (
|
|||||||
"github.com/wtfutil/wtf/cfg"
|
"github.com/wtfutil/wtf/cfg"
|
||||||
)
|
)
|
||||||
|
|
||||||
const configKey = "resourceusage"
|
const defaultTitle = "ResourceUsage"
|
||||||
|
|
||||||
type Settings struct {
|
type Settings struct {
|
||||||
common *cfg.Common
|
common *cfg.Common
|
||||||
@ -13,7 +13,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, ymlConfig, globalConfig),
|
common: cfg.NewCommonSettingsFromModule(name, defaultTitle, ymlConfig, globalConfig),
|
||||||
}
|
}
|
||||||
|
|
||||||
return &settings
|
return &settings
|
||||||
|
@ -5,7 +5,7 @@ import (
|
|||||||
"github.com/wtfutil/wtf/cfg"
|
"github.com/wtfutil/wtf/cfg"
|
||||||
)
|
)
|
||||||
|
|
||||||
const configKey = "rollbar"
|
const defaultTitle = "Rollbar"
|
||||||
|
|
||||||
type Settings struct {
|
type Settings struct {
|
||||||
common *cfg.Common
|
common *cfg.Common
|
||||||
@ -21,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, ymlConfig, globalConfig),
|
common: cfg.NewCommonSettingsFromModule(name, defaultTitle, ymlConfig, globalConfig),
|
||||||
|
|
||||||
accessToken: ymlConfig.UString("accessToken"),
|
accessToken: ymlConfig.UString("accessToken"),
|
||||||
activeOnly: ymlConfig.UBool("activeOnly", false),
|
activeOnly: ymlConfig.UBool("activeOnly", false),
|
||||||
|
@ -5,7 +5,7 @@ import (
|
|||||||
"github.com/wtfutil/wtf/cfg"
|
"github.com/wtfutil/wtf/cfg"
|
||||||
)
|
)
|
||||||
|
|
||||||
const configKey = "security"
|
const defaultTitle = "Security"
|
||||||
|
|
||||||
type Settings struct {
|
type Settings struct {
|
||||||
common *cfg.Common
|
common *cfg.Common
|
||||||
@ -13,7 +13,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, ymlConfig, globalConfig),
|
common: cfg.NewCommonSettingsFromModule(name, defaultTitle, ymlConfig, globalConfig),
|
||||||
}
|
}
|
||||||
|
|
||||||
return &settings
|
return &settings
|
||||||
|
@ -5,7 +5,7 @@ import (
|
|||||||
"github.com/wtfutil/wtf/cfg"
|
"github.com/wtfutil/wtf/cfg"
|
||||||
)
|
)
|
||||||
|
|
||||||
const configKey = "spotify"
|
const defaultTitle = "Spotify"
|
||||||
|
|
||||||
type Settings struct {
|
type Settings struct {
|
||||||
common *cfg.Common
|
common *cfg.Common
|
||||||
@ -13,7 +13,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, ymlConfig, globalConfig),
|
common: cfg.NewCommonSettingsFromModule(name, defaultTitle, ymlConfig, globalConfig),
|
||||||
}
|
}
|
||||||
|
|
||||||
return &settings
|
return &settings
|
||||||
|
@ -7,7 +7,7 @@ import (
|
|||||||
"github.com/wtfutil/wtf/cfg"
|
"github.com/wtfutil/wtf/cfg"
|
||||||
)
|
)
|
||||||
|
|
||||||
const configKey = "spotifyweb"
|
const defaultTitle = "Spotify Web"
|
||||||
|
|
||||||
type Settings struct {
|
type Settings struct {
|
||||||
common *cfg.Common
|
common *cfg.Common
|
||||||
@ -20,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, ymlConfig, globalConfig),
|
common: cfg.NewCommonSettingsFromModule(name, defaultTitle, 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")),
|
||||||
|
@ -5,7 +5,7 @@ import (
|
|||||||
"github.com/wtfutil/wtf/cfg"
|
"github.com/wtfutil/wtf/cfg"
|
||||||
)
|
)
|
||||||
|
|
||||||
const configKey = "status"
|
const defaultTitle = "Status"
|
||||||
|
|
||||||
type Settings struct {
|
type Settings struct {
|
||||||
common *cfg.Common
|
common *cfg.Common
|
||||||
@ -13,7 +13,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, ymlConfig, globalConfig),
|
common: cfg.NewCommonSettingsFromModule(name, defaultTitle, ymlConfig, globalConfig),
|
||||||
}
|
}
|
||||||
|
|
||||||
return &settings
|
return &settings
|
||||||
|
@ -5,7 +5,7 @@ import (
|
|||||||
"github.com/wtfutil/wtf/cfg"
|
"github.com/wtfutil/wtf/cfg"
|
||||||
)
|
)
|
||||||
|
|
||||||
const configKey = "system"
|
const defaultTitle = "System"
|
||||||
|
|
||||||
type Settings struct {
|
type Settings struct {
|
||||||
common *cfg.Common
|
common *cfg.Common
|
||||||
@ -13,7 +13,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, ymlConfig, globalConfig),
|
common: cfg.NewCommonSettingsFromModule(name, defaultTitle, ymlConfig, globalConfig),
|
||||||
}
|
}
|
||||||
|
|
||||||
return &settings
|
return &settings
|
||||||
|
@ -5,7 +5,7 @@ import (
|
|||||||
"github.com/wtfutil/wtf/cfg"
|
"github.com/wtfutil/wtf/cfg"
|
||||||
)
|
)
|
||||||
|
|
||||||
const configKey = "textfile"
|
const defaultTitle = "Textfile"
|
||||||
|
|
||||||
type Settings struct {
|
type Settings struct {
|
||||||
common *cfg.Common
|
common *cfg.Common
|
||||||
@ -18,7 +18,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, ymlConfig, globalConfig),
|
common: cfg.NewCommonSettingsFromModule(name, defaultTitle, ymlConfig, globalConfig),
|
||||||
|
|
||||||
filePaths: ymlConfig.UList("filePaths"),
|
filePaths: ymlConfig.UList("filePaths"),
|
||||||
format: ymlConfig.UBool("format", false),
|
format: ymlConfig.UBool("format", false),
|
||||||
|
@ -5,7 +5,7 @@ import (
|
|||||||
"github.com/wtfutil/wtf/cfg"
|
"github.com/wtfutil/wtf/cfg"
|
||||||
)
|
)
|
||||||
|
|
||||||
const configKey = "todo"
|
const defaultTitle = "Todo"
|
||||||
|
|
||||||
type Settings struct {
|
type Settings struct {
|
||||||
common *cfg.Common
|
common *cfg.Common
|
||||||
@ -16,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, ymlConfig, globalConfig),
|
common: cfg.NewCommonSettingsFromModule(name, defaultTitle, ymlConfig, globalConfig),
|
||||||
|
|
||||||
filePath: ymlConfig.UString("filename"),
|
filePath: ymlConfig.UString("filename"),
|
||||||
}
|
}
|
||||||
|
@ -7,7 +7,7 @@ import (
|
|||||||
"github.com/wtfutil/wtf/cfg"
|
"github.com/wtfutil/wtf/cfg"
|
||||||
)
|
)
|
||||||
|
|
||||||
const configKey = "todoist"
|
const defaultTitle = "Todoist"
|
||||||
|
|
||||||
type Settings struct {
|
type Settings struct {
|
||||||
common *cfg.Common
|
common *cfg.Common
|
||||||
@ -19,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, ymlConfig, globalConfig),
|
common: cfg.NewCommonSettingsFromModule(name, defaultTitle, ymlConfig, globalConfig),
|
||||||
|
|
||||||
apiKey: ymlConfig.UString("apiKey", os.Getenv("WTF_TODOIST_TOKEN")),
|
apiKey: ymlConfig.UString("apiKey", os.Getenv("WTF_TODOIST_TOKEN")),
|
||||||
projects: ymlConfig.UList("projects"),
|
projects: ymlConfig.UList("projects"),
|
||||||
|
@ -7,7 +7,7 @@ import (
|
|||||||
"github.com/wtfutil/wtf/cfg"
|
"github.com/wtfutil/wtf/cfg"
|
||||||
)
|
)
|
||||||
|
|
||||||
const configKey = "travisci"
|
const defaultTitle = "TravisCI"
|
||||||
|
|
||||||
type Settings struct {
|
type Settings struct {
|
||||||
common *cfg.Common
|
common *cfg.Common
|
||||||
@ -19,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, ymlConfig, globalConfig),
|
common: cfg.NewCommonSettingsFromModule(name, defaultTitle, ymlConfig, globalConfig),
|
||||||
|
|
||||||
apiKey: ymlConfig.UString("apiKey", os.Getenv("WTF_TRAVIS_API_TOKEN")),
|
apiKey: ymlConfig.UString("apiKey", os.Getenv("WTF_TRAVIS_API_TOKEN")),
|
||||||
pro: ymlConfig.UBool("pro", false),
|
pro: ymlConfig.UBool("pro", false),
|
||||||
|
@ -7,7 +7,7 @@ import (
|
|||||||
"github.com/wtfutil/wtf/cfg"
|
"github.com/wtfutil/wtf/cfg"
|
||||||
)
|
)
|
||||||
|
|
||||||
const configKey = "trello"
|
const defaultTitle = "Trello"
|
||||||
|
|
||||||
type Settings struct {
|
type Settings struct {
|
||||||
common *cfg.Common
|
common *cfg.Common
|
||||||
@ -22,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, ymlConfig, globalConfig),
|
common: cfg.NewCommonSettingsFromModule(name, defaultTitle, ymlConfig, globalConfig),
|
||||||
|
|
||||||
accessToken: ymlConfig.UString("accessToken", os.Getenv("WTF_TRELLO_ACCESS_TOKEN")),
|
accessToken: ymlConfig.UString("accessToken", 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")),
|
||||||
|
@ -7,7 +7,7 @@ import (
|
|||||||
"github.com/wtfutil/wtf/cfg"
|
"github.com/wtfutil/wtf/cfg"
|
||||||
)
|
)
|
||||||
|
|
||||||
const configKey = "twitter"
|
const defaultTitle = "Twitter"
|
||||||
|
|
||||||
type Settings struct {
|
type Settings struct {
|
||||||
common *cfg.Common
|
common *cfg.Common
|
||||||
@ -20,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, ymlConfig, globalConfig),
|
common: cfg.NewCommonSettingsFromModule(name, defaultTitle, ymlConfig, globalConfig),
|
||||||
|
|
||||||
bearerToken: ymlConfig.UString("bearerToken", os.Getenv("WTF_TWITTER_BEARER_TOKEN")),
|
bearerToken: ymlConfig.UString("bearerToken", os.Getenv("WTF_TWITTER_BEARER_TOKEN")),
|
||||||
count: ymlConfig.UInt("count", 5),
|
count: ymlConfig.UInt("count", 5),
|
||||||
|
@ -5,7 +5,7 @@ import (
|
|||||||
"github.com/wtfutil/wtf/cfg"
|
"github.com/wtfutil/wtf/cfg"
|
||||||
)
|
)
|
||||||
|
|
||||||
const configKey = "unkown"
|
const defaultTitle = "Unknown"
|
||||||
|
|
||||||
type Settings struct {
|
type Settings struct {
|
||||||
common *cfg.Common
|
common *cfg.Common
|
||||||
@ -13,7 +13,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, ymlConfig, globalConfig),
|
common: cfg.NewCommonSettingsFromModule(name, defaultTitle, ymlConfig, globalConfig),
|
||||||
}
|
}
|
||||||
|
|
||||||
return &settings
|
return &settings
|
||||||
|
@ -7,7 +7,7 @@ import (
|
|||||||
"github.com/wtfutil/wtf/cfg"
|
"github.com/wtfutil/wtf/cfg"
|
||||||
)
|
)
|
||||||
|
|
||||||
const configKey = "victorops"
|
const defaultTitle = "VictorOps"
|
||||||
|
|
||||||
type Settings struct {
|
type Settings struct {
|
||||||
common *cfg.Common
|
common *cfg.Common
|
||||||
@ -20,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, ymlConfig, globalConfig),
|
common: cfg.NewCommonSettingsFromModule(name, defaultTitle, ymlConfig, globalConfig),
|
||||||
|
|
||||||
apiID: ymlConfig.UString("apiID", os.Getenv("WTF_VICTOROPS_API_ID")),
|
apiID: ymlConfig.UString("apiID", os.Getenv("WTF_VICTOROPS_API_ID")),
|
||||||
apiKey: ymlConfig.UString("apiKey", os.Getenv("WTF_VICTOROPS_API_KEY")),
|
apiKey: ymlConfig.UString("apiKey", os.Getenv("WTF_VICTOROPS_API_KEY")),
|
||||||
|
@ -44,6 +44,7 @@ func (widget *Widget) Refresh() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
teams, err := Fetch(widget.settings.apiID, widget.settings.apiKey)
|
teams, err := Fetch(widget.settings.apiID, widget.settings.apiKey)
|
||||||
|
widget.View.SetTitle(widget.ContextualTitle(widget.CommonSettings.Title))
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
widget.View.SetWrap(true)
|
widget.View.SetWrap(true)
|
||||||
|
@ -5,7 +5,7 @@ import (
|
|||||||
"github.com/wtfutil/wtf/cfg"
|
"github.com/wtfutil/wtf/cfg"
|
||||||
)
|
)
|
||||||
|
|
||||||
const configKey = "prettyweather"
|
const defaultTitle = "Pretty Weather"
|
||||||
|
|
||||||
type Settings struct {
|
type Settings struct {
|
||||||
common *cfg.Common
|
common *cfg.Common
|
||||||
@ -19,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, ymlConfig, globalConfig),
|
common: cfg.NewCommonSettingsFromModule(name, defaultTitle, ymlConfig, globalConfig),
|
||||||
|
|
||||||
city: ymlConfig.UString("city", "Barcelona"),
|
city: ymlConfig.UString("city", "Barcelona"),
|
||||||
language: ymlConfig.UString("language", "en"),
|
language: ymlConfig.UString("language", "en"),
|
||||||
|
@ -7,7 +7,7 @@ import (
|
|||||||
"github.com/wtfutil/wtf/cfg"
|
"github.com/wtfutil/wtf/cfg"
|
||||||
)
|
)
|
||||||
|
|
||||||
const configKey = "weather"
|
const defaultTitle = "Weather"
|
||||||
|
|
||||||
type colors struct {
|
type colors struct {
|
||||||
current string
|
current string
|
||||||
@ -26,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, ymlConfig, globalConfig),
|
common: cfg.NewCommonSettingsFromModule(name, defaultTitle, ymlConfig, globalConfig),
|
||||||
|
|
||||||
apiKey: ymlConfig.UString("apiKey", os.Getenv("WTF_OWM_API_KEY")),
|
apiKey: ymlConfig.UString("apiKey", os.Getenv("WTF_OWM_API_KEY")),
|
||||||
cityIDs: ymlConfig.UList("cityids"),
|
cityIDs: ymlConfig.UList("cityids"),
|
||||||
|
@ -7,7 +7,7 @@ import (
|
|||||||
"github.com/wtfutil/wtf/cfg"
|
"github.com/wtfutil/wtf/cfg"
|
||||||
)
|
)
|
||||||
|
|
||||||
const configKey = "zendesk"
|
const defaultTitle = "Zendesk"
|
||||||
|
|
||||||
type Settings struct {
|
type Settings struct {
|
||||||
common *cfg.Common
|
common *cfg.Common
|
||||||
@ -21,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, ymlConfig, globalConfig),
|
common: cfg.NewCommonSettingsFromModule(name, defaultTitle, ymlConfig, globalConfig),
|
||||||
|
|
||||||
apiKey: ymlConfig.UString("apiKey", os.Getenv("ZENDESK_API")),
|
apiKey: ymlConfig.UString("apiKey", os.Getenv("ZENDESK_API")),
|
||||||
status: ymlConfig.UString("status"),
|
status: ymlConfig.UString("status"),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user