mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-23 09:53:15 +00:00
refresh working info
This commit is contained in:
@@ -69,8 +69,11 @@ class AdminConfigurationController extends Controller
|
||||
/** @var WorkerRunningJobRepository $repoWorker */
|
||||
$repoWorker = $app['repo.worker-running-job'];
|
||||
|
||||
$reload = ($request->query->get('reload')) == 1 ? true : false ;
|
||||
|
||||
return $this->render('admin/worker-manager/worker_info.html.twig', [
|
||||
'workerRunningJob' => $repoWorker->findAll()
|
||||
'workerRunningJob' => $repoWorker->findAll(),
|
||||
'reload' => $reload
|
||||
]);
|
||||
}
|
||||
|
||||
|
@@ -1,3 +1,5 @@
|
||||
{% if not reload %}
|
||||
|
||||
<h1> worker information</h1>
|
||||
|
||||
<form action="{{ path("worker_admin_truncate") }}" method="POST">
|
||||
@@ -32,7 +34,9 @@
|
||||
<th class="sortable">status</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tbody class="work-list">
|
||||
{% endif %}
|
||||
|
||||
{% for workerRow in workerRunningJob %}
|
||||
<tr>
|
||||
<td>{{ workerRow.databoxId }}</td>
|
||||
@@ -45,5 +49,23 @@
|
||||
|
||||
</tr>
|
||||
{% endfor %}
|
||||
|
||||
{% if not reload %}
|
||||
</tbody>
|
||||
</table>
|
||||
</table>
|
||||
<script>
|
||||
setInterval(function () {
|
||||
if ($('.worker-info').hasClass('active')) {
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: "/admin/worker-manager/info?reload=1",
|
||||
success: function (data) {
|
||||
$(".work-list").empty().html(data);
|
||||
}
|
||||
});
|
||||
}
|
||||
}, 5000
|
||||
);
|
||||
</script>
|
||||
{% endif %}
|
||||
|
||||
|
Reference in New Issue
Block a user