diff options
| author | PliablePixels <pliablepixels@gmail.com> | 2015-09-11 16:26:13 +0100 |
|---|---|---|
| committer | PliablePixels <pliablepixels@gmail.com> | 2015-09-11 16:26:13 +0100 |
| commit | d6189d6f85897be4250ca4b87f21f6113a10b68c (patch) | |
| tree | 6cc9800feee796ae11bacc0a7506b96b5a172709 | |
| parent | 6fa4b725624feba76031e7354a4d94aed5339957 (diff) | |
Enabled a run time debug mode so I can see more details when testers report quirky bugs. It's in developer options.
| -rw-r--r-- | www/js/DataModel.js | 36 | ||||
| -rw-r--r-- | www/js/DevOptionsCtrl.js | 7 | ||||
| -rw-r--r-- | www/js/EventCtrl.js | 42 | ||||
| -rw-r--r-- | www/js/EventDateTimeFilterCtrl.js | 8 | ||||
| -rw-r--r-- | www/js/EventsGraphsCtrl.js | 6 | ||||
| -rw-r--r-- | www/js/LoginCtrl.js | 4 | ||||
| -rw-r--r-- | www/js/ModalCtrl.js | 23 | ||||
| -rw-r--r-- | www/js/MonitorCtrl.js | 18 | ||||
| -rw-r--r-- | www/js/MontageCtrl.js | 33 | ||||
| -rw-r--r-- | www/js/PortalLoginCtrl.js | 11 | ||||
| -rw-r--r-- | www/js/StateCtrl.js | 21 | ||||
| -rw-r--r-- | www/js/TimelineCtrl.js | 46 | ||||
| -rw-r--r-- | www/js/app.js | 22 | ||||
| -rw-r--r-- | www/js/controllers.js | 2 | ||||
| -rw-r--r-- | www/templates/devoptions.html | 6 |
15 files changed, 183 insertions, 102 deletions
diff --git a/www/js/DataModel.js b/www/js/DataModel.js index 25fd0aed..ae4bee12 100644 --- a/www/js/DataModel.js +++ b/www/js/DataModel.js @@ -27,19 +27,27 @@ angular.module('zmApp.controllers').service('ZMDataModel', ['$http', '$q', '$ion 'keepAwake':true, // don't dim/dim during live view 'isUseAuth':true, // true if user wants ZM auth 'refreshSec':"1", // timer value for frame change in sec + 'enableDebug':false, // if enabled with log messages with "debug" }; var configParams = { 'ZM_EVENT_IMAGE_DIGITS':'-1' }; //-------------------------------------------------------------------------- - // uses fileLogger to write logs to file for later investigation + // uses fileLogger to write logs to file for later investigation //-------------------------------------------------------------------------- function zmLog(val,logtype) { $fileLogger.log(logtype, val); } + // separate out a debug so we don't do this if comparison for normal logs + function zmDebug(val) + { + if (loginData.enableDebug) + $fileLogger.debug(val); + } + //-------------------------------------------------------------------------- // Banner display of messages @@ -74,6 +82,12 @@ angular.module('zmApp.controllers').service('ZMDataModel', ['$http', '$q', '$ion zmLog(val,logtype); }, + + zmDebug: function (val) + { + + zmDebug(val); + }, // This function is called when the app is ready to run // sets up various variables @@ -87,10 +101,21 @@ angular.module('zmApp.controllers').service('ZMDataModel', ['$http', '$q', '$ion console.log("****** DATAMODEL INIT SERVICE CALLED ********"); zmLog("ZMData init: checking for stored variables & setting up log file"); - + + if (window.localStorage.getItem("enableDebug") != undefined) { + var dbgvalue = window.localStorage.getItem("enableDebug"); + loginData.enableDebug = (dbgvalue == "1") ? true:false; + zmLog("enableDebug is ON"); + + } + else + { + zmLog ("enableDebug is OFF"); + } if (window.localStorage.getItem("isUseAuth") != undefined) { loginData.isUseAuth = window.localStorage.getItem("isUseAuth"); + } else @@ -175,6 +200,8 @@ angular.module('zmApp.controllers').service('ZMDataModel', ['$http', '$q', '$ion console.log("useSSL " + loginData.useSSL); } + + if (window.localStorage.getItem("keepAwake") != undefined) { var awakevalue = window.localStorage.getItem("keepAwake"); @@ -185,6 +212,7 @@ angular.module('zmApp.controllers').service('ZMDataModel', ['$http', '$q', '$ion monitorsLoaded = 0; console.log("Getting out of ZMDataModel init"); + zmDebug ( "loginData structure values: " + JSON.stringify(loginData)); }, @@ -256,6 +284,7 @@ angular.module('zmApp.controllers').service('ZMDataModel', ['$http', '$q', '$ion setLogin: function (newLogin) { loginData = newLogin; zmLog("Saving all parameters to storage"); + zmDebug ("DataModel/setLogin: writing " + JSON.stringify(newLogin)); window.localStorage.setItem("username", loginData.username); window.localStorage.setItem("password", loginData.password); @@ -263,6 +292,7 @@ angular.module('zmApp.controllers').service('ZMDataModel', ['$http', '$q', '$ion window.localStorage.setItem("apiurl", loginData.apiurl); window.localStorage.setItem("streamingurl", loginData.streamingurl); window.localStorage.setItem("useSSL", loginData.useSSL?"1":"0"); + window.localStorage.setItem("enableDebug", loginData.enableDebug?"1":"0"); window.localStorage.setItem("keepAwake", loginData.keepAwake?"1":"0"); window.localStorage.setItem("maxMontage", loginData.maxMontage); window.localStorage.setItem("montageQuality", loginData.montageQuality); @@ -335,7 +365,7 @@ angular.module('zmApp.controllers').service('ZMDataModel', ['$http', '$q', '$ion // Skipping monitor number as I only need an auth key // so no need to generate an image var myurl =loginData.url+"/index.php?view=watch"; - console.log ("Getting auth from " + myurl); + zmDebug ("DataModel: Getting auth from " + myurl); $http.get (myurl) .then (function (success) { // console.log ("**** RESULT IS " + JSON.stringify(success)); diff --git a/www/js/DevOptionsCtrl.js b/www/js/DevOptionsCtrl.js index 1a857cda..b711a373 100644 --- a/www/js/DevOptionsCtrl.js +++ b/www/js/DevOptionsCtrl.js @@ -25,13 +25,14 @@ angular.module('zmApp.controllers').controller('zmApp.DevOptionsCtrl', ['$scope' // Perform the login action when the user submits the login form //------------------------------------------------------------------ $scope.saveDevOptions = function () { - console.log('Saving Dev Options'); + ZMDataModel.zmDebug ("SaveDevOptions: called"); if (parseInt($scope.loginData.maxMontage) > zm.safeMontageLimit) { $ionicPopup.alert({ title: 'Note', template: 'You have selected to view more than 10 monitors in the Montage screen. Note that this is very resource intensive and may load the server or cause issues in the application. If you are not sure, please consider limiting this value to 10' }); + ZMDataModel.zmDebug ("SaveDevOptions: " + $scope.loginData.maxMontage + " monitors for montage"); } @@ -41,7 +42,9 @@ angular.module('zmApp.controllers').controller('zmApp.DevOptionsCtrl', ['$scope' if (parseInt($scope.loginData.refeshSec) <=0) { + ZMDataModel.zmDebug ("SaveDevOptions: refresh sec was too low at " + $scope.loginData.refreshSec+ " reset to 1"); $scope.loginData.refreshSec=1; + } @@ -50,7 +53,7 @@ angular.module('zmApp.controllers').controller('zmApp.DevOptionsCtrl', ['$scope' } - + ZMDataModel.zmDebug ("SaveDevOptions: Saving to disk"); ZMDataModel.setLogin($scope.loginData); $ionicPopup.alert({ diff --git a/www/js/EventCtrl.js b/www/js/EventCtrl.js index e59bad3a..13e02a40 100644 --- a/www/js/EventCtrl.js +++ b/www/js/EventCtrl.js @@ -110,18 +110,24 @@ angular.module('zmApp.controllers') // First get total pages and then // start from the latest. If this fails, nothing displays - + + ZMDataModel.zmDebug ("EventCtrl: grabbing # of event pages"); ZMDataModel.getEventsPages($scope.id, $rootScope.fromString, $rootScope.toString) .then(function (data) { eventsPage = data.pageCount; - console.log("TOTAL EVENT PAGES IS " + eventsPage); + ZMDataModel.zmDebug ("EventCtrl: found " + eventsPage + " pages of events"); + //console.log("TOTAL EVENT PAGES IS " + eventsPage); pageLoaded = true; $scope.viewTitle.title = data.count; + ZMDataModel.zmDebug ("EventCtrl: grabbing events for: id="+$scope.id+" Date/Time:" + $rootScope.fromString + + "-" + $rootScope.toString); ZMDataModel.getEvents($scope.id, eventsPage, "", $rootScope.fromString, $rootScope.toString) .then(function (data) { console.log("EventCtrl Got events"); //var events = []; + var myevents = data; + ZMDataModel.zmDebug ("EventCtrl: success, got " + myevents.length + " events"); var loginData = ZMDataModel.getLogin(); for (var i = 0; i < myevents.length; i++) { @@ -156,10 +162,15 @@ angular.module('zmApp.controllers') hh + "/" + min + "/" + sec + "/"; + + if (i==0) // just for debug sampling to see what we are getting + { + ZMDataModel.zmDebug ("EventCtrl: Sample data from first event: " + JSON.stringify(myevents[i])); + } - } - + } //for + $scope.events = myevents; // we only need to stop the template from loading when the list is empty // so this can be false once we have _some_ content @@ -167,8 +178,12 @@ angular.module('zmApp.controllers') $scope.eventsBeingLoaded = false; // to avoid only few events being displayed // if last page has less events - console.log("**Loading Next Page ***"); - loadMore(); + //console.log("**Loading Next Page ***"); + if (myevents.length < 50) + { + ZMDataModel.zmDebug("EventCtrl:loading one more page just in case we don't have enough to display"); + loadMore(); + } }); }); @@ -191,7 +206,7 @@ angular.module('zmApp.controllers') $scope.scrollPosition = function () { var scrl = parseFloat($ionicScrollDelegate.$getByHandle("mainScroll").getScrollPosition().top); - var item = Math.round(scrl / 200.0); + var item = Math.round(scrl / zm.eventsListDetailsHeight); if ($scope.events[item] == undefined) { return ""; } else { @@ -204,6 +219,7 @@ angular.module('zmApp.controllers') // called when user switches to background //------------------------------------------------------------------------- function onPause() { + ZMDataModel.zmDebug ("EventCtrl:onpause called"); console.log("*** Moving to Background ***"); // Handle the pause event console.log("*** CANCELLING INTERVAL ****"); $interval.cancel(segmentHandle); @@ -235,7 +251,7 @@ angular.module('zmApp.controllers') // FIXME: Are we using this? //------------------------------------------------------------------------- $scope.disableSlide = function () { - console.log("***INSIDE DISABLE SLIDE"); + ZMDataModel.zmDebug ("EventCtrl:DisableSlide called"); $ionicSlideBoxDelegate.$getByHandle("eventSlideBox").enableSlide(false); }; @@ -277,6 +293,7 @@ angular.module('zmApp.controllers') if (oldEvent && event != oldEvent) { console.log("SWITCHING OLD EVENT OFF"); + ZMDataModel.zmDebug ("EventCtrl:Old event scrub will hide now"); oldEvent.Event.ShowScrub = false; oldEvent.Event.height = zm.eventsListDetailsHeight; oldEvent = ""; @@ -287,6 +304,7 @@ angular.module('zmApp.controllers') if (event.Event.ShowScrub == true) // turn on display now { + ZMDataModel.zmDebug ("EventCtrl: Scrubbing will turn on now"); //$ionicScrollDelegate.freezeScroll(true); $ionicSideMenuDelegate.canDragContent(false); $scope.slider_options = { @@ -298,6 +316,7 @@ angular.module('zmApp.controllers') callback: function (value, released) { //console.log("CALLBACK"+value+released); $ionicScrollDelegate.freezeScroll(!released); + ZMDataModel.zmDebug ("EventCtrl: freezeScroll called with " + !released); }, @@ -333,6 +352,7 @@ angular.module('zmApp.controllers') //console.log("**Resetting range"); $scope.slides = []; var i; + ZMDataModel.zmDebug ("EventCtrl: found " + frames + " frames to scrub"); for (i = 1; i <= frames; i++) { var fname = padToN(i, eventImageDigits) + "-capture.jpg"; $scope.slides.push({ @@ -344,7 +364,7 @@ angular.module('zmApp.controllers') // now get event details to show alarm frames var loginData = ZMDataModel.getLogin(); var myurl = loginData.apiurl + '/events/' + event.Event.Id + ".json"; - ZMDataModel.zmLog("*** Constructed API for detailed events: " + myurl); + ZMDataModel.zmLog("API for event details" + myurl); $http.get(myurl) .success(function (data) { $scope.FrameArray = data.event.Frame; @@ -722,7 +742,7 @@ angular.module('zmApp.controllers') //-------------------------------------------------------- $scope.openModal = function (eid, ename, edur, eframes, basepath, relativepath) { - console.log("Open Modal with Base path " + basepath); + ZMDataModel.zmDebug("EventCtrl: Open Modal with Base path " + relativepath); $scope.eventName = ename; $scope.eventId = eid; $scope.eFramesNum = eframes; @@ -866,7 +886,7 @@ angular.module('zmApp.controllers') $scope.closeModal = function () { // $interval.cancel(eventsInterval); $interval.cancel(segmentHandle); - console.log("Close & Destroy Modal"); + ZMDataModel.zmDebug("EventCtrl:Close & Destroy Modal"); ZMDataModel.setAwake(false); if ($scope.modal !== undefined) { $scope.modal.remove(); diff --git a/www/js/EventDateTimeFilterCtrl.js b/www/js/EventDateTimeFilterCtrl.js index 31ade8dd..66dac51e 100644 --- a/www/js/EventDateTimeFilterCtrl.js +++ b/www/js/EventDateTimeFilterCtrl.js @@ -5,7 +5,7 @@ angular.module('zmApp.controllers') - .controller('zmApp.EventDateTimeFilterCtrl', ['$scope', '$ionicSlideBoxDelegate', '$ionicSideMenuDelegate', '$rootScope', '$ionicHistory', function ($scope, $ionicScrollDelegate,$ionicSideMenuDelegate, $rootScope, $ionicHistory) { + .controller('zmApp.EventDateTimeFilterCtrl', ['$scope', '$ionicSlideBoxDelegate', '$ionicSideMenuDelegate', '$rootScope', '$ionicHistory', 'ZMDataModel', function ($scope, $ionicScrollDelegate,$ionicSideMenuDelegate, $rootScope, $ionicHistory, ZMDataModel) { $scope.removeFilters = function() { @@ -25,18 +25,21 @@ $scope.saveFilters = function() { console.log ("RESET fromDate"); $rootScope.fromDate = new Date(); + ZMDataModel.zmDebug ("DateTimeFilter: resetting from date"); } if (!$rootScope.toDate) { console.log ("RESET toDate"); $rootScope.toDate = new Date(); + ZMDataModel.zmDebug ("DateTimeFilter: resetting to date"); } if (!$rootScope.fromTime) { console.log ("RESET fromTime"); $rootScope.fromTime = new Date(99,5,24,0,0,0,0); //moment().format("hh:mm:ss"); + ZMDataModel.zmDebug ("DateTimeFilter: resetting from time"); } @@ -45,6 +48,7 @@ $scope.saveFilters = function() console.log ("RESET toTime"); $rootScope.toTime =new Date(99,5,24,23,59,59,0); //$rootScope.toTime = "01:01:02"; //moment().format("hh:mm:ss"); + ZMDataModel.zmDebug ("DateTimeFilter: resetting to time"); } @@ -56,7 +60,7 @@ $scope.saveFilters = function() //console.log("CONCAT DATES " + temp); // // var startDate = moment(temp).format("YYYY-MM-DD hh:mm:ss"); - console.log (" DATE IS " + $rootScope.fromString + " AND " +$rootScope.toString); + ZMDataModel.zmDebug ("DateTimeFilter: From/To is now: " + $rootScope.fromString + " & " +$rootScope.toString); $ionicHistory.goBack(); }; diff --git a/www/js/EventsGraphsCtrl.js b/www/js/EventsGraphsCtrl.js index 352b9108..05deb431 100644 --- a/www/js/EventsGraphsCtrl.js +++ b/www/js/EventsGraphsCtrl.js @@ -149,11 +149,11 @@ angular.module('zmApp.controllers').controller('zmApp.EventsGraphsCtrl', ['$ioni "/events/index/MonitorId:" + monitors[j].Monitor.Id + dateString + ".json?page=1"; // console.log("Monitor event URL:" + url); - + ZMDataModel.zmLog ("EventGraph: composed url is " + url); $http.get(url /*,{timeout:15000}*/ ) .success(function (data) { - console.log("**** EVENT COUNT FOR MONITOR " + - monitors[j].Monitor.Id + " IS " + data.pagination.count); + ZMDataModel.zmDebug("Event count for monitor" + + monitors[j].Monitor.Id + " is " + data.pagination.count); $scope.chart.data.datasets[0].data[j] = data.pagination.count; }) .error(function (data) { diff --git a/www/js/LoginCtrl.js b/www/js/LoginCtrl.js index 9bf86e65..b5c409b3 100644 --- a/www/js/LoginCtrl.js +++ b/www/js/LoginCtrl.js @@ -134,8 +134,8 @@ function addhttp(url) { '/cgi-bin/zms?user=' + $scope.loginData.username + "&pass=" + $scope.loginData.password; - console.log("Checking API: " + apiurl + " PORTAL: " + portalurl + " CGI-BIN: " + streamingurl); - ZMDataModel.zmLog ("Checking API: " + apiurl + " PORTAL: " + portalurl + " CGI-BIN: " + streamingurl); + //console.log("Checking API: " + apiurl + " PORTAL: " + portalurl + " CGI-BIN: " + streamingurl); + ZMDataModel.zmLog ("LoginCtrl: API: " + apiurl + " PORTAL: " + portalurl + " CGI-BIN: " + streamingurl); diff --git a/www/js/ModalCtrl.js b/www/js/ModalCtrl.js index 64fdc523..721cd911 100644 --- a/www/js/ModalCtrl.js +++ b/www/js/ModalCtrl.js @@ -31,7 +31,7 @@ angular.module('zmApp.controllers').controller('ModalCtrl', ['$scope', '$rootSco // console.log ("****SHOWING SLIDER"); },2000); - document.addEventListener("pause", onPause, false); + document.addEventListener("pause", onPause, false); document.addEventListener("resume", onResume, false); $rootScope.authSession = "undefined"; @@ -56,7 +56,7 @@ angular.module('zmApp.controllers').controller('ModalCtrl', ['$scope', '$rootSco { $ionicLoading.hide(); - console.log (error); + ZMDataModel.zmDebug ("ModalCtrl: Error details of stream auth:" + error); //$rootScope.authSession=""; ZMDataModel.zmLog ("Modal: Error returned Stream authentication construction. Retaining old value of: " + $rootScope.authSession); }); @@ -183,8 +183,7 @@ angular.module('zmApp.controllers').controller('ModalCtrl', ['$scope', '$rootSco function onPause() { - console.log("*** Modal: Moving to Background ***"); // Handle the pause event - console.log("*** MODAL: CANCELLING INTERVAL ****"); + ZMDataModel.zmDebug ("ModalCtrl: onpause called"); $interval.cancel(intervalModalHandle); // $interval.cancel(modalIntervalHandle); @@ -194,10 +193,10 @@ angular.module('zmApp.controllers').controller('ModalCtrl', ['$scope', '$rootSco function onResume() { - + ZMDataModel.zmDebug("ModalCtrl: Modal resume called"); if ($scope.isModalActive) { - ZMDataModel.zmLog ("MODAL: Restarting Modal timer on resume"); + ZMDataModel.zmLog ("ModalCtrl: Restarting Modal timer on resume"); $interval.cancel(intervalModalHandle); intervalModalHandle= $interval(function () { @@ -321,9 +320,8 @@ function loadModalNotifications() { $scope.onSwipeLeft = function(m,d) { - console.log ("SWIPED LEFT"); - console.log ("Next Monitor ID is " + ZMDataModel.getNextMonitor(m,d)); - $scope.monitorId = ZMDataModel.getNextMonitor(m,d); + ZMDataModel.zmDebug ("ModalCtrl:Left swipe detected, moving to "+ ZMDataModel.getNextMonitor(m,d)); + $scope.monitorId = ZMDataModel.getNextMonitor(m,d); $ionicLoading.hide(); @@ -337,8 +335,7 @@ function loadModalNotifications() { $scope.onSwipeRight = function(m,d) { - console.log ("SWIPED RIGHT"); - console.log ("Next Monitor ID is " + ZMDataModel.getNextMonitor(m,d)); + ZMDataModel.zmDebug ("ModalCtrl:Right swipe detected, moving to "+ ZMDataModel.getNextMonitor(m,d)); $scope.monitorId = ZMDataModel.getNextMonitor(m,d); $ionicLoading.show({ @@ -359,7 +356,7 @@ function loadModalNotifications() { noBackdrop: true, duration: 1000 }); - console.log("***SUCCESS"); + ZMDataModel.zmDebug ("ModalCtrl:Photo saved successfuly"); } function SaveError(e) { @@ -384,7 +381,7 @@ function loadModalNotifications() { duration: zm.httpTimeout }); - console.log("IMAGE CAPTURE INSIDE MODAL"); + ZMDataModel.zmDebug ("ModalCtrl: SaveImageToPhone called"); var canvas, context, imageDataUrl, imageData; var loginData = ZMDataModel.getLogin(); var url = loginData.streamingurl + diff --git a/www/js/MonitorCtrl.js b/www/js/MonitorCtrl.js index f816ec27..165c7c6b 100644 --- a/www/js/MonitorCtrl.js +++ b/www/js/MonitorCtrl.js @@ -87,12 +87,13 @@ angular.module('zmApp.controllers').controller('zmApp.MonitorCtrl', ['$ionicPopu { text: 'Save', onTap: function (e) { - console.log("YOU SELECTED " + $scope.monfunc.myenabled + $scope.monfunc.myfunc); + + ZMDataModel.zmDebug("MonitorCtrl:changeConfig selection:" + $scope.monfunc.myenabled + $scope.monfunc.myfunc); var loginData = ZMDataModel.getLogin(); var apiRestart = loginData.apiurl + "/states/change/restart.json"; var apiMon = loginData.apiurl + "/monitors/" + monitorId + ".json"; - console.log("VARS: " + apiRestart + ">>" + apiMon); + ZMDataModel.zmDebug("MonitorCtrl: URLs for changeConfig save:" + apiRestart + ">>" + apiMon); var isEnabled = ""; isEnabled = ($scope.monfunc.myenabled == true) ? '1' : '0'; @@ -110,7 +111,8 @@ angular.module('zmApp.controllers').controller('zmApp.MonitorCtrl', ['$ionicPopu str.push(encodeURIComponent(p) + "=" + encodeURIComponent(obj[p])); var foo = str.join("&"); - console.log("****RETURNING " + foo); + // console.log("****RETURNING " + foo); + ZMDataModel.zmDebug ("MonitorCtrl: parmeters constructed: " + foo); return foo; }, data: { @@ -123,7 +125,7 @@ angular.module('zmApp.controllers').controller('zmApp.MonitorCtrl', ['$ionicPopu // I am restarting ZM after monitor change // do I need this? FIXME: Ask Kyle .success(function () { - + ZMDataModel.zmDebug ("MonitorCtrl: Restarting ZM"); $ionicLoading.show({ template: "Successfully changed Monitor. Please wait, restarting ZoneMinder...", noBackdrop: true, @@ -147,6 +149,7 @@ angular.module('zmApp.controllers').controller('zmApp.MonitorCtrl', ['$ionicPopu }) .error(function (data, status, headers, config) { + ZMDataModel.zmDebug ("MonitorCtrl: Error changing monitor " + JSON.stringify(data)); $ionicLoading.show({ template: "Error changing Monitor. Please check ZM logs...", noBackdrop: true, @@ -202,7 +205,7 @@ angular.module('zmApp.controllers').controller('zmApp.MonitorCtrl', ['$ionicPopu }); $scope.openModal = function (mid, controllable, controlid) { - console.log("Open Monitor Modal with monitor Id=" + mid + " and Controllable:" + controllable + " with control ID:" + controlid); + ZMDataModel.zmDebug("MonitorCtrl:Open Monitor Modal with monitor Id=" + mid + " and Controllable:" + controllable + " with control ID:" + controlid); $scope.monitorId = mid; @@ -303,9 +306,11 @@ angular.module('zmApp.controllers').controller('zmApp.MonitorCtrl', ['$ionicPopu $scope.monitors[j].Monitor.color = zm.monitorCheckingColor; $scope.monitors[j].Monitor.char = "ion-checkmark-circled"; apiMonCheck = loginData.apiurl + "/monitors/daemonStatus/id:" + $scope.monitors[j].Monitor.Id + "/daemon:zmc.json"; - console.log("**** ZMC CHECK " + apiMonCheck); + ZMDataModel.zmDebug ("MonitorCtrl:monitorStateCheck: " + apiMonCheck); + //console.log("**** ZMC CHECK " + apiMonCheck); $http.get(apiMonCheck) .success(function (data) { + ZMDataModel.zmDebug ("MonitorCtrl: monitor check state returned: " + JSON.stringify(data)); if (data.statustext.indexOf("not running") > -1) { $scope.monitors[j].Monitor.isRunning = "false"; $scope.monitors[j].Monitor.color = zm.monitorNotRunningColor; @@ -326,6 +331,7 @@ angular.module('zmApp.controllers').controller('zmApp.MonitorCtrl', ['$ionicPopu $scope.monitors[j].Monitor.isRunningText = data.statustext; }) .error(function (data) { + ZMDataModel.zmDebug ("MonitorCtrl: Error->monitor check state returned: " + JSON.stringify(data)); ZMDataModel.displayBanner ('error', 'error retrieving state', 'Please try again'); $scope.monitors[j].Monitor.isRunning = "error"; $scope.monitors[j].Monitor.color = zm.monitorErrorColor; diff --git a/www/js/MontageCtrl.js b/www/js/MontageCtrl.js index 3e25ba5a..b91d67e7 100644 --- a/www/js/MontageCtrl.js +++ b/www/js/MontageCtrl.js @@ -80,8 +80,8 @@ angular.module('zmApp.controllers').controller('zmApp.MontageCtrl', ['$scope', ' var myhiddenorder = window.localStorage.getItem("montageHiddenOrder"); - console.log("Montage order is " + myorder); - console.log("Hidden order is " + myhiddenorder); + ZMDataModel.zmDebug("MontageCtrl: Montage order is " + myorder); + ZMDataModel.zmDebug("MontageCtrl: Hidden order is " + myhiddenorder); if (myorder) montageOrder = myorder.split(","); if (myhiddenorder) hiddenOrder = myhiddenorder.split(","); @@ -123,11 +123,6 @@ angular.module('zmApp.controllers').controller('zmApp.MontageCtrl', ['$scope', ' } - ZMDataModel.zmLog("view order is " + montageOrder.toString() + " and hidden order is " + hiddenOrder.toString()); - - - - // Do we have a saved montage array size? No? if (window.localStorage.getItem("montageArraySize") == undefined) { @@ -151,7 +146,6 @@ angular.module('zmApp.controllers').controller('zmApp.MontageCtrl', ['$scope', ' } } - console.log("******** SETTING VARS"); // $scope.monitorSize = monitorSize; // $scope.scaleDirection = scaleDirection; @@ -186,9 +180,9 @@ angular.module('zmApp.controllers').controller('zmApp.MontageCtrl', ['$scope', ' { $ionicLoading.hide(); - console.log (error); + ZMDataModel.zmDebug("MontageCtrl: Error in authkey retrieval " + error); //$rootScope.authSession=""; - ZMDataModel.zmLog ("Modal: Error returned Stream authentication construction. Retaining old value of: " + $rootScope.authSession); + ZMDataModel.zmLog ("MontageCtrl: Error returned Stream authentication construction. Retaining old value of: " + $rootScope.authSession); }); @@ -205,7 +199,7 @@ angular.module('zmApp.controllers').controller('zmApp.MontageCtrl', ['$scope', ' function loadNotifications() { $rootScope.rand = Math.floor((Math.random() * 100000) + 1); - console.log ("Inside Montage timer..."); + // console.log ("Inside Montage timer..."); } @@ -231,7 +225,7 @@ angular.module('zmApp.controllers').controller('zmApp.MontageCtrl', ['$scope', ' $scope.monitors[i].Monitor.listDisplay="show"; }*/ - + ZMDataModel.zmDebug ("MontageCtrl: constructing re-order list using " + JSON.stringify($scope.MontageMonitors)); var getConfig = $ionicPopup.show({ scope: $scope, template: '<ion-scroll><ion-list show-delete="true" show-reorder="true">' + @@ -378,7 +372,7 @@ angular.module('zmApp.controllers').controller('zmApp.MontageCtrl', ['$scope', ' function reorderItem(item, from, to, reorderHidden) { - console.log("FROM " + from + " TO " + to); + ZMDataModel.zmDebug("MontageCtrl: Reorder from " + from + " to " + to); $scope.MontageMonitors.splice(from, 1); $scope.MontageMonitors.splice(to, 0, item); @@ -409,6 +403,7 @@ angular.module('zmApp.controllers').controller('zmApp.MontageCtrl', ['$scope', ' //--------------------------------------------------------------------- $scope.switchMinimal = function () { $scope.minimal = !$scope.minimal; + ZMDataModel.zmDebug ("MontageCtrl: switch minimal is " + $scope.minimal); console.log("Hide Statusbar"); ionic.Platform.fullScreen($scope.minimal, !$scope.minimal); $interval.cancel(intervalHandle); //we will renew on reload @@ -448,7 +443,7 @@ angular.module('zmApp.controllers').controller('zmApp.MontageCtrl', ['$scope', ' // main monitor modal open //--------------------------------------------------------------------- $scope.openModal = function (mid, controllable, controlid) { - console.log("Open Monitor Modal with monitor Id=" + mid + " and Controllable:" + controllable + " with control ID:" + controlid); + ZMDataModel.zmDebug("MontageCtrl: Open Monitor Modal with monitor Id=" + mid + " and Controllable:" + controllable + " with control ID:" + controlid); // $scope.isModalActive = true; // Note: no need to setAwake(true) as its already awake // in montage view @@ -475,12 +470,14 @@ angular.module('zmApp.controllers').controller('zmApp.MontageCtrl', ['$scope', ' // if its controllable, lets get the control command if (controllable == '1') { + ZMDataModel.zmDebug ("MontageCtrl: getting controllable data " + myurl); var apiurl = $scope.LoginData.apiurl; var myurl = apiurl + "/controls/" + controlid + ".json"; - console.log("getting control details:" + myurl); + ZMDataModel.zmDebug ("MontageCtrl: getting controllable data " + myurl); $http.get(myurl) .success(function (data) { + ZMDataModel.zmDebug("MontageCtrl: control data returned " + JSON.stringify(data)); $scope.ptzMoveCommand = (data.control.Control.CanMoveCon == '1') ? 'moveCon' : 'move'; console.log("***moveCommand: " + $scope.ptzMoveCommand); ZMDataModel.zmLog("ControlDB reports PTZ command to be " + $scope.ptzMoveCommand); @@ -522,7 +519,7 @@ angular.module('zmApp.controllers').controller('zmApp.MontageCtrl', ['$scope', ' //--------------------------------------------------------------------- $scope.closeModal = function () { - console.log("Close & Destroy Monitor Modal"); + ZMDataModel.zmDebug("MontageCtrl: Close & Destroy Monitor Modal"); // $scope.isModalActive = false; // Note: no need to setAwake(false) as needs to be awake // in montage view @@ -605,8 +602,7 @@ angular.module('zmApp.controllers').controller('zmApp.MontageCtrl', ['$scope', ' //--------------------------------------------------------------------- function onPause() { - console.log("*** Moving to Background ***"); // Handle the pause event - console.log("*** CANCELLING INTERVAL ****"); + ZMDataModel.zmDebug ("MontageCtrl: onpause called"); $interval.cancel(intervalHandle); // $interval.cancel(modalIntervalHandle); @@ -619,6 +615,7 @@ angular.module('zmApp.controllers').controller('zmApp.MontageCtrl', ['$scope', ' if (!$scope.isModalActive) { var ld = ZMDataModel.getLogin(); + ZMDataModel.zmDebug ("MontageCtrl: onresume called"); ZMDataModel.zmLog ("Restarting montage timer on resume"); $rootScope.rand = Math.floor((Math.random() * 100000) + 1); $interval.cancel(intervalHandle); diff --git a/www/js/PortalLoginCtrl.js b/www/js/PortalLoginCtrl.js index 422c18ab..5504e225 100644 --- a/www/js/PortalLoginCtrl.js +++ b/www/js/PortalLoginCtrl.js @@ -7,7 +7,6 @@ angular.module('zmApp.controllers').controller('zmApp.PortalLoginCtrl', ['$ionic // Main -console.log ("***** INSIDE LOGIN CONTROLLER"); $ionicHistory.nextViewOptions({ disableBack: true @@ -18,17 +17,20 @@ console.log ("***** INSIDE LOGIN CONTROLLER"); if (ZMDataModel.isLoggedIn()) { ZMDataModel.zmLog ("User credentials are provided"); // console.log("VALID CREDENTIALS. Grabbing Monitors"); + ZMDataModel.zmDebug("PortalLogin: Authenticating"); zmAutoLogin.doLogin("authenticating...") .then (function(data) // success { + ZMDataModel.zmDebug("PortalLogin: auth success"); ZMDataModel.getKeyConfigParams(1); $state.go('montage'); }, // coming here means auth error // so go back to login - function (error) - { - $state.go('login'); + function (error) + { + ZMDataModel.zmDebug("PortalLogin: error authenticating " + JSON.stringify(error)); + $state.go('login'); } @@ -36,6 +38,7 @@ console.log ("***** INSIDE LOGIN CONTROLLER"); } else { + ZMDataModel.zmDebug("PortalLogin: Not logged in, so going to login"); $state.go('login'); } diff --git a/www/js/StateCtrl.js b/www/js/StateCtrl.js index c346e0ec..1a512663 100644 --- a/www/js/StateCtrl.js +++ b/www/js/StateCtrl.js @@ -51,7 +51,7 @@ angular.module('zmApp.controllers').controller('zmApp.StateCtrl', ['$ionicPopup' // if applicable //--------------------------------------------------------- function getCurrentState() { - + ZMDataModel.zmDebug("StateCtrl: getting state using " + apiCurrentState); $http.get(apiCurrentState) .then( function (success) { @@ -70,6 +70,7 @@ angular.module('zmApp.controllers').controller('zmApp.StateCtrl', ['$ionicPopup' }, function (error) { + ZMDataModel.zmDebug("StateCtrl: Error retrieving state list " + JSON.stringify(error)); $scope.customState = ""; } @@ -114,9 +115,11 @@ angular.module('zmApp.controllers').controller('zmApp.StateCtrl', ['$ionicPopup' // returns disk space in gigs taken up by events //---------------------------------------------------------------------- function getDiskStatus() { + ZMDataModel.zmDebug("StateCtrl/getDiskStatus: " + apiDisk); $http.get(apiDisk) .then( function (success) { + ZMDataModel.zmDebug("StateCtrl/getDiskStatus: success"); var obj = success.data.usage; if (obj.Total.space != undefined) { @@ -150,9 +153,11 @@ angular.module('zmApp.controllers').controller('zmApp.StateCtrl', ['$ionicPopup' // returns ZM running status //---------------------------------------------------------------------- function getRunStatus() { + ZMDataModel.zmDebug("StateCtrl/getRunStatus: " + apiRun); $http.get(apiRun) .then( function (success) { + ZMDataModel.zmDebug("StateCtrl/getRunStatus: success"); switch (success.data.result) { case 1: $scope.zmRun = 'running'; @@ -173,7 +178,7 @@ angular.module('zmApp.controllers').controller('zmApp.StateCtrl', ['$ionicPopup' // console.log("X"+success.data.result+"X"); }, function (error) { - console.log("ERROR in getRun: " + JSON.stringify(error)); + //console.log("ERROR in getRun: " + JSON.stringify(error)); ZMDataModel.zmLog("Error getting RunStatus " + JSON.stringify(error), "error"); $scope.color = 'color:red;'; $scope.zmRun = 'undetermined'; @@ -187,18 +192,20 @@ angular.module('zmApp.controllers').controller('zmApp.StateCtrl', ['$ionicPopup' // gets ZM load - max[0], avg[1], min[2] //---------------------------------------------------------------------- function getLoadStatus() { + ZMDataModel.zmDebug("StateCtrl/getLoadStatus: " + apiLoad); $http.get(apiLoad) .then( function (success) { //console.log(JSON.stringify(success)); // load returns 3 params - one in the middle is avg. + ZMDataModel.zmDebug("StateCtrl/getLoadStatus: success"); $scope.zmLoad = success.data.load[1]; // console.log("X"+success.data.result+"X"); }, function (error) { - console.log("ERROR in getLoad: " + JSON.stringify(error)); + //console.log("ERROR in getLoad: " + JSON.stringify(error)); ZMDataModel.zmLog("Error retrieving loadStatus " + JSON.stringify(error), "error"); $scope.zmLoad = 'undetermined'; } @@ -212,6 +219,7 @@ angular.module('zmApp.controllers').controller('zmApp.StateCtrl', ['$ionicPopup' function controlZM(str) { if (inProgress) { + ZMDataModel.zmDebug("StateCtrl/controlZM: operation in progress"); $ionicPopup.alert({ title: "Operation in Progress", template: "The previous operation is still in progress. Please wait..." @@ -242,11 +250,12 @@ angular.module('zmApp.controllers').controller('zmApp.StateCtrl', ['$ionicPopup' $scope.zmRun = "please wait..."; $scope.color = 'color:orange;'; $scope.customState = ""; - console.log("Control command is " + apiExec + str + ".json"); + ZMDataModel.zmDebug("StateCtrl/controlZM: POST Control command is " + apiExec + str + ".json"); inProgress = 1; $http.post(apiExec + str + ".json") .then( function (success) { + ZMDataModel.zmDebug("StateCtrl/controlZM: returned success"); switch (str) { case "stop": $scope.zmRun = 'stopped'; @@ -265,7 +274,8 @@ angular.module('zmApp.controllers').controller('zmApp.StateCtrl', ['$ionicPopup' function (error) { //if (error.status) // it seems to return error with status 0 if ok // { - console.log("ERROR in Change State:" + JSON.stringify(error)); + //console.log("ERROR in Change State:" + JSON.stringify(error)); + ZMDataModel.zmDebug("StateCtrl/controlZM: returned error"); ZMDataModel.zmLog("Error in change run state:" + JSON.stringify(error), "error"); $scope.zmRun = 'undetermined'; $scope.color = 'color:orange;'; @@ -299,6 +309,7 @@ angular.module('zmApp.controllers').controller('zmApp.StateCtrl', ['$ionicPopup' $scope.doRefresh = function () { console.log("***Pull to Refresh"); + ZMDataModel.zmDebug("StateCtrl/refresh: calling getRun/Load/Disk/CurrentState"); getRunStatus(); getLoadStatus(); getDiskStatus(); diff --git a/www/js/TimelineCtrl.js b/www/js/TimelineCtrl.js index 7c762284..bff1ed16 100644 --- a/www/js/TimelineCtrl.js +++ b/www/js/TimelineCtrl.js @@ -94,7 +94,7 @@ angular.module('zmApp.controllers').controller('zmApp.TimelineCtrl', ['$ionicPla // FIXME : code repeat from Events //-------------------------------------------------------- function openModal(eid, ename, edur, eframes, basepath, relativepath) { - console.log("Open Modal with Base path " + basepath); + ZMDataModel.zmDebug("TimelineCtrl: Open Modal with path " + relativepath); $scope.eventName = ename; $scope.eventId = eid; $scope.eFramesNum = eframes; @@ -224,7 +224,7 @@ angular.module('zmApp.controllers').controller('zmApp.TimelineCtrl', ['$ionicPla $scope.closeModal = function () { // $interval.cancel(eventsInterval); //$interval.cancel(segmentHandle); - console.log("Close & Destroy Modal"); + ZMDataModel.zmDebug("TimelineCtrl:Close & Destroy Modal"); ZMDataModel.setAwake(false); if ($scope.modal !== undefined) { $scope.modal.remove(); @@ -239,7 +239,10 @@ angular.module('zmApp.controllers').controller('zmApp.TimelineCtrl', ['$ionicPla //-------------------------------------------------------- function showEvent(start, mid, edur, eframes, eid, ename) { - console.log("Event STARTED WITH " + start); + ZMDataModel.zmDebug ("TimelineCtrl/showevent called with start:" + + start + " monitorId:" + mid + " dur:" + edur + " frames:" + eframes + + " eventId:" + eid + " eventName:" +ename); + //console.log("Event STARTED WITH " + start); var str = start; var yy = moment(str).format('YY'); var mm = moment(str).format('MM'); @@ -357,6 +360,7 @@ angular.module('zmApp.controllers').controller('zmApp.TimelineCtrl', ['$ionicPla var maxItems = zm.graphItemMax; // THAT magic # --> 300 and ZM on my m/c cries $scope.maxItems = maxItems; $scope.graphLoaded = false; + ZMDataModel.zmDebug("TimelineCtrl/drawGraph: graphLoaded is " + $scope.graphLoaded); //flat colors for graph - https://flatuicolors.com http://www.flatuicolorpicker.com var colors = ['#3498db', '#D2527F', '#f39c12', '#9b59b6', '#e74c3c','#7A942E',]; @@ -482,9 +486,15 @@ angular.module('zmApp.controllers').controller('zmApp.TimelineCtrl', ['$ionicPla duration: zm.loadingTimeout, //specifically for Android - http seems to get stuck at times }); + ZMDataModel.zmLog ("TimelineCtrl/drawgraph: from->"+fromDate+" to->"+toDate+" count:"+count); $scope.graphLoaded = false; + ZMDataModel.zmDebug ("TimelineCtrl/drawgraph: graphLoaded:"+$scope.graphLoaded); - if (timeline) timeline.destroy(); + if (timeline) + { + ZMDataModel.zmDebug("TimelineCtrl/drawgraph: destroying timeline as it exists"); + timeline.destroy(); + } var groups = new vis.DataSet(); @@ -534,7 +544,8 @@ angular.module('zmApp.controllers').controller('zmApp.TimelineCtrl', ['$ionicPla // and divide the # of items I want (currently 200) with # of items per page // So iterCount is the # of HTTP calls I need to make iterCount = Math.round(count / itemsPerPage); - console.log("I will make " + iterCount + " HTTP Requests "); + ZMDataModel.zmDebug("TimelineCtrl/drawGraph: pages of data: " + pages + " items per page: " + itemsPerPage); + ZMDataModel.zmDebug("TimelineCtrl/drawGraph: I will make " + iterCount + " HTTP Requests to get all graph data"); // I've restructured this part. I was initially using vis DataSets // for dynamic binding which was easier, but due to performance reasons @@ -550,7 +561,7 @@ angular.module('zmApp.controllers').controller('zmApp.TimelineCtrl', ['$ionicPla $q.all(promises) .then(function (data) { - + ZMDataModel.zmDebug ("TimelineCtrl/drawgraph: all pages of graph data received"); graphIndex = 0; ZMDataModel.zmLog ("Creating " + $scope.monitors.length + " groups for the graph"); // create groups @@ -559,22 +570,16 @@ angular.module('zmApp.controllers').controller('zmApp.TimelineCtrl', ['$ionicPla id: $scope.monitors[g].Monitor.Id, content: ZMDataModel.getMonitorName($scope.monitors[g].Monitor.Id) }); + ZMDataModel.zmDebug ("TimelineCtrl/drawgraph:Adding group " + + ZMDataModel.getMonitorName($scope.monitors[g].Monitor.Id)); } - //REMOVE - - /*for (var g = 1; g <= 7; g++) { - groups.add({ - id: g.toString(), - content: "Monitor " + g - }); - } - */ + for (var j = 0; j < data.length; j++) { var myevents = data[j]; - if (graphIndex > 200) + if (graphIndex > zm.graphItemMax) { ZMDataModel.zmLog ("Exiting page count graph - reached limit of " + zm.graphItemMax); break; @@ -620,13 +625,14 @@ angular.module('zmApp.controllers').controller('zmApp.TimelineCtrl', ['$ionicPla timeline.fit(); $ionicLoading.hide(); - $scope.graphLoaded = true; - $scope.navControls = false; + $scope.graphLoaded = true; + ZMDataModel.zmDebug ("graph loaded: " + $scope.graphLoaded); + $scope.navControls = false; timeline.on('select', function (properties) { if (properties.items && !isNaN(properties.items[0])) { - console.log("You clicked on item " + properties.items); + ZMDataModel.zmDebug("TimelineCtrl/drawGraph:You clicked on item " + properties.items); var item = graphData.get(properties.items); - console.log("ITEM = " + JSON.stringify(item)); + ZMDataModel.zmDebug("TimelineCtrl/drawGraph: clicked item details:" + JSON.stringify(item)); showEvent(item[0].start, item[0].group, item[0].mydur, item[0].myframes, item[0].myeid, item[0].myename); diff --git a/www/js/app.js b/www/js/app.js index 9ccd51f1..b8cc0e8a 100644 --- a/www/js/app.js +++ b/www/js/app.js @@ -28,7 +28,7 @@ angular.module('zmApp', [ largeHttpTimeout: 60000, logFile: 'zmNinjaLog.txt', authoremail: 'pliablepixels+zmNinja@gmail.com', - logFileMaxSize: 10000, // after this limit log gets reset + logFileMaxSize: 50000, // after this limit log gets reset loginInterval: 300000, //5m*60s*1000 - ZM auto login after 5 mins loadingTimeout: 15000, safeMontageLimit: 10, @@ -47,12 +47,9 @@ angular.module('zmApp', [ monitorRunningColor: '#4CAF50', monitorErrorColor: '#795548', montageScaleFrequency: 300, - eventsListDetailsHeight: 200, + eventsListDetailsHeight: 200.0, eventsListScrubHeight: 300, loginScreenString: "var currentView = 'login'" // oh shit. Isn't there a better way? - - - }) //------------------------------------------------------------------ @@ -204,6 +201,7 @@ angular.module('zmApp', [ { // these can take time, so lets bump up timeout config.timeout = zm.largeHttpTimeout; + // ZMDataModel.zmDebug("timeoutHttpIntercept: HTTP request with long response time. Timeout set to "+config.timeout); } else { config.timeout = zm.httpTimeout; @@ -245,8 +243,8 @@ angular.module('zmApp', [ //------------------------------------------------------------------ $rootScope.$on("auth-error", function () { - console.log("**** ZM LOGIN ERROR INTERCEPT"); + ZMDataModel.zmDebug ("zmAutoLogin: Inside auth-error emit"); ZMDataModel.displayBanner ('error',['ZoneMinder authentication failed', 'Please check settings']); @@ -283,7 +281,8 @@ angular.module('zmApp', [ $timeout(function () { contentBannerInstance(); }, 2000); - console.log("**** ZM LOGIN SUCCESS INTERCEPT"); + ZMDataModel.zmDebug ("auth-success emit:Successfull"); + //console.log("**** ZM LOGIN SUCCESS INTERCEPT"); }); @@ -303,7 +302,6 @@ angular.module('zmApp', [ return d.promise; } - console.log("**** ZM AUTO LOGIN CALLED"); ZMDataModel.zmLog("zmAutologin called"); if (str) { @@ -353,9 +351,8 @@ angular.module('zmApp', [ for (var p in obj) str.push(encodeURIComponent(p) + "=" + encodeURIComponent(obj[p])); - var foo = str.join("&"); - //console.log("****RETURNING " + foo); - return foo; + var params = str.join("&"); + return params; }, data: { @@ -378,7 +375,7 @@ angular.module('zmApp', [ if (data.indexOf(zm.loginScreenString) == -1) { $rootScope.loggedIntoZm = 1; - console.log("**** ZM Login OK"); + ZMDataModel.zmLog("zmAutologin successfully logged into Zoneminder"); d.resolve("Login Success"); @@ -486,6 +483,7 @@ angular.module('zmApp', [ $rootScope.toString = ""; $rootScope.loggedIntoZm = 0; + console.log ("HERE"); ZMDataModel.init(); // for making sure we canuse $state.go with ng-click // needed for views that use popovers diff --git a/www/js/controllers.js b/www/js/controllers.js index fa18a330..1e68f5c5 100644 --- a/www/js/controllers.js +++ b/www/js/controllers.js @@ -12,7 +12,7 @@ angular.module('zmApp.controllers', ['ionic', 'ngCordova', 'ng-mfb','angularCirc }; $ionicPlatform.registerBackButtonAction(function (event) { - console.log ("ANDROID BACK"); + $ionicSideMenuDelegate.toggleLeft(); $timeout (function() { $rootScope.stateofSlide = $ionicSideMenuDelegate.isOpen() + new Date(); diff --git a/www/templates/devoptions.html b/www/templates/devoptions.html index f262243d..f1a1c2c1 100644 --- a/www/templates/devoptions.html +++ b/www/templates/devoptions.html @@ -37,6 +37,12 @@ <input type="tel" placeholder="max is 70" ng-model="loginData.montageQuality"> </label> </div> + + <label> + <ion-toggle ng-model="loginData.enableDebug" + ng-checked="{{loginData.enableDebug}}" + toggle-class="toggle-calm">Enable Debug Logs</ion-toggle> + </label> <button class="button button-block button-balanced icon ion-locked" ng-click="saveDevOptions()"> Save |
