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