Get a frame's path from the controller

This commit is contained in:
Kyle Johnson 2015-02-11 19:16:13 -05:00
parent 3cd52d93de
commit 5b573ce2bc
2 changed files with 12 additions and 4 deletions

View File

@ -142,7 +142,7 @@ ZoneMinder.controller('EventsController', function($scope, Events, Console, $mod
};
});
ZoneMinder.controller('EventController', function($scope, Event, $modalInstance, eventId, index, Config) {
ZoneMinder.controller('EventController', function($scope, Event, $modalInstance, eventId, index, Config, $filter) {
$scope.stream = true;
@ -163,12 +163,20 @@ ZoneMinder.controller('EventController', function($scope, Event, $modalInstance,
$scope.archived = results.data.event.Event.Archived;
$scope.archive_text = $scope.archived == 0 ? 'Archive' : 'Unarchive';
$scope.eventView_text = 'Frames';
$scope.frames = results.data.event.Frame;
$scope.basePath = results.data.event.Event.BasePath;
var frames = results.data.event.Frame;
Config.findByName('ZM_EVENT_IMAGE_DIGITS').then(function(results) {
$scope.event_image_digits = results.data.config.Value;
var event_image_digits = results.data.config.Value;
angular.forEach(frames, function(frame, key) {
var id = $filter('zpad')(frame.FrameId, event_image_digits);
frames[key].Path = $scope.basePath + id + '-capture.jpg';
});
$scope.frames = frames;
});
});
$scope.cancel = function () {

View File

@ -6,7 +6,7 @@
</div>
<div class="panel-body">
<div class="thumbnail">
<img ng-src="{{basePath}}{{ frame.FrameId | zpad:event_image_digits }}-capture.jpg" alt="Frame {{frame.FrameId}}" class="img-responsive" />
<img ng-src="{{ frame.Path }}" alt="Frame {{frame.FrameId}}" class="img-responsive" />
</div>
<ul>
<li>Delta: <span ng-bind="frame.Delta"></span></li>