Skip to content

Commit

Permalink
Sensors update on menu click
Browse files Browse the repository at this point in the history
  • Loading branch information
pvgennip committed May 29, 2019
1 parent c7b6d38 commit 918b4e7
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
6 changes: 6 additions & 0 deletions public/app/js/angular-code.js
Original file line number Diff line number Diff line change
Expand Up @@ -3682,6 +3682,12 @@ app.controller('SensorsCtrl', function ($scope, $rootScope, $timeout, $interval,
$scope.updateSensors = function () {
$scope.sensortypes = settings.sensortypes;
$scope.sensors = measurements.sensors;

if ($scope.sensors.length == 0) {
measurements.loadRemoteSensors();
return;
}

$scope.hives = hives.hives;

for (var i = $scope.sensors.length - 1; i >= 0; i--) {
Expand Down
2 changes: 1 addition & 1 deletion public/mix-manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@
"/app/js/angular-helpers.js": "/app/js/angular-helpers.js?id=2098021eeae06581d4b9",
"/app/js/angular-index.js": "/app/js/angular-index.js?id=dc0d1ff2ae859b3ac9e0",
"/app/js/angular-directives.js": "/app/js/angular-directives.js?id=4b7fadbe055533d37a96",
"/app/js/angular-code.js": "/app/js/angular-code.js?id=7b7fc2ebe115b2324510"
"/app/js/angular-code.js": "/app/js/angular-code.js?id=ec6a4729e124e510594c"
}
7 changes: 7 additions & 0 deletions resources/assets/js/controllers/sensors.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,13 @@ app.controller('SensorsCtrl', function($scope, $rootScope, $timeout, $interval,
{
$scope.sensortypes = settings.sensortypes;
$scope.sensors = measurements.sensors;

if ($scope.sensors.length == 0)
{
measurements.loadRemoteSensors();
return;
}

$scope.hives = hives.hives;

for (var i = $scope.sensors.length - 1; i >= 0; i--)
Expand Down

0 comments on commit 918b4e7

Please sign in to comment.