Hi there,
If I have two different applications opened in tab A and B (both launched by the same ShinyProxy service), then logout in tab B, is there a nice way to show that the user logged out in tab A? Currently the Shiny application will simply disconnect, but it might be nice to inform the user a login is required/the user has been logged out.
One way to inform a user that the application has disconnected is as follows, which works nicely (I recommend anyone to use it!), but I do not know how to customize this message specifically in case a user has been logged out.
<!-- DISCONNECT AND CRASH HANDLING -->
<style>
#shiny-disconnected-overlay {
position: fixed;
top: 0px;
bottom: 0px;
left: 0px;
right: 0px;
background-color: transparent;
opacity: 1;
z-index: 1;
pointer-events: none;
overflow: hidden;
}
</style>
<script>
$(document).on('shiny:disconnected', function(event) {
$('#shiny-modal-wrapper').hide();
$('#shiny-modal-error').modal('show');
$('#shiny-modal-error').click();
});
</script>
<div id="shiny-modal-error" class="modal fade show" tabindex="-1" data-backdrop="static" data-keyboard="false" style="padding-right: 21px; display: none;">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header" style="background-color: #EFEFEF">
<h4 style="color: #666;" class="modal-title"><img style="width: 200px;" src="images/yourCompany.png"></h4>
</div>
<div class="modal-body">
<h5 style="color: rgb(102, 102, 102); font-family: Roboto;">
There was a problem.
</h5>
<br>
<h5 class="before-you-start-creating-your" style="font-weight:normal;">
Your session is disconnected due to lack of activity or a technical issue.
</h5>
</div>
<div class="modal-footer">
<a onclick="parent.location.reload();"><button class="btn btn-default action-button modal-continue-btn shiny-bound-input" id="refreshAppAfterCrash" type="button">Refresh</button></a>
</div>
</div>
</div>
<script>$('#shiny-modal').modal().focus();</script>
</div>
<!-- END OF DISCONNECT/CRASH HANDLING -->
Best regards,
Michael