diff --git a/components/Charts.vue b/components/Charts.vue index 3e367bd..4ae3162 100644 --- a/components/Charts.vue +++ b/components/Charts.vue @@ -2,9 +2,15 @@ import {Bar} from 'vue-chartjs' import type {StatExport} from "~/server/utils/api/stats"; -const props = defineProps<{ url: string, mode: string, explanation: string }>(); +const props = defineProps<{ stat: string, type: string, mode: string, explanation: string }>(); -const {data} = await useFetch(props.url, {query: {mode: props.mode}}); +const {data} = await useFetch("/api/stats", { + query: { + mode: props.mode, + type: props.type, + stat: props.stat + } +}); let downloadData = computed(() => { if (data.value) { return data.value diff --git a/layouts/default.vue b/layouts/default.vue index 0e4e9ae..650d3f7 100644 --- a/layouts/default.vue +++ b/layouts/default.vue @@ -5,16 +5,28 @@ async function onUpdateData() { await $fetch("/api/update") } -const downloadUrls = [ - {title: "Major Versions", url: "/downloads/major"}, - {title: "Minor Versions", url: "/downloads/minor"}, - {title: "All Versions", url: "/downloads/all"}, +const modDownloadUrls = [ + {title: "Major Versions", url: "/mod/downloads/major"}, + {title: "Minor Versions", url: "/mod/downloads/minor"}, + {title: "All Versions", url: "/mod/downloads/all"}, ] -const countUrls = [ - {title: "Major Versions", url: "/counts/major"}, - {title: "Minor Versions", url: "/counts/minor"}, - {title: "All Versions", url: "/counts/all"}, +const modCountUrls = [ + {title: "Major Versions", url: "/mod/counts/major"}, + {title: "Minor Versions", url: "/mod/counts/minor"}, + {title: "All Versions", url: "/mod/counts/all"}, +] + +const modpackDownloadUrls = [ + {title: "Major Versions", url: "/modpack/downloads/major"}, + {title: "Minor Versions", url: "/modpack/downloads/minor"}, + {title: "All Versions", url: "/modpack/downloads/all"}, +] + +const modpackCountUrls = [ + {title: "Major Versions", url: "/modpack/counts/major"}, + {title: "Minor Versions", url: "/modpack/counts/minor"}, + {title: "All Versions", url: "/modpack/counts/all"}, ] @@ -25,8 +37,14 @@ const countUrls = [ Modrinth Statistics