mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2025-01-24 09:01:41 +01:00
Added a try catch to the loading to inform user
This commit is contained in:
parent
f2b6040469
commit
1bc8fbed42
@ -815,6 +815,7 @@
|
|||||||
<script src="js/network-values.js"></script>
|
<script src="js/network-values.js"></script>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
try {
|
||||||
setLoadingText('Calculating values..');
|
setLoadingText('Calculating values..');
|
||||||
jsonRequest("../v1/network/overview", loadNetworkOverviewValues);
|
jsonRequest("../v1/network/overview", loadNetworkOverviewValues);
|
||||||
jsonRequest("../v1/network/servers", loadServerBoxes);
|
jsonRequest("../v1/network/servers", loadServerBoxes);
|
||||||
@ -971,6 +972,13 @@
|
|||||||
setTimeout(function () {
|
setTimeout(function () {
|
||||||
$('.page-loader').fadeOut();
|
$('.page-loader').fadeOut();
|
||||||
}, 50);
|
}, 50);
|
||||||
|
} catch (loadingError) {
|
||||||
|
setLoadingText("Error occurred, see Developer Console (Ctrl+Shift+I) - Please report this: " + loadingError);
|
||||||
|
setTimeout(function () {
|
||||||
|
$('.page-loader').fadeOut();
|
||||||
|
}, 10000);
|
||||||
|
throw loadingError;
|
||||||
|
}
|
||||||
|
|
||||||
function openFunc(i) {
|
function openFunc(i) {
|
||||||
return function () {
|
return function () {
|
||||||
|
@ -737,6 +737,7 @@
|
|||||||
<script src="js/player-values.js"></script>
|
<script src="js/player-values.js"></script>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
try {
|
||||||
setLoadingText('Loading player values..');
|
setLoadingText('Loading player values..');
|
||||||
jsonRequest("../v1/player?player=${playerName}", function (json, error) {
|
jsonRequest("../v1/player?player=${playerName}", function (json, error) {
|
||||||
loadPlayerOverviewValues(json, error);
|
loadPlayerOverviewValues(json, error);
|
||||||
@ -798,6 +799,13 @@
|
|||||||
setTimeout(function () {
|
setTimeout(function () {
|
||||||
$('.page-loader').fadeOut();
|
$('.page-loader').fadeOut();
|
||||||
}, 50);
|
}, 50);
|
||||||
|
} catch (loadingError) {
|
||||||
|
setLoadingText("Error occurred, see Developer Console (Ctrl+Shift+I) - Please report this: " + loadingError);
|
||||||
|
setTimeout(function () {
|
||||||
|
$('.page-loader').fadeOut();
|
||||||
|
}, 10000);
|
||||||
|
throw loadingError;
|
||||||
|
}
|
||||||
|
|
||||||
function openFunc(i) {
|
function openFunc(i) {
|
||||||
return function () {
|
return function () {
|
||||||
|
@ -271,6 +271,7 @@
|
|||||||
<script src="js/color-selector.js"></script>
|
<script src="js/color-selector.js"></script>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
try {
|
||||||
jsonRequest("../v1/players", function (playersTableJson, error) {
|
jsonRequest("../v1/players", function (playersTableJson, error) {
|
||||||
if (playersTableJson) {
|
if (playersTableJson) {
|
||||||
$('.player-table').DataTable({
|
$('.player-table').DataTable({
|
||||||
@ -286,6 +287,13 @@
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
} catch (loadingError) {
|
||||||
|
window.alert("Error occurred, see Developer Console (Ctrl+Shift+I) - Please report this: " + loadingError);
|
||||||
|
setTimeout(function () {
|
||||||
|
$('.page-loader').fadeOut();
|
||||||
|
}, 10000);
|
||||||
|
throw loadingError;
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
|
@ -1290,6 +1290,7 @@
|
|||||||
<script src="js/server-values.js"></script>
|
<script src="js/server-values.js"></script>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
try {
|
||||||
var x = document.getElementById("content");
|
var x = document.getElementById("content");
|
||||||
|
|
||||||
setLoadingText('Calculating values..');
|
setLoadingText('Calculating values..');
|
||||||
@ -1607,6 +1608,13 @@
|
|||||||
setTimeout(function () {
|
setTimeout(function () {
|
||||||
$('.page-loader').fadeOut();
|
$('.page-loader').fadeOut();
|
||||||
}, 50);
|
}, 50);
|
||||||
|
} catch (loadingError) {
|
||||||
|
setLoadingText("Error occurred, see Developer Console (Ctrl+Shift+I) - Please report this: " + loadingError);
|
||||||
|
setTimeout(function () {
|
||||||
|
$('.page-loader').fadeOut();
|
||||||
|
}, 10000);
|
||||||
|
throw loadingError;
|
||||||
|
}
|
||||||
|
|
||||||
function openPageFunc() {
|
function openPageFunc() {
|
||||||
var navButtons = document.getElementsByClassName("nav-button");
|
var navButtons = document.getElementsByClassName("nav-button");
|
||||||
|
Loading…
Reference in New Issue
Block a user