mirror of
https://github.com/hay-kot/mealie.git
synced 2025-08-22 06:23:34 -07:00
GroupExportData Component
This commit is contained in:
parent
bd0aed06ce
commit
0a7368857d
1 changed files with 21 additions and 33 deletions
|
@ -20,45 +20,33 @@
|
||||||
</v-data-table>
|
</v-data-table>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<script setup lang="ts">
|
||||||
import { parseISO, formatDistanceToNow } from "date-fns";
|
import { parseISO, formatDistanceToNow } from "date-fns";
|
||||||
import type { GroupDataExport } from "~/lib/api/types/group";
|
import type { GroupDataExport } from "~/lib/api/types/group";
|
||||||
|
|
||||||
export default defineNuxtComponent({
|
defineProps<{
|
||||||
props: {
|
exports: GroupDataExport[];
|
||||||
exports: {
|
}>();
|
||||||
type: Array as () => GroupDataExport[],
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
setup() {
|
|
||||||
const i18n = useI18n();
|
|
||||||
|
|
||||||
const headers = [
|
const i18n = useI18n();
|
||||||
{ 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 headers = [
|
||||||
const expiresAt = parseISO(timeString);
|
{ 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" },
|
||||||
|
];
|
||||||
|
|
||||||
return formatDistanceToNow(expiresAt, {
|
function getTimeToExpire(timeString: string) {
|
||||||
addSuffix: false,
|
const expiresAt = parseISO(timeString);
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function downloadData(_: any) {
|
return formatDistanceToNow(expiresAt, {
|
||||||
console.log("Downloading data...");
|
addSuffix: false,
|
||||||
}
|
});
|
||||||
|
}
|
||||||
|
|
||||||
return {
|
function downloadData(_: any) {
|
||||||
downloadData,
|
console.log("Downloading data...");
|
||||||
headers,
|
}
|
||||||
getTimeToExpire,
|
|
||||||
};
|
|
||||||
},
|
|
||||||
});
|
|
||||||
</script>
|
</script>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue