Repository: mesos Updated Branches: refs/heads/master 0bbeab258 -> 8949b1a10
Fixed Web UI display issue of small floating point values. Review: https://reviews.apache.org/r/38118 Project: http://git-wip-us.apache.org/repos/asf/mesos/repo Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/8949b1a1 Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/8949b1a1 Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/8949b1a1 Branch: refs/heads/master Commit: 8949b1a102a5fcfd4b861b1db112293942846d53 Parents: 0bbeab2 Author: haosdent huang <[email protected]> Authored: Thu Sep 10 02:55:31 2015 -0700 Committer: Michael Park <[email protected]> Committed: Thu Sep 10 03:02:57 2015 -0700 ---------------------------------------------------------------------- src/webui/master/static/home.html | 8 ++++---- src/webui/master/static/js/controllers.js | 6 ++++++ 2 files changed, 10 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/mesos/blob/8949b1a1/src/webui/master/static/home.html ---------------------------------------------------------------------- diff --git a/src/webui/master/static/home.html b/src/webui/master/static/home.html index ce8ca19..4fc64c0 100644 --- a/src/webui/master/static/home.html +++ b/src/webui/master/static/home.html @@ -98,22 +98,22 @@ <tbody> <tr> <td>Total</td> - <td class="text-right">{{total_cpus | number}}</td> + <td class="text-right">{{total_cpus | decimalFloat}}</td> <td class="text-right">{{total_mem * (1024 * 1024) | dataSize}}</td> </tr> <tr> <td>Used</td> - <td class="text-right">{{used_cpus | number}}</td> + <td class="text-right">{{used_cpus | decimalFloat}}</td> <td class="text-right">{{used_mem * (1024 * 1024) | dataSize}}</td> </tr> <tr> <td>Offered</td> - <td class="text-right">{{offered_cpus | number}}</td> + <td class="text-right">{{offered_cpus | decimalFloat}}</td> <td class="text-right">{{offered_mem * (1024 * 1024) | dataSize}}</td> </tr> <tr> <td>Idle</td> - <td class="text-right">{{idle_cpus | number}}</td> + <td class="text-right">{{idle_cpus | decimalFloat}}</td> <td class="text-right">{{idle_mem * (1024 * 1024) | dataSize}}</td> </tr> </tbody> http://git-wip-us.apache.org/repos/asf/mesos/blob/8949b1a1/src/webui/master/static/js/controllers.js ---------------------------------------------------------------------- diff --git a/src/webui/master/static/js/controllers.js b/src/webui/master/static/js/controllers.js index 3445028..fbf8696 100644 --- a/src/webui/master/static/js/controllers.js +++ b/src/webui/master/static/js/controllers.js @@ -206,6 +206,12 @@ return true; // Continue polling. } + // Add a filter to convert small float number to decimal string + mesosApp.filter('decimalFloat', function() { + return function(num) { + return parseFloat(num.toFixed(4)).toString(); + } + }); // Main controller that can be used to handle "global" events. E.g.,: // $scope.$on('$afterRouteChange', function() { ...; });
