/** * Display the configuration snapshot of a host * with template inheritance * * @method get * @route /host/snapshotslide/[i:id] */ public function snapshotslideAction() { $params = $this->getParams(); $data = HostRepository::getInheritanceValues($params['id'], true); $host = Host::get($params['id'], 'host_name'); $data['host_name'] = $host['host_name']; $data['icon'] = HostRepository::getIconImage($data['host_name']); $hostConfiguration = HostRepository::formatDataForSlider($data); $aDataRealTime = HostRealtime::get($params['id']); $hostReal = HostRepository::formatDataForSlider($aDataRealTime); $servicesStatus = ServiceRealTimeRepository::countAllStatusForHost($params['id']); $edit_url = $this->router->getPathFor("/centreon-configuration/host/" . $params['id']); $this->router->response()->json(array('hostConfig' => $hostConfiguration, 'hostReal' => $hostReal, 'servicesStatus' => $servicesStatus, 'edit_url' => $edit_url, 'success' => true)); }
/** * Display the realtime snapshot of a host * * @method get * @route /host/snapshotslide/[i:id] */ public function snapshotslideAction() { $params = $this->getParams(); $data['configurationData'] = HostConfRepository::getInheritanceValues($params['id'], true); $data['configurationData']['host_id'] = $params['id']; $host = HostConf::get($params['id'], 'host_name'); $data['configurationData']['host_name'] = $host['host_name']; $data['realtimeData'] = HostRealtime::get($params['id']); $hostInformations = HostRepository::formatDataForSlider($data); $servicesStatus = ServiceRepository::countAllStatusForHost($params['id']); $view_url = $this->router->getPathFor("/centreon-realtime/host/" . $params['id']); $this->router->response()->json(array('hostInformations' => $hostInformations, 'servicesStatus' => $servicesStatus, 'view_url' => $view_url, 'success' => true)); }