Example #1
0
function get_vip_status()
{
    global $config;
    if (empty($config['vinterfaces']['carp'])) {
        return "";
    }
    $a_vipaddrs = array();
    foreach ($config['vinterfaces']['carp'] as $carp) {
        $ifinfo = get_carp_info($carp['if']);
        //$a_vipaddrs[] = $carp['vipaddr']." ({$ifinfo['state']},{$ifinfo['advskew']})";
        $a_vipaddrs[] = $carp['vipaddr'] . " ({$ifinfo['state']})";
    }
    return join(', ', $a_vipaddrs);
}
Example #2
0
}
?>
	<table width="100%" border="0" cellpadding="6" cellspacing="0">
	<?php 
html_titleline_checkbox("enable", gettext("HAST (Highly Available Storage)"), !empty($pconfig['enable']) ? true : false, gettext("Enable"), "");
?>
	<?php 
echo html_text("nodeid", gettext("Node ID"), htmlspecialchars($nodeid));
?>
	<?php 
echo html_text("nodename", gettext("Node Name"), htmlspecialchars($nodename));
?>
	<?php 
$a_vipaddrs = array();
foreach ($a_carp as $carp) {
    $ifinfo = get_carp_info($carp['if']);
    //$a_vipaddrs[] = $carp['vipaddr']." ({$ifinfo['state']},{$ifinfo['advskew']})";
    $a_vipaddrs[] = $carp['vipaddr'] . " ({$ifinfo['state']})";
}
?>
	<?php 
echo html_text("vipaddr", gettext("Virtual IP address"), !empty($a_vipaddrs) ? htmlspecialchars(join(', ', $a_vipaddrs)) : sprintf("<span class='red'>%s</span>", htmlspecialchars(gettext("No configured CARP interfaces."))));
?>
	<?php 
//html_combobox("role", gettext("HAST role"), $pconfig['role'], array("primary" => gettext("Primary"), "secondary" => gettext("Secondary")), "", true);
?>
	<tr id="control_btn">
	  <td colspan="2">
	    <input id="switch_backup" name="switch_backup" type="submit" class="formbtn" value="<?php 
echo gettext("Switch VIP to BACKUP");
?>