X-Git-Url: http://git.harvie.cz/?p=svn%2FPrometheus-QoS%2F.git;a=blobdiff_plain;f=htmlandlogs.c;h=e11af1abac500b99e2b38d3489a4769a57e1455e;hp=f624a48442c56c3d508c1b01f149de98f8b9d061;hb=0b9c3c198771800cc6c5fbacfc0272549626bcfd;hpb=9a56ab25128074e581fa5f69bac8afa2fb939c82
diff --git a/htmlandlogs.c b/htmlandlogs.c
index f624a48..e11af1a 100644
--- a/htmlandlogs.c
+++ b/htmlandlogs.c
@@ -50,7 +50,7 @@ void write_htmlandlogs(char *html, char *d, int total, int just_preview)
{
int i;
char *str;
- FILE *f=fopen(html,"w");
+ FILE *f=fopen(html, "w");
string(str,STRLEN);
if(f > 0)
@@ -58,10 +58,6 @@ void write_htmlandlogs(char *html, char *d, int total, int just_preview)
int count=1;
i=0;
- /*-----------------------------------------------------------------*/
- printf("Writing statistics summary into HTML page %s ...\n", html);
- /*-----------------------------------------------------------------*/
-
if(use_jquery_popups)
{
fprintf(f,"\n", jquery_url);
@@ -195,11 +191,16 @@ void write_htmlandlogs(char *html, char *d, int total, int just_preview)
{
fprintf(f,"",i);
popup_button=0;
- for_each(sharedip, ips) if(eq(ip->name, sharedip->sharing))
+ for_each(sharedip, ips) if(eq(ip->name, sharedip->sharing) && !sharedip->v6) /* IPv4 only */
{
fprintf(f,"
%s\n", log_url, sharedip->name, sharedip->name);
popup_button++;
}
+ for_each(sharedip, ips) if(eq(ip->name, sharedip->sharing) && sharedip->v6) /* IPv6 only */
+ {
+ fprintf(f,"
%s/64\n", log_url, sharedip->addr, sharedip->addr);
+ popup_button++;
+ }
fputs("\n",f);
if(popup_button)
{
@@ -225,8 +226,7 @@ void write_htmlandlogs(char *html, char *d, int total, int just_preview)
}
fprintf(f,"
%Lu | \n", ip->credit);
fprintf(f,"%Lu | ",
- ip->keyword->html_color,
- ip->credit+(ip->min*ip->keyword->data_limit+(ip->keyword->fixed_limit<<20)));
+ ip->keyword->html_color, ip->realquota);
fprintf(f,"%s%Lu%s", f1, ip->traffic, f2);
/* download --------------------------------------- */
@@ -234,7 +234,11 @@ void write_htmlandlogs(char *html, char *d, int total, int just_preview)
if(use_jquery_popups)
{
fprintf(f,"",i);
- for_each(sharedip, ips) if(eq(ip->name, sharedip->sharing))
+ for_each(sharedip, ips) if(eq(ip->name, sharedip->sharing) && !sharedip->v6) /* IPv4 only */
+ {
+ fprintf(f," %Lu", sharedip->direct);
+ }
+ for_each(sharedip, ips) if(eq(ip->name, sharedip->sharing) && sharedip->v6) /* IPv6 only */
{
fprintf(f," %Lu", sharedip->direct);
}
@@ -252,7 +256,11 @@ void write_htmlandlogs(char *html, char *d, int total, int just_preview)
if(use_jquery_popups)
{
fprintf(f,"",i);
- for_each(sharedip,ips) if(eq(ip->name, sharedip->sharing))
+ for_each(sharedip,ips) if(eq(ip->name, sharedip->sharing) && !sharedip->v6) /* IPv4 only */
+ {
+ fprintf(f," %Lu", sharedip->upload);
+ }
+ for_each(sharedip,ips) if(eq(ip->name, sharedip->sharing) && sharedip->v6) /* IPv6 only */
{
fprintf(f," %Lu", sharedip->upload);
}
|