]> granicus.if.org Git - apache/commitdiff
When using the LB Balancer manager, if you disabled
authorJim Jagielski <jim@apache.org>
Fri, 12 Aug 2005 15:31:03 +0000 (15:31 +0000)
committerJim Jagielski <jim@apache.org>
Fri, 12 Aug 2005 15:31:03 +0000 (15:31 +0000)
a member, then clicked on another member and/or
itself again, the member would be re-enabled. This
was due to the form being "submitted" and
'dw' being null (observed with Safari). Anyway,
moving to a radio makes it explicit.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@232314 13f79535-47bb-0310-9956-ffa450edef68

modules/proxy/mod_proxy_balancer.c

index 38314b26df48b8b5a2509ee680b24d00cf462efb..af409f67a2ca69cad94d68fd65466eb78f72e7f6 100644 (file)
@@ -691,10 +691,12 @@ static int balancer_handler(request_rec *r)
             else
                 *wsel->s->redirect = '\0';
         }
-        if ((val = apr_table_get(params, "dw")))
-            wsel->s->status |= PROXY_WORKER_DISABLED;
-        else
-            wsel->s->status &= ~PROXY_WORKER_DISABLED;
+        if ((val = apr_table_get(params, "dw"))) {
+            if (!strcasecmp(val, "Disable"))
+                wsel->s->status |= PROXY_WORKER_DISABLED;
+            else if (!strcasecmp(val, "Enable"))
+                wsel->s->status &= ~PROXY_WORKER_DISABLED;
+        }
 
     }
     if (apr_table_get(params, "xml")) {
@@ -801,9 +803,12 @@ static int balancer_handler(request_rec *r)
             ap_rputs("<tr><td>Route Redirect:</td><td><input name=\"rr\" type=text ", r);
             ap_rvputs(r, "value=\"", wsel->redirect, NULL); 
             ap_rputs("\"></td><tr>\n", r);            
-            ap_rputs("<tr><td>Disabled:</td><td><input name=\"dw\" type=checkbox", r);
+            ap_rputs("<tr><td>Status:</td><td>Disabled: <input name=\"dw\" value=\"Disable\" type=radio", r);
             if (wsel->s->status & PROXY_WORKER_DISABLED)
                 ap_rputs(" checked", r);
+            ap_rputs("> | Enabled: <input name=\"dw\" value=\"Enable\" type=radio", r);
+            if (!(wsel->s->status & PROXY_WORKER_DISABLED))
+                ap_rputs(" checked", r);
             ap_rputs("></td><tr>\n", r);            
             ap_rputs("<tr><td colspan=2><input type=submit value=\"Submit\"></td></tr>\n", r);
             ap_rvputs(r, "</table>\n<input type=hidden name=\"s\" ", NULL);