Skip to content

Commit

Permalink
feature #218
Browse files Browse the repository at this point in the history
  • Loading branch information
qr committed Dec 8, 2020
1 parent c1b9338 commit 661465b
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 2 deletions.
2 changes: 1 addition & 1 deletion public/css/screen.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion public/css/screen.css.map

Large diffs are not rendered by default.

17 changes: 17 additions & 0 deletions public/js/voorlegger.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,21 @@ $(document).ready(function () {
}
});
});

if ($('#connection_error').length) {
setInterval(function () {
let element = $('#connection_error');

$.ajax({
method: "GET",
url: "/ping",
success: function (data) {
element.addClass('hidden');
},
error: function () {
element.removeClass('hidden');
}
});
}, 60000);
}
});
12 changes: 12 additions & 0 deletions public/scss/partials/_pdf-splitter.scss
Original file line number Diff line number Diff line change
Expand Up @@ -351,4 +351,16 @@ $splitter-bg-color: #555;
max-height: 100px;
margin-right: 5px;
}
}

.connection_error {
top: 30px;
margin: 15px;
margin-top: 60px;
width: 431px;
background-color: red;
color: white;
font-size: 16px;
padding: 5px;
border: 1px solid black;
}
9 changes: 9 additions & 0 deletions src/Controller/DefaultController.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,13 @@ public function debugAction(Request $request)
'trustedProxies' => $request->getTrustedProxies(),
]);
}

/**
* @Route("/ping")
* @return JsonResponse
*/
public function pingAction()
{
return new JsonResponse(['status'=>'OK']);
}
}
1 change: 1 addition & 0 deletions templates/master.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

{% block pdfsplitter %}
<aside id="pdfsplitter" class="pdf-splitter no-header file-pdf-pages" data-decorator="droppable" data-changer="pdfsplitter">
<div id="connection_error" class="connection_error hidden">Er is op dit moment geen verbinding met het schulddossier. Wacht een paar minuten om op te slaan.</div>
<span class="pdfsplitter__selected-pages"></span>
<div class="pages" data-handler="page-select"></div>
<label class="file-selector">
Expand Down

0 comments on commit 661465b

Please sign in to comment.