2020-11-17 13:46:23 +01:00
@using BTCPayServer.Abstractions.Contracts
2020-07-28 22:48:51 +02:00
@inject IEnumerable<ISyncSummaryProvider> SyncSummaryProviders;
2020-09-29 14:13:39 +02:00
@if (SyncSummaryProviders.Any(provider => !provider.AllAvailable()))
2020-06-11 17:34:41 -05:00
{
<!-- Modal -->
2020-09-29 14:13:39 +02:00
<div id="syncModal" class="modal-dialog">
2020-06-11 17:34:41 -05:00
<div class="modal-content">
2020-09-29 14:13:39 +02:00
<a class="modal-header btn-link border-0 text-decoration-none cursor-pointer align-items-center" data-toggle="collapse" data-target="#syncModalContent">
2020-06-11 17:34:41 -05:00
<h4 class="modal-title">Your nodes are synching...</h4>
2020-10-06 09:01:31 +02:00
<span class="fa fa-chevron-down"></span>
2020-09-29 14:13:39 +02:00
</a>
<div id="syncModalContent" class="collapse show">
<div class="modal-body pt-0">
<p>
Your node is synching the entire blockchain and validating the consensus rules...
</p>
@foreach (var provider in SyncSummaryProviders)
{
<partial name="@provider.Partial"/>
}
<p>
<a href="https://www.youtube.com/watch?v=OrYDehC-8TU" target="_blank">Watch this video</a> to understand the importance of blockchain synchronization.
</p>
<p class="mb-0">If you really don't want to synch and you are familiar with the command line, check <a href="https://github.com/btcpayserver/btcpayserver-docker/blob/master/contrib/FastSync/README.md" target="_blank">FastSync</a>.</p>
</div>
2020-06-11 17:34:41 -05:00
</div>
</div>
</div>
2020-09-29 14:13:39 +02:00
<script>
var syncModalContent = $('#syncModalContent');
2020-10-06 09:30:16 +02:00
var syncModal = $('#syncModal');
2020-09-29 14:13:39 +02:00
if (localStorage.getItem("sync-collapsed")){
syncModalContent.removeClass("show");
2020-06-11 17:34:41 -05:00
}
2020-09-29 14:13:39 +02:00
syncModalContent.on('hidden.bs.collapse', function () {
localStorage.setItem("sync-collapsed", "true");
}).on('shown.bs.collapse', function () {
localStorage.removeItem("sync-collapsed");
});
2020-10-06 09:30:16 +02:00
function handleFooterBottom() {
if (document.getElementsByTagName("footer")[0].getBoundingClientRect().top < window.innerHeight){
syncModal.stop().animate({"bottom":"40px"}, 200);
} else {
syncModal.stop().animate({"bottom":"10px"}, 200);
}
}
$(document).on("scroll", handleFooterBottom);
handleFooterBottom();
2020-06-11 17:34:41 -05:00
</script>
<style type="text/css">
2020-10-06 09:30:16 +02:00
2020-09-29 14:13:39 +02:00
#syncModal {
2020-06-11 17:34:41 -05:00
position: fixed;
2020-10-06 09:01:31 +02:00
bottom: 40px;
2020-09-29 14:13:39 +02:00
right: 10px;
margin: 0;
z-index: 1000;
width: 500px;
max-width: 100%;
}
#syncModal .modal-body {
max-height: 400px;
overflow-y: scroll;
}
#syncModal .fa-chevron-down {
2020-10-06 09:01:31 +02:00
font-size: 1em;
text-decoration: none;
2020-09-29 14:13:39 +02:00
transition: transform .35s;
}
#syncModal .collapsed .fa-chevron-down {
transform: rotate(-90deg);
2020-06-11 17:34:41 -05:00
}
</style>
}