Project

General

Profile

« Previous | Next » 

Revision 1ce9c03d

Added by Jim Pingle over 9 years ago

Clean up the CARP status widget. Fixes #5964

View differences:

src/usr/local/www/widgets/widgets/carp_status.widget.php
65 65

  
66 66
?>
67 67
<div class="content">
68
<table>
68
<table class="table table-striped table-hover">
69
	<thead>
70
		<th>CARP Interface</th>
71
		<th>IP Address</th>
72
		<th>Status</th>
73
	</thead>
74
	<tbody>
69 75
<?php
70 76
	if (is_array($config['virtualip']['vip'])) {
71 77
		$carpint=0;
......
80 86
			$advskew = $carp['advskew'];
81 87
			$status = get_carp_interface_status("_vip{$carp['uniqid']}");
82 88
?>
83
<tr>
84
	<td>
85
		<i class="fa fa-inbox"></i>
86
		<a href="/system_hasync.php">
87
			<?=htmlspecialchars(convert_friendly_interface_to_friendly_descr($carp['interface']) . "@{$vhid}");?>
88
		</a>
89
	</td>
90
	<td>
91
<?php
92
			if ($carp_enabled == false) {
89
		<tr>
90
			<td>
91
				<a href="/system_hasync.php">
92
					<?=htmlspecialchars(convert_friendly_interface_to_friendly_descr($carp['interface']) . "@{$vhid}");?>
93
				</a>
94
			</td>
95
<?php			if ($carp_enabled == false) {
96
				$icon = 'times-circle';
93 97
				$status = "DISABLED";
94
				echo '<i class="fa fa-ban"></i>';
95 98
			} else {
96 99
				if ($status == "MASTER") {
97
					echo '<i class="fa fa-arrow-right"></i>';
100
					$icon = 'check-circle';
98 101
				} else if ($status == "BACKUP") {
99
					echo '<i class="fa fa-arrow-right"></i>';
102
					$icon = 'check-circle-o';
100 103
				} else if ($status == "INIT") {
101
					echo '<i class="fa fa-list-alt"></i>';
104
					$icon = 'question-circle';
102 105
				}
103 106
			}
104 107
			if ($ipaddress) {
105 108
?>
106
				&nbsp;
107
				<?=htmlspecialchars($status);?> &nbsp;
108
				<?=htmlspecialchars($ipaddress);?>
109
				<td><?=htmlspecialchars($ipaddress);?></td>
110
				<td><i class="fa fa-<?=$icon?>"></i>&nbsp;<?= htmlspecialchars($status) ?></td>
109 111
<?php
110 112
			}
111 113
?>
112
</td></tr>
114
		</tr>
113 115
<?php
114 116
		}
115 117
	} else {
......
118 120
<?php
119 121
	}
120 122
?>
123
	</tbody>
121 124
</table>
122 125
</div>

Also available in: Unified diff