fix monitoring numbers

This commit is contained in:
Saeed Vaziry 2024-04-17 21:09:09 +02:00
parent 868b70f530
commit 5a9e8d6799
2 changed files with 12 additions and 7 deletions

View File

@ -32,7 +32,12 @@ function htmx(): HtmxResponse
function vito_version(): string
{
return exec('git describe --tags');
$version = exec('git describe --tags');
if (str($version)->contains('-')) {
return str($version)->before('-').' (dev)';
}
return $version;
}
function convert_time_format($string): string

View File

@ -63,19 +63,19 @@ class="h-[200px] !p-0"
<x-simple-card class="grid grid-cols-1 gap-4 lg:grid-cols-2">
<span class="text-center lg:text-left">Total Memory</span>
<div class="text-center text-xl font-bold text-gray-600 dark:text-gray-400 lg:text-right">
{{ $lastMetric ? $lastMetric->memory_total : "-" }} MB
{{ $lastMetric ? Number::format($lastMetric->memory_total / 1024, 0) : "-" }} MB
</div>
</x-simple-card>
<x-simple-card class="grid grid-cols-1 gap-4 lg:grid-cols-2">
<span class="text-center lg:text-left">Used Memory</span>
<div class="text-center text-xl font-bold text-gray-600 dark:text-gray-400 lg:text-right">
{{ $lastMetric ? $lastMetric->memory_used : "-" }} MB
{{ $lastMetric ? Number::format($lastMetric->memory_used / 1024, 0) : "-" }} MB
</div>
</x-simple-card>
<x-simple-card class="grid grid-cols-1 gap-4 lg:grid-cols-2">
<span class="text-center lg:text-left">Free Memory</span>
<div class="text-center text-xl font-bold text-gray-600 dark:text-gray-400 lg:text-right">
{{ $lastMetric ? $lastMetric->memory_free : "-" }} MB
{{ $lastMetric ? Number::format($lastMetric->memory_free / 1024, 0) : "-" }} MB
</div>
</x-simple-card>
</div>
@ -83,19 +83,19 @@ class="h-[200px] !p-0"
<x-simple-card class="grid grid-cols-1 gap-4 lg:grid-cols-2">
<span class="text-center lg:text-left">Total Space</span>
<div class="text-center text-xl font-bold text-gray-600 dark:text-gray-400 lg:text-right">
{{ $lastMetric ? $lastMetric->disk_total : "-" }} MB
{{ $lastMetric ? Number::format($lastMetric->disk_total) : "-" }} MB
</div>
</x-simple-card>
<x-simple-card class="grid grid-cols-1 gap-4 lg:grid-cols-2">
<span class="text-center lg:text-left">Used Space</span>
<div class="text-center text-xl font-bold text-gray-600 dark:text-gray-400 lg:text-right">
{{ $lastMetric ? $lastMetric->disk_used : "-" }} MB
{{ $lastMetric ? Number::format($lastMetric->disk_used) : "-" }} MB
</div>
</x-simple-card>
<x-simple-card class="grid grid-cols-1 gap-4 lg:grid-cols-2">
<span class="text-center lg:text-left">Free Space</span>
<div class="text-center text-xl font-bold text-gray-600 dark:text-gray-400 lg:text-right">
{{ $lastMetric ? $lastMetric->disk_free : "-" }} MB
{{ $lastMetric ? Number::format($lastMetric->disk_free) : "-" }} MB
</div>
</x-simple-card>
</div>