Ejemplo n.º 1
0
 /**
  * The page structure for display
  *
  * @method GET
  * @route /eventlogs
  */
 public function displayAction()
 {
     $di = Di::getDefault();
     $tmpl = $di->get('template');
     $tmpl->addJs('hogan-3.0.0.min.js');
     //$tmpl->addJs('moment-with-langs.min.js');
     $tmpl->addJs('daterangepicker.js');
     $tmpl->addJs('jquery.select2/select2.min.js');
     $tmpl->addJs('centreon.search.js');
     $tmpl->addJs('centreon-infinite-scroll.js');
     $tmpl->addCss('select2.css');
     $tmpl->addCss('select2-bootstrap.css');
     $tmpl->addCss('daterangepicker-bs3.css');
     //$tmpl->addCss('centreon.status.css');
     if (Module::isModuleReachable('centreon-performance')) {
         $tmpl->addJs('d3.min.js');
         $tmpl->addJs('c3.min.js');
         $tmpl->addJs('centreon.graph.js', 'bottom', 'centreon-performance');
         $tmpl->addCss('c3.css');
     }
     /* Prepare field for search */
     $searchField = array('header' => array('columnSearch' => array('host' => array('main' => true, 'title' => _("Host name"), 'type' => 'text', 'searchLabel' => 'host', 'colIndex' => 1), 'service' => array('main' => true, 'title' => _("Service"), 'type' => 'text', 'searchLabel' => 'service', 'colIndex' => 2), 'output' => array('main' => false, 'title' => _("Message"), 'type' => 'text', 'searchLabel' => 'output', 'colIndex' => 3), 'status' => array('main' => false, 'title' => _("Status"), 'type' => 'select', 'searchLabel' => 'status', 'colIndex' => 3, 'additionnalParams' => array('Ok' => 0, 'Warning' => 1, 'Critical' => 2)), 'eventtype' => array('main' => false, 'title' => _("Event Type"), 'type' => 'select', 'searchLabel' => 'eventtype', 'colIndex' => 4, 'additionnalParams' => array('Alert' => 0, 'Current State' => 6, 'Initial State' => 8, 'Notification' => 2, 'Acknowledgement' => 10)))));
     $tmpl->assign('datatableParameters', $searchField);
     $tmpl->display('file:[CentreonRealtimeModule]eventlogs.tpl');
 }
Ejemplo n.º 2
0
 /**
  * 
  * @param array $modules
  */
 private function parseCommand($modules)
 {
     $this->commandList = array();
     // First get the Core one
     $this->getCommandDirectoryContent(realpath(__DIR__ . "/../commands/"));
     // Now lets see the modules
     foreach ($modules as $module) {
         $moduleName = str_replace('Module', '', $module);
         preg_match_all('/[A-Z]?[a-z]+/', $moduleName, $myMatches);
         $moduleShortName = strtolower(implode('-', $myMatches[0]));
         if (Informations::isModuleReachable($moduleShortName)) {
             $this->getCommandDirectoryContent(__DIR__ . "/../../modules/{$module}/commands/", $moduleShortName, $moduleName);
         }
     }
 }