sync: fix report display with some security headers

This commit is contained in:
nemunaire 2019-01-19 15:12:06 +01:00
parent 50a51ba628
commit 58dbd9499b
2 changed files with 10 additions and 4 deletions

View File

@ -3,7 +3,7 @@
<head>
<title>Rapport d'import FIC</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<link rel="stylesheet" href="css/bootstrap.min.css">
<style>li:hover { background: lightgrey; }
</style>
<script type="text/javascript">
@ -38,6 +38,14 @@
<strong>Date du dernier import&nbsp;:</strong> <span id="date_imp"></span>
</p>
<div id="content"></div>
<script src="full_import_report.json"></script>
<script type="text/javascript">
fetch('full_import_report.json')
.then(function(response) {
return response.json();
})
.then(function(report) {
disp(report);
});
</script>
</body>
</html>

View File

@ -62,14 +62,12 @@ func SyncDeep(i Importer) (errs map[string][]string) {
if fdto, err := os.Create(DeepReportPath); err == nil {
defer fdto.Close()
fdto.Write([]byte("disp("))
if out, err := json.Marshal(errs); err == nil {
fdto.Write(out)
} else {
errs["_regeneration"] = append(errs["_regeneration"], err.Error())
log.Println(err)
}
fdto.Write([]byte(");"))
} else {
errs["_regeneration"] = append(errs["_regeneration"], err.Error())
log.Println(err)