From 4287092ea29d1260bfb485b9242e5d0b00abb3b7 Mon Sep 17 00:00:00 2001 From: Alicia Sykes Date: Wed, 11 May 2022 10:52:16 +0100 Subject: [PATCH 01/25] :sparkles: Option to hide seconds in Clock (#644) --- docs/widgets.md | 1 + src/components/Widgets/Clock.vue | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/widgets.md b/docs/widgets.md index 02f2d13d..8cb9d474 100644 --- a/docs/widgets.md +++ b/docs/widgets.md @@ -97,6 +97,7 @@ A simple, live-updating time and date widget with time-zone support. All fields **`format`** | `string` | _Optional_ | A country code for displaying the date and time in local format.
Specified as `[ISO-3166]-[ISO-639]`, for example: `en-AU`. See [here](https://www.fincher.org/Utilities/CountryLanguageList.shtml) for a full list of locales. Defaults to the browser / device's region **`customCityName`** | `string` | _Optional_ | By default the city from the time-zone is shown, but setting this value will override that text **`hideDate`** | `boolean` | _Optional_ | If set to `true`, the date and city will not be shown. Defaults to `false` +**`hideSeconds`** | `boolean` | _Optional_ | If set to `true`, seconds will not be shown. Defaults to `false` ##### Example diff --git a/src/components/Widgets/Clock.vue b/src/components/Widgets/Clock.vue index aa5ccc51..717bad62 100644 --- a/src/components/Widgets/Clock.vue +++ b/src/components/Widgets/Clock.vue @@ -36,6 +36,9 @@ export default { if (this.options.customCityName) return this.options.customCityName; return this.timeZone.split('/')[1].replaceAll('_', ' '); }, + showSeconds() { + return !this.options.hideSeconds; + }, }, methods: { update() { @@ -48,7 +51,7 @@ export default { timeZone: this.timeZone, hour: 'numeric', minute: 'numeric', - second: 'numeric', + ...(this.showSeconds && { second: 'numeric' }), }).format(); }, /* Get and format the date */ From 7b39bde573e5a37c44104b254a8e07ea0b5b9c8a Mon Sep 17 00:00:00 2001 From: Alicia Sykes Date: Fri, 13 May 2022 10:56:24 +0100 Subject: [PATCH 02/25] :bug: Fixes status check inheritance (#651) --- src/mixins/ItemMixin.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mixins/ItemMixin.js b/src/mixins/ItemMixin.js index 628391d4..7b082dda 100644 --- a/src/mixins/ItemMixin.js +++ b/src/mixins/ItemMixin.js @@ -41,13 +41,13 @@ export default { size() { const validSizes = ['small', 'medium', 'large']; if (this.itemSize && validSizes.includes(this.itemSize)) return this.itemSize; - return this.appConfig.iconSize || defaultSize; + return this.$store.getters.iconSize || defaultSize; }, /* Determines if user has enabled online status checks */ enableStatusCheck() { const globalPref = this.appConfig.statusCheck || false; - const itemPref = this.item.statusCheck || false; - return itemPref || globalPref; + const itemPref = this.item.statusCheck; + return typeof itemPref === 'boolean' ? itemPref : globalPref; }, /* Determine how often to re-fire status checks */ statusCheckInterval() { From 064c64465effe707e4403c71e517a47b1d2eaabb Mon Sep 17 00:00:00 2001 From: Alicia Sykes Date: Sat, 14 May 2022 12:18:01 +0100 Subject: [PATCH 03/25] :whale: Only re-release Docker image when src changes --- .github/workflows/docker-build-publish.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/docker-build-publish.yml b/.github/workflows/docker-build-publish.yml index 72d05010..287aa910 100644 --- a/.github/workflows/docker-build-publish.yml +++ b/.github/workflows/docker-build-publish.yml @@ -6,6 +6,11 @@ on: push: branches: ['master'] tags: [v*] + paths: + - '**.js' + - 'src/**' + - 'public/**' + - 'services/**' env: DH_IMAGE: ${{ secrets.DOCKER_REPO }} From 24e487cde52b790d9d51b6a17067354f7efadc38 Mon Sep 17 00:00:00 2001 From: Alicia Sykes Date: Sat, 14 May 2022 13:12:29 +0100 Subject: [PATCH 04/25] :bug: Fixes item size/ layout buttons (#629) --- src/utils/ConfigAccumalator.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/utils/ConfigAccumalator.js b/src/utils/ConfigAccumalator.js index 9a408309..3e0ab772 100644 --- a/src/utils/ConfigAccumalator.js +++ b/src/utils/ConfigAccumalator.js @@ -40,11 +40,11 @@ export default class ConfigAccumulator { usersAppConfig = appConfigFile; } // Some settings have their own local storage keys, apply them here - usersAppConfig.layout = appConfigFile.layout - || localStorage[localStorageKeys.LAYOUT_ORIENTATION] + usersAppConfig.layout = localStorage[localStorageKeys.LAYOUT_ORIENTATION] + || appConfigFile.layout || defaultLayout; - usersAppConfig.iconSize = appConfigFile.iconSize - || localStorage[localStorageKeys.ICON_SIZE] + usersAppConfig.iconSize = localStorage[localStorageKeys.ICON_SIZE] + || appConfigFile.iconSize || defaultIconSize; // Don't let users modify users locally if (appConfigFile.auth) usersAppConfig.auth = appConfigFile.auth; @@ -60,7 +60,7 @@ export default class ConfigAccumulator { try { localPageInfo = JSON.parse(localStorage[localStorageKeys.PAGE_INFO]); } catch (e) { ErrorHandler('Malformed pageInfo data in local storage'); } } - const filePageInfo = this.conf ? this.conf.pageInfo || {} : {}; + const filePageInfo = this.conf?.pageInfo || {}; return { ...defaultPageInfo, ...filePageInfo, ...localPageInfo }; } From 9b33a6e277fac444438cb7e9ce9942babb1ee60b Mon Sep 17 00:00:00 2001 From: Alicia Sykes Date: Sat, 14 May 2022 13:20:53 +0100 Subject: [PATCH 05/25] Fixes pageInfo not being read in router (#645) --- src/router.js | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/src/router.js b/src/router.js index e034b0e0..bf520682 100644 --- a/src/router.js +++ b/src/router.js @@ -11,7 +11,6 @@ import { Progress } from 'rsup-progress'; // Import views, that are not lazy-loaded import Home from '@/views/Home.vue'; -import ConfigAccumulator from '@/utils/ConfigAccumalator'; // Import helper functions, config data and defaults import { isAuthEnabled, isLoggedIn, isGuestAccessEnabled } from '@/utils/Auth'; @@ -19,7 +18,8 @@ import { makePageSlug, makePageName } from '@/utils/ConfigHelpers'; import { metaTagData, startingView, routePaths } from '@/utils/defaults'; import ErrorHandler from '@/utils/ErrorHandler'; -import { pages } from '../public/conf.yml'; +// Import data from users conf file. Note that rebuild is required for this to update. +import { pages, pageInfo, appConfig } from '../public/conf.yml'; Vue.use(Router); const progress = new Progress({ color: 'var(--progress-bar)' }); @@ -32,17 +32,6 @@ const isAuthenticated = () => { return (!authEnabled || userLoggedIn || guestEnabled); }; -const getConfig = () => { - const Accumulator = new ConfigAccumulator(); - return { - appConfig: Accumulator.appConfig(), - pageInfo: Accumulator.pageInfo(), - pages: Accumulator.pages(), - }; -}; - -const { appConfig, pageInfo } = getConfig(); - /* Get the users chosen starting view from app config, or return default */ const getStartingView = () => appConfig.startingView || startingView; @@ -61,7 +50,7 @@ const getStartingComponent = () => { /* Returns the meta tags for each route */ const makeMetaTags = (defaultTitle) => ({ - title: pageInfo.title || defaultTitle, + title: pageInfo?.title || defaultTitle, metaTags: metaTagData, }); @@ -73,10 +62,12 @@ const makeSubConfigPath = (rawPath) => { /* For each additional config file, create routes for home, minimal and workspace views */ const makeMultiPageRoutes = (userPages) => { - if (!userPages) return []; + // If no multi pages specified, or is not array, then return nothing + if (!userPages || !Array.isArray(userPages)) return []; const multiPageRoutes = []; + // For each user page, create an additional route userPages.forEach((page) => { - if (!page.name || !page.path) { + if (!page.name || !page.path) { // Sumin not right, show warning ErrorHandler('Additional pages must have both a `name` and `path`'); } // Props to be passed to home mixin From 3417b46eeec3cf96475cea54f725099c6f204bd6 Mon Sep 17 00:00:00 2001 From: Alicia Sykes Date: Sat, 14 May 2022 13:51:28 +0100 Subject: [PATCH 06/25] :art: Adds option to use Adventure theme with own img (#655) --- src/styles/color-themes.scss | 15 +++++++++------ src/utils/defaults.js | 1 + 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/styles/color-themes.scss b/src/styles/color-themes.scss index 72e8b4d8..3e736892 100644 --- a/src/styles/color-themes.scss +++ b/src/styles/color-themes.scss @@ -1357,7 +1357,7 @@ html[data-theme="dashy-docs"] { } } -html[data-theme="adventure"] { +html[data-theme="adventure"], html[data-theme="adventure-basic"] { // Main colors --primary: #ffffffe6; --background: #0b1021; @@ -1376,11 +1376,6 @@ html[data-theme="adventure"] { --item-group-shadow: none; --item-group-background: none; --item-group-outer-background: none; - // Background Image - body { - background: url('https://i.ibb.co/wdqSsGh/adventure-bg.jpg'); - background-size: cover; - } // Remove background from certain components div.home, div.options-outer, div.options-container, section.filter-container, section.settings-outer, div.show-hide-container.hide-btn, div.show-hide-container.show-btn { @@ -1401,6 +1396,14 @@ html[data-theme="adventure"] { } } +html[data-theme="adventure"] { + // Background Image + body { + background: url('https://i.ibb.co/wdqSsGh/adventure-bg.jpg'); + background-size: cover; + } +} + html[data-theme="color-block"] { // Main colors --primary: #E94560; diff --git a/src/utils/defaults.js b/src/utils/defaults.js index fe43aeb1..ad3af492 100644 --- a/src/utils/defaults.js +++ b/src/utils/defaults.js @@ -82,6 +82,7 @@ module.exports = { 'material-dark-original', 'high-contrast-dark', 'high-contrast-light', + 'adventure-basic', 'basic', ], /* Default color options for the theme configurator swatches */ From 2fe0110762512b019f0f87e33716e365232a27e9 Mon Sep 17 00:00:00 2001 From: Alicia Sykes Date: Sat, 14 May 2022 14:30:08 +0100 Subject: [PATCH 07/25] :bug: Updates mdi text in schema (#640) --- src/utils/ConfigSchema.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/ConfigSchema.json b/src/utils/ConfigSchema.json index 8f24c989..393b12b3 100644 --- a/src/utils/ConfigSchema.json +++ b/src/utils/ConfigSchema.json @@ -322,7 +322,7 @@ "description": "If true, font-awesome will be loaded, if false they will not be. If left empty, icons will only be loaded if needed" }, "enableMaterialDesignIcons": { - "title": "Enable Font-Awesome?", + "title": "Enable Material Design Icons?", "type": "boolean", "default": false, "description": "If true, material-design-icons will be loaded, if false they will not be. If left empty, icons will only be loaded if needed" From 9eda0488426ba138423b1b1e6f0cbbb22b999047 Mon Sep 17 00:00:00 2001 From: Alicia Sykes Date: Sun, 15 May 2022 20:46:19 +0100 Subject: [PATCH 08/25] :zap: Refactored request in RSS widget (#632) --- src/components/Widgets/RssFeed.vue | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/src/components/Widgets/RssFeed.vue b/src/components/Widgets/RssFeed.vue index e00807dc..94f8398a 100644 --- a/src/components/Widgets/RssFeed.vue +++ b/src/components/Widgets/RssFeed.vue @@ -31,7 +31,6 @@