Skip to content

Commit

Permalink
added browsing of cronjobs
Browse files Browse the repository at this point in the history
  • Loading branch information
leonid-shevtsov committed Jun 11, 2011
1 parent ead3c1b commit d1368af
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 2 deletions.
7 changes: 6 additions & 1 deletion modules/cronograph/server.py
Expand Up @@ -6,7 +6,8 @@ def serve():
sys.argv.pop(1)

urls = (
'/', 'index'
'/', 'index',
'/cronjobs/(\d+)', 'show'
)

db.ensure_structure(db.spawn())
Expand All @@ -26,3 +27,7 @@ def db(self):
class index(Action):
def GET(self):
return self.render.index(self.db().execute('SELECT * FROM cronjobs'))

class show(Action):
def GET(self, id):
return self.render.show(self.db().execute('SELECT * FROM cronjobs WHERE id=?', [id]).fetchone())
4 changes: 3 additions & 1 deletion templates/index.html
Expand Up @@ -17,7 +17,9 @@ <h1>cronograph</h1>
${entry['duration']}s
</td>
<td>
$entry['command_line']
<a href="/cronjobs/$entry['id']">
$entry['command_line']
</a>
</td>
</tr>
</table>
Expand Down
20 changes: 20 additions & 0 deletions templates/show.html
@@ -0,0 +1,20 @@
$def with (entry)

<h1>cronograph</h1>

<pre>
$entry['command_line']
</pre>

<dl>
<dt>Exit code</dt>
<dd>$entry['exit_code']</dd>
</dl>

<h2>Standard output</h2>

<pre>$entry['stdout']</pre>

<h2>Error output</h2>

<pre>$entry['stderr']</pre>

0 comments on commit d1368af

Please sign in to comment.