From c79cec7933f3a3906ef8903ca5ddcf28be30d1f2 Mon Sep 17 00:00:00 2001 From: PiBa-NL Date: Sun, 1 Nov 2015 02:30:39 +0100 Subject: haproxy-devel, user gui permissions, show backend usage, use-server action --- config/haproxy-devel/pkg/haproxy.inc | 8 ++++++-- config/haproxy-devel/pkg/haproxy_htmllist.inc | 16 ++++++++-------- 2 files changed, 14 insertions(+), 10 deletions(-) (limited to 'config/haproxy-devel/pkg') diff --git a/config/haproxy-devel/pkg/haproxy.inc b/config/haproxy-devel/pkg/haproxy.inc index ba36c089..d9f8242e 100644 --- a/config/haproxy-devel/pkg/haproxy.inc +++ b/config/haproxy-devel/pkg/haproxy.inc @@ -241,10 +241,14 @@ $a_filestype['writetodisk'] = array('name' => "Write to disk"); global $a_action; $a_action = array(); // -$a_action["use_backend"] = array('name' => "Use Backend", 'mode' => '', 'syntax' => 'use_backend {backend}', +$a_action["use_backend"] = array('name' => "Use Backend", 'mode' => '', 'syntax' => 'use_backend {backend}', 'usage' => 'frontend', 'fields' => array( 'backend' => array('name'=>"backend",'columnheader'=>"Backend",'type'=>"select",'size'=>"50",'mask'=>'backend') )); +$a_action["use_server"] = array('name' => "Use Server", 'mode' => '', 'syntax' => 'use-server {server}', 'usage' => 'backend', + 'fields' => array( + 'server' => array('name'=>"server",'columnheader'=>"Server",'type'=>"select",'size'=>"50",'mask'=>'server') + )); // $a_action["custom"] = array('name' => "Custom", 'mode' => '', 'fields' => array( @@ -356,7 +360,7 @@ $a_action["tcp-response_content_accept"] = array('name' => "tcp-response content $a_action["tcp-response_content_close"] = array('name' => "tcp-response content close", 'mode'=> '', 'syntax' => 'tcp-response content close'); $a_action["tcp-response_content_reject"] = array('name' => "tcp-response content reject", 'mode'=> '', 'syntax' => 'tcp-response content reject'); if (haproxy_version() >= '1.6') { - $a_action["tcp-response_content_lua"] = array('name' => "tcp-response content lua script", 'mode'=> '', 'syntax' => 'tcp-response content lua.{lua-function}', + $a_action["tcp-response_content_lua"] = array('name' => "tcp-response content lua script", 'mode'=> '', 'syntax' => 'tcp-response content lua.{lua-function}', 'usage' => 'backend', 'fields' => array( 'lua-function' => array('name'=>"lua-function",'columnheader'=>"lua function",'type'=>"textbox",'size'=>"50",'mask'=>'lua-function') )); diff --git a/config/haproxy-devel/pkg/haproxy_htmllist.inc b/config/haproxy-devel/pkg/haproxy_htmllist.inc index 4abfedd8..4e8ce428 100644 --- a/config/haproxy-devel/pkg/haproxy_htmllist.inc +++ b/config/haproxy-devel/pkg/haproxy_htmllist.inc @@ -88,20 +88,21 @@ class HaproxyHtmlList } if ($add_item) { if ($this->keyfield != "") { - if (isset($_POST[$this->tablename."_key".$x])) + if (isset($_POST[$this->tablename."_key".$x])) { $key = $_POST[$this->tablename."_key".$x]; - else { + } else { $key = $_POST[$this->tablename.$this->keyfield.$x]; - } + } } else { $key = ""; } $index = $_POST[$this->tablename."_rowindex".$x]; $value['_index'] = $index; - if (isset($values[$key])) + if (isset($values[$key])) { $values[] = $value; - else + } else { $values[$key] = $value; + } } } usort($values, 'sort_index'); @@ -195,13 +196,12 @@ class HaproxyHtmlList - "; - if (empty($this->keyfield)) { + if (empty($this->noindex)) { echo " @@ -237,7 +237,7 @@ class HaproxyHtmlList "; - if (empty($this->keyfield)) { + if (empty($this->noindex)) { echo " -- cgit v1.2.3