diff --git a/docs/widgets.md b/docs/widgets.md index de637eb8..addf2ff9 100644 --- a/docs/widgets.md +++ b/docs/widgets.md @@ -29,6 +29,7 @@ Dashy has support for displaying dynamic content in the form of widgets. There a - [Stock Price History](#stock-price-history) - [ETH Gas Prices](#eth-gas-prices) - [Joke of the Day](#joke) + - [Chuck Norris quotes](#chucknorris) - [XKCD Comics](#xkcd-comics) - [Flight Data](#flight-data) - [NASA APOD](#astronomy-picture-of-the-day) @@ -1001,6 +1002,36 @@ Renders a programming or generic joke. Data is fetched from the [JokesAPI](https --- +### Chuck Norris quotes + +Renders a Chuck Norris quote. Data is fetched from the [ChuckNorrisAPI](https://api.chucknorris.io/) by @matchilling. All fields are optional. + +

+ +#### Options + +**Field** | **Type** | **Required** | **Description** +--- | --- | --- | --- +**`categories`** | `string` | _Optional_ | Set the category of jokes to return. Use a string to specify a single category, or an array to pass in multiple options. Available options are: `animal`,`career`,`celebrity`,`dev`,`explicit`,`fashion`,`food`,`history`,`money`,`movie`,`music`,`political`,`religion`,`science`,`sport` and `travel`. An up-to-date list of supported categories can be found [here](https://api.chucknorris.io/jokes/categories). Defaults to not explicitely set and therefore any of the categories can come up. + +#### Example + +```yaml +- type: chucknorris + options: + categories: history,sport +``` + +#### Info + +- **CORS**: 🟢 Enabled +- **Auth**: 🟢 Not Required +- **Price**: 🟢 Free +- **Host**: Managed Instance +- **Privacy**: _See [matchilling's Privacy Policy](https://api.chucknorris.io/privacy)_ + +--- + ### XKCD Comics Have a laugh with the daily comic from [XKCD](https://xkcd.com/). A classic webcomic website covering everything from Linux, math, romance, science and language. All fields are optional. diff --git a/src/components/Widgets/ChuckNorris.vue b/src/components/Widgets/ChuckNorris.vue new file mode 100644 index 00000000..9f608a42 --- /dev/null +++ b/src/components/Widgets/ChuckNorris.vue @@ -0,0 +1,66 @@ + + + + + \ No newline at end of file diff --git a/src/components/Widgets/WidgetBase.vue b/src/components/Widgets/WidgetBase.vue index a1efa1cd..a148b476 100644 --- a/src/components/Widgets/WidgetBase.vue +++ b/src/components/Widgets/WidgetBase.vue @@ -49,15 +49,16 @@ const COMPAT = { anonaddy: 'addy.io', apod: 'Apod', 'blacklist-check': 'BlacklistCheck', + chucknorris: 'ChuckNorris', clock: 'Clock', + 'code-stats': 'CodeStats', + 'covid-stats': 'CovidStats', 'crypto-price-chart': 'CryptoPriceChart', 'crypto-watch-list': 'CryptoWatchList', 'custom-search': 'CustomSearch', 'custom-list': 'CustomList', 'cve-vulnerabilities': 'CveVulnerabilities', 'domain-monitor': 'DomainMonitor', - 'code-stats': 'CodeStats', - 'covid-stats': 'CovidStats', 'drone-ci': 'DroneCi', embed: 'EmbedWidget', 'eth-gas-prices': 'EthGasPrices', @@ -81,16 +82,16 @@ const COMPAT = { 'gl-network-traffic': 'GlNetworkTraffic', 'gl-system-load': 'GlSystemLoad', 'gl-cpu-temp': 'GlCpuTemp', + 'gluetun-status': 'GluetunStatus', 'health-checks': 'HealthChecks', 'hackernews-trending': 'HackernewsTrending', - 'gluetun-status': 'GluetunStatus', iframe: 'IframeWidget', image: 'ImageWidget', joke: 'Jokes', + linkding: 'Linkding', 'minecraft-status': 'MinecraftStatus', 'mullvad-status': 'MullvadStatus', mvg: 'Mvg', - linkding: 'Linkding', 'mvg-connection': 'MvgConnection', 'nd-cpu-history': 'NdCpuHistory', 'nd-load-history': 'NdLoadHistory', diff --git a/src/utils/defaults.js b/src/utils/defaults.js index 847dbe6f..8f72fcc8 100644 --- a/src/utils/defaults.js +++ b/src/utils/defaults.js @@ -227,6 +227,7 @@ module.exports = { anonAddy: 'https://app.addy.io', astronomyPictureOfTheDay: 'https://apod.as93.net/apod', blacklistCheck: 'https://api.blacklistchecker.com/check', + chuckNorris: 'https://api.chucknorris.io/jokes/random', codeStats: 'https://codestats.net/', covidStats: 'https://disease.sh/v3/covid-19', cryptoPrices: 'https://api.coingecko.com/api/v3/coins/',