Return-Path: Delivered-To: apmail-felix-commits-archive@www.apache.org Received: (qmail 76437 invoked from network); 24 Sep 2009 14:34:08 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 24 Sep 2009 14:34:08 -0000 Received: (qmail 84564 invoked by uid 500); 24 Sep 2009 14:34:08 -0000 Delivered-To: apmail-felix-commits-archive@felix.apache.org Received: (qmail 84498 invoked by uid 500); 24 Sep 2009 14:34:08 -0000 Mailing-List: contact commits-help@felix.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@felix.apache.org Delivered-To: mailing list commits@felix.apache.org Received: (qmail 84489 invoked by uid 99); 24 Sep 2009 14:34:08 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 24 Sep 2009 14:34:08 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 24 Sep 2009 14:33:56 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id E1715238890B; Thu, 24 Sep 2009 14:33:35 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r818495 - /felix/trunk/webconsole-plugins/event/src/main/resources/res/ui/events.js Date: Thu, 24 Sep 2009 14:33:35 -0000 To: commits@felix.apache.org From: cziegeler@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20090924143335.E1715238890B@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: cziegeler Date: Thu Sep 24 14:33:35 2009 New Revision: 818495 URL: http://svn.apache.org/viewvc?rev=818495&view=rev Log: FELIX-1607 - First version of a timeline. Modified: felix/trunk/webconsole-plugins/event/src/main/resources/res/ui/events.js 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=818495&r1=818494&r2=818495&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 Thu Sep 24 14:33:35 2009 @@ -14,6 +14,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +var view = 0; + function renderStatusLine() { $("#plugin_content").append( "
" ); } @@ -43,6 +45,13 @@ entry( eventData.data[idx] ); } $("#plugin_table").trigger("update"); + if ( view == 1 ) { + $("#timeline").remove(); + $("div.table").append( "
" ); + for ( var idx in eventData.data ) { + entryTimeline( eventData.data[idx] ); + } + } } function entry( /* Object */ dataEntry ) { @@ -51,16 +60,23 @@ $("#plugin_table > tbody").append(trElement); } +function entryTimeline( /* Object */ dataEntry ) { + var txt = "
"; + txt = txt + "" + dataEntry.topic + " "; + if ( dataEntry.info ) { + txt = txt + dataEntry.info; + } + txt = txt + "
"; + $("#timeline").append(txt); +} function entryInternal( /* Element */ parent, /* Object */ dataEntry ) { var id = dataEntry.id; var topic = dataEntry.topic; var properties = dataEntry.properties; - var styleClass = dataEntry.category; - if ( styleClass.length == 0 ) styleClass = null; else styleClass = "event" + styleClass; - parent.appendChild( td( styleClass, null, [ text( printDate(dataEntry.received) ) ] ) ); - parent.appendChild( td( styleClass, null, [ text( topic ) ] ) ); + parent.appendChild( td( null, null, [ text( printDate(dataEntry.received) ) ] ) ); + parent.appendChild( td( null, null, [ text( topic ) ] ) ); var propE; if ( dataEntry.info ) { @@ -71,10 +87,10 @@ tableE.appendChild(bodyE); for( var p in dataEntry.properties ) { - var c1 = td(styleClass, null, [text(p)]); + var c1 = td(null, null, [text(p)]); $(c1).css("border", "0px none"); $(c1).css("padding", "0 4px 0 0"); - var c2 = td(styleClass, null, [text(dataEntry.properties[p])]); + var c2 = td(null, null, [text(dataEntry.properties[p])]); $(c2).css("border", "0px none"); $(c2).css("padding", "0 0 0 4px"); bodyE.appendChild(tr(null, null, [ c1, c2 ])); @@ -82,7 +98,7 @@ propE = tableE; } - parent.appendChild( td( styleClass, null, [propE] ) ); + parent.appendChild( td( null, null, [propE] ) ); } /* displays a date in the user's local timezone */ @@ -97,15 +113,32 @@ }, "json"); } +function switchView() { + if ( view == 0 ) { + view = 1; + $("#plugin_table").hide(); + $(".switchButton").empty(); + $(".switchButton").append("List"); + loadData(); + } else { + view = 0; + $("#timeline").remove(); + $("#plugin_table").show(); + $(".switchButton").empty(); + $(".switchButton").append("Timeline"); + } +} function renderEvents() { $(document).ready(function(){ renderView( ["Received", "Topic", "Properties"], + "" + "" + ""); loadData(); $("#plugin_table").tablesorter(); $(".reloadButton").click(loadData); + $(".switchButton").click(switchView); $(".clearButton").click(function () { $("#plugin_table > tbody > tr").remove(); $.post(pluginRoot, { "action":"clear" }, function(data) {