Add single-user Apache bandwidth report on front page
[bpt/portal.git] / portal.mlt
index 3492692..7fb59ee 100644 (file)
@@ -1,5 +1,6 @@
 <% val you = Init.getUser();
 val bal = Balance.lookupBalance (#bal you);
+val deposit = Balance.depositAmount (#id bal);
 @header [] %>
 
 <% @payment [] %>
@@ -12,7 +13,10 @@ val bal = Balance.lookupBalance (#bal you);
 <tr> <td><% #d trn %></td> <td><a href="money?trn=<% #id trn %>"><% Web.html (#descr trn) %></a></td> <td><% amount %>/<% #amount trn %></td> </tr>
 <% end %>
 </table>
-<b>Balance: $<% #amount bal %></b>
+<b>Balance: $<% Util.sub (#amount bal, deposit) %></b><br>
+<b>Deposit: $<% deposit %></b> (3 months of dues at the minimal <a href="pledge">pledge level</a>)
+
+<!--b>Balance: $<% #amount bal %></b-->
 
 <% val polls = Poll.listCurrentPolls ();
 switch polls of
@@ -42,4 +46,15 @@ end %>
 <% end
 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 [] %>