/**
  * Akce pro vytvoření mineru nad konkrétním datovým zdrojem
  * @param int $datasource
  * @throws BadRequestException
  */
 public function renderNewMinerFromDatasource($datasource)
 {
     try {
         $datasource = $this->datasourcesFacade->findDatasourceWithCheckAccess($datasource, $this->getCurrentUser());
     } catch (\Exception $e) {
         throw new BadRequestException('Requested datasource was not found!', 404, $e);
     }
     $this->template->datasource = $datasource;
     $availableMinerTypes = $this->minersFacade->getAvailableMinerTypes($datasource->type);
     if (empty($availableMinerTypes)) {
         //nebyl nalezen žádný odpovídající miner
         $this->flashMessage('No suitable mining service found. Please update the configuration for support of this datasource type!', 'error');
         $this->redirect('default');
     }
     /** @var Form $form */
     $form = $this->getComponent('newMinerForm');
     $dateTime = new \DateTime();
     $form->setDefaults(['datasource' => $datasource->datasourceId, 'datasourceName' => $datasource->type . ': ' . $datasource->name, 'name' => $datasource->name . ' ' . $dateTime->format('Y-m-d H:i:s')]);
     /** @var SelectBox $typeSelect */
     $typeSelect = $form->getComponent('type');
     $typeSelect->setItems($availableMinerTypes);
 }