Show file size on version page

This commit is contained in:
Nassim Jahnke 2022-06-20 13:42:14 +02:00
parent 14d6a2193a
commit 1edb8d9af9
No known key found for this signature in database
GPG Key ID: 6BE3B555EBC5982B
2 changed files with 8 additions and 2 deletions

View File

@ -31,6 +31,7 @@ import DownloadButton from "~/components/projects/DownloadButton.vue";
import PlatformLogo from "~/components/logos/PlatformLogo.vue";
import TextAreaModal from "~/components/modals/TextAreaModal.vue";
import DependencyEditModal from "~/components/modals/DependencyEditModal.vue";
import filesize from "filesize";
const route = useRoute();
const i18n = useI18n();
@ -151,7 +152,13 @@ async function restoreVersion() {
<IconMdiCheckCircleOutline v-if="isReviewStateChecked" :title="approvalTooltip" class="text-2xl" />
</h1>
<h2>
{{ i18n.t("version.page.subheader", [projectVersion.author, lastUpdated(new Date(projectVersion.createdAt))]) }}
<span class="inline-flex">
{{ i18n.t("version.page.subheader", [projectVersion.author, lastUpdated(new Date(projectVersion.createdAt))]) }}
<span v-if="projectVersion.fileInfo.sizeBytes" class="inline-flex items-center ml-3">
<IconMdiFile class="mr-1" />
{{ filesize(projectVersion.fileInfo.sizeBytes) }}
</span>
</span>
</h2>
</div>
<div class="mt-2 text-2xl ml-1 flex">

View File

@ -16,7 +16,6 @@ import { handleRequestError } from "~/composables/useErrorHandling";
import { useRoute } from "vue-router";
import { useApi } from "~/composables/useApi";
import { HangarProject } from "hangar-internal";
import filesize from "filesize";
import { useHead } from "@vueuse/head";
import { useSeo } from "~/composables/useSeo";
import { projectIconUrl } from "~/composables/useUrlHelper";