mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-08-07 23:03:00 +03:00
Added maintenance view with image-cleanup
This commit is contained in:
4
resources/assets/icons/spanner.svg
Normal file
4
resources/assets/icons/spanner.svg
Normal file
@@ -0,0 +1,4 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
|
||||
<path clip-rule="evenodd" fill="none" d="M0 0h24v24H0z"/>
|
||||
<path d="M22.7 19l-9.1-9.1c.9-2.3.4-5-1.5-6.9-2-2-5-2.4-7.4-1.3L9 6 6 9 1.6 4.7C.4 7.1.9 10.1 2.9 12.1c1.9 1.9 4.6 2.4 6.9 1.5l9.1 9.1c.4.4 1 .4 1.4 0l2.3-2.3c.5-.4.5-1.1.1-1.4z"/>
|
||||
</svg>
|
After Width: | Height: | Size: 315 B |
@@ -50,6 +50,19 @@ return [
|
||||
'reg_confirm_restrict_domain_desc' => 'Enter a comma separated list of email domains you would like to restrict registration to. Users will be sent an email to confirm their address before being allowed to interact with the application. <br> Note that users will be able to change their email addresses after successful registration.',
|
||||
'reg_confirm_restrict_domain_placeholder' => 'No restriction set',
|
||||
|
||||
/**
|
||||
* Maintenance settings
|
||||
*/
|
||||
|
||||
'maint' => 'Maintenance',
|
||||
'maint_image_cleanup' => 'Cleanup Images',
|
||||
'maint_image_cleanup_desc' => "Scans page & revision content to check which images and drawings are currently in use and which images are redundant. Ensure you create a full database and image backup before running this.",
|
||||
'maint_image_cleanup_ignore_revisions' => 'Ignore images in revisions',
|
||||
'maint_image_cleanup_run' => 'Run Cleanup',
|
||||
'maint_image_cleanup_warning' => ':count potentially unused images were found. Are you sure you want to delete these images?',
|
||||
'maint_image_cleanup_success' => ':count potentially unused images found and deleted!',
|
||||
'maint_image_cleanup_nothing_found' => 'No unused images found, Nothing deleted!',
|
||||
|
||||
/**
|
||||
* Role settings
|
||||
*/
|
||||
|
49
resources/views/settings/maintenance.blade.php
Normal file
49
resources/views/settings/maintenance.blade.php
Normal file
@@ -0,0 +1,49 @@
|
||||
@extends('simple-layout')
|
||||
|
||||
@section('toolbar')
|
||||
@include('settings/navbar', ['selected' => 'maintenance'])
|
||||
@stop
|
||||
|
||||
@section('body')
|
||||
<div class="container small">
|
||||
|
||||
<div class="text-right text-muted container">
|
||||
<br>
|
||||
BookStack @if(strpos($version, 'v') !== 0) version @endif {{ $version }}
|
||||
</div>
|
||||
|
||||
|
||||
<div class="card" id="image-cleanup">
|
||||
<h3>@icon('images') {{ trans('settings.maint_image_cleanup') }}</h3>
|
||||
<div class="body">
|
||||
<div class="row">
|
||||
<div class="col-sm-6">
|
||||
<p class="small muted">{{ trans('settings.maint_image_cleanup_desc') }}</p>
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<form method="POST" action="{{ baseUrl('/settings/maintenance/cleanup-images') }}">
|
||||
{!! csrf_field() !!}
|
||||
<input type="hidden" name="_method" value="DELETE">
|
||||
<div>
|
||||
@if(session()->has('cleanup-images-warning'))
|
||||
<p class="text neg">
|
||||
{{ session()->get('cleanup-images-warning') }}
|
||||
</p>
|
||||
<input type="hidden" name="ignore_revisions" value="{{ session()->getOldInput('ignore_revisions', 'false') }}">
|
||||
<input type="hidden" name="confirm" value="true">
|
||||
@else
|
||||
<label>
|
||||
<input type="checkbox" name="ignore_revisions" value="true">
|
||||
{{ trans('settings.maint_image_cleanup_ignore_revisions') }}
|
||||
</label>
|
||||
@endif
|
||||
</div>
|
||||
<button class="button outline">{{ trans('settings.maint_image_cleanup_run') }}</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@stop
|
@@ -2,6 +2,7 @@
|
||||
<div class="col-md-12 setting-nav nav-tabs">
|
||||
@if($currentUser->can('settings-manage'))
|
||||
<a href="{{ baseUrl('/settings') }}" @if($selected == 'settings') class="selected text-button" @endif>@icon('settings'){{ trans('settings.settings') }}</a>
|
||||
<a href="{{ baseUrl('/settings/maintenance') }}" @if($selected == 'maintenance') class="selected text-button" @endif>@icon('spanner'){{ trans('settings.maint') }}</a>
|
||||
@endif
|
||||
@if($currentUser->can('users-manage'))
|
||||
<a href="{{ baseUrl('/settings/users') }}" @if($selected == 'users') class="selected text-button" @endif>@icon('users'){{ trans('settings.users') }}</a>
|
||||
|
Reference in New Issue
Block a user