components([ TextInput::make('family')->required()->label(__('label.agent_allow.family')), TextInput::make('start_name')->required()->label(__('label.agent_allow.start_name')), TextInput::make('peer_id_start')->required()->label(__('label.agent_allow.peer_id_start')), TextInput::make('peer_id_pattern')->required()->label(__('label.agent_allow.peer_id_pattern')), Radio::make('peer_id_matchtype')->options(self::$matchTypes)->required()->label(__('label.agent_allow.peer_id_matchtype')), TextInput::make('peer_id_match_num')->integer()->required()->label(__('label.agent_allow.peer_id_match_num')), TextInput::make('agent_start')->required()->label(__('label.agent_allow.agent_start')), TextInput::make('agent_pattern')->required()->label(__('label.agent_allow.agent_pattern')), Radio::make('agent_matchtype')->options(self::$matchTypes)->required()->label(__('label.agent_allow.agent_matchtype')), TextInput::make('agent_match_num')->required()->label(__('label.agent_allow.agent_match_num')), Radio::make('exception')->options(self::$yesOrNo)->required()->label(__('label.agent_allow.exception')), Radio::make('allowhttps')->options(self::$yesOrNo)->required()->label(__('label.agent_allow.allowhttps')), Textarea::make('comment')->label(__('label.comment')), ]); } public static function table(Table $table): Table { return $table ->columns([ TextColumn::make('id')->sortable(), TextColumn::make('family')->searchable()->label(__('label.agent_allow.family')), TextColumn::make('start_name')->searchable()->label(__('label.agent_allow.start_name')), TextColumn::make('peer_id_start')->label(__('label.agent_allow.peer_id_start')), TextColumn::make('agent_start')->label(__('label.agent_allow.agent_start')), ]) ->defaultSort('id', 'desc') ->filters([ // ]) ->recordActions([ EditAction::make(), DeleteAction::make()->using(function ($record) { $record->delete(); clear_agent_allow_deny_cache(); return redirect(self::getUrl()); }) ]) ->toolbarActions([ DeleteBulkAction::make(), ]); } public static function getRelations(): array { return [ DeniesRelationManager::class, ]; } public static function getPages(): array { return [ 'index' => ListAgentAllows::route('/'), 'create' => CreateAgentAllow::route('/create'), 'edit' => EditAgentAllow::route('/{record}/edit'), ]; } }