summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'frontend/pages/logview.php')
-rw-r--r--frontend/pages/logview.php35
1 files changed, 18 insertions, 17 deletions
diff --git a/frontend/pages/logview.php b/frontend/pages/logview.php
index 90a1fc9..2884c48 100644
--- a/frontend/pages/logview.php
+++ b/frontend/pages/logview.php
@@ -13,7 +13,9 @@ function body_logview() {
return;
}
$task=new sql_task($r->fetch(PDO::FETCH_ASSOC));
- echo '<h3>Task '.$task->id.': '.$task->command.' ';
+ echo '<div style="font-size: 130%">'.$task->display().'</div>';
+ echo '<a href="'.url('logs/build'.$task->build).'">Back</a><br/>';
+/* echo '<h3>Task '.$task->id.': '.$task->command.' ';
if (isset($task->exit)) {
if ($task->exit == 0) {
echo '<span style="color: green">[completed]</span>';
@@ -23,7 +25,7 @@ function body_logview() {
} else {
echo '<span style="color: yellow">[running]</span>';
}
- echo '</h3>';
+ echo '</h3>';*/
$page=isset($request['page']) && is_numeric($request['page'])?$request['page']:1;
$count=$S['pdo']->query('SELECT COUNT(*) FROM `buildlogs` WHERE `task`='.$task->id)->fetch(PDO::FETCH_COLUMN);
$pager='';
@@ -54,6 +56,7 @@ function body_logview() {
}
echo '</div>';
echo $pager;
+ echo '<a href="'.url('logs/build'.$task->build).'">Back</a><br/>';
} else {
if ($count) {
echo print_error("There aren't $page pages. Try an <a href=\"".url('logs/task'.$task->id)."\">earlier page</a>.");
@@ -62,7 +65,8 @@ function body_logview() {
}
}
} elseif (isset($request['build']) && preg_match('/[a-z0-9]{6}/', $request['build'])) {
- echo '<h3>Build '.$request['build'].'</h3>';
+ $build=new sql_build($request['build']);
+ echo $build->display();
$r=$S['pdo']->query('SELECT * FROM `tasks` WHERE `build`="'.$request['build'].'" ORDER BY `id` ASC');
if ($r->rowCount() == 0) {
echo '<b>No tasks found.</b>';
@@ -70,23 +74,27 @@ function body_logview() {
$i=0;
while ($task=$r->fetch(PDO::FETCH_ASSOC)) {
$task=new sql_task($task);
- echo '<a href="'.url('logs/task'.$task->id).'">Task #'.++$i.'</a>: '.htmlentities($task->command).'<br/>';
+ echo $task->display();
+// echo '<a href="'.url('logs/task'.$task->id).'">Task #'.++$i.'</a>: '.htmlentities($task->command).'<br/>';
}
} else {
- $r=$S['pdo']->query('SELECT * FROM `builds` ORDER BY `ctime` ASC');
+ $r=$S['pdo']->query('SELECT * FROM `builds` ORDER BY `ctime` IS NULL ASC, `ctime` ASC, `status` DESC');
if ($r->rowCount() == 0) {
echo print_warning('No builds found.');
}
while ($build=$r->fetch(PDO::FETCH_ASSOC)) {
$build=new sql_build($build);
- echo '<a href="'.url('logs/build'.$build->id).'">Build '.$build->id.'</a>: ';
- if (isset($build->name)) {
- echo htmlentities($build->name);
- }
- echo '<br/>';
+ echo $build->display();
}
}
}
+function process_ansi($txt) {
+ $txt=str_replace("\x1b[K", '', nl2br($txt));
+ do {
+ $txt=preg_replace('#.\ch#', '', $txt, -1, $count); // ^H = Backspace
+ } while ($count);
+ return preg_replace_callback('#\e\[(?:(?:([0-9]{1,2});)*([0-9]{1,2}))?m#', 'ansi_callback', $txt);
+}
function ansi_callback($match) {
$a=explode(' ', 'bright dim underscore blink reverse hidden');
$c=explode(' ', 'black red green yellow blue magenta cyan white');
@@ -117,11 +125,4 @@ function ansi_callback($match) {
}
return $r;
}
-function process_ansi($txt) {
- $txt=str_replace("\x1b[K", '', nl2br($txt));
- do {
- $txt=preg_replace('#.\ch#', '', $txt, -1, $count); // ^H = Backspace
- } while ($count);
- return preg_replace_callback('#\e\[(?:(?:([0-9]{1,2});)*([0-9]{1,2}))?m#', 'ansi_callback', $txt);
-}
?>