2017-09-10 21:12:57 +01:00
|
|
|
@extends(Theme::viewName('layout'))
|
2016-09-08 23:22:29 +01:00
|
|
|
@section('title', 'Analysing...')
|
|
|
|
|
|
|
|
@section('content')
|
|
|
|
<div class="container" style="margin-top: 40px;">
|
|
|
|
<div class="row">
|
2017-09-03 07:48:21 +01:00
|
|
|
<div class="col-sm-8 mr-sm-auto ml-sm-auto" id="analyse-album">
|
2017-04-09 09:07:18 +01:00
|
|
|
<div class="card" v-if="!isCompleted">
|
|
|
|
<div class="card-header">Analysing...</div>
|
2017-09-03 07:48:21 +01:00
|
|
|
<div class="card-body">
|
2016-09-08 23:22:29 +01:00
|
|
|
<p>Your uploaded photos are now being analysed.</p>
|
2016-09-24 08:17:51 +01:00
|
|
|
|
|
|
|
<div class="progress">
|
2017-04-09 09:07:18 +01:00
|
|
|
<div class="progress-bar bg-success" v-bind:style="{ width: successfulPercentage }">
|
2016-09-24 08:17:51 +01:00
|
|
|
</div>
|
2017-04-09 09:07:18 +01:00
|
|
|
<div class="progress-bar bg-danger" v-bind:style="{ width: failedPercentage }">
|
2016-09-24 08:17:51 +01:00
|
|
|
</div>
|
2016-09-08 23:22:29 +01:00
|
|
|
</div>
|
|
|
|
|
2016-10-30 18:36:34 +00:00
|
|
|
{{-- We display a queue of 3 recently completed items, and 5 up-next items, as well as a counter saying "... and XYZ more" --}}
|
|
|
|
{{-- That's what the 3's and 5's are in the next couple of blocks --}}
|
2017-04-09 09:07:18 +01:00
|
|
|
<div v-for="image in latestCompletedImages" style="margin-top: 20px;">
|
|
|
|
<p class="text-success"><span v-text="image.name"></span> ... <i class="fa fa-fw fa-check"></i></p>
|
2016-10-30 18:36:34 +00:00
|
|
|
</div>
|
2017-04-09 09:07:18 +01:00
|
|
|
<div v-for="image in imagesInProgress.slice(0, 5)" style="margin-top: 20px;">
|
|
|
|
<p><span v-text="image.name"></span> ... <i class="fa fa-fw fa-refresh"></i></p>
|
2016-10-30 18:36:34 +00:00
|
|
|
</div>
|
|
|
|
|
2017-04-09 09:07:18 +01:00
|
|
|
<div v-if="imagesInProgress.length > 5">
|
|
|
|
<p>@lang('admin.analyse_and_more.and') <span v-text="imagesInProgress.length - 5"></span> @lang('admin.analyse_and_more.others')</p>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div v-for="image in imagesFailed" style="margin-top: 20px;">
|
|
|
|
<p class="text-danger"><span v-text="image.name"></span> ... <i class="fa fa-fw fa-times"></i></p>
|
2016-09-08 23:22:29 +01:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2017-04-09 09:07:18 +01:00
|
|
|
<div class="card" v-if="isCompleted">
|
|
|
|
<div class="card-header">Upload completed</div>
|
2017-09-03 07:48:21 +01:00
|
|
|
<div class="card-body">
|
2016-09-08 23:22:29 +01:00
|
|
|
<p>Your upload has completed.</p>
|
2017-04-09 09:07:18 +01:00
|
|
|
|
|
|
|
<div v-if="numberFailed > 0">
|
2016-09-24 08:17:51 +01:00
|
|
|
<p class="text-danger">@lang('admin.analyse_photos_failed')</p>
|
2017-04-09 09:07:18 +01:00
|
|
|
<ul class="text-danger" v-for="image in imagesFailed">
|
|
|
|
<li><span v-text="image.name"></span>: <span v-text="image.reason"></span></li>
|
2016-09-24 08:17:51 +01:00
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
|
2017-04-09 09:07:18 +01:00
|
|
|
<div class="text-right">
|
|
|
|
<a class="btn btn-link" href="{{ $album->url() }}">View album</a>
|
|
|
|
<a class="btn btn-primary" href="{{ route('albums.show', ['id' => $album->id]) }}"><i class="fa fa-fw fa-chevron-left"></i> Back to album settings</a>
|
2016-09-08 23:22:29 +01:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
@endsection
|
|
|
|
|
|
|
|
@push('scripts')
|
|
|
|
<script type="text/javascript">
|
2016-09-24 08:17:51 +01:00
|
|
|
var viewModel = new AnalyseAlbumViewModel();
|
2017-04-09 09:07:18 +01:00
|
|
|
var app = new Vue(viewModel);
|
2016-09-08 23:22:29 +01:00
|
|
|
|
2016-09-24 08:17:51 +01:00
|
|
|
{{-- For each photo to analyse, push an instance of AnalyseImageViewModel to our master view model --}}
|
|
|
|
@foreach ($photos as $photo)
|
2017-04-09 09:07:18 +01:00
|
|
|
app.analyseImage(new AnalyseImageViewModel({
|
2016-09-24 08:17:51 +01:00
|
|
|
'id': '{{ $photo->id }}',
|
|
|
|
'name': '{!! addslashes($photo->name) !!}',
|
2016-10-28 05:30:57 +01:00
|
|
|
'url': '{{ route('photos.analyse', ['id' => $photo->id, 'queue_token' => $queue_token]) }}'
|
2016-09-24 08:17:51 +01:00
|
|
|
}));
|
|
|
|
@endforeach
|
2016-09-08 23:22:29 +01:00
|
|
|
</script>
|
|
|
|
@endpush
|