[Kimchi-devel] [PATCH 1/1] Fixed kimchi.hosts.js dashboard graphs and added Storage pool images

sguimaraes943 at gmail.com sguimaraes943 at gmail.com
Wed Oct 7 19:55:11 UTC 2015


From: samhenri <samuel.guimaraes at eldorado.org.br>

Signed-off-by: samhenri <samuel.guimaraes at eldorado.org.br>
---
 src/wok/plugins/kimchi/ui/js/src/kimchi.host.js | 518 ++++++++++++------------
 ui/images/theme-default/high.png                | Bin 0 -> 812 bytes
 ui/images/theme-default/low.png                 | Bin 0 -> 813 bytes
 ui/images/theme-default/med.png                 | Bin 0 -> 873 bytes
 4 files changed, 250 insertions(+), 268 deletions(-)
 create mode 100644 ui/images/theme-default/high.png
 create mode 100644 ui/images/theme-default/low.png
 create mode 100644 ui/images/theme-default/med.png

diff --git a/src/wok/plugins/kimchi/ui/js/src/kimchi.host.js b/src/wok/plugins/kimchi/ui/js/src/kimchi.host.js
index 6679503..f95dee1 100644
--- a/src/wok/plugins/kimchi/ui/js/src/kimchi.host.js
+++ b/src/wok/plugins/kimchi/ui/js/src/kimchi.host.js
@@ -15,76 +15,69 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-kimchi.host={};
+kimchi.host = {};
 
 kimchi.host_main = function() {
-    var expand = function(header, toExpand) {
-        var controlledNode = $(header).attr('aria-controls');
-        $('#' + controlledNode)[toExpand ? 'removeClass' : 'addClass']('hidden');
-        $(header).attr('aria-expanded', toExpand ? 'true' : 'false');
-    }; 
-
+    "use strict";
     var repositoriesGrid = null;
     var initRepositoriesGrid = function(repo_type) {
-        var gridFields=[];
-        if (repo_type == "yum") {
-                gridFields=[{
-                    name: 'repo_id',
-                    label: i18n['KCHREPO6004M'],
-                    'class': 'repository-id',
-                    type: 'name'
-                }, {
-                    name: 'config[display_repo_name]',
-                    label: i18n['KCHREPO6005M'],
-                    'class': 'repository-name',
-                    type: 'description'
-                }, {
-                    name: 'enabled',
-                    label: i18n['KCHREPO6009M'],
-                    'class': 'repository-enabled',
-                    type: 'status'
-                }];
-        }
-        else if (repo_type == "deb") {
-                gridFields=[{
-                    name: 'baseurl',
-                    label: i18n['KCHREPO6006M'],
-                    makeTitle: true,
-                    'class': 'repository-baseurl deb',
-                    type: 'description'
-                }, {
-                    name: 'enabled',
-                    label: i18n['KCHREPO6009M'],
-                    'class': 'repository-enabled deb',
-                    type: 'status'
-                }, {
-                    name: 'config[dist]',
-                    label: "dist",
-                    'class': 'repository-gpgcheck deb'
-                }, {
-                    name: 'config[comps]',
-                    label: "comps",
-                    'class': 'repository-gpgcheck deb'
-                }];
-        }
-        else {
-            gridFields=[{
-                    name: 'repo_id',
-                    label: i18n['KCHREPO6004M'],
-                    'class': 'repository-id',
-                    type: 'name'
-                }, {
-                    name: 'enabled',
-                    label: i18n['KCHREPO6009M'],
-                    'class': 'repository-enabled',
-                    type: 'status'
-                }, {
-                    name: 'baseurl',
-                    label: i18n['KCHREPO6006M'],
-                    makeTitle: true,
-                    'class': 'repository-baseurl',
-                    type: 'description'
-                }];
+        var gridFields = [];
+        if (repo_type === "yum") {
+            gridFields = [{
+                name: 'repo_id',
+                label: i18n['KCHREPO6004M'],
+                'class': 'repository-id',
+                type: 'name'
+            }, {
+                name: 'config[display_repo_name]',
+                label: i18n['KCHREPO6005M'],
+                'class': 'repository-name',
+                type: 'description'
+            }, {
+                name: 'enabled',
+                label: i18n['KCHREPO6009M'],
+                'class': 'repository-enabled',
+                type: 'status'
+            }];
+        } else if (repo_type === "deb") {
+            gridFields = [{
+                name: 'baseurl',
+                label: i18n['KCHREPO6006M'],
+                makeTitle: true,
+                'class': 'repository-baseurl deb',
+                type: 'description'
+            }, {
+                name: 'enabled',
+                label: i18n['KCHREPO6009M'],
+                'class': 'repository-enabled deb',
+                type: 'status'
+            }, {
+                name: 'config[dist]',
+                label: "dist",
+                'class': 'repository-gpgcheck deb'
+            }, {
+                name: 'config[comps]',
+                label: "comps",
+                'class': 'repository-gpgcheck deb'
+            }];
+        } else {
+            gridFields = [{
+                name: 'repo_id',
+                label: i18n['KCHREPO6004M'],
+                'class': 'repository-id',
+                type: 'name'
+            }, {
+                name: 'enabled',
+                label: i18n['KCHREPO6009M'],
+                'class': 'repository-enabled',
+                type: 'status'
+            }, {
+                name: 'baseurl',
+                label: i18n['KCHREPO6006M'],
+                makeTitle: true,
+                'class': 'repository-baseurl',
+                type: 'description'
+            }];
         }
         repositoriesGrid = new wok.widget.List({
             container: 'repositories-grid-container',
@@ -95,8 +88,10 @@ kimchi.host_main = function() {
                 label: i18n['KCHREPO6012M'],
                 class: 'fa fa-plus-circle',
                 onClick: function(event) {
-                    wok.window.open({url:'plugins/kimchi/repository-add.html',
-                                    class: repo_type});
+                    wok.window.open({
+                        url: 'plugins/kimchi/repository-add.html',
+                        class: repo_type
+                    });
                 }
             }, {
                 id: 'repositories-grid-enable-button',
@@ -105,7 +100,7 @@ kimchi.host_main = function() {
                 disabled: true,
                 onClick: function(event) {
                     var repository = repositoriesGrid.getSelected();
-                    if(!repository) {
+                    if (!repository) {
                         return;
                     }
                     var name = repository['repo_id'];
@@ -122,12 +117,14 @@ kimchi.host_main = function() {
                 disabled: true,
                 onClick: function(event) {
                     var repository = repositoriesGrid.getSelected();
-                    if(!repository) {
+                    if (!repository) {
                         return;
                     }
                     kimchi.selectedRepository = repository['repo_id'];
-                    wok.window.open({url:'plugins/kimchi/repository-edit.html',
-                                    class: repo_type});
+                    wok.window.open({
+                        url: 'plugins/kimchi/repository-edit.html',
+                        class: repo_type
+                    });
                 }
             }, {
                 id: 'repositories-grid-remove-button',
@@ -137,15 +134,15 @@ kimchi.host_main = function() {
                 disabled: true,
                 onClick: function(event) {
                     var repository = repositoriesGrid.getSelected();
-                    if(!repository) {
+                    if (!repository) {
                         return;
                     }
 
                     var settings = {
-                        title : i18n['KCHREPO6001M'],
-                        content : i18n['KCHREPO6002M'],
-                        confirm : i18n['KCHAPI6004M'],
-                        cancel : i18n['KCHAPI6003M']
+                        title: i18n['KCHREPO6001M'],
+                        content: i18n['KCHREPO6002M'],
+                        confirm: i18n['KCHAPI6004M'],
+                        cancel: i18n['KCHAPI6003M']
                     };
 
                     wok.confirm(settings, function() {
@@ -153,15 +150,15 @@ kimchi.host_main = function() {
                             repository['repo_id'],
                             function(result) {
                                 wok.topic('kimchi/repositoryDeleted').publish(result);
-                            }, function(error) {
-                            }
+                            },
+                            function(error) {}
                         );
                     });
                 }
             }],
             onRowSelected: function(row) {
                 var repository = repositoriesGrid.getSelected();
-                if(!repository) {
+                if (!repository) {
                     return;
                 }
                 $('#repositories-grid-remove-button').prop('disabled', false);
@@ -179,28 +176,26 @@ kimchi.host_main = function() {
 
     var listRepositories = function(gridCallback) {
         kimchi.listRepositories(function(repositories) {
-            if($.isFunction(gridCallback)) {
-                gridCallback(repositories);
-            }
-            else {
-                if(repositoriesGrid) {
-                    repositoriesGrid.setData(repositories);
-                }
-                else {
-                    initRepositoriesGrid();
-                    repositoriesGrid.setData(repositories);
+                if ($.isFunction(gridCallback)) {
+                    gridCallback(repositories);
+                } else {
+                    if (repositoriesGrid) {
+                        repositoriesGrid.setData(repositories);
+                    } else {
+                        initRepositoriesGrid();
+                        repositoriesGrid.setData(repositories);
+                    }
                 }
-            }
-        },
-        function(error) {
-            var message = error && error['responseJSON'] && error['responseJSON']['reason'];
+            },
+            function(error) {
+                var message = error && error['responseJSON'] && error['responseJSON']['reason'];
 
-            if($.isFunction(gridCallback)) {
-                gridCallback([]);
-            }
-            repositoriesGrid &&
-                repositoriesGrid.showMessage(message || i18n['KCHUPD6008M']);
-        });
+                if ($.isFunction(gridCallback)) {
+                    gridCallback([]);
+                }
+                repositoriesGrid &&
+                    repositoriesGrid.showMessage(message || i18n['KCHUPD6008M']);
+            });
 
         $('#repositories-grid-remove-button').prop('disabled', true);
         $('#repositories-grid-edit-button').prop('disabled', true);
@@ -291,14 +286,12 @@ kimchi.host_main = function() {
 
     var listSoftwareUpdates = function(gridCallback) {
         kimchi.listSoftwareUpdates(function(softwareUpdates) {
-            if($.isFunction(gridCallback)) {
+            if ($.isFunction(gridCallback)) {
                 gridCallback(softwareUpdates);
-            }
-            else {
-                if(softwareUpdatesGrid) {
+            } else {
+                if (softwareUpdatesGrid) {
                     softwareUpdatesGrid.setData(softwareUpdates);
-                }
-                else {
+                } else {
                     initSoftwareUpdatesGrid(softwareUpdates);
                 }
             }
@@ -312,13 +305,13 @@ kimchi.host_main = function() {
             // package manager instance running, so follow that instance updates
             if (message.indexOf("KCHPKGUPD0005E") !== -1) {
                 startSoftwareUpdateProgress();
-                if($.isFunction(gridCallback)) {
+                if ($.isFunction(gridCallback)) {
                     gridCallback([]);
                 }
                 return;
             }
 
-            if($.isFunction(gridCallback)) {
+            if ($.isFunction(gridCallback)) {
                 gridCallback([]);
             }
             softwareUpdatesGrid &&
@@ -412,7 +405,7 @@ kimchi.host_main = function() {
                 var report = reportGrid.getSelected();
                 // Only enable report buttons if the selected line is not a
                 // pending report
-                if (report['time'] == i18n['KCHDR6007M']) {
+                if (report['time'] === i18n['KCHDR6007M']) {
                     var gridElement = $('#' + reportGridID);
                     var row = $('tr:contains(' + report['name'] + ')', gridElement);
                     enableReportButtons(false);
@@ -438,15 +431,19 @@ kimchi.host_main = function() {
     };
 
     var getPendingReports = function() {
-        var reports = []
-        var filter = 'status=running&target_uri=' + encodeURIComponent('^/plugins/kimchi/debugreports/*')
+        var reports = [];
+        var filter = 'status=running&target_uri=' + encodeURIComponent('^/plugins/kimchi/debugreports/*');
+        var reportName;
 
         kimchi.getTasksByFilter(filter, function(tasks) {
-            for(var i = 0; i < tasks.length; i++) {
+            for (var i = 0; i < tasks.length; i++) {
                 reportName = tasks[i].target_uri.replace(/^\/plugins\/kimchi\/debugreports\//, '') || i18n['KCHDR6012M'];
-                reports.push({'name': reportName, 'time': i18n['KCHDR6007M']})
+                reports.push({
+                    'name': reportName,
+                    'time': i18n['KCHDR6007M']
+                });
 
-                if(kimchi.trackingTasks.indexOf(tasks[i].id) >= 0) {
+                if (kimchi.trackingTasks.indexOf(tasks[i].id) >= 0) {
                     continue;
                 }
 
@@ -472,29 +469,28 @@ kimchi.host_main = function() {
 
     var listDebugReports = function() {
         kimchi.listReports(function(reports) {
-            pendingReports = getPendingReports();
-            allReports = pendingReports.concat(reports);
+            var pendingReports = getPendingReports();
+            var allReports = pendingReports.concat(reports);
             $('#debug-report-section').removeClass('hidden');
 
             // Row selection will be cleared so disable buttons here
             enableReportButtons(false);
 
-            if(reportGrid) {
+            if (reportGrid) {
                 reportGrid.setData(allReports);
-            }
-            else {
+            } else {
                 initReportGrid(allReports);
             }
 
             // Set id-debug-img to pending reports
             // It will display a loading icon
             var gridElement = $('#' + reportGridID);
-                $.each($('td:contains(' + i18n['KCHDR6007M']  + ')', gridElement), function(index, row) {
+            $.each($('td:contains(' + i18n['KCHDR6007M'] + ')', gridElement), function(index, row) {
                 $(row).parent().addClass('no-hover');
                 $(row).attr('id', 'id-debug-img');
             });
         }, function(error) {
-            if(error['status'] == 403) {
+            if (error['status'] === 403) {
                 $('#debug-report-section').addClass('hidden');
                 return;
             }
@@ -506,10 +502,10 @@ kimchi.host_main = function() {
     var restartButtonID = '#host-button-restart';
     var shutdownHost = function(params) {
         var settings = {
-            title : i18n['KCHAPI6004M'],
-            content : i18n['KCHHOST6008M'],
-            confirm : i18n['KCHAPI6002M'],
-            cancel : i18n['KCHAPI6003M']
+            title: i18n['KCHAPI6004M'],
+            content: i18n['KCHHOST6008M'],
+            confirm: i18n['KCHAPI6002M'],
+            cancel: i18n['KCHAPI6003M']
         };
 
         wok.confirm(settings, function() {
@@ -518,8 +514,8 @@ kimchi.host_main = function() {
             $(restartButtonID).prop('disabled', true);
             // Check if there is any VM is running.
             kimchi.listVMs(function(vms) {
-                for(var i = 0; i < vms.length; i++) {
-                    if(vms[i]['state'] === 'running') {
+                for (var i = 0; i < vms.length; i++) {
+                    if (vms[i]['state'] === 'running') {
                         wok.message.error.code('KCHHOST6001E');
                         $(shutdownButtonID).prop('disabled', false);
                         $(restartButtonID).prop('disabled', false);
@@ -528,39 +524,30 @@ kimchi.host_main = function() {
                 }
 
             });
-        }, function() {
-        });
+        }, function() {});
     };
 
     var initPage = function() {
-        $('#host-info-container .section-header').each(function(i, header) {
-            $('<span class="arrow"></span>').prependTo(header);
-            var toExpand = $(header).attr('aria-expanded') !== 'false';
-            expand(header, toExpand);
-        });
-
-        $('#host-info-container').on('click', '.section-header', function(event) {
-            var toExpand = $(this).attr('aria-expanded') === 'false';
-            expand(this, toExpand);
-        });
 
         $('#host-button-shutdown').on('click', function(event) {
+            event.preventDefault();
             shutdownHost(null);
         });
 
         $('#host-button-restart').on('click', function(event) {
+            event.preventDefault();
             shutdownHost({
                 reboot: true
             });
         });
 
         var setupUI = function() {
-            if (kimchi.capabilities == undefined) {
+            if (kimchi.capabilities === undefined) {
                 setTimeout(setupUI, 2000);
                 return;
             }
 
-            if((kimchi.capabilities['repo_mngt_tool']) && (kimchi.capabilities['repo_mngt_tool']!="None")) {
+            if ((kimchi.capabilities['repo_mngt_tool']) && (kimchi.capabilities['repo_mngt_tool'] !== "None")) {
                 initRepositoriesGrid(kimchi.capabilities['repo_mngt_tool']);
                 $('#repositories-section').switchClass('hidden', kimchi.capabilities['repo_mngt_tool']);
                 wok.topic('kimchi/repositoryAdded')
@@ -571,7 +558,7 @@ kimchi.host_main = function() {
                     .subscribe(listRepositories);
             }
 
-            if(kimchi.capabilities['update_tool']) {
+            if (kimchi.capabilities['update_tool']) {
                 $('#software-update-section').removeClass('hidden');
                 initSoftwareUpdatesGrid();
                 wok.topic('kimchi/softwareUpdated')
@@ -581,7 +568,7 @@ kimchi.host_main = function() {
                 });
             }
 
-            if(kimchi.capabilities['system_report_tool']) {
+            if (kimchi.capabilities['system_report_tool']) {
                 listDebugReports();
                 wok.topic('kimchi/debugReportAdded')
                     .subscribe(listDebugReports);
@@ -624,40 +611,40 @@ kimchi.host_main = function() {
                 }
             },
             diskIO: {
-                r: {
+                w: {
                     type: 'value',
                     base: 2,
                     fixed: 2,
                     unit: 'B/s',
-                    legend: i18n['KCHHOST6004M'],
+                    legend: i18n['KCHHOST6005M'],
+                    'class': 'disk-write',
                     points: []
                 },
-                w: {
+                r: {
                     type: 'value',
                     base: 2,
                     fixed: 2,
                     unit: 'B/s',
-                    legend: i18n['KCHHOST6005M'],
-                    'class': 'disk-write',
+                    legend: i18n['KCHHOST6004M'],
                     points: []
                 }
             },
             networkIO: {
-                r: {
+                s: {
                     type: 'value',
                     base: 2,
                     fixed: 2,
                     unit: 'B/s',
-                    legend: i18n['KCHHOST6006M'],
+                    legend: i18n['KCHHOST6007M'],
+                    'class': 'network-sent',
                     points: []
                 },
-                s: {
+                r: {
                     type: 'value',
                     base: 2,
                     fixed: 2,
                     unit: 'B/s',
-                    legend: i18n['KCHHOST6007M'],
-                    'class': 'network-sent',
+                    legend: i18n['KCHHOST6006M'],
                     points: []
                 }
             }
@@ -666,38 +653,36 @@ kimchi.host_main = function() {
         var cursor = SIZE;
 
         var add = function(stats) {
-            for(var key in stats) {
+            for (var key in stats) {
                 var item = stats[key];
-                for(var metrics in item) {
+                for (var metrics in item) {
                     var value = item[metrics]['v'];
                     var max = item[metrics]['max'];
                     var unifiedMetrics = statsArray[key][metrics];
                     var ps = unifiedMetrics['points'];
-                    if(!Array.isArray(value)){
+                    if (!Array.isArray(value)) {
                         ps.push(value);
-                        if(ps.length > SIZE + 1) {
+                        if (ps.length > SIZE + 1) {
                             ps.shift();
                         }
+                    } else {
+                        ps = ps.concat(value);
+                        ps.splice(0, ps.length - SIZE - 1);
+                        unifiedMetrics['points'] = ps;
                     }
-                    else{
-                        ps=ps.concat(value);
-                        ps.splice(0, ps.length-SIZE-1);
-                        unifiedMetrics['points']=ps;
-                    }
-                    if(max !== undefined) {
+                    if (max !== undefined) {
                         unifiedMetrics['max'] = max;
-                    }
-                    else {
-                        if(unifiedMetrics['type'] !== 'value') {
+                    } else {
+                        if (unifiedMetrics['type'] !== 'value') {
                             continue;
                         }
                         max = -Infinity;
                         $.each(ps, function(i, value) {
-                            if(value > max) {
+                            if (value > max) {
                                 max = value;
                             }
                         });
-                        if(max === 0) {
+                        if (max === 0) {
                             ++max;
                         }
                         max *= 1.1;
@@ -711,7 +696,7 @@ kimchi.host_main = function() {
         var get = function(which) {
             var stats = statsArray[which];
             var lines = [];
-            for(var k in stats) {
+            for (var k in stats) {
                 var obj = stats[k];
                 var line = {
                     type: obj['type'],
@@ -720,10 +705,10 @@ kimchi.host_main = function() {
                     fixed: obj['fixed'],
                     legend: obj['legend']
                 };
-                if(obj['max']) {
+                if (obj['max']) {
                     line['max'] = obj['max'];
                 }
-                if(obj['class']) {
+                if (obj['class']) {
                     line['class'] = obj['class'];
                 }
                 var ps = obj['points'];
@@ -748,104 +733,102 @@ kimchi.host_main = function() {
     };
 
     var Tracker = function(charts) {
-      var charts = charts;
-      var timer = null;
-      var statsPool = new StatsMgr();
-      var setCharts = function(newCharts) {
-          charts = newCharts;
-          for(var key in charts) {
-              var chart = charts[key];
-              chart.updateUI(statsPool.get(key));
-          }
-      };
-
-      var self = this;
-
-      var UnifyStats = function(stats) {
-          var result= {
-              cpu: {
-                  u: {
-                      v: stats['cpu_utilization']
-                  }
-              },
-              memory: {
-                  u: {
-                  }
-              },
-              diskIO: {
-                  r: {
-                      v: stats['disk_read_rate']
-                  },
-                  w: {
-                      v: stats['disk_write_rate']
-                  }
-              },
-              networkIO: {
-                  r: {
-                      v: stats['net_recv_rate']
-                  },
-                  s: {
-                      v: stats['net_sent_rate']
-                  }
-              }
-          };
-          if(Array.isArray(stats['memory'])){
-              result.memory.u['v']=[];
-              result.memory.u['max']=-Infinity;
-              for(var i=0;i<stats['memory'].length;i++){
-                  result.memory.u['v'].push(stats['memory'][i]['avail']);
-                  result.memory.u['max']=Math.max(result.memory.u['max'],stats['memory'][i]['total']);
-              }
-          }
-          else {
-              result.memory.u['v']=stats['memory']['avail'],
-              result.memory.u['max']=stats['memory']['total']
-          }
-          return(result);
-      };
-
-
-      var statsCallback = function(stats) {
-              var unifiedStats = UnifyStats(stats);
-              statsPool.add(unifiedStats);
-              for(var key in charts) {
-                  var chart = charts[key];
-                  chart.updateUI(statsPool.get(key));
-              }
-              timer = setTimeout(function() {
-                  continueTrack();
-              }, 1000);
-          };
-
-      var track = function() {
-          kimchi.getHostStatsHistory(statsCallback,
-            function() {
-                continueTrack();
-            });
-      };
+        var charts = charts;
+        var timer = null;
+        var statsPool = new StatsMgr();
+        var setCharts = function(newCharts) {
+            charts = newCharts;
+            for (var key in charts) {
+                var chart = charts[key];
+                chart.updateUI(statsPool.get(key));
+            }
+        };
 
-      var continueTrack = function() {
-          kimchi.getHostStats(statsCallback,
-            function() {
+        var self = this;
+
+        var UnifyStats = function(stats) {
+            var result = {
+                cpu: {
+                    u: {
+                        v: stats['cpu_utilization']
+                    }
+                },
+                memory: {
+                    u: {}
+                },
+                diskIO: {
+                    w: {
+                        v: stats['disk_write_rate']
+                    },
+                    r: {
+                        v: stats['disk_read_rate']
+                    }
+                },
+                networkIO: {
+                    s: {
+                        v: stats['net_sent_rate']
+                    },
+                    r: {
+                        v: stats['net_recv_rate']
+                    }
+                }
+            };
+            if (Array.isArray(stats['memory'])) {
+                result.memory.u['v'] = [];
+                result.memory.u['max'] = -Infinity;
+                for (var i = 0; i < stats['memory'].length; i++) {
+                    result.memory.u['v'].push(stats['memory'][i]['avail']);
+                    result.memory.u['max'] = Math.max(result.memory.u['max'], stats['memory'][i]['total']);
+                }
+            } else {
+                result.memory.u['v'] = stats['memory']['avail'],
+                    result.memory.u['max'] = stats['memory']['total']
+            }
+            return (result);
+        };
+
+
+        var statsCallback = function(stats) {
+            var unifiedStats = UnifyStats(stats);
+            statsPool.add(unifiedStats);
+            for (var key in charts) {
+                var chart = charts[key];
+                chart.updateUI(statsPool.get(key));
+            }
+            timer = setTimeout(function() {
                 continueTrack();
-            });
-      };
-
-      var destroy = function() {
-          timer && clearTimeout(timer);
-          timer = null;
-      };
-
-      return {
-        setCharts: setCharts,
-        start: track,
-        stop: destroy
-      };
+            }, 1000);
+        };
+
+        var track = function() {
+            kimchi.getHostStatsHistory(statsCallback,
+                function() {
+                    continueTrack();
+                });
+        };
+
+        var continueTrack = function() {
+            kimchi.getHostStats(statsCallback,
+                function() {
+                    continueTrack();
+                });
+        };
+
+        var destroy = function() {
+            timer && clearTimeout(timer);
+            timer = null;
+        };
+
+        return {
+            setCharts: setCharts,
+            start: track,
+            stop: destroy
+        };
     };
 
     var initTracker = function() {
         // TODO: Extend tabs with onUnload event to unregister timers.
-        if(kimchi.hostTimer) {
+        if (kimchi.hostTimer) {
             kimchi.hostTimer.stop();
             delete kimchi.hostTimer;
         }
@@ -873,20 +856,19 @@ kimchi.host_main = function() {
             })
         };
 
-        if(kimchi.hostTimer) {
+        if (kimchi.hostTimer) {
             kimchi.hostTimer.setCharts(trackedCharts);
-        }
-        else {
+        } else {
             kimchi.hostTimer = new Tracker(trackedCharts);
             kimchi.hostTimer.start();
         }
     };
 
     $('#host-root-container').on('remove', function() {
-        if(kimchi.hostTimer) {
+        if (kimchi.hostTimer) {
             kimchi.hostTimer.stop();
             delete kimchi.hostTimer;
-            }
+        }
 
         repositoriesGrid && repositoriesGrid.destroy();
         wok.topic('kimchi/repositoryAdded')
diff --git a/ui/images/theme-default/high.png b/ui/images/theme-default/high.png
new file mode 100644
index 0000000000000000000000000000000000000000..5f5fcea79a4be9eb82d05df7ee8d981df6967bf0
GIT binary patch
literal 812
zcmV+{1JnG8P)<h;3K|Lk000e1NJLTq000>P000>X1^@s6#OZ}&00004XF*Lt006JZ
zHwB960000PbVXQnQ*UN;cVTj606}DLVr3vnZDD6+Qe|Oed2z{QJOBU!zDYzuRCwB~
z)@x|ZaU93-|2ghQ=90 at 8#kSOpMPW#pMGceN+(T|PJP at LI;F2P87si9RKd at ykQ`YhT
zVJ;8IWw}JkEpy4`9O`iJ{_68DozB^gv-7Lhes%u8|L^;|{lC9?%1)O%QA%U9#sG{_
z-2qMT6K`=FmAHtP2uA9tVUz$}F#&UthHv<U*XpPNT3|TF=~*!j<6$g8`eB!9>-;=U
zXw+}u*DP&TS;)Z at EJr?;;PSt-3J=l)$IuNQunpTIEW>v^m$RtAZgkgxrfLa;;XzWd
zLrYbPeYj~2GYePcYXE6_ZnLSz6RRH-ZK%|;&Bh|^$9!C{jy>A=me_(>xPkF_N9Tj|
z;!G`3q;eNK2~?~$MVOAK7-_Ths$m|+B7l_&(4Tre=G79w(Y|b at eW8|TBkm&|)2x97
zX@&(z(kQBUAypfh>%>-CVGZx)X$d#uhfZf33t}VA)JE?`2$N9Y{9j4NG6LD=pTc$h
zHqfi%XR|qj_cTh^=EYNnp|6(hxI17A(o?7Go*phlXD9xWq583cWLS{)cFL3%LONOX
zDZN!&+WCcc7Nog;^s8=E&mhUF1FC(tOkXUTa*@M%PjM1cl5~3g_NNBFk)p(xsM1z-
zjRm=))SazUmZ*}Yy}squnGPs}c1%zJ8|)07+7ho4U4<UZNzjswKrek3)n29TqxcBR
zKSS#oz&c;8Q+g1e-2`cu%mK~DF03wb&d9R)CVh~Xv=t#YNKp63N!=@lFshF18(y-N
z`*M|q|7LSH3%kXBSZkjO2IC0USr)CMbDQyG4X{9;#8TXecKuqKo~UcrHgB=&5?sX#
zd__}qQU)Kb+J|eFiM8RO+WwJvrc;)q8`0_&`e4J0M}0iP9+bOF6wALvcGAjl4t=x?
qLzJC;x{zMk1*bMudM9G}BftP0OtN`NjudzR0000<MNUMnLSTXlM1j8m

literal 0
HcmV?d00001

diff --git a/ui/images/theme-default/low.png b/ui/images/theme-default/low.png
new file mode 100644
index 0000000000000000000000000000000000000000..1f891d648d7d72c558a942ab77befb1cdd368235
GIT binary patch
literal 813
zcmV+|1JeA7P)<h;3K|Lk000e1NJLTq000>P000>X1^@s6#OZ}&00004XF*Lt006JZ
zHwB960000PbVXQnQ*UN;cVTj606}DLVr3vnZDD6+Qe|Oed2z{QJOBU!zez+vRCwB~
zmRU$tVHC&j+-%X%DAIN?+o)`y2U}iR9)g0RqJ;|TAtCCeg*HOyHCk<7p@<61z!rr>
zC~UBW7K%zKgCQylCmUL{z?|xL;(uWnX3S<h at bfU<`+aBm&UeoBm0c-!5=b}b4U=H5
zbU)}0ZO{mhp$e+u9kj;VC at q13Tvz~wFbuxKXLzrTx<Dq(fcbiM8qUItju<I`gVMJ7
zb+{<6KR~mhw5a?r4VJ)Wm<<~s5FJ&lkuh){hQcS<2gPyH at B?0pYfuS?V5A&csuccR
z=SD5egZ)a?C8eu4QJ!O at N@=qUq{9iA;yv_?^nz^){XVRRnhqN9qz;Op1P01rZnTk^
zFb`T}?4y&Mm{U98IShwoo)HUg4P?P_xa*`QuV5GaRCV?-BNJe(4*DoWoYdtq+=Kow
z*;V;jG*_X?=^U}NU68|z%}BmV`PqLS^uMHDMn;>F9Pp_vL^{!kwVhv(Z4va;KkX(v
z!JIt}D#2vsVP0rcfhyG`!y@^rADPlOQj8!dou%q+wm%{G4TIG94yS0OR=Tfr$kolZ
z);&>G)}-5;tUQ(W>#QHRs_7PW&;jJr!rh&u0c);L<m_@)ZK*4-EA?QdQg#zgCUF+0
zaMC*SEEuP2QRk{{pMx;0hUvWc27Ls|I%vS&FJfIln{S7%a0b434Kg6l)73qPu%K4W
za;r9pCvBQ1g}h&)ZobnlAl%YXM0`;*K3ns|=E!Y0pft8}cl??+Hq=IG+}fn9XY)H+
zZ-ui~>&?Mc at W>wcVm>5BXddJ%jmK03;dWAGXSfjd%F#w0dX3jX(&Dt~MH;(yc<ZD~
z72R9-20hdjtb@;y&H#&QqYgaM-iJg`Rc2Fih4dC(*jVvtkC!Tx@^}L;(I-(@l~n=b
rm5!+}SRUIzYS4hIkWQG=KLQK@;61`6RS)H800000NkvXXu0mjfY}$8n

literal 0
HcmV?d00001

diff --git a/ui/images/theme-default/med.png b/ui/images/theme-default/med.png
new file mode 100644
index 0000000000000000000000000000000000000000..06106551316ec16a148c346941ddec92f9d16bc9
GIT binary patch
literal 873
zcmV-v1D5=WP)<h;3K|Lk000e1NJLTq000>P000>X1^@s6#OZ}&00004XF*Lt006JZ
zHwB960000PbVXQnQ*UN;cVTj606}DLVr3vnZDD6+Qe|Oed2z{QJOBU!`$<GWRCwB?
zmT5 at TVGxIR*Dg1-gDktK)CxPKp!-V}1r|oxMF$mSMF$ii6%o{jK17+_cVI*XW}sb=
zNJWWd2T at o`8A*3|Bpqvlxz#i96Bb)#+Z}jz*!{onJM+%We`cLIm##XRkv7l?#=vyx
zZqODQpaPyiKHP>6Q19=cR?Qgb3$q{<V&Nxzg-<#t3?g7Mr07{DoPigC7#Rr%rS0(R
za6w*w29IuOw at QFSm<Jmn88$$H at 2#2|83gB`AAEtmu+L8z>fnvI0(o!<2FRiL3SoUy
zBQdaFp}Gji;Gr!{>64Ny2V(WyZc_ at cOy|DM%~#l#!df^1E8vD5>{Q}Az#dov4`3!#
zariiGT&xiJlVUi4p-ing4h!KmOtss(v at i)~KrL*Mfl=rku)GBW4&^0-^{W(~o$wsu
zV1X?#BjK<bBIQL98)B5miH^XeBW!11l0vu}eyKV;n-TMPuo8U~yf7DLJN{3iAq_*8
z{9L%N-^RLBes-J7P|cz^B`+A61S1r-^NkLhks+$GXL`5>dO3oZc<C}3i8mu%t;*CE
zysE5FWSF$Io!<~;M%wE~k96x0jYLb=O1sU-cYTSFz8RvCa_LA_ug5+r;Scmw<2xLp
zkrL at H(v at bUP_28ks;pWqBUmZ+c}XqTk6fzhT6NIwv<JIxdXNUJxjvP%i&VAQE_t1&
z2g?+)TW~UnT%5v5>&#PNs9uXwm)iDOr~&Ig6Il2TeFSm>G+^tuvadjgZ&Q_?hHs4x
zvOu1PYhd+eLy4N at W*y>B8Z=K*S)ZkDzDqCU9i_tS^qKKdnkP1P?^^p-7;T;;Xx`XN
z8K`k<ld_D%?`gjk&N}Tk2Uo&l-+9s~{UJ-OrcQ$^U7>7F!qiMN<Y<MGUZ at W8&-k at A
zJx62LlDA$uTeo`;KcF4-PzRqT?FPG5niB49>5oLYsw`0x(ex(0uua9OGhV7tEG$)l
z{w1nWWnF{e3deYLXSW8 at M;mZjQ`AyO{|Ybw4NBe};aPP+00000NkvXXu0mjfdFFsc

literal 0
HcmV?d00001

-- 
1.9.3




More information about the Kimchi-devel mailing list