mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-24 03:57:22 +08:00
migration script
# Conflicts: # app/Filament/Resources/Torrent/AnnounceLogResource.php
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Filament\Resources\System\AgentAllowResource\Pages;
|
||||
|
||||
use Filament\Actions\DeleteAction;
|
||||
use App\Filament\Resources\System\AgentAllowResource;
|
||||
use App\Models\NexusModel;
|
||||
use Filament\Pages\Actions;
|
||||
@@ -14,7 +15,7 @@ class EditAgentAllow extends EditRecord
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return [
|
||||
Actions\DeleteAction::make()->using(function ($record) {
|
||||
DeleteAction::make()->using(function ($record) {
|
||||
$record->delete();
|
||||
clear_agent_allow_deny_cache();
|
||||
return redirect(AgentAllowResource::getUrl());
|
||||
|
||||
@@ -2,6 +2,10 @@
|
||||
|
||||
namespace App\Filament\Resources\System\AgentAllowResource\Pages;
|
||||
|
||||
use Filament\Actions\CreateAction;
|
||||
use Filament\Actions\Action;
|
||||
use Filament\Forms\Components\TextInput;
|
||||
use Exception;
|
||||
use App\Filament\PageList;
|
||||
use App\Filament\Resources\System\AgentAllowResource;
|
||||
use App\Repositories\AgentAllowRepository;
|
||||
@@ -16,12 +20,12 @@ class ListAgentAllows extends PageList
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return [
|
||||
Actions\CreateAction::make(),
|
||||
Actions\Action::make('check')
|
||||
CreateAction::make(),
|
||||
Action::make('check')
|
||||
->label(__('admin.resources.agent_allow.check_modal_btn'))
|
||||
->form([
|
||||
Forms\Components\TextInput::make('peer_id')->required(),
|
||||
Forms\Components\TextInput::make('agent')->required(),
|
||||
->schema([
|
||||
TextInput::make('peer_id')->required(),
|
||||
TextInput::make('agent')->required(),
|
||||
])
|
||||
->modalHeading(__('admin.resources.agent_allow.check_modal_header'))
|
||||
->action(function ($data) {
|
||||
@@ -29,7 +33,7 @@ class ListAgentAllows extends PageList
|
||||
try {
|
||||
$result = $agentAllowRep->checkClient($data['peer_id'], $data['agent']);
|
||||
send_admin_success_notification(__('admin.resources.agent_allow.check_pass_msg', ['id' => $result->id]));
|
||||
} catch (\Exception $exception) {
|
||||
} catch (Exception $exception) {
|
||||
send_admin_fail_notification($exception->getMessage());
|
||||
}
|
||||
})
|
||||
|
||||
+24
-17
@@ -2,8 +2,15 @@
|
||||
|
||||
namespace App\Filament\Resources\System\AgentAllowResource\RelationManagers;
|
||||
|
||||
use Filament\Schemas\Schema;
|
||||
use Filament\Forms\Components\TextInput;
|
||||
use Filament\Forms\Components\Textarea;
|
||||
use Filament\Tables\Columns\TextColumn;
|
||||
use Filament\Actions\CreateAction;
|
||||
use Filament\Actions\EditAction;
|
||||
use Filament\Actions\DeleteAction;
|
||||
use Filament\Actions\DeleteBulkAction;
|
||||
use Filament\Forms;
|
||||
use Filament\Forms\Form;
|
||||
use Filament\Resources\RelationManagers\RelationManager;
|
||||
use Filament\Tables\Table;
|
||||
use Filament\Tables;
|
||||
@@ -16,14 +23,14 @@ class DeniesRelationManager extends RelationManager
|
||||
|
||||
protected static ?string $recordTitleAttribute = 'name';
|
||||
|
||||
public function form(Form $form): Form
|
||||
public function form(Schema $schema): Schema
|
||||
{
|
||||
return $form
|
||||
->schema([
|
||||
Forms\Components\TextInput::make('name')->required()->maxLength(255)->label(__('label.name')),
|
||||
Forms\Components\TextInput::make('peer_id')->required()->maxLength(255)->label(__('label.agent_deny.peer_id')),
|
||||
Forms\Components\TextInput::make('agent')->required()->maxLength(255)->label(__('label.agent_deny.agent')),
|
||||
Forms\Components\Textarea::make('comment')->label(__('label.comment')),
|
||||
return $schema
|
||||
->components([
|
||||
TextInput::make('name')->required()->maxLength(255)->label(__('label.name')),
|
||||
TextInput::make('peer_id')->required()->maxLength(255)->label(__('label.agent_deny.peer_id')),
|
||||
TextInput::make('agent')->required()->maxLength(255)->label(__('label.agent_deny.agent')),
|
||||
Textarea::make('comment')->label(__('label.comment')),
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -31,22 +38,22 @@ class DeniesRelationManager extends RelationManager
|
||||
{
|
||||
return $table
|
||||
->columns([
|
||||
Tables\Columns\TextColumn::make('name')->label(__('label.name')),
|
||||
Tables\Columns\TextColumn::make('peer_id')->label(__('label.agent_deny.peer_id')),
|
||||
Tables\Columns\TextColumn::make('agent')->label(__('label.agent_deny.agent')),
|
||||
TextColumn::make('name')->label(__('label.name')),
|
||||
TextColumn::make('peer_id')->label(__('label.agent_deny.peer_id')),
|
||||
TextColumn::make('agent')->label(__('label.agent_deny.agent')),
|
||||
])
|
||||
->filters([
|
||||
//
|
||||
])
|
||||
->headerActions([
|
||||
Tables\Actions\CreateAction::make(),
|
||||
CreateAction::make(),
|
||||
])
|
||||
->actions([
|
||||
Tables\Actions\EditAction::make(),
|
||||
Tables\Actions\DeleteAction::make(),
|
||||
->recordActions([
|
||||
EditAction::make(),
|
||||
DeleteAction::make(),
|
||||
])
|
||||
->bulkActions([
|
||||
Tables\Actions\DeleteBulkAction::make(),
|
||||
->toolbarActions([
|
||||
DeleteBulkAction::make(),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user