setTemplate('create', 'FTTHBundle:OLT:form.html.twig'); $this->setTemplate('edit', 'FTTHBundle:OLT:form.html.twig'); } /** * @param DatagridMapper $datagridMapper */ protected function configureDatagridFilters(DatagridMapper $datagridMapper) { $datagridMapper ->add('name') ->add('model') ->add('ip') ->add('snmpCommunity') ->add('sshUser') ->add('sshPass') ->add('enablePass') ->add('sshConnect') ->add('sshPort') ->add('backups') ; } /** * @param ListMapper $listMapper */ protected function configureListFields(ListMapper $listMapper) { $listMapper ->add('name') ->add('model') ->add('ip') ->add('snmpCommunity') ->add('sshUser') ->add('sshPass') ->add('enablePass') ->add('sshConnect') ->add('sshPort') ->add('enable') ->add('backups') ->add('currentState','string', array('template' => 'WorkflowBundle:Workflow:base_list_field_current_state.html.twig')) ->add('_action', 'with-workflow-action', array( 'actions' => array( 'show' => array(), 'edit' => array(), 'delete' => array(), 'state' => array('template' => 'WorkflowBundle:Workflow:show_transitions.html.twig') ) )) ; } /** * @param FormMapper $formMapper */ protected function configureFormFields(FormMapper $formMapper) { $formMapper ->tab('default') ->with('') ->add('name') ->add('model', null, [ 'query_builder' => function($qb) { return $qb->createQueryBuilder('o') ->orderBy('o.name', 'ASC') ; }, ]) ->end() ->end() ->tab('configuration') ->with('OLT') ->add('ip') ->add('snmpCommunity') ->add('sshUser') ->add('sshPass') ->add('enablePass') ->add('sshConnect', null, [ 'help' => 'form.help_ssh_connect', ]) ->add('sshPort') ->end() ->end() ->tab('autodiscovery') ->with('olt_discovery_configuration') ->add('timeDiscovery', 'integer', array('attr' => array('min' => 0), 'help' => 'Set 0 to disable autodiscovery or set a x number to scan each x minutes the ONUs connected but without configuration')) ->add('clientId') ->add('discoveryProfile', null, array('help' => 'Profile to set the ONUs by autodiscovery')) ->end() ->end() ->tab('stats') ->with('olt_execute_time') ->add('executeSnmp') ->add('timeScan', 'integer', array('attr' => array('min' => 0))) ->add('timeOnuStats', 'integer', array('attr' => array('min' => 0))) ->add('timePonStats', 'integer', array('attr' => array('min' => 0))) ->add('timeOltOctets', 'integer', array('attr' => array('min' => 0))) ->end() ->end() ->tab('Backups') ->with('Backup OLT') ->add('backups') ->add('files', AnchorType::class, array( 'required' => false, 'data' => $this->getSubject()->obtainFiles($this->getParameter('backups')) )) ->end() ->end() ; } /** * @param ShowMapper $showMapper */ protected function configureShowFields(ShowMapper $showMapper) { $showMapper ->tab('default') ->with('') ->add('name') ->add('model') ->add('ip') ->add('snmpCommunity') ->add('sshUser') ->add('sshPass') ->add('enablePass') ->add('sshConnect') ->add('sshPort') ->add('enable') ->end() ->end() ->tab('Log') ->with('Log') ->add('deviceLog','string', array( 'template' => 'DeviceBundle::show_device_log.html.twig', 'translation_domain' => 'DeviceBundle', )) ->end() ->end() ->tab('Backups') ->with('Backup OLT') ->add('backups') ->add('files', 'string', array( 'template' => 'FTTHBundle::show_backup_log.html.twig', 'translation_domain' => 'FTTHBundle' )) ->end() ->end() ; } }