admin: Fix sync report display

This commit is contained in:
nemunaire 2022-10-30 19:44:31 +01:00
parent cea3c13369
commit adebdd180d
2 changed files with 45 additions and 24 deletions

View File

@ -8,28 +8,29 @@
</style>
<script type="text/javascript">
function disp(data) {
if (data["_date"]) {
document.getElementById("date_imp").innerHTML = data["_date"][data["_date"].length - 1];
}
Object.keys(data).map(function(theme) {
if (data[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[theme].length; i++) {
var col = document.createElement("li");
col.innerHTML = data[theme][i];
row.appendChild(col);
}
document.getElementById("content").appendChild(row);
document.getElementById("content").appendChild(document.createElement("hr"));
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">

View File

@ -19,8 +19,8 @@
<h3 class="mb-0">
Import des thèmes
</h3>
<div class="badge badge-success align-self-center" ng-if="syncReport">
Dernier import&nbsp;: {{ syncReport._date[1] }}
<div class="badge badge-success align-self-center" ng-if="syncReport" title="{{ syncReport._updated[syncReport._updated.length-1] }}">
Dernier import&nbsp;: {{ syncReport._updated[syncReport._updated.length-1] | date:"medium" }}
</div>
</div>
<div class="progress" style="height: 5px; border-radius: 0;">
@ -68,7 +68,27 @@
Dernier rapport de synchronisation
</h3>
</div>
<div ng-repeat="(th, line) in syncReport" class="card-body" ng-if="th !== '_date' && line.length">
<div class="card-body" ng-if="syncReport._regeneration.length">
<div class="d-flex">
<h3>
Génération
</h3>
</div>
<ul>
<li ng-repeat="item in syncReport._regeneration" class="text-break">{{ item }}</li>
</ul>
</div>
<div class="card-body" ng-if="syncReport._themes.length">
<div class="d-flex">
<h3>
Général
</h3>
</div>
<ul>
<li ng-repeat="item in syncReport._themes" class="text-break">{{ item }}</li>
</ul>
</div>
<div ng-repeat="(th, line) in syncReport.themes" class="card-body" ng-if="line.length">
<div class="d-flex">
<h3>
{{ th }}