From 2e108cb1ec4f767a0467f2a2c14374017a88fef6 Mon Sep 17 00:00:00 2001 From: Heikki Hannikainen Date: Tue, 2 Aug 2016 10:01:21 +0300 Subject: [PATCH] status: Implement graph switching --- src/web/aprsc-graph.js | 8 ++++---- src/web/aprsc.js | 2 ++ src/web/index.html | 4 ++-- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/web/aprsc-graph.js b/src/web/aprsc-graph.js index e128cf2..90637d7 100644 --- a/src/web/aprsc-graph.js +++ b/src/web/aprsc-graph.js @@ -84,12 +84,12 @@ var graph_module = angular.module('graph', [ ]). }); }; - instance.gr_switch = function($scope, id) { + instance.gr_switch = function(id) { instance.graph_selected = id; instance.range_selected = false; - $scope.graph_zoomed = false; + instance.scope.graph_zoomed = false; $('#graph').trigger('plotunselected'); - instance.load_graph($scope); + instance.load_graph(instance.scope); }; instance.graph_zoom = function(zoom_in) { @@ -112,7 +112,7 @@ var graph_module = angular.module('graph', [ ]). instance.graph_setup = function($scope) { instance.scope = $scope; - instance.gr_switch($scope, 'totals.tcp_bytes_rx'); + instance.gr_switch('totals.tcp_bytes_rx'); $('#graph').bind('plotselected', function(event,ranges) { var to = parseInt(ranges.xaxis.to.toFixed(0)); diff --git a/src/web/aprsc.js b/src/web/aprsc.js index 478fb43..ccc26ea 100644 --- a/src/web/aprsc.js +++ b/src/web/aprsc.js @@ -1031,7 +1031,9 @@ app.controller('aprscc', [ '$scope', '$http', 'graphs', function($scope, $http, 'cols_clients': cols_clients }; + /* graph zooming and switching */ $scope.graphZoom = graphs.graph_zoom; + $scope.graphSwitch = function(tree, key) { graphs.gr_switch(tree + '.' + key); }; /* set up sorting for client and peer lists */ $scope.clients_sort = { diff --git a/src/web/index.html b/src/web/index.html index 58a3237..e3160e7 100644 --- a/src/web/index.html +++ b/src/web/index.html @@ -57,7 +57,7 @@
- + @@ -78,7 +78,7 @@
{{ setup.key_translate[k] }} {{ status.totals[k] }} {{ (status.totals[k] - status_prev.totals[k]) / status.tick_dif | ratestr}}/s
- +
{{ setup.key_translate[k] }} {{ status.dupecheck[k] }} {{ (status.dupecheck[k] - status_prev.dupecheck[k]) / status.tick_dif | ratestr}}/s