Skip to content

Commit be5b828

Browse files
authored
🔀 Merge pull request gchq#277 from Lissy93/FIX/make-routing-mode-configurable
[FIX] Make routing mode user-configurable Fixes gchq#274
2 parents 1469e4b + 07dd326 commit be5b828

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

‎docs/configuring.md

+1
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ Tips:
9191
**`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
9292
**`customCss`** | `string` | _Optional_ | Raw CSS that will be applied to the page. This can also be set from the UI. Please minify it first.
9393
**`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)
94+
**`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`.
9495
**`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.
9596
**`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
9697
**`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.

‎src/router.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ const makeMetaTags = (defaultTitle) => ({
6666
});
6767

6868
/* Routing mode, can be either 'hash', 'history' or 'abstract' */
69-
const mode = 'history';
69+
const mode = appConfig.routingMode || 'history';
7070

7171
/* List of all routes, props, components and metadata */
7272
const router = new Router({

‎src/utils/ConfigSchema.json

+8
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,14 @@
187187
}
188188
}
189189
},
190+
"routingMode": {
191+
"enum": [
192+
"hash",
193+
"history"
194+
],
195+
"default": "history",
196+
"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"
197+
},
190198
"cssThemes": {
191199
"type": "array",
192200
"description": "Theme names to be added to the dropdown",

0 commit comments

Comments
 (0)