Exemplo n.º 1
0
 public function view()
 {
     $this->assertLoggedIn();
     $this->set('area', 'queues');
     try {
         //how do we find them?
         if ($this->args('id')) {
             $q = new Queue($this->args('id'));
         } else {
             throw new Exception("Could not find that queue.");
         }
         //did we really get someone?
         if (!$q->isHydrated()) {
             throw new Exception("Could not find that queue.");
         }
         if (!$q->isMine()) {
             throw new Exception("You do not have permission to view this queue.");
         }
         $this->setTitle("View Queue - " . $q->getName());
         $this->set('queue', $q);
         $available = $q->getJobs('available', 'user_sort', 'ASC');
         $this->set('available', $available->getRange(0, 20));
         $this->set('available_count', $available->count());
         $taken = $q->getJobs('taken', 'user_sort', 'DESC');
         $this->set('taken', $taken->getRange(0, 20));
         $this->set('taken_count', $taken->count());
         $complete = $q->getJobs('complete', 'user_sort', 'DESC');
         $this->set('complete', $complete->getRange(0, 20));
         $this->set('complete_count', $complete->count());
         $qa = $q->getJobs('qa', 'finished_time', 'DESC');
         $this->set('qa', $qa->getRange(0, 20));
         $this->set('qa_count', $qa->count());
         $failure = $q->getJobs('failure', 'user_sort', 'DESC');
         $this->set('failure', $failure->getRange(0, 20));
         $this->set('failure_count', $failure->count());
         $this->set('stats', QueueStats::getStats($q));
         $bots = $q->getBots();
         $this->set('bots', $bots->getRange(0, 20));
         $this->set('bot_count', $bots->count());
         $this->set('errors', $q->getErrorLog()->getRange(0, 50));
     } catch (Exception $e) {
         $this->setTitle('View Queue - Error');
         $this->set('megaerror', $e->getMessage());
     }
 }
Exemplo n.º 2
0
			<th colspan="2">Slicing</th>
			<th colspan="2">Working</th>
			<th colspan="2">Completed</th>
			<th colspan="2">Failed</th>
			<th>Total</th>
		</tr>
		</thead>
		<tbody>
		<?php 
    foreach ($queues as $row) {
        ?>
			<?php 
        $q = $row['Queue'];
        ?>
			<?php 
        $stats = QueueStats::getStats($q);
        ?>
			<?php 
        $total['available'] += $stats['available'];
        $total['slicing'] += $stats['slicing'];
        $total['taken'] += $stats['taken'];
        $total['complete'] += $stats['complete'];
        $total['failure'] += $stats['failure'];
        $total['total'] += $stats['total'];
        ?>
			<tr>
				<td><?php 
        echo $q->getLink();
        ?>
</td>
				<td><span