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

380 Commits

Author SHA1 Message Date
Chris Cummer
cde904ff08
Use errcheck to find unhandled errors (#795)
Signed-off-by: Chris Cummer <chriscummer@me.com>
2019-12-17 08:26:16 -08:00
Chris Cummer
140dd553e0
WTF-781 Todoist project ID conversion (#789)
* 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>
2019-12-16 20:25:52 -08:00
Chris Cummer
3a388fba23
20191215 code improvements (#790)
* 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>
2019-12-16 20:25:29 -08:00
Chris Cummer
b7f8ec5ae2
Use WTF's version of spotigopher (#787)
Signed-off-by: Chris Cummer <chriscummer@me.com>
2019-12-14 21:24:18 -08:00
Chris Cummer
703619bf0a
WTF-748 Fixes and improves module templating (#786)
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>
2019-12-14 08:46:02 -08:00
Chris Cummer
ed1e6b2508
WTF-784 Fix CmdRunner title spacing issue (#785)
Closes #784.

Signed-off-by: Chris Cummer <chriscummer@me.com>
2019-12-13 21:26:53 -08:00
Chris Cummer
58299c2efa
WTF-484 DigitalOcean module (#782)
* 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
2019-12-13 11:33:29 -08:00
Chris Cummer
e1f1d0a410
WTF-781 Clean up Todoist project ID handling a bit (#783)
Signed-off-by: Chris Cummer <chriscummer@me.com>
2019-12-13 08:51:12 -08:00
Charlie Wang
f1ed15a8e4 Prevent flickering in cmdRunner widgets (#778)
* 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.
2019-12-13 08:47:09 -08:00
Nikolay Mateev
ff2f07812d Enable Jenkins module to work with Multi-configuration projects (#779)
Awesome, thanks!
2019-12-13 08:36:11 -08:00
Nikolay Mateev
4ec9d33a6f Add shortcuts for GitHub Pull Requests and Issues (#777) 2019-12-13 08:27:35 -08:00
Chris Cummer
9bea20442f Fix styling issue with IPInfo module
Signed-off-by: Chris Cummer <chriscummer@me.com>
2019-12-12 11:29:53 -08:00
Chris Cummer
31926fd4a7
Integrate vendored NewRelic dependency (#767)
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>
2019-12-01 20:47:02 -08:00
Chris Cummer
d9464c4a22
Use errwrap to improve fmt.Errorf() handling (#771)
Errwrap: https://github.com/fatih/errwrap

Signed-off-by: Chris Cummer <chriscummer@me.com>
2019-12-01 20:46:52 -08:00
Chris Cummer
251e34af22 Explicit default false for CmdRunner.tail setting
Signed-off-by: Chris Cummer <chriscummer@me.com>
2019-11-27 06:35:39 -08:00
TDHTTTT
307d8aead0 add a case where subreddit link length is less than widet.settings.numberOfPosts (#754) 2019-11-16 19:53:52 -08:00
Toon Schoenmakers
c8a14e7685 Keep an initial order of the currencies so they won't be in a different order after refreshing (#752)
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.
2019-11-16 19:47:52 -08:00
Chris Cummer
435bc59a01 Merge branch 'exchangerates' of github.com:schoentoon/wtf into schoentoon-exchangerates 2019-11-15 20:56:44 -08:00
Chris Cummer
d62356f930 Merge branch 'master' of github.com:3mard/wtf into 3mard-master 2019-11-15 20:53:31 -08:00
Chris Cummer
4d20fa1195
WTF-747 Fix resourceusage swap label bug (#750)
Signed-off-by: Chris Cummer <chriscummer@me.com>
2019-11-13 17:18:17 -08:00
Toon Schoenmakers
14c2e0c627 Added a setting to hide the completed downloads in the transmission module (#746) 2019-11-12 20:14:49 -08:00
Chris Cummer
c6a10295c1
Set Twitter Stats wrap to false (#745)
Signed-off-by: Chris Cummer <chriscummer@me.com>
2019-11-12 20:10:39 -08:00
Chris Cummer
bf85d4b144
IPInfo styling (#744)
* 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>
2019-11-12 20:10:26 -08:00
Toon Schoenmakers
244a86cb7e Implemented a module that shows exchange rates from exchangeratesapi.io 2019-11-12 18:06:45 +01:00
Omar
29d3a16491
add pocket widget 2019-11-10 13:59:20 +01:00
Chris Cummer
a18fce88ac
WTF-718 Fixes missing grid issue when running CmdRunner (#740)
Closes #718 and closes #730.

Signed-off-by: Chris Cummer <chriscummer@me.com>
2019-11-09 14:09:13 -08:00
Chris Cummer
200dbcc03c
WTF-730 Fix missing color key config error (#738)
* 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>
2019-11-09 11:21:45 -08:00
Chris Cummer
1bfca29d17
WTF-657 Add spec coverage for cfg/common_settings.go (#728)
* 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>
2019-10-30 17:35:00 -07:00
Chris Cummer
ada434b3c3
Merge pull request #715 from Ameobea/twitterstats
Twitterstats
2019-10-29 17:55:57 -07:00
Casey Primozic
a99af9a091
Support both bearer + consumer tokens for Twitter modules
* 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
2019-10-29 03:15:57 -07:00
Chris Cummer
59501353e7
Merge pull request #724 from madepolli/modded_resourceusage
modded resourceusage
2019-10-25 07:58:11 -07:00
Matjaž Depolli
900d0d0ea5 modded resourceusage 2019-10-25 12:54:16 +02:00
Cizer Pereira
5261325771 fix: resolve PR commits 2019-10-25 08:27:14 +02:00
Cizer Pereira
22b40ff0ec fix: mark favorite with 2019-10-24 18:37:16 +02:00
Cizer Pereira
e7e1463181 feat: Add new widget for football scores and standings 2019-10-24 15:28:01 +02:00
Casey Primozic
d82eda1933
Improvements to twitterstats code from review
* 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
2019-10-23 11:49:33 -07:00
Casey Primozic
3c95d8e39d
Improve styling + remove unused code
* Got rid of unused struct fields, unused settings, added some comments to functions + structs
2019-10-22 13:23:17 -07:00
Casey Primozic
0be63a404c
Implement Twitter API fetching for twitterstats
* 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
2019-10-22 12:42:11 -07:00
Casey Primozic
4c9990bafd
Implement initial twitterstats module
* 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)
2019-10-22 11:58:20 -07:00
Chris Cummer
97bf42045b
Merge pull request #712 from Daanikus/close-file
Close unclosed file
2019-10-21 21:19:11 -07:00
Chris Cummer
cb636881c3 Merge branch 'master' of github.com:wtfutil/wtf 2019-10-21 21:08:14 -07:00
Daanikus
db9f3c7b99 close unclosed file 2019-10-22 17:00:43 +13:00
Omar
e7a42e05b5
chore: adjust ToDo to use ScrollableWidget 2019-10-20 13:10:15 +02:00
Albert Salim
f1303bcc2f Rename "Approval Requests" to "Assigned Merge Requests" 2019-10-19 10:15:38 +08:00
Albert Salim
fa1bdade76 Add user context to GitLab project
- Get MergeRequests and Issues with user's ID
2019-10-19 10:13:54 +08:00
Albert Salim
149228dd1c Add lists of authored and assigned issues in GitLab project 2019-10-15 23:46:55 +08:00
Alex Fornuto
419d43670c remove pull request count from issue count (#694) 2019-10-12 17:51:53 -04:00
Chris Cummer
189c667928 Fix some of the transmission module race conditions
Signed-off-by: Chris Cummer <chriscummer@me.com>
2019-10-11 06:19:05 -07:00
Chris Cummer
c9eff660f6
Merge pull request #584 from alexfornuto/netman-agnostic
Find SSID regardless of network manager
2019-10-11 05:02:48 -07:00
Chris Cummer
3e84dc2b6e
Merge pull request #685 from Boot-Error/master
Fix Errors in azuredevops and devto modules
2019-10-10 20:28:13 -07:00