Project

General

Profile

« Previous | Next » 

Revision d00157df

Added by Steve Beaver almost 9 years ago

Revise filter_reload page to display entire reload_filter_status contents, not just last line

View differences:

src/usr/local/www/head.inc
300 300
$status_menu[] = array(gettext("Gateways"), "/status_gateways.php");
301 301
$status_menu[] = array(gettext("DHCP Leases"), "/status_dhcp_leases.php");
302 302
$status_menu[] = array(gettext("DHCPv6 Leases"), "/status_dhcpv6_leases.php");
303
$status_menu[] = array(gettext("Filter Reload"), "/status_filter_reload.php");
303
$status_menu[] = array(gettext("Filter Reload"), "/status_filter_reload.php?user=true");
304 304
$status_menu[] = array(gettext("Interfaces"), "/status_interfaces.php");
305 305
$status_menu[] = array(gettext("IPsec"), "/status_ipsec.php");
306 306
$status_menu[] = array(gettext("Load Balancer"), "/status_lb_pool.php");
src/usr/local/www/status_filter_reload.php
43 43
}
44 44
if ($_POST['reloadfilter']) {
45 45
	send_event("filter reload");
46
	header("Location: status_filter_reload.php?reloading=true");
46
	header("Location: status_filter_reload.php");
47 47
	exit;
48 48
}
49 49
if ($_POST['syncfilter']) {
......
69 69
?>
70 70
			</form>
71 71
			<br />
72
			<div id="status"></div>
73 72
			<div id="doneurl"></div>
73
			<br />
74
			<div class="panel panel-default">
75
				<div class="panel-heading"><h2 class="panel-title"><?=gettext("Reload status")?></h2></div>
76
				<div class="panel-body" id="status">
77
				</div>
78
			</div>
74 79
			<br/>
75 80

  
76
<?php if ($_GET['reloading']) { ?>
81
<?php if (!$_GET['user']) { ?>
77 82
			<div id="reloadinfo"><?=gettext("This page will automatically refresh every 3 seconds until the filter is done reloading."); ?></div>
78 83
<?php } ?>
79 84

  
......
92 97
	var result_text = obj.content;
93 98
	var result_text_split = result_text.split("|");
94 99
	result_text = result_text_split[1];
95
	result_text = result_text.replace("\n", "");
96
	result_text = result_text.replace("\r", "");
97 100

  
98 101
	if (result_text) {
99
		$('#status').html(result_text + '...');
102
		$('#status').html('<pre>' + result_text + '</pre>');
100 103
	} else {
101
		$('#status').html('<?=gettext("Obtaining filter status...");?>');
104
		$('#status').html('<pre>' + '<?=gettext("Obtaining filter status...");?>' + '</pre>');
102 105
	}
103 106

  
104
	if (result_text == "Initializing") {
105
		$('#status').html('<?=gettext("Initializing...");?>');
106
	} else if (result_text == "Done") {
107
		$('#status').addClass("alert alert-success");
108
		$('#status').html('<?=gettext("Done.  The filter rules have been reloaded.");?>');
107
	if (result_text.endsWith("Done\n")) {
109 108
		$('#reloadinfo').css("visibility", "hidden");
110 109
		$('#doneurl').css("visibility", "visible");
111 110
		$('#doneurl').html("<p><a href='status_queues.php'><?=gettext("Queue Status");?><\/a><\/p>");
111
		$('#reloadinfo').html("");
112
	}  else {
113
		window.setTimeout('update_status_thread()', 1500);
112 114
	}
113

  
114
	window.setTimeout('update_status_thread()', 2500);
115 115
}
116 116
//]]>
117 117
</script>
......
166 166
	}
167 167
}
168 168

  
169
if ("<?=$_GET['reloading']?>" == "true") {
170
 	window.setTimeout('update_status_thread()', 2500);
169
if ("<?=$_GET['user']?>" != "true") {
170
 	window.setTimeout('update_status_thread()', 1500);
171 171
 }
172 172
//]]>
173 173
</script>

Also available in: Unified diff