Skip to content

Commit

Permalink
🔀 Merge pull request gchq#277 from Lissy93/FIX/make-routing-mode-conf…
Browse files Browse the repository at this point in the history
…igurable

[FIX] Make routing mode user-configurable
Fixes gchq#274
  • Loading branch information
Lissy93 committed Oct 16, 2021
2 parents 1469e4b + 07dd326 commit be5b828
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions docs/configuring.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion src/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down
8 changes: 8 additions & 0 deletions src/utils/ConfigSchema.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit be5b828

Please sign in to comment.