mirror of
https://github.com/pelican-dev/panel.git
synced 2025-05-29 15:34:44 +02:00
Added count badge to navigation sidebar
This commit is contained in:
parent
d7ebde5f5f
commit
4ad837ff14
@ -13,6 +13,10 @@ class ApiKeyResource extends Resource
|
|||||||
protected static ?string $model = ApiKey::class;
|
protected static ?string $model = ApiKey::class;
|
||||||
protected static ?string $label = 'API Key';
|
protected static ?string $label = 'API Key';
|
||||||
|
|
||||||
|
public static function getNavigationBadge(): ?string
|
||||||
|
{
|
||||||
|
return static::getModel()::count();
|
||||||
|
}
|
||||||
protected static ?string $navigationIcon = 'tabler-key';
|
protected static ?string $navigationIcon = 'tabler-key';
|
||||||
|
|
||||||
public static function canEdit($record): bool
|
public static function canEdit($record): bool
|
||||||
|
@ -10,6 +10,11 @@ class DatabaseHostResource extends Resource
|
|||||||
{
|
{
|
||||||
protected static ?string $model = DatabaseHost::class;
|
protected static ?string $model = DatabaseHost::class;
|
||||||
|
|
||||||
|
public static function getNavigationBadge(): ?string
|
||||||
|
{
|
||||||
|
return static::getModel()::count();
|
||||||
|
}
|
||||||
|
|
||||||
protected static ?string $label = 'Databases';
|
protected static ?string $label = 'Databases';
|
||||||
|
|
||||||
protected static ?string $navigationIcon = 'tabler-database';
|
protected static ?string $navigationIcon = 'tabler-database';
|
||||||
|
@ -10,6 +10,11 @@ class DatabaseResource extends Resource
|
|||||||
{
|
{
|
||||||
protected static ?string $model = Database::class;
|
protected static ?string $model = Database::class;
|
||||||
|
|
||||||
|
public static function getNavigationBadge(): ?string
|
||||||
|
{
|
||||||
|
return static::getModel()::count();
|
||||||
|
}
|
||||||
|
|
||||||
protected static ?string $navigationIcon = 'tabler-database';
|
protected static ?string $navigationIcon = 'tabler-database';
|
||||||
|
|
||||||
protected static bool $shouldRegisterNavigation = false;
|
protected static bool $shouldRegisterNavigation = false;
|
||||||
|
@ -10,6 +10,10 @@ class EggResource extends Resource
|
|||||||
{
|
{
|
||||||
protected static ?string $model = Egg::class;
|
protected static ?string $model = Egg::class;
|
||||||
|
|
||||||
|
public static function getNavigationBadge(): ?string
|
||||||
|
{
|
||||||
|
return static::getModel()::count();
|
||||||
|
}
|
||||||
protected static ?string $navigationIcon = 'tabler-eggs';
|
protected static ?string $navigationIcon = 'tabler-eggs';
|
||||||
|
|
||||||
protected static ?string $recordTitleAttribute = 'name';
|
protected static ?string $recordTitleAttribute = 'name';
|
||||||
|
@ -10,6 +10,11 @@ class MountResource extends Resource
|
|||||||
{
|
{
|
||||||
protected static ?string $model = Mount::class;
|
protected static ?string $model = Mount::class;
|
||||||
|
|
||||||
|
public static function getNavigationBadge(): ?string
|
||||||
|
{
|
||||||
|
return static::getModel()::count();
|
||||||
|
}
|
||||||
|
|
||||||
protected static ?string $navigationIcon = 'tabler-layers-linked';
|
protected static ?string $navigationIcon = 'tabler-layers-linked';
|
||||||
|
|
||||||
public static function getRelations(): array
|
public static function getRelations(): array
|
||||||
|
@ -11,6 +11,11 @@ class NodeResource extends Resource
|
|||||||
{
|
{
|
||||||
protected static ?string $model = Node::class;
|
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 $navigationIcon = 'tabler-server-2';
|
||||||
|
|
||||||
protected static ?string $recordTitleAttribute = 'name';
|
protected static ?string $recordTitleAttribute = 'name';
|
||||||
|
@ -10,6 +10,11 @@ class ServerResource extends Resource
|
|||||||
{
|
{
|
||||||
protected static ?string $model = Server::class;
|
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 $navigationIcon = 'tabler-brand-docker';
|
||||||
|
|
||||||
protected static ?string $recordTitleAttribute = 'name';
|
protected static ?string $recordTitleAttribute = 'name';
|
||||||
|
@ -11,6 +11,10 @@ class UserResource extends Resource
|
|||||||
{
|
{
|
||||||
protected static ?string $model = User::class;
|
protected static ?string $model = User::class;
|
||||||
|
|
||||||
|
public static function getNavigationBadge(): ?string
|
||||||
|
{
|
||||||
|
return static::getModel()::count();
|
||||||
|
}
|
||||||
protected static ?string $navigationIcon = 'tabler-users';
|
protected static ?string $navigationIcon = 'tabler-users';
|
||||||
|
|
||||||
protected static ?string $recordTitleAttribute = 'username';
|
protected static ?string $recordTitleAttribute = 'username';
|
||||||
|
Loading…
x
Reference in New Issue
Block a user