From 4a1b62ea8f624700dd2eb7a9cb81d480ffd62725 Mon Sep 17 00:00:00 2001 From: xchaos Date: Wed, 30 Nov 2011 17:28:43 +0000 Subject: [PATCH] Prenosy sharujicich IPcek jsou nyni rozkliknutelne (pomoci JQuery) git-svn-id: https://dev.arachne.cz/repos/prometheus/trunk@154 251d49ef-1d17-4917-a970-b30cf55b089b --- cll1-0.6.2.h | 2 +- prometheus.c | 64 +++++++++++++++++++++++++++++++++++++++++----------- 2 files changed, 52 insertions(+), 14 deletions(-) diff --git a/cll1-0.6.2.h b/cll1-0.6.2.h index 12d27bf..7c33ce8 100644 --- a/cll1-0.6.2.h +++ b/cll1-0.6.2.h @@ -71,7 +71,7 @@ /* String macros & sequences, updated 2004-04-19 by xCh. */ -#define eq(A,B) !strcmp(A,B) +#define eq(A,B) ((A) && (B) && !strcmp(A,B)) #define strcmpi(A,B) strcasecmp(A,B) #define strlwr(A) {char *_S=A; while(_&&*_S){*_S=tolower(*_S);_S++;}} #define strupr(A) {char *_S=A; while(_&&*_S){*_S=toupper(*_S);_S++;}} diff --git a/prometheus.c b/prometheus.c index 4731bcc..0ea9378 100644 --- a/prometheus.c +++ b/prometheus.c @@ -7,7 +7,7 @@ /* Credit: CZFree.Net,Martin Devera,Netdave,Aquarius,Gandalf */ /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ -/* Modified by: xChaos, 20110428 +/* Modified by: xChaos, 20111130 ludva, 20080415 Prometheus QoS is free software; you can redistribute it and/or @@ -33,7 +33,7 @@ #include "cll1-0.6.2.h" -const char *version = "0.8.3"; +const char *version = "0.8.3-b"; /* Version numbers: 0.8.3 is development releases ("beta"), 0.8.4 will be "stable" */ /* Debian(RPM) package versions/patchlevels: 0.7.9-2, 0.8.0-1, 0.8.0-2, etc. */ @@ -1511,6 +1511,7 @@ Credit: CZFree.Net, Martin Devera, Netdave, Aquarius, Gandalf\n\n",version); printf("Sorting data and generating statistics page %s ...\n",ptr); /*-----------------------------------------------------------------*/ + fputs("\n",f); fputs("\n\n",f); fprintf(f,"\n",keywordcount); fputs("\n",f); @@ -1554,12 +1555,12 @@ Credit: CZFree.Net, Martin Devera, Netdave, Aquarius, Gandalf\n\n",version); { unsigned long long total_traffic=0, total_direct=0, total_proxy=0, total_upload=0, tmp_sum=0; int active_classes=0; - int colspan; + int colspan=11; FILE *iplog; struct Sum {unsigned long long l; int i; list(Sum);} *sum,*sums=NULL; int limit_count=0, prio_count=0; + int popup_button=0; - colspan=11; if(qos_proxy) { colspan++; @@ -1609,7 +1610,24 @@ Credit: CZFree.Net, Martin Devera, Netdave, Aquarius, Gandalf\n\n",version); #ifdef DEBUG printf("%03d. %-22s %10Lu (%d/%d)\n",i ,ip->name, ip->traffic, ip->min, ip->max); #endif - fprintf(f,"\n", ip->name, i, log_url, ip->name, ip->name); + /* hostnames -------------------------------------- */ + fprintf(f,"\n",f); + /* ----------------------------------------------- */ + if(found_lmsid) { fputs("\n",f); + fputs("\n",f); } fprintf(f,"\n", ip->credit); fprintf(f,"", - ip->keyword->html_color, ip->credit+(ip->min*ip->keyword->data_limit+(ip->keyword->fixed_limit<<20))); - fprintf(f,"\n", f1, ip->traffic, f2, ip->direct); + ip->keyword->html_color, + ip->credit+(ip->min*ip->keyword->data_limit+(ip->keyword->fixed_limit<<20))); + fprintf(f,"\n",f); + /* ----------------------------------------------- */ + if(qos_proxy) { fprintf(f,"\n", ip->proxy); } - fprintf(f,"\n", ip->upload); + /* upload ---------------------------------------- */ + fprintf(f,"\n",f); + /* ----------------------------------------------- */ + fprintf(f,"\n", ip->min,ip->desired,f1,ip->max,f2,f1,ip->prio,f2); total_traffic+=ip->traffic; @@ -1664,8 +1703,7 @@ Credit: CZFree.Net, Martin Devera, Netdave, Aquarius, Gandalf\n\n",version); } } fprintf(f,"\ - \n", total_traffic, total_direct); + fprintf(f,"\n", total_traffic, total_direct); if(qos_proxy) { fprintf(f,"\n", total_proxy); @@ -1747,8 +1785,8 @@ Credit: CZFree.Net, Martin Devera, Netdave, Aquarius, Gandalf\n\n",version); if(iplog) { 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", - time(NULL), top20_count, top20_perc1, top20_sum, top20_perc2, - active_classes, total_traffic, total, limit_count, prio_count, d); /* d = date*/ + time(NULL), top20_count, top20_perc1, top20_sum, top20_perc2, + active_classes, total_traffic, total, limit_count, prio_count, d); /* d = date*/ fclose(iplog); } } -- 2.30.2
#groupIPsrequesteddata limits
%d%s
%d%s\n", ip->name, i, log_url, ip->name, ip->name); + fprintf(f,"",i); + popup_button=0; + for_selected(sharedip,ips,eq(ip->name,sharedip->sharing)) + { + fprintf(f,"
%s\n", log_url, sharedip->name, sharedip->name); + popup_button=1; + } + fputs("
\n",f); + if(popup_button) + { + fprintf(f,"[+]", + i, i, i, i, i); + } + fputs("
",f); @@ -1622,17 +1640,38 @@ Credit: CZFree.Net, Martin Devera, Netdave, Aquarius, Gandalf\n\n",version); { fputs("-------",f); } - fputs("%Lu M%Lu M%s%Lu M%s%Lu M%s%Lu M%s",f1, ip->traffic, f2); + + /* download --------------------------------------- */ + fprintf(f,"%Lu M", ip->direct); + fprintf(f,"",i); + for_selected(sharedip,ips,eq(ip->name,sharedip->sharing)) + { + fprintf(f,"
%Lu M", sharedip->direct); + } + fputs("
%Lu M%Lu M%Lu M", ip->upload); + fprintf(f,"",i); + for_selected(sharedip,ips,eq(ip->name,sharedip->sharing)) + { + fprintf(f,"
%Lu M", sharedip->upload); + } + fputs("
%d k%d k%s%d k%s%s%d%s
SUMMARY:",colspan-7); - fprintf(f,"%Lu M%Lu M%Lu M%Lu M%Lu M