server/admin/static/check_import.html

53 lines
1.9 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<title>Rapport d'import FIC</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="css/bootstrap.min.css">
<style>li:hover { background: lightgrey; }
</style>
<script type="text/javascript">
function disp(data) {
if (data["_updated"]) {
document.getElementById("date_imp").innerHTML = new Intl.DateTimeFormat(undefined, {weekday: 'long', year: 'numeric', month: 'long', day: 'numeric', hour: 'numeric', minute: 'numeric', second: 'numeric'}).format(new Date(data["_updated"][data["_updated"].length - 1]));
}
data.themes["_ALL"] = data._themes;
Object.keys(data.themes).map(function(theme) {
if (data.themes[theme] != null && theme != "_date") {
var title = document.createElement("h3");
title.id = theme;
title.innerHTML = theme;
document.getElementById("content").appendChild(title);
var row = document.createElement("ul");
row.type = "square";
for (var i = 0; i < data.themes[theme].length; i++) {
var col = document.createElement("li");
col.innerHTML = data.themes[theme][i];
row.appendChild(col);
}
document.getElementById("content").appendChild(row);
document.getElementById("content").appendChild(document.createElement("hr"));
}
});
}
</script>
</head>
<body class="container">
<h1>Rapport d'import FIC</h1>
<p>
<strong>Date du dernier import&nbsp;:</strong> <span id="date_imp"></span>
</p>
<div id="content"></div>
<script type="text/javascript">
fetch('full_import_report.json')
.then(function(response) {
return response.json();
})
.then(function(report) {
disp(report);
});
</script>
</body>
</html>