From 5a9e8d67995e001e1cc7f030a9c90a2f9340b460 Mon Sep 17 00:00:00 2001 From: Saeed Vaziry Date: Wed, 17 Apr 2024 21:09:09 +0200 Subject: [PATCH] fix monitoring numbers --- app/Support/helpers.php | 7 ++++++- resources/views/metrics/index.blade.php | 12 ++++++------ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/app/Support/helpers.php b/app/Support/helpers.php index f55450d..4d91273 100755 --- a/app/Support/helpers.php +++ b/app/Support/helpers.php @@ -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 diff --git a/resources/views/metrics/index.blade.php b/resources/views/metrics/index.blade.php index a8fd89c..b7bd674 100644 --- a/resources/views/metrics/index.blade.php +++ b/resources/views/metrics/index.blade.php @@ -63,19 +63,19 @@ class="h-[200px] !p-0" Total Memory
- {{ $lastMetric ? $lastMetric->memory_total : "-" }} MB + {{ $lastMetric ? Number::format($lastMetric->memory_total / 1024, 0) : "-" }} MB
Used Memory
- {{ $lastMetric ? $lastMetric->memory_used : "-" }} MB + {{ $lastMetric ? Number::format($lastMetric->memory_used / 1024, 0) : "-" }} MB
Free Memory
- {{ $lastMetric ? $lastMetric->memory_free : "-" }} MB + {{ $lastMetric ? Number::format($lastMetric->memory_free / 1024, 0) : "-" }} MB
@@ -83,19 +83,19 @@ class="h-[200px] !p-0" Total Space
- {{ $lastMetric ? $lastMetric->disk_total : "-" }} MB + {{ $lastMetric ? Number::format($lastMetric->disk_total) : "-" }} MB
Used Space
- {{ $lastMetric ? $lastMetric->disk_used : "-" }} MB + {{ $lastMetric ? Number::format($lastMetric->disk_used) : "-" }} MB
Free Space
- {{ $lastMetric ? $lastMetric->disk_free : "-" }} MB + {{ $lastMetric ? Number::format($lastMetric->disk_free) : "-" }} MB