-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.js
27 lines (25 loc) · 903 Bytes
/
main.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
let releaseData = [];
let loadSuccess = false;
let apiAddress = "https://wren.ml:5000";
function loadReleaseData() {
let notice = document.getElementById("rate-notice");
$.ajax({
url: apiAddress + "/update-times/",
dataType: "json",
success: function(data) {
releaseData = data;
releaseData.forEach(function (obj) {
let name = obj['name'];
let url = obj['url'];
let date = obj['updated'];
let container = document.getElementById("data-" + name);
if (container != null) {
container.innerHTML = "<a href='" + url + "' class='pure-button pure-button-primary'>PDF (" + date + " UTC)</a>";
}
});
},
error: function() {
notice.innerHTML = "Hiba történt az adatok lekérése közben, az oldal esetleg hibásan működhet, kérlek látogass el a repositorykhoz a legújabb PDF-ekért.";
}
});
}