You've already forked AstralRinth
forked from didirus/AstralRinth
Add GDPR export (#2461)
This commit is contained in:
@@ -371,6 +371,22 @@
|
|||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
|
<section id="data-export" class="universal-card">
|
||||||
|
<h2>Data export</h2>
|
||||||
|
<p>
|
||||||
|
Request a copy of all your personal data you have uploaded to Modrinth. This may take
|
||||||
|
several minutes to complete.
|
||||||
|
</p>
|
||||||
|
<a v-if="generated" class="iconified-button" :href="generated" download="export.json">
|
||||||
|
<DownloadIcon />
|
||||||
|
Download export
|
||||||
|
</a>
|
||||||
|
<button v-else class="iconified-button" :disabled="generatingExport" @click="exportData">
|
||||||
|
<template v-if="generatingExport"> <UpdatedIcon /> Generating export... </template>
|
||||||
|
<template v-else> <UpdatedIcon /> Generate export </template>
|
||||||
|
</button>
|
||||||
|
</section>
|
||||||
|
|
||||||
<section id="delete-account" class="universal-card">
|
<section id="delete-account" class="universal-card">
|
||||||
<h2>Delete account</h2>
|
<h2>Delete account</h2>
|
||||||
<p>
|
<p>
|
||||||
@@ -391,16 +407,18 @@
|
|||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import {
|
import {
|
||||||
EditIcon,
|
|
||||||
SaveIcon,
|
|
||||||
TrashIcon,
|
|
||||||
PlusIcon,
|
|
||||||
SettingsIcon,
|
|
||||||
XIcon,
|
|
||||||
LeftArrowIcon,
|
|
||||||
RightArrowIcon,
|
|
||||||
CheckIcon,
|
CheckIcon,
|
||||||
|
EditIcon,
|
||||||
ExternalIcon,
|
ExternalIcon,
|
||||||
|
LeftArrowIcon,
|
||||||
|
PlusIcon,
|
||||||
|
RightArrowIcon,
|
||||||
|
SaveIcon,
|
||||||
|
SettingsIcon,
|
||||||
|
TrashIcon,
|
||||||
|
UpdatedIcon,
|
||||||
|
XIcon,
|
||||||
|
DownloadIcon,
|
||||||
} from "@modrinth/assets";
|
} from "@modrinth/assets";
|
||||||
import QrcodeVue from "qrcode.vue";
|
import QrcodeVue from "qrcode.vue";
|
||||||
import GitHubIcon from "assets/icons/auth/sso-github.svg";
|
import GitHubIcon from "assets/icons/auth/sso-github.svg";
|
||||||
@@ -614,6 +632,34 @@ async function deleteAccount() {
|
|||||||
|
|
||||||
stopLoading();
|
stopLoading();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const generatingExport = ref(false);
|
||||||
|
const generated = ref();
|
||||||
|
async function exportData() {
|
||||||
|
startLoading();
|
||||||
|
generatingExport.value = true;
|
||||||
|
try {
|
||||||
|
const res = await useBaseFetch("gdpr/export", {
|
||||||
|
method: "POST",
|
||||||
|
internal: true,
|
||||||
|
});
|
||||||
|
|
||||||
|
const jsonString = JSON.stringify(res, null, 2);
|
||||||
|
|
||||||
|
const blob = new Blob([jsonString], { type: "application/json" });
|
||||||
|
generated.value = URL.createObjectURL(blob);
|
||||||
|
} catch (err) {
|
||||||
|
data.$notify({
|
||||||
|
group: "main",
|
||||||
|
title: "An error occurred",
|
||||||
|
text: err.data.description,
|
||||||
|
type: "error",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
generatingExport.value = false;
|
||||||
|
stopLoading();
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
canvas {
|
canvas {
|
||||||
|
|||||||
Reference in New Issue
Block a user