felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r818849 - in /felix/trunk/webconsole-plugins/event/src/main: java/org/apache/felix/webconsole/plugins/event/internal/ resources/res/ui/
Date Fri, 25 Sep 2009 13:32:33 GMT
Author: cziegeler
Date: Fri Sep 25 13:32:32 2009
New Revision: 818849

URL: http://svn.apache.org/viewvc?rev=818849&view=rev
Log:
FELIX-1607 - Improve status info line, correct timeline display.

Modified:
    felix/trunk/webconsole-plugins/event/src/main/java/org/apache/felix/webconsole/plugins/event/internal/EventCollector.java
    felix/trunk/webconsole-plugins/event/src/main/java/org/apache/felix/webconsole/plugins/event/internal/OptionalFeaturesHandler.java
    felix/trunk/webconsole-plugins/event/src/main/java/org/apache/felix/webconsole/plugins/event/internal/PluginServlet.java
    felix/trunk/webconsole-plugins/event/src/main/resources/res/ui/events.js

Modified: felix/trunk/webconsole-plugins/event/src/main/java/org/apache/felix/webconsole/plugins/event/internal/EventCollector.java
URL: http://svn.apache.org/viewvc/felix/trunk/webconsole-plugins/event/src/main/java/org/apache/felix/webconsole/plugins/event/internal/EventCollector.java?rev=818849&r1=818848&r2=818849&view=diff
==============================================================================
--- felix/trunk/webconsole-plugins/event/src/main/java/org/apache/felix/webconsole/plugins/event/internal/EventCollector.java
(original)
+++ felix/trunk/webconsole-plugins/event/src/main/java/org/apache/felix/webconsole/plugins/event/internal/EventCollector.java
Fri Sep 25 13:32:32 2009
@@ -50,6 +50,10 @@
                 {
                     eventInfos.remove( 0 );
                 }
+                if ( this.eventInfos.size() == 1 )
+                {
+                    this.startTime = info.received;
+                }
             }
         }
     }

Modified: felix/trunk/webconsole-plugins/event/src/main/java/org/apache/felix/webconsole/plugins/event/internal/OptionalFeaturesHandler.java
URL: http://svn.apache.org/viewvc/felix/trunk/webconsole-plugins/event/src/main/java/org/apache/felix/webconsole/plugins/event/internal/OptionalFeaturesHandler.java?rev=818849&r1=818848&r2=818849&view=diff
==============================================================================
--- felix/trunk/webconsole-plugins/event/src/main/java/org/apache/felix/webconsole/plugins/event/internal/OptionalFeaturesHandler.java
(original)
+++ felix/trunk/webconsole-plugins/event/src/main/java/org/apache/felix/webconsole/plugins/event/internal/OptionalFeaturesHandler.java
Fri Sep 25 13:32:32 2009
@@ -166,6 +166,7 @@
         {
             this.unbindConfigAdmin(this.configAdminReference);
         }
+        this.plugin.setConfigAdminAvailable(true);
         this.configAdminReference = ref;
         this.configListenerRegistration = ConfigurationListener.create(this.bundleContext,
this.plugin);
     }
@@ -175,6 +176,7 @@
         if ( this.configAdminReference == ref )
         {
             this.configAdminReference = null;
+            this.plugin.setConfigAdminAvailable(false);
             if ( this.configListenerRegistration != null )
             {
                 this.configListenerRegistration.unregister();

Modified: felix/trunk/webconsole-plugins/event/src/main/java/org/apache/felix/webconsole/plugins/event/internal/PluginServlet.java
URL: http://svn.apache.org/viewvc/felix/trunk/webconsole-plugins/event/src/main/java/org/apache/felix/webconsole/plugins/event/internal/PluginServlet.java?rev=818849&r1=818848&r2=818849&view=diff
==============================================================================
--- felix/trunk/webconsole-plugins/event/src/main/java/org/apache/felix/webconsole/plugins/event/internal/PluginServlet.java
(original)
+++ felix/trunk/webconsole-plugins/event/src/main/java/org/apache/felix/webconsole/plugins/event/internal/PluginServlet.java
Fri Sep 25 13:32:32 2009
@@ -76,14 +76,6 @@
         List events = this.collector.getEvents();
 
         StringBuffer statusLine = new StringBuffer();
-        if ( this.eventAdminAvailable )
-        {
-            statusLine.append("Event Admin service is available. ");
-        }
-        else
-        {
-            statusLine.append("Event Admin service is not available. ");
-        }
         statusLine.append( events.size() );
         statusLine.append( " Event");
         if ( events.size() != 1 )
@@ -98,16 +90,22 @@
             d.setTime( ( ( EventInfo ) events.get( 0 ) ).received );
             statusLine.append( d );
         }
-        statusLine.append( "." );
+        statusLine.append( ". (Event admin: " );
+        if ( !this.eventAdminAvailable )
+        {
+            statusLine.append("un");
+        }
+        statusLine.append("available; Config admin: ");
+        if ( !this.configAdminAvailable )
+        {
+            statusLine.append("un");
+        }
+        statusLine.append("available)");
 
         // Compute scale: startTime is 0, lastTimestamp is 100%
         final long startTime = this.collector.getStartTime();
-        long endTime = (events.size() == 0 ? startTime : ((EventInfo)events.get(events.size()
- 1)).received);
-        if ( endTime == startTime )
-        {
-            endTime = startTime + 10;
-        }
-        final float scale = 100.0f / (endTime - startTime);
+        final long endTime = (events.size() == 0 ? startTime : ((EventInfo)events.get(events.size()
- 1)).received);
+        final float scale = (endTime == startTime ? 100.0f : 100.0f / (endTime - startTime));
 
         JSONWriter jw = new JSONWriter( pw );
         try
@@ -193,11 +191,13 @@
         final long msec = info.received - start;
 
         // Compute color bar size and make sure the bar is visible
-        final int percent = Math.max((int)((msec) * scale), 2);
+        final int percent = Math.max((int)(msec * scale), 2);
 
         jw.object();
         jw.key( "id" );
         jw.value( String.valueOf( index ) );
+        jw.key( "offset" );
+        jw.value( msec );
         jw.key( "width" );
         jw.value( percent );
         jw.key( "category" );
@@ -261,4 +261,9 @@
     {
         this.eventAdminAvailable = flag;
     }
+
+    public void setConfigAdminAvailable(final boolean flag)
+    {
+        this.configAdminAvailable = flag;
+    }
 }

Modified: felix/trunk/webconsole-plugins/event/src/main/resources/res/ui/events.js
URL: http://svn.apache.org/viewvc/felix/trunk/webconsole-plugins/event/src/main/resources/res/ui/events.js?rev=818849&r1=818848&r2=818849&view=diff
==============================================================================
--- felix/trunk/webconsole-plugins/event/src/main/resources/res/ui/events.js (original)
+++ felix/trunk/webconsole-plugins/event/src/main/resources/res/ui/events.js Fri Sep 25 13:32:32
2009
@@ -47,7 +47,7 @@
     $("#plugin_table").trigger("update");
     if ( view == 1 ) {
 		$("#timeline").remove();
-		$("div.table").append( "<div id='timeline'></div>" );
+		$("div.table").append( "<div id='timeline' width='100%'></div>" );
         for ( var idx in eventData.data ) {
             entryTimeline( eventData.data[idx] );
         }
@@ -61,13 +61,13 @@
 }
 
 function entryTimeline( /* Object */ dataEntry ) {
-	var txt = "<div class='event" + dataEntry.category + "' style='width:" + dataEntry.width
+ "%;'>";
-	txt = txt + "<b>" + dataEntry.topic + "</b> ";
+	var txt = "<div class='event" + dataEntry.category + "' style='overflow:visible;white-space:nowrap;width:"
+ dataEntry.width + "%;'>";
+	txt = txt + "<b>" + dataEntry.offset + "</b>&nbsp;<b>" + dataEntry.topic
+ "</b>";
 	if ( dataEntry.info ) {
-	    txt = txt + dataEntry.info;
+	    txt = txt + "&nbsp;:&nbsp;" + dataEntry.info;
 	}
     txt = txt + "</div>";
-	$("#timeline").append(txt);	
+	$("#timeline").prepend(txt);	
 }
 
 function entryInternal( /* Element */ parent, /* Object */ dataEntry ) {



Mime
View raw message