From d59466c7b5b268cc1d5e31f0cc8053d62504192c Mon Sep 17 00:00:00 2001 From: Alicia Sykes Date: Wed, 29 Dec 2021 17:52:29 +0000 Subject: [PATCH 1/7] :sparkles: Adds icon.horse to supported favicon APIs --- docs/configuring.md | 596 ++++++++++++++++++------------------ docs/icons.md | 381 +++++++++++------------ src/utils/ConfigSchema.json | 3 +- src/utils/defaults.js | 1 + 4 files changed, 492 insertions(+), 489 deletions(-) diff --git a/docs/configuring.md b/docs/configuring.md index d06fd429f1..02a04266ae 100644 --- a/docs/configuring.md +++ b/docs/configuring.md @@ -1,298 +1,298 @@ -# Configuring - -All app configuration is specified in [`/public/conf.yml`](https://github.com/Lissy93/dashy/blob/master/public/conf.yml) which is in [YAML Format](https://yaml.org/) format. Changes can also be made [directly through the UI](#editing-config-through-the-ui) and previewed live, from here you can also export, backup, reset, validate and download your configuration file. - -The following file provides a reference of all supported configuration options. - ---- - -#### Contents - -- [**`pageInfo`**](#pageinfo) - Header text, footer, title, navigation, etc - - [`navLinks`](#pageinfonavlinks-optional) - Navigation bar items and links -- [**`appConfig`**](#appconfig-optional) - Main application settings - - [`webSearch`](#appconfigwebsearch-optional) - Configure web search engine options - - [`hideComponents`](#appconfighidecomponents-optional) - Show/ hide page components - - [`auth`](#appconfigauth-optional) - Built-in authentication setup - - [`users`](#appconfigauthusers-optional) - Setup for simple auth - - [`keycloak`](#appconfigauthkeycloak-optional) - Auth using Keycloak -- [**`sections`**](#section) - List of sections - - [`displayData`](#sectiondisplaydata-optional) - Section display settings - - [`icon`](#sectionicon-and-sectionitemicon) - Icon for a section - - [`items`](#sectionitem) - List of items - - [`icon`](#sectionicon-and-sectionitemicon) - Icon for an item -- [**Notes**](#notes) - - [Editing Config through the UI](#editing-config-through-the-ui) - - [About YAML](#about-yaml) - - [Config Saving Methods](#config-saving-methods) - - [Preventing Changes](#preventing-changes-being-written-to-disk) - - [Example](#example) - ---- - -Tips: -- You may find it helpful to look at some sample config files to get you started, a collection of which can be found [here](https://gist.github.com/Lissy93/000f712a5ce98f212817d20bc16bab10) -- You can check that your config file fits the schema, by running `yarn validate-config` -- After modifying your config, the app needs to be recompiled, by running `yarn build` - this happens automatically whilst the app is running if you're using Docker -- It is recommended to make and keep a backup of your config file. You can download your current config through the UI either from the Config menu, or using the `/download` endpoint. Alternatively, you can use the [Cloud Backup](./docs/backup-restore.md) feature. -- The config can also be modified directly through the UI, validated and written to the conf.yml file. -- All fields are optional, unless otherwise stated. - ---- - -### Top-Level Fields - -**Field** | **Type** | **Required**| **Description** ---- | --- | --- | --- -**`pageInfo`** | `object` | Required | Basic meta data like title, description, nav bar links, footer text. See [`pageInfo`](#pageinfo) -**`appConfig`** | `object` | _Optional_ | Settings related to how the app functions, including API keys and global styles. See [`appConfig`](#appconfig-optional) -**`sections`** | `array` | Required | An array of sections, each containing an array of items, which will be displayed as links. See [`section`](#section) - -**[⬆️ Back to Top](#configuring)** - -### `PageInfo` - -**Field** | **Type** | **Required**| **Description** ---- | --- | --- | --- -**`title`** | `string` | Required | Your dashboard title, displayed in the header and browser tab -**`description`** | `string` | _Optional_ | Description of your dashboard, also displayed as a subtitle -**`navLinks`** | `array` | _Optional_ | Optional list of a maximum of 6 links, which will be displayed in the navigation bar. See [`navLinks`](#pageinfonavlinks-optional) -**`footerText`** | `string` | _Optional_ | Text to display in the footer (note that this will override the default footer content). This can also include HTML and inline CSS -**`logo`** | `string` | _Optional_ | The path to an image to display in the header (to the right of the title). This can be either local, where `/` is the root of `./public`, or any remote image, such as `https://i.ibb.co/yhbt6CY/dashy.png`. It's recommended to scale your image down, so that it doesn't impact load times - -**[⬆️ Back to Top](#configuring)** - -### `pageInfo.navLinks` _(optional)_ - -**Field** | **Type** | **Required**| **Description** ---- | --- | --- | --- -**`title`** | `string` | Required | The text to display on the link button -**`path`** | `string` | Required | The URL to navigate to when clicked. Can be relative (e.g. `/about`) or absolute (e.g. `https://example.com` or `http://192.168.1.1`) - -**[⬆️ Back to Top](#configuring)** - -### `appConfig` _(optional)_ - -**Field** | **Type** | **Required**| **Description** ---- | --- | --- | --- -**`language`** | `string` | _Optional_ | The 2 (or 4-digit) [ISO 639-1 code](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) for your language, e.g. `en` or `en-GB`. This must be a language that the app has already been [translated](https://github.com/Lissy93/dashy/tree/master/src/assets/locales) into. If your language is unavailable, Dashy will fallback to English. By default Dashy will attempt to auto-detect your language, although this may not work on some privacy browsers. -**`startingView`** | `enum` | _Optional_ | Which page to load by default, and on the base page or domain root. You can still switch to different views from within the UI. Can be either `default`, `minimal` or `workspace`. Defaults to `default` -**`defaultOpeningMethod`** | `enum` | _Optional_ | The default opening method for items, if no `target` is specified for a given item. Can be either `newtab`, `sametab`, `top`, `parent`, `modal` or `workspace`. Defaults to `newtab` -**`statusCheck`** | `boolean` | _Optional_ | When set to `true`, Dashy will ping each of your services and display their status as a dot next to each item. This can be overridden by setting `statusCheck` under each item. Defaults to `false` -**`statusCheckInterval`** | `boolean` | _Optional_ | The number of seconds between checks. If set to `0` then service will only be checked on initial page load, which is usually the desired functionality. If value is less than `10` you may experience a hit in performance. Defaults to `0` -**`webSearch`** | `object` | _Optional_ | Configuration options for the web search feature, set your default search engine, opening method or disable web search. See [`webSearch`](#appconfigwebsearch-optional) -**`backgroundImg`** | `string` | _Optional_ | Path to an optional full-screen app background image. This can be either remote (http) or local (/). Note that this will slow down initial load -**`enableFontAwesome`** | `boolean` | _Optional_ | Where `true` is enabled, if left blank font-awesome will be enabled only if required by 1 or more icons -**`fontAwesomeKey`** | `string` | _Optional_ | If you have a font-awesome key, then you can use it here and make use of premium icons. It is a 10-digit alpha-numeric string from you're FA kit URL (e.g. `13014ae648`) -**`faviconApi`** | `enum` | _Optional_ | Only applicable if you are using favicons for item icons. Specifies which service to use to resolve favicons. Set to `local` to do this locally, without using an API. Services running locally will use this option always. Available options are: `local`, `faviconkit`, `google`, `clearbit`, `webmasterapi` and `allesedv`. Defaults to `faviconkit`. See [Icons](/docs/icons.md#favicons) for more info -**`auth`** | `object` | _Optional_ | All settings relating to user authentication. See [`auth`](#appconfigauth-optional) -**`layout`** | `enum` | _Optional_ | Layout for homepage, either `horizontal`, `vertical` or `auto`. Defaults to `auto`. This specifies the layout and direction of how sections are positioned on the home screen. This can also be modified and overridden from the UI. -**`iconSize`** | `enum` | _Optional_ | The size of link items / icons. Can be either `small`, `medium,` or `large`. Defaults to `medium`. This can also be set directly from the UI. -**`colCount`** | `number` | _Optional_ | The number of columns of sections displayed on the homepage, using the default view. Should be in integer between `1` and `8`. Note that by default this is applied responsively, based on current screen size, and specifying a value here will override this behavior, which may not be desirable. -**`theme`** | `string` | _Optional_ | The default theme for first load (you can change this later from the UI) -**`cssThemes`** | `string[]` | _Optional_ | An array of custom theme names which can be used in the theme switcher dropdown -**`customColors`** | `object`| _Optional_ | Enables you to apply a custom color palette to any given theme. Use the theme name (lowercase) as the key, for an object including key-value-pairs, with the color variable name as keys, and 6-digit hex code as value. See [Theming](/docs/theming.md#modifying-theme-colors) for more info -**`externalStyleSheet`** | `string` or `string[]` | _Optional_ | Either a URL to an external stylesheet or an array or URLs, which can be applied as themes within the UI -**`customCss`** | `string` | _Optional_ | Raw CSS that will be applied to the page. This can also be set from the UI. Please minify it first. -**`hideComponents`** | `object` | _Optional_ | A list of key page components (header, footer, search, settings, etc) that are present by default, but can be removed using this option. See [`appConfig.hideComponents`](#appconfighideComponents-optional) -**`routingMode`** | `string` | _Optional_ | Can be either `hash` or `history`. Determines the URL format for sub-pages, hash mode will look like `/#/home` whereas with history mode available you have nice clean URLs, like `/home`. For more info, see the [Vue docs](https://router.vuejs.org/guide/essentials/history-mode.html#example-server-configurations). If you're hosting Dashy with a custom BASE_URL, you will find that a bit of extra server config is necessary to get history mode working, so here you may want to instead use `hash` mode.Defaults to `history`. -**`enableMultiTasking`** | `boolean` | _Optional_ | If set to true, will keep apps open in the background when in the workspace view. Useful for quickly switching between multiple sites, and preserving their state, but comes at the cost of performance. -**`workspaceLandingUrl`** | `string` | _Optional_ | The URL or an app, service or website to launch when the workspace view is opened, before another service has been launched -**`allowConfigEdit`** | `boolean` | _Optional_ | Should prevent / allow the user to write configuration changes to the conf.yml from the UI. When set to `false`, the user can only apply changes locally using the config editor within the app, whereas if set to `true` then changes can be written to disk directly through the UI. Defaults to `true`. Note that if authentication is enabled, the user must be of type `admin` in order to apply changes globally. -**`enableErrorReporting`** | `boolean` | _Optional_ | Enable reporting of unexpected errors and crashes. This is off by default, and **no data will ever be captured unless you explicitly enable it**. Turning on error reporting helps previously unknown bugs get discovered and fixed. Dashy uses [Sentry](https://github.com/getsentry/sentry) for error reporting. Defaults to `false`. -**`sentryDsn`** | `boolean` | _Optional_ | If you need to monitor errors in your instance, then you can use Sentry to collect and process bug reports. Sentry can be self-hosted, or used as SaaS, once your instance is setup, then all you need to do is pass in the DSN here, and enable error reporting. You can learn more on the [Sentry DSN Docs](https://docs.sentry.io/product/sentry-basics/dsn-explainer/). Note that this will only ever be used if `enableErrorReporting` is explicitly enabled. -**`disableSmartSort`** | `boolean` | _Optional_ | For the most-used and last-used app sort functions to work, a basic open-count is stored in local storage. If you do not want this to happen, then disable smart sort here, but you wil no longer be able to use these sort options. Defaults to `false`. -**`disableUpdateChecks`** | `boolean` | _Optional_ | If set to true, Dashy will not check for updates. Defaults to `false`. -**`enableServiceWorker`** | `boolean` | _Optional_ | Service workers cache web applications to improve load times and offer basic offline functionality, and are enabled by default in Dashy. The service worker can sometimes cause older content to be cached, requiring the app to be hard-refreshed. If you do not want SW functionality, or are having issues with caching, set this property to `true` to disable all service workers. -**`disableContextMenu`** | `boolean` | _Optional_ | If set to `true`, the custom right-click context menu will be disabled. Defaults to `false`. - -**[⬆️ Back to Top](#configuring)** - -### `appConfig.auth` _(optional)_ -**Field** | **Type** | **Required**| **Description** ---- | --- | --- | --- -**`users`** | `array` | _Optional_ | An array of objects containing usernames and hashed passwords. If this is not provided, then authentication will be off by default, and you will not need any credentials to access the app. See [`appConfig.auth.users`](#appconfigauthusers-optional).
**Note** this method of authentication is handled on the client side, so for security critical situations, it is recommended to use an [alternate authentication method](/docs/authentication.md#alternative-authentication-methods). -**`enableKeycloak`** | `boolean` | _Optional_ | If set to `true`, then authentication using Keycloak will be anabled. Note that you need to have an instance running, and have also configured `auth.keycloak`. Defaults to `false` -**`keycloak`** | `object` | _Optional_ | Config options to point Dashy to your Keycloak server. Requires `enableKeycloak: true`. See [`auth.keycloak`](#appconfigauthkeycloak-optional) for more info -**`enableGuestAccess`** | `boolean` | _Optional_ | When set to `true`, an unauthenticated user will be able to access the dashboard, with read-only access, without having to login. Requires `auth.users` to be configured. Defaults to `false`. - -For more info, see the **[Authentication Docs](/docs/authentication.md)** - -**[⬆️ Back to Top](#configuring)** - -### `appConfig.auth.users` _(optional)_ - -**Field** | **Type** | **Required**| **Description** ---- | --- | --- | --- -**`user`** | `string` | Required | Username to log in with -**`hash`** | `string` | Required | A SHA-256 hashed password -**`type`** | `string` | _Optional_ | The user type, either admin or normal - -**[⬆️ Back to Top](#configuring)** - -### `appConfig.auth.keycloak` _(optional)_ - -**Field** | **Type** | **Required**| **Description** ---- | --- | --- | --- -**`serverUrl`** | `string` | Required | The URL (or URL/ IP + Port) where your keycloak server is running -**`realm`** | `string` | Required | The name of the realm (must already be created) that you want to use -**`clientId`** | `string` | Required | The Client ID of the client you created for use with Dashy - -**[⬆️ Back to Top](#configuring)** - -### `appConfig.webSearch` _(optional)_ - -**Field** | **Type** | **Required**| **Description** ---- | --- | --- | --- -**`disableWebSearch`** | `string` | _Optional_ | Web search is enabled by default, but can be disabled by setting this property to `true` -**`searchEngine`** | `string` | _Optional_ | Set the key name for your search engine. Can also use a custom engine by setting this property to `custom`. Currently supported: `duckduckgo`, `google`, `whoogle`, `qwant`, `startpage`, `searx-bar` and `searx-info`. Defaults to `duckduckgo` -**`customSearchEngine`** | `string` | _Optional_ | You can also use a custom search engine, or your own self-hosted instance. This requires `searchEngine: custom` to be set. Then add the URL of your service, with GET query string included here -**`openingMethod`** | `string` | _Optional_ | Set your preferred opening method for search results: `newtab`, `sametab`, `workspace`. Defaults to `newtab` -**`searchBangs`** | `object` | _Optional_ | A key-value-pair set of custom search _bangs_ for redirecting query to a specific app or search engine. The key of each should be the bang you will type (typically starting with `/`, `!` or `:`), and value is the destination, either as a search engine key (e.g. `reddit`) or a URL with search parameters (e.g. `https://en.wikipedia.org/w/?search=`) - - -**[⬆️ Back to Top](#configuring)** - -### `appConfig.hideComponents` _(optional)_ - -**Field** | **Type** | **Required**| **Description** ---- | --- | --- | --- -**`hideHeading`** | `boolean` | _Optional_ | If set to `true`, the page title & sub-title will not be visible. Defaults to `false` -**`hideNav`** | `boolean` | _Optional_ | If set to `true`, the navigation menu will not be visible. Defaults to `false` -**`hideSearch`** | `boolean` | _Optional_ | If set to `true`, the search bar will not be visible. Defaults to `false` -**`hideSettings`** | `boolean` | _Optional_ | If set to `true`, the settings menu will not be visible. Defaults to `false` -**`hideFooter`** | `boolean` | _Optional_ | If set to `true`, the footer will not be visible. Defaults to `false` -**`hideSplashScreen`** | `boolean` | _Optional_ | If set to `true`, splash screen will not be visible while the app loads. Defaults to `true` (except on first load, when the loading screen is always shown) - -**[⬆️ Back to Top](#configuring)** - -### `section` - -**Field** | **Type** | **Required**| **Description** ---- | --- | --- | --- -**`name`** | `string` | Required | The title for the section -**`icon`** | `string` | _Optional_ | An single icon to be displayed next to the title. See [`section.icon`](#sectionicon-and-sectionitemicon) -**`items`** | `array` | Required | An array of items to be displayed within the section. See [`item`](#sectionitem) -**`displayData`** | `object` | _Optional_ | Meta-data to optionally overide display settings for a given section. See [`displayData`](#sectiondisplaydata-optional) - -**[⬆️ Back to Top](#configuring)** - -### `section.item` - -**Field** | **Type** | **Required**| **Description** ---- | --- | --- | --- -**`title`** | `string` | Required | The text to display/ title of a given item. Max length `18` -**`description`** | `string` | _Optional_ | Additional info about an item, which is shown in the tooltip on hover, or visible on large tiles -**`url`** | `string` | Required | The URL / location of web address for when the item is clicked -**`icon`** | `string` | _Optional_ | The icon for a given item. Can be a font-awesome icon, favicon, remote URL or local URL. See [`item.icon`](#sectionicon-and-sectionitemicon) -**`target`** | `string` | _Optional_ | The opening method for when the item is clicked, either `newtab`, `sametab`, `top`, `parent`, `modal` or `workspace`. Where `newtab` will open the link in a new tab, `sametab` will open it in the current tab, and `modal` will open a pop-up modal and `workspace` will open in the Workspace view. Defaults to `newtab` -**`hotkey`** | `number` | _Optional_ | Give frequently opened applications a numeric hotkey, between `0 - 9`. You can then just press that key to launch that application. -**`tags`** | `string[]` | _Optional_ | A list of tags, which can be used for improved search -**`statusCheck`** | `boolean` | _Optional_ | When set to `true`, Dashy will ping the URL associated with the current service, and display its status as a dot next to the item. The value here will override `appConfig.statusCheck` so you can turn off or on checks for a given service. Defaults to `appConfig.statusCheck`, falls back to `false` -**`statusCheckUrl`** | `string` | _Optional_ | If you've enabled `statusCheck`, and want to use a different URL to what is defined under the item, then specify it here -**`statusCheckHeaders`** | `object` | _Optional_ | If you're endpoint requires any specific headers for the status checking, then define them here -**`statusCheckAllowInsecure`** | `boolean` | _Optional_ | By default, any request to insecure content will be blocked. Setting this option to `true` will disable the `rejectUnauthorized` option, enabling you to ping non-HTTPS services for the current item. Defaults to `false` -**`color`** | `string` | _Optional_ | An optional color for the text and font-awesome icon to be displayed in. Note that this will override the current theme and so may not display well -**`backgroundColor`** | `string` | _Optional_ | An optional background fill color for the that given item. Again, this will override the current theme and so might not display well against the background -**`provider`** | `string` | _Optional_ | The name of the provider for a given service, useful for when including hosted apps. In some themes, this is visible under the item name - -**[⬆️ Back to Top](#configuring)** - -### `section.displayData` _(optional)_ - -**Field** | **Type** | **Required**| **Description** ---- | --- | --- | --- -**`sortBy`** | `string` | _Optional_ | The sort order for items within the current section. By default items are displayed in the order in which they are listed in within the config. The following sort options are supported: `most-used` (most opened apps first), `last-used` (the most recently used apps), `alphabetical`, `reverse-alphabetical`, `random` and `default` -**`collapsed`** | `boolean` | _Optional_ | If true, the section will be collapsed initially, and will need to be clicked to open. Useful for less regularly used, or very long sections. Defaults to `false` -**`rows`** | `number` | _Optional_ | Height of the section, specified as the number of rows it should span vertically, e.g. `2`. Defaults to `1`. Max is `5`. -**`cols`** | `number` | _Optional_ | Width of the section, specified as the number of columns the section should span horizontally, e.g. `2`. Defaults to `1`. Max is `5`. -**`itemSize`** | `string` | _Optional_ | Specify the size for items within this group, either `small`, `medium` or `large`. Note that this will overide any settings specified through the UI -**`color`** | `string` | _Optional_ | A custom accent color for the section, as a hex code or HTML color (e.g. `#fff`) -**`customStyles`** | `string` | _Optional_ | Custom CSS properties that should be applied to that section, e.g. `border: 2px dashed #ff0000;` -**`sectionLayout`** | `string` | _Optional_ | Specify which CSS layout will be used to responsivley place items. Can be either `auto` (which uses flex layout), or `grid`. If `grid` is selected, then `itemCountX` and `itemCountY` may also be set. Defaults to `auto` -**`itemCountX`** | `number` | _Optional_ | The number of items to display per row / horizontally. If not set, it will be calculated automatically based on available space. Can only be set if `sectionLayout` is set to `grid`. Must be a whole number between `1` and `12` -**`itemCountY`** | `number` | _Optional_ | The number of items to display per column / vertically. If not set, it will be calculated automatically based on available space. If `itemCountX` is set, then `itemCountY` can be calculated automatically. Can only be set if `sectionLayout` is set to `grid`. Must be a whole number between `1` and `12` -**`hideForUsers`** | `string[]` | _Optional_ | Current section will be visible to all users, except for those specified in this list -**`showForUsers`** | `string[]` | _Optional_ | Current section will be hidden from all users, except for those specified in this list -**`hideForGuests`** | `boolean` | _Optional_ | Current section will be visible for logged in users, but not for guests (see `appConfig.enableGuestAccess`). Defaults to `false` - -**[⬆️ Back to Top](#configuring)** - -### `section.icon` and `section.item.icon` - -**Field** | **Type** | **Required**| **Description** ---- | --- | --- | --- -**`icon`** | `string` | _Optional_ | The icon for a given item or section. See [Icon Docs](/docs/icons.md) for all available supported icon types. To auto-fetch icon from a services URL, aet to `favicon`. To use font-awesome, specify the category, followed by the icon name, e.g. `fas fa-rocket`, `fab fa-monero` or `fal fa-duck`. Similarly, for branded icons, you can use [simple-icons](https://simpleicons.org/) by setting icon to `si-[icon-name]` or [material-design-icons](https://dev.materialdesignicons.com/icons) by setting icon to `mdi-[icon-name]`. If set to `generative`, then a unique icon is generated from the apps URL or IP. You can also use hosted any by specifying it's URL, e.g. `https://i.ibb.co/710B3Yc/space-invader-x256.png`. To use a local image, first store it in `./public/item-icons/` (or `-v /app/public/item-icons/` in Docker) , and reference it by name and extension - e.g. set `image.png` to use `./public/item-icon/image.png`, you can also use sub-folders if you have a lot of icons, to keep them organised. - -**[⬆️ Back to Top](#configuring)** - ---- - -## Notes - -### Editing Config through the UI - -Config can be modified directly through the UI, and then written to disk, or applied locally. This can be done wither with the raw config editor (introduced in V 0.6.5 / [#3](https://github.com/Lissy93/dashy/pull/3)), or the interactive editor (introduced in V 1.8.9 / [#298](https://github.com/Lissy93/dashy/pull/298)). - -

- - Interactive Editor
- Interactive Editor demo -
-
- - Raw Editor
- Config Editor demo -
-

- -### About YAML -If you're new to YAML, it's pretty straight-forward. The format is exactly the same as that of JSON, but instead of using curly braces, structure is denoted using whitespace. This [quick guide](https://linuxhandbook.com/yaml-basics/) should get you up to speed in a few minutes, for more advanced topics take a look at this [Wikipedia article](https://en.wikipedia.org/wiki/YAML). - -### Config Saving Methods -When updating the config through the JSON editor in the UI, you have two save options: **Local** or **Write to Disk**. -- Changes saved locally will only be applied to the current user through the browser, and will not apply to other instances - you either need to use the cloud sync feature, or manually update the conf.yml file. -- On the other-hand, if you choose to write changes to disk, then your main `conf.yml` file will be updated, and changes will be applied to all users, and visible across all devices. For this functionality to work, you must be running Dashy with using the Docker container, or the Node server. A backup of your current configuration will also be saved in the same directory. - -### Preventing Changes being Written to Disk -To disallow any changes from being written to disk via the UI config editor, set `appConfig.allowConfigEdit: false`. If you are using users, and have setup `auth` within Dashy, then only users with `type: admin` will be able to write config changes to disk. - -### Example - -```yaml ---- -pageInfo: - title: Home Lab -sections: # An array of sections -- name: Section 1 - Getting Started - items: # An array of items - - title: GitHub - description: Source code and documentation on GitHub - icon: fab fa-github - url: https://github.com/Lissy93/dashy - - title: Issues - description: View currently open issues, or raise a new one - icon: fas fa-bug - url: https://github.com/Lissy93/dashy/issues - - title: Demo - description: A live demo - icon: far fa-rocket - url: https://dashy-demo-1.netlify.app -- name: Section 2 - Local Services - items: - - title: Firewall - icon: favicon - url: http://192.168.1.1/ - - title: Game Server - icon: https://i.ibb.co/710B3Yc/space-invader-x256.png - url: http://192.168.130.1/ -``` - -For more example config files, see: [this gist](https://gist.github.com/Lissy93/000f712a5ce98f212817d20bc16bab10) - -If you need any help, feel free to [Raise an Issue](https://github.com/Lissy93/dashy/issues/new?assignees=Lissy93&labels=%F0%9F%A4%B7%E2%80%8D%E2%99%82%EF%B8%8F+Question&template=question.md&title=%5BQUESTION%5D) or [Start a Discussion](https://github.com/Lissy93/dashy/discussions) - -Happy Configuring 🤓🔧 - -**[⬆️ Back to Top](#configuring)** - +# Configuring + +All app configuration is specified in [`/public/conf.yml`](https://github.com/Lissy93/dashy/blob/master/public/conf.yml) which is in [YAML Format](https://yaml.org/) format. Changes can also be made [directly through the UI](#editing-config-through-the-ui) and previewed live, from here you can also export, backup, reset, validate and download your configuration file. + +The following file provides a reference of all supported configuration options. + +--- + +#### Contents + +- [**`pageInfo`**](#pageinfo) - Header text, footer, title, navigation, etc + - [`navLinks`](#pageinfonavlinks-optional) - Navigation bar items and links +- [**`appConfig`**](#appconfig-optional) - Main application settings + - [`webSearch`](#appconfigwebsearch-optional) - Configure web search engine options + - [`hideComponents`](#appconfighidecomponents-optional) - Show/ hide page components + - [`auth`](#appconfigauth-optional) - Built-in authentication setup + - [`users`](#appconfigauthusers-optional) - Setup for simple auth + - [`keycloak`](#appconfigauthkeycloak-optional) - Auth using Keycloak +- [**`sections`**](#section) - List of sections + - [`displayData`](#sectiondisplaydata-optional) - Section display settings + - [`icon`](#sectionicon-and-sectionitemicon) - Icon for a section + - [`items`](#sectionitem) - List of items + - [`icon`](#sectionicon-and-sectionitemicon) - Icon for an item +- [**Notes**](#notes) + - [Editing Config through the UI](#editing-config-through-the-ui) + - [About YAML](#about-yaml) + - [Config Saving Methods](#config-saving-methods) + - [Preventing Changes](#preventing-changes-being-written-to-disk) + - [Example](#example) + +--- + +Tips: +- You may find it helpful to look at some sample config files to get you started, a collection of which can be found [here](https://gist.github.com/Lissy93/000f712a5ce98f212817d20bc16bab10) +- You can check that your config file fits the schema, by running `yarn validate-config` +- After modifying your config, the app needs to be recompiled, by running `yarn build` - this happens automatically whilst the app is running if you're using Docker +- It is recommended to make and keep a backup of your config file. You can download your current config through the UI either from the Config menu, or using the `/download` endpoint. Alternatively, you can use the [Cloud Backup](./docs/backup-restore.md) feature. +- The config can also be modified directly through the UI, validated and written to the conf.yml file. +- All fields are optional, unless otherwise stated. + +--- + +### Top-Level Fields + +**Field** | **Type** | **Required**| **Description** +--- | --- | --- | --- +**`pageInfo`** | `object` | Required | Basic meta data like title, description, nav bar links, footer text. See [`pageInfo`](#pageinfo) +**`appConfig`** | `object` | _Optional_ | Settings related to how the app functions, including API keys and global styles. See [`appConfig`](#appconfig-optional) +**`sections`** | `array` | Required | An array of sections, each containing an array of items, which will be displayed as links. See [`section`](#section) + +**[⬆️ Back to Top](#configuring)** + +### `PageInfo` + +**Field** | **Type** | **Required**| **Description** +--- | --- | --- | --- +**`title`** | `string` | Required | Your dashboard title, displayed in the header and browser tab +**`description`** | `string` | _Optional_ | Description of your dashboard, also displayed as a subtitle +**`navLinks`** | `array` | _Optional_ | Optional list of a maximum of 6 links, which will be displayed in the navigation bar. See [`navLinks`](#pageinfonavlinks-optional) +**`footerText`** | `string` | _Optional_ | Text to display in the footer (note that this will override the default footer content). This can also include HTML and inline CSS +**`logo`** | `string` | _Optional_ | The path to an image to display in the header (to the right of the title). This can be either local, where `/` is the root of `./public`, or any remote image, such as `https://i.ibb.co/yhbt6CY/dashy.png`. It's recommended to scale your image down, so that it doesn't impact load times + +**[⬆️ Back to Top](#configuring)** + +### `pageInfo.navLinks` _(optional)_ + +**Field** | **Type** | **Required**| **Description** +--- | --- | --- | --- +**`title`** | `string` | Required | The text to display on the link button +**`path`** | `string` | Required | The URL to navigate to when clicked. Can be relative (e.g. `/about`) or absolute (e.g. `https://example.com` or `http://192.168.1.1`) + +**[⬆️ Back to Top](#configuring)** + +### `appConfig` _(optional)_ + +**Field** | **Type** | **Required**| **Description** +--- | --- | --- | --- +**`language`** | `string` | _Optional_ | The 2 (or 4-digit) [ISO 639-1 code](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) for your language, e.g. `en` or `en-GB`. This must be a language that the app has already been [translated](https://github.com/Lissy93/dashy/tree/master/src/assets/locales) into. If your language is unavailable, Dashy will fallback to English. By default Dashy will attempt to auto-detect your language, although this may not work on some privacy browsers. +**`startingView`** | `enum` | _Optional_ | Which page to load by default, and on the base page or domain root. You can still switch to different views from within the UI. Can be either `default`, `minimal` or `workspace`. Defaults to `default` +**`defaultOpeningMethod`** | `enum` | _Optional_ | The default opening method for items, if no `target` is specified for a given item. Can be either `newtab`, `sametab`, `top`, `parent`, `modal` or `workspace`. Defaults to `newtab` +**`statusCheck`** | `boolean` | _Optional_ | When set to `true`, Dashy will ping each of your services and display their status as a dot next to each item. This can be overridden by setting `statusCheck` under each item. Defaults to `false` +**`statusCheckInterval`** | `boolean` | _Optional_ | The number of seconds between checks. If set to `0` then service will only be checked on initial page load, which is usually the desired functionality. If value is less than `10` you may experience a hit in performance. Defaults to `0` +**`webSearch`** | `object` | _Optional_ | Configuration options for the web search feature, set your default search engine, opening method or disable web search. See [`webSearch`](#appconfigwebsearch-optional) +**`backgroundImg`** | `string` | _Optional_ | Path to an optional full-screen app background image. This can be either remote (http) or local (/). Note that this will slow down initial load +**`enableFontAwesome`** | `boolean` | _Optional_ | Where `true` is enabled, if left blank font-awesome will be enabled only if required by 1 or more icons +**`fontAwesomeKey`** | `string` | _Optional_ | If you have a font-awesome key, then you can use it here and make use of premium icons. It is a 10-digit alpha-numeric string from you're FA kit URL (e.g. `13014ae648`) +**`faviconApi`** | `enum` | _Optional_ | Only applicable if you are using favicons for item icons. Specifies which service to use to resolve favicons. Set to `local` to do this locally, without using an API. Services running locally will use this option always. Available options are: `local`, `faviconkit`, `iconhorse`, `google`, `clearbit`, `webmasterapi` and `allesedv`. Defaults to `faviconkit`. See [Icons](/docs/icons.md#favicons) for more info +**`auth`** | `object` | _Optional_ | All settings relating to user authentication. See [`auth`](#appconfigauth-optional) +**`layout`** | `enum` | _Optional_ | Layout for homepage, either `horizontal`, `vertical` or `auto`. Defaults to `auto`. This specifies the layout and direction of how sections are positioned on the home screen. This can also be modified and overridden from the UI. +**`iconSize`** | `enum` | _Optional_ | The size of link items / icons. Can be either `small`, `medium,` or `large`. Defaults to `medium`. This can also be set directly from the UI. +**`colCount`** | `number` | _Optional_ | The number of columns of sections displayed on the homepage, using the default view. Should be in integer between `1` and `8`. Note that by default this is applied responsively, based on current screen size, and specifying a value here will override this behavior, which may not be desirable. +**`theme`** | `string` | _Optional_ | The default theme for first load (you can change this later from the UI) +**`cssThemes`** | `string[]` | _Optional_ | An array of custom theme names which can be used in the theme switcher dropdown +**`customColors`** | `object`| _Optional_ | Enables you to apply a custom color palette to any given theme. Use the theme name (lowercase) as the key, for an object including key-value-pairs, with the color variable name as keys, and 6-digit hex code as value. See [Theming](/docs/theming.md#modifying-theme-colors) for more info +**`externalStyleSheet`** | `string` or `string[]` | _Optional_ | Either a URL to an external stylesheet or an array or URLs, which can be applied as themes within the UI +**`customCss`** | `string` | _Optional_ | Raw CSS that will be applied to the page. This can also be set from the UI. Please minify it first. +**`hideComponents`** | `object` | _Optional_ | A list of key page components (header, footer, search, settings, etc) that are present by default, but can be removed using this option. See [`appConfig.hideComponents`](#appconfighideComponents-optional) +**`routingMode`** | `string` | _Optional_ | Can be either `hash` or `history`. Determines the URL format for sub-pages, hash mode will look like `/#/home` whereas with history mode available you have nice clean URLs, like `/home`. For more info, see the [Vue docs](https://router.vuejs.org/guide/essentials/history-mode.html#example-server-configurations). If you're hosting Dashy with a custom BASE_URL, you will find that a bit of extra server config is necessary to get history mode working, so here you may want to instead use `hash` mode.Defaults to `history`. +**`enableMultiTasking`** | `boolean` | _Optional_ | If set to true, will keep apps open in the background when in the workspace view. Useful for quickly switching between multiple sites, and preserving their state, but comes at the cost of performance. +**`workspaceLandingUrl`** | `string` | _Optional_ | The URL or an app, service or website to launch when the workspace view is opened, before another service has been launched +**`allowConfigEdit`** | `boolean` | _Optional_ | Should prevent / allow the user to write configuration changes to the conf.yml from the UI. When set to `false`, the user can only apply changes locally using the config editor within the app, whereas if set to `true` then changes can be written to disk directly through the UI. Defaults to `true`. Note that if authentication is enabled, the user must be of type `admin` in order to apply changes globally. +**`enableErrorReporting`** | `boolean` | _Optional_ | Enable reporting of unexpected errors and crashes. This is off by default, and **no data will ever be captured unless you explicitly enable it**. Turning on error reporting helps previously unknown bugs get discovered and fixed. Dashy uses [Sentry](https://github.com/getsentry/sentry) for error reporting. Defaults to `false`. +**`sentryDsn`** | `boolean` | _Optional_ | If you need to monitor errors in your instance, then you can use Sentry to collect and process bug reports. Sentry can be self-hosted, or used as SaaS, once your instance is setup, then all you need to do is pass in the DSN here, and enable error reporting. You can learn more on the [Sentry DSN Docs](https://docs.sentry.io/product/sentry-basics/dsn-explainer/). Note that this will only ever be used if `enableErrorReporting` is explicitly enabled. +**`disableSmartSort`** | `boolean` | _Optional_ | For the most-used and last-used app sort functions to work, a basic open-count is stored in local storage. If you do not want this to happen, then disable smart sort here, but you wil no longer be able to use these sort options. Defaults to `false`. +**`disableUpdateChecks`** | `boolean` | _Optional_ | If set to true, Dashy will not check for updates. Defaults to `false`. +**`enableServiceWorker`** | `boolean` | _Optional_ | Service workers cache web applications to improve load times and offer basic offline functionality, and are enabled by default in Dashy. The service worker can sometimes cause older content to be cached, requiring the app to be hard-refreshed. If you do not want SW functionality, or are having issues with caching, set this property to `true` to disable all service workers. +**`disableContextMenu`** | `boolean` | _Optional_ | If set to `true`, the custom right-click context menu will be disabled. Defaults to `false`. + +**[⬆️ Back to Top](#configuring)** + +### `appConfig.auth` _(optional)_ +**Field** | **Type** | **Required**| **Description** +--- | --- | --- | --- +**`users`** | `array` | _Optional_ | An array of objects containing usernames and hashed passwords. If this is not provided, then authentication will be off by default, and you will not need any credentials to access the app. See [`appConfig.auth.users`](#appconfigauthusers-optional).
**Note** this method of authentication is handled on the client side, so for security critical situations, it is recommended to use an [alternate authentication method](/docs/authentication.md#alternative-authentication-methods). +**`enableKeycloak`** | `boolean` | _Optional_ | If set to `true`, then authentication using Keycloak will be anabled. Note that you need to have an instance running, and have also configured `auth.keycloak`. Defaults to `false` +**`keycloak`** | `object` | _Optional_ | Config options to point Dashy to your Keycloak server. Requires `enableKeycloak: true`. See [`auth.keycloak`](#appconfigauthkeycloak-optional) for more info +**`enableGuestAccess`** | `boolean` | _Optional_ | When set to `true`, an unauthenticated user will be able to access the dashboard, with read-only access, without having to login. Requires `auth.users` to be configured. Defaults to `false`. + +For more info, see the **[Authentication Docs](/docs/authentication.md)** + +**[⬆️ Back to Top](#configuring)** + +### `appConfig.auth.users` _(optional)_ + +**Field** | **Type** | **Required**| **Description** +--- | --- | --- | --- +**`user`** | `string` | Required | Username to log in with +**`hash`** | `string` | Required | A SHA-256 hashed password +**`type`** | `string` | _Optional_ | The user type, either admin or normal + +**[⬆️ Back to Top](#configuring)** + +### `appConfig.auth.keycloak` _(optional)_ + +**Field** | **Type** | **Required**| **Description** +--- | --- | --- | --- +**`serverUrl`** | `string` | Required | The URL (or URL/ IP + Port) where your keycloak server is running +**`realm`** | `string` | Required | The name of the realm (must already be created) that you want to use +**`clientId`** | `string` | Required | The Client ID of the client you created for use with Dashy + +**[⬆️ Back to Top](#configuring)** + +### `appConfig.webSearch` _(optional)_ + +**Field** | **Type** | **Required**| **Description** +--- | --- | --- | --- +**`disableWebSearch`** | `string` | _Optional_ | Web search is enabled by default, but can be disabled by setting this property to `true` +**`searchEngine`** | `string` | _Optional_ | Set the key name for your search engine. Can also use a custom engine by setting this property to `custom`. Currently supported: `duckduckgo`, `google`, `whoogle`, `qwant`, `startpage`, `searx-bar` and `searx-info`. Defaults to `duckduckgo` +**`customSearchEngine`** | `string` | _Optional_ | You can also use a custom search engine, or your own self-hosted instance. This requires `searchEngine: custom` to be set. Then add the URL of your service, with GET query string included here +**`openingMethod`** | `string` | _Optional_ | Set your preferred opening method for search results: `newtab`, `sametab`, `workspace`. Defaults to `newtab` +**`searchBangs`** | `object` | _Optional_ | A key-value-pair set of custom search _bangs_ for redirecting query to a specific app or search engine. The key of each should be the bang you will type (typically starting with `/`, `!` or `:`), and value is the destination, either as a search engine key (e.g. `reddit`) or a URL with search parameters (e.g. `https://en.wikipedia.org/w/?search=`) + + +**[⬆️ Back to Top](#configuring)** + +### `appConfig.hideComponents` _(optional)_ + +**Field** | **Type** | **Required**| **Description** +--- | --- | --- | --- +**`hideHeading`** | `boolean` | _Optional_ | If set to `true`, the page title & sub-title will not be visible. Defaults to `false` +**`hideNav`** | `boolean` | _Optional_ | If set to `true`, the navigation menu will not be visible. Defaults to `false` +**`hideSearch`** | `boolean` | _Optional_ | If set to `true`, the search bar will not be visible. Defaults to `false` +**`hideSettings`** | `boolean` | _Optional_ | If set to `true`, the settings menu will not be visible. Defaults to `false` +**`hideFooter`** | `boolean` | _Optional_ | If set to `true`, the footer will not be visible. Defaults to `false` +**`hideSplashScreen`** | `boolean` | _Optional_ | If set to `true`, splash screen will not be visible while the app loads. Defaults to `true` (except on first load, when the loading screen is always shown) + +**[⬆️ Back to Top](#configuring)** + +### `section` + +**Field** | **Type** | **Required**| **Description** +--- | --- | --- | --- +**`name`** | `string` | Required | The title for the section +**`icon`** | `string` | _Optional_ | An single icon to be displayed next to the title. See [`section.icon`](#sectionicon-and-sectionitemicon) +**`items`** | `array` | Required | An array of items to be displayed within the section. See [`item`](#sectionitem) +**`displayData`** | `object` | _Optional_ | Meta-data to optionally overide display settings for a given section. See [`displayData`](#sectiondisplaydata-optional) + +**[⬆️ Back to Top](#configuring)** + +### `section.item` + +**Field** | **Type** | **Required**| **Description** +--- | --- | --- | --- +**`title`** | `string` | Required | The text to display/ title of a given item. Max length `18` +**`description`** | `string` | _Optional_ | Additional info about an item, which is shown in the tooltip on hover, or visible on large tiles +**`url`** | `string` | Required | The URL / location of web address for when the item is clicked +**`icon`** | `string` | _Optional_ | The icon for a given item. Can be a font-awesome icon, favicon, remote URL or local URL. See [`item.icon`](#sectionicon-and-sectionitemicon) +**`target`** | `string` | _Optional_ | The opening method for when the item is clicked, either `newtab`, `sametab`, `top`, `parent`, `modal` or `workspace`. Where `newtab` will open the link in a new tab, `sametab` will open it in the current tab, and `modal` will open a pop-up modal and `workspace` will open in the Workspace view. Defaults to `newtab` +**`hotkey`** | `number` | _Optional_ | Give frequently opened applications a numeric hotkey, between `0 - 9`. You can then just press that key to launch that application. +**`tags`** | `string[]` | _Optional_ | A list of tags, which can be used for improved search +**`statusCheck`** | `boolean` | _Optional_ | When set to `true`, Dashy will ping the URL associated with the current service, and display its status as a dot next to the item. The value here will override `appConfig.statusCheck` so you can turn off or on checks for a given service. Defaults to `appConfig.statusCheck`, falls back to `false` +**`statusCheckUrl`** | `string` | _Optional_ | If you've enabled `statusCheck`, and want to use a different URL to what is defined under the item, then specify it here +**`statusCheckHeaders`** | `object` | _Optional_ | If you're endpoint requires any specific headers for the status checking, then define them here +**`statusCheckAllowInsecure`** | `boolean` | _Optional_ | By default, any request to insecure content will be blocked. Setting this option to `true` will disable the `rejectUnauthorized` option, enabling you to ping non-HTTPS services for the current item. Defaults to `false` +**`color`** | `string` | _Optional_ | An optional color for the text and font-awesome icon to be displayed in. Note that this will override the current theme and so may not display well +**`backgroundColor`** | `string` | _Optional_ | An optional background fill color for the that given item. Again, this will override the current theme and so might not display well against the background +**`provider`** | `string` | _Optional_ | The name of the provider for a given service, useful for when including hosted apps. In some themes, this is visible under the item name + +**[⬆️ Back to Top](#configuring)** + +### `section.displayData` _(optional)_ + +**Field** | **Type** | **Required**| **Description** +--- | --- | --- | --- +**`sortBy`** | `string` | _Optional_ | The sort order for items within the current section. By default items are displayed in the order in which they are listed in within the config. The following sort options are supported: `most-used` (most opened apps first), `last-used` (the most recently used apps), `alphabetical`, `reverse-alphabetical`, `random` and `default` +**`collapsed`** | `boolean` | _Optional_ | If true, the section will be collapsed initially, and will need to be clicked to open. Useful for less regularly used, or very long sections. Defaults to `false` +**`rows`** | `number` | _Optional_ | Height of the section, specified as the number of rows it should span vertically, e.g. `2`. Defaults to `1`. Max is `5`. +**`cols`** | `number` | _Optional_ | Width of the section, specified as the number of columns the section should span horizontally, e.g. `2`. Defaults to `1`. Max is `5`. +**`itemSize`** | `string` | _Optional_ | Specify the size for items within this group, either `small`, `medium` or `large`. Note that this will overide any settings specified through the UI +**`color`** | `string` | _Optional_ | A custom accent color for the section, as a hex code or HTML color (e.g. `#fff`) +**`customStyles`** | `string` | _Optional_ | Custom CSS properties that should be applied to that section, e.g. `border: 2px dashed #ff0000;` +**`sectionLayout`** | `string` | _Optional_ | Specify which CSS layout will be used to responsivley place items. Can be either `auto` (which uses flex layout), or `grid`. If `grid` is selected, then `itemCountX` and `itemCountY` may also be set. Defaults to `auto` +**`itemCountX`** | `number` | _Optional_ | The number of items to display per row / horizontally. If not set, it will be calculated automatically based on available space. Can only be set if `sectionLayout` is set to `grid`. Must be a whole number between `1` and `12` +**`itemCountY`** | `number` | _Optional_ | The number of items to display per column / vertically. If not set, it will be calculated automatically based on available space. If `itemCountX` is set, then `itemCountY` can be calculated automatically. Can only be set if `sectionLayout` is set to `grid`. Must be a whole number between `1` and `12` +**`hideForUsers`** | `string[]` | _Optional_ | Current section will be visible to all users, except for those specified in this list +**`showForUsers`** | `string[]` | _Optional_ | Current section will be hidden from all users, except for those specified in this list +**`hideForGuests`** | `boolean` | _Optional_ | Current section will be visible for logged in users, but not for guests (see `appConfig.enableGuestAccess`). Defaults to `false` + +**[⬆️ Back to Top](#configuring)** + +### `section.icon` and `section.item.icon` + +**Field** | **Type** | **Required**| **Description** +--- | --- | --- | --- +**`icon`** | `string` | _Optional_ | The icon for a given item or section. See [Icon Docs](/docs/icons.md) for all available supported icon types. To auto-fetch icon from a services URL, aet to `favicon`. To use font-awesome, specify the category, followed by the icon name, e.g. `fas fa-rocket`, `fab fa-monero` or `fal fa-duck`. Similarly, for branded icons, you can use [simple-icons](https://simpleicons.org/) by setting icon to `si-[icon-name]` or [material-design-icons](https://dev.materialdesignicons.com/icons) by setting icon to `mdi-[icon-name]`. If set to `generative`, then a unique icon is generated from the apps URL or IP. You can also use hosted any by specifying it's URL, e.g. `https://i.ibb.co/710B3Yc/space-invader-x256.png`. To use a local image, first store it in `./public/item-icons/` (or `-v /app/public/item-icons/` in Docker) , and reference it by name and extension - e.g. set `image.png` to use `./public/item-icon/image.png`, you can also use sub-folders if you have a lot of icons, to keep them organised. + +**[⬆️ Back to Top](#configuring)** + +--- + +## Notes + +### Editing Config through the UI + +Config can be modified directly through the UI, and then written to disk, or applied locally. This can be done wither with the raw config editor (introduced in V 0.6.5 / [#3](https://github.com/Lissy93/dashy/pull/3)), or the interactive editor (introduced in V 1.8.9 / [#298](https://github.com/Lissy93/dashy/pull/298)). + +

+ + Interactive Editor
+ Interactive Editor demo +
+
+ + Raw Editor
+ Config Editor demo +
+

+ +### About YAML +If you're new to YAML, it's pretty straight-forward. The format is exactly the same as that of JSON, but instead of using curly braces, structure is denoted using whitespace. This [quick guide](https://linuxhandbook.com/yaml-basics/) should get you up to speed in a few minutes, for more advanced topics take a look at this [Wikipedia article](https://en.wikipedia.org/wiki/YAML). + +### Config Saving Methods +When updating the config through the JSON editor in the UI, you have two save options: **Local** or **Write to Disk**. +- Changes saved locally will only be applied to the current user through the browser, and will not apply to other instances - you either need to use the cloud sync feature, or manually update the conf.yml file. +- On the other-hand, if you choose to write changes to disk, then your main `conf.yml` file will be updated, and changes will be applied to all users, and visible across all devices. For this functionality to work, you must be running Dashy with using the Docker container, or the Node server. A backup of your current configuration will also be saved in the same directory. + +### Preventing Changes being Written to Disk +To disallow any changes from being written to disk via the UI config editor, set `appConfig.allowConfigEdit: false`. If you are using users, and have setup `auth` within Dashy, then only users with `type: admin` will be able to write config changes to disk. + +### Example + +```yaml +--- +pageInfo: + title: Home Lab +sections: # An array of sections +- name: Section 1 - Getting Started + items: # An array of items + - title: GitHub + description: Source code and documentation on GitHub + icon: fab fa-github + url: https://github.com/Lissy93/dashy + - title: Issues + description: View currently open issues, or raise a new one + icon: fas fa-bug + url: https://github.com/Lissy93/dashy/issues + - title: Demo + description: A live demo + icon: far fa-rocket + url: https://dashy-demo-1.netlify.app +- name: Section 2 - Local Services + items: + - title: Firewall + icon: favicon + url: http://192.168.1.1/ + - title: Game Server + icon: https://i.ibb.co/710B3Yc/space-invader-x256.png + url: http://192.168.130.1/ +``` + +For more example config files, see: [this gist](https://gist.github.com/Lissy93/000f712a5ce98f212817d20bc16bab10) + +If you need any help, feel free to [Raise an Issue](https://github.com/Lissy93/dashy/issues/new?assignees=Lissy93&labels=%F0%9F%A4%B7%E2%80%8D%E2%99%82%EF%B8%8F+Question&template=question.md&title=%5BQUESTION%5D) or [Start a Discussion](https://github.com/Lissy93/dashy/discussions) + +Happy Configuring 🤓🔧 + +**[⬆️ Back to Top](#configuring)** + diff --git a/docs/icons.md b/docs/icons.md index ac4adeafd3..ff98f7993c 100644 --- a/docs/icons.md +++ b/docs/icons.md @@ -1,190 +1,191 @@ -# Icons - -Both sections and items can have an icon, which is specified using the `icon` attribute. Using icons improves the aesthetics of your UI and makes the app more intuitive to use. Dashy supports multiple different icon providers, usage instructions for which are explained here. - -- [Auto-Fetched Favicons](#favicons) -- [Font Awesome Icons](#font-awesome) -- [Simple Icons](#simple-icons) -- [Generative Icons](#generative-icons) -- [Emoji Icons](#emoji-icons) -- [Home-Lab Icons](#home-lab-icons) -- [Material Icons](#material-design-icons) -- [Icons by URL](#icons-by-url) -- [Local Icons](#local-icons) -- [No Icon](#no-icon) - -

- -

- ---- - -## Favicons -Dashy can auto-fetch an icon for a given service, using it's favicon. Just set `icon: favicon` to use this feature. - -

- -

- -Since different websites host their favicons at different paths, for the best results Dashy can use an API to resolve a websites icon. - -The default favicon API is [allesedv.com](https://favicon.allesedv.com/), but you can change this under `appConfig.faviconApi`. If you'd prefer not to use an API, just set this value to `local`. You can also use different APIs for individual items, by setting `icon: favicon-[api]`, e.g. `favicon-clearbit`. - -The following favicon APIs are supported: -- `allesedv` - [allesedv.com](https://favicon.allesedv.com/) is a highly efficient IPv6-enabled service -- `clearbit` - [Clearbit](https://clearbit.com/logo) returns high-quality square logos from mainstream websites -- `faviconkit` - [faviconkit.com](https://faviconkit.com/) good quality icons and most sites supported (Note: down as of Nov '21) -- `besticon` - [BestIcon](https://github.com/mat/besticon) fetches websites icons from manifest -- `mcapi` - [MC-API](https://eu.mc-api.net/) fetches default website favicon, originally a Minecraft util -- `duckduckgo` - Returns decent quality website icons, from DuckDuckGo search -- `google` - Official Google favicon API service, good support for all sites, but poor quality -- `yandex` - Lower quality icons, but useful in some regions where other services are blocked -- `local` - Set to local to fetch the default icon at /favicon.ico instead of using an API - -If for a given service none of the APIs work in your situation, and nor does local, then the best option is to find the path of the services logo or favicon, and set the icon to the URL of the raw image. For example, `icon: https://monitoring.local/faviconx128.png`- you can find this path using the browser dev tools. - ---- - -## Font Awesome -You can use any [Font Awesome Icon](https://fontawesome.com/icons) simply by specifying it's identifier. This is in the format of `[category] [name]` and can be found on the page for that icon on the Font Awesome site. For example: `fas fa-rocket`, `fab fa-monero` or `fas fa-unicorn`. - -Font-Awesome has a wide variety of free icons, but you can also use their pro icons if you have a membership. To do so, you need to specify your license key under: `appConfig.fontAwesomeKey`. This is usually a 10-digit string, for example `13014ae648`. - -

- -

- ---- - -## Simple Icons -[SimpleIcons.org](https://simpleicons.org/) is a collection of 2000+ high quality, free and open source brand and logo SVG icons. Usage of which is very similar to font-awesome icons. First find the glyph you want to use on the [website](https://simpleicons.org/), then just set your icon the the simple icon slug, prefixed with `si-`. - -

- -

- -For example: -```yaml -sections: -- name: Simple Icons Example - items: - - title: Portainer - icon: si-portainer - - title: FreeNAS - icon: si-freenas - - title: NextCloud - icon: si-nextcloud - - title: Home Assistant - icon: si-homeassistant -``` - ---- - -## Generative Icons -To uses a unique and programmatically generated icon for a given service just set `icon: generative`. This is particularly useful when you have a lot of similar services with a different IP or port, and no specific icon. These icons are generated with [DiceBear](https://avatars.dicebear.com/) (or [Evatar](https://evatar.io/) for fallback), and use a hash of the services domain/ ip for entropy, so each domain will have a unique icon. - -

- -

- ---- - -## Emoji Icons -You can use almost any emoji as an icon for items or sections. You can specify the emoji either by pasting it directly, using it's unicode ( e.g. `'U+1F680'`) or shortcode (e.g. `':rocket:'`). You can find these codes for any emoji using [Emojipedia](https://emojipedia.org/) (near the bottom of emoji each page), or for a quick reference to emoji shortcodes, check out [emojis.ninja](https://emojis.ninja/) by @nomanoff. - -

- -

- -For example, these will all render the same rocket (🚀) emoji: `icon: ':rocket:'` or `icon: 'U+1F680'` or `icon: 🚀` - ---- - -## Home-Lab Icons - -The [dashboard-icons](https://github.com/WalkxCode/dashboard-icons) repo by [@WalkxCode](https://github.com/WalkxCode) provides a comprehensive collection of 360+ high-quality PNG icons for commonly self-hosted services. Dashy natively supports these icons, and you can use them just by specifying the icon name (without extension) preceded by `hl-`. See [here](https://github.com/WalkxCode/dashboard-icons/tree/master/png) for a full list of all available icons. Note that these are fetched and cached strait from GitHub, so if you require offline access, the [Local Icons](#local-icons) method may be a better option for you. - -For example: -```yaml -sections: -- name: Home Lab Icons Example - items: - - title: AdGuard Home - icon: hl-adguardhome - - title: Long Horn - icon: hl-longhorn - - title: Nagios - icon: hl-nagios - - title: Whoogle Search - icon: hl-whooglesearch -``` - - -

- -

- ---- - -## Material Design Icons -Dashy also supports 5000+ [material-design-icons](https://github.com/Templarian/MaterialDesign). To use these, first find the name/ slug for your icon [here](https://dev.materialdesignicons.com/icons), and then prefix is with `mdi-`. - -For example: -```yaml -sections: -- name: Material Design Icons Example - items: - - title: Alien Icon - icon: mdi-alien - - title: Fire Icon - icon: mdi-fire - - title: Dino Icon - icon: mdi-google-downasaur -``` - -

- -

- ---- - -## Icons by URL -You can also set an icon by passing in a valid URL pointing to the icons location. For example `icon: https://i.ibb.co/710B3Yc/space-invader-x256.png`, this can be in .png, .jpg or .svg format, and hosted anywhere (local or remote) - so long as it's accessible from where you are hosting Dashy. The icon will be automatically scaled to fit, however loading in a lot of large icons may have a negative impact on performance, especially if you visit Dashy from new devices often. - ---- - -## Local Icons -You may also want to store your icons locally, bundled within Dashy so that there is no reliance on outside services. This can be done by putting the icons within Dashy's `./public/item-icons/` directory. If you are using Docker, then the easiest option is to map a volume from your host system, for example: `-v /local/image/directory:/app/public/item-icons/`. To reference an icon stored locally, just specify it's name and extension. For example, if my icon was stored in `/app/public/item-icons/maltrail.png`, then I would just set `icon: maltrail.png`. - -You can also use sub-folders within the `item-icons` directory to keep things organized. You would then specify an icon with it's folder name slash image name. For example: `networking/monit.png` - ---- - -## No Icon -If you don't wish for a given item or section to have an icon, just leave out the `icon` attribute. - ---- - -## Icon Collections and Resources - -The following websites provide good-quality, free icon sets. To use any of these icons, either copy the link to the raw icon (it should end in `.svg` or `.png`) and paste it as your `icon`, or download and save the icons in `/public/item-icons` / mapped Docker volume. Full credit to the authors, please see the licenses for each service for usage and copyright information. - -- [Icons for Self-Hosted Apps](https://thehomelab.wiki/books/helpful-tools-resources/page/icons-for-self-hosted-dashboards) - 350+ high-quality icons for commonly self-hosted services -- [SVG Box](https://svgbox.net/iconsets/) - Cryptocurrency, social media apps and flag icons -- [Simple Icons](https://simpleicons.org/) - Free SVG brand icons, with easy API access -- [Material Design Icons](https://github.com/google/material-design-icons/) - Hundreds of Open source PNG + SVG icons by Google -- [Icons8](https://icons8.com/icons) - Thousands of icons, all with free versions at 64x64 -- [Flat Icon](https://www.flaticon.com/) - Wide variety of icon sets, most of which are free to use -- [SVG Repo](https://www.svgrepo.com/) - 300,000+ Vector Icons - -If you are a student, then you can get free access to premium icons on [Icon Scout](https://education.github.com/pack/redeem/iconscout-student) or [Icons8](https://icons8.com/github-students) using the [GitHub Student Pack](https://education.github.com/pack). - ---- - -## Notes - -If you are using icons from an external source, these will be fetched on initial page load automatically, if and when needed. But combining icons from multiple services may have a negative impact on performance. - -You can improve load speeds, by downloading your required icons, and serving them locally. Scaling icons to the minimum required dimensions (e.g. 128x128 or 64x64) will also greatly improve application load times. - -For icons from external sources, please see the Privacy Policies and Licenses for that provider. +# Icons + +Both sections and items can have an icon, which is specified using the `icon` attribute. Using icons improves the aesthetics of your UI and makes the app more intuitive to use. Dashy supports multiple different icon providers, usage instructions for which are explained here. + +- [Auto-Fetched Favicons](#favicons) +- [Font Awesome Icons](#font-awesome) +- [Simple Icons](#simple-icons) +- [Generative Icons](#generative-icons) +- [Emoji Icons](#emoji-icons) +- [Home-Lab Icons](#home-lab-icons) +- [Material Icons](#material-design-icons) +- [Icons by URL](#icons-by-url) +- [Local Icons](#local-icons) +- [No Icon](#no-icon) + +

+ +

+ +--- + +## Favicons +Dashy can auto-fetch an icon for a given service, using it's favicon. Just set `icon: favicon` to use this feature. + +

+ +

+ +Since different websites host their favicons at different paths, for the best results Dashy can use an API to resolve a websites icon. + +The default favicon API is [allesedv.com](https://favicon.allesedv.com/), but you can change this under `appConfig.faviconApi`. If you'd prefer not to use an API, just set this value to `local`. You can also use different APIs for individual items, by setting `icon: favicon-[api]`, e.g. `favicon-clearbit`. + +The following favicon APIs are supported: +- `allesedv` - [allesedv.com](https://favicon.allesedv.com/) is a highly efficient IPv6-enabled service +- `iconhorse` - [Icon.Horse](https://icon.horse/) returns quality icons for any site, with caching for speed and fallbacks for sites without an icon +- `clearbit` - [Clearbit](https://clearbit.com/logo) returns high-quality square logos from mainstream websites +- `faviconkit` - [faviconkit.com](https://faviconkit.com/) good quality icons and most sites supported (Note: down as of Nov '21) +- `besticon` - [BestIcon](https://github.com/mat/besticon) fetches websites icons from manifest +- `mcapi` - [MC-API](https://eu.mc-api.net/) fetches default website favicon, originally a Minecraft util +- `duckduckgo` - Returns decent quality website icons, from DuckDuckGo search +- `google` - Official Google favicon API service, good support for all sites, but poor quality +- `yandex` - Lower quality icons, but useful in some regions where other services are blocked +- `local` - Set to local to fetch the default icon at /favicon.ico instead of using an API + +If for a given service none of the APIs work in your situation, and nor does local, then the best option is to find the path of the services logo or favicon, and set the icon to the URL of the raw image. For example, `icon: https://monitoring.local/faviconx128.png`- you can find this path using the browser dev tools. + +--- + +## Font Awesome +You can use any [Font Awesome Icon](https://fontawesome.com/icons) simply by specifying it's identifier. This is in the format of `[category] [name]` and can be found on the page for that icon on the Font Awesome site. For example: `fas fa-rocket`, `fab fa-monero` or `fas fa-unicorn`. + +Font-Awesome has a wide variety of free icons, but you can also use their pro icons if you have a membership. To do so, you need to specify your license key under: `appConfig.fontAwesomeKey`. This is usually a 10-digit string, for example `13014ae648`. + +

+ +

+ +--- + +## Simple Icons +[SimpleIcons.org](https://simpleicons.org/) is a collection of 2000+ high quality, free and open source brand and logo SVG icons. Usage of which is very similar to font-awesome icons. First find the glyph you want to use on the [website](https://simpleicons.org/), then just set your icon the the simple icon slug, prefixed with `si-`. + +

+ +

+ +For example: +```yaml +sections: +- name: Simple Icons Example + items: + - title: Portainer + icon: si-portainer + - title: FreeNAS + icon: si-freenas + - title: NextCloud + icon: si-nextcloud + - title: Home Assistant + icon: si-homeassistant +``` + +--- + +## Generative Icons +To uses a unique and programmatically generated icon for a given service just set `icon: generative`. This is particularly useful when you have a lot of similar services with a different IP or port, and no specific icon. These icons are generated with [DiceBear](https://avatars.dicebear.com/) (or [Evatar](https://evatar.io/) for fallback), and use a hash of the services domain/ ip for entropy, so each domain will have a unique icon. + +

+ +

+ +--- + +## Emoji Icons +You can use almost any emoji as an icon for items or sections. You can specify the emoji either by pasting it directly, using it's unicode ( e.g. `'U+1F680'`) or shortcode (e.g. `':rocket:'`). You can find these codes for any emoji using [Emojipedia](https://emojipedia.org/) (near the bottom of emoji each page), or for a quick reference to emoji shortcodes, check out [emojis.ninja](https://emojis.ninja/) by @nomanoff. + +

+ +

+ +For example, these will all render the same rocket (🚀) emoji: `icon: ':rocket:'` or `icon: 'U+1F680'` or `icon: 🚀` + +--- + +## Home-Lab Icons + +The [dashboard-icons](https://github.com/WalkxCode/dashboard-icons) repo by [@WalkxCode](https://github.com/WalkxCode) provides a comprehensive collection of 360+ high-quality PNG icons for commonly self-hosted services. Dashy natively supports these icons, and you can use them just by specifying the icon name (without extension) preceded by `hl-`. See [here](https://github.com/WalkxCode/dashboard-icons/tree/master/png) for a full list of all available icons. Note that these are fetched and cached strait from GitHub, so if you require offline access, the [Local Icons](#local-icons) method may be a better option for you. + +For example: +```yaml +sections: +- name: Home Lab Icons Example + items: + - title: AdGuard Home + icon: hl-adguardhome + - title: Long Horn + icon: hl-longhorn + - title: Nagios + icon: hl-nagios + - title: Whoogle Search + icon: hl-whooglesearch +``` + + +

+ +

+ +--- + +## Material Design Icons +Dashy also supports 5000+ [material-design-icons](https://github.com/Templarian/MaterialDesign). To use these, first find the name/ slug for your icon [here](https://dev.materialdesignicons.com/icons), and then prefix is with `mdi-`. + +For example: +```yaml +sections: +- name: Material Design Icons Example + items: + - title: Alien Icon + icon: mdi-alien + - title: Fire Icon + icon: mdi-fire + - title: Dino Icon + icon: mdi-google-downasaur +``` + +

+ +

+ +--- + +## Icons by URL +You can also set an icon by passing in a valid URL pointing to the icons location. For example `icon: https://i.ibb.co/710B3Yc/space-invader-x256.png`, this can be in .png, .jpg or .svg format, and hosted anywhere (local or remote) - so long as it's accessible from where you are hosting Dashy. The icon will be automatically scaled to fit, however loading in a lot of large icons may have a negative impact on performance, especially if you visit Dashy from new devices often. + +--- + +## Local Icons +You may also want to store your icons locally, bundled within Dashy so that there is no reliance on outside services. This can be done by putting the icons within Dashy's `./public/item-icons/` directory. If you are using Docker, then the easiest option is to map a volume from your host system, for example: `-v /local/image/directory:/app/public/item-icons/`. To reference an icon stored locally, just specify it's name and extension. For example, if my icon was stored in `/app/public/item-icons/maltrail.png`, then I would just set `icon: maltrail.png`. + +You can also use sub-folders within the `item-icons` directory to keep things organized. You would then specify an icon with it's folder name slash image name. For example: `networking/monit.png` + +--- + +## No Icon +If you don't wish for a given item or section to have an icon, just leave out the `icon` attribute. + +--- + +## Icon Collections and Resources + +The following websites provide good-quality, free icon sets. To use any of these icons, either copy the link to the raw icon (it should end in `.svg` or `.png`) and paste it as your `icon`, or download and save the icons in `/public/item-icons` / mapped Docker volume. Full credit to the authors, please see the licenses for each service for usage and copyright information. + +- [Icons for Self-Hosted Apps](https://thehomelab.wiki/books/helpful-tools-resources/page/icons-for-self-hosted-dashboards) - 350+ high-quality icons for commonly self-hosted services +- [SVG Box](https://svgbox.net/iconsets/) - Cryptocurrency, social media apps and flag icons +- [Simple Icons](https://simpleicons.org/) - Free SVG brand icons, with easy API access +- [Material Design Icons](https://github.com/google/material-design-icons/) - Hundreds of Open source PNG + SVG icons by Google +- [Icons8](https://icons8.com/icons) - Thousands of icons, all with free versions at 64x64 +- [Flat Icon](https://www.flaticon.com/) - Wide variety of icon sets, most of which are free to use +- [SVG Repo](https://www.svgrepo.com/) - 300,000+ Vector Icons + +If you are a student, then you can get free access to premium icons on [Icon Scout](https://education.github.com/pack/redeem/iconscout-student) or [Icons8](https://icons8.com/github-students) using the [GitHub Student Pack](https://education.github.com/pack). + +--- + +## Notes + +If you are using icons from an external source, these will be fetched on initial page load automatically, if and when needed. But combining icons from multiple services may have a negative impact on performance. + +You can improve load speeds, by downloading your required icons, and serving them locally. Scaling icons to the minimum required dimensions (e.g. 128x128 or 64x64) will also greatly improve application load times. + +For icons from external sources, please see the Privacy Policies and Licenses for that provider. diff --git a/src/utils/ConfigSchema.json b/src/utils/ConfigSchema.json index 24099f2352..262a6a61c8 100644 --- a/src/utils/ConfigSchema.json +++ b/src/utils/ConfigSchema.json @@ -147,6 +147,7 @@ "local", "allesedv", "clearbit", + "iconhorse", "faviconkit", "duckduckgo", "yandex", @@ -741,4 +742,4 @@ } } } -} \ No newline at end of file +} diff --git a/src/utils/defaults.js b/src/utils/defaults.js index 36b61a48a1..d952f23cf2 100644 --- a/src/utils/defaults.js +++ b/src/utils/defaults.js @@ -185,6 +185,7 @@ module.exports = { faviconApiEndpoints: { allesedv: 'https://f1.allesedv.com/128/$URL', clearbit: 'https://logo.clearbit.com/$URL', + iconhorse: 'https://icon.horse/icon/$URL', faviconkit: 'https://api.faviconkit.com/$URL/64', duckduckgo: 'https://icons.duckduckgo.com/ip2/$URL.ico', yandex: 'https://favicon.yandex.net/favicon/$URL', From 7f4948aa0477032ce458b2dc0e1adfc37a2e5415 Mon Sep 17 00:00:00 2001 From: Alicia Sykes Date: Wed, 29 Dec 2021 18:00:54 +0000 Subject: [PATCH 2/7] :dizzy: Removes splash screen on by default --- docs/configuring.md | 2 +- src/App.vue | 3 +-- src/utils/ConfigHelpers.js | 2 -- src/utils/ConfigSchema.json | 12 ++++++------ 4 files changed, 8 insertions(+), 11 deletions(-) diff --git a/docs/configuring.md b/docs/configuring.md index 02a04266ae..23f8d1865f 100644 --- a/docs/configuring.md +++ b/docs/configuring.md @@ -99,6 +99,7 @@ Tips: **`enableMultiTasking`** | `boolean` | _Optional_ | If set to true, will keep apps open in the background when in the workspace view. Useful for quickly switching between multiple sites, and preserving their state, but comes at the cost of performance. **`workspaceLandingUrl`** | `string` | _Optional_ | The URL or an app, service or website to launch when the workspace view is opened, before another service has been launched **`allowConfigEdit`** | `boolean` | _Optional_ | Should prevent / allow the user to write configuration changes to the conf.yml from the UI. When set to `false`, the user can only apply changes locally using the config editor within the app, whereas if set to `true` then changes can be written to disk directly through the UI. Defaults to `true`. Note that if authentication is enabled, the user must be of type `admin` in order to apply changes globally. +**`showSplashScreen`** | `boolean` | _Optional_ | If set to `true`, a loading screen will be shown. Defaults to `false`. **`enableErrorReporting`** | `boolean` | _Optional_ | Enable reporting of unexpected errors and crashes. This is off by default, and **no data will ever be captured unless you explicitly enable it**. Turning on error reporting helps previously unknown bugs get discovered and fixed. Dashy uses [Sentry](https://github.com/getsentry/sentry) for error reporting. Defaults to `false`. **`sentryDsn`** | `boolean` | _Optional_ | If you need to monitor errors in your instance, then you can use Sentry to collect and process bug reports. Sentry can be self-hosted, or used as SaaS, once your instance is setup, then all you need to do is pass in the DSN here, and enable error reporting. You can learn more on the [Sentry DSN Docs](https://docs.sentry.io/product/sentry-basics/dsn-explainer/). Note that this will only ever be used if `enableErrorReporting` is explicitly enabled. **`disableSmartSort`** | `boolean` | _Optional_ | For the most-used and last-used app sort functions to work, a basic open-count is stored in local storage. If you do not want this to happen, then disable smart sort here, but you wil no longer be able to use these sort options. Defaults to `false`. @@ -162,7 +163,6 @@ For more info, see the **[Authentication Docs](/docs/authentication.md)** **`hideSearch`** | `boolean` | _Optional_ | If set to `true`, the search bar will not be visible. Defaults to `false` **`hideSettings`** | `boolean` | _Optional_ | If set to `true`, the settings menu will not be visible. Defaults to `false` **`hideFooter`** | `boolean` | _Optional_ | If set to `true`, the footer will not be visible. Defaults to `false` -**`hideSplashScreen`** | `boolean` | _Optional_ | If set to `true`, splash screen will not be visible while the app loads. Defaults to `true` (except on first load, when the loading screen is always shown) **[⬆️ Back to Top](#configuring)** diff --git a/src/App.vue b/src/App.vue index d1f0e76149..95378848b7 100644 --- a/src/App.vue +++ b/src/App.vue @@ -19,7 +19,6 @@ import Keys from '@/utils/StoreMutations'; import { localStorageKeys, splashScreenTime, - visibleComponents as defaultVisibleComponents, language as defaultLanguage, } from '@/utils/defaults'; @@ -43,7 +42,7 @@ export default { }, /* Determine if splash screen should be shown */ shouldShowSplash() { - return (this.visibleComponents || defaultVisibleComponents).splashScreen; + return (this.appConfig.showSplashScreen); }, config() { return this.$store.state.config; diff --git a/src/utils/ConfigHelpers.js b/src/utils/ConfigHelpers.js index 974f9935f7..bd47ff91e6 100644 --- a/src/utils/ConfigHelpers.js +++ b/src/utils/ConfigHelpers.js @@ -48,8 +48,6 @@ export const componentVisibility = (appConfig) => { ? !usersChoice.hideSettings : visibleComponents.settings, footer: isThere(usersChoice.hideFooter) ? !usersChoice.hideFooter : visibleComponents.footer, - splashScreen: isThere(usersChoice.hideSplashScreen) - ? !usersChoice.hideSplashScreen : visibleComponents.splashScreen, }; }; diff --git a/src/utils/ConfigSchema.json b/src/utils/ConfigSchema.json index 262a6a61c8..908bed3d81 100644 --- a/src/utils/ConfigSchema.json +++ b/src/utils/ConfigSchema.json @@ -345,12 +345,6 @@ "type": "boolean", "default": "false", "description": "If set to true, the page footer will be hidden" - }, - "hideSplashScreen": { - "title": "Hide Splash Screen?", - "type": "boolean", - "default": "true", - "description": "If set to true, the loading / splash screen will not be shown" } } }, @@ -438,6 +432,12 @@ } } }, + "showSplashScreen": { + "title": "Show splash screen", + "type": "boolean", + "default": "false", + "description": "If set to true, a loading screen will be shown" + }, "allowConfigEdit": { "title": "Allow Config Editing", "type": "boolean", From 93a6ec08bab695981f108e3519f4852ba614105c Mon Sep 17 00:00:00 2001 From: Alicia Sykes Date: Wed, 29 Dec 2021 20:06:19 +0000 Subject: [PATCH 3/7] :children_crossing: When in edit mode, show confirmation before leaving page --- src/App.vue | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/src/App.vue b/src/App.vue index 95378848b7..d669556f2d 100644 --- a/src/App.vue +++ b/src/App.vue @@ -35,6 +35,12 @@ export default { isLoading: true, // Set to false after mount complete }; }, + watch: { + isEditMode(isEditMode) { + // When in edit mode, show confirmation dialog on page exit + window.onbeforeunload = isEditMode ? this.confirmExit : null; + }, + }, computed: { /* If the user has specified custom text for footer - get it */ footerText() { @@ -76,7 +82,7 @@ export default { /* Hide splash screen, either after 2 seconds, or immediately based on user preference */ hideSplash() { if (this.shouldShowSplash) { - setTimeout(() => { this.isLoading = false; }, splashScreenTime || 1500); + setTimeout(() => { this.isLoading = false; }, splashScreenTime || 1000); } else { this.isLoading = false; } @@ -117,21 +123,27 @@ export default { this.$i18n.locale = language; document.getElementsByTagName('html')[0].setAttribute('lang', language); }, + /* If placeholder element still visible, hide it */ hideLoader() { const loader = document.getElementById('loader'); if (loader) loader.style.display = 'none'; }, + /* Called when in edit mode and navigating away from page */ + confirmExit(e) { + e.preventDefault(); + return 'You may have unsaved edits. Are you sure you want to exit the page?'; + }, }, - /* When component mounted, hide splash and initiate the injection of custom styles */ + /* Basic initialization tasks on app load */ mounted() { - this.applyLanguage(); - this.hideSplash(); - if (this.appConfig.customCss) { + this.applyLanguage(); // Apply users local language + this.hideSplash(); // Hide the splash screen, if visible + if (this.appConfig.customCss) { // Inject users custom CSS, if present const cleanedCss = this.appConfig.customCss.replace(/<\/?[^>]+(>|$)/g, ''); this.injectCustomStyles(cleanedCss); - this.hideLoader(); } - welcomeMsg(); + this.hideLoader(); // If initial placeholder still visible, hide it + welcomeMsg(); // Show message in console }, }; From 3cbf7949c352612152a6e1b0d050a37b6cc64df0 Mon Sep 17 00:00:00 2001 From: Alicia Sykes Date: Wed, 29 Dec 2021 22:14:11 +0000 Subject: [PATCH 4/7] :bug: Fixes tile move bug (#366) Closes #366. This issue was caused by item IDs not being regenerated after the previous move, causing the second part of the move operation (delete previous) to fail. It was fixed by calling regenerate item IDs after item removal --- src/store.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/store.js b/src/store.js index 4d3dbf8553..5cb0be234a 100644 --- a/src/store.js +++ b/src/store.js @@ -205,6 +205,7 @@ const store = new Vuex.Store({ }); } }); + config.sections = applyItemId(config.sections); state.config = config; }, [SET_THEME](state, theme) { From bf3ccc13d039b5e7f0b8358f00af59a0375420d8 Mon Sep 17 00:00:00 2001 From: Alicia Sykes Date: Wed, 29 Dec 2021 22:31:59 +0000 Subject: [PATCH 5/7] :bug: Fixes save item without title bug (#377) Closes #377. This bg was caused by adding items without a title, meaning an ID could not be calculated. The solution was to add a validtion check to ensure that a title is specified befire saving --- src/assets/locales/en.json | 3 ++ src/components/InteractiveEditor/EditItem.vue | 33 +++++++++++-------- 2 files changed, 23 insertions(+), 13 deletions(-) diff --git a/src/assets/locales/en.json b/src/assets/locales/en.json index f8e05fea2a..72d370d0a0 100644 --- a/src/assets/locales/en.json +++ b/src/assets/locales/en.json @@ -224,6 +224,9 @@ "save-stage-btn": "Save", "cancel-stage-btn": "Cancel" }, + "edit-item": { + "missing-title-err": "An item title is required" + }, "edit-section": { "edit-section-title": "Edit Section", "add-section-title": "Add New Section", diff --git a/src/components/InteractiveEditor/EditItem.vue b/src/components/InteractiveEditor/EditItem.vue index 14c7bfa07f..3133a654f1 100644 --- a/src/components/InteractiveEditor/EditItem.vue +++ b/src/components/InteractiveEditor/EditItem.vue @@ -198,19 +198,26 @@ export default { // Convert form data back into section.item data structure const structured = {}; this.formData.forEach((row) => { structured[row.name] = row.value; }); - // Some attributes need a little extra formatting - const newItem = this.formatBeforeSave(structured); - if (this.isNew) { // Insert new item into data store - newItem.id = `temp_${newItem.title}`; - const payload = { newItem, targetSection: this.parentSectionTitle }; - this.$store.commit(StoreKeys.INSERT_ITEM, payload); - } else { // Update existing item from form data, in the store - this.$store.commit(StoreKeys.UPDATE_ITEM, { newItem, itemId: this.itemId }); + if (!structured.title) { // Missing title, show error and don't proceed + this.$toasted.show( + this.$t('interactive-editor.edit-item.missing-title-err'), + { className: 'toast-error' }, + ); + } else { + // Some attributes need a little extra formatting + const newItem = this.formatBeforeSave(structured); + if (this.isNew) { // Insert new item into data store + newItem.id = `temp_${newItem.title}`; + const payload = { newItem, targetSection: this.parentSectionTitle }; + this.$store.commit(StoreKeys.INSERT_ITEM, payload); + } else { // Update existing item from form data, in the store + this.$store.commit(StoreKeys.UPDATE_ITEM, { newItem, itemId: this.itemId }); + } + // If we're not already in edit mode, enable it now + this.$store.commit(StoreKeys.SET_EDIT_MODE, true); + // Close edit menu + this.$emit('closeEditMenu'); } - // If we're not already in edit mode, enable it now - this.$store.commit(StoreKeys.SET_EDIT_MODE, true); - // Close edit menu - this.$emit('closeEditMenu'); }, /* Some fields require a bit of extra processing before they're saved */ formatBeforeSave(item) { @@ -225,7 +232,7 @@ export default { if (str === undefined) return undefined; return str === 'true'; }; - if (newItem.tags) newItem.tags = strToTags(newItem.tags); + if (newItem.tags) newItem.tags = newItem.tags ? strToTags(newItem.tags) : []; if (newItem.statusCheck) newItem.statusCheck = strToBool(newItem.statusCheck); if (newItem.statusCheckAllowInsecure) { newItem.statusCheckAllowInsecure = strToBool(newItem.statusCheckAllowInsecure); From d60060edfb1065edb3895dd078daa2ca3f88aed2 Mon Sep 17 00:00:00 2001 From: Alicia Sykes Date: Wed, 29 Dec 2021 22:43:58 +0000 Subject: [PATCH 6/7] :bookmark: Bumps to 1.9.5 and updates changelog --- .github/CHANGELOG.md | 5 +++++ package.json | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/CHANGELOG.md b/.github/CHANGELOG.md index b22797a480..2cde2041c6 100644 --- a/.github/CHANGELOG.md +++ b/.github/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## 🐛 1.9.5 - Bug fixes and Minor Improvements [PR #388](https://github.com/Lissy93/dashy/pull/388) +- Adds icon.horse to supported favicon APIs +- Fixes tile move bug, Re: #366 +- Fixes save items without title bug, Re: #377 + ## ✨ 1.9.4 - Widget Support [PR #382](https://github.com/Lissy93/dashy/pull/382) - Adds support for dynamic content, through widgets - Adds 30+ pre-built widgets for general info and self-hosted services diff --git a/package.json b/package.json index 5018f6c760..ca3a3a6bfa 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "Dashy", - "version": "1.9.4", + "version": "1.9.5", "license": "MIT", "main": "server", "author": "Alicia Sykes (https://aliciasykes.com)", From f1239f3aea9f78f103a161b0b87cea59ac13ca2d Mon Sep 17 00:00:00 2001 From: Alicia Sykes Date: Wed, 29 Dec 2021 22:47:03 +0000 Subject: [PATCH 7/7] :rotating_light: Fixes DeepScan logic warning --- src/components/InteractiveEditor/EditItem.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/InteractiveEditor/EditItem.vue b/src/components/InteractiveEditor/EditItem.vue index 3133a654f1..3253935182 100644 --- a/src/components/InteractiveEditor/EditItem.vue +++ b/src/components/InteractiveEditor/EditItem.vue @@ -232,7 +232,7 @@ export default { if (str === undefined) return undefined; return str === 'true'; }; - if (newItem.tags) newItem.tags = newItem.tags ? strToTags(newItem.tags) : []; + if (newItem.tags) newItem.tags = strToTags(newItem.tags); if (newItem.statusCheck) newItem.statusCheck = strToBool(newItem.statusCheck); if (newItem.statusCheckAllowInsecure) { newItem.statusCheckAllowInsecure = strToBool(newItem.statusCheckAllowInsecure);