diff --git a/app/Filament/Admin/Resources/ApiKeyResource.php b/app/Filament/Admin/Resources/ApiKeyResource.php index 7a42c1293..20f331a50 100644 --- a/app/Filament/Admin/Resources/ApiKeyResource.php +++ b/app/Filament/Admin/Resources/ApiKeyResource.php @@ -5,13 +5,16 @@ namespace App\Filament\Admin\Resources; use App\Filament\Admin\Resources\ApiKeyResource\Pages; use App\Models\ApiKey; use Filament\Resources\Resource; -use Illuminate\Database\Eloquent\Model; class ApiKeyResource extends Resource { protected static ?string $model = ApiKey::class; - protected static ?string $label = 'API Key'; + protected static ?string $modelLabel = 'Application API Key'; + + protected static ?string $pluralModelLabel = 'Application API Keys'; + + protected static ?string $navigationLabel = 'API Keys'; protected static ?string $navigationIcon = 'tabler-key'; @@ -22,11 +25,6 @@ class ApiKeyResource extends Resource return static::getModel()::where('key_type', ApiKey::TYPE_APPLICATION)->count() ?: null; } - public static function canEdit(Model $record): bool - { - return false; - } - public static function getPages(): array { return [ diff --git a/app/Filament/Admin/Resources/ApiKeyResource/Pages/CreateApiKey.php b/app/Filament/Admin/Resources/ApiKeyResource/Pages/CreateApiKey.php index c34fde5d1..8dee91fc1 100644 --- a/app/Filament/Admin/Resources/ApiKeyResource/Pages/CreateApiKey.php +++ b/app/Filament/Admin/Resources/ApiKeyResource/Pages/CreateApiKey.php @@ -17,7 +17,19 @@ class CreateApiKey extends CreateRecord { protected static string $resource = ApiKeyResource::class; - protected ?string $heading = 'Create Application API Key'; + protected static bool $canCreateAnother = false; + + protected function getHeaderActions(): array + { + return [ + $this->getCreateFormAction()->formId('form'), + ]; + } + + protected function getFormActions(): array + { + return []; + } public function form(Form $form): Form { diff --git a/app/Filament/Admin/Resources/DatabaseHostResource.php b/app/Filament/Admin/Resources/DatabaseHostResource.php index 2a00907df..85a4f7719 100644 --- a/app/Filament/Admin/Resources/DatabaseHostResource.php +++ b/app/Filament/Admin/Resources/DatabaseHostResource.php @@ -10,12 +10,12 @@ class DatabaseHostResource extends Resource { protected static ?string $model = DatabaseHost::class; - protected static ?string $label = 'Database Host'; - protected static ?string $navigationIcon = 'tabler-database'; protected static ?string $navigationGroup = 'Advanced'; + protected static ?string $recordTitleAttribute = 'name'; + public static function getNavigationBadge(): ?string { return static::getModel()::count() ?: null; diff --git a/app/Filament/Admin/Resources/DatabaseHostResource/Pages/CreateDatabaseHost.php b/app/Filament/Admin/Resources/DatabaseHostResource/Pages/CreateDatabaseHost.php index af60675a7..e1ed34bef 100644 --- a/app/Filament/Admin/Resources/DatabaseHostResource/Pages/CreateDatabaseHost.php +++ b/app/Filament/Admin/Resources/DatabaseHostResource/Pages/CreateDatabaseHost.php @@ -17,15 +17,11 @@ use PDOException; class CreateDatabaseHost extends CreateRecord { - private HostCreationService $service; - protected static string $resource = DatabaseHostResource::class; - protected ?string $heading = 'Database Hosts'; - protected static bool $canCreateAnother = false; - protected ?string $subheading = '(database servers that can have individual databases)'; + private HostCreationService $service; public function boot(HostCreationService $service): void { diff --git a/app/Filament/Admin/Resources/EggResource.php b/app/Filament/Admin/Resources/EggResource.php index 20cf209a1..24cd52684 100644 --- a/app/Filament/Admin/Resources/EggResource.php +++ b/app/Filament/Admin/Resources/EggResource.php @@ -14,8 +14,6 @@ class EggResource extends Resource protected static ?string $recordTitleAttribute = 'name'; - protected static ?string $recordRouteKeyName = 'id'; - public static function getNavigationBadge(): ?string { return static::getModel()::count() ?: null; diff --git a/app/Filament/Admin/Resources/EggResource/Pages/CreateEgg.php b/app/Filament/Admin/Resources/EggResource/Pages/CreateEgg.php index b13faccc5..cba306d55 100644 --- a/app/Filament/Admin/Resources/EggResource/Pages/CreateEgg.php +++ b/app/Filament/Admin/Resources/EggResource/Pages/CreateEgg.php @@ -28,6 +28,18 @@ class CreateEgg extends CreateRecord protected static bool $canCreateAnother = false; + protected function getHeaderActions(): array + { + return [ + $this->getCreateFormAction()->formId('form'), + ]; + } + + protected function getFormActions(): array + { + return []; + } + public function form(Form $form): Form { return $form diff --git a/app/Filament/Admin/Resources/MountResource.php b/app/Filament/Admin/Resources/MountResource.php index 83ecc697d..57d8fcf68 100644 --- a/app/Filament/Admin/Resources/MountResource.php +++ b/app/Filament/Admin/Resources/MountResource.php @@ -14,6 +14,8 @@ class MountResource extends Resource protected static ?string $navigationGroup = 'Advanced'; + protected static ?string $recordTitleAttribute = 'name'; + public static function getNavigationBadge(): ?string { return static::getModel()::count() ?: null; diff --git a/app/Filament/Admin/Resources/MountResource/Pages/CreateMount.php b/app/Filament/Admin/Resources/MountResource/Pages/CreateMount.php index 1660b3dbb..2767545f0 100644 --- a/app/Filament/Admin/Resources/MountResource/Pages/CreateMount.php +++ b/app/Filament/Admin/Resources/MountResource/Pages/CreateMount.php @@ -21,6 +21,18 @@ class CreateMount extends CreateRecord protected static bool $canCreateAnother = false; + protected function getHeaderActions(): array + { + return [ + $this->getCreateFormAction()->formId('form'), + ]; + } + + protected function getFormActions(): array + { + return []; + } + public function form(Form $form): Form { return $form diff --git a/app/Filament/Admin/Resources/NodeResource/Pages/CreateNode.php b/app/Filament/Admin/Resources/NodeResource/Pages/CreateNode.php index 67aeee461..8f78625d1 100644 --- a/app/Filament/Admin/Resources/NodeResource/Pages/CreateNode.php +++ b/app/Filament/Admin/Resources/NodeResource/Pages/CreateNode.php @@ -23,8 +23,6 @@ class CreateNode extends CreateRecord protected static bool $canCreateAnother = false; - protected ?string $subheading = 'which is a machine that runs your Servers'; - public function form(Forms\Form $form): Forms\Form { return $form diff --git a/app/Filament/Admin/Resources/RoleResource/Pages/CreateRole.php b/app/Filament/Admin/Resources/RoleResource/Pages/CreateRole.php index 55023de95..7f908cfbc 100644 --- a/app/Filament/Admin/Resources/RoleResource/Pages/CreateRole.php +++ b/app/Filament/Admin/Resources/RoleResource/Pages/CreateRole.php @@ -14,11 +14,23 @@ use Spatie\Permission\Models\Permission; */ class CreateRole extends CreateRecord { + public Collection $permissions; + protected static string $resource = RoleResource::class; protected static bool $canCreateAnother = false; - public Collection $permissions; + protected function getHeaderActions(): array + { + return [ + $this->getCreateFormAction()->formId('form'), + ]; + } + + protected function getFormActions(): array + { + return []; + } protected function mutateFormDataBeforeCreate(array $data): array { diff --git a/app/Filament/Admin/Resources/WebhookResource.php b/app/Filament/Admin/Resources/WebhookResource.php index 54eed4b5a..1eb522d74 100644 --- a/app/Filament/Admin/Resources/WebhookResource.php +++ b/app/Filament/Admin/Resources/WebhookResource.php @@ -10,11 +10,15 @@ class WebhookResource extends Resource { protected static ?string $model = WebhookConfiguration::class; + protected static ?string $modelLabel = 'Webhook'; + + protected static ?string $pluralModelLabel = 'Webhooks'; + protected static ?string $navigationIcon = 'tabler-webhook'; protected static ?string $navigationGroup = 'Advanced'; - protected static ?string $label = 'Webhooks'; + protected static ?string $recordTitleAttribute = 'description'; public static function getNavigationBadge(): ?string { diff --git a/app/Filament/Admin/Resources/WebhookResource/Pages/CreateWebhookConfiguration.php b/app/Filament/Admin/Resources/WebhookResource/Pages/CreateWebhookConfiguration.php index ad22fb8f1..0bca400ee 100644 --- a/app/Filament/Admin/Resources/WebhookResource/Pages/CreateWebhookConfiguration.php +++ b/app/Filament/Admin/Resources/WebhookResource/Pages/CreateWebhookConfiguration.php @@ -13,6 +13,20 @@ class CreateWebhookConfiguration extends CreateRecord { protected static string $resource = WebhookResource::class; + protected static bool $canCreateAnother = false; + + protected function getHeaderActions(): array + { + return [ + $this->getCreateFormAction()->formId('form'), + ]; + } + + protected function getFormActions(): array + { + return []; + } + public function form(Form $form): Form { return $form diff --git a/app/Filament/Server/Resources/ActivityResource.php b/app/Filament/Server/Resources/ActivityResource.php index c4762eeb9..30a219544 100644 --- a/app/Filament/Server/Resources/ActivityResource.php +++ b/app/Filament/Server/Resources/ActivityResource.php @@ -17,9 +17,9 @@ class ActivityResource extends Resource { protected static ?string $model = ActivityLog::class; - protected static ?string $label = 'Activity'; + protected static ?string $modelLabel = 'Activity'; - protected static ?string $pluralLabel = 'Activity'; + protected static ?string $pluralModelLabel = 'Activity'; protected static ?int $navigationSort = 8; diff --git a/app/Filament/Server/Resources/AllocationResource.php b/app/Filament/Server/Resources/AllocationResource.php index 8ad2c509a..614f52b47 100644 --- a/app/Filament/Server/Resources/AllocationResource.php +++ b/app/Filament/Server/Resources/AllocationResource.php @@ -14,9 +14,9 @@ class AllocationResource extends Resource { protected static ?string $model = Allocation::class; - protected static ?string $label = 'Network'; + protected static ?string $modelLabel = 'Network'; - protected static ?string $pluralLabel = 'Network'; + protected static ?string $pluralModelLabel = 'Network'; protected static ?int $navigationSort = 7; diff --git a/app/Models/DatabaseHost.php b/app/Models/DatabaseHost.php index 325211a50..1163959d2 100644 --- a/app/Models/DatabaseHost.php +++ b/app/Models/DatabaseHost.php @@ -16,6 +16,10 @@ use Illuminate\Database\Eloquent\Relations\HasMany; * @property int|null $node_id * @property \Carbon\CarbonImmutable $created_at * @property \Carbon\CarbonImmutable $updated_at + * @property \Illuminate\Database\Eloquent\Collection|\App\Models\Node[] $nodes + * @property int|null $nodes_count + * @property \Illuminate\Database\Eloquent\Collection|\App\Models\Database[] $databases + * @property int|null $databases_count */ class DatabaseHost extends Model { diff --git a/app/Models/Egg.php b/app/Models/Egg.php index 8f6013dc5..5ebc16575 100644 --- a/app/Models/Egg.php +++ b/app/Models/Egg.php @@ -43,7 +43,9 @@ use Illuminate\Support\Str; * @property string $inherit_file_denylist * @property array|null $inherit_features * @property \Illuminate\Database\Eloquent\Collection|\App\Models\Server[] $servers + * @property int|null $servers_count * @property \Illuminate\Database\Eloquent\Collection|\App\Models\EggVariable[] $variables + * @property int|null $variables_count * @property \App\Models\Egg|null $scriptFrom * @property \App\Models\Egg|null $configFrom */ diff --git a/app/Models/Node.php b/app/Models/Node.php index 923c5278d..011abb252 100644 --- a/app/Models/Node.php +++ b/app/Models/Node.php @@ -41,8 +41,11 @@ use Symfony\Component\Yaml\Yaml; * @property \Carbon\Carbon $created_at * @property \Carbon\Carbon $updated_at * @property \App\Models\Mount[]|\Illuminate\Database\Eloquent\Collection $mounts + * @property int|null $mounts_count * @property \App\Models\Server[]|\Illuminate\Database\Eloquent\Collection $servers + * @property int|null $servers_count * @property \App\Models\Allocation[]|\Illuminate\Database\Eloquent\Collection $allocations + * @property int|null $allocations_count */ class Node extends Model {