aboutsummaryrefslogtreecommitdiff
path: root/src/frontend/router/index.js
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2021-06-02 20:13:48 +0200
committerHampusM <hampus@hampusmat.com>2021-06-02 20:13:48 +0200
commit371e3f13e0a046aeca3a2895e4a85f8b51059edf (patch)
tree8a98c46931b2fd10bc68b8a75eda99f9848c70f9 /src/frontend/router/index.js
parent094de489fcbcbe21fdd6ab89deae09af625a7f7b (diff)
Added a tree page
Diffstat (limited to 'src/frontend/router/index.js')
-rw-r--r--src/frontend/router/index.js11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/frontend/router/index.js b/src/frontend/router/index.js
index 68762cd..fc332cd 100644
--- a/src/frontend/router/index.js
+++ b/src/frontend/router/index.js
@@ -3,6 +3,7 @@ import Home from "../views/Home";
import Repository from "../views/Repository";
import RepositoryLog from "../views/RepositoryLog";
import RepositoryCommit from "../views/RepositoryCommit";
+import RepositoryTree from "../views/RepositoryTree";
const routes = [
{
@@ -19,17 +20,23 @@ const routes = [
{
name: "Repository Log",
path: "log",
- component: RepositoryLog,
+ component: RepositoryLog
},
{
name: "Commit",
path: "log/:commit([a-fA-F0-9]{40}$)",
component: RepositoryCommit,
props: route => ({ commit: route.params.commit })
+ },
+ {
+ name: "Tree Entry",
+ path: "tree/:path*",
+ component: RepositoryTree,
+ props: route => ({ pathArr: route.params.path ? route.params.path : [] })
}
]
}
-]
+];
const router = createRouter({
history: createWebHistory(process.env.BASE_URL),