diff --git a/docs/widgets.md b/docs/widgets.md index 4dbddaa3..022cc63e 100644 --- a/docs/widgets.md +++ b/docs/widgets.md @@ -23,6 +23,7 @@ Dashy has support for displaying dynamic content in the form of widgets. There a - [TFL Status](#tfl-status) - [Stock Price History](#stock-price-history) - [ETH Gas Prices](#eth-gas-prices) + - [Covid-19 Status](#covid-19-status) - [Joke of the Day](#joke) - [XKCD Comics](#xkcd-comics) - [News Headlines](#news-headlines) @@ -586,6 +587,53 @@ _No config options._ --- +### Covid-19 Status + +Keep track of the current COVID-19 status. Optionally also show cases by country, and a time-series chart. Uses live data from various sources, computed by [disease.sh](https://disease.sh/) + +

+ +##### Options + +**Field** | **Type** | **Required** | **Description** +--- | --- | --- | --- +**`showChart`** | `boolean` | _Optional_ | Also display a time-series chart showing number of recent cases +**`showCountries`** | `boolean` | _Optional_ | +**`numDays`** | `number` | _Optional_ | Specify number of days worth of history to render on the chart +**`countries`** | `string[]` | _Optional_ | An array of countries to display, specified by their [ISO-3 codes](https://www.iso.org/obp/ui). Leave blank to show all, sorted by most cases +**`limit`** | `number` | _Optional_ | If showing all countries, set a limit for number of results to return. Defaults to `10`, no maximum + + +##### Example + +```yaml +- type: covid-stats +``` + +Or + +```yaml +- type: covid-stats + options: + showChart: true + showCountries: true + countries: + - GBR + - USA + - IND + - RUS +``` + +##### Info +- **CORS**: 🟢 Enabled +- **Auth**: 🟢 Not Required +- **Price**: 🟢 Free +- **Host**: Managed Instance or Self-Hosted (see [disease-sh/api](https://github.com/disease-sh/api)) +- **Privacy**: ⚫ No Policy Available +- **Conditions**: [Terms of Use](https://github.com/disease-sh/api/blob/master/TERMS.md) + +--- + ### Joke Renders a programming or generic joke. Data is fetched from the [JokesAPI](https://github.com/Sv443/JokeAPI) by @Sv443. All fields are optional. diff --git a/src/components/Widgets/CovidStats.vue b/src/components/Widgets/CovidStats.vue new file mode 100644 index 00000000..a7348631 --- /dev/null +++ b/src/components/Widgets/CovidStats.vue @@ -0,0 +1,229 @@ + + + + + diff --git a/src/components/Widgets/WidgetBase.vue b/src/components/Widgets/WidgetBase.vue index 707602e6..058a6ec9 100644 --- a/src/components/Widgets/WidgetBase.vue +++ b/src/components/Widgets/WidgetBase.vue @@ -60,6 +60,13 @@ @error="handleError" :ref="widgetRef" /> + import('@/components/Widgets/Apod.vue'), Clock: () => import('@/components/Widgets/Clock.vue'), CodeStats: () => import('@/components/Widgets/CodeStats.vue'), + CovidStats: () => import('@/components/Widgets/CovidStats.vue'), CryptoPriceChart: () => import('@/components/Widgets/CryptoPriceChart.vue'), CryptoWatchList: () => import('@/components/Widgets/CryptoWatchList.vue'), CveVulnerabilities: () => import('@/components/Widgets/CveVulnerabilities.vue'), diff --git a/src/utils/defaults.js b/src/utils/defaults.js index 30b3e752..59db5ce8 100644 --- a/src/utils/defaults.js +++ b/src/utils/defaults.js @@ -210,6 +210,7 @@ module.exports = { widgetApiEndpoints: { astronomyPictureOfTheDay: 'https://apodapi.herokuapp.com/api', codeStats: 'https://codestats.net/', + covidStats: 'https://disease.sh/v3/covid-19', cryptoPrices: 'https://api.coingecko.com/api/v3/coins/', cryptoWatchList: 'https://api.coingecko.com/api/v3/coins/markets/', cveVulnerabilities: 'https://www.cvedetails.com/json-feed.php',