Skip to content
Extraits de code Groupes Projets
Valider 45aad4cc rédigé par Gregor Aisch's avatar Gregor Aisch
Parcourir les fichiers

'auto commit'

parent a5440551
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -122,7 +122,7 @@ RealTimeMap.run = function(config) { ...@@ -122,7 +122,7 @@ RealTimeMap.run = function(config) {
// icons // icons
ico(r.countryFlag)+ico(r.browserIcon)+ico(r.operatingSystemIcon)+'<br/>'+ ico(r.countryFlag)+ico(r.browserIcon)+ico(r.operatingSystemIcon)+'<br/>'+
// last action // last action
(ad && ad.length ? ad[ad.length-1].pageTitle+'<br/>' : '')+ (ad && ad.length && ad[ad.length-1].pageTitle ? ad[ad.length-1].pageTitle+'<br/>' : '')+
// time of visit // time of visit
(ds < 90 ? RealTimeMap._.seconds_ago.replace('%s', '<b>'+val(ds)+'</b>') (ds < 90 ? RealTimeMap._.seconds_ago.replace('%s', '<b>'+val(ds)+'</b>')
: ds < 5400 ? RealTimeMap._.minutes_ago.replace('%s', '<b>'+val(ds/60)+'</b>') : ds < 5400 ? RealTimeMap._.minutes_ago.replace('%s', '<b>'+val(ds/60)+'</b>')
...@@ -221,9 +221,7 @@ RealTimeMap.run = function(config) { ...@@ -221,9 +221,7 @@ RealTimeMap.run = function(config) {
* If firstRun is true, the SymbolGroup is initialized * If firstRun is true, the SymbolGroup is initialized
*/ */
function refreshVisits(firstRun) { function refreshVisits(firstRun) {
ajax(_reportParams(firstRun)) function gotNewReport(report) {
.done(function(report) {
// successful request, so set timeout for next API call // successful request, so set timeout for next API call
nextReqTimer = setTimeout(refreshVisits, config.liveRefreshAfterMs); nextReqTimer = setTimeout(refreshVisits, config.liveRefreshAfterMs);
...@@ -245,6 +243,9 @@ RealTimeMap.run = function(config) { ...@@ -245,6 +243,9 @@ RealTimeMap.run = function(config) {
evt.stopPropagation(); evt.stopPropagation();
} }
}); });
// clear existing report
lastVisits = [];
} }
if (report.length) { if (report.length) {
...@@ -297,7 +298,15 @@ RealTimeMap.run = function(config) { ...@@ -297,7 +298,15 @@ RealTimeMap.run = function(config) {
} }
}); }
if (firstRun && lastVisits.length) {
// zoom changed, use cached report data
gotNewReport(lastVisits.slice());
} else {
// request API for new data
ajax(_reportParams(firstRun)).done(gotNewReport);
}
} }
/* /*
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter