You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@archiva.apache.org by ol...@apache.org on 2012/03/12 23:26:46 UTC

svn commit: r1299909 - in /archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva: general-admin.js templates/general-admin.html

Author: olamy
Date: Mon Mar 12 22:26:46 2012
New Revision: 1299909

URL: http://svn.apache.org/viewvc?rev=1299909&view=rev
Log:
[MRM-1580] system status page button to refresh all stats.

Modified:
    archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/general-admin.js
    archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/general-admin.html

Modified: archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/general-admin.js
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/general-admin.js?rev=1299909&r1=1299908&r2=1299909&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/general-admin.js (original)
+++ archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/general-admin.js Mon Mar 12 22:26:46 2012
@@ -593,6 +593,8 @@ $(function() {
     return [];
   }
 
+
+
   displayCacheEntries=function(){
     var divContent = $("#main-content #status_caches");
     divContent.html(smallSpinnerImg());
@@ -684,6 +686,32 @@ $(function() {
     });
   }
 
+  displayQueueEntries=function(){
+    var divContent = $("#main-content #status_queues");
+    divContent.html(smallSpinnerImg());
+    $.ajax("restServices/archivaServices/systemStatusService/queueEntries", {
+        type: "GET",
+        success: function(data){
+          var queueEntries=mapQueueEntries(data);
+          divContent.html($("#status_queues_tmpl" ).tmpl({queueEntries: queueEntries}));
+        }
+    });
+  }
+
+  displayServerTime=function(){
+    var divContent = $("#main-content #status_current_time");
+    divContent.html(smallSpinnerImg());
+    $.ajax("restServices/archivaServices/systemStatusService/currentServerTime/"+encodeURIComponent(usedLang()), {
+        type: "GET",
+        dataType: "text",
+        success: function(data){
+          var curTime=data;
+          $.log("currentServerTime:"+curTime);
+          divContent.html(curTime);
+        }
+    });
+  }
+
   displaySystemStatus=function(){
     screenChange();
     var mainContent=$("#main-content");
@@ -695,29 +723,22 @@ $(function() {
 
     displayMemoryUsage();
 
-    $.ajax("restServices/archivaServices/systemStatusService/currentServerTime/"+encodeURIComponent(usedLang()), {
-        type: "GET",
-        dataType: "text",
-        success: function(data){
-          var curTime=data;
-          $.log("currentServerTime:"+curTime);
-          mainContent.find("#status_current_time").html(curTime);
-        }
-    });
+    displayServerTime();
 
-    $.ajax("restServices/archivaServices/systemStatusService/queueEntries", {
-        type: "GET",
-        success: function(data){
-          var queueEntries=mapQueueEntries(data);
-          mainContent.find("#status_queues").html($("#status_queues_tmpl" ).tmpl({queueEntries: queueEntries}));
-        }
-    });
+    displayQueueEntries();
 
     displayScanningStats();
 
     displayCacheEntries();
   }
 
+  refreshSystemStatus=function(){
+    displayCacheEntries();
+    displayScanningStats();
+    displayMemoryUsage();
+    displayQueueEntries();
+    displayServerTime();
+  }
 
 
 });
\ No newline at end of file

Modified: archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/general-admin.html
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/general-admin.html?rev=1299909&r1=1299908&r2=1299909&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/general-admin.html (original)
+++ archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/general-admin.html Mon Mar 12 22:26:46 2012
@@ -312,7 +312,7 @@
 <script id="system-status-main" type="text/html">
 
   <div class="page-header">
-    <h3>${$.i18n.prop('system-status.header.main')}</h3>
+    <h3>${$.i18n.prop('system-status.header.main')}&nbsp;<a href="#" onclick="refreshSystemStatus()"><img src="images/view-refresh-22-22.png"/></a></h3>
   </div>
   <div class="page-header">
     <h4>${$.i18n.prop('system-status.header.queues')}</h4>