mirror of
				https://github.com/pelican-dev/panel.git
				synced 2025-10-31 04:36:51 +01:00 
			
		
		
		
	 b003404aea
			
		
	
	
		b003404aea
		
			
		
	
	
	
	
		
			
			* enable tags for nodes * update icon for cpu column * disable inline for "force outgoing ip" label * change label for database hosts resource * add custom empty state for database hosts & api keys * add icons to egg tabs * fix typo * rename node "Automatic Allocation" to avoid confusion * run code cleanup * remove regex for node name * only check count for application api keys * replace "New" with "Create" * change sidebar width to fit "Database Hosts"
		
			
				
	
	
		
			34 lines
		
	
	
		
			846 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			34 lines
		
	
	
		
			846 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
| <?php
 | |
| 
 | |
| namespace App\Filament\Resources;
 | |
| 
 | |
| use App\Filament\Resources\ApiKeyResource\Pages;
 | |
| use App\Models\ApiKey;
 | |
| use Filament\Resources\Resource;
 | |
| 
 | |
| class ApiKeyResource extends Resource
 | |
| {
 | |
|     protected static ?string $model = ApiKey::class;
 | |
|     protected static ?string $label = 'API Key';
 | |
|     protected static ?string $navigationIcon = 'tabler-key';
 | |
|     protected static ?string $navigationGroup = 'Advanced';
 | |
| 
 | |
|     public static function getNavigationBadge(): ?string
 | |
|     {
 | |
|         return static::getModel()::where('key_type', '2')->count() ?: null;
 | |
|     }
 | |
| 
 | |
|     public static function canEdit($record): bool
 | |
|     {
 | |
|         return false;
 | |
|     }
 | |
| 
 | |
|     public static function getPages(): array
 | |
|     {
 | |
|         return [
 | |
|             'index' => Pages\ListApiKeys::route('/'),
 | |
|             'create' => Pages\CreateApiKey::route('/create'),
 | |
|         ];
 | |
|     }
 | |
| }
 |