Commits

Riccardo Magliocchetti committed 3dfef06

Show spooler jobs in django admin

Comments (0)

Files changed (2)

django/uwsgi_admin/templates/uwsgi.html

 </table>
 </div>
 
+<div class="module" style="width:860px">
+<table>
+	<caption style="width:860px">spooler jobs</caption>
+	<thead>
+		<tr>
+			<th scope="row">job filename</th>
+			<th scope="row">environment</th>
+		</tr>
+	</thead>
+	<tbody>
+{% for j in jobs %}
+	<tr>
+		<td align="left">{{j.file}}</td>
+		<td align="left">{{j.env}}</td>
+	</tr>
+{% endfor %}
+	</tbody>
+</table>
+</div>
+
 {% if masterpid %}
 <br/>
 <form {% if has_file_field %}enctype="multipart/form-data" {% endif %}action="reload/" method="post">

django/uwsgi_admin/views.py

 		w['load'] = (100 * (w['running_time']/1000))/total_load
 		w['last_spawn_str'] = time.ctime(w['last_spawn'])
 
+	spooler_jobs = uwsgi.spooler_jobs()
+	jobs = []
+	for j in spooler_jobs:
+		jobs.append({'file': j, 'env': uwsgi.parsefile(j)})
+
 	return render_to_response('uwsgi.html', {'masterpid': uwsgi.masterpid(),
 						'started_on': time.ctime(uwsgi.started_on),
 						'buffer_size': uwsgi.buffer_size,
 						'total_requests': uwsgi.total_requests(),
 						'numproc': uwsgi.numproc,
 						'workers': workers,
+						'jobs': jobs,
 						}, RequestContext(request, {}))
 index = staff_member_required(index)