accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bil...@apache.org
Subject svn commit: r1451208 - in /accumulo/trunk/server/src/main: java/org/apache/accumulo/server/monitor/servlets/VisServlet.java resources/web/vis.js
Date Thu, 28 Feb 2013 14:19:15 GMT
Author: billie
Date: Thu Feb 28 14:19:15 2013
New Revision: 1451208

URL: http://svn.apache.org/r1451208
Log:
ACCUMULO-1127 added option to disable motion in server activity monitor

Modified:
    accumulo/trunk/server/src/main/java/org/apache/accumulo/server/monitor/servlets/VisServlet.java
    accumulo/trunk/server/src/main/resources/web/vis.js

Modified: accumulo/trunk/server/src/main/java/org/apache/accumulo/server/monitor/servlets/VisServlet.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/server/src/main/java/org/apache/accumulo/server/monitor/servlets/VisServlet.java?rev=1451208&r1=1451207&r2=1451208&view=diff
==============================================================================
--- accumulo/trunk/server/src/main/java/org/apache/accumulo/server/monitor/servlets/VisServlet.java
(original)
+++ accumulo/trunk/server/src/main/java/org/apache/accumulo/server/monitor/servlets/VisServlet.java
Thu Feb 28 14:19:15 2013
@@ -176,7 +176,8 @@ public class VisServlet extends BasicSer
         .append(">80</option></select></span>\n");
     // motion select box
     sb.append("&nbsp;&nbsp<span class='viscontrol'>Motion: <select id='motion'
onchange='setMotion(this)'>");
-    addOptions(sb, cfg.motion);
+    sb.append("<option selected='true'></option>");
+    addOptions(sb, null);
     sb.append("</select></span>\n");
     // color select box
     sb.append("&nbsp;&nbsp<span class='viscontrol'>Color: <select id='color'
onchange='setColor(this)'>");

Modified: accumulo/trunk/server/src/main/resources/web/vis.js
URL: http://svn.apache.org/viewvc/accumulo/trunk/server/src/main/resources/web/vis.js?rev=1451208&r1=1451207&r2=1451208&view=diff
==============================================================================
--- accumulo/trunk/server/src/main/resources/web/vis.js (original)
+++ accumulo/trunk/server/src/main/resources/web/vis.js Thu Feb 28 14:19:15 2013
@@ -47,6 +47,7 @@ canvas.addEventListener('click', goToSer
 var main = document.getElementById('main');
 var speedStatType;
 var colorStatType;
+var speedDisabled = true;
 var useCircles = true;
 setShape(document.getElementById('shape'));
 setSize(document.getElementById('size'));
@@ -178,7 +179,7 @@ function drawDots() {
       strokeDot(x,y,maxDotRadius-1,deadColor);
       continue;
     }
-    if (Math.floor(dots[i].size) > maxDotRadius) {
+    if (speedDisabled || Math.floor(dots[i].size) > maxDotRadius) {
       // check for resize by the user
       dots[i].size = maxDotRadius;
     } else if (server[speedStatType]<=0) {
@@ -325,7 +326,12 @@ function setSize(obj) {
 
 // callback for motion selection
 function setMotion(obj) {
-  var i = 0;
+  if (obj.selectedIndex==0) {
+    speedDisabled = true;
+    setState();
+    return;
+  }
+  var i = 1;
   for (var s in statNames) {
     if (i==obj.selectedIndex) {
       speedStatType = s;
@@ -333,6 +339,7 @@ function setMotion(obj) {
     }
     i++;
   }
+  speedDisabled = false;
   setState();
 }
 
@@ -383,7 +390,7 @@ function showId(e) {
 }
 
 function setState() {
-  var url = visurl+'?shape='+(useCircles?'circles':'squares')+'&size='+(dotSpacing*2)+'&motion='+speedStatType+'&color='+colorStatType;
+  var url = visurl+'?shape='+(useCircles?'circles':'squares')+'&size='+(dotSpacing*2)+(speedDisabled
? '' : '&motion='+speedStatType)+'&color='+colorStatType;
   window.history.replaceState(window.history.state,'Server Activity',url);
 }
 



Mime
View raw message