/* C source code development versions ("beta"): 0.7.9-a, 0.8.1-b, etc. */\r
/* C source code release versions: 0.8.0, 0.8.2, 0.8.4, etc. */\r
\r
-const char *stats_html_signature = "<small>Statistics generated by Prometheus QoS version %s<br>GPL+Copyright(C)2005-2012 Michael Polak, <a href=\"http://www.arachne.cz/\">Arachne Labs</a></small>\n";\r
+const char *stats_html_signature = "<span class=\"small\">Statistics generated by Prometheus QoS version %s<br />GPL+Copyright(C)2005-2012 Michael Polak, <a href=\"http://www.arachne.cz/\">Arachne Labs</a></span>\n";\r
\r
/* ======= All path names are defined here (for RPM patch) ======= */\r
\r
f=fopen(str,"w");\r
if(f)\r
{\r
- fprintf(f, "<table border=\"1\"><thead><tr class=\"bgGrey\"><th colspan=\"2\">%s %s</th><th align=\"right\">lms</th><th colspan=\"2\">Data transfers</th><th align=\"right\">Min.speed</th></tr></thead><tbody>\n ",\r
+ fprintf(f, "<table class=\"decorated last\"><thead>\n\\r
+<tr><th colspan=\"2\">%s %s</th>\n\\r
+<th style=\"text-align: right\">lms</th>\n\\r
+<th colspan=\"2\">Data transfers</th>\n\\r
+<th style=\"text-align: right\">Min.speed</th>\n\\r
+</tr></thead><tbody>\n ",\r
month, year);\r
\r
row_odd_even = 0;\r
{\r
if(iplog->traffic)\r
{\r
- fprintf(f, "%s<td align=\"right\">%d</td><td align=\"left\"><a href=\"%s%s.log\">%s</td></td><td align=\"right\">", \r
+ fprintf(f, "%s<td style=\"text-align: right\">%d</td>\n\\r
+<td style=\"text-align: left\"><a class=\"blue\" href=\"%s%s.log\">%s</td>\n\\r
+<td style=\"text-align: right\">", \r
tr_odd_even(), i++, log_url, iplog->name, iplog->name); \r
if(iplog->lmsid > 0)\r
{\r
/*base URL will be configurable soon ... */\r
- fprintf(f, "<a href=\"%s%d\">%04d</a>\n", lms_url, iplog->lmsid, iplog->lmsid);\r
+ fprintf(f, "<a class=\"blue\" href=\"%s%d\">%04d</a>\n", lms_url, iplog->lmsid, iplog->lmsid);\r
}\r
else if(iplog->lmsid == 0)\r
{\r
fputs("-------",f);\r
} \r
- fprintf(f, "<td align=\"right\">%ld M</td><th align=\"right\">%ld G</th><td align=\"right\">%ld kbps</th></tr>\n",\r
+ fprintf(f, "<td style=\"text-align: right\">%ld M</td>\n\\r
+ <td style=\"text-align: right\"><strong>%ld G</strong></td>\n\\r
+ <td style=\"text-align: right\">%ld kbps</th></tr>\n",\r
iplog->traffic, iplog->traffic>>10, iplog->guaranted);\r
total+=iplog->traffic>>10;\r
iplog->i=i;\r
iplog->l=total;\r
}\r
}\r
- fprintf(f,"<tr class=\"bgGrey\"><th colspan=\"4\" align=\"left\">Total:</th><th align=\"right\">%ld GB</th><th align=\"right\">%Ld kbps</th></tr>\n", total, line);\r
+ fprintf(f,"<tr>\\r
+ <td colspan=\"4\" style=\"text-align: left\">Total:</td>\\r
+ <td style=\"text-align: right\"><strong>%ld GB</strong></td>\\r
+ <td style=\"text-align: right\"><strong>%Ld kbps</strong></td></tr>\n", total, line);\r
fputs("</tbody></table>\n", f);\r
\r
row_odd_even = 0;\r
if(i>10)\r
{\r
- fputs("<a name=\"erp\"></a><p><table border=\"0\"><thead><caption>Enterprise Resource Planning (ERP)</caption></tr>\n",f);\r
- fputs("<tr class=\"bgGrey\"><td>Analytic category</td>\n",f);\r
- fputs("<td colspan=\"2\" align=\"center\">Active Classes</td><td colspan=\"2\" align=\"center\">Data transfers</td></tr>\n</thead><tbody>\n",f);\r
+ fputs("<a name=\"erp\"></a><p><table class=\"decorated last\"><thead>\n\\r
+<caption>Enterprise Resource Planning (ERP)</caption></tr>\n\\r
+<tr><td>Analytic category</td>\n\\r
+<td colspan=\"2\" style=\"text-align: center\">Active Classes</td>\n\\r
+<td colspan=\"2\" style=\"text-align: center\">Data transfers</td></tr>\n</thead><tbody>\n",f);\r
\r
if_exists(iplog,iplogs,iplog->l>=total/4)\r
{\r
fprintf(f,"%s<td>Top 25%% of traffic</td>\n", tr_odd_even());\r
- fprintf(f,"<td align=\"right\">%d</td><td align=\"right\">%d %%</td><td align=\"right\">%ld G</td><td align=\"right\">%d %%</td></tr>\n",iplog->i,(100*iplog->i+50)/i,iplog->l,(int)((100*iplog->l+50)/total));\r
+ fprintf(f,"<td style=\"text-align: right\">%d</td><td style=\"text-align: right\">%d %%</td><td style=\"text-align: right\">%ld G</td><td style=\"text-align: right\">%d %%</td></tr>\n",iplog->i,(100*iplog->i+50)/i,iplog->l,(int)((100*iplog->l+50)/total));\r
}\r
\r
if_exists(iplog,iplogs,iplog->i==10)\r
{\r
fprintf(f,"%s<td>Top 10 downloaders</td>\n", tr_odd_even());\r
- fprintf(f,"<th align=\"right\">10</th><td align=\"right\">%d %%</td><td align=\"right\">%ld G</td><td align=\"right\">%d %%</td></tr>\n",(100*iplog->i+50)/i,iplog->l,(int)((100*iplog->l+50)/total));\r
+ fprintf(f,"<th style=\"text-align: right\">10</th><td style=\"text-align: right\">%d %%</td><td style=\"text-align: right\">%ld G</td><td style=\"text-align: right\">%d %%</td></tr>\n",(100*iplog->i+50)/i,iplog->l,(int)((100*iplog->l+50)/total));\r
}\r
\r
if_exists(iplog,iplogs,iplog->l>=total/2)\r
{\r
fprintf(f,"%s<td>Top 50%% of traffic</td>\n", tr_odd_even());\r
- fprintf(f,"<td align=\"right\">%d</td><td align=\"right\">%d %%</td><td align=\"right\">%ld G</td><th align=\"right\">%d %%</th></tr>\n",iplog->i,(100*iplog->i+50)/i,iplog->l,(int)((100*iplog->l+50)/total));\r
+ fprintf(f,"<td style=\"text-align: right\">%d</td><td style=\"text-align: right\">%d %%</td><td style=\"text-align: right\">%ld G</td><th style=\"text-align: right\">%d %%</th></tr>\n",iplog->i,(100*iplog->i+50)/i,iplog->l,(int)((100*iplog->l+50)/total));\r
}\r
\r
if_exists(iplog,iplogs,iplog->l>=4*total/5)\r
{\r
fprintf(f,"%s<td>Top 80%% of traffic</td>\n",tr_odd_even());\r
- fprintf(f,"<td align=\"right\">%d</td><td align=\"right\">%d %%</td><td align=\"right\">%ld G</td><th align=\"right\">%d %%</th></tr>\n",iplog->i,(100*iplog->i+50)/i,iplog->l,(int)((100*iplog->l+50)/total));\r
+ fprintf(f,"<td style=\"text-align: right\">%d</td><td style=\"text-align: right\">%d %%</td><td style=\"text-align: right\">%ld G</td><th style=\"text-align: right\">%d %%</th></tr>\n",iplog->i,(100*iplog->i+50)/i,iplog->l,(int)((100*iplog->l+50)/total));\r
}\r
\r
if_exists (iplog,iplogs,iplog->i>=i/5)\r
{\r
fprintf(f,"%s<td>Top 20%% downloaders</td>\n",tr_odd_even());\r
- fprintf(f,"<td align=\"right\">%d</td><th align=\"right\">%d %%</th><td align=\"right\">%ld G</td><td align=\"right\">%d %%</td></tr>\n",iplog->i,(100*iplog->i+50)/i,iplog->l,(int)((100*iplog->l+50)/total));\r
+ fprintf(f,"<td style=\"text-align: right\">%d</td><th style=\"text-align: right\">%d %%</th><td style=\"text-align: right\">%ld G</td><td style=\"text-align: right\">%d %%</td></tr>\n",iplog->i,(100*iplog->i+50)/i,iplog->l,(int)((100*iplog->l+50)/total));\r
}\r
\r
if_exists(iplog,iplogs,iplog->i>=i/4)\r
{\r
fprintf(f,"%s<td>Top 25%% downloaders</td>\n", tr_odd_even());\r
- fprintf(f,"<td align=\"right\">%d</td><td align=\"right\">%d %%</td><td align=\"right\">%ld G</td><td align=\"right\">%d %%</td></tr>\n",iplog->i,(100*iplog->i+50)/i,iplog->l,(int)((100*iplog->l+50)/total));\r
+ fprintf(f,"<td style=\"text-align: right\">%d</td><td style=\"text-align: right\">%d %%</td><td style=\"text-align: right\">%ld G</td><td style=\"text-align: right\">%d %%</td></tr>\n",iplog->i,(100*iplog->i+50)/i,iplog->l,(int)((100*iplog->l+50)/total));\r
}\r
\r
if_exists(iplog,iplogs,iplog->i>=i/2)\r
{\r
fprintf(f,"%s<td>Top 50%% downloaders</td>\n",tr_odd_even());\r
- fprintf(f,"<td align=\"right\">%d</td><th align=\"right\">%d %%</th><td align=\"right\">%ld G</td><td align=\"right\">%d %%</td></tr>\n",iplog->i,(100*iplog->i+50)/i,iplog->l,(int)((100*iplog->l+50)/total));\r
+ fprintf(f,"<td style=\"text-align: right\">%d</td><th style=\"text-align: right\">%d %%</th><td style=\"text-align: right\">%ld G</td><td style=\"text-align: right\">%d %%</td></tr>\n",iplog->i,(100*iplog->i+50)/i,iplog->l,(int)((100*iplog->l+50)/total));\r
}\r
\r
if_exists(iplog,iplogs,iplog->i>=4*i/5)\r
{\r
fprintf(f,"%s<td>Top 80%% downloaders</td>\n",tr_odd_even());\r
- fprintf(f,"<td align=\"right\">%d</td><td align=\"right\">%d %%</td><td align=\"right\">%ld G</td><td align=\"right\">%d %%</td></tr>\n",iplog->i,(100*iplog->i+50)/i,iplog->l,(int)((100*iplog->l+50)/total));\r
+ fprintf(f,"<td style=\"text-align: right\">%d</td><td style=\"text-align: right\">%d %%</td><td style=\"text-align: right\">%ld G</td><td style=\"text-align: right\">%d %%</td></tr>\n",iplog->i,(100*iplog->i+50)/i,iplog->l,(int)((100*iplog->l+50)/total));\r
}\r
\r
- fprintf(f,"<tr class=\"bgGrey\"><td>All users, all traffic</td>\n");\r
- fprintf(f,"<th align=\"right\">%d</th><th align=\"right\">100 %%</th><th align=\"right\">%ld G</th><th align=\"right\">100 %%</th></tr>\n",i-1,total);\r
+ fprintf(f,"<tr><td>All users, all traffic</td>\n");\r
+ fprintf(f,"<th style=\"text-align: right\">%d</th><th style=\"text-align: right\">100 %%</th><th style=\"text-align: right\">%ld G</th><th style=\"text-align: right\">100 %%</th></tr>\n",i-1,total);\r
fputs("</tbody></table>\n", f);\r
}\r
\r
{\r
fprintf(f,"<script type=\"text/javascript\" src=\"%s\"></script>\n", jquery_url);\r
}\r
- fputs("<table border=\"0\">\n<thead><tr class=\"bgGrey\"><th align=\"right\">#</th><th align=\"right\">group</th><th align=\"right\">IPs</th><th align=\"right\">requested</th>\n",f);\r
+ fputs("<table class=\"decorated last\">\n<thead>\n\\r
+<tr><th style=\"text-align: right\">#</th>\n\\r
+<th style=\"text-align: right\">group</th>\n\\r
+<th style=\"text-align: right\">IPs</th>\n\\r
+<th style=\"text-align: right\">requested</th>\n",f);\r
fprintf(f,"<th colspan=\"%d\">data limits</th>\n", keywordcount);\r
fputs("</tr></thead><tbody>\n",f);\r
\r
#ifdef DEBUG\r
printf("%d k group: %d bandwidth requested: %d k\n",group->min,group->count,group->desired);\r
#endif\r
- fprintf(f, "%s<td align=\"right\">%d</td><td align=\"right\">%d k</td>",\r
+ fprintf(f, "%s<td style=\"text-align: right\">%d</td><td style=\"text-align: right\">%d k</td>",\r
tr_odd_even(), count, group->min);\r
- fprintf(f, "<td align=\"right\">%d</td><td align=\"right\">%d k</td>",\r
+ fprintf(f, "<td style=\"text-align: right\">%d</td><td style=\"text-align: right\">%d k</td>",\r
group->count, group->desired);\r
\r
for_each(keyword, keywords)\r
{\r
- fprintf(f,"<td align=\"right\"><span style=\"color:#%s\">%d M</span></td>",\r
+ fprintf(f,"<td style=\"text-align: right\"><span style=\"color:#%s\">%d M</span></td>",\r
keyword->html_color, group->min*keyword->data_limit);\r
} \r
i += group->desired; \r
printf("Total groups: %d Total bandwidth requested: %d k\nAGGREGATION: 1/%d\n",\r
count, i, i/line);\r
#endif\r
- fprintf(f,"<tr class=\"bgGrey\"><th colspan=\"2\" align=\"left\">Line %Ld k</td>",line);\r
- fprintf(f,"<th align=\"right\">%d</td><th align=\"right\">%d k</td>",total,i);\r
+ fprintf(f,"<tr><th colspan=\"2\" style=\"text-align: left\">Line %Ld k</td>",line);\r
+ fprintf(f,"<th style=\"text-align: right\">%d</td><th style=\"text-align: right\">%d k</td>",total,i);\r
\r
for_each(keyword, keywords)\r
{\r
- fprintf(f,"<th align=\"right\">%d IPs</th>",keyword->ip_count);\r
+ fprintf(f,"<th style=\"text-align: right\">%d IPs</th>",keyword->ip_count);\r
}\r
fprintf(f,"</tr><tr><th colspan=\"4\">Aggregation 1/%d</th>\n", (int)(0.5+i/line));\r
fprintf(f,"<th colspan=\"%d\">%d traffic classes</th></tr>\n", keywordcount, total);\r
colspan++;\r
}\r
\r
- fprintf(f,"<p><table border>\n<thead><caption>%s",title);\r
+ fprintf(f,"<p><table class=\"decorated last\">\n<thead><caption>%s",title);\r
fprintf(f," (%s)</caption>\n", d);\r
- fputs("<tr class=\"bgGrey\"><td align=\"right\">#</td><td>hostname</td>",f);\r
+ fputs("<tr><th style=\"text-align: right\">#</th><th>hostname</th>",f);\r
if(found_lmsid)\r
{\r
- fputs("<td align=\"right\">lms</td>\n",f);\r
+ fputs("<th style=\"text-align: right\">lms</th>\n",f);\r
}\r
- fputs("<td align=\"right\">credit</td>\\r
-<td align=\"right\">limit</td>\\r
-<td align=\"right\">total</td>\\r
-<td align=\"right\">direct</td>\n",f);\r
+ fputs("<th style=\"text-align: right\">credit</th>\\r
+<th style=\"text-align: right\">limit</th>\\r
+<th style=\"text-align: right\">total</th>\\r
+<th style=\"text-align: right\">direct</th>\n",f);\r
if(qos_proxy)\r
{\r
- fputs("<td align=\"right\">proxy</td>\n",f);\r
+ fputs("<th style=\"text-align: right\">proxy</th>\n",f);\r
}\r
- fputs("<td align=\"right\">upload</td>\\r
-<td align=\"right\">minimum</td>\\r
-<td align=\"right\">desired</td>\\r
-<td align=\"right\">maximum</td>\\r
-<td>prio</td></tr>\n\\r
+ fputs("<th style=\"text-align: right\">upload</th>\\r
+<th style=\"text-align: right\">minimum</th>\\r
+<th style=\"text-align: right\">desired</th>\\r
+<th style=\"text-align: right\">maximum</th>\\r
+<th>prio</th></tr>\n\\r
</thead><tbody>\n",f); \r
\r
row_odd_even = 0;\r
printf("%03d. %-22s %10Lu (%d/%d)\n",i ,ip->name, ip->traffic, ip->min, ip->max); \r
#endif\r
/* hostnames -------------------------------------- */\r
- fprintf(f,"%s<td align=\"right\"><a name=\"%s\"></a>%d</td><td><a href=\"%s%s.log\">%s</a>\n", \r
+ fprintf(f,"%s<td style=\"text-align: right\"><a name=\"%s\"></a>%d</td><td><a class=\"blue\" href=\"%s%s.log\">%s</a>\n", \r
tr_odd_even(), ip->name, i, log_url, ip->name, ip->name);\r
if(use_jquery_popups)\r
{\r
popup_button=0;\r
for_each(sharedip, ips) if(eq(ip->name, sharedip->sharing))\r
{\r
- fprintf(f,"<br /><a href=\"%s%s.log\">%s</a>\n", log_url, sharedip->name, sharedip->name);\r
+ fprintf(f,"<br /><a class=\"blue\" href=\"%s%s.log\">%s</a>\n", log_url, sharedip->name, sharedip->name);\r
popup_button++;\r
}\r
fputs("</span>\n",f);\r
if(popup_button)\r
{\r
- fprintf(f,"<span>[<a href=\"#\" onClick=\"$(this).parent().hide();$(\'#sharing_%d\').show();$(\'#download_%d\').show();$(\'#upload_%d\').show();return(false);\" style=\"cursor: pointer;\">+%d</a>]</span>",\r
+ fprintf(f,"<span>[<a class=\"blue\" href=\"#\" onClick=\"$(this).parent().hide();$(\'#sharing_%d\').show();$(\'#download_%d\').show();$(\'#upload_%d\').show();return(false);\" style=\"cursor: pointer;\">+%d</a>]</span>",\r
i, i, i, popup_button);\r
}\r
}\r
\r
if(found_lmsid)\r
{\r
- fputs("<td align=\"right\">",f);\r
+ fputs("<td style=\"text-align: right\">",f);\r
if(ip->lmsid > 0)\r
{\r
/*base URL will be configurable soon ... */\r
- fprintf(f,"<a href=\"%s%d\">%04d</a>\n", lms_url, ip->lmsid, ip->lmsid);\r
+ fprintf(f,"<a class=\"blue\" href=\"%s%d\">%04d</a>\n", lms_url, ip->lmsid, ip->lmsid);\r
}\r
else if(ip->lmsid == 0)\r
{\r
}\r
fputs("</td>\n",f);\r
}\r
- fprintf(f,"<td align=\"right\">%Lu M</td>\n", ip->credit);\r
- fprintf(f,"<td align=\"right\"><span style=\"color:#%s\">%Lu M</span></td>",\r
+ fprintf(f,"<td style=\"text-align: right\">%Lu M</td>\n", ip->credit);\r
+ fprintf(f,"<td style=\"text-align: right\"><span style=\"color:#%s\">%Lu M</span></td>",\r
ip->keyword->html_color,\r
ip->credit+(ip->min*ip->keyword->data_limit+(ip->keyword->fixed_limit<<20)));\r
- fprintf(f,"<td align=\"right\">%s%Lu M%s", f1, ip->traffic, f2);\r
+ fprintf(f,"<td style=\"text-align: right\">%s%Lu M%s", f1, ip->traffic, f2);\r
\r
/* download --------------------------------------- */\r
- fprintf(f,"</td><td align=\"right\">%Lu M", ip->direct);\r
+ fprintf(f,"</td><td style=\"text-align: right\">%Lu M", ip->direct);\r
if(use_jquery_popups)\r
{\r
fprintf(f,"<span id=\"download_%d\" style=\"display:none\">",i);\r
\r
if(qos_proxy)\r
{\r
- fprintf(f,"<td align=\"right\">%Lu M</td>\n", ip->proxy);\r
+ fprintf(f,"<td style=\"text-align: right\">%Lu M</td>\n", ip->proxy);\r
}\r
/* upload ---------------------------------------- */\r
- fprintf(f,"<td align=\"right\">%Lu M", ip->upload);\r
+ fprintf(f,"<td style=\"text-align: right\">%Lu M", ip->upload);\r
if(use_jquery_popups)\r
{\r
fprintf(f,"<span id=\"upload_%d\" style=\"display:none\">",i);\r
fputs("</td>\n",f);\r
/* ----------------------------------------------- */\r
\r
- fprintf(f,"<td align=\"right\">%d k</td><td align=\"right\">%d k</td><td align=\"right\">%s%d k%s</td><td>%s%d%s</td></tr>\n",\r
+ fprintf(f,"<td style=\"text-align: right\">%d k</td><td style=\"text-align: right\">%d k</td><td style=\"text-align: right\">%s%d k%s</td><td>%s%d%s</td></tr>\n",\r
ip->min,ip->desired,f1,ip->max,f2,f1,ip->prio,f2);\r
\r
total_traffic+=ip->traffic;\r
}\r
}\r
}\r
- fprintf(f,"<tr class=\"bgGrey\"><th colspan=\"%d\" align=\"left\">%d CLASSES</th>", colspan-7, i);\r
- fprintf(f,"<th align=\"right\">%Lu M</th><th align=\"right\">%Lu M</th>\n", total_traffic, total_direct);\r
+ fprintf(f,"<tr><th colspan=\"%d\" style=\"text-align: left\">%d CLASSES</th>", colspan-7, i);\r
+ fprintf(f,"<th style=\"text-align: right\">%Lu M</th><th style=\"text-align: right\">%Lu M</th>\n", total_traffic, total_direct);\r
if(qos_proxy)\r
{\r
- fprintf(f,"<th align=\"right\">%Lu M</th>\n", total_proxy);\r
+ fprintf(f,"<th style=\"text-align: right\">%Lu M</th>\n", total_proxy);\r
}\r
- fprintf(f,"<th align=\"right\">%Lu M</th>", total_upload);\r
+ fprintf(f,"<th style=\"text-align: right\">%Lu M</th>", total_upload);\r
fprintf(f,"<th colspan=\"4\"><span style=\"color:red\">FUP-LIMIT %dx</span> <span style=\"color:brown\">LOW-PRIO %dx</span></th></tr>\n</tbody></table>\n",limit_count,prio_count);\r
\r
row_odd_even = 0;\r
long long top20_perc2=0;\r
unsigned long long top20_sum=0l;\r
\r
- fputs("<a name=\"erp\"></a><p><table border><thead><caption>Enterprise Resource Planning (ERP)</caption>\n",f);\r
- fputs("<tr class=\"bgGrey\"><td>Analytic category</td>\n",f);\r
- fputs("<td colspan=\"2\" align=\"center\">Active Classes</td><td colspan=\"2\" align=\"center\">Data transfers</td></tr></thead><tbody>\n",f);\r
+ fputs("<a name=\"erp\"></a><p><table class=\"decorated last\"><thead><caption>Enterprise Resource Planning (ERP)</caption>\n",f);\r
+ fputs("<tr><td>Analytic category</td>\n",f);\r
+ fputs("<td colspan=\"2\" style=\"text-align: center\">Active Classes</td><td colspan=\"2\" style=\"text-align: center\">Data transfers</td></tr></thead><tbody>\n",f);\r
\r
if_exists(sum,sums,sum->l>=total_traffic/4)\r
{\r
fprintf(f,"%s<td>Top 25%% of traffic</td>\n", tr_odd_even());\r
- fprintf(f,"<td align=\"right\">%d</td><td align=\"right\">%d %%</td><td align=\"right\">%Lu M</td><td align=\"right\">%Ld %%</td></tr>\n",sum->i,(100*sum->i+50)/active_classes,sum->l,(100*sum->l+50)/total_traffic);\r
+ fprintf(f,"<td style=\"text-align: right\">%d</td><td style=\"text-align: right\">%d %%</td><td style=\"text-align: right\">%Lu M</td><td style=\"text-align: right\">%Ld %%</td></tr>\n",sum->i,(100*sum->i+50)/active_classes,sum->l,(100*sum->l+50)/total_traffic);\r
}\r
\r
if_exists(sum,sums,sum->i==10)\r
{\r
fprintf(f,"%s<td>Top 10 downloaders</td>\n", tr_odd_even());\r
- fprintf(f,"<th align=\"right\">10</th><td align=\"right\">%d %%</td><td align=\"right\">%Lu M</td><td align=\"right\">%Ld %%</td></tr>\n",(100*sum->i+50)/active_classes,sum->l,(100*sum->l+50)/total_traffic);\r
+ fprintf(f,"<th style=\"text-align: right\">10</th><td style=\"text-align: right\">%d %%</td><td style=\"text-align: right\">%Lu M</td><td style=\"text-align: right\">%Ld %%</td></tr>\n",(100*sum->i+50)/active_classes,sum->l,(100*sum->l+50)/total_traffic);\r
}\r
\r
if_exists(sum,sums,sum->l>=total_traffic/2)\r
{\r
fprintf(f,"%s<td>Top 50%% of traffic</td>\n", tr_odd_even());\r
- fprintf(f,"<td align=\"right\">%d</td><td align=\"right\">%d %%</td><td align=\"right\">%Lu M</td><th align=\"right\">%Ld %%</th></tr>\n",sum->i,(100*sum->i+50)/active_classes,sum->l,(100*sum->l+50)/total_traffic);\r
+ fprintf(f,"<td style=\"text-align: right\">%d</td><td style=\"text-align: right\">%d %%</td><td style=\"text-align: right\">%Lu M</td><th style=\"text-align: right\">%Ld %%</th></tr>\n",sum->i,(100*sum->i+50)/active_classes,sum->l,(100*sum->l+50)/total_traffic);\r
}\r
\r
if_exists(sum,sums,sum->l>=4*total_traffic/5)\r
{\r
fprintf(f,"%s<td>Top 80%% of traffic</td>\n", tr_odd_even());\r
- fprintf(f,"<td align=\"right\">%d</td><td align=\"right\">%d %%</td><td align=\"right\">%Lu M</td><th align=\"right\">%Ld %%</th></tr>\n",sum->i,(100*sum->i+50)/active_classes,sum->l,(100*sum->l+50)/total_traffic);\r
+ fprintf(f,"<td style=\"text-align: right\">%d</td><td style=\"text-align: right\">%d %%</td><td style=\"text-align: right\">%Lu M</td><th style=\"text-align: right\">%Ld %%</th></tr>\n",sum->i,(100*sum->i+50)/active_classes,sum->l,(100*sum->l+50)/total_traffic);\r
}\r
\r
if_exists(sum,sums,sum->i>=(active_classes+1)/5)\r
top20_perc1=(100*sum->i+50)/active_classes;\r
top20_sum=sum->l;\r
top20_perc2=(100*sum->l+50)/total_traffic;\r
- fprintf(f,"<td align=\"right\">%d</td><th align=\"right\">%d %%</th><td align=\"right\">%Lu M</td><td align=\"right\">%Ld %%</td></tr>\n",top20_count,top20_perc1,top20_sum,top20_perc2);\r
+ fprintf(f,"<td style=\"text-align: right\">%d</td><th style=\"text-align: right\">%d %%</th><td style=\"text-align: right\">%Lu M</td><td style=\"text-align: right\">%Ld %%</td></tr>\n",top20_count,top20_perc1,top20_sum,top20_perc2);\r
}\r
\r
if_exists(sum,sums,sum->i>=(active_classes+1)/4)\r
{\r
fprintf(f,"%s<td>Top 25%% downloaders</td>\n", tr_odd_even());\r
- fprintf(f,"<td align=\"right\">%d</td><td align=\"right\">%d %%</td><td align=\"right\">%Lu M</td><td align=\"right\">%Ld %%</td></tr>\n",sum->i,(100*sum->i+50)/active_classes,sum->l,(100*sum->l+50)/total_traffic);\r
+ fprintf(f,"<td style=\"text-align: right\">%d</td><td style=\"text-align: right\">%d %%</td><td style=\"text-align: right\">%Lu M</td><td style=\"text-align: right\">%Ld %%</td></tr>\n",sum->i,(100*sum->i+50)/active_classes,sum->l,(100*sum->l+50)/total_traffic);\r
}\r
\r
if_exists(sum,sums,sum->i>=(active_classes+1)/2)\r
{\r
fprintf(f,"%s<td>Top 50%% downloaders</td>\n", tr_odd_even());\r
- fprintf(f,"<td align=\"right\">%d</td><th align=\"right\">%d %%</th><td align=\"right\">%Lu M</td><td align=\"right\">%Ld %%</td></tr>\n",sum->i,(100*sum->i+50)/active_classes,sum->l,(100*sum->l+50)/total_traffic);\r
+ fprintf(f,"<td style=\"text-align: right\">%d</td><th style=\"text-align: right\">%d %%</th><td style=\"text-align: right\">%Lu M</td><td style=\"text-align: right\">%Ld %%</td></tr>\n",sum->i,(100*sum->i+50)/active_classes,sum->l,(100*sum->l+50)/total_traffic);\r
}\r
\r
if_exists(sum,sums,sum->i>=4*(active_classes+1)/5)\r
{\r
fprintf(f,"%s<td>Top 80%% downloaders</td>\n", tr_odd_even());\r
- fprintf(f,"<td align=\"right\">%d</td><td align=\"right\">%d %%</td><td align=\"right\">%Lu M</td><td align=\"right\">%Ld %%</td></tr>\n",sum->i,(100*sum->i+50)/active_classes,sum->l,(100*sum->l+50)/total_traffic);\r
+ fprintf(f,"<td style=\"text-align: right\">%d</td><td style=\"text-align: right\">%d %%</td><td style=\"text-align: right\">%Lu M</td><td style=\"text-align: right\">%Ld %%</td></tr>\n",sum->i,(100*sum->i+50)/active_classes,sum->l,(100*sum->l+50)/total_traffic);\r
}\r
\r
- fprintf(f,"<tr class=\"bgGrey\"><td><a href=\"%sERP.log\">All users, all traffic</a></td>\n", log_url);\r
- fprintf(f,"<th align=\"right\">%d</th><th align=\"right\">100 %%</th><th align=\"right\">%Lu M</th><th align=\"right\">100 %%</th></tr>\n",active_classes,total_traffic);\r
+ fprintf(f,"<tr><td><a class=\"blue\" href=\"%sERP.log\">All users, all traffic</a></td>\n", log_url);\r
+ fprintf(f,"<th style=\"text-align: right\">%d</th>\n\\r
+<th style=\"text-align: right\">100 %%</th>\n\\r
+<th style=\"text-align: right\">%Lu M</th>\n\\r
+<th style=\"text-align: right\">100 %%</th></tr>\n",active_classes,total_traffic);\r
fputs("</tbody></table>\n", f);\r
\r
/* write basic ERP data to log directory */\r