From 1a42a41a53c65bc425699b0a6e50f07b77fc9bb8 Mon Sep 17 00:00:00 2001 From: Josua Blejeru Date: Mon, 22 May 2023 21:57:09 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=A7=20=E2=9C=A8=20Register=20a=20Widge?= =?UTF-8?q?t=20to=20display=20stories=20from=20HN?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Widgets/HackernewsTrending.vue | 54 +++++++++++++++++++ src/components/Widgets/WidgetBase.vue | 1 + src/utils/defaults.js | 17 +++--- 3 files changed, 62 insertions(+), 10 deletions(-) create mode 100644 src/components/Widgets/HackernewsTrending.vue diff --git a/src/components/Widgets/HackernewsTrending.vue b/src/components/Widgets/HackernewsTrending.vue new file mode 100644 index 00000000..348d5783 --- /dev/null +++ b/src/components/Widgets/HackernewsTrending.vue @@ -0,0 +1,54 @@ + + + diff --git a/src/components/Widgets/WidgetBase.vue b/src/components/Widgets/WidgetBase.vue index fd6543e7..c59985df 100644 --- a/src/components/Widgets/WidgetBase.vue +++ b/src/components/Widgets/WidgetBase.vue @@ -78,6 +78,7 @@ const COMPAT = { 'gl-system-load': 'GlSystemLoad', 'gl-cpu-temp': 'GlCpuTemp', 'health-checks': 'HealthChecks', + 'hackernews-trending': 'HackernewsTrending', 'gluetun-status': 'GluetunStatus', iframe: 'IframeWidget', image: 'ImageWidget', diff --git a/src/utils/defaults.js b/src/utils/defaults.js index 8f51df94..69e0ff3e 100644 --- a/src/utils/defaults.js +++ b/src/utils/defaults.js @@ -107,11 +107,7 @@ module.exports = { footer: true, }, /* A list of route names that page furniture (header, footer, etc) should be hidden on */ - hideFurnitureOn: [ - 'minimal', - 'login', - 'download', - ], + hideFurnitureOn: ['minimal', 'login', 'download'], /* Key names for local storage identifiers */ localStorageKeys: { LANGUAGE: 'language', @@ -166,9 +162,7 @@ module.exports = { /* Amount of time to show splash screen, when enabled, in milliseconds */ splashScreenTime: 1000, /* Page meta-data, rendered in the header of each view */ - metaTagData: [ - { name: 'description', content: 'A simple static homepage for you\'re server' }, - ], + metaTagData: [{ name: 'description', content: "A simple static homepage for you're server" }], /* Default option for Toast messages */ toastedOptions: { position: 'bottom-center', @@ -212,8 +206,10 @@ module.exports = { generativeFallback: 'https://evatar.io/{icon}', localPath: './item-icons', faviconName: 'favicon.ico', - homeLabIcons: 'https://raw.githubusercontent.com/walkxcode/dashboard-icons/master/png/{icon}.png', - homeLabIconsFallback: 'https://raw.githubusercontent.com/NX211/homer-icons/master/png/{icon}.png', + homeLabIcons: + 'https://raw.githubusercontent.com/walkxcode/dashboard-icons/master/png/{icon}.png', + homeLabIconsFallback: + 'https://raw.githubusercontent.com/NX211/homer-icons/master/png/{icon}.png', }, /* API endpoints for widgets that need to fetch external data */ widgetApiEndpoints: { @@ -231,6 +227,7 @@ module.exports = { exchangeRates: 'https://v6.exchangerate-api.com/v6/', flights: 'https://aerodatabox.p.rapidapi.com/flights/airports/icao/', githubTrending: 'https://gh-trending-repos.herokuapp.com/', + hackernewsTrending: 'https://hacker-news.firebaseio.com/v0', healthChecks: 'https://healthchecks.io/api/v1/checks', holidays: 'https://kayaposoft.com/enrico/json/v2.0/?action=getHolidaysForDateRange', jokes: 'https://v2.jokeapi.dev/joke/',