diff options
author | HampusM <hampus@hampusmat.com> | 2021-06-05 19:37:52 +0200 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2021-06-05 19:37:52 +0200 |
commit | 4da3272bf7893760f6710c9a1ec7de02358136e6 (patch) | |
tree | 92eb961bf20a7ef9f7c0650ba288baf512986fca /src/frontend/views/RepositoryCommit.vue | |
parent | 4e3074dfd752dd52951d300090c642aee76cfaac (diff) |
Reorganized into a monorepo, refactored the frontend again, goodbye Parcel
Diffstat (limited to 'src/frontend/views/RepositoryCommit.vue')
-rw-r--r-- | src/frontend/views/RepositoryCommit.vue | 89 |
1 files changed, 0 insertions, 89 deletions
diff --git a/src/frontend/views/RepositoryCommit.vue b/src/frontend/views/RepositoryCommit.vue deleted file mode 100644 index d3ba174..0000000 --- a/src/frontend/views/RepositoryCommit.vue +++ /dev/null @@ -1,89 +0,0 @@ -<template> - <RepositoryNavbar active-page="log" :repository="repository" /> - <div class="row mx-0"> - <div class="col ms-2 ps-4 ps-sm-5 fs-5 vld-parent"> - <BaseBreadcrumb :items="[{ name: 'Log', path: '/' + repository + '/log' }]" :active-item="commit" /> - <Loading - v-model:active="is_loading" :height="24" - :width="24" color="#ffffff" - :opacity="0" /> - <table id="commit-info" class="table table-dark"> - <tbody> - <tr> - <td class="commit-info-title"> - Author - </td> - <td>{{ commit_data["author"] }}</td> - </tr> - <tr> - <td class="commit-info-title"> - Date - </td> - <td>{{ commit_data["date"] }}</td> - </tr> - <tr> - <td class="commit-info-title"> - Message - </td> - <td>{{ commit_data["message"] }}</td> - </tr> - </tbody> - </table> - - <template - v-for="(patch, index) in commit_data['patches']" :key="index"> - <CommitPatch :patch="patch" /> - </template> - </div> - </div> -</template> - -<script> -import RepositoryNavbar from "../components/RepositoryNavbar"; -import CommitPatch from "../components/CommitPatch"; -import BaseBreadcrumb from "../components/BaseBreadcrumb"; -import Loading from "vue-loading-overlay"; -import 'vue-loading-overlay/dist/vue-loading.css'; -import { watch, reactive, toRefs } from "vue"; -import { format } from "date-fns"; - -export default { - name: "RepositoryCommit", - components: { - RepositoryNavbar, - CommitPatch, - Loading, - BaseBreadcrumb - }, - props: { - repository: { - type: String, - required: true - }, - commit: { - type: String, - required: true - } - }, - setup(props) - { - const state = reactive({ commit_data: {}, is_loading: true }); - - watch(() => - { - fetch(`${window.location.protocol}//${window.location.host}/api/v1/repos/${props.repository}/log/${props.commit}`) - .then((res) => res.json()) - .then((data) => - { - data["data"]["date"] = format(new Date(data["data"]["date"]), "yyyy-MM-dd hh:mm"); - state.commit_data = data["data"]; - state.is_loading = false; - }); - }); - - return { - ... toRefs(state) - }; - } -}; -</script> |