aboutsummaryrefslogtreecommitdiff
path: root/src/frontend/views/Home.vue
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2021-06-05 19:37:52 +0200
committerHampusM <hampus@hampusmat.com>2021-06-05 19:37:52 +0200
commit4da3272bf7893760f6710c9a1ec7de02358136e6 (patch)
tree92eb961bf20a7ef9f7c0650ba288baf512986fca /src/frontend/views/Home.vue
parent4e3074dfd752dd52951d300090c642aee76cfaac (diff)
Reorganized into a monorepo, refactored the frontend again, goodbye Parcel
Diffstat (limited to 'src/frontend/views/Home.vue')
-rw-r--r--src/frontend/views/Home.vue62
1 files changed, 0 insertions, 62 deletions
diff --git a/src/frontend/views/Home.vue b/src/frontend/views/Home.vue
deleted file mode 100644
index e3746c7..0000000
--- a/src/frontend/views/Home.vue
+++ /dev/null
@@ -1,62 +0,0 @@
-<template>
- <HomeHeader />
- <div class="row mx-0">
- <div id="projects-header" class="col ms-4">
- <p class="fs-1">
- Projects
- </p>
- </div>
- <div id="projects-search" class="col d-flex justify-content-end">
- <form>
- <input type="search" name="q">
- <input type="submit" value="Search">
- </form>
- </div>
- </div>
- <div class="row mx-0">
- <div class="col ms-4">
- <ul id="repos">
- <li v-for="(project, project_name, index) in projects" :key="index">
- <div v-if="(search !== null && project_name.includes(search)) || search == null">
- <p class="fs-3">
- <router-link :to="project_name">
- {{ project_name }}
- </router-link>
- </p>
- <span class="repo-last-updated fs-5">Last updated about {{ project["last_updated"] }} ago</span>
- <span class="fs-5">{{ project["description"] }}</span>
- </div>
- </li>
- </ul>
- </div>
- </div>
-</template>
-
-<script>
-import HomeHeader from "../components/HomeHeader";
-import { watch, reactive, toRefs } from "vue";
-
-export default {
- name: "Home",
- components: {
- HomeHeader
- },
- setup()
- {
- const state = reactive({ projects: {}, search: "" });
-
- watch(() =>
- {
- fetch(`${window.location.protocol}//${window.location.host}/api/v1/repos`)
- .then((res) => res.json())
- .then((data) => state.projects = data["data"]);
- });
-
- state.search = (new URLSearchParams(window.location.search)).get("q");
-
- return {
- ... toRefs(state)
- };
- }
-}
-</script> \ No newline at end of file