Show blank if only 0

This commit is contained in:
Lance Pioch 2024-05-15 14:11:09 -04:00
parent ee3f8cd3ec
commit 0c72833af7
8 changed files with 35 additions and 33 deletions

View File

@ -12,12 +12,12 @@ class ApiKeyResource extends Resource
{
protected static ?string $model = ApiKey::class;
protected static ?string $label = 'API Key';
protected static ?string $navigationIcon = 'tabler-key';
public static function getNavigationBadge(): ?string
{
return static::getModel()::count();
return static::getModel()::count() ?: null;
}
protected static ?string $navigationIcon = 'tabler-key';
public static function canEdit($record): bool
{

View File

@ -10,15 +10,15 @@ class DatabaseHostResource extends Resource
{
protected static ?string $model = DatabaseHost::class;
public static function getNavigationBadge(): ?string
{
return static::getModel()::count();
}
protected static ?string $label = 'Databases';
protected static ?string $navigationIcon = 'tabler-database';
public static function getNavigationBadge(): ?string
{
return static::getModel()::count() ?: null;
}
public static function getRelations(): array
{
return [

View File

@ -10,15 +10,15 @@ class DatabaseResource extends Resource
{
protected static ?string $model = Database::class;
public static function getNavigationBadge(): ?string
{
return static::getModel()::count();
}
protected static ?string $navigationIcon = 'tabler-database';
protected static bool $shouldRegisterNavigation = false;
public static function getNavigationBadge(): ?string
{
return static::getModel()::count() ?: null;
}
public static function getRelations(): array
{
return [

View File

@ -10,16 +10,17 @@ class EggResource extends Resource
{
protected static ?string $model = Egg::class;
public static function getNavigationBadge(): ?string
{
return static::getModel()::count();
}
protected static ?string $navigationIcon = 'tabler-eggs';
protected static ?string $recordTitleAttribute = 'name';
protected static ?string $recordRouteKeyName = 'id';
public static function getNavigationBadge(): ?string
{
return static::getModel()::count() ?: null;
}
public static function getRelations(): array
{
return [

View File

@ -10,13 +10,13 @@ class MountResource extends Resource
{
protected static ?string $model = Mount::class;
protected static ?string $navigationIcon = 'tabler-layers-linked';
public static function getNavigationBadge(): ?string
{
return static::getModel()::count();
return static::getModel()::count() ?: null;
}
protected static ?string $navigationIcon = 'tabler-layers-linked';
public static function getRelations(): array
{
return [

View File

@ -11,15 +11,15 @@ class NodeResource extends Resource
{
protected static ?string $model = Node::class;
public static function getNavigationBadge(): ?string
{
return static::getModel()::count();
}
protected static ?string $navigationIcon = 'tabler-server-2';
protected static ?string $recordTitleAttribute = 'name';
public static function getNavigationBadge(): ?string
{
return static::getModel()::count() ?: null;
}
public static function getRelations(): array
{
return [

View File

@ -10,15 +10,15 @@ class ServerResource extends Resource
{
protected static ?string $model = Server::class;
public static function getNavigationBadge(): ?string
{
return static::getModel()::count();
}
protected static ?string $navigationIcon = 'tabler-brand-docker';
protected static ?string $recordTitleAttribute = 'name';
public static function getNavigationBadge(): ?string
{
return static::getModel()::count() ?: null;
}
public static function getRelations(): array
{
return [

View File

@ -11,14 +11,15 @@ class UserResource extends Resource
{
protected static ?string $model = User::class;
public static function getNavigationBadge(): ?string
{
return static::getModel()::count();
}
protected static ?string $navigationIcon = 'tabler-users';
protected static ?string $recordTitleAttribute = 'username';
public static function getNavigationBadge(): ?string
{
return static::getModel()::count() ?: null;
}
public static function getRelations(): array
{
return [