Project

General

Profile

« Previous | Next » 

Revision 1ae0947a

Added by Jim Pingle over 8 years ago

Show the button to reset CARP demotion status even when the value is negative, and change the reset code to accommodate. Also fixup text in that dialog. Fixes #7424

View differences:

src/usr/local/www/status_carp.php
130 130
$carp_detected_problems = get_single_sysctl("net.inet.carp.demotion");
131 131

  
132 132
if (!empty($_POST['resetdemotion'])) {
133
	set_single_sysctl("net.inet.carp.demotion", "-{$carp_detected_problems}");
133
	set_single_sysctl("net.inet.carp.demotion", 0 - $carp_detected_problems);
134 134
	sleep(1);
135 135
	$carp_detected_problems = get_single_sysctl("net.inet.carp.demotion");
136 136
}
......
172 172
	}
173 173

  
174 174
	// Sadly this needs to be here so that it is inside the form
175
	if ($carp_detected_problems > 0) {
175
	if ($carp_detected_problems != 0) {
176 176
		print_info_box(
177
			gettext("CARP has detected a problem and this unit has been demoted to BACKUP status.") .
177
			gettext("CARP has detected a problem and this unit has a non-zero demotion status.") .
178 178
			"<br/>" .
179
			gettext("Check the link status on all interfaces with configured CARP VIPs.") .
180
			"<br/>" .
181
			sprintf(gettext('Search the %1$sSystem Log%2$s for CARP demotion-related events.'), "<a href=\"/status_logs.php?filtertext=carp%3A+demoted+by\">", "</a>") .
179
			gettext("Check the link status on all interfaces configured with CARP VIPs and ") .
180
			sprintf(gettext('search the %1$sSystem Log%2$s for CARP demotion-related events.'), "<a href=\"/status_logs.php?filtertext=carp%3A+demoted+by\">", "</a>") .
182 181
			"<br/><br/>" .
183 182
			'<button type="submit" class="btn btn-warning" name="resetdemotion" id="resetdemotion" value="' .
184
			gettext("Reset CARP Demotion Status.") .
183
			gettext("Reset CARP Demotion Status") .
185 184
			'"><i class="fa fa-undo icon-embed-btn"></i>' .
186
			gettext("Reset CARP Demotion Status.") .
185
			gettext("Reset CARP Demotion Status") .
187 186
			'</button>',
188 187
			'danger'
189 188
		);

Also available in: Unified diff