|
@@ -3,7 +3,7 @@
|
|
|
namespace IPv4Bundle\Admin;
|
|
|
|
|
|
use Base\AdminBundle\Admin\BaseAdmin;
|
|
|
-use IPv4Bundle\Entity\Host;
|
|
|
+use IPv4Bundle\Utils\HostStatus;
|
|
|
use Sonata\AdminBundle\Datagrid\DatagridMapper;
|
|
|
use Sonata\AdminBundle\Datagrid\ListMapper;
|
|
|
use Sonata\AdminBundle\Form\FormMapper;
|
|
@@ -51,12 +51,11 @@ class HostAdmin extends BaseAdmin
|
|
|
->tab('Host')
|
|
|
->with('Host')
|
|
|
->add('mac')
|
|
|
- ->add('hostType')
|
|
|
+ ->add('hostType', null, [
|
|
|
+ 'required' => true,
|
|
|
+ ])
|
|
|
->add('state', ChoiceType::class, [
|
|
|
- 'choices' => [
|
|
|
- Host::STATE_ACTIVE => Host::STATE_ACTIVE,
|
|
|
- Host::STATE_SUSPENDED => Host::STATE_SUSPENDED,
|
|
|
- ],
|
|
|
+ 'choices' => HostStatus::getChoices(),
|
|
|
'translation_domain' => 'IPv4Bundle',
|
|
|
])
|
|
|
->end()
|