diff options
author | Daniel Dunbar <daniel@zuster.org> | 2008-09-22 00:11:51 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2008-09-22 00:11:51 +0000 |
commit | 78266296fd201f0766b7e79319151bb4f9231e28 (patch) | |
tree | ec00bd31415e1656f14806d8f7cfd1c39ad494d2 /tools/scan-view | |
parent | b131c8ac7cc429416a2d6aaa0baccb2336883acc (diff) |
Improve scan-view report bug interface.
- Pulled css out into Resources/scanview.css
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56416 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/scan-view')
-rwxr-xr-x | tools/scan-view/Resources/bugcatcher.ico | bin | 0 -> 318 bytes | |||
-rw-r--r-- | tools/scan-view/Resources/scanview.css | 66 | ||||
-rw-r--r-- | tools/scan-view/ScanView.py | 100 |
3 files changed, 133 insertions, 33 deletions
diff --git a/tools/scan-view/Resources/bugcatcher.ico b/tools/scan-view/Resources/bugcatcher.ico Binary files differnew file mode 100755 index 0000000000..22d39b5920 --- /dev/null +++ b/tools/scan-view/Resources/bugcatcher.ico diff --git a/tools/scan-view/Resources/scanview.css b/tools/scan-view/Resources/scanview.css new file mode 100644 index 0000000000..280ce900b8 --- /dev/null +++ b/tools/scan-view/Resources/scanview.css @@ -0,0 +1,66 @@ +body { color:#000000; background-color:#ffffff } +body { font-family: Helvetica, sans-serif; font-size:9pt } +h1 { font-size:16pt } +h3 { font-size:12pt } +table { font-size:9pt } +table { border-spacing: 0px; border: 1px solid black } +table thead { + background-color:#eee; color:#666666; + font-weight: bold; cursor: default; + text-align:center; + font-weight: bold; font-family: Verdana; + white-space:nowrap; +} +.W { font-size:0px } +th, td { padding:5px; padding-left:8px; text-align:left } +td.SUMM_DESC { padding-left:12px } +td.DESC { white-space:pre } +td.Q { text-align:right } +td { text-align:left } +td.View a { + white-space: nowrap; + -webkit-appearance:square-button; + padding-left:1em; + padding-right:1em; + padding-top:0.5ex; + padding-bottom:0.5ex; + text-decoration:none; + color:black } +tbody.scrollContent { overflow:auto } + +table.form_group { + background-color: #ccc; + border: 1px solid #333; + padding: 2px; +} + +table.form_inner_group { + background-color: #ccc; + border: 1px solid #333; + padding: 0px; +} + +table.form { + background-color: #999; + border: 1px solid #333; + padding: 5px auto; +} + +td.form_label { + text-align: right; + vertical-align: top; +} +/* For one line entires */ +td.form_clabel { + text-align: right; + vertical-align: center; +} +td.form_value { + text-align: left; + vertical-align: top; +} +td.form_submit { + text-align: right; + vertical-align: top; +} + diff --git a/tools/scan-view/ScanView.py b/tools/scan-view/ScanView.py index 9e43ddf881..c213d3a384 100644 --- a/tools/scan-view/ScanView.py +++ b/tools/scan-view/ScanView.py @@ -212,7 +212,10 @@ class ScanViewRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler): # Send back an initial response and wait for the report to # finish. initial_response = """<html> -<head><title>Filing Report</title></head> +<head> + <title>Filing Report</title> + <link rel="stylesheet" type="text/css" href="/scanview.css" /> +</head> <body> <h1>Filing Report</h1> <b>Report</b>: %(report)s<br> @@ -269,12 +272,25 @@ Line: %s for i,r in enumerate(self.server.reporters): reporterSelections.append('<option value="%d">%s</option>'%(i,r.getName())) - options = '\n'.join(['%s: <input type="text" name="%s_%s"><br>'%(o,r.getName(),o) for o in r.getParameterNames()]) + options = '\n'.join(["""\ +<tr> + <td class="form_clabel">%s:</td> + <td class="form_value"><input type="text" name="%s_%s"></td> +</tr>"""%(o,r.getName(),o) for o in r.getParameterNames()]) if i==0: - display = 'inline' + display = '' else: display = 'none' - reporterOptions.append('<div id="%sReporterOptions" style="display:%s">\n<h3>%s Options</h3>%s\n</div>'%(r.getName(),display,r.getName(),options)) + reporterOptions.append("""\ +<tr id="%sReporterOptions" style="display:%s"> + <td class="form_label">%s Options</td> + <td class="form_value"> + <table class="form_inner_group"> +%s + </table> + </td> +</tr> +"""%(r.getName(),display,r.getName(),options)) reporterSelections = '\n'.join(reporterSelections) reporterOptionsDivs = '\n'.join(reporterOptions) reportersArray = '[%s]'%(','.join([`r.getName()` for r in self.server.reporters])) @@ -282,6 +298,7 @@ Line: %s result = """<html> <head> <title>File Report</title> + <link rel="stylesheet" type="text/css" href="/scanview.css" /> </head> <script language="javascript" type="text/javascript"> var reporters = %(reportersArray)s; @@ -290,7 +307,7 @@ function updateReporterOptions() { for (var i=0; i < reporters.length; ++i) { o = document.getElementById(reporters[i] + "ReporterOptions"); if (i == index) { - o.style.display = "inline"; + o.style.display = ""; } else { o.style.display = "none"; } @@ -299,25 +316,47 @@ function updateReporterOptions() { </script> <body> <h1>File Report</h1> -<hr> <form name="form" action="/report_submit" method="post"> -Title: -<input type="text" name="title" size="50" value="%(initialTitle)s"><br> -Description:<br> +<input type="hidden" name="report" value="%(report)s"> + +<table class="form"> +<tr><td> +<table class="form_group"> +<tr> + <td class="form_clabel">Title:</td> + <td class="form_value"> + <input type="text" name="title" size="50" value="%(initialTitle)s"> + </td> +</tr> +<tr> + <td class="form_label">Description:</td> + <td class="form_value"> <textarea rows="10" cols="80" name="description"> %(initialDescription)s -</textarea><br> -<hr> -<input type="hidden" name="report" value="%(report)s"> -Method: <select id="reporter" name="reporter" onChange="updateReporterOptions()"> -%(reporterSelections)s -</select><br> -<hr> +</textarea> + </td> +</table> +<br> +<table class="form_group"> +<tr> + <td class="form_clabel">Method:</td> + <td class="form_value"> + <select id="reporter" name="reporter" onChange="updateReporterOptions()"> + %(reporterSelections)s + </select> + </td> +</tr> %(reporterOptionsDivs)s -<hr> -<input type="submit" name="Submit" value="Submit"> +</table> +<br> +</td></tr> +<tr><td class="form_submit"> + <input align="right" type="submit" name="Submit" value="Submit"> +</td></tr> +</table> </form> + <iframe src="/report-%(report)s.html#EndPath" width="100%%" height="40%%" scrolling="auto" frameborder="1"> <a href="/report-%(report)s.html#EndPath">View Bug Report</a> @@ -342,24 +381,19 @@ Method: <select id="reporter" name="reporter" onChange="updateReporterOptions()" # Special case some top-level entries. if components: name = components[0] - if name=='quit': - self.server.halt() - return self.send_string('Goodbye.', 'text/plain') - elif name=='report': - if len(components)==2: + if len(components)==2: + if name=='report': return self.send_report(components[1]) - else: - return self.send_404() - elif name=='report_submit': - if len(components)==1: + elif len(components)==1: + if name=='quit': + self.server.halt() + return self.send_string('Goodbye.', 'text/plain') + elif name=='report_submit': return self.send_report_submit() - else: - return self.send_404() - elif name=='favicon.ico': - if len(components)==1: + elif name=='favicon.ico': return self.send_path(posixpath.join(kResources,'bugcatcher.ico')) - else: - return self.send_404() + elif name=='scanview.css': + return self.send_path(posixpath.join(kResources,'scanview.css')) # Match directory entries. if components[-1] == '': |