mirror of
https://github.com/HangarMC/Hangar.git
synced 2024-11-21 01:21:54 +08:00
Remove old table reference from stats page
Fixes HANGAR-N
This commit is contained in:
parent
475304dfc2
commit
831db903a5
@ -2,5 +2,5 @@ package io.papermc.hangar.model.internal.admin;
|
||||
|
||||
import java.time.LocalDate;
|
||||
|
||||
public record DayStats(LocalDate day, long reviews, long uploads, long totalDownloads, long unsafeDownloads, long flagsOpened, long flagsClosed) {
|
||||
public record DayStats(LocalDate day, long reviews, long uploads, long totalDownloads, long flagsOpened, long flagsClosed) {
|
||||
}
|
||||
|
@ -1,7 +1,6 @@
|
||||
SELECT (SELECT count(*) FROM project_version_reviews WHERE ended_at::date = day) reviews,
|
||||
(SELECT count(*) FROM project_versions WHERE created_at::date = day) uploads,
|
||||
(SELECT count(*) FROM project_versions_downloads_individual WHERE created_at = day) totaldownloads,
|
||||
(SELECT count(*) FROM project_version_unsafe_downloads WHERE created_at::date = day) unsafedownloads,
|
||||
(SELECT count(*) FROM project_flags WHERE created_at::date <= day AND (created_at::date >= day OR resolved_at IS NULL)) flagsopened,
|
||||
(SELECT count(*) FROM project_flags WHERE resolved_at::date = day) flagsclosed,
|
||||
day::date
|
||||
|
@ -822,7 +822,6 @@
|
||||
"uploads": "Uploads",
|
||||
"downloads": "Downloads",
|
||||
"totalDownloads": "Total Downloads",
|
||||
"unsafeDownloads": "Unsafe Downloads",
|
||||
"flags": "Reports",
|
||||
"openedFlags": "Opened Reports",
|
||||
"closedFlags": "Closed Reports"
|
||||
|
@ -29,7 +29,6 @@ interface DayStats {
|
||||
flagsOpened: number;
|
||||
reviews: number;
|
||||
totalDownloads: number;
|
||||
unsafeDownloads: number;
|
||||
uploads: number;
|
||||
}
|
||||
|
||||
@ -49,7 +48,6 @@ let data: DayStats[] = (await useInternalApi<DayStats[]>("admin/stats", "get", {
|
||||
let reviews: DayStat[] = [];
|
||||
let uploads: DayStat[] = [];
|
||||
let totalDownloads: DayStat[] = [];
|
||||
let unsafeDownloads: DayStat[] = [];
|
||||
let openedFlags: DayStat[] = [];
|
||||
let closedFlags: DayStat[] = [];
|
||||
for (const statDay of data) {
|
||||
@ -57,7 +55,6 @@ for (const statDay of data) {
|
||||
reviews.push({ x: day, y: statDay.reviews });
|
||||
uploads.push({ x: day, y: statDay.uploads });
|
||||
totalDownloads.push({ x: day, y: statDay.totalDownloads });
|
||||
unsafeDownloads.push({ x: day, y: statDay.unsafeDownloads });
|
||||
openedFlags.push({ x: day, y: statDay.flagsOpened });
|
||||
closedFlags.push({ x: day, y: statDay.flagsClosed });
|
||||
}
|
||||
@ -68,8 +65,8 @@ const pluginData = ref<LineChartData>({
|
||||
});
|
||||
|
||||
const downloadData = ref<LineChartData>({
|
||||
labels: [i18n.t("stats.totalDownloads"), i18n.t("stats.unsafeDownloads")],
|
||||
series: [totalDownloads, unsafeDownloads],
|
||||
labels: [i18n.t("stats.totalDownloads")],
|
||||
series: [totalDownloads],
|
||||
});
|
||||
|
||||
const flagData = ref<LineChartData>({
|
||||
@ -104,7 +101,6 @@ async function updateDate() {
|
||||
reviews = [];
|
||||
uploads = [];
|
||||
totalDownloads = [];
|
||||
unsafeDownloads = [];
|
||||
openedFlags = [];
|
||||
closedFlags = [];
|
||||
for (const statDay of data) {
|
||||
@ -112,14 +108,12 @@ async function updateDate() {
|
||||
reviews.push({ x: day, y: statDay.reviews });
|
||||
uploads.push({ x: day, y: statDay.uploads });
|
||||
totalDownloads.push({ x: day, y: statDay.totalDownloads });
|
||||
unsafeDownloads.push({ x: day, y: statDay.unsafeDownloads });
|
||||
openedFlags.push({ x: day, y: statDay.flagsOpened });
|
||||
closedFlags.push({ x: day, y: statDay.flagsClosed });
|
||||
}
|
||||
pluginData.value.series[0] = reviews;
|
||||
pluginData.value.series[1] = uploads;
|
||||
downloadData.value.series[0] = totalDownloads;
|
||||
downloadData.value.series[1] = unsafeDownloads;
|
||||
flagData.value.series[0] = openedFlags;
|
||||
flagData.value.series[1] = closedFlags;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user