Skip to content

Commit 23ee1fd

Browse files
ipweblabVidas P
authored andcommitted
Always show job indicators and fix lingering overlay of job error log
1 parent 2abb8a7 commit 23ee1fd

File tree

5 files changed

+48
-10
lines changed

5 files changed

+48
-10
lines changed

app/assets/javascripts/components/worker-checker.js

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ $(function() {
2828
}
2929
} else {
3030
if (elem.is(":visible")) {
31-
elem.tooltip('dispose').fadeOut();
31+
// elem.tooltip('dispose').fadeOut();
3232
}
3333
}
3434
}
@@ -39,7 +39,7 @@ $(function() {
3939
find(".number").
4040
text(json.message_count);
4141
} else {
42-
$("#message-indicator").tooltip('dispose').fadeOut();
42+
// $("#message-indicator").tooltip('dispose').fadeOut();
4343
}
4444

4545
$("#message-indicator").data("sinceId", json.max_id);
@@ -48,7 +48,21 @@ $(function() {
4848
if ((document.location.pathname === '/jobs') && ($(".modal[aria-hidden=false]").length === 0) && (previousJobs != null) && (previousJobs.join(',') !== currentJobs.join(','))) {
4949
if (!document.location.search || (document.location.search === '?page=1')) {
5050
$.get('/jobs', data => {
51-
return $("#main-content").html(data);
51+
if ($('.modal-backdrop').is(":visible")) {
52+
$('.modal-backdrop.fade.show').hide();
53+
}
54+
$("#main-content").html(data);
55+
$("#jobs-table").dataTable({
56+
"destroy": true,
57+
paging: true,
58+
statesave: true,
59+
order: [[2, 'asc']],
60+
columnDefs: [
61+
{ targets: [0, 1], orderable: true, searchable: true },
62+
{ targets: [2, 3, 5], orderable: true, searchable: false },
63+
{ targets: '_all', orderable: false, searchable: false },
64+
]
65+
});
5266
});
5367
}
5468
}

app/assets/javascripts/pages/jobs-index-page.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
this.JobsIndexPage = class JobsIndexPage {
22
constructor() {
33
$("#jobs-table").dataTable({
4-
paging: false,
4+
paging: true,
5+
statesave: true,
56
order: [[2, 'asc']],
67
columnDefs: [
78
{ targets: [0, 1], orderable: true, searchable: true },
8-
{ targets: [2, 3], orderable: true, searchable: false },
9+
{ targets: [2, 3, 5], orderable: true, searchable: false },
910
{ targets: '_all', orderable: false, searchable: false },
1011
]
1112
});

app/assets/stylesheets/jobs.scss

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,25 @@
1-
.big-modal-dialog {
1+
.modal-dialog.big-modal-dialog {
22
width: 90% !important;
3-
}
3+
max-width: 90%;
4+
}
5+
6+
#jobs-table {
7+
.badge-info {
8+
background-color: $green;
9+
}
10+
11+
a:not(.btn) {
12+
cursor: pointer;
13+
text-decoration: underline;
14+
15+
&:hover {
16+
text-decoration: none;
17+
}
18+
}
19+
}
20+
21+
body.jobs .modal {
22+
pre {
23+
white-space:normal;
24+
}
25+
}

app/assets/stylesheets/navbar.scss

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,16 @@
2121

2222
#message-indicator,
2323
.job-indicator {
24-
font-size: 1.22rem;
2524
line-height: 55px;
2625
padding-right: 1rem;
2726

2827
a {
2928
color: $gray-500;
29+
display: inline-flex;
3030

3131
.badge {
3232
font-weight: 200;
33+
font-size: 14px;
3334

3435
i {
3536
color: $gray-500;

app/views/jobs/index.html.erb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,12 @@
5555
<div class="modal-dialog big-modal-dialog">
5656
<div class="modal-content">
5757
<div class="modal-header">
58-
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
5958
<h4 class="modal-title" id="myModalLabel">Error Backtrace</h4>
59+
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
6060
</div>
6161
<div class="modal-body">
6262
<pre>
63-
<%= raw html_escape(job.last_error).split("\n").join('<br/>') %>
63+
<%= raw html_escape(job.last_error).split("\n").join('<br>') %>
6464
</pre>
6565
</div>
6666
</div>

0 commit comments

Comments
 (0)