summaryrefslogtreecommitdiff
path: root/www
diff options
context:
space:
mode:
Diffstat (limited to 'www')
-rw-r--r--www/js/MonitorCtrl.js30
-rwxr-xr-xwww/js/app.js4
-rw-r--r--www/templates/monitors.html2
3 files changed, 17 insertions, 19 deletions
diff --git a/www/js/MonitorCtrl.js b/www/js/MonitorCtrl.js
index 0ed5883c..7fc2cec2 100644
--- a/www/js/MonitorCtrl.js
+++ b/www/js/MonitorCtrl.js
@@ -6,11 +6,12 @@
// refer to comments in EventCtrl for the modal stuff. They are almost the same
angular.module('zmApp.controllers')
- .controller('zmApp.MonitorCtrl', ['$ionicPopup', 'zm', '$scope', 'NVRDataModel', 'message', '$ionicSideMenuDelegate', '$ionicLoading', '$ionicModal', '$state', '$http', '$rootScope', '$timeout', '$ionicHistory', '$ionicPlatform', '$translate', '$q',
- function ($ionicPopup, zm, $scope, NVRDataModel, message, $ionicSideMenuDelegate, $ionicLoading, $ionicModal, $state, $http, $rootScope, $timeout, $ionicHistory, $ionicPlatform, $translate, $q) {
+ .controller('zmApp.MonitorCtrl', ['$ionicPopup', 'zm', '$scope', 'NVRDataModel', '$ionicSideMenuDelegate', '$ionicLoading', '$ionicModal', '$state', '$http', '$rootScope', '$timeout', '$ionicHistory', '$ionicPlatform', '$translate', '$q',
+ function ($ionicPopup, zm, $scope, NVRDataModel, $ionicSideMenuDelegate, $ionicLoading, $ionicModal, $state, $http, $rootScope, $timeout, $ionicHistory, $ionicPlatform, $translate, $q) {
var loginData;
+ $scope.monitorLoadStatus = "...";
// --------------------------------------------------------
// Handling of back button in case modal is open should
@@ -269,24 +270,15 @@ angular.module('zmApp.controllers')
$scope.$on('$ionicView.afterEnter', function () {
// console.log("**VIEW ** Monitor Ctrl Entered");
+
+ NVRDataModel.debug ("Monitor Control afterEnter");
$scope.monitors = [];
- $scope.monitors = message;
+ $scope.monitorLoadStatus = $translate.instant ('kPleaseWait')+'...';
+
//console.log (">>>>>>>>>>>> MONITOR CTRL " + JSON.stringify($scope.monitors));
- if ($scope.monitors.length == 0) {
- $rootScope.zmPopup = $ionicPopup.alert({
- title: $translate.instant('kNoMonitors'),
- template: $translate.instant('kPleaseCheckCredentials')
- });
- $ionicHistory.nextViewOptions({
- disableBack: true
- });
- $state.go("app.login", {
- "wizard": false
- });
- return;
- }
+
loginData = NVRDataModel.getLogin();
monitorStateCheck();
@@ -416,6 +408,11 @@ angular.module('zmApp.controllers')
.then (function (data) {
$scope.monitors = data;
+
+ if (!$scope.monitors.length) {
+ $scope.monitorLoadStatus = $translate.instant ('kNoMonitors');
+ }
+
if (!$scope.monitors[0].Monitor_Status ) {
NVRDataModel.debug ("no Monitor_Status found reverting to daemonCheck...");
forceDaemonCheck();
@@ -428,6 +425,7 @@ angular.module('zmApp.controllers')
},
function (err) {
NVRDataModel.debug ("Monitor fetch error, reverting to daemonCheck...");
+ $scope.monitorLoadStatus = $translate.instant ('kNoMonitors');
forceDaemonCheck();
});
diff --git a/www/js/app.js b/www/js/app.js
index 74f7d0cf..696006dd 100755
--- a/www/js/app.js
+++ b/www/js/app.js
@@ -2539,12 +2539,12 @@ angular.module('zmApp', [
data: {
requireLogin: true
},
- resolve: {
+ /*resolve: {
message: function (NVRDataModel) {
// console.log("Inside app.montage resolve");
return NVRDataModel.getMonitors(0);
}
- },
+ },*/
url: "/monitors",
cache: false,
templateUrl: "templates/monitors.html",
diff --git a/www/templates/monitors.html b/www/templates/monitors.html
index 0f9df892..5da6b8db 100644
--- a/www/templates/monitors.html
+++ b/www/templates/monitors.html
@@ -64,7 +64,7 @@
</div>
</div>
<ion-item ng-show="!monitors.length">
- {{'kNoMonitors' | translate}}
+ {{monitorLoadStatus}}
</ion-item>
</ion-content>
</ion-view>