aboutsummaryrefslogtreecommitdiffstats
path: root/config/haproxy-devel/pkg
diff options
context:
space:
mode:
authorPiBa-NL <pba_2k3@yahoo.com>2015-12-23 23:23:12 +0100
committerPiBa-NL <pba_2k3@yahoo.com>2015-12-23 23:23:12 +0100
commit5317a20269bd39459ca22737a35e494ca972bf88 (patch)
tree2afbdf9c22ae598779dd3211fb551a4a63513896 /config/haproxy-devel/pkg
parent3bd905893f4eeb15485783e49a8ea2af14b31f4e (diff)
downloadpfsense-packages-5317a20269bd39459ca22737a35e494ca972bf88.tar.gz
pfsense-packages-5317a20269bd39459ca22737a35e494ca972bf88.tar.bz2
pfsense-packages-5317a20269bd39459ca22737a35e494ca972bf88.zip
haproxy-devel, small fixes for showing/hiding acl fields not applicable, fix custom action, pkg v0.36
Diffstat (limited to 'config/haproxy-devel/pkg')
-rw-r--r--config/haproxy-devel/pkg/haproxy.inc2
-rw-r--r--config/haproxy-devel/pkg/haproxy_htmllist.inc24
2 files changed, 21 insertions, 5 deletions
diff --git a/config/haproxy-devel/pkg/haproxy.inc b/config/haproxy-devel/pkg/haproxy.inc
index 8dce42ee..c8a225a3 100644
--- a/config/haproxy-devel/pkg/haproxy.inc
+++ b/config/haproxy-devel/pkg/haproxy.inc
@@ -253,7 +253,7 @@ $a_action["use_server"] = array('name' => "Use Server", 'mode' => '', 'syntax' =
'server' => array('name'=>"server",'columnheader'=>"Server",'type'=>"select",'size'=>"50",'mask'=>'server')
));
//
-$a_action["custom"] = array('name' => "Custom", 'mode' => '',
+$a_action["custom"] = array('name' => "Custom", 'mode' => '', 'syntax' => '{customaction}',
'fields' => array(
array('name'=>"customaction",'columnheader'=>"Custom action",'type'=>"textbox",'size'=>"50",'mask'=>'freetext')
));
diff --git a/config/haproxy-devel/pkg/haproxy_htmllist.inc b/config/haproxy-devel/pkg/haproxy_htmllist.inc
index 7eaad023..d5386fcd 100644
--- a/config/haproxy-devel/pkg/haproxy_htmllist.inc
+++ b/config/haproxy-devel/pkg/haproxy_htmllist.inc
@@ -42,8 +42,8 @@ class HaproxyHtmlList
<tableId>_field_changed(tableId, rowNr, fieldId, field)
*/
- private $tablename = "";
- private $fields = array();
+ public $tablename = "";
+ public $fields = array();
public $editmode = false;
public $fields_details = null;
public $keyfield = "";
@@ -269,7 +269,13 @@ class HaproxyHtmlList
foreach($itemdetails as $item) {
$itemname = $item['name'];
$itemvalue = $value[$itemname];
- //TODO don't filter empty items, filter context un-related items through customizable function..
+ if ($this->fields_details_showfieldfunction != null) {
+ // filter context un-related items through customizable function.
+ $fn = &$this->fields_details_showfieldfunction;
+ if ($fn($this, $itemname, $value) == false) {
+ continue;
+ }
+ } else
if (empty($itemvalue)) {
continue;
}
@@ -488,7 +494,10 @@ function haproxy_htmllist_js(){
subtr.appendChild(subtd);
subtd = d.createElement("td");
subtd.setAttribute("class","vncell");
- subtd.innerHTML = field['description'] + "<br/>" + fieldhtml;
+ if (field['description']) {
+ fieldhtml = field['description'] + "<br/>" + fieldhtml;
+ }
+ subtd.innerHTML = fieldhtml;
subtr.appendChild(subtd);
table.appendChild(subtr);
}
@@ -539,6 +548,13 @@ function haproxy_htmllist_js(){
if (typeof fn === 'function'){
fn(tableId, totalrows);
}
+
+ // show/hide conditional fields if applicable using a custom function.
+ javascript_event = tableId + "_listitem_change";
+ var fn = window[javascript_event];
+ if (typeof fn === 'function'){
+ fn(tableId, "toggle_details", totalrows, null);
+ }
}
function editRow(num) {
var trview = document.getElementById('tr_view_' + num);