Changeset 10044


Ignore:
Timestamp:
07/30/08 01:06:32 (5 years ago)
Author:
BrainSlayer
Message:

channelshift for each vap now, better code

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/router/httpd/visuals/dd-wrt.c

    r10043 r10044  
    16111611  for (i = 0; i < count; i++) 
    16121612    { 
    1613           sprintf (var, "ath%d", i); 
    1614           websWrite (wp, "<option value=\"%s\" %s >%s</option>\n", 
    1615                           var, nvram_match ("wifi_display", var) ? "selected=\"selected\"" : "", var); 
    1616           char *names = nvram_nget ("ath%d_vifs", i); 
    1617           foreach (var, names, next) 
    1618           { 
    1619                 websWrite (wp, "<option value=\"%s\" %s >%s</option>\n", 
    1620                         var, nvram_match ("wifi_display", var) ? "selected=\"selected\"" : "", var); 
     1613      sprintf (var, "ath%d", i); 
     1614      websWrite (wp, "<option value=\"%s\" %s >%s</option>\n", 
     1615                 var, nvram_match ("wifi_display", 
     1616                                   var) ? "selected=\"selected\"" : "", var); 
     1617      char *names = nvram_nget ("ath%d_vifs", i); 
     1618      foreach (var, names, next) 
     1619      { 
     1620        websWrite (wp, "<option value=\"%s\" %s >%s</option>\n", 
     1621                   var, nvram_match ("wifi_display", 
     1622                                     var) ? "selected=\"selected\"" : "", 
     1623                   var); 
    16211624      } 
    16221625    } 
     
    16581661{ 
    16591662  websWrite (wp, "<div class=\"setting\">\n"); 
    1660   websWrite (wp, "<div class=\"label\"><script type=\"text/javascript\">Capture(%s)</script></div>\n", 
    1661                   propname); 
    1662   websWrite (wp, "<input class=\"spaceradio\" type=\"radio\" value=\"0\" name=\"%s\" %s><script type=\"text/javascript\">Capture(share.disable)</script></input>&nbsp;\n", 
    1663                   nvname, nvram_default_match (nvname, "0", "0") ? "checked=\"checked\"" : ""); 
    1664   websWrite (wp, "<input class=\"spaceradio\" type=\"radio\" value=\"1\" name=\"%s\" %s><script type=\"text/javascript\">Capture(share.enable)</script></input>&nbsp;\n", 
    1665                   nvname, nvram_default_match (nvname, "1", "0") ? "checked=\"checked\"" : ""); 
     1663  websWrite (wp, 
     1664             "<div class=\"label\"><script type=\"text/javascript\">Capture(%s)</script></div>\n", 
     1665             propname); 
     1666  websWrite (wp, 
     1667             "<input class=\"spaceradio\" type=\"radio\" value=\"0\" name=\"%s\" %s><script type=\"text/javascript\">Capture(share.disable)</script></input>&nbsp;\n", 
     1668             nvname, nvram_default_match (nvname, "0", 
     1669                                          "0") ? "checked=\"checked\"" : ""); 
     1670  websWrite (wp, 
     1671             "<input class=\"spaceradio\" type=\"radio\" value=\"1\" name=\"%s\" %s><script type=\"text/javascript\">Capture(share.enable)</script></input>&nbsp;\n", 
     1672             nvname, nvram_default_match (nvname, "1", 
     1673                                          "0") ? "checked=\"checked\"" : ""); 
    16661674  websWrite (wp, "</div>\n"); 
    16671675} 
     
    22652273ej_show_bridgetable (webs_t wp, int argc, char_t ** argv) 
    22662274{ 
    2267 #ifdef HAVE_MICRO  //brctl N/A in micro 
     2275#ifdef HAVE_MICRO               //brctl N/A in micro 
    22682276  return; 
    22692277#endif 
     
    29322940             "<input class=\"spaceradio\" type=\"radio\" value=\"0\" onclick=\"show_layer_ext(this, '%s_idrts', false);\" name=\"%s_rts\" %s><script type=\"text/javascript\">Capture(share.disabled)</script></input>&nbsp;\n", 
    29332941             vvar, var, nvram_default_match (ssid, "0", 
    2934                                             "0") ? "checked=\"checked\"" : 
     2942                                             "0") ? "checked=\"checked\"" : 
    29352943             ""); 
    29362944  websWrite (wp, 
    29372945             "<input class=\"spaceradio\" type=\"radio\" value=\"1\" onclick=\"show_layer_ext(this, '%s_idrts', true);\" name=\"%s_rts\" %s><script type=\"text/javascript\">Capture(share.enabled)</script></input>\n", 
    29382946             vvar, var, nvram_default_match (ssid, "1", 
    2939                                             "0") ? "checked=\"checked\"" : 
     2947                                             "0") ? "checked=\"checked\"" : 
    29402948             ""); 
    29412949  websWrite (wp, "</div>\n"); 
     
    30453053} 
    30463054 
     3055#ifdef HAVE_MADWIFI 
     3056static void 
     3057show_chanshift (webs_t * wp, char *wl_chanshift) 
     3058{ 
     3059  websWrite (wp, "<div class=\"setting\">\n"); 
     3060  websWrite (wp, 
     3061             "<div class=\"label\"><script type=\"text/javascript\">Capture(wl_basic.chanshift)</script></div>\n<select name=\"%s\">\n", 
     3062             wl_chanshift); 
     3063  websWrite (wp, "<script type=\"text/javascript\">\n//<![CDATA[\n"); 
     3064  websWrite (wp, 
     3065             "document.write(\"<option value=\\\"-1\\\" %s >-1</option>\");\n", 
     3066             nvram_default_match (wl_chanshift, "-1", 
     3067                                  "-1") ? "selected=\\\"selected\\\"" : ""); 
     3068  websWrite (wp, 
     3069             "document.write(\"<option value=\\\"0\\\" %s >0</option>\");\n", 
     3070             nvram_default_match (wl_chanshift, "0", 
     3071                                  "-1") ? "selected=\\\"selected\\\"" : ""); 
     3072  websWrite (wp, 
     3073             "document.write(\"<option value=\\\"1\\\" %s >1</option>\");\n", 
     3074             nvram_default_match (wl_chanshift, "1", 
     3075                                  "-1") ? "selected=\\\"selected\\\"" : ""); 
     3076  websWrite (wp, "//]]>\n</script>\n</select>\n</div>\n"); 
     3077 
     3078} 
     3079#endif 
    30473080static int 
    30483081show_virtualssid (webs_t wp, char *prefix) 
     
    30863119 
    30873120#ifdef HAVE_MADWIFI 
    3088   sprintf (wl_chanshift, "%s_chanshift", var); 
    3089   websWrite (wp, "<div class=\"setting\">\n"); 
    3090   websWrite (wp, 
    3091              "<div class=\"label\"><script type=\"text/javascript\">Capture(wl_basic.chanshift)</script></div>\n<select name=\"%s\">\n", 
    3092              wl_chanshift); 
    3093   websWrite (wp, "<script type=\"text/javascript\">\n//<![CDATA[\n"); 
    3094   websWrite (wp, 
    3095              "document.write(\"<option value=\\\"-1\\\" %s >-1</option>\");\n", 
    3096              nvram_default_match (wl_chanshift, "-1", 
    3097                                   "-1") ? "selected=\\\"selected\\\"" : ""); 
    3098   websWrite (wp, 
    3099              "document.write(\"<option value=\\\"0\\\" %s >0</option>\");\n", 
    3100              nvram_default_match (wl_chanshift, "0", 
    3101                                   "-1") ? "selected=\\\"selected\\\"" : ""); 
    3102   websWrite (wp, 
    3103              "document.write(\"<option value=\\\"1\\\" %s >1</option>\");\n", 
    3104              nvram_default_match (wl_chanshift, "1", 
    3105                                   "-1") ? "selected=\\\"selected\\\"" : ""); 
    3106   websWrite (wp, "//]]>\n</script>\n</select>\n</div>\n"); 
     3121    sprintf (wl_chanshift, "%s_chanshift", var); 
     3122    show_chanshift (wp, wl_chanshift); 
    31073123 
    31083124    sprintf (wl_protmode, "%s_protmode", var); 
     
    35383554  if (nvram_match ("ath_regulatory", "1") || !issuperchannel ()) 
    35393555    { 
    3540           showRadio (wp, "wl_basic.outband", wl_outdoor); 
     3556      showRadio (wp, "wl_basic.outband", wl_outdoor); 
    35413557    } 
    35423558#endif 
     
    36583674 
    36593675#ifdef HAVE_MADWIFI 
    3660   websWrite (wp, "<div class=\"setting\">\n"); 
    3661   websWrite (wp, 
    3662              "<div class=\"label\"><script type=\"text/javascript\">Capture(wl_basic.chanshift)</script></div>\n<select name=\"%s\">\n", 
    3663              wl_chanshift); 
    3664   websWrite (wp, "<script type=\"text/javascript\">\n//<![CDATA[\n"); 
    3665   websWrite (wp, 
    3666              "document.write(\"<option value=\\\"-1\\\" %s >-1</option>\");\n", 
    3667              nvram_default_match (wl_chanshift, "-1", 
    3668                                   "-1") ? "selected=\\\"selected\\\"" : ""); 
    3669   websWrite (wp, 
    3670              "document.write(\"<option value=\\\"0\\\" %s >0</option>\");\n", 
    3671              nvram_default_match (wl_chanshift, "0", 
    3672                                   "-1") ? "selected=\\\"selected\\\"" : ""); 
    3673   websWrite (wp, 
    3674              "document.write(\"<option value=\\\"1\\\" %s >1</option>\");\n", 
    3675              nvram_default_match (wl_chanshift, "1", 
    3676                                   "-1") ? "selected=\\\"selected\\\"" : ""); 
    3677   websWrite (wp, "//]]>\n</script>\n</select>\n</div>\n"); 
    3678  
     3676  show_chanshift (wp, wl_chanshift); 
    36793677#endif 
    36803678  if (nvram_match (wl_mode, "ap") || nvram_match (wl_mode, "wdsap") 
Note: See TracChangeset for help on using the changeset viewer.