* WTF-781 Switch Todoist IDs from `int` to `string`
On platforms that convert an `int` to `int32`, like the Raspberry Pi,
an `int` is not large enough to store Todoist project IDs.
Using a `string` ensures this never becomes a problem.
Fixes#781
Signed-off-by: Chris Cummer <chriscummer@me.com>
* Upgrade godo to latest
* Fix a bunch of issues found by
* Running staticcheck on a codebase for the first time is a sobering experience
* go mod tidy
* More static improvements
Signed-off-by: Chris Cummer <chriscummer@me.com>
Fixes and improves the module templating for creating new bare-bones
text widgets.
This command:
WTF_WIDGET_NAME=MyNewWidget go generate -run=text
now properly generates:
* the module directory in the /modules directory
* the widget.go file
* the settings.go file
with no linter warnings or errors.
Signed-off-by: Chris Cummer <chriscummer@me.com>
* WTF-484 DigitalOcean module stubbed out
* WTF-484 Delete droplets via Ctrl-d
* WTF-484 Rebasing off master after a long time away
* WTF-484 Improve DigitalOcean display
* WTF-484 Can shutdown and restart the selected droplet
* WTF-484 Display info about the selected droplet using the ? key
* WTF-484 Display info about the selected droplet using the Return key
* WTF-484 Greatly improve the utils.Truncate function
* WTF-484 Display a droplet's features in the info modal
* WTF-484 Change reboot key from r to b to not conflict with refresh
* WTF-484 Panic if a keyboard control is mapped to the same character more than once
* WTF-484 Colorize droplet status indicator
* WTF-484 Extract view.InfoTable out into a reusable component
* Prevent flickering in cmdRunner widgets
This commit removes flickering in the cmdRunner widgets while preserving
the live-update functionality. It amends 45b955 by not redrawing on
every write call. Instead, the logic in Refresh is as follows:
1. If the command is already running, it will not try to re-run the
command. The default case in the select will trigger a re-draw instead
so that new output can be seen. This accommodates long-runing commands
eg. tailing a log.
2. If the command is not already running, it will trigger a new run.
When the command terminates, it will trigger a re-draw. This means the
widget refreshes as soon as possible, to accommodate the original use
case of running a command and displaying its output in the widget.
In all cases, the widget will not re-draw more often than the refresh
interval. This is what eliminates flickering, since the previous
implementation before using goroutines was not redrawing more than once
per refresh interval.
* Remove useless locking in Refresh
Since the Refresh command doesn't actually block on anything, and the
goroutines have their own locking, Refresh shouldn't lock.
The NewRelic module relies on yfronto/newrelic, which no longer exists.
yfronto deleted that directory quite awhile ago, and since then it has
been vendored.
But vendoring a missing repository creates problems when trying to
update the vendored code.
This PR brings the yfronto/newrelic code into the mainline.
Signed-off-by: Chris Cummer <chriscummer@me.com>
This purely happend due to maps not keeping the order items are in. This way
it at least won't change throughout the runtime of wtfutil. Ideally it would
use and keep the order as specified by the user in the configuration but
right now there is no way to enforce this.
* WIP
Signed-off-by: Chris Cummer <chriscummer@me.com>
* Fix the colour scheme for IPInfo to match other modules
Now uses standard label and text colours.
Signed-off-by: Chris Cummer <chriscummer@me.com>
* WTF-730 Fix missing color key config error
Signed-off-by: Chris Cummer <chriscummer@me.com>
* WTF-730 Add Subheading color formatting to modules
Users can now set a `subheading` color in their config to change the
color of subheadings in widget display.
Defaults to `red`.
Signed-off-by: Chris Cummer <chriscummer@me.com>
* WTF-730 Fix oustanding color issues
Clean up missing color config changes not addressed in earlier commits.
Signed-off-by: Chris Cummer <chriscummer@me.com>
* Remove unused dependency
Signed-off-by: Chris Cummer <chriscummer@me.com>
* WTF-730 Base cleanup
Signed-off-by: Chris Cummer <chriscummer@me.com>
* WTF-730 Fix a few bugs related to color config changes
Signed-off-by: Chris Cummer <chriscummer@me.com>
* WTF-730 Fix issues with PagerDuty subheading display
Signed-off-by: Chris Cummer <chriscummer@me.com>
* WTF-730 Fix bug with Todo list colour rendering
Signed-off-by: Chris Cummer <chriscummer@me.com>
* WTF-657 Add spec coverage for cfg/common_settings.go
Signed-off-by: Chris Cummer <chriscummer@me.com>
* WTF-657 Add spec coverage for cfg/position_validation.go
Signed-off-by: Chris Cummer <chriscummer@me.com>
* WTF-657 Add spec coverage for cfg/validations.go
Signed-off-by: Chris Cummer <chriscummer@me.com>
* WTF-657 Add spec coverage for checklist/checklist.go
Signed-off-by: Chris Cummer <chriscummer@me.com>
* WTF-657 Add spec coverage for checklist/checklist_item.go
Signed-off-by: Chris Cummer <chriscummer@me.com>
* WTF-657 Add spec coverage for utils/conversions.go
Signed-off-by: Chris Cummer <chriscummer@me.com>
* WTF-657 Get rid of utils.Home() function
Signed-off-by: Chris Cummer <chriscummer@me.com>
* WTF-657 Add spec coverage for utils/homedir.go
Signed-off-by: Chris Cummer <chriscummer@me.com>
* WTF-657 Add spec coverage for utils/text.go
Signed-off-by: Chris Cummer <chriscummer@me.com>
* WTF-657 Clean up utils/utils.go
Signed-off-by: Chris Cummer <chriscummer@me.com>
* Add support to both the twitter and twitterstats modules for authenticating using both bearer tokens as well as consumer key + secret.
* A bearer token is defaulted to if it's supplied
* Add this support to both the twitterstats module as well as to the existing twitter module, modifying its functionality to re-use the same HTTP client and handle authentication upfront via oauth2
* Unmarshal directly into a `TwitterStats` struct by using json struct annotations
* Pull stats fetching for a single user out into its own function so that closing the request body is done after each request and the HTTP request can be re-used for multiple usernames' stats
* Improve type casting code used in settings parsing logic
* Create Oauth2 client configured for Twitter and create a HTTP client out of that
* Fetch user stats for each of the users, parse out of JSON, and return stats as stats structs
* Create module skeleton based off of the existing twitter module
* Strip out unused pieces and try to make it as minimal as possible
* Implement settings parsing, converting the untyped `screenNames` slice into an slice of strings
* Implement initial minimal display, showing a table with all usernames and their follower count + # of tweets (using dummy metrics for now)