admin/sync: Add last sync date into full_import_report
This commit is contained in:
parent
809d166a2d
commit
935b1666ac
@ -8,8 +8,11 @@
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
function disp(data) {
|
||||
if (data["_date"] && data["_date"].length == 2) {
|
||||
document.getElementById("date_imp").innerHTML = data["_date"][1];
|
||||
}
|
||||
Object.keys(data).map(function(theme) {
|
||||
if (data[theme] != null) {
|
||||
if (data[theme] != null && theme != "_date") {
|
||||
var title = document.createElement("h3");
|
||||
title.id = theme;
|
||||
title.innerHTML = theme;
|
||||
@ -31,6 +34,9 @@
|
||||
</head>
|
||||
<body class="container">
|
||||
<h1>Rapport d'import FIC</h1>
|
||||
<p>
|
||||
<strong>Date du dernier import :</strong> <span id="date_imp"></span>
|
||||
</p>
|
||||
<div id="content"></div>
|
||||
<script src="full_import_report.json"></script>
|
||||
</body>
|
||||
|
@ -2,8 +2,10 @@ package sync
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"log"
|
||||
"os"
|
||||
"time"
|
||||
"sync"
|
||||
|
||||
"srs.epita.fr/fic-server/libfic"
|
||||
@ -18,6 +20,7 @@ func SyncDeep(i Importer) map[string][]string {
|
||||
|
||||
errs := map[string][]string{}
|
||||
|
||||
errs["_date"] = []string{fmt.Sprintf("%v", time.Now())}
|
||||
errs["_themes"] = SyncThemes(i)
|
||||
|
||||
if themes, err := fic.GetThemes(); err == nil {
|
||||
@ -34,6 +37,8 @@ func SyncDeep(i Importer) map[string][]string {
|
||||
}
|
||||
}
|
||||
|
||||
errs["_date"] = append(errs["_date"], fmt.Sprintf("%v", time.Now()))
|
||||
|
||||
if fdto, err := os.Create("../htdocs-admin/full_import_report.json"); err == nil {
|
||||
defer fdto.Close()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user