diff options
| author | Pliable Pixels <pliablepixels@gmail.com> | 2018-10-27 07:38:31 -0400 |
|---|---|---|
| committer | Pliable Pixels <pliablepixels@gmail.com> | 2018-10-27 07:38:31 -0400 |
| commit | 9514414907d78587d5ad78abd6849397d4973ff6 (patch) | |
| tree | acbd8180687fe57aaeecda66d64b7e7c347387f9 /www/js/LogCtrl.js | |
| parent | 73d3ab8eea13038d9ff3ab3bea0329fc48b6e464 (diff) | |
attach logs instead of pasting
Diffstat (limited to 'www/js/LogCtrl.js')
| -rw-r--r-- | www/js/LogCtrl.js | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/www/js/LogCtrl.js b/www/js/LogCtrl.js index 2858e289..c575b5fb 100644 --- a/www/js/LogCtrl.js +++ b/www/js/LogCtrl.js @@ -103,6 +103,46 @@ angular.module('zmApp.controllers').controller('zmApp.LogCtrl', ['$scope', '$roo }); }; + + $scope.attachLogs = function() { + + cordova.plugins.email.isAvailable( + function (isAvailable) { + + if (isAvailable) { + + + $fileLogger.checkFile() + .then (function (d) { + + var url = cordova.file.dataDirectory + d.name; + console.log ( "URL:"+url); + cordova.plugins.email.open({ + to: zm.authoremail, + subject: $rootScope.appName + ' logs attached', + body: 'logs are attached', + attachments: url + + }); + }, + function (e) { + NVRDataModel.debug ("Error attaching log file:"+JSON.stringify(e)); + }); + + + + } else { + // kEmailNotConfigured + $rootScope.zmPopup = SecuredPopups.show('alert', { + title: $translate.instant('kError'), + template: $translate.instant('kEmailNotConfigured'), + okText: $translate.instant('kButtonOk'), + cancelText: $translate.instant('kButtonCancel'), + }); + } + + }); + }; //-------------------------------------------------------------------------- // Convenience function to send logs via email //-------------------------------------------------------------------------- |
