From 9514414907d78587d5ad78abd6849397d4973ff6 Mon Sep 17 00:00:00 2001 From: Pliable Pixels Date: Sat, 27 Oct 2018 07:38:31 -0400 Subject: attach logs instead of pasting --- www/js/LogCtrl.js | 40 ++++++++++++++++++++++++++++++++++++++++ www/templates/log.html | 10 ++++++++-- 2 files changed, 48 insertions(+), 2 deletions(-) (limited to 'www') 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 //-------------------------------------------------------------------------- diff --git a/www/templates/log.html b/www/templates/log.html index 0ad840d8..c67cab4c 100644 --- a/www/templates/log.html +++ b/www/templates/log.html @@ -4,7 +4,10 @@   + ng-click="selectToggle()">   + + + @@ -13,7 +16,7 @@
- +
@@ -32,6 +35,9 @@ + + +
-- cgit v1.2.3