File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
apps/frontend/src/components/ui/servers Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff 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
178181const 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)" ;
You can’t perform that action at this time.
0 commit comments