Add basic analyze view from FEN
[vchess.git] / client / src / router.js
index 49f777d..1eb88f9 100644 (file)
@@ -55,17 +55,26 @@ const router = new Router({
       component: Hall,
       //redirect: "/", //problem: redirection before end of AJAX request
     },
+    {
+      path: "/mygames",
+      name: "mygames",
+      component: loadView("MyGames"),
+    },
     {
       path: "/game/:id",
       name: "game",
       component: loadView("Game"),
     },
+    {
+      path: "/analyze/:vname([a-zA-Z0-9]+)",
+      name: "analyze",
+      component: loadView("Analyze"),
+    },
     {
       path: "/about",
       name: "about",
       component: loadView("About"),
     },
-    // TODO: myGames, problemId: https://router.vuejs.org/guide/essentials/dynamic-matching.html
   ]
 });
 
@@ -77,9 +86,6 @@ router.beforeEach((to, from, next) => {
     store.state.conn.send(JSON.stringify({code: "pagechange", page: to.path}));
   }
   next();
-  // TODO?: redirect to current game (through GameStorage.getCurrent()) if any?
-  // (and if the URL doesn't already match it) (use next("/game/GID"))
-  //https://router.vuejs.org/guide/advanced/navigation-guards.html#global-before-guards
 });
 
 export default router;