Skip to content

Commit

Permalink
fix: ts hawk tuahing me
Browse files Browse the repository at this point in the history
  • Loading branch information
not-nullptr committed Oct 18, 2024
1 parent 029252e commit 23366a4
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions apps/frontend/src/components/ui/servers/ServerStats.vue
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,10 @@ const getPotentialWarning = (metric: (typeof metrics.value)[0]) => {
return word.toLowerCase();
})
.join(" ");
const data = metric.data.at(-1) || 0;
let data = metric.data.at(-1) || 0;
if (userPrefrences.value.ramAsNumber) {
data = (props.data.current.ram_usage_bytes / props.data.current.ram_total_bytes) * 100;
}
switch (true) {
case data >= 90:
return `Your server's ${title} is very high.`;
Expand All @@ -177,7 +180,10 @@ const getPotentialWarning = (metric: (typeof metrics.value)[0]) => {
const generateOptions = (metric: (typeof metrics.value)[0]) => {
let color = "var(--color-brand)";
const data = metric.data.at(-1) || 0;
let data = metric.data.at(-1) || 0;
if (userPrefrences.value.ramAsNumber) {
data = (props.data.current.ram_usage_bytes / props.data.current.ram_total_bytes) * 100;
}
switch (true) {
case data >= 90:
color = "var(--color-red)";
Expand Down

0 comments on commit 23366a4

Please sign in to comment.