Changes
This commit is contained in:
@@ -0,0 +1,102 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Pages;
|
||||||
|
|
||||||
|
use AskerAkbar\Checkpoint\Settings\CheckpointSettings;
|
||||||
|
use Filament\Forms\Components\Grid;
|
||||||
|
use Filament\Forms\Components\Section;
|
||||||
|
use Filament\Forms\Components\TextInput;
|
||||||
|
use Filament\Forms\Components\Toggle;
|
||||||
|
use Filament\Forms\Form;
|
||||||
|
use Filament\Forms\Get;
|
||||||
|
use Filament\Pages\SettingsPage;
|
||||||
|
|
||||||
|
class CheckpointSettingsPage extends SettingsPage
|
||||||
|
{
|
||||||
|
protected static ?string $slug = 'checkpoint/settings';
|
||||||
|
|
||||||
|
protected static ?string $navigationIcon = 'heroicon-o-adjustments-horizontal';
|
||||||
|
|
||||||
|
protected static string $settings = CheckpointSettings::class;
|
||||||
|
|
||||||
|
public static function getNavigationLabel(): string
|
||||||
|
{
|
||||||
|
return 'Настройки Контрольных Точек'; // Русифицированная метка навигации
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getTitle(): string
|
||||||
|
{
|
||||||
|
return 'Настройки Контрольных Точек'; // Заголовок страницы
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getSubheading(): ?string
|
||||||
|
{
|
||||||
|
return 'Здесь вы можете настроить параметры контрольных точек.'; // Подзаголовок с описанием
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function getNavigationGroup(): ?string
|
||||||
|
{
|
||||||
|
return 'Settings'; // Группа навигации
|
||||||
|
}
|
||||||
|
|
||||||
|
public function form(Form $form): Form
|
||||||
|
{
|
||||||
|
return $form
|
||||||
|
->schema([
|
||||||
|
Grid::make()
|
||||||
|
->columns([
|
||||||
|
'default' => 1,
|
||||||
|
])
|
||||||
|
->columnSpan(2)
|
||||||
|
->schema([
|
||||||
|
TextInput::make('max_attempts')
|
||||||
|
->required()
|
||||||
|
->integer()
|
||||||
|
->minValue(1)
|
||||||
|
->label('Максимальное количество попыток') // Метка для поля
|
||||||
|
->helperText('Введите максимальное количество попыток входа.') // Подсказка
|
||||||
|
->suffix('попытки'),
|
||||||
|
TextInput::make('lockout_duration')
|
||||||
|
->required()
|
||||||
|
->integer()
|
||||||
|
->minValue(1)
|
||||||
|
->label('Продолжительность блокировки (в секундах)') // Метка для поля
|
||||||
|
->helperText('Введите время блокировки в секундах.') // Подсказка
|
||||||
|
->suffix('секунд'),
|
||||||
|
]),
|
||||||
|
Grid::make()
|
||||||
|
->schema([
|
||||||
|
Section::make()
|
||||||
|
->columns([
|
||||||
|
'default' => 2,
|
||||||
|
])
|
||||||
|
->columnSpan(2)
|
||||||
|
->schema([
|
||||||
|
Toggle::make('notify_on_lockout')
|
||||||
|
->live()
|
||||||
|
->columnSpan(2)
|
||||||
|
->default(false)
|
||||||
|
->label('Уведомлять при блокировке'), // Метка для переключателя
|
||||||
|
TextInput::make('notification_emails')
|
||||||
|
->required()
|
||||||
|
->email()
|
||||||
|
->hidden(fn (Get $get): bool => ! $get('notify_on_lockout'))
|
||||||
|
->helperText('Введите адреса электронной почты для уведомлений.') // Подсказка
|
||||||
|
->label('Электронная почта для уведомлений'), // Метка для поля
|
||||||
|
TextInput::make('notify_after_lockouts')
|
||||||
|
->required()
|
||||||
|
->hidden(fn (Get $get): bool => ! $get('notify_on_lockout'))
|
||||||
|
->label('Уведомлять после блокировок') // Метка для поля
|
||||||
|
->helperText('Введите количество блокировок, после которых отправляется уведомление.') // Подсказка
|
||||||
|
->suffix('блокировок'),
|
||||||
|
TextInput::make('notification_time_frame')
|
||||||
|
->required()
|
||||||
|
->hidden(fn (Get $get): bool => ! $get('notify_on_lockout'))
|
||||||
|
->label('Временной интервал уведомлений (в секундах)') // Метка для поля
|
||||||
|
->helperText('Введите временной интервал для уведомлений в секундах.') // Подсказка
|
||||||
|
->suffix('секунд')
|
||||||
|
]),
|
||||||
|
]),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Plugins;
|
||||||
|
|
||||||
|
use App\Filament\Pages\CheckpointSettingsPage;
|
||||||
|
use AskerAkbar\Checkpoint\Pages\Auth\Login;
|
||||||
|
use Filament\Contracts\Plugin;
|
||||||
|
use Filament\Panel;
|
||||||
|
|
||||||
|
class CheckpointPlugin implements Plugin
|
||||||
|
{
|
||||||
|
private $login = Login::class;
|
||||||
|
|
||||||
|
|
||||||
|
private array $pages = [
|
||||||
|
CheckpointSettingsPage::class,
|
||||||
|
];
|
||||||
|
|
||||||
|
protected ?string $panelName = null;
|
||||||
|
|
||||||
|
public static function make(): static
|
||||||
|
{
|
||||||
|
return app(static::class);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getId(): string
|
||||||
|
{
|
||||||
|
return 'checkpoint';
|
||||||
|
}
|
||||||
|
|
||||||
|
public function register(Panel $panel): void
|
||||||
|
{
|
||||||
|
$panel->pages($this->pages)->login($this->login);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function boot(Panel $panel): void {}
|
||||||
|
|
||||||
|
public static function get(): Plugin
|
||||||
|
{
|
||||||
|
return filament(app(static::class)->getId());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -158,7 +158,7 @@ class RoleResource extends Resource implements HasShieldPermissions
|
|||||||
public static function getNavigationGroup(): ?string
|
public static function getNavigationGroup(): ?string
|
||||||
{
|
{
|
||||||
return Utils::isResourceNavigationGroupEnabled()
|
return Utils::isResourceNavigationGroupEnabled()
|
||||||
? __('filament-shield::filament-shield.nav.group')
|
? 'Settings'
|
||||||
: '';
|
: '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
namespace App\Providers\Filament;
|
namespace App\Providers\Filament;
|
||||||
|
|
||||||
use App\Filament\Pages\Backups;
|
use App\Filament\Pages\Backups;
|
||||||
|
use App\Filament\Plugins\CheckpointPlugin;
|
||||||
use Filament\Http\Middleware\Authenticate;
|
use Filament\Http\Middleware\Authenticate;
|
||||||
use Filament\Http\Middleware\DisableBladeIconComponents;
|
use Filament\Http\Middleware\DisableBladeIconComponents;
|
||||||
use Filament\Http\Middleware\DispatchServingFilamentEvent;
|
use Filament\Http\Middleware\DispatchServingFilamentEvent;
|
||||||
@@ -62,6 +63,7 @@ class AdminPanelProvider extends PanelProvider
|
|||||||
->plugins([
|
->plugins([
|
||||||
\BezhanSalleh\FilamentShield\FilamentShieldPlugin::make(),
|
\BezhanSalleh\FilamentShield\FilamentShieldPlugin::make(),
|
||||||
FilamentSpatieLaravelBackupPlugin::make()->usingPage(Backups::class),
|
FilamentSpatieLaravelBackupPlugin::make()->usingPage(Backups::class),
|
||||||
|
CheckpointPlugin::make(),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
"require": {
|
"require": {
|
||||||
"php": "^8.1",
|
"php": "^8.1",
|
||||||
"ext-curl": "*",
|
"ext-curl": "*",
|
||||||
|
"askerakbar/checkpoint": "^0.0.1",
|
||||||
"awcodes/filament-tiptap-editor": "^3.0",
|
"awcodes/filament-tiptap-editor": "^3.0",
|
||||||
"bezhansalleh/filament-shield": "^3.2",
|
"bezhansalleh/filament-shield": "^3.2",
|
||||||
"filament/filament": "^3.0-stable",
|
"filament/filament": "^3.0-stable",
|
||||||
|
|||||||
Generated
+659
-290
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
@@ -13,7 +13,7 @@ cropperjs/dist/cropper.min.css:
|
|||||||
|
|
||||||
filepond/dist/filepond.min.css:
|
filepond/dist/filepond.min.css:
|
||||||
(*!
|
(*!
|
||||||
* FilePond 4.31.3
|
* FilePond 4.31.4
|
||||||
* Licensed under MIT, https://opensource.org/licenses/MIT/
|
* Licensed under MIT, https://opensource.org/licenses/MIT/
|
||||||
* Please visit https://pqina.nl/filepond/ for details.
|
* Please visit https://pqina.nl/filepond/ for details.
|
||||||
*)
|
*)
|
||||||
|
|||||||
Reference in New Issue
Block a user