From a3b964c1caaeddaa60c6a010d589cb7c52555cd2 Mon Sep 17 00:00:00 2001 From: F4ilji Date: Sun, 6 Apr 2025 18:49:40 +0500 Subject: [PATCH] fix bugs and add log viewer package --- .../Resources/AcademicJournalResource.php | 12 +- .../JournalsRelationManager.php | 16 +- composer.json | 1 + composer.lock | 143 ++++++++++- config/log-viewer.php | 241 ++++++++++++++++++ resources/js/Navbars/MainPageNavbar.vue | 3 - resources/js/Pages/Main.vue | 2 +- .../componentss/features/sliders/Slider.vue | 33 ++- .../sliders/components/SliderBody.vue | 15 +- .../shared/builder/pageBuilder/Builder.vue | 2 +- .../pageBuilder/blocks/PostListBlock.vue | 2 +- .../blocks/contacts/ContactGroup.vue | 2 +- .../shared/contactSection/ContactGroup.vue | 2 +- 13 files changed, 432 insertions(+), 42 deletions(-) create mode 100644 config/log-viewer.php diff --git a/app/Filament/Resources/AcademicJournalResource.php b/app/Filament/Resources/AcademicJournalResource.php index e00f8ac..6fdb5c9 100644 --- a/app/Filament/Resources/AcademicJournalResource.php +++ b/app/Filament/Resources/AcademicJournalResource.php @@ -105,17 +105,17 @@ class AcademicJournalResource extends Resource TextInput::make('name') ->label('ФИО') ->required() - ->maxLength(100) + ->maxLength(255) ->placeholder('Иванов Иван Иванович'), TextInput::make('academicTitle') ->label('Учёная степень') ->required() - ->maxLength(50) + ->maxLength(255) ->placeholder('д.т.н., профессор'), TextInput::make('position') ->label('Должность') ->required() - ->maxLength(100) + ->maxLength(255) ->placeholder('Главный научный сотрудник'), TextInput::make('institution') ->label('Учреждение') @@ -137,17 +137,17 @@ class AcademicJournalResource extends Resource TextInput::make('name') ->label('ФИО') ->required() - ->maxLength(100) + ->maxLength(255) ->placeholder('Петров Петр Петрович'), TextInput::make('academicTitle') ->label('Учёная степень') ->required() - ->maxLength(50) + ->maxLength(255) ->placeholder('к.ф.-м.н., доцент'), TextInput::make('position') ->label('Должность') ->required() - ->maxLength(100) + ->maxLength(255) ->placeholder('Доцент кафедры'), TextInput::make('institution') ->label('Учреждение') diff --git a/app/Filament/Resources/AcademicJournalResource/RelationManagers/JournalsRelationManager.php b/app/Filament/Resources/AcademicJournalResource/RelationManagers/JournalsRelationManager.php index 3efdb3c..4b594c1 100644 --- a/app/Filament/Resources/AcademicJournalResource/RelationManagers/JournalsRelationManager.php +++ b/app/Filament/Resources/AcademicJournalResource/RelationManagers/JournalsRelationManager.php @@ -37,20 +37,18 @@ class JournalsRelationManager extends RelationManager ->label('Файл выпуска') ->required() ->acceptedFileTypes([ - 'application/pdf' => 'PDF', - 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' => 'DOCX', - 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' => 'XLSX', - 'application/vnd.openxmlformats-officedocument.presentationml.presentation' => 'PPTX', - 'application/zip' => 'ZIP', + 'application/pdf', + 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', + 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', + 'application/vnd.openxmlformats-officedocument.presentationml.presentation', + 'application/zip' ]) ->maxSize(512000) ->disk('public') - ->directory('journals/files') + ->directory('files') ->downloadable() - ->visibility('public') ->helperText('Максимальный размер файла: 512MB. Допустимые форматы: PDF, DOCX, XLSX, PPTX, ZIP') - ->openable() - ->previewable(false), + ->openable(), TextInput::make('year_publication') diff --git a/composer.json b/composer.json index 233b537..16e1525 100644 --- a/composer.json +++ b/composer.json @@ -24,6 +24,7 @@ "laravel/tinker": "^2.8", "mohamedsabil83/filament-forms-tinyeditor": "^2.3", "nesbot/carbon": "^2.71", + "opcodesio/log-viewer": "^3.15", "predis/predis": "^2.3", "protonemedia/laravel-cross-eloquent-search": "^3.4", "pxlrbt/filament-excel": "^2.3", diff --git a/composer.lock b/composer.lock index 9bb7235..7004b90 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "8dfdeaeee9096f0841adf98508f78eea", + "content-hash": "77a23a844000cefe479418fddc5c8353", "packages": [ { "name": "anourvalar/eloquent-serialize", @@ -5287,6 +5287,147 @@ ], "time": "2024-10-15T15:27:12+00:00" }, + { + "name": "opcodesio/log-viewer", + "version": "v3.15.5", + "source": { + "type": "git", + "url": "https://github.com/opcodesio/log-viewer.git", + "reference": "726afaac63458ad41073057670727fd892cf10d1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/opcodesio/log-viewer/zipball/726afaac63458ad41073057670727fd892cf10d1", + "reference": "726afaac63458ad41073057670727fd892cf10d1", + "shasum": "" + }, + "require": { + "illuminate/contracts": "^8.0|^9.0|^10.0|^11.0|^12.0", + "opcodesio/mail-parser": "^0.1.6", + "php": "^8.0" + }, + "conflict": { + "arcanedev/log-viewer": "^8.0" + }, + "require-dev": { + "guzzlehttp/guzzle": "^7.2", + "itsgoingd/clockwork": "^5.1", + "laravel/pint": "^1.0", + "nunomaduro/collision": "^7.0|^8.0", + "orchestra/testbench": "^7.6|^8.0|^9.0|^10.0", + "pestphp/pest": "^2.0|^3.7", + "pestphp/pest-plugin-laravel": "^2.0|^3.1", + "spatie/test-time": "^1.3" + }, + "suggest": { + "guzzlehttp/guzzle": "Required for multi-host support. ^7.2" + }, + "type": "library", + "extra": { + "laravel": { + "aliases": { + "LogViewer": "Opcodes\\LogViewer\\Facades\\LogViewer" + }, + "providers": [ + "Opcodes\\LogViewer\\LogViewerServiceProvider" + ] + } + }, + "autoload": { + "psr-4": { + "Opcodes\\LogViewer\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Arunas Skirius", + "email": "arukomp@gmail.com", + "role": "Developer" + } + ], + "description": "Fast and easy-to-use log viewer for your Laravel application", + "homepage": "https://github.com/opcodesio/log-viewer", + "keywords": [ + "arukompas", + "better-log-viewer", + "laravel", + "log viewer", + "logs", + "opcodesio" + ], + "support": { + "issues": "https://github.com/opcodesio/log-viewer/issues", + "source": "https://github.com/opcodesio/log-viewer/tree/v3.15.5" + }, + "funding": [ + { + "url": "https://www.buymeacoffee.com/arunas", + "type": "custom" + }, + { + "url": "https://github.com/arukompas", + "type": "github" + } + ], + "time": "2025-04-02T17:40:35+00:00" + }, + { + "name": "opcodesio/mail-parser", + "version": "v0.1.6", + "source": { + "type": "git", + "url": "https://github.com/opcodesio/mail-parser.git", + "reference": "639ef31cbd146a63416283e75afce152e13233ea" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/opcodesio/mail-parser/zipball/639ef31cbd146a63416283e75afce152e13233ea", + "reference": "639ef31cbd146a63416283e75afce152e13233ea", + "shasum": "" + }, + "require": { + "php": "^8.0" + }, + "require-dev": { + "pestphp/pest": "^2.16", + "symfony/var-dumper": "^6.3" + }, + "type": "library", + "autoload": { + "psr-4": { + "Opcodes\\MailParser\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Arunas Skirius", + "email": "arukomp@gmail.com", + "role": "Developer" + } + ], + "description": "Parse emails without the mailparse extension", + "keywords": [ + "arukompas", + "email", + "email parser", + "mail", + "opcodesio", + "php" + ], + "support": { + "issues": "https://github.com/opcodesio/mail-parser/issues", + "source": "https://github.com/opcodesio/mail-parser/tree/v0.1.6" + }, + "time": "2023-11-19T08:47:43+00:00" + }, { "name": "openspout/openspout", "version": "v4.26.0", diff --git a/config/log-viewer.php b/config/log-viewer.php new file mode 100644 index 0000000..9d9aede --- /dev/null +++ b/config/log-viewer.php @@ -0,0 +1,241 @@ + env('LOG_VIEWER_ENABLED', true), + + 'api_only' => env('LOG_VIEWER_API_ONLY', false), + + 'require_auth_in_production' => true, + + /* + |-------------------------------------------------------------------------- + | Log Viewer Domain + |-------------------------------------------------------------------------- + | You may change the domain where Log Viewer should be active. + | If the domain is empty, all domains will be valid. + | + */ + + 'route_domain' => null, + + /* + |-------------------------------------------------------------------------- + | Log Viewer Route + |-------------------------------------------------------------------------- + | Log Viewer will be available under this URL. + | + */ + + 'route_path' => 'logs', + + /* + |-------------------------------------------------------------------------- + | Back to system URL + |-------------------------------------------------------------------------- + | When set, displays a link to easily get back to this URL. + | Set to `null` to hide this link. + | + | Optional label to display for the above URL. + | + */ + + 'back_to_system_url' => config('app.url', null), + + 'back_to_system_label' => null, // Displayed by default: "Back to {{ app.name }}" + + /* + |-------------------------------------------------------------------------- + | Log Viewer time zone. + |-------------------------------------------------------------------------- + | The time zone in which to display the times in the UI. Defaults to + | the application's timezone defined in config/app.php. + | + */ + + 'timezone' => null, + + /* + |-------------------------------------------------------------------------- + | Log Viewer route middleware. + |-------------------------------------------------------------------------- + | Optional middleware to use when loading the initial Log Viewer page. + | + */ + + 'middleware' => ['web', 'superadmin'], + + /* + |-------------------------------------------------------------------------- + | Log Viewer API middleware. + |-------------------------------------------------------------------------- + | Optional middleware to use on every API request. The same API is also + | used from within the Log Viewer user interface. + | + */ + + 'api_middleware' => [ + \Opcodes\LogViewer\Http\Middleware\EnsureFrontendRequestsAreStateful::class, + \Opcodes\LogViewer\Http\Middleware\AuthorizeLogViewer::class, + ], + + 'api_stateful_domains' => env('LOG_VIEWER_API_STATEFUL_DOMAINS') ? explode(',', env('LOG_VIEWER_API_STATEFUL_DOMAINS')) : null, + + /* + |-------------------------------------------------------------------------- + | Log Viewer Remote hosts. + |-------------------------------------------------------------------------- + | Log Viewer supports viewing Laravel logs from remote hosts. They must + | be running Log Viewer as well. Below you can define the hosts you + | would like to show in this Log Viewer instance. + | + */ + + 'hosts' => [ + 'local' => [ + 'name' => ucfirst(env('APP_ENV', 'local')), + ], + + // 'staging' => [ + // 'name' => 'Staging', + // 'host' => 'https://staging.example.com/log-viewer', + // 'auth' => [ // Example of HTTP Basic auth + // 'username' => 'username', + // 'password' => 'password', + // ], + // 'verify_server_certificate' => true, + // ], + // + // 'production' => [ + // 'name' => 'Production', + // 'host' => 'https://example.com/log-viewer', + // 'auth' => [ // Example of Bearer token auth + // 'token' => env('LOG_VIEWER_PRODUCTION_TOKEN'), + // ], + // 'headers' => [ + // 'X-Foo' => 'Bar', + // ], + // 'verify_server_certificate' => true, + // ], + ], + + /* + |-------------------------------------------------------------------------- + | Include file patterns + |-------------------------------------------------------------------------- + | + */ + + 'include_files' => [ + '*.log', + '**/*.log', + + // You can include paths to other log types as well, such as apache, nginx, and more. + // This key => value pair can be used to rename and group multiple paths into one folder in the UI. + '/var/log/httpd/*' => 'Apache', + '/var/log/nginx/*' => 'Nginx', + + // MacOS Apple Silicon logs + '/opt/homebrew/var/log/nginx/*', + '/opt/homebrew/var/log/httpd/*', + '/opt/homebrew/var/log/php-fpm.log', + '/opt/homebrew/var/log/postgres*log', + '/opt/homebrew/var/log/redis*log', + '/opt/homebrew/var/log/supervisor*log', + + // '/absolute/paths/supported', + ], + + /* + |-------------------------------------------------------------------------- + | Exclude file patterns. + |-------------------------------------------------------------------------- + | This will take precedence over included files. + | + */ + + 'exclude_files' => [ + // 'my_secret.log' + ], + + /* + |-------------------------------------------------------------------------- + | Hide unknown files. + |-------------------------------------------------------------------------- + | The include/exclude options above might catch files which are not + | logs supported by Log Viewer. In that case, you can hide them + | from the UI and API calls by setting this to true. + | + */ + + 'hide_unknown_files' => true, + + /* + |-------------------------------------------------------------------------- + | Shorter stack trace filters. + |-------------------------------------------------------------------------- + | Lines containing any of these strings will be excluded from the full log. + | This setting is only active when the function is enabled via the user interface. + | + */ + + 'shorter_stack_trace_excludes' => [ + '/vendor/symfony/', + '/vendor/laravel/framework/', + '/vendor/barryvdh/laravel-debugbar/', + ], + + /* + |-------------------------------------------------------------------------- + | Cache driver + |-------------------------------------------------------------------------- + | Cache driver to use for storing the log indices. Indices are used to speed up + | log navigation. Defaults to your application's default cache driver. + | + */ + + 'cache_driver' => env('LOG_VIEWER_CACHE_DRIVER', null), + + /* + |-------------------------------------------------------------------------- + | Cache key prefix + |-------------------------------------------------------------------------- + | Log Viewer prefixes all the cache keys created with this value. If for + | some reason you would like to change this prefix, you can do so here. + | The format of Log Viewer cache keys is: + | {prefix}:{version}:{rest-of-the-key} + | + */ + + 'cache_key_prefix' => 'lv', + + /* + |-------------------------------------------------------------------------- + | Chunk size when scanning log files lazily + |-------------------------------------------------------------------------- + | The size in MB of files to scan before updating the progress bar when searching across all files. + | + */ + + 'lazy_scan_chunk_size_in_mb' => 50, + + 'strip_extracted_context' => true, + + /* + |-------------------------------------------------------------------------- + | Per page options + |-------------------------------------------------------------------------- + | Define the available options for number of results per page + | + */ + + 'per_page_options' => [10, 25, 50, 100, 250, 500], +]; diff --git a/resources/js/Navbars/MainPageNavbar.vue b/resources/js/Navbars/MainPageNavbar.vue index fd9fbfe..ba30054 100644 --- a/resources/js/Navbars/MainPageNavbar.vue +++ b/resources/js/Navbars/MainPageNavbar.vue @@ -86,9 +86,6 @@ export default { sections: { type: Object, }, - sliderRef: { - default: true - }, }, data() { return { diff --git a/resources/js/Pages/Main.vue b/resources/js/Pages/Main.vue index cef7082..7581787 100644 --- a/resources/js/Pages/Main.vue +++ b/resources/js/Pages/Main.vue @@ -77,7 +77,7 @@
- + Все мероприятия diff --git a/resources/js/componentss/features/sliders/Slider.vue b/resources/js/componentss/features/sliders/Slider.vue index 96910b2..7cb247c 100644 --- a/resources/js/componentss/features/sliders/Slider.vue +++ b/resources/js/componentss/features/sliders/Slider.vue @@ -2,9 +2,10 @@
-
+ + -
+ \ No newline at end of file diff --git a/resources/js/componentss/features/sliders/components/SliderBody.vue b/resources/js/componentss/features/sliders/components/SliderBody.vue index f0e7775..1048778 100644 --- a/resources/js/componentss/features/sliders/components/SliderBody.vue +++ b/resources/js/componentss/features/sliders/components/SliderBody.vue @@ -64,21 +64,26 @@
{{ currentIndex + 1 }} -
-
+
+
{{ slides.length }}
@@ -90,7 +95,7 @@