summaryrefslogtreecommitdiff
path: root/www/js/MonitorCtrl.js
diff options
context:
space:
mode:
authorPliable Pixels <pliablepixels@gmail.com>2018-09-28 08:37:24 -0400
committerPliable Pixels <pliablepixels@gmail.com>2018-09-28 08:37:24 -0400
commitd8fea09d65e5207ef8c4fafcddd5fc74a7f7be00 (patch)
tree40d9528aa2e694624eec48da4eccec7c95aee057 /www/js/MonitorCtrl.js
parent776d0d1a52622d5c84411ec3e3d9303ab117a696 (diff)
#709 implement native/XHR wrapper, convert all success/error to "then" construct
Diffstat (limited to 'www/js/MonitorCtrl.js')
-rw-r--r--www/js/MonitorCtrl.js13
1 files changed, 7 insertions, 6 deletions
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')]);