mirror of https://github.com/nextcloud/server.git
Refresh if maintenance mode is over
Using status.php for this. I modified status.php to also show, whether we're in maintenance. Checks every 20 seconds if maintenance is over, if yes: reload.remotes/origin/fix-10825
parent
dc99fd768a
commit
69f2c0544e
@ -0,0 +1,20 @@
|
||||
// Check every 20 seconds via status.php if maintenance is over
|
||||
window.setInterval(checkStatus, 20000);
|
||||
|
||||
function checkStatus() {
|
||||
var request = new XMLHttpRequest();
|
||||
var ocroot = location.pathname.substr(
|
||||
0, location.pathname.indexOf('index.php')
|
||||
);
|
||||
request.open("GET", ocroot+'status.php', true);
|
||||
request.send();
|
||||
request.onreadystatechange = function() {
|
||||
if (request.readyState === 4) {
|
||||
var response = request.responseText;
|
||||
var responseobj = JSON.parse(response);
|
||||
if (responseobj.maintenance === 'false') {
|
||||
window.location.reload();
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
Loading…
Reference in New Issue