Compare commits
No commits in common. "main" and "0.2.0" have entirely different histories.
@ -1,21 +1,17 @@
|
||||
APP_NAME="My Projects Website"
|
||||
APP_NAME=Laravel
|
||||
APP_ENV=local
|
||||
APP_KEY=
|
||||
APP_DEBUG=true
|
||||
APP_TIMEZONE=UTC
|
||||
APP_URL=http://localhost
|
||||
|
||||
APP_CAPTCHA=false
|
||||
CAPTCHA_API_DOMAIN=http://your-domain-captcha-or-IP:8081
|
||||
CAPTCHA_PRIVATE_TOKEN=
|
||||
CAPTCHA_STATIC_PATH=http://your-domain-captcha-or-IP:8081/captcha
|
||||
CAPTCHA_PUBLIC_TOKEN=
|
||||
|
||||
# Don't forget to configure MAIL_MAILER to send mail.
|
||||
FEEDBACK_MAIL_NOTIFICATIONS=false
|
||||
FEEDBACK_MAIL_TO=
|
||||
|
||||
APP_FORCE_HTTPS=false
|
||||
#UNIT_SOURCE="\"172.16.0.0/12\""
|
||||
|
||||
APP_DEFAULT_LOCALE=ru
|
||||
APP_FAKER_LOCALE=ru_RU
|
||||
@ -63,7 +59,7 @@ REDIS_HOST=app-redis
|
||||
REDIS_PASSWORD=null
|
||||
REDIS_PORT=6379
|
||||
|
||||
MAIL_MAILER=smtp
|
||||
MAIL_MAILER=log
|
||||
MAIL_HOST=127.0.0.1
|
||||
MAIL_PORT=2525
|
||||
MAIL_USERNAME=null
|
||||
|
1
app/application/.gitignore
vendored
1
app/application/.gitignore
vendored
@ -8,7 +8,6 @@
|
||||
.env
|
||||
.env.backup
|
||||
.env.production
|
||||
.env.testing
|
||||
.phpunit.result.cache
|
||||
Homestead.json
|
||||
Homestead.yaml
|
||||
|
@ -1,50 +0,0 @@
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
namespace App\Console\Commands\Files;
|
||||
|
||||
use App\Services\Commands\DeleteOldFilesService;
|
||||
use Illuminate\Console\Command;
|
||||
use Illuminate\Support\Carbon;
|
||||
|
||||
final class DeleteOldFilesFromStorage extends Command
|
||||
{
|
||||
/**
|
||||
* The name and signature of the console command.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'files:delete-old-files-from-storage';
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'Remove temporary files or files that have been deleted from the storage table';
|
||||
|
||||
/**
|
||||
* Create a new command instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
*/
|
||||
public function handle(DeleteOldFilesService $deleteOldFilesService): void
|
||||
{
|
||||
$temporaryBeforeDate = Carbon::now()->subDays(3);
|
||||
$deletedBeforeDate = Carbon::now()->subDays(7);
|
||||
|
||||
$result = $deleteOldFilesService->fromStorage($temporaryBeforeDate, $deletedBeforeDate);
|
||||
if ($result->isError()) {
|
||||
$this->error($result->getMessage());
|
||||
return;
|
||||
}
|
||||
$this->info($result->getMessage());
|
||||
}
|
||||
}
|
@ -3,14 +3,12 @@
|
||||
namespace App\Dto\Service\Admin\Project\About;
|
||||
|
||||
use App\Dto\Service\Dto;
|
||||
use App\Dto\Service\Storage\Storages;
|
||||
|
||||
final readonly class StoreUpdate extends Dto
|
||||
{
|
||||
public function __construct(
|
||||
private string $title,
|
||||
private string $description,
|
||||
private Storages $storages,
|
||||
) { }
|
||||
|
||||
public function getTitle(): string
|
||||
@ -22,9 +20,4 @@ public function getDescription(): string
|
||||
{
|
||||
return $this->description;
|
||||
}
|
||||
|
||||
public function getStorages(): Storages
|
||||
{
|
||||
return $this->storages;
|
||||
}
|
||||
}
|
||||
|
@ -2,15 +2,12 @@
|
||||
|
||||
namespace App\Dto\Service\Admin\Project\DocumentationContent;
|
||||
|
||||
use App\Dto\Service\Storage\Storages;
|
||||
|
||||
final readonly class Content
|
||||
{
|
||||
public function __construct(
|
||||
private int $languageId,
|
||||
private string $title,
|
||||
private string $content,
|
||||
private Storages $storages,
|
||||
) { }
|
||||
|
||||
public function getLanguageId(): int
|
||||
@ -27,9 +24,4 @@ public function getContent(): string
|
||||
{
|
||||
return $this->content;
|
||||
}
|
||||
|
||||
public function getStorages(): Storages
|
||||
{
|
||||
return $this->storages;
|
||||
}
|
||||
}
|
||||
|
@ -1,30 +0,0 @@
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
namespace App\Dto\Service\DocumentationContent;
|
||||
|
||||
use App\Dto\Service\Storage\Storages;
|
||||
use App\Models\DocumentationContent;
|
||||
|
||||
final class StorageDto
|
||||
{
|
||||
/**
|
||||
* @var array [][DocumentationContent documentationContent, Storages storages]
|
||||
*/
|
||||
private array $storages = [];
|
||||
|
||||
public function add(DocumentationContent $documentationContent, Storages $storages): void
|
||||
{
|
||||
$this->storages[] = [
|
||||
'documentationContent' => $documentationContent,
|
||||
'storages' => $storages
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array [][DocumentationContent documentationContent, Storages storages]
|
||||
*/
|
||||
public function getStorages(): array
|
||||
{
|
||||
return $this->storages;
|
||||
}
|
||||
}
|
@ -1,29 +0,0 @@
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
namespace App\Dto\View\Volt\Form;
|
||||
|
||||
use App\Enums\Morph;
|
||||
use App\Helpers\Helpers;
|
||||
|
||||
final readonly class WysiwygStorageUpload
|
||||
{
|
||||
public function __construct(
|
||||
private string $inputName,
|
||||
private Morph $morph,
|
||||
) { }
|
||||
|
||||
public function getInputName(): string
|
||||
{
|
||||
return $this->inputName;
|
||||
}
|
||||
|
||||
public function getRequestInputName(): string
|
||||
{
|
||||
return Helpers::formatAttributeNameToRequestName($this->getInputName());
|
||||
}
|
||||
|
||||
public function getMorph(): Morph
|
||||
{
|
||||
return $this->morph;
|
||||
}
|
||||
}
|
@ -2,22 +2,16 @@
|
||||
|
||||
namespace App\Enums;
|
||||
|
||||
use App\Models\DocumentationContent;
|
||||
use App\Models\Project;
|
||||
use App\Models\ProjectContent;
|
||||
|
||||
enum Morph: int
|
||||
{
|
||||
case Project = 1;
|
||||
case DocumentationContent = 2;
|
||||
case ProjectContent = 3;
|
||||
|
||||
public function getPathModel(): string
|
||||
{
|
||||
return match ($this) {
|
||||
self::Project => Project::class,
|
||||
self::DocumentationContent => DocumentationContent::class,
|
||||
self::ProjectContent => ProjectContent::class,
|
||||
self::Project => Project::class,
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -9,43 +9,39 @@
|
||||
enum StorageType: int implements Image, Video, Audio
|
||||
{
|
||||
case Logo = 1;
|
||||
case ContentImages = 2;
|
||||
|
||||
public function getTitle(): string
|
||||
{
|
||||
return match ($this) {
|
||||
self::Logo => __('validation.attributes.logo'),
|
||||
self::ContentImages => __('validation.attributes.content_images'),
|
||||
};
|
||||
}
|
||||
|
||||
public function getAcceptMimes(): array
|
||||
{
|
||||
return match ($this) {
|
||||
self::Logo => ['jpeg', 'jpg', 'png'],
|
||||
self::ContentImages => ['jpeg', 'jpg', 'png'],
|
||||
self::Logo => ['jpeg', 'jpg', 'png'],
|
||||
};
|
||||
}
|
||||
|
||||
public function isImage(): bool
|
||||
{
|
||||
return match ($this) {
|
||||
self::Logo => true,
|
||||
self::ContentImages => true,
|
||||
self::Logo => true,
|
||||
default => false
|
||||
};
|
||||
}
|
||||
|
||||
public function isVideo(): bool
|
||||
{
|
||||
return match ($this) {
|
||||
return match ($this->name) {
|
||||
default => false
|
||||
};
|
||||
}
|
||||
|
||||
public function isAudio(): bool
|
||||
{
|
||||
return match ($this) {
|
||||
return match ($this->name) {
|
||||
default => false
|
||||
};
|
||||
}
|
||||
|
@ -1,18 +0,0 @@
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
namespace App\Exceptions\Services\DocumentationContent;
|
||||
|
||||
use App\ServiceResults\ServiceResultError;
|
||||
|
||||
final class StorageCommandException extends \Exception
|
||||
{
|
||||
public function __construct(private readonly ServiceResultError $resultError, string $message = "", int $code = 0, ?\Throwable $previous = null)
|
||||
{
|
||||
parent::__construct($message, $code, $previous);
|
||||
}
|
||||
|
||||
public function getResultError(): ServiceResultError
|
||||
{
|
||||
return $this->resultError;
|
||||
}
|
||||
}
|
@ -1,8 +0,0 @@
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
namespace App\Exceptions\Services\Rule;
|
||||
|
||||
final class RoleSyncPermissionsCommandHandlerException extends \Exception
|
||||
{
|
||||
|
||||
}
|
@ -19,9 +19,7 @@ public function __construct(
|
||||
|
||||
public function login(): View
|
||||
{
|
||||
return view('login', [
|
||||
'captcha' => config('app.captcha', false),
|
||||
]);
|
||||
return view('login');
|
||||
}
|
||||
|
||||
public function authorization(AuthorizationRequest $request): RedirectResponse
|
||||
|
@ -19,7 +19,6 @@ public function index(Request $request): View
|
||||
return view('site.feedback.index', [
|
||||
'project' => $request->get('project'),
|
||||
'websiteTranslations' => $request->get('websiteTranslations'),
|
||||
'captcha' => config('app.captcha', false),
|
||||
]);
|
||||
}
|
||||
|
||||
|
@ -4,19 +4,10 @@
|
||||
|
||||
use App\Contracts\FormRequestDto;
|
||||
use App\Dto\Service\Admin\Project\About\StoreUpdate;
|
||||
use App\Dto\Service\Storage\Storages;
|
||||
use App\Enums\StorageType;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
final class StoreUpdateRequest extends FormRequest implements FormRequestDto
|
||||
{
|
||||
public function attributes(): array
|
||||
{
|
||||
return [
|
||||
'storage.content_images.*.file' => __('validation.attributes.content_images'),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*/
|
||||
@ -25,7 +16,6 @@ public function rules(): array
|
||||
return [
|
||||
'title' => ['required', 'string', 'max:255',],
|
||||
'description' => ['nullable', 'string',],
|
||||
'storage.content_images.*.file' => ['numeric', 'min:1'],
|
||||
];
|
||||
}
|
||||
|
||||
@ -34,18 +24,6 @@ public function getDto(): StoreUpdate
|
||||
return new StoreUpdate(
|
||||
title: $this->input('title'),
|
||||
description: $this->input('description'),
|
||||
storages: $this->storages(),
|
||||
);
|
||||
}
|
||||
|
||||
private function storages(): Storages
|
||||
{
|
||||
$storages = new Storages();
|
||||
|
||||
$content = $this->input('storage', []);
|
||||
$images = $content['content_images'] ?? [];
|
||||
$storages->addMany($images, StorageType::ContentImages);
|
||||
|
||||
return $storages;
|
||||
}
|
||||
}
|
||||
|
@ -6,19 +6,10 @@
|
||||
use App\Dto\Service\Admin\Project\Documentation\StoreUpdate;
|
||||
use App\Dto\Service\Admin\Project\DocumentationContent\Content;
|
||||
use App\Dto\Service\Admin\Project\DocumentationContent\Contents;
|
||||
use App\Dto\Service\Storage\Storages;
|
||||
use App\Enums\StorageType;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
final class StoreUpdateRequest extends FormRequest implements FormRequestDto
|
||||
{
|
||||
public function attributes(): array
|
||||
{
|
||||
return [
|
||||
'content.*.content_images.*.file' => __('validation.attributes.content_images'),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*/
|
||||
@ -31,7 +22,6 @@ public function rules(): array
|
||||
'category_id' => ['nullable', 'integer', 'exists:documentation_categories,id'],
|
||||
'content.*.title' => ['required', 'string', 'max:255'],
|
||||
'content.*.content' => ['nullable', 'string'],
|
||||
'content.*.content_images.*.file' => ['numeric', 'min:1'],
|
||||
];
|
||||
}
|
||||
|
||||
@ -59,19 +49,8 @@ private function getContents(): Contents
|
||||
languageId: (int) $languageId,
|
||||
title: $content['title'],
|
||||
content: $content['content'] ?? '',
|
||||
storages: $this->contentStorages($content),
|
||||
));
|
||||
}
|
||||
return $contents;
|
||||
}
|
||||
|
||||
private function contentStorages(array $content): Storages
|
||||
{
|
||||
$storages = new Storages();
|
||||
|
||||
$images = $content['content_images'] ?? [];
|
||||
$storages->addMany($images, StorageType::ContentImages);
|
||||
|
||||
return $storages;
|
||||
}
|
||||
}
|
||||
|
@ -13,17 +13,12 @@ final class AuthorizationRequest extends FormRequest implements FormRequestDto
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
$rules = [
|
||||
return [
|
||||
'email' => ['required', 'email', 'max:255'],
|
||||
'password' => ['required', 'min:3'],
|
||||
'captcha-verified' => ['captcha'],
|
||||
'remember' => ['nullable', 'boolean'],
|
||||
];
|
||||
|
||||
if (config('app.captcha', false)) {
|
||||
$rules['captcha-verified'] = ['captcha'];
|
||||
}
|
||||
|
||||
return $rules;
|
||||
}
|
||||
|
||||
public function getDto(): Authorization
|
||||
|
@ -32,17 +32,12 @@ public function attributes(): array
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
$rules = [
|
||||
return [
|
||||
'name' => ['nullable', 'string', 'max:255'],
|
||||
'email' => ['nullable', 'string', 'max:255', 'email'],
|
||||
'message' => ['required', 'string', 'max:5000'],
|
||||
'captcha-verified' => ['captcha'],
|
||||
];
|
||||
|
||||
if (config('app.captcha', false)) {
|
||||
$rules['captcha-verified'] = ['captcha'];
|
||||
}
|
||||
|
||||
return $rules;
|
||||
}
|
||||
|
||||
public function getDto(): Send
|
||||
|
@ -6,9 +6,7 @@
|
||||
use App\Dto\Service\Storage\Upload;
|
||||
use App\Enums\Morph;
|
||||
use App\Enums\StorageType;
|
||||
use Illuminate\Contracts\Validation\Validator;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Illuminate\Http\Exceptions\HttpResponseException;
|
||||
use Illuminate\Validation\Rules\Enum;
|
||||
|
||||
final class ImageRequest extends FormRequest implements FormRequestDto
|
||||
@ -39,20 +37,4 @@ public function getDto(): Upload
|
||||
morph: Morph::from((int) $this->input('morph')),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the error messages for the defined validation rules.*
|
||||
* @return array
|
||||
*/
|
||||
protected function failedValidation(Validator $validator): array
|
||||
{
|
||||
/**
|
||||
* To always return json
|
||||
*/
|
||||
throw new HttpResponseException(response()->json([
|
||||
'errors' => $validator->errors(),
|
||||
'status' => true
|
||||
], 422));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -2,15 +2,13 @@
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use App\Contracts\Models\Storage as StorageContract;
|
||||
use App\Models\Traits\StorageTrait;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
|
||||
final class DocumentationContent extends Model implements StorageContract
|
||||
final class DocumentationContent extends Model
|
||||
{
|
||||
use HasFactory, SoftDeletes, StorageTrait;
|
||||
use HasFactory, SoftDeletes;
|
||||
|
||||
protected $table = 'documentation_content';
|
||||
|
||||
|
@ -2,15 +2,13 @@
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use App\Contracts\Models\Storage as StorageContract;
|
||||
use App\Models\Traits\StorageTrait;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
|
||||
final class ProjectContent extends Model implements StorageContract
|
||||
final class ProjectContent extends Model
|
||||
{
|
||||
use HasFactory, SoftDeletes, StorageTrait;
|
||||
use HasFactory, SoftDeletes;
|
||||
|
||||
protected $table = 'project_content';
|
||||
|
||||
|
@ -1,60 +0,0 @@
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
namespace App\Notifications;
|
||||
|
||||
use App\Enums\Site\ProjectSection;
|
||||
use App\Models\ProjectFeedback;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Notifications\Messages\MailMessage;
|
||||
use Illuminate\Notifications\Notification;
|
||||
|
||||
final class ReviewAdded extends Notification implements ShouldQueue
|
||||
{
|
||||
use Queueable;
|
||||
|
||||
/**
|
||||
* Create a new notification instance.
|
||||
*/
|
||||
public function __construct(
|
||||
private readonly ProjectFeedback $feedback
|
||||
) { }
|
||||
|
||||
/**
|
||||
* Get the notification's delivery channels.
|
||||
*
|
||||
* @return array<int, string>
|
||||
*/
|
||||
public function via(object $notifiable): array
|
||||
{
|
||||
return ['mail'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the mail representation of the notification.
|
||||
*/
|
||||
public function toMail(object $notifiable): MailMessage
|
||||
{
|
||||
$project = $this->feedback->project;
|
||||
|
||||
return (new MailMessage)
|
||||
->subject(__('notification.Review Added: :name', ['name' => $project->name]))
|
||||
->line(__('notification.Added a new review.'))
|
||||
->action(__('notification.Project :name', ['name' => $project->name]), \url(ProjectSection::Home->url($project)))
|
||||
->line( __('site.attributes.name') . ': ' . $this->feedback->name)
|
||||
->line( __('site.attributes.email') . ': ' . $this->feedback->email)
|
||||
->line(__('site.attributes.message') . ': ' . $this->feedback->message);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the array representation of the notification.
|
||||
*
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function toArray(object $notifiable): array
|
||||
{
|
||||
return [
|
||||
//
|
||||
];
|
||||
}
|
||||
}
|
@ -1,17 +0,0 @@
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
namespace App\Policies;
|
||||
|
||||
use App\Models\User;
|
||||
|
||||
final readonly class DocumentationContentPolicy extends Policy
|
||||
{
|
||||
public function upload(User $user): bool
|
||||
{
|
||||
if ($user->hasPermission('documentation.create') || $user->hasPermission('documentation.update')) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
@ -26,13 +26,4 @@ public function update(User $user, ProjectContent $projectContent): bool
|
||||
{
|
||||
return $user->hasPermission('project-content.update');
|
||||
}
|
||||
|
||||
public function upload(User $user): bool
|
||||
{
|
||||
if ($user->hasPermission('project-content.create') || $user->hasPermission('project-content.update')) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -3,10 +3,8 @@
|
||||
namespace App\Providers;
|
||||
|
||||
use App\Enums\Morph;
|
||||
use App\Services\ProjectFeedback\ProjectFeedbackCommandHandler;
|
||||
use App\Services\Search\CreateSearchInstanceCommand;
|
||||
use App\Services\Search\Search;
|
||||
use App\Services\Site\FeedbackService;
|
||||
use App\Services\Storage\Image\ResizeCommandHandler;
|
||||
use App\Services\Storage\ImageService;
|
||||
use App\Services\Storage\StorageCommandHandler;
|
||||
@ -33,15 +31,7 @@ public function register(): void
|
||||
});
|
||||
|
||||
$this->app->bind(StorageCommandHandler::class, function () {
|
||||
return new StorageCommandHandler(disc: (string) \config('storage.disk'));
|
||||
});
|
||||
|
||||
$this->app->bind(FeedbackService::class, function (Application $app) {
|
||||
return new FeedbackService(
|
||||
$app->make(ProjectFeedbackCommandHandler::class),
|
||||
(bool) \config('feedback.mail_notifications', false),
|
||||
\config('feedback.mail_to', null),
|
||||
);
|
||||
return new StorageCommandHandler(disc: (string) config('storage.disk'));
|
||||
});
|
||||
|
||||
$this->app->bind(ImageService::class, function (Application $app) {
|
||||
|
@ -11,6 +11,7 @@
|
||||
use App\Dto\Builder\DocumentationCategory as DocumentationCategoryBuilderDto;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\Relations\HasOne;
|
||||
use Illuminate\Support\Collection;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
final readonly class DocumentationCategoryRepository
|
||||
@ -62,7 +63,7 @@ public function isExistsSlug(int $versionId, string $slug, ?int $exceptId = null
|
||||
->exists();
|
||||
}
|
||||
|
||||
public function getForSelect(DocumentationVersion $version, ?ProjectLanguage $defaultLanguage, ?DocumentationCategory $exceptCategory = null, array $withExcepts = []): array
|
||||
public function getForSelect(?ProjectLanguage $defaultLanguage, ?DocumentationCategory $exceptCategory = null, array $withExcepts = []): array
|
||||
{
|
||||
$with = [
|
||||
'content' => function (HasOne $hasOne) use ($defaultLanguage) {
|
||||
@ -72,7 +73,7 @@ public function getForSelect(DocumentationVersion $version, ?ProjectLanguage $de
|
||||
}
|
||||
];
|
||||
|
||||
$categories = $version->categories()
|
||||
$categories = DocumentationCategory::query()
|
||||
->with($with)
|
||||
->when($exceptCategory, function (Builder $query, DocumentationCategory $exceptCategory) {
|
||||
$query->whereNotIn(
|
||||
|
@ -4,7 +4,6 @@
|
||||
|
||||
use App\Contracts\ServiceResultError;
|
||||
use App\Dto\Service\Admin\Project\About\StoreUpdate;
|
||||
use App\Enums\Morph;
|
||||
use App\Models\ProjectContent;
|
||||
use App\Models\User;
|
||||
use App\Repositories\ProjectContentRepository;
|
||||
@ -14,7 +13,6 @@
|
||||
use App\ServiceResults\StoreUpdateResult;
|
||||
use App\Services\ProjectContent\ProjectContentCommandHandler;
|
||||
use App\Services\Service;
|
||||
use App\Services\Storage\StorageService;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
final class AboutService extends Service
|
||||
@ -24,7 +22,6 @@ public function __construct(
|
||||
private readonly ProjectLanguageRepository $projectLanguageRepository,
|
||||
private readonly ProjectContentRepository $projectContentRepository,
|
||||
private readonly ProjectContentCommandHandler $projectContentCommandHandler,
|
||||
private readonly StorageService $storageService,
|
||||
) { }
|
||||
|
||||
public function languages(int $projectId, User $user): ServiceResultError | ServiceResultArray
|
||||
@ -91,19 +88,11 @@ private function store(int $projectId, int $languageId, StoreUpdate $data, User
|
||||
if ($user->cannot('create', ProjectContent::class)) {
|
||||
return $this->errFobidden(__('Access is denied'));
|
||||
}
|
||||
|
||||
$storages = $this->storageService->getStoragesAndValidate($data->getStorages(), Morph::ProjectContent);
|
||||
if (!$storages->isSuccess()) {
|
||||
return $storages;
|
||||
}
|
||||
|
||||
try {
|
||||
$aboutProject = DB::transaction(function () use ($data, $projectId, $languageId, $storages) {
|
||||
$aboutProject = DB::transaction(function () use ($data, $projectId, $languageId) {
|
||||
$dataAboutProject = $this->getDataAboutProject($data);
|
||||
|
||||
$aboutProject = $this->projectContentCommandHandler->handleStore($projectId, $languageId, $dataAboutProject);
|
||||
$this->storageService->saveAndDelete($aboutProject, $storages);
|
||||
return $aboutProject;
|
||||
return $this->projectContentCommandHandler->handleStore($projectId, $languageId, $dataAboutProject);
|
||||
});
|
||||
} catch (\Throwable $e) {
|
||||
report($e);
|
||||
@ -119,19 +108,11 @@ private function update(ProjectContent $content, StoreUpdate $data, User $user):
|
||||
return $this->errFobidden(__('Access is denied'));
|
||||
}
|
||||
|
||||
$storages = $this->storageService->getStoragesAndValidate($data->getStorages(), Morph::ProjectContent);
|
||||
if (!$storages->isSuccess()) {
|
||||
return $storages;
|
||||
}
|
||||
|
||||
try {
|
||||
$aboutProject = DB::transaction(function () use ($data, $content, $storages) {
|
||||
$aboutProject = DB::transaction(function () use ($data, $content) {
|
||||
$dataAboutProject = $this->getDataAboutProject($data);
|
||||
|
||||
$aboutProject = $this->projectContentCommandHandler->handleUpdate($content, $dataAboutProject);
|
||||
$this->storageService->saveAndDelete($aboutProject, $storages);
|
||||
|
||||
return $aboutProject;
|
||||
return $this->projectContentCommandHandler->handleUpdate($content, $dataAboutProject);
|
||||
});
|
||||
} catch (\Throwable $e) {
|
||||
report($e);
|
||||
|
@ -89,7 +89,7 @@ public function create(int $projectId, int $versionId, User $user): ServiceResul
|
||||
'version' => $version,
|
||||
'project' => $project,
|
||||
'category' => new DocumentationCategory(),
|
||||
'categories' => $this->documentationCategoryRepository->getForSelect($version, $defaultLanguage),
|
||||
'categories' => $this->documentationCategoryRepository->getForSelect($defaultLanguage),
|
||||
]);
|
||||
}
|
||||
|
||||
@ -119,7 +119,7 @@ public function edit(int $projectId, int $versionId, int $categoryId, User $user
|
||||
'version' => $version,
|
||||
'project' => $project,
|
||||
'category' => $category,
|
||||
'categories' => $this->documentationCategoryRepository->getForSelect($version, $defaultLanguage, $category, $withCategories),
|
||||
'categories' => $this->documentationCategoryRepository->getForSelect($defaultLanguage, $category, $withCategories),
|
||||
]);
|
||||
}
|
||||
|
||||
|
@ -5,13 +5,13 @@
|
||||
use App\Dto\Builder\Documentation as DocumentationBuilderDto;
|
||||
use App\Dto\QuerySettingsDto;
|
||||
use App\Dto\Service\Admin\Project\Documentation\StoreUpdate;
|
||||
use App\Exceptions\Services\DocumentationContent\StorageCommandException;
|
||||
use App\Models\Documentation;
|
||||
use App\Models\ProjectLanguage;
|
||||
use App\Models\User;
|
||||
use App\Repositories\DocumentationCategoryRepository;
|
||||
use App\Repositories\DocumentationRepository;
|
||||
use App\Repositories\DocumentationVersionRepository;
|
||||
use App\Repositories\ProjectRepository;
|
||||
use App\ServiceResults\ServiceResultArray;
|
||||
use App\ServiceResults\ServiceResultError;
|
||||
use App\ServiceResults\ServiceResultSuccess;
|
||||
@ -89,7 +89,7 @@ public function create(int $projectId, int $versionId, User $user): ServiceResul
|
||||
'version' => $version,
|
||||
'project' => $project,
|
||||
'documentation' => new Documentation(),
|
||||
'categories' => $this->documentationCategoryRepository->getForSelect($version, $defaultLanguage),
|
||||
'categories' => $this->documentationCategoryRepository->getForSelect($defaultLanguage),
|
||||
]);
|
||||
}
|
||||
|
||||
@ -119,7 +119,7 @@ public function edit(int $projectId, int $versionId, int $documentationId, User
|
||||
'version' => $version,
|
||||
'project' => $project,
|
||||
'documentation' => $documentation,
|
||||
'categories' => $this->documentationCategoryRepository->getForSelect($version, $defaultLanguage, null, $withCategories),
|
||||
'categories' => $this->documentationCategoryRepository->getForSelect($defaultLanguage, null, $withCategories),
|
||||
]);
|
||||
}
|
||||
|
||||
@ -150,8 +150,6 @@ public function store(int $projectId, int $versionId, StoreUpdate $data, User $u
|
||||
|
||||
return $documentation;
|
||||
});
|
||||
} catch (StorageCommandException $e) {
|
||||
return $e->getResultError();
|
||||
} catch (\Throwable $e) {
|
||||
report($e);
|
||||
return $this->errService(__('Server Error'));
|
||||
@ -192,8 +190,6 @@ public function update(int $projectId, int $versionId, int $documentationId, Sto
|
||||
|
||||
return $documentation;
|
||||
});
|
||||
} catch (StorageCommandException $e) {
|
||||
return $e->getResultError();
|
||||
} catch (\Throwable $e) {
|
||||
report($e);
|
||||
return $this->errService(__('Server Error'));
|
||||
|
@ -1,46 +0,0 @@
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
namespace App\Services\Commands;
|
||||
|
||||
use App\Models\Storage as StorageModel;
|
||||
use App\ServiceResults\ServiceResultError;
|
||||
use App\ServiceResults\ServiceResultSuccess;
|
||||
use App\Services\Service;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Support\Carbon;
|
||||
use Illuminate\Support\Facades\Storage as StorageSupport;
|
||||
|
||||
final class DeleteOldFilesService extends Service
|
||||
{
|
||||
/**
|
||||
* $temporaryBeforeDate = date of deletion of temporary files
|
||||
* $deletedBeforeDate = date of deletion files that were marked as deleted
|
||||
*
|
||||
* @param Carbon $temporaryBeforeDate
|
||||
* @param Carbon $deletedBeforeDate
|
||||
* @return ServiceResultError|ServiceResultSuccess
|
||||
*/
|
||||
public function fromStorage(Carbon $temporaryBeforeDate, Carbon $deletedBeforeDate): ServiceResultError|ServiceResultSuccess
|
||||
{
|
||||
$disk = config('storage.disk');
|
||||
|
||||
StorageModel::withTrashed()
|
||||
->where(function (Builder $query) use($temporaryBeforeDate) {
|
||||
$query->whereNull('morph_id')->where('updated_at', '<', $temporaryBeforeDate);
|
||||
})->orWhere(function (Builder $query) use($deletedBeforeDate) {
|
||||
$query->whereNotNull('deleted_at')->where('deleted_at', '<', $deletedBeforeDate);
|
||||
})->chunkById(100, function ($items) use($disk) {
|
||||
$deleteIds = [];
|
||||
foreach ($items as $item) {
|
||||
$deleteIds[] = $item->id;
|
||||
|
||||
if (StorageSupport::disk($disk)->exists($item->file)) {
|
||||
StorageSupport::disk($disk)->delete($item->file);
|
||||
}
|
||||
}
|
||||
StorageModel::withTrashed()->whereIn('id', $deleteIds)->forceDelete();
|
||||
});
|
||||
|
||||
return $this->ok(__('Old Files deleted.'));
|
||||
}
|
||||
}
|
@ -4,33 +4,18 @@
|
||||
|
||||
use App\Dto\Service\Admin\Project\DocumentationContent\Content;
|
||||
use App\Dto\Service\Admin\Project\DocumentationContent\Contents;
|
||||
use App\Dto\Service\DocumentationContent\StorageDto;
|
||||
use App\Exceptions\Services\DocumentationContent\ContentSaveException;
|
||||
use App\Exceptions\Services\DocumentationContent\StorageCommandException;
|
||||
use App\Models\Documentation;
|
||||
use App\Models\DocumentationContent;
|
||||
use App\Models\Project;
|
||||
|
||||
final readonly class ModelSyncCommand
|
||||
{
|
||||
public function __construct(
|
||||
private StorageCommand $storageCommand,
|
||||
) { }
|
||||
|
||||
/**
|
||||
* @throws StorageCommandException
|
||||
* @throws ContentSaveException
|
||||
*/
|
||||
public function execute(Project $project, Documentation $documentation, Contents $contents): void
|
||||
{
|
||||
$storageDto = new StorageDto();
|
||||
|
||||
$languages = $project->languages;
|
||||
$documentationContents = $documentation->contents;
|
||||
|
||||
$newContents = [];
|
||||
$contentsStorageCreated = [];
|
||||
$contentLanguages = [];
|
||||
foreach ($contents->getContents() as $content) {
|
||||
/** @var Content $content */
|
||||
$language = $languages->firstWhere('id', $content->getLanguageId());
|
||||
@ -41,29 +26,15 @@ public function execute(Project $project, Documentation $documentation, Contents
|
||||
$model = $documentationContents->firstWhere('language_id', $language->id);
|
||||
$data = $this->getData($content);
|
||||
if (\is_null($model)) {
|
||||
$contentsStorageCreated[$content->getLanguageId()] = $content->getStorages();
|
||||
$newContents[] = array_merge(['language_id' => $content->getLanguageId()], $data);
|
||||
$contentLanguages[] = $content->getLanguageId();
|
||||
continue;
|
||||
}
|
||||
$storageDto->add($model, $content->getStorages());
|
||||
$model->update($data);
|
||||
}
|
||||
|
||||
if (!empty($newContents)) {
|
||||
$documentation->contents()->createMany($newContents);
|
||||
$contents = $documentation->contents()->whereIn('language_id', $contentLanguages)->get();
|
||||
foreach ($contents as $content) {
|
||||
/** @var DocumentationContent $content */
|
||||
if (!isset($contentsStorageCreated[$content->language_id])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$storageDto->add($content, $contentsStorageCreated[$content->language_id]);
|
||||
}
|
||||
}
|
||||
|
||||
$this->storageCommand->execute($storageDto);
|
||||
}
|
||||
|
||||
private function getData(Content $content): array
|
||||
|
@ -1,31 +0,0 @@
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
namespace App\Services\DocumentationContent;
|
||||
|
||||
use App\Dto\Service\DocumentationContent\StorageDto;
|
||||
use App\Enums\Morph;
|
||||
use App\Exceptions\Services\DocumentationContent\StorageCommandException;
|
||||
use App\Services\Storage\StorageService;
|
||||
|
||||
final readonly class StorageCommand
|
||||
{
|
||||
public function __construct(
|
||||
private StorageService $storageService,
|
||||
) { }
|
||||
|
||||
|
||||
/**
|
||||
* @throws StorageCommandException
|
||||
*/
|
||||
public function execute(StorageDto $storageDto): void
|
||||
{
|
||||
foreach ($storageDto->getStorages() as $storage) {
|
||||
$storages = $this->storageService->getStoragesAndValidate($storage['storages'], Morph::DocumentationContent, $storage['documentationContent']->id);
|
||||
if (!$storages->isSuccess()) {
|
||||
throw new StorageCommandException($storages, 'Error when adding a file to storage: ' . $storages->getMessage());
|
||||
}
|
||||
|
||||
$this->storageService->saveAndDelete($storage['documentationContent'], $storages);
|
||||
}
|
||||
}
|
||||
}
|
@ -3,7 +3,7 @@
|
||||
namespace App\Services\Role;
|
||||
|
||||
use App\Enums\Permission;
|
||||
use App\Exceptions\Services\Rule\RoleSyncPermissionsCommandHandlerException;
|
||||
use App\Exceptions\Rule\RoleSyncPermissionsCommandHandlerException;
|
||||
use App\Models\Role;
|
||||
use App\Models\RolePermission;
|
||||
|
||||
|
@ -5,44 +5,32 @@
|
||||
use App\Dto\Service\Site\Feedback\Send;
|
||||
use App\Models\Project;
|
||||
use App\Models\User;
|
||||
use App\Notifications\ReviewAdded;
|
||||
use App\ServiceResults\ServiceResultError;
|
||||
use App\ServiceResults\ServiceResultSuccess;
|
||||
use App\Services\ProjectFeedback\ProjectFeedbackCommandHandler;
|
||||
use App\Services\Service;
|
||||
use App\Services\WebsiteTranslations;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Notification;
|
||||
|
||||
final class FeedbackService extends Service
|
||||
{
|
||||
public function __construct(
|
||||
private readonly ProjectFeedbackCommandHandler $feedbackCommandHandler,
|
||||
private readonly bool $isNotifications = false,
|
||||
private readonly ?string $mailNotifications = null,
|
||||
) { }
|
||||
|
||||
public function send(Send $send, Project $project, WebsiteTranslations $websiteTranslations, ?User $user = null): ServiceResultError | ServiceResultSuccess
|
||||
{
|
||||
try {
|
||||
$feedback = DB::transaction(function () use ($send, $project, $user) {
|
||||
DB::transaction(function () use ($send, $project, $user) {
|
||||
$data = $this->getDataFeedback($send);
|
||||
$data['user_id'] = $user?->id;
|
||||
return $this->feedbackCommandHandler->handleStore($project, $data);
|
||||
$this->feedbackCommandHandler->handleStore($project, $data);
|
||||
});
|
||||
} catch (\Throwable $e) {
|
||||
report($e);
|
||||
return $this->errService($websiteTranslations->translate('Server Error'));
|
||||
}
|
||||
|
||||
try {
|
||||
if ($this->isNotifications) {
|
||||
Notification::route('mail', $this->mailNotifications)->notify(new ReviewAdded($feedback));
|
||||
}
|
||||
} catch (\Throwable $e) {
|
||||
report($e);
|
||||
}
|
||||
|
||||
return $this->ok($websiteTranslations->translate('site.Message sent successfully'));
|
||||
}
|
||||
|
||||
|
@ -2,17 +2,15 @@
|
||||
|
||||
namespace App\View\Components\Volt\Forms;
|
||||
|
||||
use App\Dto\View\Volt\Form\WysiwygStorageUpload;
|
||||
use Illuminate\Support\Str;
|
||||
use Illuminate\View\View;
|
||||
|
||||
final class TextareaWysiwyg extends Form
|
||||
{
|
||||
public function __construct(
|
||||
private readonly string $title,
|
||||
private readonly string $name,
|
||||
private readonly ?string $value = '',
|
||||
private readonly ?WysiwygStorageUpload $storageUpload = null,
|
||||
private readonly string $title,
|
||||
private readonly string $name,
|
||||
private readonly ?string $value = '',
|
||||
) { }
|
||||
|
||||
protected function getName(): string
|
||||
@ -30,11 +28,6 @@ private function getValue(): string
|
||||
return (string) old($this->getRequestName(), $this->value);
|
||||
}
|
||||
|
||||
public function getStorageUpload(): ?WysiwygStorageUpload
|
||||
{
|
||||
return $this->storageUpload;
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
@ -44,11 +37,10 @@ public function render(): View
|
||||
|
||||
return view('components.volt.forms.textarea-wysiwyg', [
|
||||
'tinymceLicenseKey' => $tinymceLicenseKey,
|
||||
'title' => $this->getTitle(),
|
||||
'name' => $this->getName(),
|
||||
'requestName' => $this->getRequestName(),
|
||||
'value' => $this->getValue(),
|
||||
'storageUpload' => $this->getStorageUpload(),
|
||||
'title' => $this->getTitle(),
|
||||
'name' => $this->getName(),
|
||||
'requestName' => $this->getRequestName(),
|
||||
'value' => $this->getValue(),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
@ -28,15 +28,6 @@
|
||||
|
||||
'env' => env('APP_ENV', 'production'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Сaptcha
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Enables or disables captcha.
|
||||
*/
|
||||
'captcha' => (bool) env('APP_CAPTCHA', false),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Application Debug Mode
|
||||
|
@ -1,9 +0,0 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
/**
|
||||
* Enable new review alerts.
|
||||
*/
|
||||
'mail_notifications' => (bool) env('FEEDBACK_MAIL_NOTIFICATIONS', false),
|
||||
'mail_to' => env('FEEDBACK_MAIL_TO', null),
|
||||
];
|
@ -1,32 +0,0 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('storage', function (Blueprint $table) {
|
||||
$table->dropIndex(['morph_id']);
|
||||
$table->index(['morph_id', 'updated_at']);
|
||||
$table->index(['deleted_at']);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('storage', function (Blueprint $table) {
|
||||
$table->dropIndex(['morph_id', 'updated_at']);
|
||||
$table->dropIndex(['deleted_at']);
|
||||
$table->index(['morph_id']);
|
||||
});
|
||||
}
|
||||
};
|
@ -267,6 +267,5 @@
|
||||
"Documentation successfully removed": "Documentation successfully removed",
|
||||
"Category successfully created": "Category successfully created",
|
||||
"Category updated successfully": "Category updated successfully",
|
||||
"Category successfully deleted": "Category successfully deleted",
|
||||
"Old Files deleted": "Old Files deleted"
|
||||
"Category successfully deleted": "Category successfully deleted"
|
||||
}
|
||||
|
@ -1,6 +0,0 @@
|
||||
<?php
|
||||
return [
|
||||
'Added a new review.' => 'Added a new review.',
|
||||
'Review Added: :name' => 'Review Added: :name',
|
||||
'Project :name' => 'Project :name',
|
||||
];
|
@ -307,6 +307,5 @@
|
||||
'content.*.title' => 'title',
|
||||
'content.*.content' => 'content',
|
||||
'category_id' => 'category',
|
||||
'content_images' => 'content images',
|
||||
],
|
||||
];
|
||||
|
@ -267,6 +267,5 @@
|
||||
"Documentation successfully removed": "Документация успешно удалена",
|
||||
"Category successfully created": "Категория успешно создана",
|
||||
"Category updated successfully": "Категория успешно обновлена",
|
||||
"Category successfully deleted": "Категория успешно удалена",
|
||||
"Old Files deleted": "Старые файлы удалены"
|
||||
"Category successfully deleted": "Категория успешно удалена"
|
||||
}
|
||||
|
@ -1,6 +0,0 @@
|
||||
<?php
|
||||
return [
|
||||
'Added a new review.' => 'Добавили новый отзыв.',
|
||||
'Review Added: :name' => 'Отзыв добавлен: :name',
|
||||
'Project :name' => 'Проект :name',
|
||||
];
|
@ -307,6 +307,5 @@
|
||||
'content.*.title' => 'заголовок',
|
||||
'content.*.content' => 'контент',
|
||||
'category_id' => 'категория',
|
||||
'content_images' => 'изображения контента',
|
||||
],
|
||||
];
|
||||
|
16
app/application/package-lock.json
generated
16
app/application/package-lock.json
generated
@ -5,7 +5,6 @@
|
||||
"packages": {
|
||||
"": {
|
||||
"dependencies": {
|
||||
"@fancyapps/ui": "^5.0.36",
|
||||
"@popperjs/core": "^2.9.2",
|
||||
"bootstrap": "5.0.2",
|
||||
"chartist": "^0.11.4",
|
||||
@ -18,6 +17,7 @@
|
||||
"sass": "^1.47.0",
|
||||
"simplebar": "^5.3.4",
|
||||
"smooth-scroll": "^16.1.3",
|
||||
"sweetalert2": "^11.0.18",
|
||||
"tinymce": "^7.0.1",
|
||||
"vanillajs-datepicker": "^1.2.0",
|
||||
"waypoints": "^4.0.1"
|
||||
@ -398,11 +398,6 @@
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/@fancyapps/ui": {
|
||||
"version": "5.0.36",
|
||||
"resolved": "https://registry.npmjs.org/@fancyapps/ui/-/ui-5.0.36.tgz",
|
||||
"integrity": "sha512-GMygQzp1MBTFNTT6AzpbL6pXTD6bTxwjmmpI1fe8Ozmmiseu8/g82Sudl1YhcbZmS4bJgaBOF5THDFGpXQ1fDw=="
|
||||
},
|
||||
"node_modules/@jridgewell/gen-mapping": {
|
||||
"version": "0.3.5",
|
||||
"resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.5.tgz",
|
||||
@ -2070,6 +2065,15 @@
|
||||
"url": "https://github.com/chalk/supports-color?sponsor=1"
|
||||
}
|
||||
},
|
||||
"node_modules/sweetalert2": {
|
||||
"version": "11.10.7",
|
||||
"resolved": "https://registry.npmjs.org/sweetalert2/-/sweetalert2-11.10.7.tgz",
|
||||
"integrity": "sha512-5Jlzrmaitay6KzU+2+LhYu9q+L4v/dZ8oZyEDH14ep0C/QilCnFLHmqAyD/Lhq/lm5DiwsOs6Tr58iv8k3wyGg==",
|
||||
"funding": {
|
||||
"type": "individual",
|
||||
"url": "https://github.com/sponsors/limonte"
|
||||
}
|
||||
},
|
||||
"node_modules/tapable": {
|
||||
"version": "2.2.1",
|
||||
"resolved": "https://registry.npmjs.org/tapable/-/tapable-2.2.1.tgz",
|
||||
|
@ -6,7 +6,6 @@
|
||||
"build": "vite build"
|
||||
},
|
||||
"dependencies": {
|
||||
"@fancyapps/ui": "^5.0.36",
|
||||
"@popperjs/core": "^2.9.2",
|
||||
"bootstrap": "5.0.2",
|
||||
"chartist": "^0.11.4",
|
||||
@ -19,6 +18,7 @@
|
||||
"sass": "^1.47.0",
|
||||
"simplebar": "^5.3.4",
|
||||
"smooth-scroll": "^16.1.3",
|
||||
"sweetalert2": "^11.0.18",
|
||||
"tinymce": "^7.0.1",
|
||||
"vanillajs-datepicker": "^1.2.0",
|
||||
"waypoints": "^4.0.1"
|
||||
|
@ -1,6 +0,0 @@
|
||||
import { Fancybox } from "@fancyapps/ui";
|
||||
import "@fancyapps/ui/dist/fancybox/fancybox.css";
|
||||
|
||||
Fancybox.bind('a.image-open', {
|
||||
//
|
||||
});
|
@ -18,10 +18,6 @@ import "prismjs/components/prism-nginx.js";
|
||||
import "prismjs/components/prism-docker.js";
|
||||
import "prismjs/components/prism-diff.js";
|
||||
import "prismjs/components/prism-php.js";
|
||||
import "prismjs/components/prism-yaml.js";
|
||||
import "prismjs/components/prism-bash.js"
|
||||
import "prismjs/components/prism-json.js"
|
||||
import "prismjs/components/prism-toml.js"
|
||||
|
||||
|
||||
import "prismjs/plugins/toolbar/prism-toolbar.css";
|
||||
|
@ -1,10 +1,8 @@
|
||||
let blockDocumentationVersion = document.querySelector('#documentation-version');
|
||||
if (blockDocumentationVersion) {
|
||||
blockDocumentationVersion.querySelector('.documentation-version__button').addEventListener('click', (e) => {
|
||||
if (blockDocumentationVersion.classList.contains('active')) {
|
||||
blockDocumentationVersion.classList.remove('active');
|
||||
} else {
|
||||
blockDocumentationVersion.classList.add('active');
|
||||
}
|
||||
});
|
||||
}
|
||||
blockDocumentationVersion.querySelector('.documentation-version__button').addEventListener('click', (e) => {
|
||||
if (blockDocumentationVersion.classList.contains('active')) {
|
||||
blockDocumentationVersion.classList.remove('active');
|
||||
} else {
|
||||
blockDocumentationVersion.classList.add('active');
|
||||
}
|
||||
});
|
||||
|
@ -29,39 +29,6 @@ body {
|
||||
|
||||
.content {
|
||||
flex: 1 0 auto;
|
||||
|
||||
img {
|
||||
max-width: 100%;
|
||||
object-fit: contain;
|
||||
}
|
||||
|
||||
.image-open {
|
||||
display: block;
|
||||
|
||||
img {
|
||||
max-width: 100%;
|
||||
height: auto;
|
||||
}
|
||||
}
|
||||
|
||||
@supports (--custom:property) {
|
||||
[style*="--aspect-ratio"] {
|
||||
position: relative;
|
||||
}
|
||||
[style*="--aspect-ratio"]::before {
|
||||
content: "";
|
||||
display: block;
|
||||
padding-bottom: calc(100% / (var(--aspect-ratio)));
|
||||
}
|
||||
[style*="--aspect-ratio"] img {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
height: 100%;
|
||||
max-width: 100%;
|
||||
object-fit: cover;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.footer {
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1 +0,0 @@
|
||||
@vite('resources/fancybox/app.js')
|
@ -1 +0,0 @@
|
||||
<script src="{{ asset('/build/tinymce/tinymce.min.js') }}" referrerpolicy="origin"></script>
|
@ -1,4 +0,0 @@
|
||||
@pushOnce('scripts')
|
||||
@include('_tinymce')
|
||||
@include('_prism')
|
||||
@endpushonce
|
@ -1,11 +1,6 @@
|
||||
@csrf
|
||||
<x-volt.forms.input :title="__('validation.attributes.title')" name="title" type="text" :value="$content->title" required autofocus />
|
||||
<x-volt.forms.textarea-wysiwyg
|
||||
:title="__('validation.attributes.description')"
|
||||
name="description"
|
||||
:value="$content->description"
|
||||
:storageUpload="new \App\Dto\View\Volt\Form\WysiwygStorageUpload(inputName: 'storage', morph: \App\Enums\Morph::ProjectContent)"
|
||||
/>
|
||||
<x-volt.forms.textarea-wysiwyg :title="__('validation.attributes.description')" name="description" :value="$content->description" />
|
||||
|
||||
@canany(['create', 'update'], $content)
|
||||
<button class="btn btn-primary" type="submit">{{ __('Save') }}</button>
|
||||
|
@ -1,22 +1,15 @@
|
||||
@csrf
|
||||
<x-volt.forms.checkbox :title="__('validation.attributes.is_public')" name="is_public" checkboxValue="1"
|
||||
notCheckedValue="0" :userValue="(string) $documentation->is_public"/>
|
||||
<x-volt.forms.input :title="__('validation.attributes.slug')" allowed-characters="a-z0-9.-_" name="slug" type="text"
|
||||
:value="$documentation->slug" required autofocus/>
|
||||
<x-volt.forms.input :title="__('validation.attributes.sort')" name="sort" type="number" :value="$documentation->sort"
|
||||
required/>
|
||||
<x-volt.forms.select :title="__('validation.attributes.category_id')" name="category_id" :list="$categories"
|
||||
:value="(string) $documentation->category?->id">
|
||||
<x-volt.forms.checkbox :title="__('validation.attributes.is_public')" name="is_public" checkboxValue="1" notCheckedValue="0" :userValue="(string) $documentation->is_public" />
|
||||
<x-volt.forms.input :title="__('validation.attributes.slug')" allowed-characters="a-z0-9.-_" name="slug" type="text" :value="$documentation->slug" required autofocus />
|
||||
<x-volt.forms.input :title="__('validation.attributes.sort')" name="sort" type="number" :value="$documentation->sort" required />
|
||||
<x-volt.forms.select :title="__('validation.attributes.category_id')" name="category_id" :list="$categories" :value="(string) $documentation->category?->id">
|
||||
<option value=""></option>
|
||||
</x-volt.forms.select>
|
||||
|
||||
<nav>
|
||||
<div class="nav nav-tabs mb-4" id="nav-language-tab" role="tablist">
|
||||
@foreach($project->languages as $index => $language)
|
||||
<a class="nav-item nav-link @if($index === 0) active @endif" id="language-{{ $language->id }}-tab"
|
||||
data-bs-toggle="tab" href="#language-{{ $language->id }}" role="tab"
|
||||
aria-controls="language-{{ $language->id }}"
|
||||
aria-selected="{{ $index ? 'false' : 'true' }}">{{ $language->title }}</a>
|
||||
<a class="nav-item nav-link @if($index === 0) active @endif" id="language-{{ $language->id }}-tab" data-bs-toggle="tab" href="#language-{{ $language->id }}" role="tab" aria-controls="language-{{ $language->id }}" aria-selected="{{ $index ? 'false' : 'true' }}">{{ $language->title }}</a>
|
||||
@endforeach
|
||||
</div>
|
||||
</nav>
|
||||
@ -25,22 +18,10 @@
|
||||
@php
|
||||
$content = $documentation->contents->firstWhere('language_id', $language->id);
|
||||
@endphp
|
||||
<div class="tab-pane fade @if($index === 0) show active @endif" id="language-{{ $language->id }}"
|
||||
role="tabpanel" aria-labelledby="language-{{ $language->id }}-tab">
|
||||
<x-volt.forms.checkbox :title="__('Edit')" :name="'content-enable-' . $language->id"
|
||||
:user-value="($index === 0) ? 1 : 0" class="content-enable" checkbox-value="1"
|
||||
notCheckedValue="0"/>
|
||||
<x-volt.forms.input :title="__('validation.attributes.title')"
|
||||
:name="'content[' . $language->id . '][title]'" type="text" class="language-content"
|
||||
:disabled="$index !== 0" :value="$content?->title ?? ''" required/>
|
||||
<x-volt.forms.textarea-wysiwyg
|
||||
:title="__('validation.attributes.content')"
|
||||
:storageUpload="new \App\Dto\View\Volt\Form\WysiwygStorageUpload(inputName: 'content[' . $language->id . ']', morph: \App\Enums\Morph::DocumentationContent)"
|
||||
:name="'content[' . $language->id . '][content]'"
|
||||
class="language-content"
|
||||
:value="$content?->content"
|
||||
:disabled="$index !== 0"
|
||||
/>
|
||||
<div class="tab-pane fade @if($index === 0) show active @endif" id="language-{{ $language->id }}" role="tabpanel" aria-labelledby="language-{{ $language->id }}-tab">
|
||||
<x-volt.forms.checkbox :title="__('Edit')" :name="'content-enable-' . $language->id" :user-value="($index === 0) ? 1 : 0" class="content-enable" checkbox-value="1" notCheckedValue="0"/>
|
||||
<x-volt.forms.input :title="__('validation.attributes.title')" :name="'content[' . $language->id . '][title]'" type="text" class="language-content" :disabled="$index !== 0" :value="$content?->title ?? ''" required />
|
||||
<x-volt.forms.textarea-wysiwyg :title="__('validation.attributes.content')" :name="'content[' . $language->id . '][content]'" class="language-content" :value="$content?->content" :disabled="$index !== 0" />
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
|
@ -1,121 +1,27 @@
|
||||
@php
|
||||
$tinyId = \Illuminate\Support\Str::random(7);
|
||||
$tinyId = 'form-textarea-wysiwyg-' . $tinyId;
|
||||
|
||||
$images = [];
|
||||
$files = [];
|
||||
/** @var \App\Dto\View\Volt\Form\WysiwygStorageUpload | null $storageUpload */
|
||||
if ($storageUpload !== null) {
|
||||
$storages = old($storageUpload->getRequestInputName(), []);
|
||||
$images = $storages['content_images'] ?? [];
|
||||
}
|
||||
@endphp
|
||||
<div class="mb-3">
|
||||
<label for="{{ $tinyId }}">{{ $title }}</label>
|
||||
<textarea class="form-control {{ $attributes->get('class') }} textarea-tinymce @error($requestName) is-invalid @enderror" name="{{ $name }}" id="{{ $tinyId }}" rows="3">{{ $value }}</textarea>
|
||||
@foreach($images as $image)
|
||||
@continue( empty($image['file']) )
|
||||
<input type="hidden" value="{{ $image['file'] }}" name="{{ $storageUpload->getInputName() }}[content_images][][file]';">
|
||||
@endforeach
|
||||
<label for="form-textarea-wysiwyg-{{ $requestName }}">{{ $title }}</label>
|
||||
<textarea class="form-control {{ $attributes->get('class') }} textarea-tinymce @error($requestName) is-invalid @enderror" name="{{ $name }}" id="form-textarea-wysiwyg-{{ $requestName }}" rows="3">{{ $value }}</textarea>
|
||||
@error($requestName)
|
||||
<span class="invalid-feedback">{{ $message }}</span>
|
||||
<span class="invalid-feedback">{{ $message }}</span>
|
||||
@enderror
|
||||
</div>
|
||||
@include('admin._scripts._tinymce')
|
||||
@push('scripts')
|
||||
@pushOnce('scripts')
|
||||
<script src="{{ asset('/build/tinymce/tinymce.min.js') }}" referrerpolicy="origin"></script>
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
@if($storageUpload !== null)
|
||||
const textarea = document.querySelector('#{{ $tinyId }}');
|
||||
if (!textarea) {
|
||||
return;
|
||||
}
|
||||
|
||||
const storageImageType = '{{ \App\Enums\StorageType::ContentImages->value }}';
|
||||
const morph = '{{ $storageUpload->getMorph()->value }}';
|
||||
const storageInputName = '{{ $storageUpload->getInputName() }}';
|
||||
|
||||
const imageUpload = (blobInfo, progress) => new Promise((resolve, reject) => {
|
||||
const xhr = new XMLHttpRequest();
|
||||
xhr.withCredentials = false;
|
||||
xhr.open('POST', '{{ route('storage.image_upload_and_resize') }}');
|
||||
|
||||
xhr.upload.onprogress = (e) => {
|
||||
progress(e.loaded / e.total * 100);
|
||||
};
|
||||
|
||||
xhr.onload = () => {
|
||||
if (xhr.status === 422) {
|
||||
const json = JSON.parse(xhr.responseText);
|
||||
let error = 'Error:<br><br>';
|
||||
for (let key of Object.keys(json.errors)) {
|
||||
error += json.errors[key] + '<br><br>';
|
||||
}
|
||||
reject(error);
|
||||
return;
|
||||
}
|
||||
|
||||
if (xhr.status === 403) {
|
||||
reject({ message: 'HTTP Error: ' + xhr.status, remove: true });
|
||||
return;
|
||||
}
|
||||
|
||||
if (xhr.status < 200 || xhr.status >= 300) {
|
||||
reject('HTTP Error: ' + xhr.status);
|
||||
return;
|
||||
}
|
||||
|
||||
const json = JSON.parse(xhr.responseText);
|
||||
|
||||
if (!json || typeof json.url != 'string') {
|
||||
reject('Invalid JSON: ' + xhr.responseText);
|
||||
return;
|
||||
}
|
||||
|
||||
let input = document.createElement('input');
|
||||
input.type = 'hidden';
|
||||
input.name = storageInputName + '[content_images][][file]';
|
||||
input.value = json.id;
|
||||
|
||||
textarea.after(input);
|
||||
|
||||
resolve(json.url);
|
||||
};
|
||||
|
||||
xhr.onerror = () => {
|
||||
reject('Image upload failed due to a XHR Transport error. Code: ' + xhr.status);
|
||||
};
|
||||
|
||||
const formData = new FormData();
|
||||
formData.append('file', blobInfo.blob(), blobInfo.filename());
|
||||
formData.append('_token', document.querySelector('meta[name="csrf-token"]').content);
|
||||
formData.append('storage_type', storageImageType);
|
||||
formData.append('morph', morph);
|
||||
|
||||
xhr.send(formData);
|
||||
});
|
||||
@endif
|
||||
tinymce.init({
|
||||
selector: '#{{ $tinyId }}',
|
||||
selector: '.textarea-tinymce',
|
||||
@if(in_array(app()->getLocale(), ['ru'], true))
|
||||
language: '{{ app()->getLocale() }}',
|
||||
@endif
|
||||
license_key: '{{ $tinymceLicenseKey }}',
|
||||
plugins: 'advlist code emoticons link lists table codesample media my-image',
|
||||
toolbar: 'bold italic | bullist numlist | link image emoticons media codesample',
|
||||
plugins: 'advlist code emoticons link lists table codesample',
|
||||
toolbar: 'bold italic | bullist numlist | link emoticons codesample',
|
||||
referrer_policy: 'origin',
|
||||
@if($storageUpload !== null)
|
||||
images_upload_handler: imageUpload,
|
||||
@endif
|
||||
relative_urls: false,
|
||||
convert_urls: false,
|
||||
codesample_global_prismjs: true,
|
||||
codesample_languages: [
|
||||
{text: 'HTML/XML', value: 'markup'},
|
||||
{text: 'JavaScript', value: 'javascript'},
|
||||
{text: 'Bash', value: 'bash'},
|
||||
{text: 'SH', value: 'sh'},
|
||||
{text: 'Shell', value: 'shell'},
|
||||
{text: 'CSS', value: 'css'},
|
||||
{text: 'PHP', value: 'php'},
|
||||
{text: 'Ruby', value: 'ruby'},
|
||||
@ -127,13 +33,11 @@
|
||||
{text: 'Go', value: 'go'},
|
||||
{text: 'Nginx', value: 'nginx'},
|
||||
{text: 'Docker', value: 'docker'},
|
||||
{text: 'YAML', value: 'yaml'},
|
||||
{text: 'TOML', value: 'toml'},
|
||||
{text: 'Json', value: 'json'},
|
||||
{text: "Treeview", value: "treeview"},
|
||||
{text: "Diff", value: "diff"},
|
||||
],
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
@include('_prism')
|
||||
@endpushonce
|
||||
|
@ -37,7 +37,7 @@
|
||||
</header>
|
||||
<div class="main-container">
|
||||
<nav id="menu">
|
||||
<div class="menu__title">{{ $websiteTranslations->translate('site.Menu') }}</div>
|
||||
<div class="menu__title">{{ __('site.Menu') }}</div>
|
||||
<ul>
|
||||
<li><a href="{{ \App\Enums\Site\ProjectSection::Home->url($project, $websiteTranslations->getLanguage()) }}" @class(['active' => request()->route()->named(['home', 'language.home', 'project.home', 'project.language.home'])])>{{ $websiteTranslations->translate('site.About project') }}</a></li>
|
||||
<li><a href="{{ \App\Enums\Site\ProjectSection::Documentation->url($project, $websiteTranslations->getLanguage()) }}" @class(['active' => request()->route()->named(['documentation', 'documentation.home'])])>{{ $websiteTranslations->translate('site.Documentation') }}</a></li>
|
||||
|
@ -36,7 +36,7 @@
|
||||
<span class="input-group-text" id="basic-addon2">
|
||||
<svg class="icon icon-xs text-gray-600" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" d="M5 9V7a5 5 0 0110 0v2a2 2 0 012 2v5a2 2 0 01-2 2H5a2 2 0 01-2-2v-5a2 2 0 012-2zm8-2v2H7V7a3 3 0 016 0z" clip-rule="evenodd"></path></svg>
|
||||
</span>
|
||||
<input type="password" name="password" placeholder="Password" class="form-control" id="password" autocomplete="off" required>
|
||||
<input type="password" name="password" placeholder="Password" class="form-control" id="password" required>
|
||||
</div>
|
||||
</div>
|
||||
<!-- End of Form -->
|
||||
@ -49,11 +49,9 @@
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
@if($captcha)
|
||||
<div class="form-group mb-4">
|
||||
@captcha
|
||||
</div>
|
||||
@endif
|
||||
<div class="form-group mb-4">
|
||||
@captcha
|
||||
</div>
|
||||
</div>
|
||||
<div class="d-grid">
|
||||
<button type="submit" class="btn btn-gray-800">{{ __('Sign in') }}</button>
|
||||
|
@ -23,8 +23,8 @@
|
||||
<form method="post" action="{{ route('profile.update-password') }}">
|
||||
@csrf
|
||||
@method('PUT')
|
||||
<x-volt.forms.input :title="__('validation.attributes.password')" name="password" type="password" autocomplete="off" required />
|
||||
<x-volt.forms.input :title="__('validation.attributes.password_confirmation')" name="password_confirmation" type="password" autocomplete="off" required />
|
||||
<x-volt.forms.input :title="__('validation.attributes.password')" name="password" type="password" required />
|
||||
<x-volt.forms.input :title="__('validation.attributes.password_confirmation')" name="password_confirmation" type="password" required />
|
||||
<button class="btn btn-primary" type="submit">{{ __('Save') }}</button>
|
||||
</form>
|
||||
</div>
|
||||
|
@ -8,14 +8,12 @@
|
||||
<x-site.forms.input :title="$websiteTranslations->translate('site.attributes.name')" :websiteTranslations="$websiteTranslations" name="name" type="text" value="" autofocus />
|
||||
<x-site.forms.input :title="$websiteTranslations->translate('site.attributes.email')" :websiteTranslations="$websiteTranslations" name="email" type="text" value="" />
|
||||
<x-site.forms.textarea-wysiwyg :title="$websiteTranslations->translate('site.attributes.message')" :websiteTranslations="$websiteTranslations" required name="message" value="" />
|
||||
@if($captcha)
|
||||
<div class="form-block">
|
||||
@captcha
|
||||
@error('captcha-verified')
|
||||
<span class="invalid-feedback">{{ $message }}</span>
|
||||
@enderror
|
||||
</div>
|
||||
@endif
|
||||
<div class="form-block">
|
||||
@captcha
|
||||
@error('captcha-verified')
|
||||
<span class="invalid-feedback">{{ $message }}</span>
|
||||
@enderror
|
||||
</div>
|
||||
<div class="form-block">
|
||||
<button class="button" type="submit">{{ $websiteTranslations->translate('site.Feedback-send') }}</button>
|
||||
</div>
|
||||
|
@ -11,6 +11,5 @@
|
||||
|
||||
@push('scripts')
|
||||
@include('_prism')
|
||||
@include('_fancybox')
|
||||
@endpush
|
||||
</x-site.layout>
|
||||
|
@ -5,6 +5,5 @@
|
||||
<div class="line-numbers">{!! $documentation->content->content !!}</div>
|
||||
@push('scripts')
|
||||
@include('_prism')
|
||||
@include('_fancybox')
|
||||
@endpush
|
||||
</x-site.layout>
|
||||
|
@ -19,10 +19,53 @@
|
||||
const d = document;
|
||||
|
||||
import * as bootstrap from 'bootstrap';
|
||||
import Swal from 'sweetalert2';
|
||||
import SmoothScroll from 'smooth-scroll';
|
||||
import Chartist from 'chartist';
|
||||
import 'chartist-plugin-tooltips';
|
||||
|
||||
d.addEventListener("DOMContentLoaded", function(event) {
|
||||
|
||||
const swalWithBootstrapButtons = Swal.mixin({
|
||||
customClass: {
|
||||
confirmButton: 'btn btn-primary me-3',
|
||||
cancelButton: 'btn btn-gray'
|
||||
},
|
||||
buttonsStyling: false
|
||||
});
|
||||
|
||||
var themeSettingsEl = document.getElementById('theme-settings');
|
||||
var themeSettingsExpandEl = document.getElementById('theme-settings-expand');
|
||||
|
||||
if(themeSettingsEl) {
|
||||
|
||||
var themeSettingsCollapse = new bootstrap.Collapse(themeSettingsEl, {
|
||||
show: true,
|
||||
toggle: false
|
||||
});
|
||||
|
||||
if (window.localStorage.getItem('settings_expanded') === 'true') {
|
||||
themeSettingsCollapse.show();
|
||||
themeSettingsExpandEl.classList.remove('show');
|
||||
} else {
|
||||
themeSettingsCollapse.hide();
|
||||
themeSettingsExpandEl.classList.add('show');
|
||||
}
|
||||
|
||||
themeSettingsEl.addEventListener('hidden.bs.collapse', function () {
|
||||
themeSettingsExpandEl.classList.add('show');
|
||||
window.localStorage.setItem('settings_expanded', false);
|
||||
});
|
||||
|
||||
themeSettingsExpandEl.addEventListener('click', function () {
|
||||
themeSettingsExpandEl.classList.remove('show');
|
||||
window.localStorage.setItem('settings_expanded', true);
|
||||
setTimeout(function() {
|
||||
themeSettingsCollapse.show();
|
||||
}, 300);
|
||||
});
|
||||
}
|
||||
|
||||
// options
|
||||
const breakpoints = {
|
||||
sm: 540,
|
||||
@ -41,6 +84,13 @@ d.addEventListener("DOMContentLoaded", function(event) {
|
||||
});
|
||||
}
|
||||
|
||||
var iconNotifications = d.querySelector('.notification-bell');
|
||||
if (iconNotifications) {
|
||||
iconNotifications.addEventListener('shown.bs.dropdown', function () {
|
||||
iconNotifications.classList.remove('unread');
|
||||
});
|
||||
}
|
||||
|
||||
[].slice.call(d.querySelectorAll('[data-background]')).map(function(el) {
|
||||
el.style.background = 'url(' + el.getAttribute('data-background') + ')';
|
||||
});
|
||||
@ -62,15 +112,17 @@ d.addEventListener("DOMContentLoaded", function(event) {
|
||||
//Tooltips
|
||||
var tooltipTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="tooltip"]'))
|
||||
var tooltipList = tooltipTriggerList.map(function (tooltipTriggerEl) {
|
||||
return new bootstrap.Tooltip(tooltipTriggerEl)
|
||||
return new bootstrap.Tooltip(tooltipTriggerEl)
|
||||
})
|
||||
|
||||
|
||||
// Popovers
|
||||
var popoverTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="popover"]'))
|
||||
var popoverList = popoverTriggerList.map(function (popoverTriggerEl) {
|
||||
return new bootstrap.Popover(popoverTriggerEl)
|
||||
})
|
||||
|
||||
|
||||
// Datepicker
|
||||
var datepickers = [].slice.call(d.querySelectorAll('[data-datepicker]'))
|
||||
var datepickersList = datepickers.map(function (el) {
|
||||
@ -79,6 +131,164 @@ d.addEventListener("DOMContentLoaded", function(event) {
|
||||
});
|
||||
})
|
||||
|
||||
if(d.querySelector('.input-slider-container')) {
|
||||
[].slice.call(d.querySelectorAll('.input-slider-container')).map(function(el) {
|
||||
var slider = el.querySelector(':scope .input-slider');
|
||||
var sliderId = slider.getAttribute('id');
|
||||
var minValue = slider.getAttribute('data-range-value-min');
|
||||
var maxValue = slider.getAttribute('data-range-value-max');
|
||||
|
||||
var sliderValue = el.querySelector(':scope .range-slider-value');
|
||||
var sliderValueId = sliderValue.getAttribute('id');
|
||||
var startValue = sliderValue.getAttribute('data-range-value-low');
|
||||
|
||||
var c = d.getElementById(sliderId),
|
||||
id = d.getElementById(sliderValueId);
|
||||
|
||||
noUiSlider.create(c, {
|
||||
start: [parseInt(startValue)],
|
||||
connect: [true, false],
|
||||
//step: 1000,
|
||||
range: {
|
||||
'min': [parseInt(minValue)],
|
||||
'max': [parseInt(maxValue)]
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
if (d.getElementById('input-slider-range')) {
|
||||
var c = d.getElementById("input-slider-range"),
|
||||
low = d.getElementById("input-slider-range-value-low"),
|
||||
e = d.getElementById("input-slider-range-value-high"),
|
||||
f = [d, e];
|
||||
|
||||
noUiSlider.create(c, {
|
||||
start: [parseInt(low.getAttribute('data-range-value-low')), parseInt(e.getAttribute('data-range-value-high'))],
|
||||
connect: !0,
|
||||
tooltips: true,
|
||||
range: {
|
||||
min: parseInt(c.getAttribute('data-range-value-min')),
|
||||
max: parseInt(c.getAttribute('data-range-value-max'))
|
||||
}
|
||||
}), c.noUiSlider.on("update", function (a, b) {
|
||||
f[b].textContent = a[b]
|
||||
});
|
||||
}
|
||||
|
||||
//Chartist
|
||||
|
||||
if(d.querySelector('.ct-chart-sales-value')) {
|
||||
//Chart 5
|
||||
new Chartist.Line('.ct-chart-sales-value', {
|
||||
labels: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
|
||||
series: [
|
||||
[0, 10, 30, 40, 80, 60, 100]
|
||||
]
|
||||
}, {
|
||||
low: 0,
|
||||
showArea: true,
|
||||
fullWidth: true,
|
||||
plugins: [
|
||||
Chartist.plugins.tooltip()
|
||||
],
|
||||
axisX: {
|
||||
// On the x-axis start means top and end means bottom
|
||||
position: 'end',
|
||||
showGrid: true
|
||||
},
|
||||
axisY: {
|
||||
// On the y-axis start means left and end means right
|
||||
showGrid: false,
|
||||
showLabel: false,
|
||||
labelInterpolationFnc: function(value) {
|
||||
return '$' + (value / 1) + 'k';
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if(d.querySelector('.ct-chart-ranking')) {
|
||||
var chart = new Chartist.Bar('.ct-chart-ranking', {
|
||||
labels: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
|
||||
series: [
|
||||
[1, 5, 2, 5, 4, 3],
|
||||
[2, 3, 4, 8, 1, 2],
|
||||
]
|
||||
}, {
|
||||
low: 0,
|
||||
showArea: true,
|
||||
plugins: [
|
||||
Chartist.plugins.tooltip()
|
||||
],
|
||||
axisX: {
|
||||
// On the x-axis start means top and end means bottom
|
||||
position: 'end'
|
||||
},
|
||||
axisY: {
|
||||
// On the y-axis start means left and end means right
|
||||
showGrid: false,
|
||||
showLabel: false,
|
||||
offset: 0
|
||||
}
|
||||
});
|
||||
|
||||
chart.on('draw', function(data) {
|
||||
if(data.type === 'line' || data.type === 'area') {
|
||||
data.element.animate({
|
||||
d: {
|
||||
begin: 2000 * data.index,
|
||||
dur: 2000,
|
||||
from: data.path.clone().scale(1, 0).translate(0, data.chartRect.height()).stringify(),
|
||||
to: data.path.clone().stringify(),
|
||||
easing: Chartist.Svg.Easing.easeOutQuint
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if(d.querySelector('.ct-chart-traffic-share')) {
|
||||
var data = {
|
||||
series: [70, 20, 10]
|
||||
};
|
||||
|
||||
var sum = function(a, b) { return a + b };
|
||||
|
||||
new Chartist.Pie('.ct-chart-traffic-share', data, {
|
||||
labelInterpolationFnc: function(value) {
|
||||
return Math.round(value / data.series.reduce(sum) * 100) + '%';
|
||||
},
|
||||
low: 0,
|
||||
high: 8,
|
||||
donut: true,
|
||||
donutWidth: 20,
|
||||
donutSolid: true,
|
||||
fullWidth: false,
|
||||
showLabel: false,
|
||||
plugins: [
|
||||
Chartist.plugins.tooltip()
|
||||
],
|
||||
});
|
||||
}
|
||||
|
||||
if (d.getElementById('loadOnClick')) {
|
||||
d.getElementById('loadOnClick').addEventListener('click', function () {
|
||||
var button = this;
|
||||
var loadContent = d.getElementById('extraContent');
|
||||
var allLoaded = d.getElementById('allLoadedText');
|
||||
|
||||
button.classList.add('btn-loading');
|
||||
button.setAttribute('disabled', 'true');
|
||||
|
||||
setTimeout(function () {
|
||||
loadContent.style.display = 'block';
|
||||
button.style.display = 'none';
|
||||
allLoaded.style.display = 'block';
|
||||
}, 1500);
|
||||
});
|
||||
}
|
||||
|
||||
var scroll = new SmoothScroll('a[href*="#"]', {
|
||||
speed: 500,
|
||||
speedAsDuration: true
|
||||
@ -87,4 +297,68 @@ d.addEventListener("DOMContentLoaded", function(event) {
|
||||
if(d.querySelector('.current-year')){
|
||||
d.querySelector('.current-year').textContent = new Date().getFullYear();
|
||||
}
|
||||
|
||||
// Glide JS
|
||||
|
||||
if (d.querySelector('.glide')) {
|
||||
new Glide('.glide', {
|
||||
type: 'carousel',
|
||||
startAt: 0,
|
||||
perView: 3
|
||||
}).mount();
|
||||
}
|
||||
|
||||
if (d.querySelector('.glide-testimonials')) {
|
||||
new Glide('.glide-testimonials', {
|
||||
type: 'carousel',
|
||||
startAt: 0,
|
||||
perView: 1,
|
||||
autoplay: 2000
|
||||
}).mount();
|
||||
}
|
||||
|
||||
if (d.querySelector('.glide-clients')) {
|
||||
new Glide('.glide-clients', {
|
||||
type: 'carousel',
|
||||
startAt: 0,
|
||||
perView: 5,
|
||||
autoplay: 2000
|
||||
}).mount();
|
||||
}
|
||||
|
||||
if (d.querySelector('.glide-news-widget')) {
|
||||
new Glide('.glide-news-widget', {
|
||||
type: 'carousel',
|
||||
startAt: 0,
|
||||
perView: 1,
|
||||
autoplay: 2000
|
||||
}).mount();
|
||||
}
|
||||
|
||||
if (d.querySelector('.glide-autoplay')) {
|
||||
new Glide('.glide-autoplay', {
|
||||
type: 'carousel',
|
||||
startAt: 0,
|
||||
perView: 3,
|
||||
autoplay: 2000
|
||||
}).mount();
|
||||
}
|
||||
|
||||
// Pricing countup
|
||||
var billingSwitchEl = d.getElementById('billingSwitch');
|
||||
if(billingSwitchEl) {
|
||||
const countUpStandard = new countUp.CountUp('priceStandard', 99, { startVal: 199 });
|
||||
const countUpPremium = new countUp.CountUp('pricePremium', 199, { startVal: 299 });
|
||||
|
||||
billingSwitchEl.addEventListener('change', function() {
|
||||
if(billingSwitch.checked) {
|
||||
countUpStandard.start();
|
||||
countUpPremium.start();
|
||||
} else {
|
||||
countUpStandard.reset();
|
||||
countUpPremium.reset();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
|
@ -1,6 +1,2 @@
|
||||
<?php
|
||||
use Illuminate\Support\Facades\Schedule;
|
||||
|
||||
$timezone = config('app.user_timezone');
|
||||
|
||||
Schedule::command(\App\Console\Commands\Files\DeleteOldFilesFromStorage::class)->timezone($timezone)->dailyAt('3:30');
|
||||
|
@ -15,8 +15,6 @@ export default defineConfig({
|
||||
'resources/site/js/app.js',
|
||||
|
||||
'resources/prism/app.js',
|
||||
|
||||
'resources/fancybox/app.js',
|
||||
],
|
||||
refresh: true,
|
||||
}),
|
||||
|
@ -64,18 +64,16 @@ FROM BUILD AS PRODUCTION
|
||||
|
||||
COPY --from=APP_BUILD_FOR_PRODUCTION /home/app /var/www/html
|
||||
COPY docker/docker-entrypoint_prod.sh /home/unit/docker-entrypoint.sh
|
||||
COPY docker/start.sh /usr/local/bin/start
|
||||
|
||||
WORKDIR /var/www/html
|
||||
|
||||
RUN chmod 755 /home/unit/docker-entrypoint.sh \
|
||||
&& chmod 755 /usr/local/bin/start
|
||||
RUN chmod 755 /home/unit/docker-entrypoint.sh
|
||||
|
||||
STOPSIGNAL SIGTERM
|
||||
|
||||
ENTRYPOINT ["/home/unit/docker-entrypoint.sh"]
|
||||
EXPOSE 9000
|
||||
CMD ["/usr/local/bin/start"]
|
||||
CMD ["unitd", "--no-daemon", "--control", "unix:/var/run/control.unit.sock", "--user", "unit", "--group", "unit"]
|
||||
|
||||
|
||||
FROM BUILD AS DEVELOP
|
||||
@ -83,19 +81,17 @@ FROM BUILD AS DEVELOP
|
||||
WORKDIR /var/www/html
|
||||
|
||||
COPY docker/docker-entrypoint_dev.sh /home/unit/docker-entrypoint.sh
|
||||
COPY docker/start.sh /usr/local/bin/start
|
||||
|
||||
STOPSIGNAL SIGTERM
|
||||
|
||||
RUN chmod 755 /home/unit/docker-entrypoint.sh \
|
||||
&& chmod 755 /usr/local/bin/start \
|
||||
&& apk --no-cache add git nodejs npm \
|
||||
&& curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
|
||||
|
||||
ENTRYPOINT ["/home/unit/docker-entrypoint.sh"]
|
||||
|
||||
EXPOSE 9000
|
||||
CMD ["/usr/local/bin/start"]
|
||||
CMD ["unitd", "--no-daemon", "--control", "unix:/var/run/control.unit.sock", "--user", "unit", "--group", "unit"]
|
||||
|
||||
|
||||
|
||||
|
@ -5,7 +5,6 @@ set -euo pipefail
|
||||
WAITLOOPS=5
|
||||
SLEEPSEC=1
|
||||
unitd="unitd"
|
||||
role=${CONTAINER_ROLE:-app}
|
||||
|
||||
curl_put()
|
||||
{
|
||||
@ -23,7 +22,7 @@ curl_put()
|
||||
return 0
|
||||
}
|
||||
|
||||
if [ "$role" = "app" ]; then
|
||||
if [ "$unitd" = "unitd" ] || [ "$unitd" = "unitd-debug" ]; then
|
||||
echo "$0: Launching Unit daemon to perform initial configuration..."
|
||||
/usr/sbin/$unitd --control unix:/var/run/control.unit.sock
|
||||
for i in $(/usr/bin/seq $WAITLOOPS); do
|
||||
@ -62,7 +61,7 @@ if [ "$role" = "app" ]; then
|
||||
|
||||
if [ ! -z ${UNIT_SOURCE+x} ]
|
||||
then
|
||||
echo $UNIT_SOURCE > /docker-entrypoint.d/unit_source.json
|
||||
echo "[${UNIT_SOURCE}]" > /docker-entrypoint.d/unit_source.json
|
||||
curl_put "/docker-entrypoint.d/unit_source.json" "config/listeners/*:9000/forwarded/source"
|
||||
fi
|
||||
|
||||
|
@ -5,7 +5,6 @@ set -euo pipefail
|
||||
WAITLOOPS=5
|
||||
SLEEPSEC=1
|
||||
unitd="unitd"
|
||||
role=${CONTAINER_ROLE:-app}
|
||||
|
||||
curl_put()
|
||||
{
|
||||
@ -23,7 +22,7 @@ curl_put()
|
||||
return 0
|
||||
}
|
||||
|
||||
if [ "$role" = "app" ]; then
|
||||
if [ "$unitd" = "unitd" ] || [ "$unitd" = "unitd-debug" ]; then
|
||||
echo "$0: Launching Unit daemon to perform initial configuration..."
|
||||
/usr/sbin/$unitd --control unix:/var/run/control.unit.sock
|
||||
for i in $(/usr/bin/seq $WAITLOOPS); do
|
||||
@ -62,7 +61,7 @@ if [ "$role" = "app" ]; then
|
||||
|
||||
if [ ! -z ${UNIT_SOURCE+x} ]
|
||||
then
|
||||
echo $UNIT_SOURCE > /docker-entrypoint.d/unit_source.json
|
||||
echo "[${UNIT_SOURCE}]" > /docker-entrypoint.d/unit_source.json
|
||||
curl_put "/docker-entrypoint.d/unit_source.json" "config/listeners/*:9000/forwarded/source"
|
||||
fi
|
||||
|
||||
@ -103,10 +102,8 @@ php artisan config:cache
|
||||
php artisan event:cache
|
||||
php artisan route:cache
|
||||
php artisan view:cache
|
||||
php artisan storage:link
|
||||
if [ "$role" = "app" ]; then
|
||||
php artisan migrate --force
|
||||
fi
|
||||
php artisan migrate --force
|
||||
|
||||
chown -R unit:unit /var/www/html
|
||||
chown -R www-data:www-data /var/www/html/storage /var/www/html/bootstrap/cache
|
||||
chmod -R 777 /var/www/html/storage /var/www/html/bootstrap/cache
|
||||
|
@ -1,21 +0,0 @@
|
||||
#!/usr/bin/env sh
|
||||
set -e
|
||||
role=${CONTAINER_ROLE:-app}
|
||||
if [ "$role" = "app" ]; then
|
||||
exec unitd --no-daemon --control unix:/var/run/control.unit.sock --user unit --group unit
|
||||
elif [ "$role" = "queue" ]; then
|
||||
echo "Running the queue..."
|
||||
while [ true ]
|
||||
do
|
||||
php /var/www/html/artisan queue:work --verbose --sleep=5 --tries=100 --backoff=10 --max-time=3600 --queue=high,normal,low,default
|
||||
done
|
||||
elif [ "$role" = "scheduler" ]; then
|
||||
while [ true ]
|
||||
do
|
||||
php /var/www/html/artisan schedule:run --verbose --no-interaction &
|
||||
sleep 60
|
||||
done
|
||||
else
|
||||
echo "Could not match the container role \"$role\""
|
||||
exit 1
|
||||
fi
|
1
captcha-app/redis/.gitignore
vendored
1
captcha-app/redis/.gitignore
vendored
@ -1 +0,0 @@
|
||||
data/
|
@ -14,47 +14,12 @@ services:
|
||||
- ${DOCKER_APP_PORT}:9000
|
||||
volumes:
|
||||
- ./app/application:/var/www/html
|
||||
environment:
|
||||
CONTAINER_ROLE: app
|
||||
UNIT_SOURCE: '"172.16.0.0/12"'
|
||||
|
||||
queue:
|
||||
build:
|
||||
context: app
|
||||
dockerfile: docker/Dockerfile
|
||||
target: PRODUCTION
|
||||
# restart: always
|
||||
depends_on:
|
||||
- db
|
||||
- app-redis
|
||||
environment:
|
||||
CONTAINER_ROLE: queue
|
||||
volumes:
|
||||
- ./app/application:/var/www/html
|
||||
|
||||
scheduler:
|
||||
build:
|
||||
context: app
|
||||
dockerfile: docker/Dockerfile
|
||||
target: PRODUCTION
|
||||
# restart: always
|
||||
depends_on:
|
||||
- db
|
||||
- app-redis
|
||||
environment:
|
||||
CONTAINER_ROLE: scheduler
|
||||
volumes:
|
||||
- ./app/application:/var/www/html
|
||||
|
||||
app-redis:
|
||||
image: redis:3.0-alpine # docker hub
|
||||
# image: docker.mdhub.kor-elf.net/kor-elf/redis:3.0-alpine # MDHub
|
||||
image: redis:3.0-alpine
|
||||
# restart: always
|
||||
volumes:
|
||||
- ./redis/data:/data
|
||||
|
||||
captcha-app:
|
||||
image: korelf/service-captcha:0.8.2
|
||||
image: korelf/service-captcha:0.8.1
|
||||
# restart: always
|
||||
cap_drop:
|
||||
- ALL
|
||||
@ -67,13 +32,10 @@ services:
|
||||
- db
|
||||
- captcha-redis
|
||||
env_file: captcha-app/.env
|
||||
environment:
|
||||
CONTAINER_ROLE: app
|
||||
UNIT_SOURCE: '"172.16.0.0/12"'
|
||||
ports:
|
||||
- ${DOCKER_CAPTCHA_PORT}:9000
|
||||
captcha-queue:
|
||||
image: korelf/service-captcha:0.8.2
|
||||
image: korelf/service-captcha:0.8.1
|
||||
# restart: always
|
||||
depends_on:
|
||||
- db
|
||||
@ -82,7 +44,7 @@ services:
|
||||
CONTAINER_ROLE: queue
|
||||
env_file: captcha-app/.env
|
||||
captcha-reverb:
|
||||
image: korelf/service-captcha:0.8.2
|
||||
image: korelf/service-captcha:0.8.1
|
||||
# restart: always
|
||||
depends_on:
|
||||
- db
|
||||
@ -93,7 +55,7 @@ services:
|
||||
ports:
|
||||
- ${DOCKER_CAPTCHA_WEBSOCKET_PORT}:9000
|
||||
captcha-scheduler:
|
||||
image: korelf/service-captcha:0.8.2
|
||||
image: korelf/service-captcha:0.8.1
|
||||
# restart: always
|
||||
depends_on:
|
||||
- db
|
||||
@ -102,14 +64,10 @@ services:
|
||||
CONTAINER_ROLE: scheduler
|
||||
env_file: captcha-app/.env
|
||||
captcha-redis:
|
||||
image: redis:3.0-alpine # docker hub
|
||||
# image: docker.mdhub.kor-elf.net/kor-elf/redis:3.0-alpine # MDHub
|
||||
image: redis:3.0-alpine
|
||||
# restart: always
|
||||
volumes:
|
||||
- ./captcha-app/redis/data:/data
|
||||
db:
|
||||
image: docker.io/mysql:8.0.33 # docker hub
|
||||
# image: docker.mdhub.kor-elf.net/kor-elf/mysql:8.0.33 # MDHub
|
||||
image: docker.io/mysql:8.0.33
|
||||
command: --default-authentication-plugin=mysql_native_password
|
||||
#restart: always
|
||||
ports:
|
||||
|
@ -1,8 +1,7 @@
|
||||
version: '3.7'
|
||||
services:
|
||||
app:
|
||||
# image: korelf/my-projects-website:0.3.1 # docker hub
|
||||
image: docker.mdhub.kor-elf.net/kor-elf/my-projects-website:0.3.1 # MDHub
|
||||
image: korelf/my-projects-website:0.1.0
|
||||
# restart: always
|
||||
depends_on:
|
||||
- db
|
||||
@ -11,50 +10,15 @@ services:
|
||||
ports:
|
||||
- ${DOCKER_APP_PORT}:9000
|
||||
env_file: app/.env
|
||||
environment:
|
||||
CONTAINER_ROLE: app
|
||||
UNIT_SOURCE: '"172.16.0.0/12"'
|
||||
volumes:
|
||||
- ./app/storage/app:/var/www/html/storage/app
|
||||
- ./app/storage/logs:/var/www/html/storage/logs
|
||||
|
||||
queue:
|
||||
# image: korelf/my-projects-website:0.3.1 # docker hub
|
||||
image: docker.mdhub.kor-elf.net/kor-elf/my-projects-website:0.3.1 # MDHub
|
||||
# restart: always
|
||||
depends_on:
|
||||
- db
|
||||
- app-redis
|
||||
environment:
|
||||
CONTAINER_ROLE: queue
|
||||
env_file: app/.env
|
||||
volumes:
|
||||
- ./app/storage/app:/var/www/html/storage/app
|
||||
- ./app/storage/logs:/var/www/html/storage/logs
|
||||
|
||||
scheduler:
|
||||
# image: korelf/my-projects-website:0.3.1 # docker hub
|
||||
image: docker.mdhub.kor-elf.net/kor-elf/my-projects-website:0.3.1 # MDHub
|
||||
# restart: always
|
||||
depends_on:
|
||||
- db
|
||||
- app-redis
|
||||
environment:
|
||||
CONTAINER_ROLE: scheduler
|
||||
env_file: app/.env
|
||||
volumes:
|
||||
- ./app/storage/app:/var/www/html/storage/app
|
||||
- ./app/storage/logs:/var/www/html/storage/logs
|
||||
|
||||
app-redis:
|
||||
image: redis:3.0-alpine # docker hub
|
||||
# image: docker.mdhub.kor-elf.net/kor-elf/redis:3.0-alpine # MDHub
|
||||
image: redis:3.0-alpine
|
||||
# restart: always
|
||||
volumes:
|
||||
- ./redis/data:/data
|
||||
|
||||
captcha-app:
|
||||
image: korelf/service-captcha:0.8.2
|
||||
image: korelf/service-captcha:0.8.1
|
||||
# restart: always
|
||||
cap_drop:
|
||||
- ALL
|
||||
@ -69,11 +33,8 @@ services:
|
||||
env_file: captcha-app/.env
|
||||
ports:
|
||||
- ${DOCKER_CAPTCHA_PORT}:9000
|
||||
environment:
|
||||
CONTAINER_ROLE: app
|
||||
UNIT_SOURCE: '"172.16.0.0/12"'
|
||||
captcha-queue:
|
||||
image: korelf/service-captcha:0.8.2
|
||||
image: korelf/service-captcha:0.8.1
|
||||
# restart: always
|
||||
depends_on:
|
||||
- db
|
||||
@ -82,7 +43,7 @@ services:
|
||||
CONTAINER_ROLE: queue
|
||||
env_file: captcha-app/.env
|
||||
captcha-reverb:
|
||||
image: korelf/service-captcha:0.8.2
|
||||
image: korelf/service-captcha:0.8.1
|
||||
# restart: always
|
||||
depends_on:
|
||||
- db
|
||||
@ -93,7 +54,7 @@ services:
|
||||
ports:
|
||||
- ${DOCKER_CAPTCHA_WEBSOCKET_PORT}:9000
|
||||
captcha-scheduler:
|
||||
image: korelf/service-captcha:0.8.2
|
||||
image: korelf/service-captcha:0.8.1
|
||||
# restart: always
|
||||
depends_on:
|
||||
- db
|
||||
@ -102,14 +63,10 @@ services:
|
||||
CONTAINER_ROLE: scheduler
|
||||
env_file: captcha-app/.env
|
||||
captcha-redis:
|
||||
image: redis:3.0-alpine # docker hub
|
||||
# image: docker.mdhub.kor-elf.net/kor-elf/redis:3.0-alpine # MDHub
|
||||
image: redis:3.0-alpine
|
||||
# restart: always
|
||||
volumes:
|
||||
- ./captcha-app/redis/data:/data
|
||||
db:
|
||||
image: docker.io/mysql:8.0.33 # docker hub
|
||||
# image: docker.mdhub.kor-elf.net/kor-elf/mysql:8.0.33 # MDHub
|
||||
image: docker.io/mysql:8.0.33
|
||||
command: --default-authentication-plugin=mysql_native_password
|
||||
#restart: always
|
||||
ports:
|
||||
|
@ -13,41 +13,11 @@ services:
|
||||
- ${DOCKER_APP_PORT}:9000
|
||||
volumes:
|
||||
- ./app/application:/var/www/html
|
||||
|
||||
queue:
|
||||
build:
|
||||
context: app
|
||||
dockerfile: docker/Dockerfile
|
||||
target: DEVELOP
|
||||
depends_on:
|
||||
- db
|
||||
- app-redis
|
||||
environment:
|
||||
CONTAINER_ROLE: queue
|
||||
volumes:
|
||||
- ./app/application:/var/www/html
|
||||
|
||||
scheduler:
|
||||
build:
|
||||
context: app
|
||||
dockerfile: docker/Dockerfile
|
||||
target: DEVELOP
|
||||
depends_on:
|
||||
- db
|
||||
- app-redis
|
||||
environment:
|
||||
CONTAINER_ROLE: scheduler
|
||||
volumes:
|
||||
- ./app/application:/var/www/html
|
||||
|
||||
app-redis:
|
||||
image: redis:3.0-alpine # docker hub
|
||||
# image: docker.mdhub.kor-elf.net/kor-elf/redis:3.0-alpine # MDHub
|
||||
volumes:
|
||||
- ./redis/data:/data
|
||||
image: redis:3.0-alpine
|
||||
|
||||
captcha-app:
|
||||
image: korelf/service-captcha:0.8.2
|
||||
image: korelf/service-captcha:0.8.1
|
||||
cap_drop:
|
||||
- ALL
|
||||
cap_add:
|
||||
@ -59,13 +29,10 @@ services:
|
||||
- db
|
||||
- captcha-redis
|
||||
env_file: captcha-app/.env
|
||||
volumes:
|
||||
- ./captcha-app/app/storage/app:/var/www/html/storage/app
|
||||
- ./captcha-app/app/storage/logs:/var/www/html/storage/logs
|
||||
ports:
|
||||
- ${DOCKER_CAPTCHA_PORT}:9000
|
||||
captcha-queue:
|
||||
image: korelf/service-captcha:0.8.2
|
||||
image: korelf/service-captcha:0.8.1
|
||||
# restart: always
|
||||
depends_on:
|
||||
- db
|
||||
@ -73,11 +40,8 @@ services:
|
||||
environment:
|
||||
CONTAINER_ROLE: queue
|
||||
env_file: captcha-app/.env
|
||||
volumes:
|
||||
- ./captcha-app/app/storage/app:/var/www/html/storage/app
|
||||
- ./captcha-app/app/storage/logs:/var/www/html/storage/logs
|
||||
captcha-reverb:
|
||||
image: korelf/service-captcha:0.8.2
|
||||
image: korelf/service-captcha:0.8.1
|
||||
# restart: always
|
||||
depends_on:
|
||||
- db
|
||||
@ -85,13 +49,10 @@ services:
|
||||
environment:
|
||||
CONTAINER_ROLE: websockets
|
||||
env_file: captcha-app/.env
|
||||
volumes:
|
||||
- ./captcha-app/app/storage/app:/var/www/html/storage/app
|
||||
- ./captcha-app/app/storage/logs:/var/www/html/storage/logs
|
||||
ports:
|
||||
- ${DOCKER_CAPTCHA_WEBSOCKET_PORT}:9000
|
||||
captcha-scheduler:
|
||||
image: korelf/service-captcha:0.8.2
|
||||
image: korelf/service-captcha:0.8.1
|
||||
# restart: always
|
||||
depends_on:
|
||||
- db
|
||||
@ -99,17 +60,10 @@ services:
|
||||
environment:
|
||||
CONTAINER_ROLE: scheduler
|
||||
env_file: captcha-app/.env
|
||||
volumes:
|
||||
- ./captcha-app/app/storage/app:/var/www/html/storage/app
|
||||
- ./captcha-app/app/storage/logs:/var/www/html/storage/logs
|
||||
captcha-redis:
|
||||
image: redis:3.0-alpine # docker hub
|
||||
# image: docker.mdhub.kor-elf.net/kor-elf/redis:3.0-alpine # MDHub
|
||||
volumes:
|
||||
- ./captcha-app/redis/data:/data
|
||||
image: redis:3.0-alpine
|
||||
db:
|
||||
image: docker.io/mysql:8.0.33 # docker hub
|
||||
# image: docker.mdhub.kor-elf.net/kor-elf/mysql:8.0.33 # MDHub
|
||||
image: docker.io/mysql:8.0.33
|
||||
command: --default-authentication-plugin=mysql_native_password
|
||||
#restart: always
|
||||
ports:
|
||||
|
1
redis/.gitignore
vendored
1
redis/.gitignore
vendored
@ -1 +0,0 @@
|
||||
data/
|
Loading…
Reference in New Issue
Block a user