ahem
[svn/Prometheus-QoS/.git] / prometheus.c
index 25a7233a71ae2d7051dc185f133bdb9639bc6afb..4c63dfeede3422f118a06167c41c673dfdfc869c 100644 (file)
@@ -7,7 +7,7 @@
 /*  Credit: CZFree.Net,Martin Devera,Netdave,Aquarius,Gandalf  */\r
 /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  */\r
 \r
-/* Modified by: xChaos, 20110427\r
+/* Modified by: xChaos, 20110428\r
                  ludva, 20080415\r
  \r
    Prometheus QoS is free software; you can redistribute it and/or\r
@@ -839,20 +839,30 @@ void parse_ip_log(int argc, char **argv)
  f=fopen(str,"w");\r
  if(f)\r
  {\r
-  fprintf(f,"<table border><tr><th colspan=\"2\">%s %s</th><th colspan=\"2\">Data transfers</th><th align=\"right\">Min.speed</th></tr>\n ",month,year);\r
+  fprintf(f,"<table border><tr><th colspan=\"2\">%s %s</th><th align=\"right\">lms</th><th colspan=\"2\">Data transfers</th><th align=\"right\">Min.speed</th></tr>\n ",month,year);\r
 \r
   for_each(iplog,iplogs)\r
   {\r
    if(iplog->traffic)\r
    {\r
-    fprintf(f,"<tr><td align=\"right\">%d</td><th align=\"left\">%s</td><td align=\"right\">%ld M</td><th align=\"right\">%ld G</th><td align=\"right\">%ld kbps</th></tr>\n",\r
-              i++, iplog->name, iplog->traffic, iplog->traffic>>10, iplog->guaranted);\r
+    fprintf(f,"<tr><td align=\"right\">%d</td><th align=\"left\">%s</td><td align=\"right\">", i++, iplog->name); \r
+    if(iplog->lmsid > 0)\r
+    {\r
+     /*base URL will be configurable soon ... */\r
+     fprintf(f,"<a href=\"https://hermes.spoje.net/?m=customerinfo&amp;id=%d\">%04d</a>\n", 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
+              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><th colspan=\"3\" align=\"left\">Total:</th><th align=\"right\">%ld GB</th><th align=\"right\">%Ld kbps</th></tr>\n", total, line);\r
+  fprintf(f,"<tr><th colspan=\"4\" align=\"left\">Total:</th><th align=\"right\">%ld GB</th><th align=\"right\">%Ld kbps</th></tr>\n", total, line);\r
   fputs("</table>\n", f);\r
 \r
   if(i>10)\r
@@ -1123,6 +1133,7 @@ Credit: CZFree.Net, Martin Devera, Netdave, Aquarius, Gandalf\n\n",version);
    sharedip->traffic+=ip->traffic;\r
    ip->traffic=0;\r
    ip->mark=sharedip->mark; \r
+   ip->lmsid=sharedip->lmsid;\r
    break;\r
   }\r
   if(!sharedip)\r
@@ -1605,7 +1616,7 @@ Credit: CZFree.Net, Martin Devera, Netdave, Aquarius, Gandalf\n\n",version);
     }\r
     else if(ip->lmsid == 0)\r
     {\r
-     fputs("----",f);\r
+     fputs("-------",f);\r
     }\r
     fputs("</td>\n",f);    \r
    }\r
This page took 0.128466 seconds and 4 git commands to generate.