mirror of
https://github.com/overte-org/overte.git
synced 2025-04-26 06:56:32 +02:00
Move requests that require access token to go through DS Update various styling and ease of use on DS settings page Update domain server settings CP CP
48 lines
1.4 KiB
JavaScript
48 lines
1.4 KiB
JavaScript
function showRestartModal() {
|
|
$('#restart-modal').modal({
|
|
backdrop: 'static',
|
|
keyboard: false
|
|
});
|
|
|
|
var secondsElapsed = 0;
|
|
var numberOfSecondsToWait = 3;
|
|
|
|
var refreshSpan = $('span#refresh-time')
|
|
refreshSpan.html(numberOfSecondsToWait + " seconds");
|
|
|
|
// call ourselves every 1 second to countdown
|
|
var refreshCountdown = setInterval(function(){
|
|
secondsElapsed++;
|
|
secondsLeft = numberOfSecondsToWait - secondsElapsed
|
|
refreshSpan.html(secondsLeft + (secondsLeft == 1 ? " second" : " seconds"))
|
|
|
|
if (secondsElapsed == numberOfSecondsToWait) {
|
|
location.reload(true);
|
|
clearInterval(refreshCountdown);
|
|
}
|
|
}, 1000);
|
|
}
|
|
|
|
$(document).ready(function(){
|
|
var url = window.location;
|
|
// Will only work if string in href matches with location
|
|
$('ul.nav a[href="'+ url +'"]').parent().addClass('active');
|
|
|
|
// Will also work for relative and absolute hrefs
|
|
$('ul.nav a').filter(function() {
|
|
return this.href == url;
|
|
}).parent().addClass('active');
|
|
$('body').on('click', '#restart-server', function(e) {
|
|
swal( {
|
|
title: "Are you sure?",
|
|
text: "This will restart your domain server, causing your domain to be briefly offline.",
|
|
type: "warning",
|
|
html: true,
|
|
showCancelButton: true
|
|
}, function() {
|
|
$.get("/restart");
|
|
showRestartModal();
|
|
});
|
|
return false;
|
|
});
|
|
});
|