Force RAM to be listed by bytes instead of percent when in dev mode (#3853)

* Force RAM to be listed by bytes instead of percent when in dev mode

Makes things easier for support.

* fix lint
This commit is contained in:
Emma Alexia 2025-06-29 04:47:03 -04:00 committed by GitHub
parent 240cccf8a1
commit 479aaf503b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -74,6 +74,7 @@ import { FolderOpenIcon, CPUIcon, DatabaseIcon, IssuesIcon } from "@modrinth/ass
import { useStorage } from "@vueuse/core";
import type { Stats } from "@modrinth/utils";
const flags = useFeatureFlags();
const route = useNativeRoute();
const serverId = route.params.id;
const VueApexCharts = defineAsyncComponent(() => import("vue3-apexcharts"));
@ -165,10 +166,14 @@ const metrics = computed(() => {
},
{
title: "Memory usage",
value: userPreferences.value.ramAsNumber
value:
userPreferences.value.ramAsNumber || flags.developerMode
? formatBytes(stats.value.ram_usage_bytes)
: `${ramPercent.toFixed(2)}%`,
max: userPreferences.value.ramAsNumber ? formatBytes(stats.value.ram_total_bytes) : "100%",
max:
userPreferences.value.ramAsNumber || flags.developerMode
? formatBytes(stats.value.ram_total_bytes)
: "100%",
icon: DatabaseIcon,
data: ramData.value,
showGraph: true,