2017-09-16 08:26:05 +01:00
|
|
|
@extends(Theme::viewName('layout'))
|
|
|
|
@section('title', trans('admin.metadata_upgrade.title'))
|
|
|
|
|
|
|
|
@section('breadcrumb')
|
|
|
|
<li class="breadcrumb-item"><a href="{{ route('home') }}"><i class="fa fa-fw fa-home"></i></a></li>
|
|
|
|
<li class="breadcrumb-item"><a href="{{ route('admin') }}">@lang('navigation.breadcrumb.admin')</a></li>
|
|
|
|
<li class="breadcrumb-item"><a href="{{ route('albums.index') }}">@lang('navigation.breadcrumb.albums')</a></li>
|
|
|
|
<li class="breadcrumb-item"><a href="{{ route('albums.show', ['id' => $album->id]) }}">{{ $album->name }}</a></li>
|
|
|
|
<li class="breadcrumb-item active">@lang('navigation.breadcrumb.metadata_upgrade')</li>
|
|
|
|
@endsection
|
|
|
|
|
|
|
|
@section('content')
|
|
|
|
<div class="container">
|
|
|
|
<div class="row">
|
2017-09-17 16:04:07 +01:00
|
|
|
<div class="col-md-8 ml-md-auto mr-md-auto" id="analyse-album">
|
|
|
|
<div v-if="!isCompleted">
|
|
|
|
<div class="card" id="analysis-card" style="display: none;">
|
|
|
|
<div class="card-header">Analysing...</div>
|
|
|
|
<div class="card-body">
|
|
|
|
<p>Your photos are now being analysed.</p>
|
2017-09-16 08:26:05 +01:00
|
|
|
|
2017-09-17 16:04:07 +01:00
|
|
|
<div class="progress">
|
|
|
|
<div class="progress-bar bg-success" v-bind:style="{ width: successfulPercentage }">
|
|
|
|
</div>
|
|
|
|
<div class="progress-bar bg-danger" v-bind:style="{ width: failedPercentage }">
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
{{-- 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 --}}
|
|
|
|
<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>
|
|
|
|
</div>
|
|
|
|
<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>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<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>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="card bg-primary" id="confirm-card">
|
|
|
|
<div class="card-header text-white">@yield('title')</div>
|
|
|
|
<div class="card-body bg-light">
|
|
|
|
<p>@lang('admin.metadata_upgrade.confirm', ['name' => $album->name])</p>
|
|
|
|
<p class="text-danger"><b>@lang('admin.metadata_upgrade.warning')</b></p>
|
|
|
|
|
|
|
|
<div class="text-right">
|
2017-09-16 08:26:05 +01:00
|
|
|
<a href="{{ route('admin.metadataUpgrade', ['id' => $album->id]) }}" class="btn btn-link">@lang('forms.cancel_action')</a>
|
2017-09-16 12:49:34 +01:00
|
|
|
<button id="submit-button" type="submit" class="btn btn-primary"><i class="fa fa-fw fa-check"></i> @lang('forms.continue_action')</button>
|
2017-09-17 16:04:07 +01:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="card" v-if="isCompleted">
|
|
|
|
<div class="card-header">Analysis completed</div>
|
|
|
|
<div class="card-body">
|
|
|
|
<p>Your analysis has completed.</p>
|
|
|
|
|
|
|
|
<div v-if="numberFailed > 0">
|
2018-07-14 08:15:19 +01:00
|
|
|
<p class="text-danger">@lang('admin.analyse_photos_failed_metadata')</p>
|
2017-09-17 16:04:07 +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>
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="text-right">
|
|
|
|
<a class="btn btn-link" href="{{ $album->url() }}">View album</a>
|
|
|
|
<a class="btn btn-primary" href="{{ route('admin.metadataUpgrade') }}"><i class="fa fa-fw fa-chevron-left"></i> Back to metadata upgrade</a>
|
2017-09-16 08:26:05 +01:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2017-09-16 09:02:25 +01:00
|
|
|
@endsection
|
|
|
|
|
|
|
|
@push('scripts')
|
|
|
|
<script type="text/javascript">
|
2017-09-17 16:04:07 +01:00
|
|
|
var viewModel = new AnalyseAlbumViewModel();
|
|
|
|
var app = new Vue(viewModel);
|
|
|
|
|
2017-09-16 09:02:25 +01:00
|
|
|
$(document).ready(function() {
|
2017-09-17 16:04:07 +01:00
|
|
|
$('#submit-button').click(function()
|
|
|
|
{
|
|
|
|
$('#analysis-card').show();
|
|
|
|
$('#confirm-card').hide();
|
|
|
|
|
|
|
|
{{-- For each photo to analyse, push an instance of AnalyseImageViewModel to our master view model --}}
|
|
|
|
@foreach ($photos as $photo)
|
|
|
|
app.analyseImage(new AnalyseImageViewModel({
|
|
|
|
'id': '{{ $photo->id }}',
|
|
|
|
'name': '{!! addslashes($photo->name) !!}',
|
|
|
|
'url': '{{ route('photos.re-analyse', ['id' => $photo->id, 'queue_token' => $queue_token]) }}'
|
|
|
|
}));
|
|
|
|
@endforeach
|
2017-09-16 09:02:25 +01:00
|
|
|
});
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
@endpush
|