/**
  * @return \Illuminate\Contracts\View\View
  */
 public function index()
 {
     $jobs = $this->jobRepo->latest(10);
     $issues = $this->jobRepo->latest(25, [['status', '=', 'error']], 'id', 'desc');
     $logs = $this->logRepo->latest(25, [], 'id', 'desc');
     return \View::make('connector::dashboard.index', ['jobs' => $jobs, 'issues' => $issues, 'logs' => $logs]);
 }
Example #2
0
 /**
  * @param $id
  * @return \Illuminate\Contracts\View\View
  */
 public function show($id)
 {
     $job = $this->jobRepo->findById($id);
     $referenced = $this->jobRepo->latest(10, [['reference', '=', $job->reference], ['id', '!=', $job->id], ['reference', 'NOT NULL'], ['reference', '!=', '']]);
     $logs = $this->logRepo->filter([['job_id', $job->id]], 'id');
     return \View::make('connector::job.show', ['job' => $job, 'presenter' => new JobPresenter($job), 'referenced' => $referenced, 'logs' => $logs]);
 }
Example #3
0
 /**
  * @param $jobId
  * @param $stageId
  * @return \Illuminate\Contracts\View\View
  */
 public function show($jobId, $stageId)
 {
     $stage = $this->stageRepo->findById($stageId);
     $previous = $this->stageRepo->getPrecedingStage($stage);
     if ($previous === null) {
         $previous = $this->jobRepo->findById($stage->job_id);
     }
     $logs = $this->logRepo->filter([['job_id', $stage->job_id], ['stage', $stage->stage]], 'id');
     return \View::make('connector::stage.show', ['stage' => new StagePresenter($stage), 'previous' => $previous, 'logs' => $logs]);
 }
Example #4
0
 /**
  * @param $id
  * @return \View
  */
 public function show($id)
 {
     try {
         $log = $this->logRepo->findById($id);
         $last = null;
     } catch (ModelNotFoundException $e) {
         $log = null;
         $last = (int) $id - 1;
     }
     return \View::make('connector::log.show', ['log' => $log, 'last' => $last]);
 }
Example #5
0
 public function fire()
 {
     $days = $this->argument('days');
     try {
         if (!is_numeric($days)) {
             throw new \Exception("days must be numeric");
         }
         $this->jobRepo->clean($days);
         $this->logRepo->clean($days);
     } catch (\Exception $e) {
         $this->out('Error cleaning database: ' . $e->getMessage());
     }
 }