summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bower.json4
-rw-r--r--package.json6
-rw-r--r--www/js/LogCtrl.js40
-rw-r--r--www/templates/log.html10
4 files changed, 53 insertions, 7 deletions
diff --git a/bower.json b/bower.json
index 8079f1af..db6aad91 100644
--- a/bower.json
+++ b/bower.json
@@ -32,7 +32,6 @@
"angular-ui-router": "0.2.13",
"angular-wizard": "~0.6.1",
"crypto-js": "~3.1.6",
- "filelogger": "~1.3.0",
"font-awesome": "~4.3.0",
"ion-datetime-picker": "~0.1.1",
"ionic-native-transitions": "shprink/ionic-native-transitions#~1.0.2",
@@ -48,7 +47,8 @@
"videogular-themes-default": "~1.4.4",
"vis": "~4.20.0",
"holderjs": "^2.9.4",
- "localforage": "^1.7.1"
+ "localforage": "^1.7.1",
+ "filelogger": "^1.3.2"
},
"resolutions": {
"angular-sanitize": "1.5.3",
diff --git a/package.json b/package.json
index bb9e847a..7713be0e 100644
--- a/package.json
+++ b/package.json
@@ -59,6 +59,7 @@
"dependencies": {
"clivas": "^0.2.0",
"cordova-android": "^6.4.0",
+ "cordova-ios": "~4.5.5",
"cordova-library-helper-pp-fork": "^1.0.1",
"cordova-plugin-add-swift-support": "^1.7.2",
"cordova-plugin-advanced-http": "^2.0.1",
@@ -98,8 +99,7 @@
"minimist": "^1.2.0",
"mkdirp": "^0.5.1",
"phonegap-plugin-mobile-accessibility": "^1.0.5",
- "phonegap-plugin-push": "~2.1.3",
- "cordova-ios": "~4.5.5"
+ "phonegap-plugin-push": "~2.1.3"
},
"devDependencies": {
"bower": "^1.8.4",
@@ -175,4 +175,4 @@
]
}
}
-} \ No newline at end of file
+}
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 @@
 
<button ng-class="selectOn? 'button button-icon button-clear ion-ios-copy':'button button-icon button-clear ion-ios-copy-outline'"
- ng-click="selectToggle()"></button>
+ ng-click="selectToggle()"></button> &nbsp;
+
+
+
<button data-badge="{{$root.alarmCount}}" class="animated infinite tada button button-icon button-clear ion-ios-bell notification-badge"
ng-click="handleAlarms();" ng-if="$root.isAlarm"></button>
@@ -13,7 +16,7 @@
<a class="button button-icon icon ion-arrow-swap" ng-href="" ng-click="flipLogs()"></a>
<a ng-if="logEntity == $root.appName" class="button button-icon icon ion-trash-a" ng-href="" ng-click="deleteLogs()"></a>
<div ng-if="$root.platformOS!='desktop'">
- <a class="button button-icon icon ion-email" ng-href="" ng-click="sendEmail(log.logString)"> </a>
+ <a class="button button-icon icon ion-email" ng-href="" ng-click="attachLogs()"> </a>
</div>
<div ng-if="$root.platformOS=='desktop'">
<a class="button button-icon icon ion-android-download" ng-href="" ng-click="sendEmail(log.logString)"> </a>
@@ -32,6 +35,9 @@
</button>
<button class="button button-small button-stable icon ion-chevron-right" ng-click="changePage(-1)">
</button>
+
+
+
</div>
<div ng-if="logEntity==$root.appName">