Skip to content

Commit

Permalink
v2.0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewalanpenning committed May 26, 2021
1 parent 82b6a31 commit 471a830
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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.

Expand Down
2 changes: 1 addition & 1 deletion lxd-dashboard/about.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<html lang="en">
<body class="">
<p><strong>About</strong>: LXDWARE is an open source LXD dashboard that provides a web-based user interface for controlling the entire LXD-based virtual infrastructure.</p>
<p><strong>Version</strong>: 2.0.2</p>
<p><strong>Version</strong>: 2.0.3</p>
<p><strong>License</strong>: AGPL-3.0</p>
<p><strong>URL</strong>: https://lxdware.com</p>
</body>
Expand Down
6 changes: 3 additions & 3 deletions lxd-dashboard/php/lxd/remotes-single.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 471a830

Please sign in to comment.