<?php
namespace AdminBundle\Admin\Report;
use AdminBundle\Admin\BaseAdmin;
use Sonata\AdminBundle\Datagrid\ListMapper;
use Sonata\AdminBundle\Route\RouteCollectionInterface;
use Sonata\AdminBundle\Show\ShowMapper;
class CriticalLogAdmin extends BaseAdmin
{
protected function configureRoutes(RouteCollectionInterface $collection): void
{
$collection->remove('edit');
$collection->remove('create');
$collection->remove('delete');
}
protected function configureListFields(ListMapper $listMapper): void
{
$listMapper->addIdentifier('id')
->add('message',null, ['label' => 'Message'])
->add('contextForAdmin', 'text', ['label' => 'Context'])
->add('level',null, ['label' => 'Level'])
->add('level_name', null, ['label' => 'Level name'])
->add('domain', null, ['label' => 'Domain'])
->add('created_at', null, ['label' => 'Created At'])
->add('_action', 'actions', [
'label' => 'Действия',
'actions' => [
'view' => [],
]
])
;
}
protected function configureShowFields(ShowMapper $show): void
{
$show
->add('message',null, ['label' => 'Message'])
->add('contextForAdmin', 'textarea', ['label' => 'Context'])
->add('extraForAdmin', 'textarea', ['label' => 'Extra'])
->add('level',null, ['label' => 'Level'])
->add('level_name',null, ['label' => 'Level name'])
->add('domain',null, ['label' => 'Domain'])
->add('created_at',null, ['label' => 'Created At']);
}
protected $datagridValues = [
'_sort_order' => 'DESC',
'_sort_by' => 'id',
];
}