/* Credit: CZFree.Net,Martin Devera,Netdave,Aquarius,Gandalf */\r
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */\r
\r
-/* Modified by: xChaos, 20110428\r
+/* Modified by: xChaos, 20111130\r
ludva, 20080415\r
\r
Prometheus QoS is free software; you can redistribute it and/or\r
\r
#include "cll1-0.6.2.h"\r
\r
-const char *version = "0.8.3"; \r
+const char *version = "0.8.3-b";\r
\r
/* Version numbers: 0.8.3 is development releases ("beta"), 0.8.4 will be "stable" */\r
/* Debian(RPM) package versions/patchlevels: 0.7.9-2, 0.8.0-1, 0.8.0-2, etc. */\r
printf("Sorting data and generating statistics page %s ...\n",ptr);\r
/*-----------------------------------------------------------------*/\r
\r
+ fputs("<script type=\"text/javascript\" src=\"/jquery.js\"></script>\n",f);\r
fputs("<table border>\n<tr><th align=\"right\">#</th><th align=\"right\">group</th><th align=\"right\">IPs</th><th align=\"right\">requested</th>\n",f);\r
fprintf(f,"<th colspan=\"%d\">data limits</th>\n",keywordcount);\r
fputs("</tr>\n",f);\r
{\r
unsigned long long total_traffic=0, total_direct=0, total_proxy=0, total_upload=0, tmp_sum=0;\r
int active_classes=0;\r
- int colspan;\r
+ int colspan=11;\r
FILE *iplog;\r
struct Sum {unsigned long long l; int i; list(Sum);} *sum,*sums=NULL;\r
int limit_count=0, prio_count=0;\r
+ int popup_button=0;\r
\r
- colspan=11;\r
if(qos_proxy)\r
{\r
colspan++;\r
#ifdef DEBUG\r
printf("%03d. %-22s %10Lu (%d/%d)\n",i ,ip->name, ip->traffic, ip->min, ip->max); \r
#endif\r
- fprintf(f,"<tr><td align=\"right\"><a name=\"%s\"></a>%d</td><td><a href=\"%s%s.log\">%s</a></td>\n", ip->name, i, log_url, ip->name, ip->name);\r
+ /* hostnames -------------------------------------- */\r
+ fprintf(f,"<tr><td align=\"right\"><a name=\"%s\"></a>%d</td><td><a href=\"%s%s.log\">%s</a>\n", ip->name, i, log_url, ip->name, ip->name); \r
+ fprintf(f,"<span id=\"sharing_%d\" style=\"display:none\">",i);\r
+ popup_button=0;\r
+ for_selected(sharedip,ips,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
+ popup_button=1;\r
+ }\r
+ fputs("</span>\n",f);\r
+ if(popup_button)\r
+ {\r
+ fprintf(f,"<span id=\"toggle_%d\">[<a href=\"#\" onClick=\"$(\'#toggle_%d\').remove();$(\'#sharing_%d\').show();$(\'#download_%d\').show();$(\'#upload_%d\').show();return(false);\" style=\"cursor: pointer; text-decoration:none;\">+</a>]</span>",\r
+ i, i, i, i, i);\r
+ }\r
+ fputs("</td>\n",f);\r
+ /* ----------------------------------------------- */\r
+\r
if(found_lmsid)\r
{\r
fputs("<td align=\"right\">",f);\r
{\r
fputs("-------",f);\r
}\r
- fputs("</td>\n",f); \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
- ip->keyword->html_color, ip->credit+(ip->min*ip->keyword->data_limit+(ip->keyword->fixed_limit<<20)));\r
- fprintf(f,"<td align=\"right\">%s%Lu M%s</td><td align=\"right\">%Lu M</td>\n", f1, ip->traffic, f2, ip->direct);\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
+\r
+ /* download --------------------------------------- */\r
+ fprintf(f,"</td><td align=\"right\">%Lu M", ip->direct);\r
+ fprintf(f,"<span id=\"download_%d\" style=\"display:none\">",i);\r
+ for_selected(sharedip,ips,eq(ip->name,sharedip->sharing))\r
+ {\r
+ fprintf(f,"<br />%Lu M", sharedip->direct);\r
+ }\r
+ fputs("</span></td>\n",f);\r
+ /* ----------------------------------------------- */\r
+\r
if(qos_proxy)\r
{\r
fprintf(f,"<td align=\"right\">%Lu M</td>\n", ip->proxy);\r
}\r
- fprintf(f,"<td align=\"right\">%Lu M</td>\n", ip->upload);\r
+ /* upload ---------------------------------------- */\r
+ fprintf(f,"<td align=\"right\">%Lu M", ip->upload);\r
+ fprintf(f,"<span id=\"upload_%d\" style=\"display:none\">",i);\r
+ for_selected(sharedip,ips,eq(ip->name,sharedip->sharing))\r
+ {\r
+ fprintf(f,"<br />%Lu M", sharedip->upload);\r
+ }\r
+ fputs("</span></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
ip->min,ip->desired,f1,ip->max,f2,f1,ip->prio,f2);\r
total_traffic+=ip->traffic;\r
}\r
}\r
fprintf(f,"<tr><th colspan=\"%d\" align=\"left\">SUMMARY:</td>",colspan-7);\r
- fprintf(f,"<th align=\"right\">%Lu M</th>\\r
- <th align=\"right\">%Lu M</th>\n", total_traffic, total_direct);\r
+ fprintf(f,"<th align=\"right\">%Lu M</th><th 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
if(iplog)\r
{\r
fprintf(iplog,"%ld\t%d\t%d %%\t%Lu M\t%Ld %%\tACTIVE %d\tTRAFFIC %Lu M\tCLASSES %d\tFUP-LIMIT %d\tLOW-PRIO %d\t%s",\r
- time(NULL), top20_count, top20_perc1, top20_sum, top20_perc2, \r
- active_classes, total_traffic, total, limit_count, prio_count, d); /* d = date*/\r
+ time(NULL), top20_count, top20_perc1, top20_sum, top20_perc2, \r
+ active_classes, total_traffic, total, limit_count, prio_count, d); /* d = date*/\r
fclose(iplog);\r
}\r
}\r