Hi Willy,

Please find the attached patch file for backporting to v1.7.0. I hope this
is okay.

Please do let me know if I can do anything else.

-=david=-

On 2 January 2017 at 15:57, Willy Tarreau <w...@1wt.eu> wrote:

> On Mon, Jan 02, 2017 at 02:58:15PM +0000, David Harrigan wrote:
> > Hi Willy,
> >
> > As requested, attached :-)
>
> Much better, applied now. Thanks!
> Willy
>



-- 
I prefer encrypted and signed messages.
Fingerprint: 110A F423 3647 54E2 880F ADAD 1C52 85BF B20A 22F9

No trees were harmed in the sending of this message, however, a number of
electrons were inconvenienced.
From 7c99a4b97d62e23f6a01a3dc5577028c2cd45f71 Mon Sep 17 00:00:00 2001
From: David Harrigan <dharri...@gmail.com>
Date: Tue, 3 Jan 2017 08:47:20 +0000
Subject: [PATCH] MINOR: stats: Support "select all" for backend actions

Allow the user to quickly select all servers within a group before invoking an
action.
---
 src/stats.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/stats.c b/src/stats.c
index 497aa477..14427445 100644
--- a/src/stats.c
+++ b/src/stats.c
@@ -636,7 +636,8 @@ static int stats_dump_fields_html(struct chunk *out, const struct field *stats,
 
 		if (flags & ST_SHOWADMIN)
 			chunk_appendf(out,
-			              "<td><input type=\"checkbox\" name=\"s\" value=\"%s\"></td>",
+			              "<td><input class='%s-checkbox' type=\"checkbox\" name=\"s\" value=\"%s\"></td>",
+			              field_str(stats, ST_F_SVNAME),;
 			              field_str(stats, ST_F_SVNAME));
 
 		chunk_appendf(out,
@@ -1642,7 +1643,12 @@ static void stats_dump_html_px_hdr(struct stream_interface *si, struct proxy *px
 
 	if ((px->cap & PR_CAP_BE) && px->srv && (appctx->ctx.stats.flags & STAT_ADMIN)) {
 		/* Column heading for Enable or Disable server */
-		chunk_appendf(&trash, "<th rowspan=2 width=1></th>");
+        chunk_appendf(&trash,
+                "<th rowspan=2 width=1><input type=\"checkbox\" \
+                onclick=\"for(c in document.getElementsByClassName('%s-checkbox')) \
+                document.getElementsByClassName('%s-checkbox').item(c).checked = this.checked\"></th>",
+                px->id,
+                px->id);
 	}
 
 	chunk_appendf(&trash,
-- 
2.11.0

Reply via email to