Example #1
0
 public function pretty()
 {
     $this->assertAdmin();
     $this->setTitle("Latest Completed Jobs");
     $sql = "SELECT id, webcam_image_id FROM jobs WHERE webcam_image_id != 0 AND status = 'complete' ORDER BY finished_time DESC";
     $available = new Collection($sql);
     $available->bindType('id', 'Job');
     $available->bindType('webcam_image_id', 'StorageInterface');
     $this->set('jobs', $available->getRange(0, 24));
 }
Example #2
0
 public function live()
 {
     $this->assertAdmin();
     $this->setTitle("Live Bots View");
     $sql = "SELECT id, queue_id, job_id FROM bots WHERE webcam_image_id != 0 AND last_seen > NOW() - 3600 ORDER BY last_seen DESC";
     $bots = new Collection($sql);
     $bots->bindType('id', 'Bot');
     $bots->bindType('queue_id', 'Queue');
     $bots->bindType('job_id', 'Job');
     $this->set('bots', $bots->getRange(0, 24));
     $this->set('dashboard_style', 'medium_thumbnails');
 }