diff options
| author | Pliable Pixels <pliablepixels@gmail.com> | 2019-05-10 11:37:32 -0400 |
|---|---|---|
| committer | Pliable Pixels <pliablepixels@gmail.com> | 2019-05-10 11:37:32 -0400 |
| commit | da48c504975617bceb9191a06229d5c730f335f8 (patch) | |
| tree | b68077efcc1010c73f6fe871b15ee6bcad38b058 /www | |
| parent | be54fb1534f20ff0cc622ff2e7f8734a5fc22752 (diff) | |
general cleanup, also object notes tweaks, removed authSession undefined foo
Diffstat (limited to 'www')
| -rw-r--r-- | www/css/style.css | 14 | ||||
| -rw-r--r-- | www/js/EventCtrl.js | 12 | ||||
| -rw-r--r-- | www/js/MomentCtrl.js | 2 | ||||
| -rw-r--r-- | www/js/MonitorModalCtrl.js | 4 | ||||
| -rw-r--r-- | www/js/MontageCtrl.js | 31 | ||||
| -rw-r--r-- | www/js/MontageHistoryCtrl.js | 6 | ||||
| -rw-r--r-- | www/js/TimelineCtrl.js | 2 | ||||
| -rw-r--r-- | www/js/TimelineModalCtrl.js | 2 | ||||
| -rw-r--r-- | www/js/WizardCtrl.js | 2 | ||||
| -rw-r--r-- | www/templates/monitors-modal.html | 16 | ||||
| -rw-r--r-- | www/templates/montage-history.html | 5 | ||||
| -rw-r--r-- | www/templates/montage.html | 14 |
12 files changed, 69 insertions, 41 deletions
diff --git a/www/css/style.css b/www/css/style.css index d86c089a..f52c0f38 100644 --- a/www/css/style.css +++ b/www/css/style.css @@ -577,6 +577,20 @@ http://www.cssportal.com/tryit/index.php?file=blog/css-notification-badge */ opacity: 0.7; } +.object-notes { + background-color:rgba(255, 242, 0,1.0); + color: black; + border-radius: 5px; + padding-left:4px; + padding-right:4px; + margin-top:1px; + margin-bottom:1px; +} + +.regular-notes { + color:white; +} + .events-modal-camera-icon { position: absolute; bottom: 120px; diff --git a/www/js/EventCtrl.js b/www/js/EventCtrl.js index 77a50a64..e06309aa 100644 --- a/www/js/EventCtrl.js +++ b/www/js/EventCtrl.js @@ -974,10 +974,10 @@ 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; - } + $scope.imgsrc += NVR.insertBasicAuthToken(); @@ -2316,7 +2316,7 @@ angular.module('zmApp.controllers') videoURL = event.Event.recordingURL + "/index.php?view=view_video&eid=" + event.Event.Id; - if ($rootScope.authSession != 'undefined') videoURL += $rootScope.authSession; + videoURL += $rootScope.authSession; videoURL += NVR.insertBasicAuthToken(); @@ -2965,7 +2965,7 @@ angular.module('zmApp.controllers') NVR.getSnapshotFrame()+"&eid="+event.Event.Id + "&width=" + event.Event.thumbWidth * 2 + "&height=" + event.Event.thumbHeight * 2; - if ($rootScope.authSession != 'undefined') stream += $rootScope.authSession; + stream += $rootScope.authSession; stream += NVR.insertBasicAuthToken(); return stream; @@ -2979,7 +2979,7 @@ angular.module('zmApp.controllers') stream = event.Event.recordingURL + "/index.php?view=image" + "&fid=" + slide.id + $scope.outlineMotionParam; - if ($rootScope.authSession != 'undefined') stream += $rootScope.authSession; + stream += $rootScope.authSession; stream += NVR.insertBasicAuthToken(); @@ -2994,7 +2994,7 @@ angular.module('zmApp.controllers') stream = event.Event.recordingURL + "/index.php?view=image&fid=" + alarm.id; if (motion) stream += $scope.outlineMotionParam; - if ($rootScope.authSession != 'undefined') stream += $rootScope.authSession; + stream += $rootScope.authSession; stream += NVR.insertBasicAuthToken(); // console.log ("alarm:"+stream); diff --git a/www/js/MomentCtrl.js b/www/js/MomentCtrl.js index 06294a16..b749837a 100644 --- a/www/js/MomentCtrl.js +++ b/www/js/MomentCtrl.js @@ -273,7 +273,7 @@ angular.module('zmApp.controllers').controller('zmApp.MomentCtrl', ['$scope', '$ "&width=" + moment.Event.thumbWidth * 2 + "&height=" + moment.Event.thumbHeight * 2; - if ($rootScope.authSession != 'undefined') stream += $rootScope.authSession; + stream += $rootScope.authSession; stream += NVR.insertBasicAuthToken(); return stream; diff --git a/www/js/MonitorModalCtrl.js b/www/js/MonitorModalCtrl.js index 4d5f94f2..1279c013 100644 --- a/www/js/MonitorModalCtrl.js +++ b/www/js/MonitorModalCtrl.js @@ -1184,11 +1184,9 @@ angular.module('zmApp.controllers').controller('MonitorModalCtrl', ['$scope', '$ var loginData = NVR.getLogin(); var url = loginData.streamingurl + '/zms?mode=single&monitor=' + mid; - - if ($rootScope.authSession != 'undefined') { url += $rootScope.authSession; - } + url += NVR.insertBasicAuthToken(); NVR.log("SavetoPhone:Trying to save image from " + url); diff --git a/www/js/MontageCtrl.js b/www/js/MontageCtrl.js index 6b769b21..e6fba792 100644 --- a/www/js/MontageCtrl.js +++ b/www/js/MontageCtrl.js @@ -636,11 +636,25 @@ angular.module('zmApp.controllers') NVR.debug ("Getting event count using:"+apiurl); $http.get(apiurl) .then (function (data) { - // console.log ("EVENTS GOT: "+JSON.stringify(data)); + console.log ("EVENTS GOT: "+JSON.stringify(data)); var res = data.data; var mid = monitor.Monitor.Id; if (res.events.length == 0) res = undefined; + monitor.Monitor.lastEvent = res; + + if (monitor.Monitor.lastEvent) { + var notes = res.events[0].Event.Notes; + if (notes.indexOf('detected:') != -1) { + monitor.Monitor.lastEvent.object = true; + } + else { + monitor.Monitor.lastEvent.object = false; + } + + } + + if (monitor.Monitor.lastEvent && showMontageSidebars) { monitor.Monitor.showSidebar = true; } @@ -868,7 +882,7 @@ angular.module('zmApp.controllers') "&monitor=" + item.Monitor.Id + "&scale=50"; - if ($rootScope.authSession != 'undefined') frame += $rootScope.authSession; + frame += $rootScope.authSession; frame += NVR.insertBasicAuthToken(); return frame; }; @@ -1908,7 +1922,7 @@ angular.module('zmApp.controllers') ld.lastEventCheckTimes[mid] = (new moment()).tz(NVR.getTimeZoneNow()).format('YYYY-MM-DD HH:mm:ss'); NVR.debug ("Updating monitor:"+mid+" event check time (server tz) to " + ld.lastEventCheckTimes[mid] ); NVR.setLogin(ld); - monitor.Monitor.lastEvent = undefined; + $http.get(url) .then ( function (succ) { @@ -1941,6 +1955,7 @@ angular.module('zmApp.controllers') }); NVR.log("Cancelling montage timer, opening Modal"); + // NVR.log("Starting Modal timer"); //console.log ("openModal:Cancelling timer"); $interval.cancel(intervalHandleMontage); @@ -1969,6 +1984,8 @@ angular.module('zmApp.controllers') $scope.modalData = { doRefresh: false }; + + monitor.Monitor.lastEvent = undefined; $ionicModal.fromTemplateUrl('templates/events-modal.html', { scope: $scope, // give ModalCtrl access to this scope animation: 'slide-in-up', @@ -2013,10 +2030,12 @@ angular.module('zmApp.controllers') - if ($rootScope.authSession != 'undefined') stream += $rootScope.authSession; + + stream += $rootScope.authSession; stream += NVR.insertBasicAuthToken(); // console.log (stream); + //console.log ("EVENT="+stream); return stream; }; @@ -2024,7 +2043,7 @@ angular.module('zmApp.controllers') $scope.constructStream = function (monitor) { var stream; - if (currentStreamState == streamState.STOPPED || monitor.Monitor.listDisplay == 'noshow' || $rootScope.authSession == 'undefined') { + if (currentStreamState == streamState.STOPPED || monitor.Monitor.listDisplay == 'noshow' ) { //console.log ("STREAM=empty and auth="+$rootScope.authSession); return ""; } @@ -2048,7 +2067,7 @@ angular.module('zmApp.controllers') //"&rand="+$scope.randToAvoidCacheMem + - // console.log("STREAM=" + stream); + console.log("STREAM=" + stream); return stream; }; diff --git a/www/js/MontageHistoryCtrl.js b/www/js/MontageHistoryCtrl.js index 5cf9892b..6f6687e4 100644 --- a/www/js/MontageHistoryCtrl.js +++ b/www/js/MontageHistoryCtrl.js @@ -301,7 +301,7 @@ angular.module('zmApp.controllers').controller('zmApp.MontageHistoryCtrl', ['$sc if (eType=='video') { var videoURL= $scope.MontageMonitors[j].Monitor.baseURL + "/index.php?view=view_video&eid=" + eid; - if ($rootScope.authSession != 'undefined') videoURL += $rootScope.authSession; + videoURL += $rootScope.authSession; if ($rootScope.basicAuthToken) videoURL = videoURL + "&basicauth=" + $rootScope.basicAuthToken; @@ -422,7 +422,7 @@ angular.module('zmApp.controllers').controller('zmApp.MontageHistoryCtrl', ['$sc if (eType=='video') { var videoURL= $scope.MontageMonitors[i].Monitor.baseURL + "/index.php?view=view_video&eid=" + eid; - if ($rootScope.authSession != 'undefined') videoURL += $rootScope.authSession; + videoURL += $rootScope.authSession; if ($rootScope.basicAuthToken) videoURL = videoURL + "&basicauth=" + $rootScope.basicAuthToken; @@ -892,7 +892,7 @@ angular.module('zmApp.controllers').controller('zmApp.MontageHistoryCtrl', ['$sc var videoURL= m.Monitor.baseURL + "/index.php?view=view_video&eid=" + success.eid; - if ($rootScope.authSession != 'undefined') videoURL += $rootScope.authSession; + videoURL += $rootScope.authSession; if ($rootScope.basicAuthToken) videoURL = videoURL + "&basicauth=" + $rootScope.basicAuthToken; m.Monitor.videoObject = { diff --git a/www/js/TimelineCtrl.js b/www/js/TimelineCtrl.js index 3e09a24b..78006f37 100644 --- a/www/js/TimelineCtrl.js +++ b/www/js/TimelineCtrl.js @@ -1501,7 +1501,7 @@ angular.module('zmApp.controllers').controller('zmApp.TimelineCtrl', ['$ionicPla stream = event.Event.recordingURL + "/index.php?view=image&fid=" + NVR.getSnapshotFrame()+"&eid="+event.Event.Id + "&width=400" ; - if ($rootScope.authSession != 'undefined') stream += $rootScope.authSession; + stream += $rootScope.authSession; stream += NVR.insertBasicAuthToken(); $timeout ( function () { diff --git a/www/js/TimelineModalCtrl.js b/www/js/TimelineModalCtrl.js index 0753182e..0b7fb5cb 100644 --- a/www/js/TimelineModalCtrl.js +++ b/www/js/TimelineModalCtrl.js @@ -52,7 +52,7 @@ angular.module('zmApp.controllers').controller('TimelineModalCtrl', ['$scope', ' "&fid=" + alarm.id; - if ($rootScope.authSession != 'undefined') stream += $rootScope.authSession; + stream += $rootScope.authSession; stream += NVR.insertBasicAuthToken(); return stream; diff --git a/www/js/WizardCtrl.js b/www/js/WizardCtrl.js index 5ca0aa25..c1a2ca57 100644 --- a/www/js/WizardCtrl.js +++ b/www/js/WizardCtrl.js @@ -678,7 +678,7 @@ angular.module('zmApp.controllers').controller('zmApp.WizardCtrl', ['$scope', '$ function validateData() { - $rootScope.authSession = 'undefined'; + $rootScope.authSession = ''; $rootScope.zmCookie = ''; $scope.wizard.portalValidText = ""; diff --git a/www/templates/monitors-modal.html b/www/templates/monitors-modal.html index e2ee7bdb..ff0a11c3 100644 --- a/www/templates/monitors-modal.html +++ b/www/templates/monitors-modal.html @@ -9,7 +9,7 @@ <!-- --> <div id="monitorimage" style="height: 100vh;" class="main"> - <div ng-if="$root.authSession!='undefined'"> + <div ng-if="!animationInProgress"> <!--<span style="color:white">{{currentStreamMode}}</span>--> @@ -22,11 +22,11 @@ <div ng-if="animationInProgress"> <img style="width:100vw; height:100vh" ng-src="img/noimage.png" class="object-fit_contain" /> </div> - </div> - <div ng-if="$root.authSession=='undefined'"> + + <img id="singlemonitor" ng-src="img/noimage.png" style="width:100vw; height:100vh; display:block;" class="object-fit_contain" width="{{((devWidth)/(7-monitorSize[$index]))}}px;" /> - </div> + </div> </ion-scroll> @@ -39,7 +39,7 @@ <!-- android needs this 100vh - otherwise max- does not work --> <!-- --> <div id="monitorimage" style="height: 100vh;" class="main"> - <div ng-if="$root.authSession!='undefined'"> + <div ng-if="!animationInProgress && !isBackground() && connKey"> <!--<span style="color:white">{{currentStreamMode}}</span>--> @@ -51,11 +51,11 @@ <div ng-if="animationInProgress || isBackground()"> <img style="width:100vw; height:100vh" ng-src="img/noimage.png" class="object-fit_contain" /> </div> - </div> - <div ng-if="$root.authSession=='undefined'"> + + <img id="singlemonitor" ng-src="img/noimage.png" style="width:100vw; height:100vh; display:block;" class="object-fit_contain" width="{{((devWidth)/(7-monitorSize[$index]))}}px;" /> - </div> + </div> </ion-scroll> diff --git a/www/templates/montage-history.html b/www/templates/montage-history.html index f872718b..82fb70f3 100644 --- a/www/templates/montage-history.html +++ b/www/templates/montage-history.html @@ -140,10 +140,7 @@ </div> </div> - <!-- valid auth session &!background --> - <!--<div ng-if="!$root.authSession=='undefined' || isBackground()"> - <img image-spinner-src="img/noimage.png" /> - </div>--> + </span> </div> <ion-item ng-show="!MontageMonitors.length"> {{'kNoMonitors' | translate }} </ion-item> diff --git a/www/templates/montage.html b/www/templates/montage.html index f505c135..34dce100 100644 --- a/www/templates/montage.html +++ b/www/templates/montage.html @@ -123,8 +123,7 @@ <div class="row row-no-padding"> <div ng-class="monitor.Monitor.showSidebar?'col col-70 col-no-padding':'col col-no-padding'"> <figure role="group" class="{{dragBorder}}" ng-show="monitor.Monitor.listDisplay!='noshow'"> - <!--<div ng-if="!isModalActive" >--> - <!--<div ng-if="$root.authSession!='undefined' && !isBackground() && !areImagesLoading">--> + <div class="montage-image"> <div ng-if="LoginData.enableMontageOverlays" class="montage-buttons"> @@ -174,10 +173,7 @@ </div> <div ng-if="monitor.Monitor.showSidebar" class="montage-sidebar "> - <div class="row row-no-padding"> - <i class="ion-social-buffer"></i> {{'kMontageEventStorage' | translate }}: - {{formatBytes(monitor.Monitor.TotalEventDiskSpace,1)}} - </div> + <div ng-if="!monitor.Monitor.lastEvent"> <div class="row row-no-padding"> <div class="col col-no-padding"> @@ -197,10 +193,14 @@ {{humanizeTime(monitor.Monitor.lastEvent.events[0].Event.StartTime)}}<br /> </div> <div class="row row-no-padding"> - <i class="ion-clipboard"></i> {{monitor.Monitor.lastEvent.events[0].Event.Notes}}<br /> + <i class="ion-clipboard"></i> <span ng-class="{'object-notes': monitor.Monitor.lastEvent.object}">{{monitor.Monitor.lastEvent.events[0].Event.Notes}}</span><br /> </div> </div> + <div class="row row-no-padding"> + <i class="ion-social-buffer"></i> {{'kMontageEventStorage' | translate }}: + {{formatBytes(monitor.Monitor.TotalEventDiskSpace,1)}} + </div> </div> |
