Changeset 7293:fbc43cf8113f for sage/dsage/web/web_server.py
- Timestamp:
- 10/16/07 21:11:07 (6 years ago)
- Branch:
- default
- File:
-
- 1 edited
-
sage/dsage/web/web_server.py (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
sage/dsage/web/web_server.py
r7292 r7293 27 27 DSAGE_LOCAL = SAGE_ROOT + '/local/dsage' 28 28 CSS_FILE = os.path.join(DSAGE_LOCAL,'web/static/dsage_web.css') 29 SORTTABLE = os.path.join(DSAGE_LOCAL,'web/static/sorttable.js') 29 30 JS_FILE = os.path.join(DSAGE_LOCAL,'web/static/dsage_web.js') 30 31 PROTOTYPE = os.path.join(DSAGE_LOCAL,'web/static/prototype.js') … … 103 104 setattr(Toplevel, 'child_dsage_web.js', static.File(JS_FILE)) 104 105 setattr(Toplevel, 'child_prototype.js', static.File(PROTOTYPE)) 106 setattr(Toplevel, 'child_sorttable.js', static.File(SORTTABLE)) 105 107 # setattr(Toplevel, 'child_index.html', static.File(INDEX)) 106 108 … … 116 118 117 119 def render(self, request): 118 jdicts = self.dsage_server.jobdb.get_all_jobs() 119 html = "" 120 if len(jdicts) != len(self.jdicts): 121 self.jdicts = jdicts 122 for i, jdict in enumerate(jdicts): 123 html+=""" 124 <tr class='tr%s' 125 """ % (i % 2) 126 html+=""" 127 <td><a href='get_details?job_id=%s'>%s</a></td> 128 <td>%s</td> 129 <td>%s</td> 130 <td>%s</td> 131 <td>%s</td> 132 <td>%s</td> 133 </tr> 134 """ % (jdict['job_id'],jdict['job_id'], jdict['status'], 135 jdict['username'], jdict['creation_time'], 136 jdict['update_time'], jdict['priority']) 137 138 html += '</table>' 139 else: 140 pass 120 jdicts = self.dsage_server.jobdb.get_all_jobs()[:10] 121 html = """ 122 <tr class='thead'> 123 <td>Job ID</td> 124 <td>Status</td> 125 <td>Username</td> 126 <td>Creation Time</td> 127 <td>Last Update</td> 128 <td>Priority</td> 129 </tr>""" 130 # if len(jdicts) != len(self.jdicts): 131 # self.jdicts = jdicts 132 for i, jdict in enumerate(jdicts): 133 html+=""" 134 <tr class='tr%s'> 135 """ % (i % 2) 136 html+=""" 137 <td><a href='get_details?job_id=%s'>%s</a></td> 138 <td>%s</td> 139 <td>%s</td> 140 <td>%s</td> 141 <td>%s</td> 142 <td>%s</td> 143 </tr> 144 """ % (jdict['job_id'],jdict['job_id'], jdict['status'], 145 jdict['username'], jdict['creation_time'], 146 jdict['update_time'], jdict['priority']) 147 148 html += '</table>' 149 # else: 150 # pass 141 151 # xml_stream = self.build_xml(jdicts) 142 152 … … 211 221 if not isinstance(jdict, dict): 212 222 raise TypeError 213 for k, v in jdict.iteritems():223 for i, (k, v) in enumerate(jdict.iteritems()): 214 224 if k == 'code': # We will display the code below the table 215 225 continue 216 226 html += """ 217 <tr class='tr0'> 227 <tr class='tr%s'> 228 """ % (i % 2) 229 html += """ 218 230 <td>%s</td> 219 231 <td>%s</td>
Note: See TracChangeset
for help on using the changeset viewer.
