diff options
author | 2009-07-24 11:56:22 -0400 | |
---|---|---|
committer | 2009-07-24 11:56:22 -0400 | |
commit | 518e41513db9c60ec7cf5fc9b4e10e29c037e6ba (patch) | |
tree | 06fee7516b143ca6b61b5cdb876800f67b68c95c /frontend | |
parent | Require manually-configured URL - backend needs it anyway (diff) | |
download | ingenue-518e41513db9c60ec7cf5fc9b4e10e29c037e6ba.tar.gz ingenue-518e41513db9c60ec7cf5fc9b4e10e29c037e6ba.tar.bz2 ingenue-518e41513db9c60ec7cf5fc9b4e10e29c037e6ba.zip |
Reorganized log URLs; little update to routing.csv format
Diffstat (limited to 'frontend')
-rw-r--r-- | frontend/index.php | 2 | ||||
-rw-r--r-- | frontend/pages/builds/task.php | 8 | ||||
-rw-r--r-- | frontend/pages/configurations/manager.php | 4 | ||||
-rw-r--r-- | frontend/routing.csv | 54 |
4 files changed, 34 insertions, 34 deletions
diff --git a/frontend/index.php b/frontend/index.php index 30ced1c..a103dd9 100644 --- a/frontend/index.php +++ b/frontend/index.php @@ -24,7 +24,7 @@ for ($line=fgets($routing, 32768); !feof($routing); $line=fgets($routing, 32768) $vars=explode("\t", $vars); } unset($line); - if (preg_match('{'.$expr.'}',$S['request'],$matches)) { + if (preg_match('{^'.$expr.'$}',$S['request'],$matches)) { fclose($routing); for ($i=0; $i < count($vars); $i++) { if (strpos($vars[$i],'=')) { diff --git a/frontend/pages/builds/task.php b/frontend/pages/builds/task.php index 8724857..ff3dd3f 100644 --- a/frontend/pages/builds/task.php +++ b/frontend/pages/builds/task.php @@ -13,12 +13,12 @@ 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/>'; + echo '<a href="'.url("build/$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("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: '; + $pager='<form action="'.url("build/$task->build/$task->order").'" method="post" onsubmit="window.location.href=\''.url("build/$task->build/$task->order").'/\'+this.page.value; return false">Page: '; if ($page > 1) { $pager.='<input type="button" value="<<" onclick="this.form.page.value='.($page-1).'; this.form.onsubmit()" /> '."\n"; } @@ -44,10 +44,10 @@ function body_builds_task() { echo $ansi->reset(); // Clear any leftover <span>s echo '</div>'; echo $pager; - echo '<a href="'.url("build/$task->build/log").'">Back</a><br/>'; + echo '<a href="'.url("build/$task->build").'">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>."); + echo print_error("There aren't $page pages. Try an <a href=\"".url("build/$task->build/$task->order")."\">earlier page</a>."); } else { echo print_warning('No output'); } diff --git a/frontend/pages/configurations/manager.php b/frontend/pages/configurations/manager.php index 0488a11..dfd8322 100644 --- a/frontend/pages/configurations/manager.php +++ b/frontend/pages/configurations/manager.php @@ -17,7 +17,7 @@ function body_configurations_manager() { $name=isset($request['name'])?$request['name']:null; $build=$c->build($name); if (is_object($build)) - echo print_success('Submitted for build - <a href="'.url('logs/'.$build->id).'">Logs</a>'); + echo print_success('Submitted for build - <a href="'.url("build/$build->id").'">Logs</a>'); else echo print_error('Invalid configuration', 'Your configuration could not be submitted for build. Please return to <a href="'.url("config/$c->id/$build").'">step '.$build.'</a> and continue configuration from there.'); } @@ -54,7 +54,7 @@ function body_configurations_manager() { $builds=$c->get_builds(); if ($builds) { foreach ($builds as $build) { - echo '<a href="'.url('logs/'.$build).'">'.$build.'</a> '; + echo '<a href="'.url("build/$build").'">'.$build.'</a> '; } } else { echo '<i>None</i>'; diff --git a/frontend/routing.csv b/frontend/routing.csv index a0bf3c2..3151d27 100644 --- a/frontend/routing.csv +++ b/frontend/routing.csv @@ -10,40 +10,40 @@ # ^ 404 # Home -^$ welcome + welcome # 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 +builds builds/index +build/([a-z0-9]{6}) builds/log build +build/([a-z0-9]{6})/([0-9]+) builds/task build task +build/([a-z0-9]{6})/([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 +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 # Session -^login$ login -^login/(.+)$ login go -^logout$ logout -^logout/(.+)$ logout go +login login +login/(.+) login go +logout logout +logout/(.+) logout go # Account stuff -^register$ register -^register/([a-zA-Z0-9]{30})$ register token -^invite$ invite +register register +register/([a-zA-Z0-9]{30}) register token +invite invite # Pass through -^(js)/([0-9a-zA-Z-_]+\.(js))$ passthrough dir file ext -^(images)/([0-9a-zA-Z-_]+\.(gif|jpg|jpeg|ico|png))$ passthrough dir file ext +(js)/([0-9a-zA-Z-_]+\.(js)) passthrough dir file ext +(images)/([0-9a-zA-Z-_]+\.(gif|jpg|jpeg|ico|png)) passthrough dir file ext (?:.*/)?(favicon.(ico))$ passthrough file ext dir=images # Replace xinha with a directory name to turn it into fairly normal handling like without all this crazy redirecting -#^(xinha(?=/)[0-9a-zA-Z-_./]*).(?<=/)([0-9a-zA-Z-_.]+\.([a-zA-Z0-9]+))$ passthrough dir file ext +#(xinha(?=/)[0-9a-zA-Z-_./]*).(?<=/)([0-9a-zA-Z-_.]+\.([a-zA-Z0-9]+)) passthrough dir file ext # CSS -^style.css$ stylesheet +style.css stylesheet # Backend access only -^backend/upload_image$ upload +backend/upload_image upload # This is the catch-all - never remove it -^ 404 +.* 404 |