improve filament trans + user profile actions

This commit is contained in:
xiaomlove
2022-06-30 21:08:25 +08:00
parent 459d7462de
commit 579351c0eb
27 changed files with 966 additions and 178 deletions
@@ -4,8 +4,10 @@ namespace App\Filament\Resources\System\AgentAllowResource\Pages;
use App\Filament\PageList;
use App\Filament\Resources\System\AgentAllowResource;
use App\Repositories\AgentAllowRepository;
use Filament\Pages\Actions;
use Filament\Resources\Pages\ListRecords;
use Filament\Forms;
class ListAgentAllows extends PageList
{
@@ -15,6 +17,23 @@ class ListAgentAllows extends PageList
{
return [
Actions\CreateAction::make(),
Actions\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(),
])
->modalHeading(__('admin.resources.agent_allow.check_modal_header'))
->action(function ($data) {
$agentAllowRep = new AgentAllowRepository();
try {
$result = $agentAllowRep->checkClient($data['peer_id'], $data['agent']);
$this->notify('success', __('admin.resources.agent_allow.check_pass_msg', ['id' => $result->id]));
} catch (\Exception $exception) {
$this->notify('danger', $exception->getMessage());
}
})
];
}
}