diff options
Diffstat (limited to 'app/assets/javascripts/clusters/agents/router.js')
-rw-r--r-- | app/assets/javascripts/clusters/agents/router.js | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/app/assets/javascripts/clusters/agents/router.js b/app/assets/javascripts/clusters/agents/router.js new file mode 100644 index 00000000000..162a91dc300 --- /dev/null +++ b/app/assets/javascripts/clusters/agents/router.js @@ -0,0 +1,22 @@ +import Vue from 'vue'; +import VueRouter from 'vue-router'; + +Vue.use(VueRouter); + +// Vue Router requires a component to render if the route matches, but since we're only using it for +// querystring handling, we'll create an empty component. +const EmptyRouterComponent = { + render(createElement) { + return createElement('div'); + }, +}; + +export default () => { + // Name and path here don't really matter since we're not rendering anything if the route matches. + const routes = [{ path: '/', name: 'cluster_agents', component: EmptyRouterComponent }]; + return new VueRouter({ + mode: 'history', + base: window.location.pathname, + routes, + }); +}; |