mirror of
https://github.com/hay-kot/mealie.git
synced 2025-07-05 20:42:23 -07:00
Some checks are pending
CodeQL / Analyze (push) Waiting to run
Docker Nightly Production / Backend Server Tests (push) Waiting to run
Docker Nightly Production / Frontend Tests (push) Waiting to run
Docker Nightly Production / Build Package (push) Waiting to run
Docker Nightly Production / Build Tagged Release (push) Blocked by required conditions
Docker Nightly Production / Notify Discord (push) Blocked by required conditions
Release Drafter / ✏️ Draft release (push) Waiting to run
Co-authored-by: Michael Genson <71845777+michael-genson@users.noreply.github.com> Co-authored-by: Kuchenpirat <24235032+Kuchenpirat@users.noreply.github.com>
64 lines
1.5 KiB
Vue
64 lines
1.5 KiB
Vue
<template>
|
|
<v-data-table
|
|
item-key="id"
|
|
:headers="headers"
|
|
:items="exports"
|
|
:items-per-page="15"
|
|
class="elevation-0"
|
|
@click:row="downloadData"
|
|
>
|
|
<template #[`item.expires`]="{ item }">
|
|
{{ getTimeToExpire(item.expires) }}
|
|
</template>
|
|
<template #[`item.actions`]="{ item }">
|
|
<BaseButton
|
|
download
|
|
size="small"
|
|
:download-url="`/api/recipes/bulk-actions/export/download?path=${item.path}`"
|
|
/>
|
|
</template>
|
|
</v-data-table>
|
|
</template>
|
|
|
|
<script lang="ts">
|
|
import { parseISO, formatDistanceToNow } from "date-fns";
|
|
import type { GroupDataExport } from "~/lib/api/types/group";
|
|
|
|
export default defineNuxtComponent({
|
|
props: {
|
|
exports: {
|
|
type: Array as () => GroupDataExport[],
|
|
required: true,
|
|
},
|
|
},
|
|
setup() {
|
|
const i18n = useI18n();
|
|
|
|
const headers = [
|
|
{ title: i18n.t("export.export"), value: "name" },
|
|
{ title: i18n.t("export.file-name"), value: "filename" },
|
|
{ title: i18n.t("export.size"), value: "size" },
|
|
{ title: i18n.t("export.link-expires"), value: "expires" },
|
|
{ title: "", value: "actions" },
|
|
];
|
|
|
|
function getTimeToExpire(timeString: string) {
|
|
const expiresAt = parseISO(timeString);
|
|
|
|
return formatDistanceToNow(expiresAt, {
|
|
addSuffix: false,
|
|
});
|
|
}
|
|
|
|
function downloadData(_: any) {
|
|
console.log("Downloading data...");
|
|
}
|
|
|
|
return {
|
|
downloadData,
|
|
headers,
|
|
getTimeToExpire,
|
|
};
|
|
},
|
|
});
|
|
</script>
|