not tested - initial commit only
[svn/Prometheus-QoS/.git] / htmlandlogs.c
index 2cb7898b5431cb44a02dff5d9dfbdc34ebffe87f..b6f9cb66602c080c23b220dd177cd2076a95df98 100644 (file)
@@ -14,7 +14,6 @@ extern const char *version;
 extern const char *stats_html_signature;\r
 extern char *jquery_url;\r
 extern int keywordcount;\r
-extern long long int line;\r
 extern int dry_run;\r
 extern int qos_proxy;\r
 extern char *title;\r
@@ -100,19 +99,19 @@ void write_htmlandlogs(char *html, char *d, int total, int just_preview)
    count++; \r
   }\r
 #ifdef DEBUG\r
-   printf("Total groups: %d Total bandwidth requested: %d kb/s\nAGGREGATION: 1/%d\n",\r
-          count, i, i/line);\r
+   printf("Total groups: %d Total bandwidth requested: %d kb/s\n",\r
+          count, i, i);\r
 #endif\r
    fprintf(f,"</tr></tbody>\n\\r
 <thead><tr>\n\\r
-<th colspan=\"2\" style=\"text-align: left\">Line %Ld kb/s</td>",line);\r
+<th colspan=\"2\" style=\"text-align: left\"></td>");\r
    fprintf(f,"<th style=\"text-align: right\">%d</td><th style=\"text-align: right\">%d kb/s</td>",total,i);\r
 \r
    for_each(keyword, keywords) if(keyword->ip_count)\r
    {\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,"</tr><tr><th colspan=\"4\"></th>\n");\r
    fprintf(f,"<th colspan=\"%d\">%d traffic classes</th></tr>\n", keywordcount, total);\r
 \r
    fputs("</thead></table>\n",f);\r
@@ -130,7 +129,7 @@ void write_htmlandlogs(char *html, char *d, int total, int just_preview)
   int active_classes = 0;\r
 //  int colspan = 14;\r
   struct Sum {unsigned long long l; int i; list(Sum);} *sum,*sums = NULL;\r
-  int limit_count = 0, prio_count = 0;\r
+  int agreg_count = 0, limit_count = 0, prio_count = 0;\r
   int popup_button = 0;\r
   /* IPv6 vs. IPv4 stats */\r
   unsigned long long pkts4 =0, pkts6 = 0, bytes4 = 0, bytes6 = 0;\r
@@ -197,7 +196,13 @@ $(\'#pktsup_\'+n).show();\
    char *f1="", *f2="";\r
    i++;\r
 \r
-   if(ip->max < ip->desired) \r
+   if(ip->aggregated > 1)\r
+   {\r
+    f1 = "<span style=\"color:green\">";\r
+    f2 = "</span>";   \r
+    agreg_count++;\r
+   }\r
+   else if(ip->max < ip->desired) \r
    {\r
     f1 = "<span style=\"color:red\">";\r
     f2 = "</span>"; \r
@@ -419,9 +424,11 @@ style=\"cursor: pointer;\">+%d</a>]</span>",
 */\r
   fprintf(f, "<th style=\"text-align: right\">%Lu</th><th style=\"text-align: right\">%d</th>",\r
              total_direct, total_pktdown/i);\r
-  fprintf(f, "<th colspan=\"6\"><span style=\"color:red\">LIMIT %dx</span> \\r
-<span style=\"color:brown\">LOW-PRIO %dx</span></th></tr>\n</thead></table>\n",\r
-             limit_count, prio_count);\r
+  fprintf(f, "<th colspan=\"6\">\\r
+<span style=\"color:green\">AGR %dx</span> \\r
+<span style=\"color:red\">FUP %dx</span> \\r
+<span style=\"color:brown\">PRIO %dx</span></th></tr>\n</thead></table>\n",\r
+             agreg_count, limit_count, prio_count);\r
 \r
   if(ip6prefix)\r
   { \r
This page took 0.135516 seconds and 4 git commands to generate.