mirror of
https://github.com/azures04/crafatar.git
synced 2026-03-21 23:41:18 +01:00
detect & show mojang issues
This commit is contained in:
parent
f69eb85c58
commit
882b0753bc
@ -14,15 +14,23 @@ xhr.onload = function() {
|
||||
var error = null;
|
||||
|
||||
if (textures || session && skins) {
|
||||
error = "both";
|
||||
error = "all";
|
||||
} else if (skins) {
|
||||
error = "name";
|
||||
error = "username";
|
||||
} else if (session) {
|
||||
error = "uuid";
|
||||
error = "UUID";
|
||||
}
|
||||
|
||||
console.log(error);
|
||||
if (error) {
|
||||
var warn = document.createElement("div");
|
||||
warn.setAttribute("class", "alert alert-warning");
|
||||
warn.setAttribute("role", "alert");
|
||||
warn.innerHTML = "<h5>Mojang issues</h5> Mojang's servers are having trouble <i>right now</i>, this affects <b>" + error + "</b> requests at Crafatar. <small><a href=\"https://help.mojang.com\" target=\"_blank\">check status</a>";
|
||||
document.querySelector("#alerts").appendChild(warn);
|
||||
}
|
||||
};
|
||||
|
||||
document.addEventListener("DOMContentLoaded", function(event) {
|
||||
xhr.open("GET", "https://status.mojang.com/check", true);
|
||||
xhr.send();
|
||||
});
|
||||
@ -17,6 +17,7 @@
|
||||
<meta property="og:description" content="A blazing fast Minecraft avatar API with support for avatars, skins, and 3D renders.">
|
||||
<meta name="twitter:card" content="summary">
|
||||
<meta name="twitter:creator" content="@Crafatar">
|
||||
<script src="/javascript/mojang.js"></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
@ -53,12 +54,14 @@
|
||||
</div>
|
||||
<div class="container">
|
||||
<section id="documentation">
|
||||
<div id="alerts">
|
||||
<div class="alert alert-danger" role="alert">
|
||||
<h5>Usernames are deprecated!</h5>
|
||||
You should only use usernames for <i>testing</i>.<br>
|
||||
Updates are slower, some features are not available, and it may <strong>break anytime</strong>!<br>
|
||||
<i>We strongly advise you to use UUIDs instead of usernames.</i> <small><a href="#usernames">more info</a></small>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h2>Documentation</h2>
|
||||
<div class="row">
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user