diff --git a/CHANGELOG.md b/CHANGELOG.md index 96b9218..1c900bf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +# v2.0.3 +- Bug Fix: Continuing the bug fix from previous version, used float type casting for memory variables on remote-single page rather than letting PHP automatically deciding on variable type. + # v2.0.2 - Bug Fix: Replaced PHP round() function with number_format() to force the format of two decimal places on instance-single and remote-single pages. diff --git a/lxd-dashboard/about.html b/lxd-dashboard/about.html index 7ec3685..fb48bfe 100644 --- a/lxd-dashboard/about.html +++ b/lxd-dashboard/about.html @@ -20,7 +20,7 @@
About: LXDWARE is an open source LXD dashboard that provides a web-based user interface for controlling the entire LXD-based virtual infrastructure.
-Version: 2.0.2
+Version: 2.0.3
License: AGPL-3.0
URL: https://lxdware.com
diff --git a/lxd-dashboard/php/lxd/remotes-single.php b/lxd-dashboard/php/lxd/remotes-single.php index aa23f67..fa943fc 100644 --- a/lxd-dashboard/php/lxd/remotes-single.php +++ b/lxd-dashboard/php/lxd/remotes-single.php @@ -233,12 +233,12 @@ $arr['cpus'] = (isset($resource_data['cpu']['total'])) ? $resource_data['cpu']['total'] : "Unknown"; //example: 8 $arr['sockets'] = (isset($resource_data['cpu']['sockets'])) ? $resource_data['cpu']['sockets'] : []; //array of cpu info per socket $arr['storageDisks'] = (isset($resource_data['storage']['disks'])) ? $resource_data['storage']['disks'] : []; //array of storage devices - $memory_total = (isset($resource_data['memory']['total'])) ? $resource_data['memory']['total'] : 0; //memory in bytes - $memory_used = (isset($resource_data['memory']['used'])) ? $resource_data['memory']['used'] : 0; //memory in bytes + $memory_total = (isset($resource_data['memory']['total'])) ? (float)$resource_data['memory']['total'] : 0; //memory in bytes + $memory_used = (isset($resource_data['memory']['used'])) ? (float)$resource_data['memory']['used'] : 0; //memory in bytes if ($memory_total == 0) $arr['memoryPercentage'] = 0; else - $arr['memoryPercentage'] = number_format($memory_used / $memory_total, 2) * 100; + $arr['memoryPercentage'] = number_format($memory_used / $memory_total* 100, 2); //Format memory values if ($memory_total < 1073741824) {