diff options
| author | Pliable Pixels <pliablepixels@gmail.com> | 2018-04-30 10:55:59 -0400 |
|---|---|---|
| committer | Pliable Pixels <pliablepixels@gmail.com> | 2018-04-30 10:55:59 -0400 |
| commit | f286615882223adf7bc309c75a142286b5044cc1 (patch) | |
| tree | 5fa006dcdcde6a223543d5cad4102993741b00a0 /www/js/EventCtrl.js | |
| parent | dee2ad4192126f82a7afbe1974b4470b0d0218af (diff) | |
#618 add token for basic auth as "fyi" for all images
Diffstat (limited to 'www/js/EventCtrl.js')
| -rw-r--r-- | www/js/EventCtrl.js | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/www/js/EventCtrl.js b/www/js/EventCtrl.js index 5e228077..b158b915 100644 --- a/www/js/EventCtrl.js +++ b/www/js/EventCtrl.js @@ -960,6 +960,17 @@ angular.module('zmApp.controllers') //$rootScope.zmPopup = $ionicPopup.alert({title: kFrame+':'+fid+'/'+kEvent+':'+e,template:img, cssClass:'popup80'}); + if ($rootScope.authSession !='undefined'){ + $scope.imgsrc +=$rootScope.authSession; + $scope.fallbackImgSrc +=$rootScope.authSession; + } + + if ($rootScope.basicAuthToken) { + $scope.imgsrc +="&basicauth="+$rootScope.basicAuthToken; + $scope.fallbackImgSrc +="&basicauth="+$rootScope.basicAuthToken; + } + + $rootScope.zmPopup = $ionicPopup.show( { template: '<center>' + $translate.instant('kFrame') + ':{{parray[ndx].frameid}}@{{prettifyTimeSec(parray[ndx].time)}}</center><br/><img ng-src="{{imgsrc}}" fallback-src="{{fallbackImgSrc}}" width="100%" />', @@ -3139,6 +3150,61 @@ angular.module('zmApp.controllers') }; + $scope.constructThumbnail = function(event) { + var stream = ""; + stream = event.Event.baseURL+ + "/index.php?view=image&fid=" +event.Event.MaxScoreFrameId + + "&width="+event.Event.thumbWidth*2 + + "&height="+event.Event.thumbHeight*2; + if ($rootScope.authSession !='undefined') stream+=$rootScope.authSession; + if ($rootScope.basicAuthToken) stream +="&basicauth="+$rootScope.basicAuthToken; + return stream; + + }; + + $scope.constructScrubFrame = function (event,slide) { + + var stream = ""; + if (event.Event.imageMode=='path') { + stream = event.Event.baseURL+"/index.php?view=image"+ + "&path="+event.Event.relativePath+slide.img+"&height=380"; + + } + else if (event.Event.imageMode == 'fid') { + stream = event.Event.baseURL+"/index.php?view=image"+ + "&fid="+slide.id; + } + if ($rootScope.authSession !='undefined') stream+=$rootScope.authSession; + if ($rootScope.basicAuthToken) stream +="&basicauth="+$rootScope.basicAuthToken; + + return stream; + } + + $scope.constructAlarmFrame = function(event, alarm, motion) { + var stream = ""; + + if (event.Event.imageMode=='fid') { + stream = event.Event.baseURL+ + "/index.php?view=image&fid=" +alarm.id; + if (motion) stream+=$scope.outlineMotionParam; + + } + else if (event.Event.imageMode=='path') { + st + ream = event.Event.baseURL+ + "/index.php?view=image&path=" +event.Event.relativePath + + motion? alarm.aname:alarm.fname + + "&height=380"; + + + } + if ($rootScope.authSession !='undefined') stream+=$rootScope.authSession; + if ($rootScope.basicAuthToken) stream +="&basicauth="+$rootScope.basicAuthToken; + + return stream; + + }; + $scope.toggleMinAlarmFrameCount = function() { |
