summaryrefslogtreecommitdiff
path: root/tko/compose_query.cgi
diff options
context:
space:
mode:
authormbligh <mbligh@592f7852-d20e-0410-864c-8624ca9c26a4>2008-05-15 23:49:04 +0000
committermbligh <mbligh@592f7852-d20e-0410-864c-8624ca9c26a4>2008-05-15 23:49:04 +0000
commit61c053f3f5b2cc9919731c8e7a4cbf2a236e35b8 (patch)
treef1e066ec66430fd5cc41a1e26592828c83fe815b /tko/compose_query.cgi
parentaa2b7c921c6e82c11e614dfa4b324669088eb3ed (diff)
Save query on request.
a) Add to TKO UI a form containing button [SaveQuery] and edit control for optional comments b) On saveQuery request TKO make sure that user's cookies contain a unique user's id c) ... and then write into table query_history in TKO: time stamp, comment, uid, url of the query d) Make sure user can read saved queries back ( can read only own queries ) compose_query.cgi - added a form that supports user's request to save current qu ery save_query.cgi - saves the query query_history.cgi - shows saved queries by this user unique_cookie.py - common cookie related function: set/get user's unique id 006_add_table_query_history.py - database migration. New table introduced for qu ery history. Signed-off-by: Vladimir Samarskiy <vsamarsk@google.com> git-svn-id: svn://test.kernel.org/autotest/trunk@1523 592f7852-d20e-0410-864c-8624ca9c26a4
Diffstat (limited to 'tko/compose_query.cgi')
-rwxr-xr-xtko/compose_query.cgi30
1 files changed, 23 insertions, 7 deletions
diff --git a/tko/compose_query.cgi b/tko/compose_query.cgi
index 5fef8b8f..c5a29cb2 100755
--- a/tko/compose_query.cgi
+++ b/tko/compose_query.cgi
@@ -47,6 +47,19 @@ html_header = """\
</tr>
</table>
</form>
+<form action="save_query.cgi" method="get">
+<table border="0">
+<tr>
+ <td>Name your query:&nbsp;&nbsp;</td>
+ <td>
+ <input type="text" name="label" size="15" value="">
+ </td>
+ <td align="center">&nbsp;<input type="submit" value="Save Query">
+ </td>
+ <td>&nbsp;&nbsp;<a href="query_history.cgi">View saved queries</a></td>
+</tr>
+</table>
+</form>
"""
@@ -210,7 +223,8 @@ def map_kernel_init():
key = base + ' p%d' % (idx)
if not map.has_key(key):
map[key] = map_kernel_base(base) + ' p%d' % (idx)
- map[key] += '<br>+<span title="' + name + '">' + name[0:25] + '</span>'
+ map[key] += ('<br>+<span title="' + name + '">' +
+ name[0:25] + '</span>')
return map
@@ -309,7 +323,7 @@ def gen_matrix():
box_data = test_data.data[x][y]
except:
cur_row.append(display.box(None, None,
- row_label=y, column_label=x))
+ row_label=y, column_label=x))
continue
job_tag = test_data.data[x][y].job_tag
if job_tag:
@@ -317,9 +331,9 @@ def gen_matrix():
else:
link = construct_link(x, y)
- cur_row.append(display.status_precounted_box(db_obj,
- box_data,
- link, y, x))
+ apnd = display.status_precounted_box(db_obj, box_data,
+ link, y, x)
+ cur_row.append(apnd)
matrix.append(cur_row)
return matrix
@@ -339,8 +353,10 @@ def main():
display.print_table(gen_matrix())
print display.color_keys_row()
total_wall_time = time.time() - total_wall_time_start
- print '<p style="font-size:x-small;">sql access wall time = %s secs, \
- total wall time = %s secs</p>' % (sql_wall_time, total_wall_time)
+ perf_info = '<p style="font-size:x-small;">'
+ perf_info += 'sql access wall time = %s secs,' % sql_wall_time
+ perf_info += 'total wall time = %s secs</p>' % total_wall_time
+ print perf_info
print '</body></html>'
main()