diff --git a/glances/outputs/static/js/app.js b/glances/outputs/static/js/app.js index 6ff863fd..12018c50 100644 --- a/glances/outputs/static/js/app.js +++ b/glances/outputs/static/js/app.js @@ -11,5 +11,9 @@ var glancesApp = angular.module('glancesApp', ['glances.config', 'cfp.hotkeys']) .run(function($rootScope, GlancesStats) { $rootScope.title = "Glances"; + $rootScope.$on('data_refreshed', function(event, data) { + $rootScope.title = data.stats.system.hostname + ' - Glances'; + }); + GlancesStats.init(); }); diff --git a/glances/outputs/static/js/services/stats.js b/glances/outputs/static/js/services/stats.js index 77cf1884..54b39810 100644 --- a/glances/outputs/static/js/services/stats.js +++ b/glances/outputs/static/js/services/stats.js @@ -22,9 +22,7 @@ glancesApp.service('GlancesStats', function($http, $q, $rootScope, $timeout, Gla 'isWindows': results[0]['system']['os_name'] === 'Windows' }; - $rootScope.title = _data.stats.system.hostname + ' - Glances'; $rootScope.$broadcast('data_refreshed', _data); - nextLoad(); }, function() { $rootScope.$broadcast('is_disconnected'); diff --git a/glances/outputs/static/public/js/main.min.js b/glances/outputs/static/public/js/main.min.js index 50f6acee..c89a23d5 100644 --- a/glances/outputs/static/public/js/main.min.js +++ b/glances/outputs/static/public/js/main.min.js @@ -11,6 +11,10 @@ var glancesApp = angular.module('glancesApp', ['glances.config', 'cfp.hotkeys']) .run(["$rootScope", "GlancesStats", function($rootScope, GlancesStats) { $rootScope.title = "Glances"; + $rootScope.$on('data_refreshed', function(event, data) { + $rootScope.title = data.stats.system.hostname + ' - Glances'; + }); + GlancesStats.init(); }]); @@ -246,9 +250,7 @@ glancesApp.service('GlancesStats', ["$http", "$q", "$rootScope", "$timeout", "Gl 'isWindows': results[0]['system']['os_name'] === 'Windows' }; - $rootScope.title = _data.stats.system.hostname + ' - Glances'; $rootScope.$broadcast('data_refreshed', _data); - nextLoad(); }, function() { $rootScope.$broadcast('is_disconnected'); @@ -295,24 +297,6 @@ glancesApp.service('GlancesStats', ["$http", "$q", "$rootScope", "$timeout", "Gl 'use strict'; -glancesApp.component('glancesHelp', { - controller: GlancesHelpController, - controllerAs: 'vm', - templateUrl: 'components/help/view.html' -}); - -'use strict'; - -function GlancesHelpController($http) { - var vm = this; - - $http.get('api/2/help').then(function (response) { - vm.help = response.data; - }); -} - -'use strict'; - glancesApp.component('glances', { controller: GlancesController, controllerAs: 'vm', @@ -538,55 +522,20 @@ function GlancesController($scope, GlancesStats, hotkeys, ARGUMENTS) { 'use strict'; -glancesApp.component('glancesPluginAmps', { - controller: GlancesPluginAmpsController, +glancesApp.component('glancesHelp', { + controller: GlancesHelpController, controllerAs: 'vm', - templateUrl: 'components/plugin-amps/view.html' + templateUrl: 'components/help/view.html' }); 'use strict'; -function GlancesPluginAmpsController($scope, GlancesStats, favicoService) { +function GlancesHelpController($http) { var vm = this; - vm.processes = []; - vm.$onInit = function() { - loadData(GlancesStats.getData()); - }; - - $scope.$on('data_refreshed', function(event, data) { - loadData(data); + $http.get('api/2/help').then(function (response) { + vm.help = response.data; }); - - var loadData = function(data) { - var processes = data.stats['amps']; - - this.processes = []; - angular.forEach(processes, function(process) { - if (process.result !== null) { - this.processes.push(process); - } - }, this); - } - - vm.getDescriptionDecoration = function(process) { - var count = process.count; - var countMin = process.countmin; - var countMax = process.countmax; - var decoration = "ok"; - - if (count > 0) { - if ((countMin == null || count >= countMin) && (countMax == null || count <= countMax)) { - decoration = 'ok'; - } else { - decoration = 'careful'; - } - } else { - decoration = countMin == null ? 'ok' : 'critical'; - } - - return decoration; - } } 'use strict'; @@ -665,6 +614,59 @@ function GlancesPluginAlertController($scope, favicoService) { 'use strict'; +glancesApp.component('glancesPluginAmps', { + controller: GlancesPluginAmpsController, + controllerAs: 'vm', + templateUrl: 'components/plugin-amps/view.html' +}); + +'use strict'; + +function GlancesPluginAmpsController($scope, GlancesStats, favicoService) { + var vm = this; + vm.processes = []; + + vm.$onInit = function() { + loadData(GlancesStats.getData()); + }; + + $scope.$on('data_refreshed', function(event, data) { + loadData(data); + }); + + var loadData = function(data) { + var processes = data.stats['amps']; + + this.processes = []; + angular.forEach(processes, function(process) { + if (process.result !== null) { + this.processes.push(process); + } + }, this); + } + + vm.getDescriptionDecoration = function(process) { + var count = process.count; + var countMin = process.countmin; + var countMax = process.countmax; + var decoration = "ok"; + + if (count > 0) { + if ((countMin == null || count >= countMin) && (countMax == null || count <= countMax)) { + decoration = 'ok'; + } else { + decoration = 'careful'; + } + } else { + decoration = countMin == null ? 'ok' : 'critical'; + } + + return decoration; + } +} + +'use strict'; + glancesApp.component('glancesPluginCloud', { controller: GlancesPluginCloudController, controllerAs: 'vm', diff --git a/glances/outputs/static/public/js/templates.min.js b/glances/outputs/static/public/js/templates.min.js index 48d30358..fe90646c 100644 --- a/glances/outputs/static/public/js/templates.min.js +++ b/glances/outputs/static/public/js/templates.min.js @@ -1,7 +1,7 @@ -angular.module('glancesApp').run(['$templateCache', function($templateCache) {$templateCache.put('components/help/view.html','
\n
\n
{{vm.help.version}} {{vm.help.psutil_version}}
\n
\n
 
\n
\n
{{vm.help.configuration_file}}
\n
\n
 
\n
\n
{{vm.help.sort_auto}}
\n
{{vm.help.sort_network}}
\n
\n
\n
{{vm.help.sort_cpu}}
\n
{{vm.help.show_hide_alert}}
\n
\n
\n
{{vm.help.sort_mem}}
\n
{{vm.help.percpu}}
\n
\n
\n
{{vm.help.sort_user}}
\n
{{vm.help.show_hide_ip}}
\n
\n
\n
{{vm.help.sort_proc}}
\n
{{vm.help.enable_disable_docker}}
\n
\n
\n
{{vm.help.sort_io}}
\n
{{vm.help.view_network_io_combination}}
\n
\n
\n
{{vm.help.sort_cpu_times}}
\n
{{vm.help.view_cumulative_network}}
\n
\n
\n
{{vm.help.show_hide_diskio}}
\n
{{vm.help.show_hide_filesytem_freespace}}
\n
\n
\n
{{vm.help.show_hide_filesystem}}
\n
{{vm.help.show_hide_vm.help}}
\n
\n
\n
{{vm.help.show_hide_network}}
\n
{{vm.help.diskio_iops}}
\n
\n
\n
{{vm.help.show_hide_sensors}}
\n
{{vm.help.show_hide_top_menu}}
\n
\n
\n
{{vm.help.show_hide_left_sidebar}}
\n
{{vm.help.show_hide_amp}}
\n
\n
\n
{{vm.help.enable_disable_process_stats}}
\n
{{vm.help.show_hide_irq}}
\n
\n
\n
{{vm.help.enable_disable_gpu}}
\n
{{vm.help.enable_disable_mean_gpu}}
\n
\n
\n
{{vm.help.enable_disable_quick_look}}
\n
\n
\n
\n
{{vm.help.enable_disable_short_processname}}
\n
\n
\n
\n
{{vm.help.enable_disable_ports}}
\n
\n
\n\n
\n'); -$templateCache.put('components/glances/view.html','
\n
\n \n
Loading...
\n
\n\n \n\n
\n
\n
\n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n
\n
\n
\n \n
\n
\n
\n
\n
\n\n
\n \n
\n \n
\n
\n\n
\n \n
\n \n
\n \n
\n \n
\n
\n \n
\n
\n
\n \n
\n \n \n \n
\n
\n
\n
\n\n'); -$templateCache.put('components/plugin-amps/view.html','
\n
\n
\n
{{ process.name }}
\n
{{ process.count }}
\n
{{ process.result }}
\n
\n
\n
\n'); +angular.module('glancesApp').run(['$templateCache', function($templateCache) {$templateCache.put('components/glances/view.html','
\n
\n \n
Loading...
\n
\n\n \n\n
\n
\n
\n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n
\n
\n
\n \n
\n
\n
\n
\n
\n\n
\n \n
\n \n
\n
\n \n
\n \n
\n \n
\n \n
\n \n
\n
\n \n
\n
\n
\n \n
\n \n \n \n
\n
\n
\n
\n\n'); +$templateCache.put('components/help/view.html','
\n
\n
{{vm.help.version}} {{vm.help.psutil_version}}
\n
\n
 
\n
\n
{{vm.help.configuration_file}}
\n
\n
 
\n
\n
{{vm.help.sort_auto}}
\n
{{vm.help.sort_network}}
\n
\n
\n
{{vm.help.sort_cpu}}
\n
{{vm.help.show_hide_alert}}
\n
\n
\n
{{vm.help.sort_mem}}
\n
{{vm.help.percpu}}
\n
\n
\n
{{vm.help.sort_user}}
\n
{{vm.help.show_hide_ip}}
\n
\n
\n
{{vm.help.sort_proc}}
\n
{{vm.help.enable_disable_docker}}
\n
\n
\n
{{vm.help.sort_io}}
\n
{{vm.help.view_network_io_combination}}
\n
\n
\n
{{vm.help.sort_cpu_times}}
\n
{{vm.help.view_cumulative_network}}
\n
\n
\n
{{vm.help.show_hide_diskio}}
\n
{{vm.help.show_hide_filesytem_freespace}}
\n
\n
\n
{{vm.help.show_hide_filesystem}}
\n
{{vm.help.show_hide_vm.help}}
\n
\n
\n
{{vm.help.show_hide_network}}
\n
{{vm.help.diskio_iops}}
\n
\n
\n
{{vm.help.show_hide_sensors}}
\n
{{vm.help.show_hide_top_menu}}
\n
\n
\n
{{vm.help.show_hide_left_sidebar}}
\n
{{vm.help.show_hide_amp}}
\n
\n
\n
{{vm.help.enable_disable_process_stats}}
\n
{{vm.help.show_hide_irq}}
\n
\n
\n
{{vm.help.enable_disable_gpu}}
\n
{{vm.help.enable_disable_mean_gpu}}
\n
\n
\n
{{vm.help.enable_disable_quick_look}}
\n
\n
\n
\n
{{vm.help.enable_disable_short_processname}}
\n
\n
\n
\n
{{vm.help.enable_disable_ports}}
\n
\n
\n\n
\n'); $templateCache.put('components/plugin-alert/view.html','
\n No warning or critical alert detected\n Warning or critical alerts (lasts {{vm.count()}} entries)\n
\n
\n
\n
\n
\n {{alert.begin | date : \'yyyy-MM-dd H:mm:ss\'}} ({{ alert.ongoing ? \'ongoing\' : alert.duration }}) - {{alert.level}} on {{alert.name}} ({{alert.max}})\n
\n
\n
\n
\n'); +$templateCache.put('components/plugin-amps/view.html','
\n
\n
\n
{{ process.name }}
\n
{{ process.count }}
\n
{{ process.result }}
\n
\n
\n
\n'); $templateCache.put('components/plugin-cloud/view.html','
\n {{ vm.provider }} {{ vm.instance }}\n
\n'); $templateCache.put('components/plugin-cpu/view.html','
\n
\n
\n
\n
\n
CPU
\n
{{ vm.total }}%
\n
\n
\n
user:
\n
\n {{ vm.user }}%\n
\n
\n
\n
system:
\n
\n {{ vm.system }}%\n
\n
\n
\n
idle:
\n
{{ vm.idle }}%
\n
\n
\n
\n \n \n
\n
\n'); $templateCache.put('components/plugin-diskio/view.html','
\n
DISK I/O
\n
R/s
\n
W/s
\n\n
IOR/s
\n
IOW/s
\n
\n
\n
{{(disk.alias ? disk.alias : disk.name) | min_size}}
\n
{{disk.bitrate.txps }}
\n
{{disk.bitrate.rxps }}
\n\n
{{disk.count.txps }}
\n
{{disk.count.rxps }}
\n
\n');