Skip to content

Commit

Permalink
Fix for showing job information for Studies queue. Change of icons.
Browse files Browse the repository at this point in the history
  • Loading branch information
tblock79 committed Aug 23, 2024
1 parent 2543ef7 commit bd5a4ae
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 25 deletions.
12 changes: 7 additions & 5 deletions webinterface/queue.py
Original file line number Diff line number Diff line change
Expand Up @@ -386,10 +386,8 @@ async def set_queues_status(request):
processing_halt_file = Path(config.mercure.processing_folder + "/" + mercure_names.HALT)
routing_halt_file = Path(config.mercure.outgoing_folder + "/" + mercure_names.HALT)

form = dict(await request.form())
print(form)

try:
form = dict(await request.form())
if form.get("suspend_processing", "false") == "true":
processing_halt_file.touch()
else:
Expand All @@ -408,7 +406,7 @@ async def set_queues_status(request):
return JSONResponse({"result": "OK"})


@router.get("/jobinfo/{category}/{id}")
@router.post("/jobinfo/{category}/{id}")
@requires("authenticated", redirect="login")
async def get_jobinfo(request):
try:
Expand All @@ -425,6 +423,10 @@ async def get_jobinfo(request):
elif job_category == "routing":
job_pathstr = config.mercure.outgoing_folder + "/" + job_id
elif job_category == "studies":
# Note: For studies, the job_id contains a dash character, which is removed from the URL. Thus,
# take the information from the request body instead.
params = dict(await request.form())
job_id = params["jobId"]
job_pathstr = config.mercure.studies_folder + "/" + job_id
elif job_category == "failure":
job_pathstr = config.mercure.error_folder + "/" + job_id
Expand All @@ -447,4 +449,4 @@ async def get_jobinfo(request):
else:
return PlainTextResponse("Task not found. Refresh view!")

queue_app = Starlette(routes=router)
queue_app = Starlette(routes=router)
41 changes: 21 additions & 20 deletions webinterface/templates/queue.html
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ <h5 class="title is-5 configtitle" style="margin-top: 60px;"><i
</div>
</section>
<footer class="modal-card-foot buttons is-centered">
<button class="button" type="button" id="closejobinformation" onclick="closeJobInformation()">Close</button>
<button class="button" type="button" id="closejobinformation" onclick="closeJobInformation()"><i class="fas fa-check"></i>&nbsp;Close</button>
</footer>
</div>
</div>
Expand All @@ -267,7 +267,7 @@ <h5 class="title is-5 configtitle" style="margin-top: 60px;"><i
</div>
</section>
<footer class="modal-card-foot buttons is-centered">
<button class="button" type="button" id="closejobarchiveinformation" onclick="closeJobArchiveInformation()">Close</button>
<button class="button" type="button" id="closejobarchiveinformation" onclick="closeJobArchiveInformation()"><i class="fas fa-check"></i>&nbsp;Close</button>
</footer>
</div>
</div>
Expand Down Expand Up @@ -296,7 +296,7 @@ <h5 class="title is-5 configtitle" style="margin-top: 60px;"><i
</table>
</section>
<footer class="modal-card-foot buttons is-centered">
<button class="button" type="button" id="closejobaudittrail" onclick="closeJobAuditTrail()">Close</button>
<button class="button" type="button" id="closejobaudittrail" onclick="closeJobAuditTrail()"><i class="fas fa-check"></i>&nbsp;Close</button>
</footer>
</div>
</div>
Expand All @@ -311,7 +311,7 @@ <h5 class="title is-5 configtitle" style="margin-top: 60px;"><i
<pre id="process_logs_display" class="process-logs process-logs-output"></pre>
</section>
<footer class="modal-card-foot buttons is-centered">
<button class="button" type="button" id="closeprocesslogs" onclick="closeProcessLogs()">Close</button>
<button class="button" type="button" id="closeprocesslogs" onclick="closeProcessLogs()"><i class="fas fa-check"></i>&nbsp;Close</button>
</footer>
</div>
</div>
Expand All @@ -326,7 +326,7 @@ <h5 class="title is-5 configtitle" style="margin-top: 60px;"><i
<pre id="process_results_display" class="process-results process-results-output"></pre>
</section>
<footer class="modal-card-foot buttons is-centered">
<button class="button" type="button" id="closeprocessresults" onclick="closeProcessResults()">Close</button>
<button class="button" type="button" id="closeprocessresults" onclick="closeProcessResults()"><i class="fas fa-check"></i>&nbsp;Close</button>
</footer>
</div>
</div>
Expand Down Expand Up @@ -602,15 +602,15 @@ <h5 class="title is-5 configtitle" style="margin-top: 60px;"><i
titleAttr: 'Deselect all',
},
{
text: '<i class="far fa-question-circle"></i>',
text: '<i class="fas fa-code"></i>',
titleAttr: 'Job information',
action: function ( e, dt, node, config ) {
var jid = $('#jobs_processing').DataTable().rows( { selected: true } ).data()[0][5];
showJobInformation(jid,"processing");
}
},
{
text: '<i class="far fa-trash-alt"></i>',
text: '<i class="fas fa-trash-alt"></i>',
titleAttr: 'Cancel job',
action: function ( e, dt, node, config ) {
alert("Coming soon!");
Expand Down Expand Up @@ -649,15 +649,15 @@ <h5 class="title is-5 configtitle" style="margin-top: 60px;"><i
titleAttr: 'Deselect all',
},
{
text: '<i class="far fa-question-circle"></i>',
text: '<i class="fas fa-code"></i>',
titleAttr: 'Job information',
action: function ( e, dt, node, config ) {
var jid = $('#jobs_routing').DataTable().rows( { selected: true } ).data()[0][5];
showJobInformation(jid,"routing");
}
},
{
text: '<i class="far fa-trash-alt"></i>',
text: '<i class="fas fa-trash-alt"></i>',
titleAttr: 'Cancel job',
action: function ( e, dt, node, config ) {
alert("Coming soon!");
Expand Down Expand Up @@ -700,21 +700,22 @@ <h5 class="title is-5 configtitle" style="margin-top: 60px;"><i
titleAttr: 'Deselect all',
},
{
text: '<i class="far fa-question-circle"></i>',
text: '<i class="fas fa-code"></i>',
titleAttr: 'Job information',
action: function ( e, dt, node, config ) {
showJobInformation("","studies");
var jid = $('#jobs_studies').DataTable().rows( { selected: true } ).data()[0][0];
showJobInformation(jid,"studies");
}
},
{
text: '<i class="far fa-trash-alt"></i>',
text: '<i class="fas fa-trash-alt"></i>',
titleAttr: 'Cancel study',
action: function ( e, dt, node, config ) {
alert("Coming soon!");
}
},
{
text: '<i class="far fa-play-circle"></i>',
text: '<i class="fas fa-sign-out-alt"></i>',
titleAttr: 'Force study completion',
action: function ( e, dt, node, config ) {

Expand Down Expand Up @@ -785,15 +786,15 @@ <h5 class="title is-5 configtitle" style="margin-top: 60px;"><i
titleAttr: 'Deselect all',
},
{
text: '<i class="far fa-question-circle"></i>',
text: '<i class="fas fa-code"></i>',
titleAttr: 'Job information',
action: function ( e, dt, node, config ) {
var jid = $('#jobs_fail').DataTable().rows( { selected: true } ).data()[0][4];
showJobInformation(jid,"failure");
}
},
{
text: '<i class="fas fa-redo"></i>',
text: '<i class="fas fa-redo-alt"></i>',
titleAttr: 'Restart job',
action: function ( e, dt, node, config ) {
alert("Coming soon!");
Expand Down Expand Up @@ -842,23 +843,23 @@ <h5 class="title is-5 configtitle" style="margin-top: 60px;"><i
]
},
{
text: '<i class="far fa-question-circle"></i>',
text: '<i class="fas fa-code"></i>',
titleAttr: 'Job information',
action: function ( e, dt, node, config ) {
var jid = $('#jobs_archive').DataTable().rows( { selected: true } ).data()[0].slice(-1)[0];
showArchiveJobInformation(jid);
}
},
{
text: '<i class="fas fa-list"></i>',
text: '<i class="fas fa-list-ul"></i>',
titleAttr: 'Audit trail',
action: function ( e, dt, node, config ) {
var jid = $('#jobs_archive').DataTable().rows( { selected: true } ).data()[0].slice(-1)[0];
showAuditTrail(jid);
}
},
{
text: '<i class="far fa-file-alt"></i>',
text: '<i class="fas fa-receipt"></i>',
titleAttr: 'Processing log',
action: function ( e, dt, node, config ) {
var jid = $('#jobs_archive').DataTable().rows( { selected: true } ).data()[0].slice(-1)[0];
Expand Down Expand Up @@ -1110,9 +1111,9 @@ <h5 class="title is-5 configtitle" style="margin-top: 60px;"><i
$("#jobinfocontrol").addClass("is-loading");

$.ajax({
type: 'GET',
type: 'POST',
url: '/queue/jobinfo/' + category + '/' + jobId,
data: {},
data: { 'jobId': jobId },
dataType: 'json',
success: function (data) {
textContent = ""
Expand Down

0 comments on commit bd5a4ae

Please sign in to comment.