mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-31 01:35:36 +02:00
#9765 Fixed check connection
This commit is contained in:
parent
778501d4bf
commit
53ef84c7e5
@ -35,33 +35,26 @@ function handleConnection() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (navigator.onLine) {
|
$.ajax({
|
||||||
$.ajax({
|
url: homeurl + "include/connection_check.php",
|
||||||
url: homeurl + "include/connection_check.php",
|
type: "post",
|
||||||
type: "post",
|
dataType: "json"
|
||||||
dataType: "json"
|
})
|
||||||
|
.done(function(response) {
|
||||||
|
connected = true;
|
||||||
|
showConnectionMessage(connected, msg);
|
||||||
})
|
})
|
||||||
.done(function(response) {
|
.fail(function(err) {
|
||||||
|
// If test connection file is not found, do not show message.
|
||||||
|
if (err.status != 404) {
|
||||||
|
connected = false;
|
||||||
|
msg = err;
|
||||||
|
} else {
|
||||||
connected = true;
|
connected = true;
|
||||||
showConnectionMessage(connected, msg);
|
}
|
||||||
})
|
|
||||||
.fail(function(err) {
|
|
||||||
// If test connection file is not found, do not show message.
|
|
||||||
if (err.status != 404) {
|
|
||||||
connected = false;
|
|
||||||
msg = err;
|
|
||||||
} else {
|
|
||||||
connected = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
showConnectionMessage(connected, msg);
|
showConnectionMessage(connected, msg);
|
||||||
});
|
});
|
||||||
} else {
|
|
||||||
// handle offline status
|
|
||||||
connected = false;
|
|
||||||
msg = "Connection offline";
|
|
||||||
showConnectionMessage(connected, msg);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user