Browse Source

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

tags/v2.2.0-beta.1
Andy Heathershaw 7 months ago
parent
commit
f26f545b76
3 changed files with 84 additions and 53 deletions
  1. +2
    -0
      app/Helpers/ConfigHelper.php
  2. +4
    -0
      resources/lang/en/admin.php
  3. +78
    -53
      resources/views/themes/base/admin/settings.blade.php

+ 2
- 0
app/Helpers/ConfigHelper.php View File

@@ -8,6 +8,7 @@ use App\AlbumSources\LocalFilesystemSource;
use App\AlbumSources\OpenStackSource;
use App\AlbumSources\RackspaceSource;
use App\Configuration;
use App\Storage;

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


+ 4
- 0
resources/lang/en/admin.php View File

@@ -260,6 +260,10 @@ return [
'albums_menu_heading' => 'Albums Navigation Menu',
'albums_menu_number_items' => 'Number of albums to display:',
'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_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.',


+ 78
- 53
resources/views/themes/base/admin/settings.blade.php View File

@@ -129,70 +129,95 @@
<div class="alert alert-info mb-5">
<p class="mb-0">@lang('admin.settings.image_processing_queue_intro_3')</p>
</div>
</fieldset>

<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-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']) }}">
<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>
@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']) }}">
<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>
@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']) }}">
<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>
@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']) }}">
<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>
@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']) }}">
<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>
@if ($errors->has('rabbitmq_queue'))
<div class="invalid-feedback">
<strong>{{ $errors->first('rabbitmq_queue') }}</strong>
</div>
@endif
</div>
</fieldset>

<hr/>

<fieldset>
<legend>@lang('admin.settings.analysis_queue_storage')</legend>
<p>@lang('admin.settings.analysis_queue_storage_intro')</p>
<p>@lang('admin.settings.analysis_queue_storage_intro_2')</p>

<div class="alert alert-warning mb-5">
<p class="mb-0">@lang('admin.settings.analysis_queue_storage_warning')</p>
</div>

<div class="form-group">
<label class="form-control-label" for="analysis-queue-storage-location">Analysis queue storage:</label>
<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('analysis_queue_storage_location'))
<div class="invalid-feedback">
<strong>{{ $errors->first('analysis_queue_storage_location') }}</strong>
</div>
@endif
</div>
</fieldset>
</div>

{{-- E-mail --}}


Loading…
Cancel
Save