summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/clusters/agents/router.js
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-02-18 09:45:46 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2022-02-18 09:45:46 +0000
commita7b3560714b4d9cc4ab32dffcd1f74a284b93580 (patch)
tree7452bd5c3545c2fa67a28aa013835fb4fa071baf /app/assets/javascripts/clusters/agents/router.js
parentee9173579ae56a3dbfe5afe9f9410c65bb327ca7 (diff)
downloadgitlab-ce-a7b3560714b4d9cc4ab32dffcd1f74a284b93580.tar.gz
Add latest changes from gitlab-org/gitlab@14-8-stable-eev14.8.0-rc42
Diffstat (limited to 'app/assets/javascripts/clusters/agents/router.js')
-rw-r--r--app/assets/javascripts/clusters/agents/router.js22
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,
+ });
+};