Skip to content

Commit

Permalink
Finish connection plugin of the webUi
Browse files Browse the repository at this point in the history
  • Loading branch information
notFloran committed Dec 1, 2019
1 parent b037e91 commit 4eb1746
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 28 deletions.
1 change: 1 addition & 0 deletions glances/outputs/static/js/components/glances/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export default function GlancesController($scope, GlancesStats, hotkeys, ARGUMEN

$scope.$on('data_refreshed', function (event, data) {
vm.hasGpu = data.stats.gpu.length > 0;
vm.isLinux = data.isLinux;
vm.dataLoaded = true;
});

Expand Down
5 changes: 2 additions & 3 deletions glances/outputs/static/js/components/glances/view.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
<div class="col-sm-6 col-md-4 col-lg-3" ng-if="!vm.arguments.disable_gpu && vm.hasGpu">
<glances-plugin-gpu></glances-plugin-gpu>
</div>
<div class="col-sm-6 col-md-4 col-lg-3" ng-if="!vm.argumentsdisable_mem">
<div class="col-sm-6 col-md-4 col-lg-3" ng-if="!vm.arguments.disable_mem">
<glances-plugin-mem></glances-plugin-mem>
</div>
<div class="col-sm-6 col-md-4 col-lg-3"
Expand All @@ -61,7 +61,7 @@
<div class="col-sm-6 sidebar" ng-if="!vm.arguments.disable_left_sidebar">
<div class="table">
<glances-plugin-network id="plugin-network" class="plugin table-row-group" ng-if="!vm.arguments.disable_network"></glances-plugin-network>
<glances-plugin-connections id="plugin-connections" class="plugin table-row-group" ng-if="!vm.arguments.disable_connections"></glances-plugin-connections>
<glances-plugin-connections id="plugin-connections" class="plugin table-row-group" ng-if="vm.isLinux && !vm.arguments.disable_connections"></glances-plugin-connections>
<glances-plugin-wifi id="plugin-wifi" class="plugin table-row-group" ng-if="!vm.arguments.disable_wifi"></glances-plugin-wifi>
<glances-plugin-ports id="plugin-ports" class="plugin table-row-group" ng-if="!vm.arguments.disable_ports"></glances-plugin-ports>
<glances-plugin-diskio id="plugin-diskio" class="plugin table-row-group" ng-if="!vm.arguments.disable_diskio"></glances-plugin-diskio>
Expand All @@ -80,4 +80,3 @@
</div>
</div>
</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,15 @@ export default function GlancesPluginConnectionsController($scope, GlancesStats)
var stats = data.stats['connections'];
_view = data.views['connections'];

vm.isLinux = data.isLinux;

vm.listen = stats.listen;
vm.initiated = stats.initiated;
vm.established = stats.established;
vm.terminated = stats.terminated;
//vm.tracked = null;
}
vm.listen = stats['LISTEN'];
vm.initiated = stats['initiated'];
vm.established = stats['ESTABLISHED'];
vm.terminated = stats['terminated'];
vm.tracked = {
count: stats['nf_conntrack_count'],
max: stats['nf_conntrack_max'],
};
};

vm.getDecoration = function (value) {
if (_view[value] === undefined) {
Expand Down
32 changes: 26 additions & 6 deletions glances/outputs/static/js/components/plugin-connections/view.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,30 @@
<div class="table-row" ng-if="vm.irqs.length > 0">
<div class="table-cell text-left title">IRQ</div>
<div class="table-row">
<div class="table-cell text-left title">TCP CONNECTIONS</div>
<div class="table-cell"></div>
<div class="table-cell">Rate/s</div>
</div>
<div class="table-row" ng-repeat="irq in vm.irqs">
<div class="table-cell text-left">{{irq.irq_line}}</div>
<div class="table-row">
<div class="table-cell text-left">Listen</div>
<div class="table-cell"></div>
<div class="table-cell"><span>{{irq.irq_rate}}</span></div>
<div class="table-cell">{{vm.listen}}</div>
</div>
<div class="table-row">
<div class="table-cell text-left">Initiated</div>
<div class="table-cell"></div>
<div class="table-cell">{{vm.initiated}}</div>
</div>
<div class="table-row">
<div class="table-cell text-left">Established</div>
<div class="table-cell"></div>
<div class="table-cell">{{vm.established}}</div>
</div>
<div class="table-row">
<div class="table-cell text-left">Terminated</div>
<div class="table-cell"></div>
<div class="table-cell">{{vm.terminated}}</div>
</div>
<div class="table-row">
<div class="table-cell text-left">Tracked</div>
<div class="table-cell"></div>
<div class="table-cell" ng-class="vm.getDecoration('nf_conntrack_percent')">{{vm.tracked.count}}/{{vm.tracked.max}}</div>
</div>

22 changes: 12 additions & 10 deletions glances/outputs/static/public/glances.js
Original file line number Diff line number Diff line change
Expand Up @@ -57237,6 +57237,7 @@ function GlancesController($scope, GlancesStats, hotkeys, ARGUMENTS) {

$scope.$on('data_refreshed', function (event, data) {
vm.hasGpu = data.stats.gpu.length > 0;
vm.isLinux = data.isLinux;
vm.dataLoaded = true;
});

Expand Down Expand Up @@ -57459,7 +57460,7 @@ function GlancesController($scope, GlancesStats, hotkeys, ARGUMENTS) {
/***/ (function(module, exports) {

var path = '/Users/floranbrutel/dev/glances/glances/outputs/static/js/components/glances/view.html';
var html = "<div>\n <div ng-if=\"!vm.dataLoaded\" class=\"container-fluid\" id=\"loading-page\">\n <div class=\"glances-logo\"></div>\n <div class=\"loader\">Loading...</div>\n </div>\n\n <glances-help ng-if=\"vm.arguments.help_tag\"></glances-help>\n\n <div ng-if=\"vm.dataLoaded && !vm.arguments.help_tag\" class=\"container-fluid\">\n <div class=\"top-plugin\">\n <div class=\"row\">\n <div class=\"col-sm-24\">\n <div class=\"pull-left\">\n <glances-plugin-system></glances-plugin-system>\n </div>\n <div class=\"pull-left\">\n <glances-plugin-ip></glances-plugin-ip>\n </div>\n <div class=\"pull-right\">\n <glances-plugin-uptime></glances-plugin-uptime>\n </div>\n </div>\n <div class=\"row\">\n <div class=\"col-sm-24\">\n <div class=\"pull-left\">\n <glances-plugin-cloud></glances-plugin-cloud>\n </div>\n </div>\n </div>\n </div>\n </div>\n\n <div class=\"row\">\n <div class=\"hidden-xs hidden-sm hidden-md col-lg-6\" ng-if=\"!vm.arguments.disable_quicklook\">\n <glances-plugin-quicklook></glances-plugin-quicklook>\n </div>\n <div class=\"col-sm-6 col-md-8 col-lg-6\" ng-if=\"!vm.arguments.disable_cpu && !vm.arguments.percpu\">\n <glances-plugin-cpu></glances-plugin-cpu>\n </div>\n <div class=\"col-sm-12 col-md-8 col-lg-6\" ng-if=\"!vm.arguments.disable_cpu && vm.arguments.percpu\">\n <glances-plugin-percpu></glances-plugin-percpu>\n </div>\n <div class=\"col-sm-6 col-md-4 col-lg-3\" ng-if=\"!vm.arguments.disable_gpu && vm.hasGpu\">\n <glances-plugin-gpu></glances-plugin-gpu>\n </div>\n <div class=\"col-sm-6 col-md-4 col-lg-3\" ng-if=\"!vm.argumentsdisable_mem\">\n <glances-plugin-mem></glances-plugin-mem>\n </div>\n <div class=\"col-sm-6 col-md-4 col-lg-3\"\n ng-if=\"!vm.arguments.disable_mem && !(!vm.arguments.disable_gpu && vm.hasGpu)\">\n <glances-plugin-mem-more></glances-plugin-mem-more>\n </div>\n <div class=\"col-sm-6 col-md-4 col-lg-3\" ng-if=\"!vm.arguments.disable_memswap\">\n <glances-plugin-memswap></glances-plugin-memswap>\n </div>\n <div class=\"col-sm-6 col-md-4 col-lg-3\" ng-if=\"!vm.arguments.disable_load\">\n <glances-plugin-load></glances-plugin-load>\n </div>\n </div>\n <div class=\"row\">\n <div class=\"col-sm-6 sidebar\" ng-if=\"!vm.arguments.disable_left_sidebar\">\n <div class=\"table\">\n <glances-plugin-network id=\"plugin-network\" class=\"plugin table-row-group\" ng-if=\"!vm.arguments.disable_network\"></glances-plugin-network>\n <glances-plugin-connections id=\"plugin-connections\" class=\"plugin table-row-group\" ng-if=\"!vm.arguments.disable_connections\"></glances-plugin-connections>\n <glances-plugin-wifi id=\"plugin-wifi\" class=\"plugin table-row-group\" ng-if=\"!vm.arguments.disable_wifi\"></glances-plugin-wifi>\n <glances-plugin-ports id=\"plugin-ports\" class=\"plugin table-row-group\" ng-if=\"!vm.arguments.disable_ports\"></glances-plugin-ports>\n <glances-plugin-diskio id=\"plugin-diskio\" class=\"plugin table-row-group\" ng-if=\"!vm.arguments.disable_diskio\"></glances-plugin-diskio>\n <glances-plugin-fs id=\"plugin-fs\" class=\"plugin table-row-group\" ng-if=\"!vm.arguments.disable_fs\"></glances-plugin-fs>\n <glances-plugin-irq id=\"plugin-irq\" class=\"plugin table-row-group\" ng-if=\"vm.arguments.enable_irq\"></glances-plugin-irq>\n <glances-plugin-folders id=\"plugin-folders\" class=\"plugin table-row-group\" ng-if=\"!vm.arguments.disable_folders\"></glances-plugin-folders>\n <glances-plugin-raid id=\"plugin-raid\" class=\"plugin table-row-group\" ng-if=\"!vm.arguments.raid\"></glances-plugin-raid>\n <glances-plugin-sensors id=\"plugin-sensors\" class=\"plugin table-row-group\" ng-if=\"!vm.arguments.disable_sensors\"></glances-plugin-sensors>\n </div>\n </div>\n <div class=\"col-sm-18\">\n <glances-plugin-docker ng-if=\"!vm.arguments.disable_docker\"></glances-plugin-docker>\n <glances-plugin-alert ng-if=\"!vm.arguments.disable_alert\"></glances-plugin-alert>\n <glances-plugin-process></glances-plugin-process>\n </div>\n </div>\n </div>\n</div>\n</div>\n";
var html = "<div>\n <div ng-if=\"!vm.dataLoaded\" class=\"container-fluid\" id=\"loading-page\">\n <div class=\"glances-logo\"></div>\n <div class=\"loader\">Loading...</div>\n </div>\n\n <glances-help ng-if=\"vm.arguments.help_tag\"></glances-help>\n\n <div ng-if=\"vm.dataLoaded && !vm.arguments.help_tag\" class=\"container-fluid\">\n <div class=\"top-plugin\">\n <div class=\"row\">\n <div class=\"col-sm-24\">\n <div class=\"pull-left\">\n <glances-plugin-system></glances-plugin-system>\n </div>\n <div class=\"pull-left\">\n <glances-plugin-ip></glances-plugin-ip>\n </div>\n <div class=\"pull-right\">\n <glances-plugin-uptime></glances-plugin-uptime>\n </div>\n </div>\n <div class=\"row\">\n <div class=\"col-sm-24\">\n <div class=\"pull-left\">\n <glances-plugin-cloud></glances-plugin-cloud>\n </div>\n </div>\n </div>\n </div>\n </div>\n\n <div class=\"row\">\n <div class=\"hidden-xs hidden-sm hidden-md col-lg-6\" ng-if=\"!vm.arguments.disable_quicklook\">\n <glances-plugin-quicklook></glances-plugin-quicklook>\n </div>\n <div class=\"col-sm-6 col-md-8 col-lg-6\" ng-if=\"!vm.arguments.disable_cpu && !vm.arguments.percpu\">\n <glances-plugin-cpu></glances-plugin-cpu>\n </div>\n <div class=\"col-sm-12 col-md-8 col-lg-6\" ng-if=\"!vm.arguments.disable_cpu && vm.arguments.percpu\">\n <glances-plugin-percpu></glances-plugin-percpu>\n </div>\n <div class=\"col-sm-6 col-md-4 col-lg-3\" ng-if=\"!vm.arguments.disable_gpu && vm.hasGpu\">\n <glances-plugin-gpu></glances-plugin-gpu>\n </div>\n <div class=\"col-sm-6 col-md-4 col-lg-3\" ng-if=\"!vm.arguments.disable_mem\">\n <glances-plugin-mem></glances-plugin-mem>\n </div>\n <div class=\"col-sm-6 col-md-4 col-lg-3\"\n ng-if=\"!vm.arguments.disable_mem && !(!vm.arguments.disable_gpu && vm.hasGpu)\">\n <glances-plugin-mem-more></glances-plugin-mem-more>\n </div>\n <div class=\"col-sm-6 col-md-4 col-lg-3\" ng-if=\"!vm.arguments.disable_memswap\">\n <glances-plugin-memswap></glances-plugin-memswap>\n </div>\n <div class=\"col-sm-6 col-md-4 col-lg-3\" ng-if=\"!vm.arguments.disable_load\">\n <glances-plugin-load></glances-plugin-load>\n </div>\n </div>\n <div class=\"row\">\n <div class=\"col-sm-6 sidebar\" ng-if=\"!vm.arguments.disable_left_sidebar\">\n <div class=\"table\">\n <glances-plugin-network id=\"plugin-network\" class=\"plugin table-row-group\" ng-if=\"!vm.arguments.disable_network\"></glances-plugin-network>\n <glances-plugin-connections id=\"plugin-connections\" class=\"plugin table-row-group\" ng-if=\"vm.isLinux && !vm.arguments.disable_connections\"></glances-plugin-connections>\n <glances-plugin-wifi id=\"plugin-wifi\" class=\"plugin table-row-group\" ng-if=\"!vm.arguments.disable_wifi\"></glances-plugin-wifi>\n <glances-plugin-ports id=\"plugin-ports\" class=\"plugin table-row-group\" ng-if=\"!vm.arguments.disable_ports\"></glances-plugin-ports>\n <glances-plugin-diskio id=\"plugin-diskio\" class=\"plugin table-row-group\" ng-if=\"!vm.arguments.disable_diskio\"></glances-plugin-diskio>\n <glances-plugin-fs id=\"plugin-fs\" class=\"plugin table-row-group\" ng-if=\"!vm.arguments.disable_fs\"></glances-plugin-fs>\n <glances-plugin-irq id=\"plugin-irq\" class=\"plugin table-row-group\" ng-if=\"vm.arguments.enable_irq\"></glances-plugin-irq>\n <glances-plugin-folders id=\"plugin-folders\" class=\"plugin table-row-group\" ng-if=\"!vm.arguments.disable_folders\"></glances-plugin-folders>\n <glances-plugin-raid id=\"plugin-raid\" class=\"plugin table-row-group\" ng-if=\"!vm.arguments.raid\"></glances-plugin-raid>\n <glances-plugin-sensors id=\"plugin-sensors\" class=\"plugin table-row-group\" ng-if=\"!vm.arguments.disable_sensors\"></glances-plugin-sensors>\n </div>\n </div>\n <div class=\"col-sm-18\">\n <glances-plugin-docker ng-if=\"!vm.arguments.disable_docker\"></glances-plugin-docker>\n <glances-plugin-alert ng-if=\"!vm.arguments.disable_alert\"></glances-plugin-alert>\n <glances-plugin-process></glances-plugin-process>\n </div>\n </div>\n </div>\n</div>\n";
window.angular.module('ng').run(['$templateCache', function(c) { c.put(path, html) }]);
module.exports = path;

Expand Down Expand Up @@ -57814,14 +57815,15 @@ function GlancesPluginConnectionsController($scope, GlancesStats) {
var stats = data.stats['connections'];
_view = data.views['connections'];

vm.isLinux = data.isLinux;

vm.listen = stats.listen;
vm.initiated = stats.initiated;
vm.established = stats.established;
vm.terminated = stats.terminated;
//vm.tracked = null;
}
vm.listen = stats['LISTEN'];
vm.initiated = stats['initiated'];
vm.established = stats['ESTABLISHED'];
vm.terminated = stats['terminated'];
vm.tracked = {
count: stats['nf_conntrack_count'],
max: stats['nf_conntrack_max'],
};
};

vm.getDecoration = function (value) {
if (_view[value] === undefined) {
Expand All @@ -57838,7 +57840,7 @@ function GlancesPluginConnectionsController($scope, GlancesStats) {
/***/ (function(module, exports) {

var path = '/Users/floranbrutel/dev/glances/glances/outputs/static/js/components/plugin-connections/view.html';
var html = "<div class=\"table-row\" ng-if=\"vm.irqs.length > 0\">\n <div class=\"table-cell text-left title\">IRQ</div>\n <div class=\"table-cell\"></div>\n <div class=\"table-cell\">Rate/s</div>\n</div>\n<div class=\"table-row\" ng-repeat=\"irq in vm.irqs\">\n <div class=\"table-cell text-left\">{{irq.irq_line}}</div>\n <div class=\"table-cell\"></div>\n <div class=\"table-cell\"><span>{{irq.irq_rate}}</span></div>\n</div>\n";
var html = "<div class=\"table-row\">\n <div class=\"table-cell text-left title\">TCP CONNECTIONS</div>\n <div class=\"table-cell\"></div>\n</div>\n<div class=\"table-row\">\n <div class=\"table-cell text-left\">Listen</div>\n <div class=\"table-cell\"></div>\n <div class=\"table-cell\">{{vm.listen}}</div>\n</div>\n<div class=\"table-row\">\n <div class=\"table-cell text-left\">Initiated</div>\n <div class=\"table-cell\"></div>\n <div class=\"table-cell\">{{vm.initiated}}</div>\n</div>\n<div class=\"table-row\">\n <div class=\"table-cell text-left\">Established</div>\n <div class=\"table-cell\"></div>\n <div class=\"table-cell\">{{vm.established}}</div>\n</div>\n<div class=\"table-row\">\n <div class=\"table-cell text-left\">Terminated</div>\n <div class=\"table-cell\"></div>\n <div class=\"table-cell\">{{vm.terminated}}</div>\n</div>\n<div class=\"table-row\">\n <div class=\"table-cell text-left\">Tracked</div>\n <div class=\"table-cell\"></div>\n <div class=\"table-cell\" ng-class=\"vm.getDecoration('nf_conntrack_percent')\">{{vm.tracked.count}}/{{vm.tracked.max}}</div>\n</div>\n\n";
window.angular.module('ng').run(['$templateCache', function(c) { c.put(path, html) }]);
module.exports = path;

Expand Down
2 changes: 1 addition & 1 deletion glances/outputs/static/public/glances.map.js

Large diffs are not rendered by default.

0 comments on commit 4eb1746

Please sign in to comment.