diff options
Diffstat (limited to 'www/js')
| -rw-r--r-- | www/js/EventCtrl.js | 3 | ||||
| -rw-r--r-- | www/js/LogCtrl.js | 19 | ||||
| -rw-r--r-- | www/js/MonitorCtrl.js | 12 | ||||
| -rw-r--r-- | www/js/app.js | 12 | ||||
| -rw-r--r-- | www/js/controllers.js | 2 |
5 files changed, 39 insertions, 9 deletions
diff --git a/www/js/EventCtrl.js b/www/js/EventCtrl.js index 7320a03c..8d9bd57b 100644 --- a/www/js/EventCtrl.js +++ b/www/js/EventCtrl.js @@ -457,7 +457,8 @@ angular.module('zmApp.controllers').controller('zmApp.EventCtrl', ['$scope', '$r //evtCurSegment = 0; // console.log ("**** I SET SEGMENTS TO " + evtSegments); - // call on progress indicator every 2 seconds + // call on progress indicator every 5 seconds + // don't want to overload segmentHandle = $interval(function () { segmentCheck(); }, 5000); diff --git a/www/js/LogCtrl.js b/www/js/LogCtrl.js index 942bd8da..eb66b71e 100644 --- a/www/js/LogCtrl.js +++ b/www/js/LogCtrl.js @@ -13,6 +13,25 @@ angular.module('zmApp.controllers').controller('zmApp.LogCtrl', ['$scope', '$roo $scope.zmAppVersion = ZMDataModel.getAppVersion(); + $scope.deleteLogs = function () { + + var confirmPopup = $ionicPopup.confirm({ + title: 'Please Confirm', + template: 'Are you sure you want to delete logs?', + }); + + confirmPopup.then(function (res) { + if (res) { + $fileLogger.deleteLogfile().then(function () { + console.log('Logfile deleted'); + $fileLogger.setStorageFilename('zmNinjaLog.txt'); + $scope.zmLog.logString = ""; + }); + } + }); + }; + + //-------------------------------------------------------------------------- // Make sure user knows information masking is best effort //-------------------------------------------------------------------------- diff --git a/www/js/MonitorCtrl.js b/www/js/MonitorCtrl.js index bf94f48f..a98c6b1b 100644 --- a/www/js/MonitorCtrl.js +++ b/www/js/MonitorCtrl.js @@ -293,7 +293,7 @@ angular.module('zmApp.controllers').controller('zmApp.MonitorCtrl', ['$ionicPopu (function (j) { $scope.monitors[j].Monitor.isRunningText = "..."; $scope.monitors[j].Monitor.isRunning = "..."; - $scope.monitors[j].Monitor.color = '#1E90FF'; + $scope.monitors[j].Monitor.color = '#03A9F4'; $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); @@ -301,17 +301,17 @@ angular.module('zmApp.controllers').controller('zmApp.MonitorCtrl', ['$ionicPopu .success(function (data) { if (data.statustext.indexOf("not running") > -1) { $scope.monitors[j].Monitor.isRunning = "false"; - $scope.monitors[j].Monitor.color = 'red'; + $scope.monitors[j].Monitor.color = '#F44336'; $scope.monitors[j].Monitor.char = "ion-close-circled"; } else if (data.statustext.indexOf("pending") > -1) { $scope.monitors[j].Monitor.isRunning = "pending"; - $scope.monitors[j].Monitor.color = 'orange'; + $scope.monitors[j].Monitor.color = '#FF9800'; } else if (data.statustext.indexOf("running since") > -1) { $scope.monitors[j].Monitor.isRunning = "true"; - $scope.monitors[j].Monitor.color = 'green'; + $scope.monitors[j].Monitor.color = '#4CAF50'; } else if (data.statustext.indexOf("Unable to connect") > -1) { $scope.monitors[j].Monitor.isRunning = "false"; - $scope.monitors[j].Monitor.color = 'red'; + $scope.monitors[j].Monitor.color = '#F44336'; $scope.monitors[j].Monitor.char = "ion-close-circled"; } @@ -320,7 +320,7 @@ angular.module('zmApp.controllers').controller('zmApp.MonitorCtrl', ['$ionicPopu }) .error(function (data) { $scope.monitors[j].Monitor.isRunning = "error"; - $scope.monitors[j].Monitor.color = '#800000'; + $scope.monitors[j].Monitor.color = '#795548'; $scope.monitors[j].Monitor.char = "ion-help-circled"; }); diff --git a/www/js/app.js b/www/js/app.js index bf6e646f..4e8311d2 100644 --- a/www/js/app.js +++ b/www/js/app.js @@ -18,7 +18,7 @@ angular.module('zmApp', [ //------------------------------------------------------------------ // this directive will be load any time an image completes loading // via img tags where this directive is added (I am using this in -// events and mionitor view to show a loader while the image is +// events and monitor view to show a loader while the image is // downloading from ZM //------------------------------------------------------------------ @@ -242,11 +242,19 @@ angular.module('zmApp', [ }); - + //fileLogger is an excellent cross platform library + // that allows you to manage log files without worrying about + // paths etc.https://github.com/pbakondy/filelogger $fileLogger.setStorageFilename('zmNinjaLog.txt'); if (window.cordova) { + // getAppVersion is a handy library + // that lets you extract the app version in config.xml + // given that you are always changing versions while + // uploading to app/play stores, this is very useful + // to keep in sync and use within your app + cordova.getAppVersion(function(version) { appVersion = version; ZMDataModel.zmLog ("zmNinja Version: " + appVersion); diff --git a/www/js/controllers.js b/www/js/controllers.js index 2f079951..914a23bf 100644 --- a/www/js/controllers.js +++ b/www/js/controllers.js @@ -2,6 +2,8 @@ /* jshint browser: true*/ /* global cordova,StatusBar,angular,console */ + + angular.module('zmApp.controllers', ['ionic', 'ngCordova', 'ng-mfb','angularCircularNavigation']) .controller('zmApp.AppCtrl', function($scope, $ionicSideMenuDelegate) { |
