summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEudyptula <eitan@mosenkis.net>2009-07-24 11:09:15 -0400
committerEudyptula <eitan@mosenkis.net>2009-07-24 11:09:15 -0400
commitb006cfcdd1245105f9e22b104ca8527229b17ae4 (patch)
tree9e6f43bdb614bdd079c6da58392bd95633279cdd
parentClean up backend API (diff)
downloadingenue-b006cfcdd1245105f9e22b104ca8527229b17ae4.tar.gz
ingenue-b006cfcdd1245105f9e22b104ca8527229b17ae4.tar.bz2
ingenue-b006cfcdd1245105f9e22b104ca8527229b17ae4.zip
Broke log viewer into segments, added build deletion
-rw-r--r--frontend/pages/builds/delete.php20
-rw-r--r--frontend/pages/builds/index.php18
-rw-r--r--frontend/pages/builds/log.php29
-rw-r--r--frontend/pages/builds/task.php56
-rw-r--r--frontend/pages/logview.php87
-rw-r--r--frontend/routing.csv18
-rw-r--r--shared/classes/0sql_row_obj.php16
-rw-r--r--shared/classes/build.php37
-rw-r--r--shared/classes/buildlog_entry.php3
-rw-r--r--shared/classes/gentoo_baseinit.php9
-rw-r--r--shared/classes/gentoo_basepkg.php6
-rw-r--r--shared/classes/gentoo_profile.php3
-rw-r--r--shared/classes/task.php2
-rw-r--r--tidy1
-rw-r--r--todo4
15 files changed, 183 insertions, 126 deletions
diff --git a/frontend/pages/builds/delete.php b/frontend/pages/builds/delete.php
new file mode 100644
index 0000000..cf6c6d4
--- /dev/null
+++ b/frontend/pages/builds/delete.php
@@ -0,0 +1,20 @@
+<?php
+function init_builds_delete() {
+ global $S, $request;
+ if (!isset($S['user'])) return 'login';
+ if (!(isset($request['build']) && strlen($request['build']) == 6 && ctype_alnum($request['build']))) return '404';
+ $r=$S['pdo']->query('SELECT * FROM `builds` WHERE `id`="'.$request['build'].'"');
+ if ($r->rowCount() == 0) return '404';
+ $S['build']=new sql_build($r->fetch(PDO::FETCH_ASSOC));
+ if (!owner_or_admin($S['build']->id)) return '404';
+ return array('title' => 'Delete Build');
+}
+function body_builds_delete() {
+ global $S;
+ if ($S['build']->status >= 0 || $S['build']->status == -128) {
+ $S['build']->delete();
+ echo print_success('Build deleted.');
+ } else
+ echo print_error('Cannot delete build while it is being built.');
+}
+?>
diff --git a/frontend/pages/builds/index.php b/frontend/pages/builds/index.php
new file mode 100644
index 0000000..4b6b7c8
--- /dev/null
+++ b/frontend/pages/builds/index.php
@@ -0,0 +1,18 @@
+<?php
+function init_builds_index() {
+ global $S;
+ if (!isset($S['user'])) return 'login';
+ return array('title' => 'My Builds');
+}
+function body_builds_index() {
+ global $S;
+ $r=$S['pdo']->query('SELECT * FROM `builds` WHERE `owner`='.$S['user']->id.' 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 $build->display();
+ }
+}
+?>
diff --git a/frontend/pages/builds/log.php b/frontend/pages/builds/log.php
new file mode 100644
index 0000000..ee652f3
--- /dev/null
+++ b/frontend/pages/builds/log.php
@@ -0,0 +1,29 @@
+<?php
+function init_builds_log() {
+ global $S, $request;
+ $S['title']='Log Viewer';
+ if (!isset($S['user'])) return 'login';
+ if (!(isset($request['build']) && strlen($request['build']) == 6 && ctype_alnum($request['build']))) return '404';
+ $r=$S['pdo']->query('SELECT * FROM `builds` WHERE `id`="'.$request['build'].'"');
+ if ($r->rowCount()) {
+ $S['builds_log']=new sql_build($r->fetch(PDO::FETCH_ASSOC));
+ if (!owner_or_admin($S['builds_log']->owner)) return '404'; // TODO permission denied
+ } else
+ return '404';
+ if (isset($request['task']) && is_numeric($request['task']))
+ return 'builds/task';
+}
+function body_builds_log() {
+ global $S;
+ $build=&$S['builds_log'];
+ echo $build->display();
+ $r=$S['pdo']->query('SELECT * FROM `tasks` WHERE `build`="'.$build->id.'" ORDER BY `order` ASC');
+ if ($r->rowCount() == 0) {
+ echo '<b>No tasks found.</b>';
+ }
+ while ($task=$r->fetch(PDO::FETCH_ASSOC)) {
+ $task=new sql_task($task);
+ echo $task->display();
+ }
+}
+?>
diff --git a/frontend/pages/builds/task.php b/frontend/pages/builds/task.php
new file mode 100644
index 0000000..8724857
--- /dev/null
+++ b/frontend/pages/builds/task.php
@@ -0,0 +1,56 @@
+<?php
+function init_builds_task() {
+ global $S, $request;
+ if (!isset($S['user'])) return 'login';
+ if (!(isset($S['builds_log']) && isset($request['task']) && is_numeric($request['task']))) return 'builds/log';
+ $r=$S['pdo']->query('SELECT * FROM `tasks` WHERE `build`="'.$S['builds_log']->id.'" AND `order`='.$request['task']);
+ if ($r->rowCount()) {
+ $S['builds_task']=new sql_task($r->fetch(PDO::FETCH_ASSOC));
+ } else
+ return '404';
+}
+function body_builds_task() {
+ global $S, $request, $conf;
+ $task=&$S['builds_task'];
+ echo '<div style="font-size: 130%">'.$task->display().'</div>';
+ echo '<a href="'.url("build/$task->build/log").'">Back</a><br/>';
+ $page=isset($request['page']) && is_numeric($request['page'])?$request['page']:1;
+ $count=$S['pdo']->query('SELECT COUNT(*) FROM `buildlogs` WHERE `build`=\''.$task->build.'\' AND `task`='.$task->order)->fetch(PDO::FETCH_COLUMN);
+ $pager='';
+ if ($count > $conf['logview_max']) {
+ $pager='<form action="'.url("build/$task->build/log/$task->order").'" method="post" onsubmit="window.location.href=\''.url("build/$task->build/log/$task->order").'/\'+this.page.value; return false">Page: ';
+ if ($page > 1) {
+ $pager.='<input type="button" value="&lt;&lt;" onclick="this.form.page.value='.($page-1).'; this.form.onsubmit()" /> '."\n";
+ }
+ $pager.='<select name="page">';
+ for ($i=1; ($i-1)*$conf['logview_max']<$count; $i++) {
+ $pager.="<option value=\"$i\"".($i==$page?'selected="selected"':'').">$i</option>\n";
+ }
+ $pager.='</select> <input type="submit" value="Go" />';
+ if ($page*$conf['logview_max']<$count) {
+ $pager.=' <input type="button" value="&gt;&gt;" onclick="this.form.page.value='.($page+1).'; this.form.onsubmit()" />'."\n";
+ }
+ $pager.='</form>';
+ echo $pager;
+ }
+ $r=$S['pdo']->query('SELECT * FROM `buildlogs` WHERE `build`=\''.$task->build.'\' AND `task`='.$task->order.' ORDER BY `order` ASC LIMIT '.$conf['logview_max'].' OFFSET '.($page-1)*$conf['logview_max']);
+ if ($r->rowCount()) {
+ echo '<div style="font-family: monospace">';
+ $ansi=new ansi_to_html();
+ while ($entry=$r->fetch(PDO::FETCH_ASSOC)) {
+ $entry=new sql_buildlog_entry($entry);
+ echo '<'.($t=($entry->stream=='stderr'?'b':'span')).' title="'.strtoupper($entry->stream).', entry #'.$entry->order.' '.date('D j M Y @ H:i:s T', $entry->timestamp).'">'.$ansi->process($entry->text)."</$t>";
+ }
+ echo $ansi->reset(); // Clear any leftover <span>s
+ echo '</div>';
+ echo $pager;
+ echo '<a href="'.url("build/$task->build/log").'">Back</a><br/>';
+ } else {
+ if ($count) {
+ echo print_error("There aren't $page pages. Try an <a href=\"".url("build/$task->build/log/$task->order")."\">earlier page</a>.");
+ } else {
+ echo print_warning('No output');
+ }
+ }
+}
+?>
diff --git a/frontend/pages/logview.php b/frontend/pages/logview.php
deleted file mode 100644
index ac41c5d..0000000
--- a/frontend/pages/logview.php
+++ /dev/null
@@ -1,87 +0,0 @@
-<?php
-function init_logview() {
- global $S, $request;
- $S['title']='Log Viewer';
- if (!isset($S['user'])) return 'login';
- if (isset($request['build']) && strlen($request['build']) == 6 && ctype_alnum($request['build'])) {
- $r=$S['pdo']->query('SELECT * FROM `builds` WHERE `id`="'.$request['build'].'"');
- if ($r->rowCount()) {
- $S['logview']['build']=new sql_build($r->fetch(PDO::FETCH_ASSOC));
- if (!owner_or_admin($S['logview']['build']->owner)) return '404'; // TODO permission denied
- } else
- return '404';
- if (isset($request['task']) && is_numeric($request['task'])) {
- $r=$S['pdo']->query('SELECT * FROM `tasks` WHERE `build`="'.$request['build'].'" AND `order`='.$request['task']);
- if ($r->rowCount()) {
- $S['logview']['task']=new sql_task($r->fetch(PDO::FETCH_ASSOC));
- } // else return '404'; // Just goes to the build if task is missing
- }
- }
-}
-function body_logview() {
- global $S, $request, $conf;
- if (isset($S['logview']['task'])) {
- $task=&$S['logview']['task'];
- echo '<div style="font-size: 130%">'.$task->display().'</div>';
- echo '<a href="'.url('logs/'.$task->build).'">Back</a><br/>';
- $page=isset($request['page']) && is_numeric($request['page'])?$request['page']:1;
- $count=$S['pdo']->query('SELECT COUNT(*) FROM `buildlogs` WHERE `build`=\''.$task->build.'\' AND `task`='.$task->order)->fetch(PDO::FETCH_COLUMN);
- $pager='';
- if ($count > $conf['logview_max']) {
- $pager='<form action="'.url('logs/'.$task->build.'/'.$task->order).'" method="post" onsubmit="window.location.href=\''.url('logs/'.$task->build.'/'.$task->order).'/\'+this.page.value; return false">Page: ';
- if ($page > 1) {
- $pager.='<input type="button" value="&lt;&lt;" onclick="this.form.page.value='.($page-1).'; this.form.onsubmit()" /> '."\n";
- }
- $pager.='<select name="page">';
- for ($i=1; ($i-1)*$conf['logview_max']<$count; $i++) {
- $pager.="<option value=\"$i\"".($i==$page?'selected="selected"':'').">$i</option>\n";
- }
- $pager.='</select> <input type="submit" value="Go" />';
- if ($page*$conf['logview_max']<$count) {
- $pager.=' <input type="button" value="&gt;&gt;" onclick="this.form.page.value='.($page+1).'; this.form.onsubmit()" />'."\n";
- }
- $pager.='</form>';
- echo $pager;
- }
- $r=$S['pdo']->query('SELECT * FROM `buildlogs` WHERE `build`=\''.$task->build.'\' AND `task`='.$task->order.' ORDER BY `order` ASC LIMIT '.$conf['logview_max'].' OFFSET '.($page-1)*$conf['logview_max']);
- if ($r->rowCount()) {
- echo '<div style="font-family: monospace">';
- $ansi=new ansi_to_html();
- while ($entry=$r->fetch(PDO::FETCH_ASSOC)) {
- $entry=new sql_buildlog_entry($entry);
- echo '<'.($t=($entry->stream=='stderr'?'b':'span')).' title="'.strtoupper($entry->stream).', entry #'.$entry->order.' '.date('D j M Y @ H:i:s T', $entry->timestamp).'">'.$ansi->process($entry->text)."</$t>";
- }
- echo $ansi->reset(); // Clear any leftover <span>s
- echo '</div>';
- echo $pager;
- echo '<a href="'.url('logs/'.$task->build).'">Back</a><br/>';
- } else {
- if ($count) {
- echo print_error("There aren't $page pages. Try an <a href=\"".url('logs/'.$task->build.'/'.$task->order)."\">earlier page</a>.");
- } else {
- echo print_warning('No output');
- }
- }
- } elseif (isset($S['logview']['build'])) {
- $build=&$S['logview']['build'];
- echo $build->display();
- $r=$S['pdo']->query('SELECT * FROM `tasks` WHERE `build`="'.$request['build'].'" ORDER BY `order` ASC');
- if ($r->rowCount() == 0) {
- echo '<b>No tasks found.</b>';
- }
- while ($task=$r->fetch(PDO::FETCH_ASSOC)) {
- $task=new sql_task($task);
- echo $task->display();
- }
- } else {
- $r=$S['pdo']->query('SELECT * FROM `builds` WHERE `owner`='.$S['user']->id.' 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 $build->display();
- }
- }
-}
-?>
diff --git a/frontend/routing.csv b/frontend/routing.csv
index 3a93c19..a0bf3c2 100644
--- a/frontend/routing.csv
+++ b/frontend/routing.csv
@@ -11,21 +11,21 @@
# Home
^$ welcome
-# Logs
-^builds$ logview
-^logs/([a-z0-9]{6})$ logview build
-^logs/([a-z0-9]{6})/([0-9]+)$ logview build task
-^logs/([a-z0-9]{6})/([0-9]+)/([0-9]+)$ logview build task page
-#^logs/([a-z0-9]{6})/live$ livelog build
+# Builds
+^builds$ builds/index
+^build/([a-z0-9]{6})/log$ builds/log build
+^build/([a-z0-9]{6})/log/([0-9]+)$ builds/task build task
+^build/([a-z0-9]{6})/log/([0-9]+)/([0-9]+)$ builds/task build task page
+^build/([a-zA-Z0-9]{6})/download$ builds/download build
+^build/([a-zA-Z0-9]{6})/history$ builds/history build
+^build/([a-zA-Z0-9]{6})/delete$ builds/delete build
+#^build/([a-z0-9]{6})/live$ builds/live build
# Configurations
^create$ configurations/wizard
^config/([a-zA-Z0-9]{6})$ configurations/wizard configuration
^config/([a-zA-Z0-9]{6})/([0-9]+)$ configurations/wizard configuration step
^config/([a-zA-Z0-9]{6})/status$ configurations/status configuration
^configurations$ configurations/manager
-# Download finished image
-^download/([a-zA-Z0-9]{6})$ builds/download build
-^download/([a-zA-Z0-9]{6})/history$ builds/history build
# Session
^login$ login
^login/(.+)$ login go
diff --git a/shared/classes/0sql_row_obj.php b/shared/classes/0sql_row_obj.php
index 89a7382..239dae3 100644
--- a/shared/classes/0sql_row_obj.php
+++ b/shared/classes/0sql_row_obj.php
@@ -199,7 +199,7 @@ abstract class sql_row_obj { // If the name of this class changes, it must be up
if ($r->rowCount() == 0) {
throw new Exception(get_class($this).' object constructed with single argument ('.$arg.') but found no rows with this in the `'.$this->primary_key[0].'` column (PRIMARY_KEY).');
} else {
- $this->from_array($r->fetch(), true);
+ $this->from_array($r->fetch(PDO::FETCH_ASSOC), true);
return;
}
}
@@ -210,7 +210,7 @@ abstract class sql_row_obj { // If the name of this class changes, it must be up
if ($r->rowCount() == 0) {
throw new Exception(get_class($this).' object constructed with single numeric argument ('.$arg.') but found no rows with this in the `'.$this->num_key.'` column (UNIQUE numeric).');
} else {
- $this->from_array($r->fetch(), true);
+ $this->from_array($r->fetch(PDO::FETCH_ASSOC), true);
return;
}
} elseif (isset($this->misc_key)) {
@@ -219,7 +219,7 @@ abstract class sql_row_obj { // If the name of this class changes, it must be up
if ($r->rowCount() == 0) {
throw new Exception(get_class($this).' object constructed with single value ('.$arg.') but found no rows with this in the `'.$this->misc_key.'` column (UNIQUE non-numeric).');
} else {
- $this->from_array($r->fetch(), true);
+ $this->from_array($r->fetch(PDO::FETCH_ASSOC), true);
return;
}
}
@@ -238,7 +238,7 @@ abstract class sql_row_obj { // If the name of this class changes, it must be up
} else
throw new Exception(get_class($this).' object constructed with '.func_num_args().' values '.$this->sql_id().' but no rows were found (PRIMARY KEY).');
} else {
- $this->from_array($r->fetch(), true);
+ $this->from_array($r->fetch(PDO::FETCH_ASSOC), true);
return;
}
}
@@ -315,7 +315,7 @@ abstract class sql_row_obj { // If the name of this class changes, it must be up
function load() {
if ($this->is_in_db()) {
$r=self::sql_query('SELECT * FROM `'.$this->table.'` WHERE '.$this->sql_id());
- $this->from_array($r->fetch(), true);
+ $this->from_array($r->fetch(PDO::FETCH_ASSOC), true);
}
}
// Deletes this row from the database and clears db_values array
@@ -495,7 +495,7 @@ abstract class sql_row_obj { // If the name of this class changes, it must be up
if ($r->rowCount() == 0) {
return null;
} elseif ($r->rowCount() == 1) {
- $obj->from_array($r->fetch());
+ $obj->from_array($r->fetch(PDO::FETCH_ASSOC));
self::$ref_cache[get_class($this)][$name][$this->__get($name)]=&$obj;
return $obj;
} else {
@@ -630,7 +630,7 @@ class sql_col {
$this->default=$string;
break;
case 'COMMENT':
- if (preg_match('/^refers to: ([a-zA-Z0-9_$]+\.[a-zA-Z0-9_$]+)$/', $string, $match)) {
+ if (preg_match('/^refers to(?::| |: )([a-zA-Z0-9_$]+\.[a-zA-Z0-9_$]+)$/', $string, $match)) {
$this->refers_to=$match[1];
} else {
$this->comment=$string;
@@ -750,7 +750,7 @@ class sql_col {
if (isset($this->comment))
$d.=' COMMENT '.sql_row_obj::sql_quote_string($this->comment);
elseif (isset($this->refers_to))
- $d.=' COMMENT '.sql_row_obj::sql_quote_string('refers to: '.$this->refers_to);
+ $d.=' COMMENT '.sql_row_obj::sql_quote_string('refers to '.$this->refers_to);
return $d;
}
// Returns the array necessary to generate this column using the constructor
diff --git a/shared/classes/build.php b/shared/classes/build.php
index d14deb0..5427633 100644
--- a/shared/classes/build.php
+++ b/shared/classes/build.php
@@ -28,7 +28,8 @@ class sql_build extends conf_build_common {
'status' => array (
'type' => 'TINYINT',
'length' => 4,
- 'not_null' => true
+ 'not_null' => true,
+ 'default' => 0
),
'ctime' => array (
'type' => 'INT',
@@ -47,7 +48,7 @@ class sql_build extends conf_build_common {
)
);
// Returns HTML code describing this build's status (for human consumption)
- function display() {
+ public function display() {
global $S;
$format='D j M Y G:i:s T';
$OoA=owner_or_admin($this->id);
@@ -59,33 +60,35 @@ class sql_build extends conf_build_common {
$html.="<span class=\"status queued\">[Queued ($num/$total)]</span>";
} elseif ($this->status == -127) {
$html.='<span class="status successful">[uploading]</span>';
- if ($OoA) $links['Build log']=url("logs/$this->id");
+ if ($OoA) $links['Build log']=url("build/$this->id/log");
} elseif ($this->status < 0) {
// TODO Build stage X
$html.='<span class="status building">[building]</span>';
if ($OoA) {
- //$links['Watch']=url("logs/$this->id/live");
- $links['Build Log']=url("logs/$this->id");
+ //$links['Watch']=url("build/$this->id/live");
+ $links['Build Log']=url("build/$this->id/log");
}
} elseif ($this->status == 0) {
$r=$S['pdo']->query('SELECT COUNT(*) as `count`, MAX(`time`) as `time` FROM `downloads` WHERE `build`="'.$this->id.'"')->fetch(PDO::FETCH_ASSOC);
- $d=($OoA && $r['count']?'<a href="'.url("download/$this->id/history").'">':'').$r['count'].' download'.($r['count'] != 1?'s':'').($r['count']?($OoA?'</a>':'').'<br/><span class="time">(last at '.date($format, $r['time']).')</span>':'');
+ $d=($OoA && $r['count']?'<a href="'.url("build/$this->id/history").'">':'').$r['count'].' download'.($r['count'] != 1?'s':'').($r['count']?($OoA?'</a>':'').'<br/><span class="time">(last at '.date($format, $r['time']).')</span>':'');
$html.='<span class="downloads">'.$d.'</span><span class="status successful">[successful]</span>';
- $links['Download image']=url("download/$this->id");
- if ($OoA) $links['Build log']=url("logs/$this->id");
+ $links['Download image']=url("build/$this->id/download");
+ if ($OoA) $links['Build log']=url("build/$this->id/log");
} elseif ($this->status == 127) {
$html.='<span class="status failed">[upload failed]</span>';
- if ($OoA) $links['Build log']=url("logs/$this->id");
+ if ($OoA) $links['Build log']=url("build/$this->id/log");
} elseif ($this->status == 126) {
$html.='<span class="status failed">[failed]</span>';
if ($OoA) {
//$links['View output of failed command']=url("logs/$this->id/failure");
- $links['Build log']=url("logs/$this->id");
+ $links['Build log']=url("build/$this->id/log");
}
} else {
$html.='<span class="status failed">[failed: got signal '.$this->status.']</span>';
- if ($OoA) $links['Build log']=url('logs/'.$this->id);
+ if ($OoA) $links['Build log']=url("build/$this->id/log");
}
+ if ($this->status >= 0 || $this->status == -128) // Finished or queued
+ $links['Delete']=url("build/$this->id/delete");
if ($links) {
foreach ($links as $label => $url) {
$links[$label]='<a href="'.$url.'">'.htmlentities($label).'</a>';
@@ -109,12 +112,22 @@ class sql_build extends conf_build_common {
$html.='</div>';
return $html;
}
- function queued_tasks() {
+ public function queued_tasks() {
global $S;
static $cache;
if (!isset($cache))
$cache=$S['pdo']->query('SELECT COUNT(`order`) FROM `tasks` WHERE `start` IS NULL AND `build`="'.$this->id.'"')->fetch(PDO::FETCH_COLUMN);
return $cache;
}
+ public function delete() {
+ global $S;
+ $S['pdo']->query('DELETE FROM `buildlogs` WHERE `build`="'.$this->id.'"');
+ $S['pdo']->query('DELETE FROM `tasks` WHERE `build`="'.$this->id.'"');
+ $S['pdo']->query('DELETE FROM `buildopts` WHERE `build`="'.$this->id.'"');
+ $S['pdo']->query('DELETE FROM `downloads` WHERE `build`="'.$this->id.'"');
+ foreach (glob(COMPLETED."/build-.$this->id.*") as $file)
+ unlink($file);
+ parent::delete();
+ }
}
?>
diff --git a/shared/classes/buildlog_entry.php b/shared/classes/buildlog_entry.php
index 5b8c380..69e9022 100644
--- a/shared/classes/buildlog_entry.php
+++ b/shared/classes/buildlog_entry.php
@@ -5,7 +5,8 @@ class sql_buildlog_entry extends sql_row_obj {
'type' => 'CHAR',
'length' => 6,
'not_null' => true,
- 'default' => ''
+ 'default' => '',
+ 'refers_to' => 'builds.id'
),
'task' => array (
'type' => 'TINYINT',
diff --git a/shared/classes/gentoo_baseinit.php b/shared/classes/gentoo_baseinit.php
index d685635..01b5dc5 100644
--- a/shared/classes/gentoo_baseinit.php
+++ b/shared/classes/gentoo_baseinit.php
@@ -5,17 +5,20 @@ class sql_gentoo_baseinit extends sql_row_obj {
'type' => 'TINYINT',
'length' => 3,
'unsigned' => true,
- 'not_null' => true
+ 'not_null' => true,
+ 'default' => 0
),
'name' => array (
'type' => 'VARCHAR',
'length' => 255,
- 'not_null' => true
+ 'not_null' => true,
+ 'default' => ''
),
'runlevel' => array (
'type' => 'VARCHAR',
'length' => 255,
- 'not_null' => true
+ 'not_null' => true,
+ 'default' => ''
)
);
diff --git a/shared/classes/gentoo_basepkg.php b/shared/classes/gentoo_basepkg.php
index 824d495..d61b3dc 100644
--- a/shared/classes/gentoo_basepkg.php
+++ b/shared/classes/gentoo_basepkg.php
@@ -6,12 +6,14 @@ class sql_gentoo_basepkg extends sql_row_obj {
'length' => 3,
'unsigned' => true,
'not_null' => true,
- 'comment' => 'refers to:gentoo_profiles.id'
+ 'default' => 0,
+ 'refers_to' => 'gentoo_profiles.id'
),
'pkg' => array (
'type' => 'VARCHAR',
'length' => 255,
- 'not_null' => true
+ 'not_null' => true,
+ 'default' => ''
)
);
diff --git a/shared/classes/gentoo_profile.php b/shared/classes/gentoo_profile.php
index ad7a12f..b29bf05 100644
--- a/shared/classes/gentoo_profile.php
+++ b/shared/classes/gentoo_profile.php
@@ -18,7 +18,8 @@ class sql_gentoo_profile extends sql_row_obj {
'stage3' => array (
'type' => 'VARCHAR',
'length' => 255,
- 'not_null' => true
+ 'not_null' => true,
+ 'default' => ''
),
'name' => array (
'type' => 'VARCHAR',
diff --git a/shared/classes/task.php b/shared/classes/task.php
index 571c895..d0bda3d 100644
--- a/shared/classes/task.php
+++ b/shared/classes/task.php
@@ -45,7 +45,7 @@ class sql_task extends sql_row_obj {
);
function display() {
- $html='<div class="task"><div class="description">'.htmlentities($this->description).'</div><div class="info">[<a href="'.url('logs/'.$this->build.'/'.$this->order).'">log</a>] '.($this->command?'<span class="command">'.htmlentities($this->command).'</span> ':'');
+ $html='<div class="task"><div class="description">'.htmlentities($this->description).'</div><div class="info">[<a href="'.url("build/$this->build/log/$this->order").'">log</a>] '.($this->command?'<span class="command">'.htmlentities($this->command).'</span> ':'');
if (isset($this->start)) {
if (isset($this->finish)) {
$html.='<span class="status ';
diff --git a/tidy b/tidy
index ffb464c..17499ab 100644
--- a/tidy
+++ b/tidy
@@ -1,4 +1,5 @@
builds
+ tasks
buildopts
buildlogs
downloads
diff --git a/todo b/todo
index a01c4e9..3228a59 100644
--- a/todo
+++ b/todo
@@ -7,11 +7,11 @@ Add cleanup functions to the frontend and backend (tasks dir in backend containi
Separate variables we got from the URL from the rest, stop using $request, instead keep super globals and strip slashes on them
Add masked indicator back to package selector, support ~arch installation
Allow backend to define bail-out functions to call when it dies (things like unmounting the ISO it was copying)
-Add STDERR (maybe STDOUT) only option to log viewer
+Add STDERR (maybe STDOUT) only option to builds/task
Move bundler selection out of gentoo module and generalize it
Allow config viewing for builds, not just configurations
Add `flags` column to configurations, builds, use it to implement public and private things
-Add 'cancel', 'delete' options to builds
+Add 'cancel', option to builds, allow deletion of currently running builds
Add build->configuration and configuration duplication
Add map file for liveCD, load it into DB, etc.
Write script for fetching latest stage3's from the desired FTP dirs