Update of /cvsroot/hcoop/portal
In directory sc8-pr-cvs17.sourceforge.net:/tmp/cvs-serv28161

Modified Files:
        portal.mlt stats.sig stats.sml 
Log Message:
Add single-user Apache bandwidth report on front page

Index: stats.sig
===================================================================
RCS file: /cvsroot/hcoop/portal/stats.sig,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** stats.sig   9 Dec 2007 21:21:02 -0000       1.3
--- stats.sig   24 Apr 2008 19:28:07 -0000      1.4
***************
*** 13,16 ****
--- 13,19 ----
       * totals. *)
  
+     val getWebbwUser : {user : string, last : int} -> {total : int,
+                                                      vhosts : {host : host, 
size : int} list}
+ 
      type disk = {uname : string, (* UNIX username *)
                 kbs : int}      (* Number of kilobytes space used *)

Index: stats.sml
===================================================================
RCS file: /cvsroot/hcoop/portal/stats.sml,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** stats.sml   9 Dec 2007 21:45:20 -0000       1.5
--- stats.sml   24 Apr 2008 19:28:07 -0000      1.6
***************
*** 90,94 ****
         end
  
!     type disk = {uname : string,
                 kbs : int}
  
--- 90,105 ----
         end
  
!    fun getWebbwUser {user, last} =
!        let
!          val {vhosts, users, ...} = getWebbw last
!        in
!          case List.find (fn {user = u, ...} => u = user) users of
!              NONE => {total = 0, vhosts = []}
!            | SOME {hosts, size, ...} =>
!              {total = size, vhosts = List.filter (fn {host, ...} => 
List.exists (fn host' => host' = host) hosts) vhosts}
!        end
!          
! 
!    type disk = {uname : string,
                 kbs : int}
  

Index: portal.mlt
===================================================================
RCS file: /cvsroot/hcoop/portal/portal.mlt,v
retrieving revision 1.19
retrieving revision 1.20
diff -C2 -d -r1.19 -r1.20
*** portal.mlt  1 Mar 2008 19:30:52 -0000       1.19
--- portal.mlt  24 Apr 2008 19:28:07 -0000      1.20
***************
*** 47,49 ****
--- 47,60 ----
  end;
  
+ val {total, vhosts} = Stats.getWebbwUser {user = Init.getUserName (), last = 
0};
+ switch vhosts of
+        _ :: _ =>
+        %><h3>Your web traffic this month</h3>
+        <table><tr><th>Site</th> <th>Data transferred (kB)</th></tr><%
+        foreach e in vhosts do %>
+                      <tr><td align="right"><a href="<% if #ssl (#host e) then 
%>https<% else %>http<% end %>://<% #hostname (#host e) %>/"><% #hostname 
(#host e) %><% if #ssl (#host e) then %> (SSL)<% end %></a> <a 
href="/webalizer/<% #id (#host e) %>/">[detail]</a></td><td><% #size e 
%></td></tr>
+        <% end %>
+        </table>
+ <% end;
+ 
  @footer [] %>


-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
hcoop-cvs mailing list
hcoop-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/hcoop-cvs

Reply via email to