aboutsummaryrefslogtreecommitdiffstats
path: root/config/haproxy-devel/www/haproxy_listeners.php
diff options
context:
space:
mode:
Diffstat (limited to 'config/haproxy-devel/www/haproxy_listeners.php')
-rw-r--r--config/haproxy-devel/www/haproxy_listeners.php63
1 files changed, 36 insertions, 27 deletions
diff --git a/config/haproxy-devel/www/haproxy_listeners.php b/config/haproxy-devel/www/haproxy_listeners.php
index c7288e7d..35d9ba54 100644
--- a/config/haproxy-devel/www/haproxy_listeners.php
+++ b/config/haproxy-devel/www/haproxy_listeners.php
@@ -35,6 +35,7 @@ require_once("haproxy.inc");
require_once("certs.inc");
require_once("haproxy_utils.inc");
require_once("pkg_haproxy_tabs.inc");
+require_once("haproxy_gui.inc");
$changedesc = "Services: HAProxy: Frontends";
@@ -85,7 +86,8 @@ if ($_GET['act'] == "del") {
if (isset($a_frontend[$id])) {
if (!$input_errors) {
unset($a_frontend[$id]);
- write_config();
+ $changedesc .= " Frontend delete";
+ write_config($changedesc);
touch($d_haproxyconfdirty_path);
}
header("Location: haproxy_listeners.php");
@@ -132,23 +134,24 @@ echo "<br/></div>";
?>
<script type="text/javascript" language="javascript" src="/javascript/haproxy_geturl.js"></script>
<script language="javascript">
-function toggle_on(button, image) {
- var item = document.getElementById(button);
- item.src = image;
+function set_content(elementid, image) {
+ var item = document.getElementById(elementid);
+ item.innerHTML = image;
}
function js_callback(req) {
showapplysettings.style.display = 'block';
+
if(req.content != '') {
var itemsplit = req.content.split("|");
buttonid = itemsplit[0];
enabled = itemsplit[1];
if (enabled == 1){
- img = 'pass';
+ img = "<?=haproxyicon("enabled", gettext("click to toggle enable/disable this frontend"))?>";
} else {
- img = 'reject';
+ img = "<?=haproxyicon("disabled", gettext("click to toggle enable/disable this frontend"))?>";
}
- toggle_on('btn_'+buttonid, './themes/<?=$g['theme'];?>/images/icons/icon_'+img+'.gif');
+ set_content('btn_'+buttonid, img);
}
}
</script>
@@ -197,9 +200,6 @@ function js_callback(req) {
}
ksort($a_frontend_grouped);
- $img_cert = "/themes/{$g['theme']}/images/icons/icon_frmfld_cert.png";
- $img_adv = "/themes/{$g['theme']}/images/icons/icon_advanced.gif";
- $img_acl = "/themes/{$g['theme']}/images/icons/icon_ts_rule.gif";
$textgray = "";
$first = true;
$last_frontend_shared = false;
@@ -218,13 +218,12 @@ function js_callback(req) {
<td class="listlr" ondblclick="document.location='haproxy_listeners_edit.php?id=<?=$frontendname;?>';">
<?
if ($frontend['status']=='disabled'){
- $iconfn = "reject";
+ $iconfn = "disabled";
} else {
- $iconfn = "pass";
+ $iconfn = "enabled";
}?>
- <a href='javascript:getURL("?id=<?=$frontendname;?>&amp;action=toggle&amp;", js_callback);'>
- <img id="btn_<?=$frontendname;?>" src="./themes/<?= $g['theme']; ?>/images/icons/icon_<?=$iconfn;?>.gif" width="11" height="11" border="0"
- title="<?=gettext("click to toggle enable/disable this frontend");?>" alt="icon" />
+ <a id="btn_<?=$frontendname;?>" href='javascript:getURL("?id=<?=$frontendname;?>&amp;action=toggle&amp;", js_callback);'>
+ <?=haproxyicon($iconfn, gettext("click to toggle enable/disable this frontend"))?>
</a>
</td>
<td class="listr" style="<?=$frontend['secondary']=='yes'?"visibility:hidden;":""?>" ondblclick="document.location='haproxy_listeners_edit.php?id=<?=$frontendname;?>';">
@@ -235,11 +234,12 @@ function js_callback(req) {
$acls = get_frontend_acls($frontend);
$isaclset = "";
foreach ($acls as $acl) {
- $isaclset .= "&#10;" . htmlspecialchars($acl['descr']);
+ $isaclset .= "\n" . htmlspecialchars($acl['descr']);
+ }
+ if ($isaclset) {
+ echo haproxyicon("acl", gettext("acl's used") . ": {$isaclset}");
}
- if ($isaclset)
- echo "<img src=\"$img_acl\" title=\"" . gettext("acl's used") . ": {$isaclset}\" border=\"0\" />";
-
+
if (get_frontend_uses_ssl($frontend)) {
$cert = lookup_cert($frontend['ssloffloadcert']);
$descr = htmlspecialchars($cert['descr']);
@@ -252,14 +252,15 @@ function js_callback(req) {
}
}
}
- echo '<img src="'.$img_cert.'" title="SSL offloading cert: '.$descr.'" alt="SSL offloading" border="0" height="16" width="16" />';
+ echo haproxyicon("cert", "SSL offloading cert: {$descr}");
}
$isadvset = "";
if ($frontend['advanced_bind']) $isadvset .= "Advanced bind: ".htmlspecialchars($frontend['advanced_bind'])."\r\n";
if ($frontend['advanced']) $isadvset .= "Advanced pass thru setting used\r\n";
- if ($isadvset)
- echo "<img src=\"$img_adv\" title=\"" . gettext("Advanced settings set") . ": {$isadvset}\" border=\"0\" />";
+ if ($isadvset) {
+ echo haproxyicon("advanced", gettext("Advanced settings set") . ": {$isadvset}");
+ }
?>
</td>
<td class="listr" ondblclick="document.location='haproxy_listeners_edit.php?id=<?=$frontendname;?>';">
@@ -277,7 +278,7 @@ function js_callback(req) {
print "<div style='white-space:nowrap;'>";
print "{$addr['addr']}:{$addr['port']}";
if ($addr['ssl'] == 'yes') {
- echo '<img src="'.$img_cert.'" title="SSL offloading" alt="SSL" border="0" height="11" width="11" />';
+ echo haproxyicon("cert", "SSL offloading");
}
print "</div";
$first = false;
@@ -327,9 +328,15 @@ function js_callback(req) {
<td class="list" nowrap>
<table border="0" cellspacing="0" cellpadding="1">
<tr>
- <td valign="middle"><a href="haproxy_listeners_edit.php?id=<?=$frontendname;?>"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" title="<?=gettext("edit frontend");?>" width="17" height="17" border="0" /></a></td>
- <td valign="middle"><a href="haproxy_listeners.php?act=del&amp;id=<?=$frontendname;?>" onclick="return confirm('Do you really want to delete this entry?')"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" title="<?=gettext("delete frontend");?>" width="17" height="17" border="0" /></a></td>
- <td valign="middle"><a href="haproxy_listeners_edit.php?dup=<?=$frontendname;?>"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" title="<?=gettext("clone frontend");?>" width="17" height="17" border="0" /></a></td>
+ <td valign="middle"><a href="haproxy_listeners_edit.php?id=<?=$frontendname;?>">
+ <?=haproxyicon("edit", gettext("edit frontend"))?>
+ </a></td>
+ <td valign="middle"><a href="haproxy_listeners.php?act=del&amp;id=<?=$frontendname;?>" onclick="return confirm('Do you really want to delete this entry?')">
+ <?=haproxyicon("delete", gettext("delete frontend"))?>
+ </a></td>
+ <td valign="middle"><a href="haproxy_listeners_edit.php?dup=<?=$frontendname;?>">
+ <?=haproxyicon("clone", gettext("clone frontend"))?>
+ </a></td>
</tr>
</table>
</td>
@@ -342,7 +349,9 @@ function js_callback(req) {
<td class="list">
<table border="0" cellspacing="0" cellpadding="1">
<tr>
- <td valign="middle"><a href="haproxy_listeners_edit.php"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" title="<?=gettext("add new frontend");?>" width="17" height="17" border="0" /></a></td>
+ <td valign="middle"><a href="haproxy_listeners_edit.php">
+ <?=haproxyicon("add", gettext("add new frontend"))?>
+ </a></td>
</tr>
</table>
</td>