summaryrefslogtreecommitdiff
path: root/www/templates/events.html
blob: 58ed0eca29997e56a5142940eac00f196810a352 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
<ion-view cache-view="false">
    <ion-nav-title>{{scrollPosition();}}</ion-nav-title>
    <ion-nav-buttons side="left">
        <button class="button button-icon button-clear ion-navicon" ng-click="openMenu()">
        </button>

        <button class="button button-icon icon ion-ios-minus-outline" ng-click="eventList.showDelete = !eventList.showDelete;"></button>

        <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>

    </ion-nav-buttons>

    <ion-nav-buttons side="right">
        <a style="" class="button button-icon icon ion-android-more-vertical" ng-click="popover.show($event)" ;>&nbsp;&nbsp;&nbsp;</a>

        <a style="" class="button button-icon icon ion-search" ng-href="" ng-click="searchClicked();"> </a>
    </ion-nav-buttons>




    <div ng-if="showSearch">
        <ion-header-bar class="bar bar-subheader item-input-inset">

            <label class="item-input-wrapper">
                <i class="icon ion-ios7-search placeholder-icon"></i>
                <input type="search" placeholder="Search" ng-model="search.text" autocorrect="off" autocomplete="off">
            </label>
        </ion-header-bar>
    </div>


    <ion-content on-tap="tapped();" delegate-handle="mainScroll" lazy-scroll has-subheader="true">


        <!-- lets make sure the events list is not empty as collection repeat needs height -->
        <div ng-if="!eventsBeingLoaded">
            <ion-list show-delete="eventList.showDelete">
                <ion-item repeat="event in events| filter:search.text" item-height="event.Event.height" id="item-{{$index}}" overflow-scroll="true">

                    <!--<span class="events-filter-on" ng-if="isEventFilterOn">Filter</span>-->

                    <span style="float:right;margin-top:-18px;background-color:#6d0909;color:#fff;font-size:11px;opacity:0.7;width:90px;border-radius: 0px 0px 5px 5px;">&nbsp;&nbsp;&nbsp;<i class="ion-clock"></i>&nbsp;&nbsp;{{prettifyTime(event.Event.StartTime)}}</span>

                    <span style="float:left;margin-top:-18px;background-color:#444444;color:#fff;font-size:11px;opacity:0.7;width:90px;border-radius: 0px 0px 5px 5px;">&nbsp;&nbsp;&nbsp;<i class="ion-calendar"></i>&nbsp;&nbsp;{{prettifyDate(event.Event.StartTime)}}</span>


                    <div class="row">
                        <div class="col col-left">
                            <!-- this ngswitch displays different icons
                                        depending on the cause of the event -->

                            <div ng-switch on="event.Event.Cause">
                                <div ng-switch-when="Motion">

                                    <i class="ion-android-walk" style="float:left; font-size:200%;"></i>
                                    <div ng-if="event.Event.DefaultVideo !== undefined && event.Event.DefaultVideo!=''">
                                        <i class="ion-ios-videocam" style="float:left; padding-left:5px; font-size:100%;"></i>
                                    </div>
                                    <br/>
                                </div>
                                <div ng-switch-when="Signal">
                                    <i class="ion-wifi" style="float:left; font-size:200%;"></i>
                                    <div ng-if=" event.Event.DefaultVideo !== undefined && event.Event.DefaultVideo!=''">
                                        <i class="ion-ios-videocam" style="float:left; padding-left:5px;font-size:100%;"></i>
                                    </div>
                                    <br/>
                                </div>
                                <div ng-switch-default>
                                    <i class="ion-ionic" style="float:left; font-size:200%;"></i>
                                    <div ng-if="event.Event.DefaultVideo !== undefined && event.Event.DefaultVideo!=''">
                                        <i class="ion-ios-videocam" style="float:left; padding-left:5px;font-size:100%;"></i>
                                    </div>
                                    <br/>
                                </div>
                            </div>
                            <!-- ng switch -->
                            <!-- {{event.Event.Cause}} -->

                            <br/>
                            <span style="font-size:80%; color:rgb(110,110,110)">
                                {{event.Event.Length}}s
                            </span>
                        </div>
                        <!-- col col left-->
                        <div class="col col-80">
                            <div class="item-text-wrap">
                                <i class="ion-monitor"></i>
                                <b>{{event.Event.MonitorName}}</b> ({{event.Event.Name}})
                            </div>

                            <i class="ion-images"></i> {{event.Event.Frames}} &nbsp;
                            <i class="ion-ios-bell-outline"></i> {{event.Event.AlarmFrames}} &nbsp;
                            <i class="ion-arrow-graph-up-right"></i> {{event.Event.TotScore}}
                        </div>
                    </div>
                    <!--row-->

                    <div class="row" style="font-size:80%; color:rgb(110,110,110)">
                        <div class="item-text-wrap"><i class="ion-calendar"></i>&nbsp; {{prettify(event.Event.StartTime)}}
                            <br/>
                            <i class="ion-clipboard"></i>&nbsp; {{event.Event.Notes}}
                            <!-- <br/> Default video:{{event.Event.relativePath}}{{event.Event.DefaultVideo}}-->
                        </div>
                    </div>

                    <span style="float:right">
                                <div ng-if="event.Event.EndTime">
                                    <button class="button button-small icon icon-left ion-ios-eye"
                                            ng-click="toggleGroup(event,$index,event.Event.Frames)" > Quick Scrub
                                    </button>


                                    <button class="button button-small icon icon-left ion-ios-eye"
                                            ng-click="closeIfOpen(event);openModal(event)" > View Footage
                                    </button>
                                </div>
                              
                                <div ng-if="!event.Event.EndTime">
                                    <p>recording in progress</p>
                                </div>
                    </span>


                    <!-- this is the event scrub area -->
                    <div ng-if="isGroupShown(event)">

                        <div ng-if="event.Event.DefaultVideo=='' || loginData.enableh264==false">


                            <br/>
                            <br/>
                            <br/>

                            <div style="width:90%">
                                <input ng-model="ionRange.index" type="text" id="mySlider1" slider options="slider_options" />
                            </div>
                            <br/>



                            <p>{{mycarousel.index+1}}/{{event.Event.Frames}} Type: {{FrameArray[mycarousel.index].Type}}</p>

                            <div style="height:190px">
                                <ul rn-carousel rn-carousel-buffered rn-carousel-transition="none" rn-swipe-disabled="true" rn-carousel-index="mycarousel.index" rn-carousel-auto-slide="{{calcMsTimer(event.Event.Frames, event.Event.Length)/1000.0}}" rn-carousel-pause-on-hover rn-platform="{{$root.platformOS}}">
                                    <li ng-repeat="slide in slides">
                                        <!-- Linwood scaling -->
                                        <img imageonload="finishedLoadingImage($index)" image-spinner-src="{{playbackURL}}/index.php?view=image&path={{event.Event.relativePath}}{{slide.img}}&height=380" image-spinner-loader="lines" height="190px" ;/>
                                        <br/>


                                    </li>
                                </ul>
                            </div>
                        </div>
                        <!-- no DefaultVideo -->


                        <div ng-if="event.Event.DefaultVideo!='' && loginData.enableh264 == true">

                            <br/>
                            <br/>
                            <br/>


                            <div class="videogular-container">
                                <videogular vg-theme="event.Event.video.config.theme" vg-plays-inline="'true'" vg-auto-play="'true'" vg-responsive="true">
                                    <vg-controls>
                                        <vg-play-pause-button></vg-play-pause-button>
                                        <vg-scrub-bar>
                                            <vg-scrub-bar-current-time></vg-scrub-bar-current-time>
                                        </vg-scrub-bar>
                                        <vg-time-display>{{ timeLeft | date:'mm:ss':'+0000' }}</vg-time-display>
                                        <vg-fullscreen-button></vg-fullscreen-button>
                                        <vg-volume>
                                            <vg-mute-button></vg-mute-button>
                                        </vg-volume>
                                    </vg-controls>

                                    <vg-media vg-src="event.Event.video.config.sources" vg-native-controls="false">
                                    </vg-media>
                                </videogular>
                            </div>

                        </div>
                        <!-- DefaultVideo -->
                    </div>
                    <!-- isGroupShown -->

                    <ion-delete-button class="ion-minus-circled" ng-click="deleteEvent(event.Event.Id, $index)">
                    </ion-delete-button>



                </ion-item>
            </ion-list>
        </div>

        <ion-item ng-show="!events.length">
            No events to display.
        </ion-item>

        <div ng-if="!eventsBeingLoaded">
            <ion-infinite-scroll ng-if="moreDataCanBeLoaded()" icon="ion-loading-c" on-infinite="loadMore()" distance="2%">
            </ion-infinite-scroll>
        </div>
    </ion-content>
    <div class="events-float-filter" ng-if="isEventFilterOn" on-tap="filterTapped();">Filter On</div>

    <ion-pull-up-footer class="bar-energized" on-expand="footerExpand()" on-collapse="footerCollapse()" initial-state="minimized" default-behavior="expand">

        <ion-pull-up-handle width="100" height="25" toggle="ion-chevron-up ion-chevron-down" style="border-radius: 25px 25px 0 0">
            <i class="icon ion-chevron-up"></i>
        </ion-pull-up-handle>
        <ion-pull-up-bar>
            <h1 class="title" ion-pull-up-trigger>Latest Events</h1>
        </ion-pull-up-bar>
        <ion-pull-up-content scroll="true">

            <div class="list list-inset">
                <div class="item item-divider">1 hour summary</div>
                <div ng-repeat="hour in hours" id="hour-{{$index}}">

                    <span style="color:black">
                    <a class="item item-icon-right" href="" 
                       ng-click="showEvents('1', 'hour',hour.mid);">
                        <b>{{hour.monitor}}</b> {{hour.events}} events
                        <i class="icon ion-android-arrow-dropright"></i>
                    </a>
                    </span>

                </div>
            </div>

            <div class="list list-inset">
                <div class="item item-divider">1 day summary</div>
                <div ng-repeat="day in days" id="day-{{$index}}">

                    <span style="color:black">
                    <a class="item item-icon-right" href="" 
                       ng-click="showEvents('1', 'day',day.mid);">
                        <b>{{day.monitor}}</b> {{day.events}} events
                        <i class="icon ion-android-arrow-dropright"></i>
                    </a>
                    </span>

                </div>
            </div>


            <div class="list list-inset">
                <div class="item item-divider">1 week summary</div>
                <div ng-repeat="week in weeks" id="week-{{$index}}">

                    <span style="color:black">
                    <a class="item item-icon-right" href="" 
                       ng-click="showEvents('1', 'week',week.mid);">
                        <b>{{week.monitor}}</b> {{week.events}} events
                        <i class="icon ion-android-arrow-dropright"></i>
                    </a>
                    </span>

                </div>
            </div>

            <div class="list list-inset">
                <div class="item item-divider">1 month summary</div>
                <div ng-repeat="month in months" id="month-{{$index}}">

                    <span style="color:black">
                    <a class="item item-icon-right" href="" 
                       ng-click="showEvents('1', 'months',month.mid);">
                        <b>{{month.monitor}}</b> {{month.events}} events
                        <i class="icon ion-android-arrow-dropright"></i>
                    </a>
                    </span>

                </div>
            </div>

            <br/>
            <br/>


        </ion-pull-up-content>
    </ion-pull-up-footer>


</ion-view>