#123: Added the dropdown to the settings page to select from storage locations

This commit is contained in:
Andy Heathershaw 2019-07-11 09:01:20 +01:00
parent ebbc5ba097
commit f26f545b76
3 changed files with 89 additions and 58 deletions

View File

@ -8,6 +8,7 @@ use App\AlbumSources\LocalFilesystemSource;
use App\AlbumSources\OpenStackSource; use App\AlbumSources\OpenStackSource;
use App\AlbumSources\RackspaceSource; use App\AlbumSources\RackspaceSource;
use App\Configuration; use App\Configuration;
use App\Storage;
class ConfigHelper class ConfigHelper
{ {
@ -102,6 +103,7 @@ class ConfigHelper
'allow_photo_comments' => false, 'allow_photo_comments' => false,
'allow_photo_comments_anonymous' => true, 'allow_photo_comments_anonymous' => true,
'allow_self_registration' => true, 'allow_self_registration' => true,
'analysis_queue_storage_location' => Storage::where('is_default', true)->first()->id,
'analytics_code' => '', 'analytics_code' => '',
'app_name' => trans('global.app_name'), 'app_name' => trans('global.app_name'),
'date_format' => $this->allowedDateFormats()[0], 'date_format' => $this->allowedDateFormats()[0],

View File

@ -260,6 +260,10 @@ return [
'albums_menu_heading' => 'Albums Navigation Menu', 'albums_menu_heading' => 'Albums Navigation Menu',
'albums_menu_number_items' => 'Number of albums to display:', 'albums_menu_number_items' => 'Number of albums to display:',
'albums_menu_parents_only' => 'Only show top-level albums', 'albums_menu_parents_only' => 'Only show top-level albums',
'analysis_queue_storage' => 'Analysis Queue Storage Driver',
'analysis_queue_storage_intro' => 'The analysis queue is a temporary storage location for images waiting to be analysed after an upload or a meta-data refresh.',
'analysis_queue_storage_intro_2' => 'Select the storage location to use for the analysis queue. If you are using RabbitMQ, it is recommended this is a cloud storage location.',
'analysis_queue_storage_warning' => 'Using a cloud storage location may incur additional transfer costs. Consult your storage provider to check these costs.',
'analytics_cookie_link_1' => 'Information about the EU Cookie Law directive', 'analytics_cookie_link_1' => 'Information about the EU Cookie Law directive',
'analytics_cookie_link_2' => 'Cookie Consent by Insites', 'analytics_cookie_link_2' => 'Cookie Consent by Insites',
'analytics_cookie_warning_1' => 'If you are based in Europe and you enable visitor tracking, you will need to comply with the EU Cookie Law. The easiest way to do so is using a script like Cookie Consent by Insites.', 'analytics_cookie_warning_1' => 'If you are based in Europe and you enable visitor tracking, you will need to comply with the EU Cookie Law. The easiest way to do so is using a script like Cookie Consent by Insites.',

View File

@ -129,70 +129,95 @@
<div class="alert alert-info mb-5"> <div class="alert alert-info mb-5">
<p class="mb-0">@lang('admin.settings.image_processing_queue_intro_3')</p> <p class="mb-0">@lang('admin.settings.image_processing_queue_intro_3')</p>
</div> </div>
<div class="form-check mb-3">
<input type="checkbox" class="form-check-input" id="rabbitmq-enabled" name="rabbitmq_enabled" @if (UserConfig::get('rabbitmq_enabled'))checked="checked"@endif>
<label class="form-check-label" for="rabbitmq-enabled">
<strong>@lang('admin.settings.image_processing_queue_enabled')</strong><br/>
<span class="text-muted">@lang('admin.settings.image_processing_queue_enabled_help')</span>
</label>
</div>
<div class="form-group ml-4">
<label class="form-control-label" for="rabbitmq-server">Hostname:</label>
<input type="text" class="form-control{{ $errors->has('rabbitmq_server') ? ' is-invalid' : '' }}" id="rabbitmq-server" name="rabbitmq_server" value="{{ old('rabbitmq_server', $config['rabbitmq_server']) }}">
@if ($errors->has('rabbitmq_server'))
<div class="invalid-feedback">
<strong>{{ $errors->first('rabbitmq_server') }}</strong>
</div>
@endif
</div>
<div class="form-group ml-4">
<label class="form-control-label" for="rabbitmq-port">Port:</label>
<input type="text" class="form-control{{ $errors->has('rabbitmq_port') ? ' is-invalid' : '' }}" id="rabbitmq-port" name="rabbitmq_port" value="{{ old('rabbitmq_port', $config['rabbitmq_port']) }}">
@if ($errors->has('rabbitmq_port'))
<div class="invalid-feedback">
<strong>{{ $errors->first('rabbitmq_port') }}</strong>
</div>
@endif
</div>
<div class="form-group ml-4">
<label class="form-control-label" for="rabbitmq-username">Username:</label>
<input type="text" class="form-control{{ $errors->has('rabbitmq_username') ? ' is-invalid' : '' }}" id="rabbitmq-username" name="rabbitmq_username" value="{{ old('rabbitmq_username', $config['rabbitmq_username']) }}">
@if ($errors->has('rabbitmq_username'))
<div class="invalid-feedback">
<strong>{{ $errors->first('rabbitmq_username') }}</strong>
</div>
@endif
</div>
<div class="form-group ml-4">
<label class="form-control-label" for="rabbitmq-password">Password:</label>
<input type="text" class="form-control{{ $errors->has('rabbitmq_password') ? ' is-invalid' : '' }}" id="rabbitmq-password" name="rabbitmq_password" value="{{ old('rabbitmq_password', $config['rabbitmq_password']) }}">
@if ($errors->has('rabbitmq_password'))
<div class="invalid-feedback">
<strong>{{ $errors->first('rabbitmq_password') }}</strong>
</div>
@endif
</div>
<div class="form-group ml-4">
<label class="form-control-label" for="rabbitmq-queue">Queue:</label>
<input type="text" class="form-control{{ $errors->has('rabbitmq_queue') ? ' is-invalid' : '' }}" id="rabbitmq-queue" name="rabbitmq_queue" value="{{ old('rabbitmq_queue', $config['rabbitmq_queue']) }}">
@if ($errors->has('rabbitmq_queue'))
<div class="invalid-feedback">
<strong>{{ $errors->first('rabbitmq_queue') }}</strong>
</div>
@endif
</div>
</fieldset> </fieldset>
<div class="form-check mb-3"> <hr/>
<input type="checkbox" class="form-check-input" id="rabbitmq-enabled" name="rabbitmq_enabled" @if (UserConfig::get('rabbitmq_enabled'))checked="checked"@endif>
<label class="form-check-label" for="rabbitmq-enabled">
<strong>@lang('admin.settings.image_processing_queue_enabled')</strong><br/>
<span class="text-muted">@lang('admin.settings.image_processing_queue_enabled_help')</span>
</label>
</div>
<div class="form-group ml-4"> <fieldset>
<label class="form-control-label" for="rabbitmq-server">Hostname:</label> <legend>@lang('admin.settings.analysis_queue_storage')</legend>
<input type="text" class="form-control{{ $errors->has('rabbitmq_server') ? ' is-invalid' : '' }}" id="rabbitmq-server" name="rabbitmq_server" value="{{ old('rabbitmq_server', $config['rabbitmq_server']) }}"> <p>@lang('admin.settings.analysis_queue_storage_intro')</p>
<p>@lang('admin.settings.analysis_queue_storage_intro_2')</p>
@if ($errors->has('rabbitmq_server')) <div class="alert alert-warning mb-5">
<div class="invalid-feedback"> <p class="mb-0">@lang('admin.settings.analysis_queue_storage_warning')</p>
<strong>{{ $errors->first('rabbitmq_server') }}</strong> </div>
</div>
@endif
</div>
<div class="form-group ml-4"> <div class="form-group">
<label class="form-control-label" for="rabbitmq-port">Port:</label> <label class="form-control-label" for="analysis-queue-storage-location">Analysis queue storage:</label>
<input type="text" class="form-control{{ $errors->has('rabbitmq_port') ? ' is-invalid' : '' }}" id="rabbitmq-port" name="rabbitmq_port" value="{{ old('rabbitmq_port', $config['rabbitmq_port']) }}"> <select class="form-control{{ $errors->has('analysis_queue_storage_location') ? ' is-invalid' : '' }}" id="analysis-queue-storage-location" name="analysis_queue_storage_location">
<option value="{{ old('analysis_queue_storage_location', $config['analysis_queue_storage_location']) }}"></option>
</select>
@if ($errors->has('rabbitmq_port')) @if ($errors->has('analysis_queue_storage_location'))
<div class="invalid-feedback"> <div class="invalid-feedback">
<strong>{{ $errors->first('rabbitmq_port') }}</strong> <strong>{{ $errors->first('analysis_queue_storage_location') }}</strong>
</div> </div>
@endif @endif
</div> </div>
</fieldset>
<div class="form-group ml-4">
<label class="form-control-label" for="rabbitmq-username">Username:</label>
<input type="text" class="form-control{{ $errors->has('rabbitmq_username') ? ' is-invalid' : '' }}" id="rabbitmq-username" name="rabbitmq_username" value="{{ old('rabbitmq_username', $config['rabbitmq_username']) }}">
@if ($errors->has('rabbitmq_username'))
<div class="invalid-feedback">
<strong>{{ $errors->first('rabbitmq_username') }}</strong>
</div>
@endif
</div>
<div class="form-group ml-4">
<label class="form-control-label" for="rabbitmq-password">Password:</label>
<input type="text" class="form-control{{ $errors->has('rabbitmq_password') ? ' is-invalid' : '' }}" id="rabbitmq-password" name="rabbitmq_password" value="{{ old('rabbitmq_password', $config['rabbitmq_password']) }}">
@if ($errors->has('rabbitmq_password'))
<div class="invalid-feedback">
<strong>{{ $errors->first('rabbitmq_password') }}</strong>
</div>
@endif
</div>
<div class="form-group ml-4">
<label class="form-control-label" for="rabbitmq-queue">Queue:</label>
<input type="text" class="form-control{{ $errors->has('rabbitmq_queue') ? ' is-invalid' : '' }}" id="rabbitmq-queue" name="rabbitmq_queue" value="{{ old('rabbitmq_queue', $config['rabbitmq_queue']) }}">
@if ($errors->has('rabbitmq_queue'))
<div class="invalid-feedback">
<strong>{{ $errors->first('rabbitmq_queue') }}</strong>
</div>
@endif
</div>
</div> </div>
{{-- E-mail --}} {{-- E-mail --}}