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

495 Commits

Author SHA1 Message Date
Chris Cummer
8eb4a25891
WTF-1070 Read response body data before closing (#1071)
Signed-off-by: Chris Cummer <chriscummer@me.com>
2021-03-27 19:30:18 -07:00
Antoine Meillet
9fb57845ed
Add Yahoo Finance module (#1066)
* Move finnhub to a stocks folder

As I am preparing an other stocks data provider, let's move `finnhub` to
a stocks folder that will host the others providers.

* Use go-pretty v6

Will be used by the new stock provider module, so let's just upgrade
this one to reduce the number of dependencies.

* Add Yahoo Finance module

Yahoo Finance provides an API for which `piquette/finance-go` is a
powerful client. This new module leverages this module to integrate all
indices provided by Yahoo Finance (international stocks, crypto,
options, currencies...)

Sample config:
```yaml
    yfinance:
      title: "Stocks 🚀"
      symbols:
        - "MSFT"
        - "GC=F"
        - "ORA.PA"
      sort: true
      enabled: true
      refreshInterval: 60
      position:
        top: 1
        left: 0
        height: 1
        width: 1
```
2021-03-27 13:42:28 -07:00
David Bouchare
2ec2fc37a5
Fix defer execution (#1065) 2021-03-23 03:19:29 -07:00
Lukas Kämmerling
9446886b37
Fix HackerNews Widget (#1063)
After commit 49109c77f719cedc5c7f15bcf255f952d2c3b90d the HackerNews widget did not work as expected. It failed with a error message "http: read on closed response body". This commit fixes the underlying reader issue by reading the whole request body within the apiRequest function and returning the []bytes of the response instead of *http.Response. If we want to continue to return *http.Response this would lead to the problem that the caller (GetStory() and GetStories()) always need to close the Request Body. The ways before this MR is a bit problematic because the defer gets executed when the function is "done", so it closes the Body already before the utils.ParseJSON can read it.

Signed-off-by: Lukas Kämmerling <lukas.kaemmerling@hetzner-cloud.de>
2021-03-19 21:43:54 -07:00
Lukas Kämmerling
0a89786826
Enhance Kubernetes module with Replica Count (Deployments) (#1062)
This commit adds the ReadyReplicas and Total Replicas count, the information is useful if you want to look over a new release of your application and k8s and want to know how many pods are ready/started from k8s. Otherwise the deployment option of this module is not that useful.

Signed-off-by: Lukas Kämmerling <lukas.kaemmerling@hetzner-cloud.de>
2021-03-18 21:57:40 -07:00
Christian Frichot
a8b0fa897a
Add Asana Module (#1052)
* Add Asana Module

* Add Asana Module to the widget_maker

* Asana Module - addressing linting concerns

* Asana Module - ran go mod tidy
2021-02-04 00:51:03 -08:00
David Bouchare
6ecec4f149
Update test (#1050) 2021-01-24 20:49:10 -08:00
Fredrik Steen
ddfc439c41
Fix for potential runtime panic (#1046)
Switch error checking around, so we don't check the StatusCode before
handling client errors.
2021-01-20 09:03:27 -08:00
David Bouchare
49109c77f7
[several modules] Close the response body (#1040) 2021-01-16 12:36:29 -08:00
Fredrik Steen
2341446376 Healthcecks module
Healthchecks.io is a service for monitoring cron jobs and similar
periodic processes.

Hosted: https://healthchecks.io/
API-Doc: https://healthchecks.io/docs/api/
GitHub: https://github.com/healthchecks/healthchecks

This module can be used both with hosted and self-hosted healthchecks.
2021-01-16 12:33:15 -08:00
Chris Cummer
9a703dd78b Deleted the Finnhub client test. It requires an API key to pass, and thats not acceptible
Signed-off-by: Chris Cummer <chriscummer@me.com>
2021-01-16 12:32:52 -08:00
zye1996
5783473cfa
fix requests url for cryptolive (#1042)
Co-authored-by: yzy <zhenyi@sensor.com>
2021-01-03 10:32:37 -08:00
Chris Cummer
d341c21f4b
Add support for the 'language' setting in the covid module (#1039)
Signed-off-by: Chris Cummer <chriscummer@me.com>
2020-12-29 13:46:08 -08:00
David Bouchare
2f2df04478
[modules] Add new covid tracker module (#1037)
* Add draft of covid module

* Work on pointers

* Add country stats

* Remove recovered, stays at 0

* Handle response code

* One struct for both

* List of countries

* Add test

* Add test for countries

* Fix typos

* Format numbers based on language/locale
2020-12-29 13:33:14 -08:00
Chris Cummer
d7da659b8b
Add support for user-configuration language tag specification. (#1038)
Adds a new top-level configuration key called "language":

```yaml
wtf:
  langauge: "ja-JP"
```

Users can now define which BCP 47 language tag to use to format any
text or numbers that currently support localization. Defaults to
"en-CA".

Acceptible values: any BCP 47 language tag recognized by the Go
"language" package.

Good luck to you figuring out what that cannonical list is. After a
morning of trying to suss it out, I have no idea.

Signed-off-by: Chris Cummer <chriscummer@me.com>
2020-12-29 12:14:20 -08:00
Chris Cummer
fd794707cd
☢️ WTF-1031 Support multiple simultaneous configurations (#1032)
* WTF-1031 Rename WtfApp.app to WtfApp.tviewApp

Signed-off-by: Chris Cummer <chriscummer@me.com>

* WTF-1031 Add scaffolding for main to support multiple WtfApp instances

Signed-off-by: Chris Cummer <chriscummer@me.com>

* WTF-1031 WIP

Signed-off-by: Chris Cummer <chriscummer@me.com>

* Remove common functionality from KeyboardWidget and into Base

Signed-off-by: Chris Cummer <chriscummer@me.com>

* Augment with some descriptive comments

Signed-off-by: Chris Cummer <chriscummer@me.com>

* Add full support for multiple app instances via the AppManager.

Still to do:

* Config support for multiple apps/multiple config files
* The ability to switch between apps

Signed-off-by: Chris Cummer <chriscummer@me.com>

* Move SetTerminal out of main and into its own file

Signed-off-by: Chris Cummer <chriscummer@me.com>
2020-12-21 03:25:41 -08:00
David Bouchare
9ba22f656b
Close the response body (#1036) 2020-12-18 20:20:05 -08:00
Chris Cummer
190b06182f Merge branch 'kris' of github.com:stone/wtf into stone-kris 2020-12-02 13:53:55 -08:00
David Bouchare
b2168be56e
Edit comment (#1033) 2020-12-02 13:52:06 -08:00
Fredrik Steen
cf808dd09b Fix inconsistent configuration name. 2020-11-30 17:44:28 +01:00
Fredrik Steen
90d672b2f2 Add krisinformation module
A module to parse the feed from: https://www.krisinformation.se/en

 Krisinformation.se is a web site run by the Swedish Civil Contingencies Agency
that compiles and convey warnings, alerts, and emergency information from
Swedish authorities to the public.

Features:

 - Filter on country (all messages)
 - Filter on county (only show county specific messages)
 - Distance (only show message within a certain distance)
 - Set a max age for displaying messages
 - Set a maximum number of messages displayed
2020-11-30 16:26:51 +01:00
Chris Cummer
e195453573 Use explicit documentation paths for modules that are nested into subdirectories
Signed-off-by: Chris Cummer <chriscummer@me.com>
2020-11-26 23:18:46 -08:00
Chris Cummer
d6a0797bf2 Simplify the inclusion of the Common config settings into each module
Signed-off-by: Chris Cummer <chriscummer@me.com>
2020-11-26 23:18:46 -08:00
Chris Cummer
f9a06540f1 Simplify the view loading for the keyboard widget
Signed-off-by: Chris Cummer <chriscummer@me.com>
2020-11-26 23:12:15 -08:00
Chris Cummer
4a820dd0e5 Make every widget a keyboard widget
Signed-off-by: Chris Cummer <chriscummer@me.com>
2020-11-26 23:12:15 -08:00
Chris Cummer
3521ebf6e8 Rename SigilStr to PaginationMarker
Signed-off-by: Chris Cummer <chriscummer@me.com>
2020-11-26 23:07:30 -08:00
David Bouchare
aae1cf55cc
[CircleCI] Add configurable number of builds to settings (#1025)
* Add configurable build number to settings

* Review feedback: number of builds
2020-11-21 18:21:02 -08:00
Toon Schoenmakers
f58e244cf6
Handle errors from the grafana api by displaying the error message (#1015) 2020-10-29 09:33:55 -07:00
Chris Cummer
546f73d56c Merge branch 'grafana' of github.com:schoentoon/wtf into schoentoon-grafana 2020-10-22 09:27:22 -07:00
Jade
fd8298dfd1 go lint fix 2020-10-19 20:59:26 +01:00
Jade
a728d448cb update the views 2020-10-19 20:51:39 +01:00
Toon Schoenmakers
441e82a3bd Added grafana alerts widget 2020-10-19 19:03:15 +02:00
Jade
d152a8beee fix go lint 2020-10-19 01:07:04 +01:00
Jade
5c6833a0df add the module to the widget_maker.go 2020-10-19 00:42:03 +01:00
Jade
4d3e9506e4 added finnhub mod 2020-10-19 00:03:07 +01:00
Jade
63462ac8ef add finnhub modules 2020-10-16 23:18:02 +01:00
Chris Cummer
f84142553c
WTF-986 User-definable DigitalOcean columns (#1001)
* WTF-986 Wrap the DigitalOcean droplet in our own droplet

This gives us something to build off while still providing the
underlying functionality of the original droplet instance.

Signed-off-by: Chris Cummer <chriscummer@me.com>

* WTF-986 Dynamically display droplet attributes based on defined column names

Signed-off-by: Chris Cummer <chriscummer@me.com>

* WTF-986 Read DigitalOcean column configuration from settings

Signed-off-by: Chris Cummer <chriscummer@me.com>

* WTF-986 Extract the reflection bits into a Reflective package

Signed-off-by: Chris Cummer <chriscummer@me.com>
2020-10-14 09:29:58 -07:00
Jason Schweier
0ab72ab7bb
Default domain for gitlab (#1000)
* Add a default domain for gitlab

* Remove trailing whitespace
2020-10-13 09:39:05 -07:00
Chris Cummer
21bdf18e98 Remove a redundant byte conversion
Signed-off-by: Chris Cummer <chriscummer@me.com>
2020-10-11 20:10:57 -07:00
Miha Frangež
b8c9f96db2 UptimeRobot: option to show offline monitors first 2020-10-11 20:09:18 -07:00
Miha Frangež
dd4899a07c UptimeRobot: improve uptime formatting 2020-10-11 20:09:18 -07:00
Miha Frangež
6908e744e1 Make CI happy 2020-10-11 20:09:18 -07:00
Miha Frangež
7f05fbcda5 Implemented UptimeRobot widget
This is the first working version of the UptimeRobot module, as discussed in #979
2020-10-11 20:09:18 -07:00
Chris Cummer
9f94e8c63a Add an app exit banner message 2020-10-11 16:55:16 -07:00
Chris Cummer
4064d42fed Fix go.mod conflict
Signed-off-by: Chris Cummer <chriscummer@me.com>
2020-10-08 12:29:32 -07:00
Sean Smith
7643109c63 Fix unlocking bug noticed during refactor 2020-10-08 08:17:52 -04:00
Todd Trimble
2f70693656
Correct minor typo in clock settings help text (#993) 2020-10-07 22:11:39 -07:00
Sean Smith
e23cec2897 Let pty be optional 2020-10-07 19:40:26 -04:00
Sean Smith
34154620f6 Handle error handling better
Don't panic
Add function due to reuse
Catch all errors to appease CI
2020-10-07 19:40:26 -04:00
Sean Smith
57bf5c7417 Have cmdrunner use a tty
This lets us get proper coloring
Fixes #577
2020-10-07 19:40:26 -04:00