Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono-tools.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiguel de Icaza <miguel@gnome.org>2008-12-19 23:52:08 +0300
committerMiguel de Icaza <miguel@gnome.org>2008-12-19 23:52:08 +0300
commit15c77f311fa430004010b2d3f455165b358fbeae (patch)
treee084def20322923b5446fb06eb27c0ff54c04a5c /webcompare
parent7ec3d023f856ff6a7dc95c9018c6100fb9be8af5 (diff)
2008-12-19 Miguel de Icaza <miguel@novell.com>
* status.aspx: Display how long ago the assemblies were updated. svn path=/trunk/mono-tools/; revision=121887
Diffstat (limited to 'webcompare')
-rw-r--r--webcompare/ChangeLog4
-rw-r--r--webcompare/Global.asax5
-rw-r--r--webcompare/status.aspx32
3 files changed, 33 insertions, 8 deletions
diff --git a/webcompare/ChangeLog b/webcompare/ChangeLog
index 3fb6d768..44f55a0b 100644
--- a/webcompare/ChangeLog
+++ b/webcompare/ChangeLog
@@ -1,3 +1,7 @@
+2008-12-19 Miguel de Icaza <miguel@novell.com>
+
+ * status.aspx: Display how long ago the assemblies were updated.
+
2008-12-18 Miguel de Icaza <miguel@novell.com>
* Global.asax: Trigger an update if the files change on disk.
diff --git a/webcompare/Global.asax b/webcompare/Global.asax
index 0cdc1969..664e1669 100644
--- a/webcompare/Global.asax
+++ b/webcompare/Global.asax
@@ -18,6 +18,11 @@ public class CompareParameters {
}
}
+ static public DateTime GetAssemblyTime (CompareParameters cp)
+ {
+ return timestamp [cp];
+ }
+
public CompareParameters (NameValueCollection nvc)
{
Assembly = nvc ["assembly"] ?? "mscorlib";
diff --git a/webcompare/status.aspx b/webcompare/status.aspx
index 65d10442..6195b3ff 100644
--- a/webcompare/status.aspx
+++ b/webcompare/status.aspx
@@ -131,12 +131,25 @@ public void Page_Load ()
//TreeNode tn = new TreeNode (n.name);
//TreeNode tn = new TreeNode ("<div class='ok'></div>" + n.name);
+ tree.Nodes.Clear ();
TreeNode tn = new TreeNode (GetStatus (n), n.Name);
tn.SelectAction = TreeNodeSelectAction.None;
tn.PopulateOnDemand = true;
tree.Nodes.Add (tn);
- tree.Visible = true;
+ var diff = DateTime.Now - global_asax.CompareParameters.GetAssemblyTime (cp);
+ string t;
+ if (diff.Days > 1)
+ t = String.Format ("{0} days", diff.Days);
+ else if (diff.Hours > 2)
+ t = String.Format ("{0} hours", diff.Hours);
+ else if (diff.Minutes > 2)
+ t = String.Format ("{0} minutes", diff.Minutes);
+ else
+ t = String.Format ("{0} seconds", diff.Seconds);
+
+ time_label.Text = String.Format ("Assembly last updated: {0} ago", t);
+ activediv.Visible = true;
}
static string GetTodo (ComparisonNode cn)
@@ -346,8 +359,8 @@ void TreeNodePopulate (object sender, TreeNodeEventArgs e)
</script>
<body>
- <%=DateTime.Now %>
-
+ Page generated at: <%=DateTime.Now %>
+ <p>
<form id="form" runat="server">
<div>
<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
@@ -356,11 +369,14 @@ void TreeNodePopulate (object sender, TreeNodeEventArgs e)
<div runat="server" id="waitdiv">
<img src="wait.gif" runat="server" enableviewstate="false" /> Loading and Comparing...
</div>
- <asp:TreeView ID="tree" Runat="server" OnTreeNodePopulate="TreeNodePopulate"
- EnableClientScript="true"
- PopulateNodesFromClient="true"
- ExpandDepth="1">
- </asp:TreeView>
+ <div runat="server" id="activediv" >
+ <asp:Label id="time_label" runat="server"/>
+ <asp:TreeView ID="tree" Runat="server" OnTreeNodePopulate="TreeNodePopulate"
+ EnableClientScript="true"
+ PopulateNodesFromClient="true"
+ ExpandDepth="1">
+ </asp:TreeView>
+ </div>
</ContentTemplate>
</asp:UpdatePanel>
</div>