diff options
author | Gonzalo Paniagua Javier <gonzalo.mono@gmail.com> | 2009-04-13 07:36:37 +0400 |
---|---|---|
committer | Gonzalo Paniagua Javier <gonzalo.mono@gmail.com> | 2009-04-13 07:36:37 +0400 |
commit | 93cd143b30dbcafa42f23eb8a9e9bcd942e11b3d (patch) | |
tree | 7fd5c48ba75fbcce168ee21fdc8adcfa4476a445 | |
parent | ac673c874a3ca2c3dfdb31b4d63c187ac13c14ba (diff) |
2009-04-12 Gonzalo Paniagua Javier <gonzalo@novell.com>
* main.css:
* App_Code/NodeUtils.cs:
* status.aspx: display the the total counts of everything we compare
for a given assembly.
svn path=/trunk/mono-tools/; revision=131559
-rw-r--r-- | webcompare/App_Code/NodeUtils.cs | 15 | ||||
-rw-r--r-- | webcompare/ChangeLog | 7 | ||||
-rw-r--r-- | webcompare/main.css | 16 | ||||
-rw-r--r-- | webcompare/status.aspx | 67 |
4 files changed, 101 insertions, 4 deletions
diff --git a/webcompare/App_Code/NodeUtils.cs b/webcompare/App_Code/NodeUtils.cs index 563f976d..e597055a 100644 --- a/webcompare/App_Code/NodeUtils.cs +++ b/webcompare/App_Code/NodeUtils.cs @@ -224,6 +224,21 @@ public class NodeUtils { return node.Children; } + public List<KeyValuePair<int, int>> GetTotals () + { + List<KeyValuePair<int, int>> totals = new List<KeyValuePair<int, int>> (); + using (IDbConnection cnc = GetConnection ()) { + IDbCommand cmd = cnc.CreateCommand (); + cmd.CommandText = "SELECT comparison_type, COUNT(*) FROM nodes WHERE master_id = " + MasterID + " GROUP BY comparison_type ORDER BY comparison_type"; + using (IDataReader reader = cmd.ExecuteReader ()) { + while (reader.Read ()) { + totals.Add (new KeyValuePair<int,int> (Convert.ToInt32 (reader [0]), Convert.ToInt32 (reader [1]))); + } + } + } + return totals; + } + static IDataParameter AddParameter (IDbCommand cmd, string name, object val) { IDataParameter p = cmd.CreateParameter (); diff --git a/webcompare/ChangeLog b/webcompare/ChangeLog index 709150ee..2d5ee1cd 100644 --- a/webcompare/ChangeLog +++ b/webcompare/ChangeLog @@ -1,3 +1,10 @@ +2009-04-12 Gonzalo Paniagua Javier <gonzalo@novell.com> + + * main.css: + * App_Code/NodeUtils.cs: + * status.aspx: display the the total counts of everything we compare + for a given assembly. + 2009-04-11 Gonzalo Paniagua Javier <gonzalo@novell.com> * db/init-db.mysql: retrieve the last_updated field from the DB. diff --git a/webcompare/main.css b/webcompare/main.css index 39f2fd6e..51012de6 100644 --- a/webcompare/main.css +++ b/webcompare/main.css @@ -95,6 +95,7 @@ a:active { color:#ccf; text-decoration: none; } #treeview { float: left; } + #detaillevel { float: right; margin: 20px 20px 20px 20px; @@ -106,3 +107,18 @@ a:active { color:#ccf; text-decoration: none; } padding: 1em; } +#counts { + float: right; + margin-top: 20px; + border-width: 1px 1px 2px 2px; + border-color: #4c83c4; + border-style: solid; +} + +.item { + background-color: #ddd; +} + +.alternatingitem { + background-color: #FFF; +} diff --git a/webcompare/status.aspx b/webcompare/status.aspx index c024149a..1c8cb3a4 100644 --- a/webcompare/status.aspx +++ b/webcompare/status.aspx @@ -3,7 +3,7 @@ <%@ Import Namespace="System.Collections.Generic" %> <%@ Import Namespace="System.Collections.Specialized" %> <%@ Import Namespace="GuiCompare" %> -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html> <script runat="server" language="c#"> const string ImageMissing = "<img src='images/sm.gif' border=0 align=absmiddle title='Missing'>"; @@ -82,11 +82,15 @@ public void Page_Load () tree.Visible = false; tree.Enabled = false; time_label.Text = "No data available for " + - HttpUtility.HtmlEncode (String.Format ("Mono <b>{1}</b> in {0} vs MS.NET {2}", - Parameters.InfoDir, Parameters.Assembly, Parameters.Profile)); + String.Format ("Mono <b>{1}</b> in {0} vs MS.NET {2}", + HttpUtility.HtmlEncode (Parameters.InfoDir), + HttpUtility.HtmlEncode (Parameters.Assembly), + HttpUtility.HtmlEncode (Parameters.Profile)); return; } + tbl_counts.DataSource = GetTotals (); + tbl_counts.DataBind (); TreeNode tn = new TreeNode (GetStatus (n), n.InternalID.ToString ()); tn.SelectAction = TreeNodeSelectAction.None; tn.PopulateOnDemand = true; @@ -355,8 +359,37 @@ void OnLevelChanged (object sender, EventArgs args) Response.Redirect (url); } +static string GetCompTypeName (int comp_type) +{ + switch (comp_type) { + case 1: return "Namespaces"; + case 2: return "Attributes"; + case 3: return "Interfaces"; + case 4: return "Classes"; + case 5: return "Structs"; + case 6: return "Enums"; + case 7: return "Methods"; + case 8: return "Properties"; + case 9: return "Fields"; + case 10: return "Delegates"; + case 11: return "Events"; + default: return ""; + } +} + +object [] GetTotals () +{ + List<KeyValuePair<int,int>> kvs = DB.GetTotals (); + int count = kvs.Count; + object [] result = new object [count - 1]; + for (int i = 1; i < count; i++) { + KeyValuePair<int, int> kv = kvs [i]; + result [i - 1] = new { Name = GetCompTypeName (kv.Key), Value = kv.Value }; + } + return result; +} + </script> -<html> <head id="head1" runat="server"> <title>Mono API Compare</title> <link href="main.css" media="screen" type="text/css" rel="stylesheet"> @@ -377,6 +410,32 @@ void OnLevelChanged (object sender, EventArgs args) ExpandDepth="1"> </asp:TreeView> </div> + <div id="counts"> + <asp:ListView runat="server" id="tbl_counts"> + <LayoutTemplate> + <table border="0" cellpadding="0" cellspacing="0"> + <caption style="background-color: #4c83c4; color: #fff"><b>Mono Totals<b></caption> + <asp:PlaceHolder runat="server" id="itemPlaceholder" /> + </table> + </LayoutTemplate> + <ItemTemplate> + <tr class="item"> + <td><%# DataBinder.Eval (Container.DataItem, "Name") %> + </td> + <td style="text-align: right"><%# DataBinder.Eval (Container.DataItem, "Value") %> + </td> + </tr> + </ItemTemplate> + <AlternatingItemTemplate> + <tr class="item alternatingitem"> + <td><%# DataBinder.Eval (Container.DataItem, "Name") %> + </td> + <td style="text-align: right"><%# DataBinder.Eval (Container.DataItem, "Value") %> + </td> + </tr> + </AlternatingItemTemplate> + </asp:ListView> + </div> <div id="detaillevel"> <div style="font-weight: bold; margin-bottom: 0.5em; text-align: center;">Detail Level</div> <asp:RadioButtonList id="dlevel" runat="server" |