X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fresources%2Ftemplates%2Finclude%2FviewSone.html;h=896f670e8500ce62fc5853ee3ca65398a8e85bb0;hb=dd6c6a0cd8e75ff556038de771f577156ec0af79;hp=af7c8be976e96dcf7400381e8fefba288a34e4be;hpb=dfdfe62269b1abc712aeffb3f5940b57c99d9e3a;p=Sone.git diff --git a/src/main/resources/templates/include/viewSone.html b/src/main/resources/templates/include/viewSone.html index af7c8be..896f670 100644 --- a/src/main/resources/templates/include/viewSone.html +++ b/src/main/resources/templates/include/viewSone.html @@ -2,25 +2,37 @@ function getStatus(soneId) { $.getJSON("ajax/getSoneStatus.ajax", {"sone": soneId}, function(data, textStatus) { - updateStatus(soneId, data.status, data.modified); + updateStatus(soneId, data.status, data.modified, data.lastUpdated); setTimeout(function() { getStatus(soneId); }, 5000); }); } - function updateStatus(soneId, status, modified) { + function updateStatus(soneId, status, modified, lastUpdated) { $("#sone .sone#" + soneId). toggleClass("unknown", status == "unknown"). toggleClass("idle", status == "idle"). toggleClass("inserting", status == "inserting"). toggleClass("downloading", status == "downloading"). toggleClass("modified", modified); + $("#sone .sone#" + soneId + " .last-update span.time").text(lastUpdated); } + registeredSones = {}; + $(document).ready(function() { $("#sone .sone").each(function() { - getStatus($(this).attr("id")); + soneId = $(this).attr("id"); + if (registeredSones[soneId]) { + return; + } + registeredSones[soneId] = true; + (function(soneId) { + setTimeout(function() { + getStatus(soneId); + }, 5000); + })(soneId); }); }); @@ -31,7 +43,7 @@
⬊
⬈
✔
-
<%= View.Sone.Label.LastUpdate|l10n|html> <% sone.time|date format="MMM d, yyyy, HH:mm:ss">
+
<%= View.Sone.Label.LastUpdate|l10n|html> <% sone.time|date format="MMM d, yyyy, HH:mm:ss">
<% sone.requestUri|substring start=4 length=43|html>
<%ifnull ! currentSone>