From d8fea09d65e5207ef8c4fafcddd5fc74a7f7be00 Mon Sep 17 00:00:00 2001 From: Pliable Pixels Date: Fri, 28 Sep 2018 08:37:24 -0400 Subject: #709 implement native/XHR wrapper, convert all success/error to "then" construct --- www/js/MonitorCtrl.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'www/js/MonitorCtrl.js') diff --git a/www/js/MonitorCtrl.js b/www/js/MonitorCtrl.js index 38bdf765..881d6a2c 100644 --- a/www/js/MonitorCtrl.js +++ b/www/js/MonitorCtrl.js @@ -181,10 +181,10 @@ angular.module('zmApp.controllers') } }) - .success(function () { + .then(function () { NVRDataModel.debug("MonitorCtrl: Not restarting ZM - Make sure you have the patch installed in MonitorsController.php or this won't work"); - }) - .error(function (data, status, headers, config) { + }, + function (data, status, headers, config) { NVRDataModel.debug("MonitorCtrl: Error changing monitor " + JSON.stringify(data)); $scope.monfunc.myfailedIds.push(item); }); @@ -419,7 +419,8 @@ angular.module('zmApp.controllers') NVRDataModel.debug("MonitorCtrl:monitorStateCheck: " + apiMonCheck); //console.log("**** ZMC CHECK " + apiMonCheck); $http.get(apiMonCheck) - .success(function (data) { + .then(function (data) { + data = data.data; NVRDataModel.debug("MonitorCtrl: monitor check state returned: " + JSON.stringify(data)); if (data.statustext.indexOf("not running") > -1) { $scope.monitors[j].Monitor.isRunning = "false"; @@ -438,8 +439,8 @@ angular.module('zmApp.controllers') } $scope.monitors[j].Monitor.isRunningText = data.statustext; - }) - .error(function (data) { + }, + function (data) { NVRDataModel.debug("MonitorCtrl: Error->monitor check state returned: " + JSON.stringify(data)); NVRDataModel.displayBanner('error', [$translate.instant('kErrorRetrievingState'), $translate.instant('kPleaseTryAgain')]); -- cgit v1.2.3