Fix maintenance refresh interval
* fix XMLHttpRequest - send after callback is registered * check for correct type of value - it's a boolean * return correct content-type in status.php
This commit is contained in:
parent
fc2711e156
commit
78ec7543d5
|
@ -7,14 +7,14 @@ function checkStatus() {
|
||||||
0, location.pathname.indexOf('index.php')
|
0, location.pathname.indexOf('index.php')
|
||||||
);
|
);
|
||||||
request.open("GET", ocroot+'status.php', true);
|
request.open("GET", ocroot+'status.php', true);
|
||||||
request.send();
|
|
||||||
request.onreadystatechange = function() {
|
request.onreadystatechange = function() {
|
||||||
if (request.readyState === 4) {
|
if (request.readyState === 4) {
|
||||||
var response = request.responseText;
|
var response = request.responseText;
|
||||||
var responseobj = JSON.parse(response);
|
var responseobj = JSON.parse(response);
|
||||||
if (responseobj.maintenance === 'false') {
|
if (responseobj.maintenance === false) {
|
||||||
window.location.reload();
|
window.location.reload();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
request.send();
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,6 +41,7 @@ try {
|
||||||
if (OC::$CLI) {
|
if (OC::$CLI) {
|
||||||
print_r($values);
|
print_r($values);
|
||||||
} else {
|
} else {
|
||||||
|
header('Content-Type: application/json');
|
||||||
echo json_encode($values);
|
echo json_encode($values);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue