diff --git a/AquaNet/src/libs/ui.ts b/AquaNet/src/libs/ui.ts index 4eca3e2d..0cae2348 100644 --- a/AquaNet/src/libs/ui.ts +++ b/AquaNet/src/libs/ui.ts @@ -6,13 +6,14 @@ import { LineElement, LinearScale, PointElement, - CategoryScale, TimeScale, + CategoryScale, TimeScale, type ChartOptions, type LineOptions, } from 'chart.js'; import moment from "moment/moment"; // @ts-ignore import CalHeatmap from "cal-heatmap"; // @ts-ignore import CalTooltip from 'cal-heatmap/plugins/Tooltip'; +import type {Line} from "svelte-chartjs"; export function title(t: string) { document.title = `AquaNet - ${t}` @@ -60,3 +61,32 @@ export function renderCal(el: HTMLElement, d: {date: any, value: any}[]) { ]); } + +export const CHARTJS_OPT: ChartOptions<"line"> = { + responsive: true, + maintainAspectRatio: false, + // TODO: Show point on hover + elements: { + point: { + radius: 0 + } + }, + scales: { + xAxis: { + type: 'time', + display: false + }, + y: { + display: false, + } + }, + plugins: { + legend: { + display: false + }, + tooltip: { + mode: "index", + intersect: false + } + }, +} diff --git a/AquaNet/src/pages/UserHome.svelte b/AquaNet/src/pages/UserHome.svelte index df0d4f4d..81893546 100644 --- a/AquaNet/src/pages/UserHome.svelte +++ b/AquaNet/src/pages/UserHome.svelte @@ -1,11 +1,9 @@ -
+
{#if d !== null} - -

{d.user.userName}

- -
- {return {x: Date.parse(it.date), y: it.rating}}), - fill: false, - borderColor: 'rgb(75, 192, 192)', - tension: 0.1 - } - ] - }} options={{ - // TODO: Show point on hover - elements: { - point: { - radius: 0 - } - }, - scales: { - xAxis: { - type: 'time', - display: false - }, - y: { - display: false, - } - }, - plugins: { - legend: { - display: false - }, - tooltip: { - mode: "index", - intersect: false - } - }, - }} /> +
+ +

{d.user.name}

+
+ +
+
+
+
+ DX Rating + {d.user.rating.toLocaleString()} +
+ +
+ Server Rank + #{d.user.serverRank.toLocaleString()} +
+
+ +
+ {return {x: Date.parse(it.date), y: it.rating}}), + borderColor: '#646cff', + tension: 0.1, + + // TODO: Set X axis span to 3 months + } + ] + }} options={CHARTJS_OPT} /> +
+ +
+ {#each d.user.ranks as r} +
+ {r.name} + {r.count} +
+ {/each} +
+
+ +
+
+ Accuracy + {(d.user.accuracy / 10000).toFixed(2)}% +
+ +
+ Max Combo + {d.user.maxCombo} +
+ +
+ Full Combo + {d.user.fullCombo} +
+ +
+ All Perfect + {d.user.allPerfect} +
+ +
+ DX Score + {d.user.totalDxScore.toLocaleString()} +
+
+
+ +
+
+ +
+
+ Plays + {d.user.plays} +
+ +
+ Play Time + {d.user.totalPlayTime} +
+ +
+ Joined + {moment(d.user.joined).format("YYYY-MM-DD HH:mm:ss")} +
+ +
+ Last Seen + {moment(d.user.lastSeen).format("YYYY-MM-DD HH:mm:ss")} +
+ +
+ Last Version + {d.user.lastVersion} +
+
-
{:else}

Loading...

{/if} -
\ No newline at end of file +
+ + \ No newline at end of file diff --git a/src/main/java/icu/samnyan/aqua/api/controller/sega/game/maimai2/Maimai2New.kt b/src/main/java/icu/samnyan/aqua/api/controller/sega/game/maimai2/Maimai2New.kt index 0c765535..8407e911 100644 --- a/src/main/java/icu/samnyan/aqua/api/controller/sega/game/maimai2/Maimai2New.kt +++ b/src/main/java/icu/samnyan/aqua/api/controller/sega/game/maimai2/Maimai2New.kt @@ -60,7 +60,7 @@ class Maimai2New( } return mapOf( - "name" to user, + "name" to user.userName, "iconId" to user.iconId, "serverRank" to userDataRepository.getRanking(user.playerRating),