From 371e3f13e0a046aeca3a2895e4a85f8b51059edf Mon Sep 17 00:00:00 2001 From: HampusM Date: Wed, 2 Jun 2021 20:13:48 +0200 Subject: Added a tree page --- README.md | 2 +- src/app.js | 9 +++ src/frontend/components/RepositoryNavbar.vue | 8 +- src/frontend/components/RepositoryTreeBlob.vue | 23 ++++++ src/frontend/components/RepositoryTreeTree.vue | 84 +++++++++++++++++++++ src/frontend/router/index.js | 11 ++- src/frontend/scss/style.scss | 26 +++++++ src/frontend/views/RepositoryTree.vue | 100 +++++++++++++++++++++++++ 8 files changed, 257 insertions(+), 6 deletions(-) create mode 100644 src/frontend/components/RepositoryTreeBlob.vue create mode 100644 src/frontend/components/RepositoryTreeTree.vue create mode 100644 src/frontend/views/RepositoryTree.vue diff --git a/README.md b/README.md index 570437c..b3e14eb 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ Githermit will probably **never** be as fast as cgit, Gitweb & Stagit. But that' - [x] Log & commit pages - [x] Cloning - [ ] Refs page -- [ ] Tree page +- [x] Tree page - [ ] Blob page - [ ] Markdown support - [ ] Tests diff --git a/src/app.js b/src/app.js index b05bbcf..8904219 100644 --- a/src/app.js +++ b/src/app.js @@ -114,6 +114,15 @@ fastify.register((fastify_repo, opts, done) => } }); + fastify_repo.route({ + method: "GET", + path: "/tree/*", + handler: async (req, reply) => + { + reply.sendFile("app.html"); + } + }); + fastify_repo.route({ method: "GET", path: "/info/refs", diff --git a/src/frontend/components/RepositoryNavbar.vue b/src/frontend/components/RepositoryNavbar.vue index 87a32d6..53e1bfa 100644 --- a/src/frontend/components/RepositoryNavbar.vue +++ b/src/frontend/components/RepositoryNavbar.vue @@ -8,9 +8,11 @@