Prechádzať zdrojové kódy

FD3-407 Se agrega DeviceInterface

Guillermo Espinoza 7 rokov pred
rodič
commit
15d3b80d6c

+ 13 - 1
src/RadiusBundle/Admin/NASAdmin.php

@@ -70,6 +70,8 @@ class NASAdmin extends BaseAdmin
     protected function configureShowFields(ShowMapper $showMapper)
     {
         $showMapper
+            ->tab('default')
+            ->with('')
             ->add('description')
             ->add('host')
             ->add('snmp_comunity')
@@ -77,7 +79,17 @@ class NASAdmin extends BaseAdmin
             ->add('radius_password')
             ->add('model')
             ->add('acct_enabled')
-            ->add('extraData');
+            ->add('extraData')
+            ->end()
+            ->end()
+            ->tab('Log')
+            ->with('Log')
+            ->add('deviceLog', 'string', array(
+                'template' => 'DeviceBundle::show_device_log.html.twig',
+                'translation_domain' => 'DeviceBundle',
+            ))
+            ->end()
+            ->end();
     }
 
 }

+ 26 - 6
src/RadiusBundle/Entity/NAS.php

@@ -5,19 +5,23 @@ namespace RadiusBundle\Entity;
 use Base\AdminBundle\Traits\TenancyIdTrait;
 use Base\AdminBundle\Traits\TenancyIdTraitInterface;
 use Doctrine\ORM\Mapping as ORM;
+use DeviceBundle\Interfaces\DeviceInterface;
 use ExtraDataBundle\Entity\Traits\ExtraDataTrait;
+use MapBundle\Entity\Interfaces\LocationInterface;
+use MapBundle\Entity\Traits\LocationTrait;
 use Symfony\Component\Validator\Constraints as Assert;
 
 /**
  * @ORM\Table
  * @ORM\Entity
  */
-class NAS implements TenancyIdTraitInterface
+class NAS implements TenancyIdTraitInterface, DeviceInterface, LocationInterface
 {
 
     use ExtraDataTrait;
     use TenancyIdTrait;
-
+    use LocationTrait;
+    
     /**
      * @var int
      *
@@ -33,17 +37,17 @@ class NAS implements TenancyIdTraitInterface
     private $description;
 
     /**
-     * @ORM\Column(type="string", length=50, nullable=false, unique=TRUE)
+     * @ORM\Column(type="string", length=50, unique=true)
      */
     private $host;
 
     /**
-     * @ORM\Column(type="string", length=50, nullable=false)
+     * @ORM\Column(type="string", length=50)
      */
     private $snmp_comunity;
 
     /**
-     * @ORM\Column(type="integer", nullable=false)
+     * @ORM\Column(type="integer")
      */
     private $snmp_version;
 
@@ -83,11 +87,13 @@ class NAS implements TenancyIdTraitInterface
 
     /**
      * @param int $id
+     *
      * @return mixed Retorna el objeto.
      */
     public function setId($id)
     {
         $this->id = $id;
+
         return $this;
     }
 
@@ -101,11 +107,13 @@ class NAS implements TenancyIdTraitInterface
 
     /**
      * @param mixed $description
+     *
      * @return mixed Retorna el objeto.
      */
     public function setDescription($description)
     {
         $this->description = $description;
+
         return $this;
     }
 
@@ -119,11 +127,13 @@ class NAS implements TenancyIdTraitInterface
 
     /**
      * @param mixed $host
+     *
      * @return mixed Retorna el objeto.
      */
     public function setHost($host)
     {
         $this->host = $host;
+
         return $this;
     }
 
@@ -137,11 +147,13 @@ class NAS implements TenancyIdTraitInterface
 
     /**
      * @param mixed $snmp_comunity
+     *
      * @return mixed Retorna el objeto.
      */
     public function setSnmpComunity($snmp_comunity)
     {
         $this->snmp_comunity = $snmp_comunity;
+
         return $this;
     }
 
@@ -155,11 +167,13 @@ class NAS implements TenancyIdTraitInterface
 
     /**
      * @param mixed $snmp_version
+     *
      * @return mixed Retorna el objeto.
      */
     public function setSnmpVersion($snmp_version)
     {
         $this->snmp_version = $snmp_version;
+
         return $this;
     }
 
@@ -173,11 +187,13 @@ class NAS implements TenancyIdTraitInterface
 
     /**
      * @param mixed $radius_password
+     *
      * @return mixed Retorna el objeto.
      */
     public function setRadiusPassword($radius_password)
     {
         $this->radius_password = $radius_password;
+
         return $this;
     }
 
@@ -191,11 +207,13 @@ class NAS implements TenancyIdTraitInterface
 
     /**
      * @param mixed $model
+     *
      * @return mixed Retorna el objeto.
      */
     public function setModel($model)
     {
         $this->model = $model;
+
         return $this;
     }
 
@@ -209,12 +227,14 @@ class NAS implements TenancyIdTraitInterface
 
     /**
      * @param bool $acct_enabled
+     *
      * @return mixed Retorna el objeto.
      */
     public function setAcctEnabled($acct_enabled)
     {
         $this->acct_enabled = $acct_enabled;
+
         return $this;
     }
 
-}
+}

+ 5 - 19
src/RadiusBundle/Entity/NASModel.php

@@ -57,11 +57,13 @@ class NASModel implements TenancyIdTraitInterface
 
     /**
      * @param int $id
+     *
      * @return mixed Retorna el objeto.
      */
     public function setId($id)
     {
         $this->id = $id;
+
         return $this;
     }
 
@@ -75,30 +77,14 @@ class NASModel implements TenancyIdTraitInterface
 
     /**
      * @param string $name
+     *
      * @return mixed Retorna el objeto.
      */
     public function setName($name)
     {
         $this->name = $name;
+
         return $this;
     }
 
-//    /**
-//     * @return mixed
-//     */
-//    public function getNass()
-//    {
-//        return $this->nass;
-//    }
-//
-//    /**
-//     * @param mixed $nass
-//     * @return mixed Retorna el objeto.
-//     */
-//    public function setNass($nass)
-//    {
-//        $this->nass = $nass;
-//        return $this;
-//    }
-
-}
+}