Changeset 3084
- Timestamp:
- 09/18/10 07:01:47 (14 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/oscam-http.c
r3081 r3084 115 115 tpl_printf(vars, 0, "READERRESTARTSECONDS", "%d", cfg->reader_restart_seconds); 116 116 117 tpl_printf(vars, 0, "TMP", "READERAUTOLOADBALANCE%d", cfg->lb_mode);118 tpl_addVar(vars, 0, tpl_getVar(vars, "TMP"), "selected");119 120 tpl_printf(vars, 0, "READERAUTOLOADBALANCES", "%d",cfg->lb_save);121 122 117 if (cfg->resolve_gethostbyname == 1) 123 118 tpl_addVar(vars, 0, "RESOLVER1", "selected"); … … 127 122 128 123 fputs(tpl_getTpl(vars, "CONFIGGLOBAL"), f); 124 } 125 126 void send_oscam_config_loadbalancer(struct templatevars *vars, FILE *f, struct uriparams *params, struct in_addr in) { 127 int i; 128 if (strcmp(getParam(params, "action"),"execute") == 0) { 129 130 memset(cfg->ser_device, 0, sizeof(cfg->ser_device)); 131 for(i = 0; i < (*params).paramcount; ++i) { 132 if ((strcmp((*params).params[i], "part")) && (strcmp((*params).params[i], "action"))) { 133 //tpl_printf(vars, 1, "MESSAGE", "Parameter: %s set to Value: %s<BR>\n", (*params).params[i], (*params).values[i]); 134 //we use the same function as used for parsing the config tokens 135 if((*params).values[i][0]) 136 chk_t_global((*params).params[i], (*params).values[i]); 137 } 138 } 139 tpl_addVar(vars, 1, "MESSAGE", "<BR><BR><B>Configuration Loadbalancer done.</B><BR><BR>"); 140 if(write_config()==0) refresh_oscam(REFR_SERVER, in); 141 else tpl_addVar(vars, 1, "MESSAGE", "<B>Write Config failed</B><BR><BR>"); 142 } 143 144 tpl_printf(vars, 0, "TMP", "LBMODE%d", cfg->lb_mode); 145 tpl_addVar(vars, 0, tpl_getVar(vars, "TMP"), "selected"); 146 147 tpl_printf(vars, 0, "LBSAVE", "%d",cfg->lb_save); 148 149 tpl_printf(vars, 0, "LBNBESTREADERS", "%d",cfg->lb_nbest_readers); 150 tpl_printf(vars, 0, "LBNFBREADERS", "%d",cfg->lb_nfb_readers); 151 tpl_printf(vars, 0, "LBMINECMCOUNT", "%d",cfg->lb_min_ecmcount); 152 tpl_printf(vars, 0, "LBMAXECEMCOUNT", "%d",cfg->lb_max_ecmcount); 153 tpl_printf(vars, 0, "LBREOPENSECONDS", "%d",cfg->lb_reopen_seconds); 154 155 fputs(tpl_getTpl(vars, "CONFIGLOADBALANCER"), f); 156 129 157 } 130 158 … … 500 528 } 501 529 } 502 tpl_addVar(vars, 1, "MESSAGE", "<BR><BR><B>Configuration Monitordone. You should restart Oscam now.</B><BR><BR>");530 tpl_addVar(vars, 1, "MESSAGE", "<BR><BR><B>Configuration Serial done. You should restart Oscam now.</B><BR><BR>"); 503 531 if(write_config()==0) refresh_oscam(REFR_SERVER, in); 504 532 else tpl_addVar(vars, 1, "MESSAGE", "<B>Write Config failed</B><BR><BR>"); … … 648 676 else if (!strcmp(part,"monitor")) send_oscam_config_monitor(vars, f, params, in); 649 677 else if (!strcmp(part,"serial")) send_oscam_config_serial(vars, f, params, in); 678 else if (!strcmp(part,"loadbalancer")) send_oscam_config_loadbalancer(vars, f, params, in); 650 679 else send_oscam_config_global(vars, f, params, in); 651 680 } -
trunk/oscam-http.h
r3069 r3084 264 264 <TR>\n\ 265 265 <TD CLASS=\"configmenu\"><A HREF=\"config.html?part=global\">Global</TD>\n\ 266 <TD CLASS=\"configmenu\"><A HREF=\"config.html?part=loadbalancer\">Loadbalancer</TD>\n\ 266 267 <TD CLASS=\"configmenu\"><A HREF=\"config.html?part=camd33\">Camd3.3</TD>\n\ 267 268 <TD CLASS=\"configmenu\"><A HREF=\"config.html?part=camd35\">Camd3.5</TD>\n\ … … 966 967 <TR><TD>Prefer local cards:</TD><TD><input name=\"preferlocalcards\" type=\"checkbox\" value=\"1\" ##PREFERLOCALCARDS##></TD></TR>\n\ 967 968 <TR><TD>Save init history:</TD><TD><input name=\"saveinithistory\" type=\"checkbox\" value=\"1\" ##SAVEINITHISTORY##></TD></TR>\n\ 968 <TR><TD>Reader autoloadbalance:</TD>\n\969 <TD><select name=\"readerautoloadbalance\">\n\970 <option value=\"0\" ##READERAUTOLOADBALANCE0##>0 - Loadbalancer disabled (send to all readers)</option>\n\971 <option value=\"1\" ##READERAUTOLOADBALANCE1##>1 - Fastest reader first</option>\n\972 <option value=\"2\" ##READERAUTOLOADBALANCE2##>2 - Oldest reader first</option>\n\973 <option value=\"3\" ##READERAUTOLOADBALANCE3##>3 - Lowest usagelevel</option>\n\974 </select></TD></TR>\n\975 <TR><TD>Reader autoloadbalance save:</TD><TD><input name=\"readerautoloadbalance_save\" type=\"text\" size=\"5\" maxlength=\"5\" value=\"##READERAUTOLOADBALANCES##\"></TD></TR>\n\976 969 <TR><TD>Reader restart seconds:</TD><TD><input name=\"readerrestartseconds\" type=\"text\" size=\"5\" maxlength=\"5\" value=\"##READERRESTARTSECONDS##\"></TD></TR>\n\ 977 970 <TR><TD>Resolver:</TD>\n\ … … 980 973 <option value=\"1\" ##RESOLVER1##>1 - gethostbyname()</option>\n\ 981 974 </select></TD></TR>\n\ 975 <TR><TD colspan=\"2\" align=\"right\"><input type=\"submit\" value=\"OK\" ##BTNDISABLED##>\n</TD></TR>\n\ 976 </TABLE>\n\ 977 </form>\n\ 978 ##TPLFOOTER##" 979 980 #define TPLCONFIGLOADBALANCER "\ 981 ##TPLHEADER##\ 982 ##TPLMENU##\n\ 983 ##TPLCONFIGMENU##\n\ 984 <BR><BR>\n\ 985 ##MESSAGE##\ 986 <form action=\"config.html\" method=\"get\">\n\ 987 <input name=\"part\" type=\"hidden\" value=\"loadbalancer\">\n\ 988 <input name=\"action\" type=\"hidden\" value=\"execute\">\n\ 989 <TABLE class=\"config\" cellspacing=\"0\">\n\ 990 <TR><TH> </TH><TH>Edit Loadbalancer Config</TH></TR>\n\ 991 <TR><TD>Loadbalance Mode:</TD>\n\ 992 <TD><select name=\"lb_mode\">\n\ 993 <option value=\"0\" ##LBMODE0##>0 - Loadbalancer disabled (send to all readers)</option>\n\ 994 <option value=\"1\" ##LBMODE1##>1 - Fastest reader first</option>\n\ 995 <option value=\"2\" ##LBMODE2##>2 - Oldest reader first</option>\n\ 996 <option value=\"3\" ##LBMODE3##>3 - Lowest usagelevel</option>\n\ 997 </select></TD></TR>\n\ 998 <TR><TD>Loadbalance Save:</TD><TD><input name=\"lb_save\" type=\"text\" size=\"5\" maxlength=\"5\" value=\"##LBSAVE##\"></TD></TR>\n\ 999 <TR><TD>No. best readers:</TD><TD><input name=\"lb_nbest_readers\" type=\"text\" size=\"5\" maxlength=\"5\" value=\"##LBNBESTREADERS##\"></TD></TR>\n\ 1000 <TR><TD>No. fallback readers:</TD><TD><input name=\"lb_nfb_readers\" type=\"text\" size=\"5\" maxlength=\"5\" value=\"##LBNFBREADERS##\"></TD></TR>\n\ 1001 <TR><TD>Min ECM count:</TD><TD><input name=\"lb_min_ecmcount\" type=\"text\" size=\"5\" maxlength=\"5\" value=\"##LBMINECMCOUNT##\"></TD></TR>\n\ 1002 <TR><TD>Max ECM count:</TD><TD><input name=\"lb_max_ecmcount\" type=\"text\" size=\"5\" maxlength=\"5\" value=\"##LBMAXECEMCOUNT##\"></TD></TR>\n\ 1003 <TR><TD>Time to reopen:</TD><TD><input name=\"lb_reopen_seconds\" type=\"text\" size=\"5\" maxlength=\"5\" value=\"##LBREOPENSECONDS##\"></TD></TR>\n\ 982 1004 <TR><TD colspan=\"2\" align=\"right\"><input type=\"submit\" value=\"OK\" ##BTNDISABLED##>\n</TD></TR>\n\ 983 1005 </TABLE>\n\ … … 1230 1252 "CONFIGNEWCAMD", 1231 1253 "CONFIGGLOBAL", 1254 "CONFIGLOADBALANCER", 1232 1255 "CONFIGCAMD33", 1233 1256 "CONFIGCAMD35", … … 1303 1326 TPLCONFIGNEWCAMD, 1304 1327 TPLCONFIGGLOBAL, 1328 TPLCONFIGLOADBALANCER, 1305 1329 TPLCONFIGCAMD33, 1306 1330 TPLCONFIGCAMD35,
Note:
See TracChangeset
for help on using the changeset viewer.