mirror of
				https://github.com/pelican-dev/panel.git
				synced 2025-10-26 08:06:52 +01:00 
			
		
		
		
	Allow adding new allocations to existing servers
This commit is contained in:
		
							parent
							
								
									7a327ea378
								
							
						
					
					
						commit
						5e7f5c2a4c
					
				| @ -27,13 +27,15 @@ class AllocationsRelationManager extends RelationManager | |||||||
|     { |     { | ||||||
|         return $table |         return $table | ||||||
|             ->recordTitleAttribute('ip') |             ->recordTitleAttribute('ip') | ||||||
|  |             ->recordTitle(fn (Allocation $allocation) => "$allocation->ip:$allocation->port") | ||||||
|             ->checkIfRecordIsSelectableUsing(fn (Allocation $record) => $record->id !== $this->getOwnerRecord()->allocation_id) |             ->checkIfRecordIsSelectableUsing(fn (Allocation $record) => $record->id !== $this->getOwnerRecord()->allocation_id) | ||||||
|             // ->actions
 |             // ->actions
 | ||||||
|             // ->groups
 |             // ->groups
 | ||||||
|  |             ->inverseRelationship('server') | ||||||
|             ->columns([ |             ->columns([ | ||||||
|                 Tables\Columns\TextInputColumn::make('ip_alias')->label('Alias'), |  | ||||||
|                 Tables\Columns\TextColumn::make('ip')->label('IP'), |                 Tables\Columns\TextColumn::make('ip')->label('IP'), | ||||||
|                 Tables\Columns\TextColumn::make('port')->label('Port'), |                 Tables\Columns\TextColumn::make('port')->label('Port'), | ||||||
|  |                 Tables\Columns\TextInputColumn::make('ip_alias')->label('Alias'), | ||||||
|                 Tables\Columns\IconColumn::make('primary') |                 Tables\Columns\IconColumn::make('primary') | ||||||
|                     ->icon(fn ($state) => match ($state) { |                     ->icon(fn ($state) => match ($state) { | ||||||
|                         false => 'tabler-star', |                         false => 'tabler-star', | ||||||
| @ -57,7 +59,11 @@ class AllocationsRelationManager extends RelationManager | |||||||
|             ]) |             ]) | ||||||
|             ->headerActions([ |             ->headerActions([ | ||||||
|                 //TODO Tables\Actions\CreateAction::make()->label('Create Allocation'),
 |                 //TODO Tables\Actions\CreateAction::make()->label('Create Allocation'),
 | ||||||
|                 //TODO Tables\Actions\AssociateAction::make()->label('Add Allocation'),
 |                 Tables\Actions\AssociateAction::make() | ||||||
|  |                     ->multiple() | ||||||
|  |                     ->preloadRecordSelect() | ||||||
|  |                     ->recordSelectOptionsQuery(fn ($query) => $query->whereBelongsTo($this->getOwnerRecord()->node)) | ||||||
|  |                     ->label('Add Allocation'), | ||||||
|             ]) |             ]) | ||||||
|             ->bulkActions([ |             ->bulkActions([ | ||||||
|                 Tables\Actions\BulkActionGroup::make([ |                 Tables\Actions\BulkActionGroup::make([ | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Lance Pioch
						Lance Pioch