🔀 Merge pull request #277 from Lissy93/FIX/make-routing-mode-configurable

[FIX] Make routing mode user-configurable
Fixes #274
This commit is contained in:
Alicia Sykes 2021-10-16 19:13:07 +01:00 committed by GitHub
commit be5b828e7d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 1 deletions

View File

@ -91,6 +91,7 @@ Tips:
**`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.

View File

@ -66,7 +66,7 @@ const makeMetaTags = (defaultTitle) => ({
});
/* Routing mode, can be either 'hash', 'history' or 'abstract' */
const mode = 'history';
const mode = appConfig.routingMode || 'history';
/* List of all routes, props, components and metadata */
const router = new Router({

View File

@ -187,6 +187,14 @@
}
}
},
"routingMode": {
"enum": [
"hash",
"history"
],
"default": "history",
"description": "The Vue routing mode to use, history mode will remove the annoying hash from the URL, but requires some extra config on some systems"
},
"cssThemes": {
"type": "array",
"description": "Theme names to be added to the dropdown",