Skip to content

Commit

Permalink
haproxy-devel, use new print_apply_box function, and cleanup / small …
Browse files Browse the repository at this point in the history
…syntax changes, pkg 0.41
  • Loading branch information
PiBa-NL committed Jan 26, 2016
1 parent 8e9870b commit 2d861d9
Show file tree
Hide file tree
Showing 15 changed files with 87 additions and 158 deletions.
2 changes: 1 addition & 1 deletion net/pfSense-pkg-haproxy-devel/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# $FreeBSD$

PORTNAME= pfSense-pkg-haproxy-devel
PORTVERSION= 0.40
PORTVERSION= 0.41
PORTREVISION= 1
CATEGORIES= net
MASTER_SITES= # empty
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<!DOCTYPE packagegui SYSTEM "../schema/packages.dtd">
<?xml-stylesheet type="text/xsl" href="../xsl/package.xsl"?>
<packagegui>
<copyright>
<copyright>
<![CDATA[
/* $Id$ */
/* ====================================================================================== */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -441,89 +441,6 @@ function haproxy_version() {
return $haproxy_version;
}

function haproxy_css() {
if (!file_exists("/usr/local/www/bootstrap"))
return;
// quick fix to look a bit decent on bootstrapped pfSense..
echo <<<EOD
<style type="text/css">
.listtopic {
border-right: 1px solid #999999;
font-size: 11px;
background-color: #990000;
padding-right: 16px;
padding-left: 6px;
color: #FFFFFF;
font-weight: bold;
padding-top: 5px;
padding-bottom: 5px;
}
.tabcont {
background-color: #DDDDDD;
padding-right: 12px;
padding-left: 12px;
padding-top: 12px;
padding-bottom: 12px;
}
.vtable {
border-bottom: 1px solid #999999;
}
.vncell {
background-color: #DDDDDD;
padding-right: 20px;
padding-left: 8px;
border-bottom: 1px solid #999999;
}
.vncellreq {
background-color: #DDDDDD;
padding-right: 20px;
padding-left: 8px;
font-weight: bold;
border-bottom: 1px solid #999999;
}
.listhdrr {
background-color: #BBBBBB;
padding-right: 6px;
padding-left: 6px;
font-weight: bold;
border-right: 1px solid #999999;
border-bottom: 1px solid #999999;
font-size: 11px;
padding-top: 5px;
padding-bottom: 5px;
}
.listr {
background-color: #FFFFFF;
border-right: 1px solid #999999;
border-bottom: 1px solid #999999;
font-size: 11px;
padding-right: 6px;
padding-left: 6px;
padding-top: 4px;
padding-bottom: 4px;
}
.listlr {
background-color: #FFFFFF;
border-right: 1px solid #999999;
border-bottom: 1px solid #999999;
border-left: 1px solid #999999;
font-size: 11px;
padding-right: 6px;
padding-left: 6px;
padding-top: 4px;
padding-bottom: 4px;
}
.tabcont {
background-color: #DDDDDD;
padding-right: 12px;
padding-left: 12px;
padding-top: 12px;
padding-bottom: 12px;
}
</style>
EOD;
}

function haproxy_portoralias_to_list($port_or_alias) {
// input: a port or aliasname: 80 https MyPortAlias
// returns: a array of ports and portranges 80 443 8000:8010
Expand Down Expand Up @@ -1805,7 +1722,6 @@ function haproxy_writeconf($configpath) {

$transparent_clientip = false;
foreach ($bind['config'] as $frontend) {
//todo: check also use_backend actions
if (frontend_usetransparentbackend($frontend)) {
$transparent_clientip = true;
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -757,7 +757,7 @@ function hideElement(element, hide) {
//]]>
</script>

<?
<?php
}

?>
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
<pkginfolink>https://doc.pfsense.org/index.php/haproxy_package</pkginfolink>
<descr><![CDATA[The Reliable, High Performance TCP/HTTP(S) Load Balancer.&lt;br /&gt;
This package implements the TCP, HTTP and HTTPS balancing features from haproxy.&lt;br /&gt;
Supports ACLs for smart backend switching.&lt;br /&gt;
&lt;strong&gt;As of pkg v0.33 switched to using 1.6 stable releases.&lt;/strong&gt;]]></descr>
Supports ACLs for smart backend switching.]]></descr>
<website>http://haproxy.1wt.eu/</website>
<version>%%PKGVERSION%%</version>
<configurationfile>haproxy.xml</configurationfile>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,9 @@
print_info_box($savemsg);
}
if (file_exists($d_haproxyconfdirty_path)) {
print_info_box_np("The haproxy configuration has been changed.<br/>You must apply the changes in order for them to take effect.");
print_apply_box(sprintf(gettext("The haproxy configuration has been changed.%sYou must apply the changes in order for them to take effect."), "<br/>"));
}
haproxy_display_top_tabs_active($haproxy_tab_array['haproxy'], "files");
//haproxy_css();
?>
<form action="haproxy_files.php" method="post">
<div class="panel panel-default">
Expand All @@ -140,7 +139,7 @@
<a href="http://www.arpalert.org/src/haproxy-lua-api/1.6/">See the api for more information.</a>
</div>
<div class="table-responsive panel-body">
<?
<?php
$counter=0;
echo $fileslist->Draw($a_files);
?>
Expand All @@ -154,12 +153,12 @@
</div>

</form>
<?
<?php
haproxy_htmllist_js();
?>
<script type="text/javascript">
totalrows = <?php echo $counter; ?>;
<?
<?php
$fileslist->outputjavascript();
?>
</script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@
print_info_box($savemsg);
}
if (file_exists($d_haproxyconfdirty_path)) {
print_info_box_np("The haproxy configuration has been changed.<br/>You must apply the changes in order for them to take effect.");
print_apply_box(sprintf(gettext("The haproxy configuration has been changed.%sYou must apply the changes in order for them to take effect."), "<br/>"));
}
haproxy_display_top_tabs_active($haproxy_tab_array['haproxy'], "settings");

Expand Down Expand Up @@ -531,12 +531,12 @@ function group_input_with_text($name, $title, $type = 'text', $value = null, arr
});
});
</script>
<?
<?php
haproxy_htmllist_js();
?>
<script type="text/javascript">
totalrows = <?php echo $counter; ?>;
<?
<?php
$mailerslist->outputjavascript();
$resolverslist->outputjavascript();
?>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,9 @@ function array_moveitemsbefore(&$items, $before, $selected) {

if ($_POST['apply']) {
$result = haproxy_check_and_run($savemsg, true);
if ($result)
if ($result) {
unlink_if_exists($d_haproxyconfdirty_path);
}
} elseif ($_POST['del_x']) {
/* delete selected rules */
$deleted = false;
Expand Down Expand Up @@ -207,7 +208,7 @@ function haproxy_userlist_backend_servers($backendname) {

$display_apply = file_exists($d_haproxyconfdirty_path) ? "" : "none";
echo "<div id='showapplysettings' style='display: {$display_apply};'>";
print_info_box_np("The haproxy configuration has been changed.<br/>You must apply the changes in order for them to take effect.");
print_apply_box(sprintf(gettext("The haproxy configuration has been changed.%sYou must apply the changes in order for them to take effect."), "<br/>"));
echo "</div>";

haproxy_display_top_tabs_active($haproxy_tab_array['haproxy'], "frontend");
Expand Down Expand Up @@ -237,7 +238,7 @@ function js_callback(req) {
}
}
</script>
<?
<?php

function sort_sharedfrontends(&$a, &$b) {
// make sure the 'primary frontend' is the first in the array, after that sort by name.
Expand Down Expand Up @@ -280,7 +281,7 @@ function sort_sharedfrontends(&$a, &$b) {
</tr>
</thead>
<tbody class="user-entries">
<?
<?php
$textgray = "";
$first = true;
$last_frontend_shared = false;
Expand Down Expand Up @@ -310,7 +311,7 @@ function sort_sharedfrontends(&$a, &$b) {
<?endif?>
</td>
<td>
<?
<?php
if ($frontend['status']=='disabled'){
$iconfn = "disabled";
} else {
Expand All @@ -321,7 +322,7 @@ function sort_sharedfrontends(&$a, &$b) {
</a>
</td>
<td>
<?
<?php
$acls = get_frontend_acls($frontend);
$isaclset = "";
foreach ($acls as $acl) {
Expand Down Expand Up @@ -361,7 +362,7 @@ function sort_sharedfrontends(&$a, &$b) {
<?=$frontend['desc'];?>
</td>
<td>
<?
<?php
$first = true;
foreach($frontend['ipport'] as $addr) {
//if (!$first)
Expand All @@ -377,7 +378,7 @@ function sort_sharedfrontends(&$a, &$b) {
?>
</td>
<td>
<?
<?php
if ($frontend['type'] == 'http') {
$mainfrontend = get_primaryfrontend($frontend);
$sslused = get_frontend_uses_ssl($mainfrontend);
Expand All @@ -392,7 +393,7 @@ function sort_sharedfrontends(&$a, &$b) {
?>
</td>
<td>
<?
<?php
if (is_array($frontend['a_actionitems']['item'])) {
foreach ($frontend['a_actionitems']['item'] as $actionitem) {
if ($actionitem['action'] == "use_backend") {
Expand Down
Loading

0 comments on commit 2d861d9

Please sign in to comment.