Skip to content

Commit 23366a4

Browse files
committed
fix: ts hawk tuahing me
1 parent 029252e commit 23366a4

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

apps/frontend/src/components/ui/servers/ServerStats.vue

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,10 @@ const getPotentialWarning = (metric: (typeof metrics.value)[0]) => {
166166
return word.toLowerCase();
167167
})
168168
.join(" ");
169-
const data = metric.data.at(-1) || 0;
169+
let data = metric.data.at(-1) || 0;
170+
if (userPrefrences.value.ramAsNumber) {
171+
data = (props.data.current.ram_usage_bytes / props.data.current.ram_total_bytes) * 100;
172+
}
170173
switch (true) {
171174
case data >= 90:
172175
return `Your server's ${title} is very high.`;
@@ -177,7 +180,10 @@ const getPotentialWarning = (metric: (typeof metrics.value)[0]) => {
177180
178181
const generateOptions = (metric: (typeof metrics.value)[0]) => {
179182
let color = "var(--color-brand)";
180-
const data = metric.data.at(-1) || 0;
183+
let data = metric.data.at(-1) || 0;
184+
if (userPrefrences.value.ramAsNumber) {
185+
data = (props.data.current.ram_usage_bytes / props.data.current.ram_total_bytes) * 100;
186+
}
181187
switch (true) {
182188
case data >= 90:
183189
color = "var(--color-red)";

0 commit comments

Comments
 (0)