Project

General

Profile

« Previous | Next » 

Revision 7d5b007c

Added by Sjon Hortensius over 10 years ago

initial drag/drop WIP, working on backup/restore page

View differences:

etc/inc/gmirror.inc
67 67
function gmirror_html_status() {
68 68
	$mirrors = gmirror_get_status();
69 69
	$output = "";
70
	if (count($mirrors) > 0) {
71
		$output .= "<tr>\n";
72
		$output .= "<th>Name</td>\n";
73
		$output .= "<th>Status</td>\n";
74
		$output .= "<th>Component</td>\n";
75
		$output .= "</tr>\n";
76
		foreach ($mirrors as $mirror => $name) {
77
			$components = count($name["components"]);
78
			$output .= "<tr>\n";
79
			$output .= "<td rowspan=\"{$components}\">{$name['name']}</td>\n";
80
			$output .= "<td rowspan=\"{$components}\" class=\"listr\">{$name['status']}</td>\n";
81
			$output .= "<td>{$name['components'][0]}</td>\n";
82
			$output .= "</tr>\n";
83
			if (count($name["components"]) > 1) {
84
				$morecomponents = array_slice($name["components"], 1);
85
				foreach ($morecomponents as $component) {
86
					$output .= "<tr>\n";
87
					$output .= "<td>{$component}</td>\n";
88
					$output .= "</tr>\n";
89
				}
90
			}
91
		}
92
	} else {
93
		$output .= "<tr><td colspan=\"3\" class=\"listr\">No Mirrors Found</td></tr>\n";
70
	if (count($mirrors) < 1) {
71
?>
72
<div class="alert">
73
	<p>No Mirrors Found</p>
74
</div>
75
<?php
76
		return;
94 77
	}
95
	// $output .= "<tr><td colspan=\"3\" class=\"listr\">Updated at " . date("F j, Y, g:i:s a") . "</td></tr>\n";
96
	return $output;
78

  
79
?>
80
<table class="table table-striped">
81
	<thead>
82
		<tr>
83
			<th>Name</td>
84
			<th>Status</td>
85
			<th>Component</td>
86
		</tr>
87
	</thead>
88
	<tbody>
89
<?php foreach ($mirrors as $mirror => $name): ?>
90
		<tr>
91
			<td rowspan="<?=count($name["components"])?>"><?=$name['name']?></td>
92
			<td rowspan="<?=count($name["components"])?>"><?=$name['status']?></td>
93
			<td><?=$name['components'][0]?></td>
94
		</tr>
95
<?php if (count($name["components"]) > 1): ?>
96
		<?php foreach (array_slice($name["components"], 1) as $component): ?>
97
			<tr>
98
				<td><?=$component?></td>
99
			</tr>
100
		<?php endforeach; ?>
101
	<?php endif; ?>
102
<?php endforeach;
97 103
}
98 104

  
99 105
/* List all disks in the system (potential gmirror targets) */
usr/local/www/bandwidth_by_ip.php
1 1
<?php
2
/* 
2
/*
3 3
 * To change this template, choose Tools | Templates
4 4
 * and open the template in the editor.
5 5
 *
......
47 47

  
48 48
//get the sort method
49 49
$sort = $_GET['sort'];
50
if ($sort == "out") 
50
if ($sort == "out")
51 51
	{$sort_method = "-T";}
52 52
else
53 53
	{$sort_method = "-R";}
......
77 77
$someinfo = false;
78 78
for ($x=2; $x<12; $x++){
79 79

  
80
    $bandwidthinfo = $listedIPs[$x];
80
	$bandwidthinfo = $listedIPs[$x];
81 81

  
82
   // echo $bandwidthinfo;
83
    $emptyinfocounter = 1;
84
    if ($bandwidthinfo != "") {
85
        $infoarray = explode (":",$bandwidthinfo);
82
	// echo $bandwidthinfo;
83
	$emptyinfocounter = 1;
84
	if ($bandwidthinfo != "") {
85
		$infoarray = explode (":",$bandwidthinfo);
86 86
		if (($filter == "all") ||
87
		    (($filter == "local") && (ip_in_subnet($infoarray[0], $intsubnet))) ||
88
		    (($filter == "remote") && (!ip_in_subnet($infoarray[0], $intsubnet)))) {
87
			(($filter == "local") && (ip_in_subnet($infoarray[0], $intsubnet))) ||
88
			(($filter == "remote") && (!ip_in_subnet($infoarray[0], $intsubnet)))) {
89 89
			if ($hostipformat == "") {
90 90
				$addrdata = $infoarray[0];
91 91
			} else {
......
116 116

  
117 117
//no bandwidth usage found
118 118
if ($someinfo == false)
119
    echo gettext("no info");
119
	echo gettext("no info");
120 120

  
121
?>
121
?>
usr/local/www/bootstrap/css/pfSense.css
27 27
	background: url("/logo.png") no-repeat;
28 28
}
29 29

  
30
body.index a[data-toggle][aria-expanded="false"] i {
31
	background-position: 0 -96px;
32
}
33
body.index a[data-toggle][aria-expanded="true"] i {
34
	background-position: -24px -96px;
35
}
36

  
30 37
tr.disabled {
31 38
	opacity: .5;
32 39
}
usr/local/www/carp_status.php
1 1
<?php
2 2
/*
3
    carp_status.php
4
    Copyright (C) 2004 Scott Ullrich
5
    Copyright (C) 2013-2014 Electric Sheep Fencing, LP
6
    All rights reserved.
7

  
8
    Redistribution and use in source and binary forms, with or without
9
    modification, are permitted provided that the following conditions are met:
10

  
11
    1. Redistributions of source code must retain the above copyright notice,
12
       this list of conditions and the following disclaimer.
13

  
14
    2. Redistributions in binary form must reproduce the above copyright
15
       notice, this list of conditions and the following disclaimer in the
16
       documentation and/or other materials provided with the distribution.
17

  
18
    THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
19
    INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
20
    AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
21
    AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
22
    OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23
    SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24
    INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25
    CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26
    ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27
    POSSIBILITY OF SUCH DAMAGE.
3
	carp_status.php
4
	Copyright (C) 2004 Scott Ullrich
5
	Copyright (C) 2013-2014 Electric Sheep Fencing, LP
6
	All rights reserved.
7

  
8
	Redistribution and use in source and binary forms, with or without
9
	modification, are permitted provided that the following conditions are met:
10

  
11
	1. Redistributions of source code must retain the above copyright notice,
12
	   this list of conditions and the following disclaimer.
13

  
14
	2. Redistributions in binary form must reproduce the above copyright
15
	   notice, this list of conditions and the following disclaimer in the
16
	   documentation and/or other materials provided with the distribution.
17

  
18
	THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
19
	INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
20
	AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
21
	AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
22
	OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23
	SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24
	INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25
	CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26
	ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27
	POSSIBILITY OF SUCH DAMAGE.
28 28
*/
29 29

  
30 30
##|+PRIV
......
100 100
$pgtitle = array(gettext("Status"),gettext("CARP"));
101 101
$shortcut_section = "carp";
102 102
include("head.inc");
103

  
104 103
?>
105

  
106
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
107
<?php include("fbegin.inc"); ?>
104
<body>
105
<?php include("fbegin.inc")?>
108 106
<form action="carp_status.php" method="post">
109
<?php if ($savemsg) print_info_box($savemsg); ?>
110

  
111
<?PHP	if ($carp_detected_problems) print_info_box(gettext("CARP has detected a problem and this unit has been demoted to BACKUP status.") . "<br />" . gettext("Check link status on all interfaces with configured CARP VIPs.")); ?>
112

  
113

  
114
<div id="mainlevel">
115
	<table width="100%" border="0" cellpadding="0" cellspacing="0" summary="carp status">
116
		<tr>
117
			<td>
107
<?php if ($savemsg) print_info_box($savemsg)?>
108
<?php if ($carp_detected_problems) print_info_box(gettext("CARP has detected a problem and this unit has been demoted to BACKUP status.") . "<br />" . gettext("Check link status on all interfaces with configured CARP VIPs."))?>
118 109
<?php
119
			$carpcount = 0;
120
			if(is_array($config['virtualip']['vip'])) {
121
				foreach($config['virtualip']['vip'] as $carp) {
122
					if ($carp['mode'] == "carp") {
123
						$carpcount++;
124
						break;
125
					}
126
				}
127
			}
128
			if($carpcount > 0) {
129
				if($status > 0) {
130
					$carp_enabled = true;
131
					echo "<input type=\"submit\" name=\"disablecarp\" id=\"disablecarp\" value=\"" . gettext("Temporarily Disable CARP") . "\" />";
132
				} else {
133
					$carp_enabled = false;
134
					echo "<input type=\"submit\" name=\"disablecarp\" id=\"disablecarp\" value=\"" . gettext("Enable CARP") . "\" />";
135
				}
136
				if(isset($config["virtualip_carp_maintenancemode"])) {
137
					echo "<input type=\"submit\" name=\"carp_maintenancemode\" id=\"carp_maintenancemode\" value=\"" . gettext("Leave Persistent CARP Maintenance Mode") . "\" />";
138
				} else {
139
					echo "<input type=\"submit\" name=\"carp_maintenancemode\" id=\"carp_maintenancemode\" value=\"" . gettext("Enter Persistent CARP Maintenance Mode") . "\" />";
140
				}
141
			}
110
$carpcount = 0;
111
if(is_array($config['virtualip']['vip'])) {
112
	foreach($config['virtualip']['vip'] as $carp) {
113
		if ($carp['mode'] == "carp") {
114
			$carpcount++;
115
			break;
116
		}
117
	}
118
}
119
if ($carpcount > 0):
120
	$carp_enabled = ($status > 0);
142 121
?>
143

  
144
			<br/><br/>
145
			<table class="tabcont sortable" width="100%" border="0" cellpadding="6" cellspacing="0" summary="results">
146
				<tr>
147
					<td class="listhdrr" align="center"><?=gettext("CARP Interface"); ?></td>
148
					<td class="listhdrr" align="center"><?=gettext("Virtual IP"); ?></td>
149
					<td class="listhdrr" align="center"><?=gettext("Status"); ?></td>
150
				</tr>
122
	<input type="submit" name="disablecarp" value="<?=($carp_enabled ? gettext("Temporarily Disable CARP") : gettext("Enable CARP"))?>" />
123
	<input type="submit" name="carp_maintenancemode" value="<?=($config["virtualip_carp_maintenancemode"] ? gettext("Leave Persistent CARP Maintenance Mode") : gettext("Enter Persistent CARP Maintenance Mode"))?>" />
124
<?php elseif ($carpcount == 0): ?>
125
	<div class="alert alert-info" role="alert">
126
		<p>
127
			<?=gettext("Could not locate any defined CARP interfaces.")?><br/>
128
			<a href="system_hasync.php" class="alert-link"><?=gettext("You can configure high availability sync settings here")?></a>.
129
		</p>
130
	</div>
131
<?php else: ?>
132
<table>
133
	<tr>
134
		<td><?=gettext("CARP Interface")?></td>
135
		<td><?=gettext("Virtual IP")?></td>
136
		<td><?=gettext("Status")?></td>
137
	</tr>
151 138
<?php
152
				if ($carpcount == 0) {
153
					echo "</table></td></tr></table></div></form><center><br />" . gettext("Could not locate any defined CARP interfaces.");
154
					echo "</center>";
155

  
156
					include("fend.inc");
157
					echo "</body></html>";
158
					return;
159
				}
160
				if(is_array($config['virtualip']['vip'])) {
161
					foreach($config['virtualip']['vip'] as $carp) {
162
						if ($carp['mode'] != "carp")
163
							continue;
164
						$ipaddress = $carp['subnet'];
165
						$password = $carp['password'];
166
						$netmask = $carp['subnet_bits'];
167
						$vhid = $carp['vhid'];
168
						$advskew = $carp['advskew'];
169
						$advbase = $carp['advbase'];
170
						$status = get_carp_interface_status("{$carp['interface']}_vip{$carp['vhid']}");
171
						echo "<tr>";
172
						$align = "style=\"vertical-align:middle\"";
173
						if($carp_enabled == false) {
174
							$icon = "<img {$align} src=\"/themes/".$g['theme']."/images/icons/icon_block.gif\" alt=\"disabled\" />";
175
							$status = "DISABLED";
176
						} else {
177
							if($status == "MASTER") {
178
								$icon = "<img {$align} src=\"/themes/".$g['theme']."/images/icons/icon_pass.gif\" alt=\"master\" />";
179
							} else if($status == "BACKUP") {
180
								$icon = "<img {$align} src=\"/themes/".$g['theme']."/images/icons/icon_pass_d.gif\" alt=\"backup\" />";
181
							} else if($status == "INIT") {
182
								$icon = "<img {$align} src=\"/themes/".$g['theme']."/images/icons/icon_log.gif\" alt=\"init\" />";
183
							}
184
						}
185
						echo "<td class=\"listlr\" align=\"center\">" . convert_friendly_interface_to_friendly_descr($carp['interface']) . "@{$vhid} &nbsp;</td>";
186
						echo "<td class=\"listlr\" align=\"center\">" . $ipaddress . "&nbsp;</td>";
187
						echo "<td class=\"listlr\" align=\"center\">{$icon}&nbsp;&nbsp;" . $status . "&nbsp;</td>";
188
						echo "</tr>";
189
					}
190
				}
139
	foreach($config['virtualip']['vip'] as $carp) {
140
		if ($carp['mode'] != "carp")
141
			continue;
142
		$ipaddress = $carp['subnet'];
143
		$password = $carp['password'];
144
		$netmask = $carp['subnet_bits'];
145
		$vhid = $carp['vhid'];
146
		$advskew = $carp['advskew'];
147
		$advbase = $carp['advbase'];
148
		$status = get_carp_interface_status("{$carp['interface']}_vip{$carp['vhid']}");
149
		if($carp_enabled == false) {
150
			$icon = 'remove-sign';
151
			$status = "DISABLED";
152
		} else {
153
			if($status == "MASTER") {
154
				$icon = 'ok-sign';
155
			} else if($status == "BACKUP") {
156
				$icon = 'ok-circle';
157
			} else if($status == "INIT") {
158
				$icon = 'question-sign';
159
			}
160
		}
191 161
?>
192
			</table>
193
			</td>
162
	<tr>
163
		<td>
164
			<td><?=convert_friendly_interface_to_friendly_descr($carp['interface'])?>@<?=$vhid?></td>
165
			<td><?=$ipaddress?></td>
166
			<td><i class="icon icon-<?=$icon?>">$status</td>
194 167
		</tr>
168
<?php }?>
195 169
	</table>
196
</div>
197 170
</form>
171
<?php endif?>
198 172

  
199
<p class="vexpl">
200
<span class="red"><strong><?=gettext("Note"); ?>:</strong></span>
201
<br />
202
<?=gettext("You can configure high availability sync settings"); ?> <a href="system_hasync.php"><?=gettext("here"); ?></a>.
203
</p>
204

  
173
<h4><?=gettext("pfSync nodes")?></h4>
174
<ul>
205 175
<?php
206
	echo "<br />" . gettext("pfSync nodes") . ":<br />";
207
	echo "<pre>";
208
	system("/sbin/pfctl -vvss | /usr/bin/grep creator | /usr/bin/cut -d\" \" -f7 | /usr/bin/sort -u");
209
	echo "</pre>";
176
	foreach (explode("\n", exec_command("/sbin/pfctl -vvss | /usr/bin/grep creator | /usr/bin/cut -d\" \" -f7 | /usr/bin/sort -u")) as $node)
177
		echo '<li>'. $node .'</li>';
210 178
?>
179
</ul>
211 180

  
212
<?php include("fend.inc"); ?>
181
<?php include("fend.inc")?>
213 182

  
214 183
</body>
215
</html>
184
</html>
usr/local/www/crash_reporter.php
53 53
		$post["file{$counter}"] = "@{$file}";
54 54
		$counter++;
55 55
	}
56
    $ch = curl_init();
57
    curl_setopt($ch, CURLOPT_HEADER, 0);
58
    curl_setopt($ch, CURLOPT_VERBOSE, 0);
59
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
60
    curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible;)");
61
    curl_setopt($ch, CURLOPT_URL, $g['crashreporterurl']);
62
    curl_setopt($ch, CURLOPT_POST, true);
63
    curl_setopt($ch, CURLOPT_POSTFIELDS, $post); 
64
    $response = curl_exec($ch);
56
	$ch = curl_init();
57
	curl_setopt($ch, CURLOPT_HEADER, 0);
58
	curl_setopt($ch, CURLOPT_VERBOSE, 0);
59
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
60
	curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible;)");
61
	curl_setopt($ch, CURLOPT_URL, $g['crashreporterurl']);
62
	curl_setopt($ch, CURLOPT_POST, true);
63
	curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
64
	$response = curl_exec($ch);
65 65
	return $response;
66 66
}
67 67

  
68
function output_crash_reporter_html($crash_reports) {
69
	echo "<p><strong>" . gettext("Unfortunately we have detected a programming bug.") . "</strong></p>";
70
	echo "<p>" . gettext("Would you like to submit the programming debug logs to the pfSense developers for inspection?") . "</p>";
71
	echo "<p><i>" . gettext("Please double check the contents to ensure you are comfortable sending this information before clicking Yes.") . "</i></p>";
72
	echo "<p>" . gettext("Contents of crash reports") . ":<br />";
73
	echo "<textarea readonly=\"readonly\" rows=\"40\" cols=\"65\" name=\"crashreports\">{$crash_reports}</textarea></p>";
74
	echo "<p><input name=\"Submit\" type=\"submit\" class=\"formbtn\" value=\"" . gettext("Yes") .  "\" />" . gettext(" - Submit this to the developers for inspection") . "</p>";
75
	echo "<p><input name=\"Submit\" type=\"submit\" class=\"formbtn\" value=\"" . gettext("No") .  "\" />" . gettext(" - Just delete the crash report and take me back to the Dashboard") . "</p>";
76
	echo "</form>";
77
}
78

  
79 68
$pgtitle = array(gettext("Diagnostics"),gettext("Crash reporter"));
80 69
include('head.inc');
81 70

  
......
86 75
$crash_report_header .= "\nCrash report details:\n";
87 76

  
88 77
exec("/usr/bin/grep -vi warning /tmp/PHP_errors.log", $php_errors);
89

  
90 78
?>
91

  
92
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
93

  
94
<?php include("fbegin.inc"); ?>
95

  
96
	<form action="crash_reporter.php" method="post">
97

  
79
<body class="crash_reporter">
80
<?php include("fbegin.inc")?>
98 81
<?php
99 82
	if (gettext($_POST['Submit']) == "Yes") {
100 83
		echo gettext("Processing...");
......
140 123
					$crash_reports .= file_get_contents($cf);
141 124
				}
142 125
			}
143
		} else { 
126
		} else {
144 127
			echo "Could not locate any crash data.";
145 128
		}
146
		output_crash_reporter_html($crash_reports);
129
?>
130
	<div class="jumbotron">
131
	<div class="panel panel-default">
132
		<div class="panel-heading"><h3><?=gettext("Unfortunately we have detected a programming bug.")?></h3></div>
133
		<div class="panel-body">
134
		<p>
135
			<?=gettext("Would you like to submit the programming debug logs to the pfSense developers for inspection?")?>
136
			<i><?=gettext("Please double check the contents to ensure you are comfortable sending this information before clicking Yes.")?></i>
137
		</p>
138
		<textarea readonly="readonly" style="width: 100%; height: 350px;">
139
			<?=$crash_reports?>
140
		</textarea>
141
		<form action="crash_reporter.php" method="post">
142
			<button class="btn btn-primary" name="Submit" type="submit" value="Yes"><?=gettext("Yes")?> - <?=gettext("Submit this to the developers for inspection")?></button>
143
			<button class="btn btn-default" name="Submit" type="submit" value="No"><?=gettext("No")?> - <?=gettext("Just delete the crash report and take me back to the Dashboard")?></button>
144
		</form>
145
	</div>
146
	</div>
147
<?php
147 148
	}
148 149
?>
149 150

  
150
<?php include("fend.inc"); ?>
151
<?php include("fend.inc")?>
151 152

  
152 153
</body>
153
</html>
154
</html>
usr/local/www/diag_arp.php
3 3
	diag_arp.php
4 4
	part of the pfSense project	(https://www.pfsense.org)
5 5
	Copyright (C) 2004-2009 Scott Ullrich <sullrich@gmail.com>
6
        Copyright (C) 2013-2014 Electric Sheep Fencing, LP
6
	Copyright (C) 2013-2014 Electric Sheep Fencing, LP
7 7

  
8 8
	originally part of m0n0wall (http://m0n0.ch/wall)
9 9
	Copyright (C) 2005 Paul Taylor (paultaylor@winndixie.com) and Manuel Kasper <mk@neon1.net>.
......
253 253
		exec("host -W 1 " . escapeshellarg($ip), $output);
254 254
		if (preg_match('/.*pointer ([A-Za-z0-9.-]+)\..*/',$output[0],$matches)) {
255 255
			if ($matches[1] <> $ip)
256
				return $matches[1]; 
256
				return $matches[1];
257 257
		}
258 258
	}
259 259
	return "";
......
263 263
include("head.inc");
264 264

  
265 265
?>
266

  
267
<body link="#000000" vlink="#000000" alink="#000000">
268

  
269
<?php include("fbegin.inc"); ?>
270

  
271
<div id="loading">
272
	<img src="/themes/<?=$g['theme'];?>/images/misc/loader.gif" alt="loader" /><?= gettext("Loading, please wait..."); ?>
273
	<p>&nbsp;</p>
274
</div>
275

  
266
<body>
267
<?php include("fbegin.inc")?>
276 268
<?php
277 269

  
278
// Flush buffers out to client so that they see Loading, please wait....
279
for ($i = 0; $i < ob_get_level(); $i++) { ob_end_flush(); }
280
ob_implicit_flush(1);
281

  
282 270
// Resolve hostnames and replace Z_ with "".  The intention
283 271
// is to sort the list by hostnames, alpha and then the non
284 272
// resolvable addresses will appear last in the list.
285 273
$dnsavailable=1;
286
$dns = trim(_getHostName("", "8.8.8.8")); 
274
$dns = trim(_getHostName("", "8.8.8.8"));
287 275
if ($dns == ""){
288
	$dns = trim(_getHostName("", "8.8.4.4")); 
276
	$dns = trim(_getHostName("", "8.8.4.4"));
289 277
	if ($dns == "") $dnsavailable =0;
290 278
}
291 279

  
......
306 294
// Load MAC-Manufacturer table
307 295
$mac_man = load_mac_manufacturer_table();
308 296
?>
309
<table width="100%" border="0" cellpadding="0" cellspacing="0" summary="diag arp">
310
	<tr>
311
		<td>
312
			<table class="tabcont sortable" width="100%" border="0" cellpadding="0" cellspacing="0" summary="tabcont">
313
				<tr>
314
					<td class="listhdrr"><?= gettext("IP address"); ?></td>
315
					<td class="listhdrr"><?= gettext("MAC address"); ?></td>
316
					<td class="listhdrr"><?= gettext("Hostname"); ?></td>
317
					<td class="listhdr"><?= gettext("Interface"); ?></td>
318
					<td class="list"></td>
319
				</tr>
320
				<?php foreach ($data as $entry): ?>
321
					<tr>
322
						<td class="listlr"><?=$entry['ip'];?></td>
323
						<td class="listr">
324
						<?php
325
						$mac=trim($entry['mac']);
326
						$mac_hi = strtoupper($mac[0] . $mac[1] . $mac[3] . $mac[4] . $mac[6] . $mac[7]);
327
						print $mac;
328
						if(isset($mac_man[$mac_hi])){ print "<br /><font size=\"-2\"><i>{$mac_man[$mac_hi]}</i></font>"; }
329
						?>
330
						</td>
331
						<td class="listr">
332
							<?php
333
							echo trim(str_replace("Z_ ", "", $entry['dnsresolve']));
334
							?>
335
						</td>
336
						<td class="listr"><?=$hwif[$entry['interface']];?></td>
337
					</tr>
338
				<?php endforeach; ?>
339
			</table>
340
		</td>
341
	</tr>
342
	<tr>
343
		<td><br /><?= gettext("NOTE: Local IPv6 peers use") ?> <a href="diag_ndp.php"><?= gettext("NDP") ?></a> <?= gettext("instead of ARP") ?>.</td>
344
	</tr>
297
<table class="table table-striped">
298
	<thead>
299
		<tr>
300
			<td><?= gettext("Interface")?></td>
301
			<td><?= gettext("IP address")?></td>
302
			<td><?= gettext("MAC address")?></td>
303
			<td><?= gettext("Hostname")?></td>
304
			<td></td>
305
		</tr>
306
	</thead>
307
	<tbody>
308
	<?php foreach ($data as $entry): ?>
309
		<tr>
310
			<td><?=$hwif[$entry['interface']]?></td>
311
			<td><?=$entry['ip']?></td>
312
			<td>
313
				<?=trim($entry['mac'])?>
314
			<?php
315
				$mac = trim($entry['mac']);
316
				$mac_hi = strtoupper($mac[0] . $mac[1] . $mac[3] . $mac[4] . $mac[6] . $mac[7]);
317

  
318
				if (isset($mac_man[$mac_hi]))
319
					print '('. $mac_man[$mac_hi] .'(';
320
?>
321
			</td>
322
			<td><?=trim(str_replace("Z_ ", "", $entry['dnsresolve']))?></td>
323
		</tr>
324
	<?php endforeach?>
325
	</tbody>
345 326
</table>
327
<p><?= gettext("NOTE: Local IPv6 peers use")?> <a href="diag_ndp.php"><?= gettext("NDP")?></a> <?= gettext("instead of ARP")?>.</p>
346 328

  
347
<?php include("fend.inc"); ?>
348

  
349
<script type="text/javascript">
350
//<![CDATA[
351
	jQuery('#loading').html('');
352
//]]>
353
</script>
329
<?php include("fend.inc")?>
354 330
</body>
355
</html>
331
</html>
usr/local/www/diag_authentication.php
3 3
	diag_authentication.php
4 4
	part of the pfSense project	(https://www.pfsense.org)
5 5
	Copyright (C) 2010 Ermal Luçi
6
        Copyright (C) 2013-2014 Electric Sheep Fencing, LP
6
	Copyright (C) 2013-2014 Electric Sheep Fencing, LP
7 7
	All rights reserved.
8 8

  
9 9
	Redistribution and use in source and binary forms, with or without
......
72 72

  
73 73
?>
74 74

  
75
<body link="#000000" vlink="#000000" alink="#000000">
76

  
77
<?php include("fbegin.inc"); ?>
78
<?php if ($input_errors) print_input_errors($input_errors);?>
79
<?php if ($savemsg) print_info_box($savemsg);?>
80

  
81
<table width="100%" border="0" cellpadding="0" cellspacing="0" summary="diag authentication">
82
	<tr>
83
		<td class="tabnavtbl"></td>
84
	</tr>
85
	<tr>
86
	<td>
87
	<div id="mainarea">
88
	<form id="iform" name="iform" action="diag_authentication.php" method="post">
89
	<table class="tabcont" width="100%" border="0" cellspacing="0" cellpadding="6" summary="test">
90
	<tr>
91
		<td width="22%" valign="top" class="vncell"><?=gettext("Authentication Server"); ?></td>
92
		<td width="78%" class="vtable">
93
			<select name="authmode" id="authmode" class="formselect" >
94
			<?php
95
				$auth_servers = auth_get_authserver_list();
96
				foreach ($auth_servers as $auth_server):
97
					$selected = "";
98
					if ($auth_server['name'] == $pconfig['authmode'])
99
						$selected = "selected=\"selected\"";
100
			?>
101
			<option value="<?=$auth_server['name'];?>" <?=$selected;?>><?=$auth_server['name'];?></option>
102
			<?php   endforeach; ?>
103
			</select>
104
		</td>
105
	</tr>
106
	<tr>
107
		<td width="22%" valign="top" class="vncell"><?=gettext("Username"); ?></td>
108
		<td width="78%" class="vtable">
109
			<input class="formfld unknown" size="20" id="username" name="username" value="<?=htmlspecialchars($pconfig['username']);?>" />
110
		</td>
111
	</tr>
112
	<tr>
113
		<td width="22%" valign="top" class="vncell"><?=gettext("Password"); ?></td>
114
		<td width="78%" class="vtable">
115
			<input class="formfld pwd" type="password" size="20" id="password" name="password" value="<?=htmlspecialchars($pconfig['password']);?>" />
116
		</td>
117
	</tr>
118
	<tr>
119
		<td width="22%" valign="top">&nbsp;</td>
120
		<td width="78%">
121
			<input id="save" name="save" type="submit" class="formbtn" value="<?=gettext("Test");?>" />
122
		</td>
123
	</tr>
124
	</table>
125
	</form>
75
<body>
76
<?php include("fbegin.inc")?>
77
<?php if ($input_errors) print_input_errors($input_errors)?>
78
<?php if ($savemsg) print_info_box($savemsg)?>
79
	<div id="container">
80
		<form class="form-horizontal" action="diag_authentication.php" method="post">
81
			<div class="form-group">
82
				<label for="authmode" class="col-sm-2 control-label"><?=gettext("Authentication Server")?></label>
83
				<div class="col-sm-10">
84
					<select name="authmode" id="authmode" class="formselect" >
85
					<?php
86
							foreach (auth_get_authserver_list() as $auth_server):
87
								$selected = ($auth_server['name'] == $pconfig['authmode'])
88
					?>
89
						<option value="<?=$auth_server['name']?>" <?=($selected?'selected="selected"':'')?>>
90
							<?=$auth_server['name']?>
91
						</option>
92
					<?php   endforeach?>
93
					</select>
94
				</div>
95
			</div>
96

  
97
			<div class="form-group">
98
				<label for="authmode" class="col-sm-2 control-label"><?=gettext("Username")?></label>
99
				<div class="col-sm-10">
100
					<input name="username" value="<?=htmlspecialchars($pconfig['username'])?>" />
101
				</div>
102
			</div>
103

  
104
			<div class="form-group">
105
				<label for="authmode" class="col-sm-2 control-label"><?=gettext("Password")?></label>
106
				<div class="col-sm-10">
107
					<input name="password" type="password" value="<?=htmlspecialchars($pconfig['password'])?>" />
108
				</div>
109
			</div>
110

  
111
			<button type="submit" class="btn btn-primary"><?=gettext("Test");?></button>
112
		</form>
126 113
	</div>
127
	</td></tr>
128
</table>
129

  
130
<?php include("fend.inc"); ?>
114
</div>
115
<?php include("fend.inc")?>
131 116
</body>
132
</html>
117
</html>
usr/local/www/diag_backup.php
3 3
/*
4 4
	diag_backup.php
5 5
	Copyright (C) 2004-2009 Scott Ullrich
6
        Copyright (C) 2013-2014 Electric Sheep Fencing, LP
6
	Copyright (C) 2013-2014 Electric Sheep Fencing, LP
7 7
	All rights reserved.
8 8

  
9 9
	originally part of m0n0wall (http://m0n0.ch/wall)
......
178 178
function spit_out_select_items($name, $showall) {
179 179
	global $config;
180 180

  
181
	$areas = array("aliases" => gettext("Aliases"),
182
		       "captiveportal" => gettext("Captive Portal"),
183
		       "voucher" => gettext("Captive Portal Vouchers"),
184
		       "dnsmasq" => gettext("DNS Forwarder"),
185
		       "dhcpd" => gettext("DHCP Server"),
186
		       "dhcpdv6" => gettext("DHCPv6 Server"),
187
		       "filter" => gettext("Firewall Rules"),
188
		       "interfaces" => gettext("Interfaces"),
189
		       "ipsec" => gettext("IPSEC"),
190
		       "nat" => gettext("NAT"),
191
		       "openvpn" => gettext("OpenVPN"),
192
		       "installedpackages" => gettext("Package Manager"),
193
		       "pptpd" => gettext("PPTP Server"),
194
		       "rrddata" => gettext("RRD Data"),
195
		       "cron" => gettext("Scheduled Tasks"),
196
		       "syslog" => gettext("Syslog"),
197
		       "system" => gettext("System"),
198
		       "staticroutes" => gettext("Static routes"),
199
		       "sysctl" => gettext("System tunables"),
200
		       "snmpd" => gettext("SNMP Server"),
201
		       "shaper" => gettext("Traffic Shaper"),
202
		       "vlans" => gettext("VLANS"),
203
		       "wol" => gettext("Wake on LAN")
204
		);
205

  
206
	$select  = "<select name=\"{$name}\" id=\"{$name}\">";
181
	$areas = array(
182
		"aliases" => gettext("Aliases"),
183
		"captiveportal" => gettext("Captive Portal"),
184
		"voucher" => gettext("Captive Portal Vouchers"),
185
		"dnsmasq" => gettext("DNS Forwarder"),
186
		"dhcpd" => gettext("DHCP Server"),
187
		"dhcpdv6" => gettext("DHCPv6 Server"),
188
		"filter" => gettext("Firewall Rules"),
189
		"interfaces" => gettext("Interfaces"),
190
		"ipsec" => gettext("IPSEC"),
191
		"nat" => gettext("NAT"),
192
		"openvpn" => gettext("OpenVPN"),
193
		"installedpackages" => gettext("Package Manager"),
194
		"pptpd" => gettext("PPTP Server"),
195
		"rrddata" => gettext("RRD Data"),
196
		"cron" => gettext("Scheduled Tasks"),
197
		"syslog" => gettext("Syslog"),
198
		"system" => gettext("System"),
199
		"staticroutes" => gettext("Static routes"),
200
		"sysctl" => gettext("System tunables"),
201
		"snmpd" => gettext("SNMP Server"),
202
		"shaper" => gettext("Traffic Shaper"),
203
		"vlans" => gettext("VLANS"),
204
		"wol" => gettext("Wake on LAN")
205
	);
206

  
207
	$select  = "<select name=\"{$name}\" id=\"{$name}\" multiple=\"multiple\">";
207 208
	$select .= "<option value=\"\">" . gettext("ALL") . "</option>";
208 209

  
209 210
	if($showall == true)
......
216 217

  
217 218
	$select .= "</select>\n";
218 219

  
219
	if ($name === "backuparea") {
220
		$select .= <<<END_SCRIPT_BLOCK
221
			<script type="text/javascript">
222
			//<![CDATA[
223
				jQuery(function (\$) {
224
					$("#{$name}").change(function () {
225
						backuparea_change(this);
226
					}).trigger("change");
227
				});
228
			//]]>
229
			</script>
230
END_SCRIPT_BLOCK;
231
	}
232

  
233 220
	echo $select;
234

  
235 221
}
236 222

  
237 223
if ($_POST['apply']) {
......
594 580
include("head.inc");
595 581

  
596 582
?>
583
<body>
584
<?php include("fbegin.inc")?>
585
<?php if ($input_errors) print_input_errors($input_errors)?>
586
<?php if ($savemsg) print_info_box($savemsg)?>
587
<?php if (is_subsystem_dirty('restore')):?><br/>
588
	<form action="reboot.php" method="post">
589
		<input name="Submit" type="hidden" value="Yes" />
590
		<?php print_info_box(gettext("The firewall configuration has been changed.") . "<br />" . gettext("The firewall is now rebooting."))?><br />
591
	</form>
592
<?php endif?>
593
<?php
594
	$tab_array = array();
595
	$tab_array[0] = array(gettext("Config History"), false, "diag_confbak.php");
596
	$tab_array[1] = array(gettext("Backup/Restore"), true, "diag_backup.php");
597
	display_top_tabs($tab_array);
598
?>
599
	<div id="container">
600
		<form class="form-horizontal" action="diag_backup.php" method="post" name="iform" enctype="multipart/form-data">
601
			<h2><?=gettext("Backup configuration"); ?></h2>
602
			<div class="form-group">
603
				<label for="backuparea" class="col-sm-2 control-label"><?=gettext("Backup area"); ?></label>
604
				<div class="col-sm-10">
605
					<?php spit_out_select_items("backuparea", false)?>
606
				</div>
607
			</div>
597 608

  
598
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
599
<?php include("fbegin.inc"); ?>
600
<script type="text/javascript">
601
//<![CDATA[
602

  
603
function encrypt_change() {
609
			<div class="form-group">
610
				<label for="nopackages" class="col-sm-2 control-label"><?=gettext("Do not backup package information.")?></label>
611
				<div class="col-sm-10">
612
					<input name="nopackages" type="checkbox" />
613
				</div>
614
			</div>
604 615

  
605
	if (!document.iform.encrypt.checked)
606
		document.getElementById("encrypt_opts").style.display="none";
607
	else
608
		document.getElementById("encrypt_opts").style.display="";
609
}
616
			<div class="form-group">
617
				<label for="donotbackuprrd" class="col-sm-2 control-label"><?=gettext("Do not backup RRD data (NOTE: RRD Data can consume 4+ megabytes of config.xml space!)")?></label>
618
				<div class="col-sm-10">
619
					<input name="donotbackuprrd" type="checkbox" checked="checked" />
620
				</div>
621
			</div>
610 622

  
611
function decrypt_change() {
623
			<div class="form-group">
624
				<label for="encrypt" class="col-sm-2 control-label"><?=gettext("Encrypt this configuration file.")?></label>
625
				<div class="col-sm-10">
626
					<input name="encrypt" type="checkbox" data-toggle="collapse" href="#encryptOptions" aria-expanded="false" aria-controls="encryptOptions" />
612 627

  
613
	if (!document.iform.decrypt.checked)
614
		document.getElementById("decrypt_opts").style.display="none";
615
	else
616
		document.getElementById("decrypt_opts").style.display="";
617
}
628
					<div class="collapse"id="encryptOptions">
629
						<input name="encrypt_password" type="password" placeholder="Password" /><br/>
630
						<input name="encrypt_passconf" type="password" placeholder="Confirm password" />
631
					</div>
632
				</div>
633
			</div>
618 634

  
619
function backuparea_change(obj) {
620
	if (obj.value == "rrddata") {
621
		document.getElementById("nopackages").disabled      = true;
622
		document.getElementById("dotnotbackuprrd").disabled = true;
623
	} else {
624
		document.getElementById("nopackages").disabled      = false;
625
		document.getElementById("dotnotbackuprrd").disabled = false;
626
	}
627
}
628
//]]>
629
</script>
630

  
631
<?php if ($input_errors) print_input_errors($input_errors); ?>
632
<?php if ($savemsg) print_info_box($savemsg); ?>
633
<?php if (is_subsystem_dirty('restore')): ?><br/>
634
<form action="reboot.php" method="post">
635
<input name="Submit" type="hidden" value="Yes" />
636
<?php print_info_box(gettext("The firewall configuration has been changed.") . "<br />" . gettext("The firewall is now rebooting."));?><br />
635
			<input name="Submit" type="submit" class="btn btn-default" value="<?=gettext("Download configuration as XML")?>" />
637 636
</form>
638
<?php endif; ?>
637

  
639 638
<form action="diag_backup.php" method="post" name="iform" enctype="multipart/form-data">
640
<table width="100%" border="0" cellspacing="0" cellpadding="0" summary="diag backup">
641
	<tr>
642
		<td>
643
<?php
644
		$tab_array = array();
645
		$tab_array[0] = array(gettext("Config History"), false, "diag_confbak.php");
646
		$tab_array[1] = array(gettext("Backup/Restore"), true, "diag_backup.php");
647
		display_top_tabs($tab_array);
648
?>
649
		</td>
650
	</tr>
651
	<tr>
652
		<td>
653
			<div id="mainarea">
654
			<table class="tabcont" align="center" width="100%" border="0" cellpadding="6" cellspacing="0" summary="main area">
655 639
				<tr>
656
					<td colspan="2" class="listtopic"><?=gettext("Backup configuration"); ?></td>
640
					<td><?=gettext("Restore configuration")?></td>
657 641
				</tr>
658 642
				<tr>
659
					<td width="22%" valign="baseline" class="vncell">&nbsp;</td>
660
					<td width="78%" class="vtable">
661
						<p><?=gettext("Click this button to download the system configuration in XML format."); ?><br /><br /> <?=gettext("Backup area:"); ?> <?php spit_out_select_items("backuparea", false); ?></p>
662
						<table>
663
							<tr>
664
								<td>
665
									<input name="nopackages" type="checkbox" class="formcheckbox" id="nopackages" />
666
								</td>
667
								<td>
668
									<span class="vexpl"><?=gettext("Do not backup package information."); ?></span>
669
								</td>
670
							</tr>
671
						</table>
672
						<table>
673
							<tr>
674
								<td>
675
									<input name="encrypt" type="checkbox" class="formcheckbox" id="nopackages" onclick="encrypt_change()" />
676
								</td>
677
								<td>
678
									<span class="vexpl"><?=gettext("Encrypt this configuration file."); ?></span>
679
								</td>
680
							</tr>
681
							<tr>
682
								<td>
683
									<input name="donotbackuprrd" type="checkbox" class="formcheckbox" id="dotnotbackuprrd" checked="checked" />
684
								</td>
685
								<td>
686
									<span class="vexpl"><?=gettext("Do not backup RRD data (NOTE: RRD Data can consume 4+ megabytes of config.xml space!)"); ?></span>
687
								</td>
688
							</tr>
689
						</table>
690
						<table id="encrypt_opts">
691
							<tr>
692
								<td>
693
									<span class="vexpl"><?=gettext("Password:"); ?> </span>
694
								</td>
695
								<td>
696
									<input name="encrypt_password" type="password" class="formfld pwd" size="20" value="" />
697
								</td>
698
							</tr>
699
							<tr>
700
								<td>
701
									<span class="vexpl"><?=gettext("confirm:"); ?> </span>
702
								</td>
703
								<td>
704
									<input name="encrypt_passconf" type="password" class="formfld pwd" size="20" value="" />
705
								</td>
706
							</tr>
707
						</table>
708
						<p><input name="Submit" type="submit" class="formbtn" id="download" value="<?=gettext("Download configuration"); ?>" /></p>
709
					</td>
710
				</tr>
711
				<tr>
712
					<td colspan="2" class="list" height="12">&nbsp;</td>
713
				</tr>
714
				<tr>
715
					<td colspan="2" class="listtopic"><?=gettext("Restore configuration"); ?></td>
716
				</tr>
717
				<tr>
718
					<td width="22%" valign="baseline" class="vncell">&nbsp;</td>
719
					<td width="78%" class="vtable">
720
						<?=gettext("Open a"); ?> <?=$g['[product_name']?> <?=gettext("configuration XML file and click the button below to restore the configuration."); ?>
643
					<td>&nbsp;</td>
644
					<td>
645
						<?=gettext("Open a")?><?=$g['[product_name']?><?=gettext("configuration XML file and click the button below to restore the configuration.")?>
721 646
						<br /><br />
722
						<?=gettext("Restore area:"); ?> <?php spit_out_select_items("restorearea", true); ?>
647
						<?=gettext("Restore area:")?><?php spit_out_select_items("restorearea", true)?>
723 648
						<p><input name="conffile" type="file" class="formbtn" id="conffile" size="40" /></p>
724 649
						<table>
725 650
							<tr>
......
727 652
									<input name="decrypt" type="checkbox" class="formcheckbox" id="nopackages" onclick="decrypt_change()" />
728 653
								</td>
729 654
								<td>
730
									<span class="vexpl"><?=gettext("Configuration file is encrypted."); ?></span>
655
									<span><?=gettext("Configuration file is encrypted.")?></span>
731 656
								</td>
732 657
							</tr>
733 658
						</table>
734
						<table id="decrypt_opts">
659
						<table>
735 660
							<tr>
736 661
								<td>
737
									<span class="vexpl"><?=gettext("Password :"); ?></span>
662
									<span><?=gettext("Password :")?></span>
738 663
								</td>
739 664
								<td>
740 665
									<input name="decrypt_password" type="password" class="formfld pwd" size="20" value="" />
......
742 667
							</tr>
743 668
							<tr>
744 669
								<td>
745
									<span class="vexpl"><?=gettext("confirm :"); ?></span>
670
									<span><?=gettext("confirm :")?></span>
746 671
								</td>
747 672
								<td>
748 673
									<input name="decrypt_passconf" type="password" class="formfld pwd" size="20" value="" />
749 674
								</td>
750 675
							</tr>
751 676
						</table>
752
						<p><input name="Submit" type="submit" class="formbtn" id="restore" value="<?=gettext("Restore configuration"); ?>" /></p>
753
						<p><strong><span class="red"><?=gettext("Note:"); ?></span></strong><br /><?=gettext("The firewall will reboot after restoring the configuration."); ?><br /></p>
677
						<p><input name="Submit" type="submit" class="formbtn" id="restore" value="<?=gettext("Restore configuration")?>" /></p>
678
						<p><strong><span><?=gettext("Note:")?></span></strong><br /><?=gettext("The firewall will reboot after restoring the configuration.")?><br /></p>
754 679
					</td>
755 680
				</tr>
756
				<?php if (($config['installedpackages']['package'] != "") || (is_subsystem_dirty("packagelock"))) { ?>
681
				<?php if (($config['installedpackages']['package'] != "") || (is_subsystem_dirty("packagelock"))) {?>
757 682
				<tr>
758
					<td colspan="2" class="list" height="12">&nbsp;</td>
683
					<td>&nbsp;</td>
759 684
				</tr>
760 685
				<tr>
761
					<td colspan="2" class="listtopic"><?=gettext("Package Functions"); ?></td>
686
					<td><?=gettext("Package Functions")?></td>
762 687
				</tr>
763 688
				<tr>
764
					<td width="22%" valign="baseline" class="vncell">&nbsp;</td>
765
					<td width="78%" class="vtable">
766
						<?php if ($config['installedpackages']['package'] != "") { ?>
767
							<p><?=gettext("Click this button to reinstall all system packages.  This may take a while."); ?> <br /><br />
768
							<input name="Submit" type="submit" class="formbtn" id="reinstallpackages" value="<?=gettext("Reinstall packages"); ?>" />
689
					<td>&nbsp;</td>
690
					<td>
691
						<?php if ($config['installedpackages']['package'] != "") {?>
692
							<p><?=gettext("Click this button to reinstall all system packages.  This may take a while.")?><br /><br />
693
							<input name="Submit" type="submit" class="formbtn" id="reinstallpackages" value="<?=gettext("Reinstall packages")?>" />
769 694
							<br />
770 695
							<br />
771
						<?php } ?>
772
						<?php if (is_subsystem_dirty("packagelock")) { ?>
773
							<p><?=gettext("Click this button to clear the package lock if a package fails to reinstall properly after an upgrade."); ?> <br /><br />
774
							<input name="Submit" type="submit" class="formbtn" id="clearpackagelock" value="<?=gettext("Clear Package Lock"); ?>" />
775
						<?php } ?>
696
						<?php }?>
697
						<?php if (is_subsystem_dirty("packagelock")) {?>
698
							<p><?=gettext("Click this button to clear the package lock if a package fails to reinstall properly after an upgrade.")?><br /><br />
699
							<input name="Submit" type="submit" class="formbtn" id="clearpackagelock" value="<?=gettext("Clear Package Lock")?>" />
700
						<?php }?>
776 701
							</p>
777 702
					</td>
778 703
				</tr>
779
				<?php } ?>
704
				<?php }?>
780 705
			</table>
781 706
			</div>
782 707
		</td>
......
784 709
</table>
785 710
</form>
786 711

  
787
<script type="text/javascript">
788
//<![CDATA[
789
encrypt_change();
790
decrypt_change();
791
//]]>
792
</script>
793

  
794
<?php include("fend.inc"); ?>
712
<?php include("fend.inc")?>
795 713
</body>
796 714
</html>
797 715
<?php
798 716

  
799 717
if (is_subsystem_dirty('restore'))
800 718
	system_reboot();
801

  
802
?>
719
?>
usr/local/www/fend.inc
15 15
</footer>
16 16

  
17 17
<script src="/jquery/jquery-1.11.1.min.js"></script>
18
<script src="/jquery/jquery-ui-1.11.2.min.js"></script>
18 19
<script src="/bootstrap/js/bootstrap.min.js"></script>
usr/local/www/firewall_nat.php
108 108
			// Check for filter rule associations
109 109
			if (isset($a_nat[$rulei]['associated-rule-id'])){
110 110
				delete_id($a_nat[$rulei]['associated-rule-id'], $config['filter']['rule']);
111
				
111

  
112 112
				mark_subsystem_dirty('filter');
113 113
			}
114 114
	        unset($a_nat[$rulei]);
......
172 172
echo "<script type=\"text/javascript\" src=\"/javascript/domTT/behaviour.js\"></script>";
173 173
echo "<script type=\"text/javascript\" src=\"/javascript/domTT/fadomatic.js\"></script>";
174 174

  
175
//FIXME This largely matches firewall_rules.php
175 176
?>
176 177
</head>
177 178

  
......
226 227
		  </td>
227 228
		</tr>
228 229
	<?php $nnats = $i = 0; foreach ($a_nat as $natent): ?>
229
	<?php 
230
	
230
	<?php
231

  
231 232
		//build Alias popup box
232 233
		$span_end = "</U></span>";
233 234

  
......
257 258
			$textss = "<span>";
258 259

  
259 260
		$textse = "</span>";
260
	
261

  
261 262
		/* if user does not have access to edit an interface skip on to the next record */
262
		if(!have_natpfruleint_access($natent['interface'])) 
263
		if(!have_natpfruleint_access($natent['interface']))
263 264
			continue;
264 265
	?>
265 266
                <tr valign="top" id="fr<?=$nnats;?>">
usr/local/www/firewall_nat_out.php
214 214
$pgtitle = array(gettext("Firewall"),gettext("NAT"),gettext("Outbound"));
215 215
include("head.inc");
216 216

  
217
//FIXME This largely matches firewall_rules.php
218

  
217 219
?>
218 220
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
219 221
<?php include("fbegin.inc"); ?>
usr/local/www/guiconfig.inc
1064 1064
	}
1065 1065
}
1066 1066

  
1067
function form_output_row($name, $label, $content){
1068
var_dump($content);die;
1069
?>
1070
<div class="form-group">
1071
	<label for="<?=$name?>" class="col-sm-2 control-label"><?=gettext($label); ?></label>
1072
	<div class="col-sm-10">
1073
		<?=$content?>
1074
	</div>
1075
</div>
1076
<?php
1077
}
1078

  
1067 1079
$timezone = $config['system']['timezone'];
1068 1080
if (!$timezone)
1069 1081
	$timezone = "Etc/UTC";
usr/local/www/index.php
258 258
<div class="panel panel-default">
259 259
	<div class="panel-heading"><h3><?=gettext("Available Widgets"); ?></h3></div>
260 260
	<div class="panel-body">
261
<?php
262
	foreach($widgets as $widgetname => $widgetconfig):
263
?>
261
<?php foreach($widgets as $widgetname => $widgetconfig): ?>
264 262
		<div class="col-sm-3"><a href="#"><i class="icon icon-plus"></i> <?=$widgetconfig['name']?></a></div>
265 263
<?php endforeach; ?>
266 264
	</div>
267 265
</div>
268 266

  
269
<div class="panel panel-default">
270
	<div class="panel-heading"><h3><?=gettext("Welcome to the Dashboard page"); ?>!</h3></div>
271
	<div class="panel-body">
267
<div class="modal fade">
268
<div class="modal-dialog">
269
<div class="modal-content">
270
	<div class="modal-header">
271
		<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
272
		<h4 class="modal-title"><?=gettext("Welcome to the Dashboard page"); ?>!</h4>
273
	</div>
274
	<div class="modal-body">
272 275
		<p>
273 276
			<?=gettext("This page allows you to customize the information you want to be displayed!");?>
274 277
			<?=gettext("To get started click the");?> FIXME <?=gettext("icon to add widgets.");?><br />
......
276 279
			<?=gettext("You can move any widget around by clicking and dragging the title.");?>
277 280
		</p>
278 281
	</div>
282
	<div class="modal-footer">
283
		<button type="button" class="btn btn-default btn-primary" data-dismiss="modal">Close</button>
284
	</div>
285
</div>
286
</div>
279 287
</div>
280 288

  
281 289
<?php
......
288 296
				<?=$widgetconfig['name']?>
289 297
				<span style="float: right">
290 298
					<a href="#"><i class="icon icon-wrench"></i></a>
291
					<a href="#"><i class="icon icon-plus-sign"></i></a>
292
					<a href="#"><i class="icon icon-minus-sign"></i></a>
299
					<a data-toggle="collapse" href="#widget-<?=$widgetname?>">
300
						<?php if ($widgetconfig['display'] == 'close'): ?>
301
							<i class="icon icon-plus-sign"></i>
302
						<?php else: ?>
303
							<i class="icon icon-minus-sign"></i>
304
						<?php endif; ?>
305
					</a>
293 306
					<a href="#"><i class="icon icon-remove-sign"></i></a>
294 307
				</span>
295 308
			</div>
296
			<div class="panel-body">
309
			<div class="panel-body collapse<?=($widgetconfig['display']=='close' ? '' : ' in')?>" id="widget-<?=$widgetname?>">
297 310
				<?php include('/usr/local/www/widgets/widgets/'. $widgetname.'.widget.php'); ?>
298 311
			</div>
299 312
		</div>
usr/local/www/jquery/jquery-ui-1.11.2.min.js
1
/*! jQuery UI - v1.11.2 - 2015-01-03
2
* http://jqueryui.com
3
* Includes: core.js, widget.js, mouse.js, draggable.js, droppable.js, selectable.js
4
* Copyright 2015 jQuery Foundation and other contributors; Licensed MIT */
5

  
6
(function(e){"function"==typeof define&&define.amd?define(["jquery"],e):e(jQuery)})(function(e){function t(t,s){var n,a,o,r=t.nodeName.toLowerCase();return"area"===r?(n=t.parentNode,a=n.name,t.href&&a&&"map"===n.nodeName.toLowerCase()?(o=e("img[usemap='#"+a+"']")[0],!!o&&i(o)):!1):(/input|select|textarea|button|object/.test(r)?!t.disabled:"a"===r?t.href||s:s)&&i(t)}function i(t){return e.expr.filters.visible(t)&&!e(t).parents().addBack().filter(function(){return"hidden"===e.css(this,"visibility")}).length}e.ui=e.ui||{},e.extend(e.ui,{version:"1.11.2",keyCode:{BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38}}),e.fn.extend({scrollParent:function(t){var i=this.css("position"),s="absolute"===i,n=t?/(auto|scroll|hidden)/:/(auto|scroll)/,a=this.parents().filter(function(){var t=e(this);return s&&"static"===t.css("position")?!1:n.test(t.css("overflow")+t.css("overflow-y")+t.css("overflow-x"))}).eq(0);return"fixed"!==i&&a.length?a:e(this[0].ownerDocument||document)},uniqueId:function(){var e=0;return function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++e)})}}(),removeUniqueId:function(){return this.each(function(){/^ui-id-\d+$/.test(this.id)&&e(this).removeAttr("id")})}}),e.extend(e.expr[":"],{data:e.expr.createPseudo?e.expr.createPseudo(function(t){return function(i){return!!e.data(i,t)}}):function(t,i,s){return!!e.data(t,s[3])},focusable:function(i){return t(i,!isNaN(e.attr(i,"tabindex")))},tabbable:function(i){var s=e.attr(i,"tabindex"),n=isNaN(s);return(n||s>=0)&&t(i,!n)}}),e("<a>").outerWidth(1).jquery||e.each(["Width","Height"],function(t,i){function s(t,i,s,a){return e.each(n,function(){i-=parseFloat(e.css(t,"padding"+this))||0,s&&(i-=parseFloat(e.css(t,"border"+this+"Width"))||0),a&&(i-=parseFloat(e.css(t,"margin"+this))||0)}),i}var n="Width"===i?["Left","Right"]:["Top","Bottom"],a=i.toLowerCase(),o={innerWidth:e.fn.innerWidth,innerHeight:e.fn.innerHeight,outerWidth:e.fn.outerWidth,outerHeight:e.fn.outerHeight};e.fn["inner"+i]=function(t){return void 0===t?o["inner"+i].call(this):this.each(function(){e(this).css(a,s(this,t)+"px")})},e.fn["outer"+i]=function(t,n){return"number"!=typeof t?o["outer"+i].call(this,t):this.each(function(){e(this).css(a,s(this,t,!0,n)+"px")})}}),e.fn.addBack||(e.fn.addBack=function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}),e("<a>").data("a-b","a").removeData("a-b").data("a-b")&&(e.fn.removeData=function(t){return function(i){return arguments.length?t.call(this,e.camelCase(i)):t.call(this)}}(e.fn.removeData)),e.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase()),e.fn.extend({focus:function(t){return function(i,s){return"number"==typeof i?this.each(function(){var t=this;setTimeout(function(){e(t).focus(),s&&s.call(t)},i)}):t.apply(this,arguments)}}(e.fn.focus),disableSelection:function(){var e="onselectstart"in document.createElement("div")?"selectstart":"mousedown";return function(){return this.bind(e+".ui-disableSelection",function(e){e.preventDefault()})}}(),enableSelection:function(){return this.unbind(".ui-disableSelection")},zIndex:function(t){if(void 0!==t)return this.css("zIndex",t);if(this.length)for(var i,s,n=e(this[0]);n.length&&n[0]!==document;){if(i=n.css("position"),("absolute"===i||"relative"===i||"fixed"===i)&&(s=parseInt(n.css("zIndex"),10),!isNaN(s)&&0!==s))return s;n=n.parent()}return 0}}),e.ui.plugin={add:function(t,i,s){var n,a=e.ui[t].prototype;for(n in s)a.plugins[n]=a.plugins[n]||[],a.plugins[n].push([i,s[n]])},call:function(e,t,i,s){var n,a=e.plugins[t];if(a&&(s||e.element[0].parentNode&&11!==e.element[0].parentNode.nodeType))for(n=0;a.length>n;n++)e.options[a[n][0]]&&a[n][1].apply(e.element,i)}};var s=0,n=Array.prototype.slice;e.cleanData=function(t){return function(i){var s,n,a;for(a=0;null!=(n=i[a]);a++)try{s=e._data(n,"events"),s&&s.remove&&e(n).triggerHandler("remove")}catch(o){}t(i)}}(e.cleanData),e.widget=function(t,i,s){var n,a,o,r,h={},l=t.split(".")[0];return t=t.split(".")[1],n=l+"-"+t,s||(s=i,i=e.Widget),e.expr[":"][n.toLowerCase()]=function(t){return!!e.data(t,n)},e[l]=e[l]||{},a=e[l][t],o=e[l][t]=function(e,t){return this._createWidget?(arguments.length&&this._createWidget(e,t),void 0):new o(e,t)},e.extend(o,a,{version:s.version,_proto:e.extend({},s),_childConstructors:[]}),r=new i,r.options=e.widget.extend({},r.options),e.each(s,function(t,s){return e.isFunction(s)?(h[t]=function(){var e=function(){return i.prototype[t].apply(this,arguments)},n=function(e){return i.prototype[t].apply(this,e)};return function(){var t,i=this._super,a=this._superApply;return this._super=e,this._superApply=n,t=s.apply(this,arguments),this._super=i,this._superApply=a,t}}(),void 0):(h[t]=s,void 0)}),o.prototype=e.widget.extend(r,{widgetEventPrefix:a?r.widgetEventPrefix||t:t},h,{constructor:o,namespace:l,widgetName:t,widgetFullName:n}),a?(e.each(a._childConstructors,function(t,i){var s=i.prototype;e.widget(s.namespace+"."+s.widgetName,o,i._proto)}),delete a._childConstructors):i._childConstructors.push(o),e.widget.bridge(t,o),o},e.widget.extend=function(t){for(var i,s,a=n.call(arguments,1),o=0,r=a.length;r>o;o++)for(i in a[o])s=a[o][i],a[o].hasOwnProperty(i)&&void 0!==s&&(t[i]=e.isPlainObject(s)?e.isPlainObject(t[i])?e.widget.extend({},t[i],s):e.widget.extend({},s):s);return t},e.widget.bridge=function(t,i){var s=i.prototype.widgetFullName||t;e.fn[t]=function(a){var o="string"==typeof a,r=n.call(arguments,1),h=this;return a=!o&&r.length?e.widget.extend.apply(null,[a].concat(r)):a,o?this.each(function(){var i,n=e.data(this,s);return"instance"===a?(h=n,!1):n?e.isFunction(n[a])&&"_"!==a.charAt(0)?(i=n[a].apply(n,r),i!==n&&void 0!==i?(h=i&&i.jquery?h.pushStack(i.get()):i,!1):void 0):e.error("no such method '"+a+"' for "+t+" widget instance"):e.error("cannot call methods on "+t+" prior to initialization; "+"attempted to call method '"+a+"'")}):this.each(function(){var t=e.data(this,s);t?(t.option(a||{}),t._init&&t._init()):e.data(this,s,new i(a,this))}),h}},e.Widget=function(){},e.Widget._childConstructors=[],e.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{disabled:!1,create:null},_createWidget:function(t,i){i=e(i||this.defaultElement||this)[0],this.element=e(i),this.uuid=s++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=e(),this.hoverable=e(),this.focusable=e(),i!==this&&(e.data(i,this.widgetFullName,this),this._on(!0,this.element,{remove:function(e){e.target===i&&this.destroy()}}),this.document=e(i.style?i.ownerDocument:i.document||i),this.window=e(this.document[0].defaultView||this.document[0].parentWindow)),this.options=e.widget.extend({},this.options,this._getCreateOptions(),t),this._create(),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:e.noop,_getCreateEventData:e.noop,_create:e.noop,_init:e.noop,destroy:function(){this._destroy(),this.element.unbind(this.eventNamespace).removeData(this.widgetFullName).removeData(e.camelCase(this.widgetFullName)),this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName+"-disabled "+"ui-state-disabled"),this.bindings.unbind(this.eventNamespace),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")},_destroy:e.noop,widget:function(){return this.element},option:function(t,i){var s,n,a,o=t;if(0===arguments.length)return e.widget.extend({},this.options);if("string"==typeof t)if(o={},s=t.split("."),t=s.shift(),s.length){for(n=o[t]=e.widget.extend({},this.options[t]),a=0;s.length-1>a;a++)n[s[a]]=n[s[a]]||{},n=n[s[a]];if(t=s.pop(),1===arguments.length)return void 0===n[t]?null:n[t];n[t]=i}else{if(1===arguments.length)return void 0===this.options[t]?null:this.options[t];o[t]=i}return this._setOptions(o),this},_setOptions:function(e){var t;for(t in e)this._setOption(t,e[t]);return this},_setOption:function(e,t){return this.options[e]=t,"disabled"===e&&(this.widget().toggleClass(this.widgetFullName+"-disabled",!!t),t&&(this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus"))),this},enable:function(){return this._setOptions({disabled:!1})},disable:function(){return this._setOptions({disabled:!0})},_on:function(t,i,s){var n,a=this;"boolean"!=typeof t&&(s=i,i=t,t=!1),s?(i=n=e(i),this.bindings=this.bindings.add(i)):(s=i,i=this.element,n=this.widget()),e.each(s,function(s,o){function r(){return t||a.options.disabled!==!0&&!e(this).hasClass("ui-state-disabled")?("string"==typeof o?a[o]:o).apply(a,arguments):void 0}"string"!=typeof o&&(r.guid=o.guid=o.guid||r.guid||e.guid++);var h=s.match(/^([\w:-]*)\s*(.*)$/),l=h[1]+a.eventNamespace,u=h[2];u?n.delegate(u,l,r):i.bind(l,r)})},_off:function(t,i){i=(i||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,t.unbind(i).undelegate(i),this.bindings=e(this.bindings.not(t).get()),this.focusable=e(this.focusable.not(t).get()),this.hoverable=e(this.hoverable.not(t).get())},_delay:function(e,t){function i(){return("string"==typeof e?s[e]:e).apply(s,arguments)}var s=this;return setTimeout(i,t||0)},_hoverable:function(t){this.hoverable=this.hoverable.add(t),this._on(t,{mouseenter:function(t){e(t.currentTarget).addClass("ui-state-hover")},mouseleave:function(t){e(t.currentTarget).removeClass("ui-state-hover")}})},_focusable:function(t){this.focusable=this.focusable.add(t),this._on(t,{focusin:function(t){e(t.currentTarget).addClass("ui-state-focus")},focusout:function(t){e(t.currentTarget).removeClass("ui-state-focus")}})},_trigger:function(t,i,s){var n,a,o=this.options[t];if(s=s||{},i=e.Event(i),i.type=(t===this.widgetEventPrefix?t:this.widgetEventPrefix+t).toLowerCase(),i.target=this.element[0],a=i.originalEvent)for(n in a)n in i||(i[n]=a[n]);return this.element.trigger(i,s),!(e.isFunction(o)&&o.apply(this.element[0],[i].concat(s))===!1||i.isDefaultPrevented())}},e.each({show:"fadeIn",hide:"fadeOut"},function(t,i){e.Widget.prototype["_"+t]=function(s,n,a){"string"==typeof n&&(n={effect:n});var o,r=n?n===!0||"number"==typeof n?i:n.effect||i:t;n=n||{},"number"==typeof n&&(n={duration:n}),o=!e.isEmptyObject(n),n.complete=a,n.delay&&s.delay(n.delay),o&&e.effects&&e.effects.effect[r]?s[t](n):r!==t&&s[r]?s[r](n.duration,n.easing,a):s.queue(function(i){e(this)[t](),a&&a.call(s[0]),i()})}}),e.widget;var a=!1;e(document).mouseup(function(){a=!1}),e.widget("ui.mouse",{version:"1.11.2",options:{cancel:"input,textarea,button,select,option",distance:1,delay:0},_mouseInit:function(){var t=this;this.element.bind("mousedown."+this.widgetName,function(e){return t._mouseDown(e)}).bind("click."+this.widgetName,function(i){return!0===e.data(i.target,t.widgetName+".preventClickEvent")?(e.removeData(i.target,t.widgetName+".preventClickEvent"),i.stopImmediatePropagation(),!1):void 0}),this.started=!1},_mouseDestroy:function(){this.element.unbind("."+this.widgetName),this._mouseMoveDelegate&&this.document.unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(t){if(!a){this._mouseMoved=!1,this._mouseStarted&&this._mouseUp(t),this._mouseDownEvent=t;var i=this,s=1===t.which,n="string"==typeof this.options.cancel&&t.target.nodeName?e(t.target).closest(this.options.cancel).length:!1;return s&&!n&&this._mouseCapture(t)?(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){i.mouseDelayMet=!0},this.options.delay)),this._mouseDistanceMet(t)&&this._mouseDelayMet(t)&&(this._mouseStarted=this._mouseStart(t)!==!1,!this._mouseStarted)?(t.preventDefault(),!0):(!0===e.data(t.target,this.widgetName+".preventClickEvent")&&e.removeData(t.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(e){return i._mouseMove(e)},this._mouseUpDelegate=function(e){return i._mouseUp(e)},this.document.bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate),t.preventDefault(),a=!0,!0)):!0}},_mouseMove:function(t){if(this._mouseMoved){if(e.ui.ie&&(!document.documentMode||9>document.documentMode)&&!t.button)return this._mouseUp(t);if(!t.which)return this._mouseUp(t)}return(t.which||t.button)&&(this._mouseMoved=!0),this._mouseStarted?(this._mouseDrag(t),t.preventDefault()):(this._mouseDistanceMet(t)&&this._mouseDelayMet(t)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,t)!==!1,this._mouseStarted?this._mouseDrag(t):this._mouseUp(t)),!this._mouseStarted)},_mouseUp:function(t){return this.document.unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,t.target===this._mouseDownEvent.target&&e.data(t.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(t)),a=!1,!1},_mouseDistanceMet:function(e){return Math.max(Math.abs(this._mouseDownEvent.pageX-e.pageX),Math.abs(this._mouseDownEvent.pageY-e.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}}),e.widget("ui.draggable",e.ui.mouse,{version:"1.11.2",widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1,drag:null,start:null,stop:null},_create:function(){"original"===this.options.helper&&this._setPositionRelative(),this.options.addClasses&&this.element.addClass("ui-draggable"),this.options.disabled&&this.element.addClass("ui-draggable-disabled"),this._setHandleClassName(),this._mouseInit()},_setOption:function(e,t){this._super(e,t),"handle"===e&&(this._removeHandleClassName(),this._setHandleClassName())},_destroy:function(){return(this.helper||this.element).is(".ui-draggable-dragging")?(this.destroyOnClear=!0,void 0):(this.element.removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled"),this._removeHandleClassName(),this._mouseDestroy(),void 0)},_mouseCapture:function(t){var i=this.options;return this._blurActiveElement(t),this.helper||i.disabled||e(t.target).closest(".ui-resizable-handle").length>0?!1:(this.handle=this._getHandle(t),this.handle?(this._blockFrames(i.iframeFix===!0?"iframe":i.iframeFix),!0):!1)},_blockFrames:function(t){this.iframeBlocks=this.document.find(t).map(function(){var t=e(this);return e("<div>").css("position","absolute").appendTo(t.parent()).outerWidth(t.outerWidth()).outerHeight(t.outerHeight()).offset(t.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_blurActiveElement:function(t){var i=this.document[0];if(this.handleElement.is(t.target))try{i.activeElement&&"body"!==i.activeElement.nodeName.toLowerCase()&&e(i.activeElement).blur()}catch(s){}},_mouseStart:function(t){var i=this.options;return this.helper=this._createHelper(t),this.helper.addClass("ui-draggable-dragging"),this._cacheHelperProportions(),e.ui.ddmanager&&(e.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(!0),this.offsetParent=this.helper.offsetParent(),this.hasFixedAncestor=this.helper.parents().filter(function(){return"fixed"===e(this).css("position")}).length>0,this.positionAbs=this.element.offset(),this._refreshOffsets(t),this.originalPosition=this.position=this._generatePosition(t,!1),this.originalPageX=t.pageX,this.originalPageY=t.pageY,i.cursorAt&&this._adjustOffsetFromHelper(i.cursorAt),this._setContainment(),this._trigger("start",t)===!1?(this._clear(),!1):(this._cacheHelperProportions(),e.ui.ddmanager&&!i.dropBehaviour&&e.ui.ddmanager.prepareOffsets(this,t),this._normalizeRightBottom(),this._mouseDrag(t,!0),e.ui.ddmanager&&e.ui.ddmanager.dragStart(this,t),!0)},_refreshOffsets:function(e){this.offset={top:this.positionAbs.top-this.margins.top,left:this.positionAbs.left-this.margins.left,scroll:!1,parent:this._getParentOffset(),relative:this._getRelativeOffset()},this.offset.click={left:e.pageX-this.offset.left,top:e.pageY-this.offset.top}},_mouseDrag:function(t,i){if(this.hasFixedAncestor&&(this.offset.parent=this._getParentOffset()),this.position=this._generatePosition(t,!0),this.positionAbs=this._convertPositionTo("absolute"),!i){var s=this._uiHash();if(this._trigger("drag",t,s)===!1)return this._mouseUp({}),!1;this.position=s.position}return this.helper[0].style.left=this.position.left+"px",this.helper[0].style.top=this.position.top+"px",e.ui.ddmanager&&e.ui.ddmanager.drag(this,t),!1},_mouseStop:function(t){var i=this,s=!1;return e.ui.ddmanager&&!this.options.dropBehaviour&&(s=e.ui.ddmanager.drop(this,t)),this.dropped&&(s=this.dropped,this.dropped=!1),"invalid"===this.options.revert&&!s||"valid"===this.options.revert&&s||this.options.revert===!0||e.isFunction(this.options.revert)&&this.options.revert.call(this.element,s)?e(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){i._trigger("stop",t)!==!1&&i._clear()}):this._trigger("stop",t)!==!1&&this._clear(),!1},_mouseUp:function(t){return this._unblockFrames(),e.ui.ddmanager&&e.ui.ddmanager.dragStop(this,t),this.handleElement.is(t.target)&&this.element.focus(),e.ui.mouse.prototype._mouseUp.call(this,t)},cancel:function(){return this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear(),this},_getHandle:function(t){return this.options.handle?!!e(t.target).closest(this.element.find(this.options.handle)).length:!0},_setHandleClassName:function(){this.handleElement=this.options.handle?this.element.find(this.options.handle):this.element,this.handleElement.addClass("ui-draggable-handle")},_removeHandleClassName:function(){this.handleElement.removeClass("ui-draggable-handle")},_createHelper:function(t){var i=this.options,s=e.isFunction(i.helper),n=s?e(i.helper.apply(this.element[0],[t])):"clone"===i.helper?this.element.clone().removeAttr("id"):this.element;return n.parents("body").length||n.appendTo("parent"===i.appendTo?this.element[0].parentNode:i.appendTo),s&&n[0]===this.element[0]&&this._setPositionRelative(),n[0]===this.element[0]||/(fixed|absolute)/.test(n.css("position"))||n.css("position","absolute"),n},_setPositionRelative:function(){/^(?:r|a|f)/.test(this.element.css("position"))||(this.element[0].style.position="relative")},_adjustOffsetFromHelper:function(t){"string"==typeof t&&(t=t.split(" ")),e.isArray(t)&&(t={left:+t[0],top:+t[1]||0}),"left"in t&&(this.offset.click.left=t.left+this.margins.left),"right"in t&&(this.offset.click.left=this.helperProportions.width-t.right+this.margins.left),"top"in t&&(this.offset.click.top=t.top+this.margins.top),"bottom"in t&&(this.offset.click.top=this.helperProportions.height-t.bottom+this.margins.top)},_isRootNode:function(e){return/(html|body)/i.test(e.tagName)||e===this.document[0]},_getParentOffset:function(){var t=this.offsetParent.offset(),i=this.document[0];return"absolute"===this.cssPosition&&this.scrollParent[0]!==i&&e.contains(this.scrollParent[0],this.offsetParent[0])&&(t.left+=this.scrollParent.scrollLeft(),t.top+=this.scrollParent.scrollTop()),this._isRootNode(this.offsetParent[0])&&(t={top:0,left:0}),{top:t.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:t.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"!==this.cssPosition)return{top:0,left:0};var e=this.element.position(),t=this._isRootNode(this.scrollParent[0]);return{top:e.top-(parseInt(this.helper.css("top"),10)||0)+(t?0:this.scrollParent.scrollTop()),left:e.left-(parseInt(this.helper.css("left"),10)||0)+(t?0:this.scrollParent.scrollLeft())}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var t,i,s,n=this.options,a=this.document[0];return this.relativeContainer=null,n.containment?"window"===n.containment?(this.containment=[e(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,e(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,e(window).scrollLeft()+e(window).width()-this.helperProportions.width-this.margins.left,e(window).scrollTop()+(e(window).height()||a.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top],void 0):"document"===n.containment?(this.containment=[0,0,e(a).width()-this.helperProportions.width-this.margins.left,(e(a).height()||a.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top],void 0):n.containment.constructor===Array?(this.containment=n.containment,void 0):("parent"===n.containment&&(n.containment=this.helper[0].parentNode),i=e(n.containment),s=i[0],s&&(t=/(scroll|auto)/.test(i.css("overflow")),this.containment=[(parseInt(i.css("borderLeftWidth"),10)||0)+(parseInt(i.css("paddingLeft"),10)||0),(parseInt(i.css("borderTopWidth"),10)||0)+(parseInt(i.css("paddingTop"),10)||0),(t?Math.max(s.scrollWidth,s.offsetWidth):s.offsetWidth)-(parseInt(i.css("borderRightWidth"),10)||0)-(parseInt(i.css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(t?Math.max(s.scrollHeight,s.offsetHeight):s.offsetHeight)-(parseInt(i.css("borderBottomWidth"),10)||0)-(parseInt(i.css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relativeContainer=i),void 0):(this.containment=null,void 0)},_convertPositionTo:function(e,t){t||(t=this.position);var i="absolute"===e?1:-1,s=this._isRootNode(this.scrollParent[0]);return{top:t.top+this.offset.relative.top*i+this.offset.parent.top*i-("fixed"===this.cssPosition?-this.offset.scroll.top:s?0:this.offset.scroll.top)*i,left:t.left+this.offset.relative.left*i+this.offset.parent.left*i-("fixed"===this.cssPosition?-this.offset.scroll.left:s?0:this.offset.scroll.left)*i}},_generatePosition:function(e,t){var i,s,n,a,o=this.options,r=this._isRootNode(this.scrollParent[0]),h=e.pageX,l=e.pageY;return r&&this.offset.scroll||(this.offset.scroll={top:this.scrollParent.scrollTop(),left:this.scrollParent.scrollLeft()}),t&&(this.containment&&(this.relativeContainer?(s=this.relativeContainer.offset(),i=[this.containment[0]+s.left,this.containment[1]+s.top,this.containment[2]+s.left,this.containment[3]+s.top]):i=this.containment,e.pageX-this.offset.click.left<i[0]&&(h=i[0]+this.offset.click.left),e.pageY-this.offset.click.top<i[1]&&(l=i[1]+this.offset.click.top),e.pageX-this.offset.click.left>i[2]&&(h=i[2]+this.offset.click.left),e.pageY-this.offset.click.top>i[3]&&(l=i[3]+this.offset.click.top)),o.grid&&(n=o.grid[1]?this.originalPageY+Math.round((l-this.originalPageY)/o.grid[1])*o.grid[1]:this.originalPageY,l=i?n-this.offset.click.top>=i[1]||n-this.offset.click.top>i[3]?n:n-this.offset.click.top>=i[1]?n-o.grid[1]:n+o.grid[1]:n,a=o.grid[0]?this.originalPageX+Math.round((h-this.originalPageX)/o.grid[0])*o.grid[0]:this.originalPageX,h=i?a-this.offset.click.left>=i[0]||a-this.offset.click.left>i[2]?a:a-this.offset.click.left>=i[0]?a-o.grid[0]:a+o.grid[0]:a),"y"===o.axis&&(h=this.originalPageX),"x"===o.axis&&(l=this.originalPageY)),{top:l-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.offset.scroll.top:r?0:this.offset.scroll.top),left:h-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.offset.scroll.left:r?0:this.offset.scroll.left)}},_clear:function(){this.helper.removeClass("ui-draggable-dragging"),this.helper[0]===this.element[0]||this.cancelHelperRemoval||this.helper.remove(),this.helper=null,this.cancelHelperRemoval=!1,this.destroyOnClear&&this.destroy()},_normalizeRightBottom:function(){"y"!==this.options.axis&&"auto"!==this.helper.css("right")&&(this.helper.width(this.helper.width()),this.helper.css("right","auto")),"x"!==this.options.axis&&"auto"!==this.helper.css("bottom")&&(this.helper.height(this.helper.height()),this.helper.css("bottom","auto"))},_trigger:function(t,i,s){return s=s||this._uiHash(),e.ui.plugin.call(this,t,[i,s,this],!0),/^(drag|start|stop)/.test(t)&&(this.positionAbs=this._convertPositionTo("absolute"),s.offset=this.positionAbs),e.Widget.prototype._trigger.call(this,t,i,s)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}}),e.ui.plugin.add("draggable","connectToSortable",{start:function(t,i,s){var n=e.extend({},i,{item:s.element});s.sortables=[],e(s.options.connectToSortable).each(function(){var i=e(this).sortable("instance");i&&!i.options.disabled&&(s.sortables.push(i),i.refreshPositions(),i._trigger("activate",t,n))})},stop:function(t,i,s){var n=e.extend({},i,{item:s.element});s.cancelHelperRemoval=!1,e.each(s.sortables,function(){var e=this;e.isOver?(e.isOver=0,s.cancelHelperRemoval=!0,e.cancelHelperRemoval=!1,e._storedCSS={position:e.placeholder.css("position"),top:e.placeholder.css("top"),left:e.placeholder.css("left")},e._mouseStop(t),e.options.helper=e.options._helper):(e.cancelHelperRemoval=!0,e._trigger("deactivate",t,n))})},drag:function(t,i,s){e.each(s.sortables,function(){var n=!1,a=this;a.positionAbs=s.positionAbs,a.helperProportions=s.helperProportions,a.offset.click=s.offset.click,a._intersectsWith(a.containerCache)&&(n=!0,e.each(s.sortables,function(){return this.positionAbs=s.positionAbs,this.helperProportions=s.helperProportions,this.offset.click=s.offset.click,this!==a&&this._intersectsWith(this.containerCache)&&e.contains(a.element[0],this.element[0])&&(n=!1),n})),n?(a.isOver||(a.isOver=1,a.currentItem=i.helper.appendTo(a.element).data("ui-sortable-item",!0),a.options._helper=a.options.helper,a.options.helper=function(){return i.helper[0]},t.target=a.currentItem[0],a._mouseCapture(t,!0),a._mouseStart(t,!0,!0),a.offset.click.top=s.offset.click.top,a.offset.click.left=s.offset.click.left,a.offset.parent.left-=s.offset.parent.left-a.offset.parent.left,a.offset.parent.top-=s.offset.parent.top-a.offset.parent.top,s._trigger("toSortable",t),s.dropped=a.element,e.each(s.sortables,function(){this.refreshPositions()}),s.currentItem=s.element,a.fromOutside=s),a.currentItem&&(a._mouseDrag(t),i.position=a.position)):a.isOver&&(a.isOver=0,a.cancelHelperRemoval=!0,a.options._revert=a.options.revert,a.options.revert=!1,a._trigger("out",t,a._uiHash(a)),a._mouseStop(t,!0),a.options.revert=a.options._revert,a.options.helper=a.options._helper,a.placeholder&&a.placeholder.remove(),s._refreshOffsets(t),i.position=s._generatePosition(t,!0),s._trigger("fromSortable",t),s.dropped=!1,e.each(s.sortables,function(){this.refreshPositions()}))})}}),e.ui.plugin.add("draggable","cursor",{start:function(t,i,s){var n=e("body"),a=s.options;n.css("cursor")&&(a._cursor=n.css("cursor")),n.css("cursor",a.cursor)},stop:function(t,i,s){var n=s.options;n._cursor&&e("body").css("cursor",n._cursor)}}),e.ui.plugin.add("draggable","opacity",{start:function(t,i,s){var n=e(i.helper),a=s.options;n.css("opacity")&&(a._opacity=n.css("opacity")),n.css("opacity",a.opacity)},stop:function(t,i,s){var n=s.options;n._opacity&&e(i.helper).css("opacity",n._opacity)}}),e.ui.plugin.add("draggable","scroll",{start:function(e,t,i){i.scrollParentNotHidden||(i.scrollParentNotHidden=i.helper.scrollParent(!1)),i.scrollParentNotHidden[0]!==i.document[0]&&"HTML"!==i.scrollParentNotHidden[0].tagName&&(i.overflowOffset=i.scrollParentNotHidden.offset())},drag:function(t,i,s){var n=s.options,a=!1,o=s.scrollParentNotHidden[0],r=s.document[0];o!==r&&"HTML"!==o.tagName?(n.axis&&"x"===n.axis||(s.overflowOffset.top+o.offsetHeight-t.pageY<n.scrollSensitivity?o.scrollTop=a=o.scrollTop+n.scrollSpeed:t.pageY-s.overflowOffset.top<n.scrollSensitivity&&(o.scrollTop=a=o.scrollTop-n.scrollSpeed)),n.axis&&"y"===n.axis||(s.overflowOffset.left+o.offsetWidth-t.pageX<n.scrollSensitivity?o.scrollLeft=a=o.scrollLeft+n.scrollSpeed:t.pageX-s.overflowOffset.left<n.scrollSensitivity&&(o.scrollLeft=a=o.scrollLeft-n.scrollSpeed))):(n.axis&&"x"===n.axis||(t.pageY-e(r).scrollTop()<n.scrollSensitivity?a=e(r).scrollTop(e(r).scrollTop()-n.scrollSpeed):e(window).height()-(t.pageY-e(r).scrollTop())<n.scrollSensitivity&&(a=e(r).scrollTop(e(r).scrollTop()+n.scrollSpeed))),n.axis&&"y"===n.axis||(t.pageX-e(r).scrollLeft()<n.scrollSensitivity?a=e(r).scrollLeft(e(r).scrollLeft()-n.scrollSpeed):e(window).width()-(t.pageX-e(r).scrollLeft())<n.scrollSensitivity&&(a=e(r).scrollLeft(e(r).scrollLeft()+n.scrollSpeed)))),a!==!1&&e.ui.ddmanager&&!n.dropBehaviour&&e.ui.ddmanager.prepareOffsets(s,t)}}),e.ui.plugin.add("draggable","snap",{start:function(t,i,s){var n=s.options;s.snapElements=[],e(n.snap.constructor!==String?n.snap.items||":data(ui-draggable)":n.snap).each(function(){var t=e(this),i=t.offset();this!==s.element[0]&&s.snapElements.push({item:this,width:t.outerWidth(),height:t.outerHeight(),top:i.top,left:i.left})})},drag:function(t,i,s){var n,a,o,r,h,l,u,d,c,p,f=s.options,m=f.snapTolerance,g=i.offset.left,v=g+s.helperProportions.width,y=i.offset.top,b=y+s.helperProportions.height;for(c=s.snapElements.length-1;c>=0;c--)h=s.snapElements[c].left-s.margins.left,l=h+s.snapElements[c].width,u=s.snapElements[c].top-s.margins.top,d=u+s.snapElements[c].height,h-m>v||g>l+m||u-m>b||y>d+m||!e.contains(s.snapElements[c].item.ownerDocument,s.snapElements[c].item)?(s.snapElements[c].snapping&&s.options.snap.release&&s.options.snap.release.call(s.element,t,e.extend(s._uiHash(),{snapItem:s.snapElements[c].item})),s.snapElements[c].snapping=!1):("inner"!==f.snapMode&&(n=m>=Math.abs(u-b),a=m>=Math.abs(d-y),o=m>=Math.abs(h-v),r=m>=Math.abs(l-g),n&&(i.position.top=s._convertPositionTo("relative",{top:u-s.helperProportions.height,left:0}).top),a&&(i.position.top=s._convertPositionTo("relative",{top:d,left:0}).top),o&&(i.position.left=s._convertPositionTo("relative",{top:0,left:h-s.helperProportions.width}).left),r&&(i.position.left=s._convertPositionTo("relative",{top:0,left:l}).left)),p=n||a||o||r,"outer"!==f.snapMode&&(n=m>=Math.abs(u-y),a=m>=Math.abs(d-b),o=m>=Math.abs(h-g),r=m>=Math.abs(l-v),n&&(i.position.top=s._convertPositionTo("relative",{top:u,left:0}).top),a&&(i.position.top=s._convertPositionTo("relative",{top:d-s.helperProportions.height,left:0}).top),o&&(i.position.left=s._convertPositionTo("relative",{top:0,left:h}).left),r&&(i.position.left=s._convertPositionTo("relative",{top:0,left:l-s.helperProportions.width}).left)),!s.snapElements[c].snapping&&(n||a||o||r||p)&&s.options.snap.snap&&s.options.snap.snap.call(s.element,t,e.extend(s._uiHash(),{snapItem:s.snapElements[c].item})),s.snapElements[c].snapping=n||a||o||r||p)}}),e.ui.plugin.add("draggable","stack",{start:function(t,i,s){var n,a=s.options,o=e.makeArray(e(a.stack)).sort(function(t,i){return(parseInt(e(t).css("zIndex"),10)||0)-(parseInt(e(i).css("zIndex"),10)||0)});o.length&&(n=parseInt(e(o[0]).css("zIndex"),10)||0,e(o).each(function(t){e(this).css("zIndex",n+t)}),this.css("zIndex",n+o.length))}}),e.ui.plugin.add("draggable","zIndex",{start:function(t,i,s){var n=e(i.helper),a=s.options;n.css("zIndex")&&(a._zIndex=n.css("zIndex")),n.css("zIndex",a.zIndex)},stop:function(t,i,s){var n=s.options;n._zIndex&&e(i.helper).css("zIndex",n._zIndex)}}),e.ui.draggable,e.widget("ui.droppable",{version:"1.11.2",widgetEventPrefix:"drop",options:{accept:"*",activeClass:!1,addClasses:!0,greedy:!1,hoverClass:!1,scope:"default",tolerance:"intersect",activate:null,deactivate:null,drop:null,out:null,over:null},_create:function(){var t,i=this.options,s=i.accept;this.isover=!1,this.isout=!0,this.accept=e.isFunction(s)?s:function(e){return e.is(s)
7
},this.proportions=function(){return arguments.length?(t=arguments[0],void 0):t?t:t={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight}},this._addToManager(i.scope),i.addClasses&&this.element.addClass("ui-droppable")},_addToManager:function(t){e.ui.ddmanager.droppables[t]=e.ui.ddmanager.droppables[t]||[],e.ui.ddmanager.droppables[t].push(this)},_splice:function(e){for(var t=0;e.length>t;t++)e[t]===this&&e.splice(t,1)},_destroy:function(){var t=e.ui.ddmanager.droppables[this.options.scope];this._splice(t),this.element.removeClass("ui-droppable ui-droppable-disabled")},_setOption:function(t,i){if("accept"===t)this.accept=e.isFunction(i)?i:function(e){return e.is(i)};else if("scope"===t){var s=e.ui.ddmanager.droppables[this.options.scope];this._splice(s),this._addToManager(i)}this._super(t,i)},_activate:function(t){var i=e.ui.ddmanager.current;this.options.activeClass&&this.element.addClass(this.options.activeClass),i&&this._trigger("activate",t,this.ui(i))},_deactivate:function(t){var i=e.ui.ddmanager.current;this.options.activeClass&&this.element.removeClass(this.options.activeClass),i&&this._trigger("deactivate",t,this.ui(i))},_over:function(t){var i=e.ui.ddmanager.current;i&&(i.currentItem||i.element)[0]!==this.element[0]&&this.accept.call(this.element[0],i.currentItem||i.element)&&(this.options.hoverClass&&this.element.addClass(this.options.hoverClass),this._trigger("over",t,this.ui(i)))},_out:function(t){var i=e.ui.ddmanager.current;i&&(i.currentItem||i.element)[0]!==this.element[0]&&this.accept.call(this.element[0],i.currentItem||i.element)&&(this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("out",t,this.ui(i)))},_drop:function(t,i){var s=i||e.ui.ddmanager.current,n=!1;return s&&(s.currentItem||s.element)[0]!==this.element[0]?(this.element.find(":data(ui-droppable)").not(".ui-draggable-dragging").each(function(){var i=e(this).droppable("instance");return i.options.greedy&&!i.options.disabled&&i.options.scope===s.options.scope&&i.accept.call(i.element[0],s.currentItem||s.element)&&e.ui.intersect(s,e.extend(i,{offset:i.element.offset()}),i.options.tolerance,t)?(n=!0,!1):void 0}),n?!1:this.accept.call(this.element[0],s.currentItem||s.element)?(this.options.activeClass&&this.element.removeClass(this.options.activeClass),this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("drop",t,this.ui(s)),this.element):!1):!1},ui:function(e){return{draggable:e.currentItem||e.element,helper:e.helper,position:e.position,offset:e.positionAbs}}}),e.ui.intersect=function(){function e(e,t,i){return e>=t&&t+i>e}return function(t,i,s,n){if(!i.offset)return!1;var a=(t.positionAbs||t.position.absolute).left+t.margins.left,o=(t.positionAbs||t.position.absolute).top+t.margins.top,r=a+t.helperProportions.width,h=o+t.helperProportions.height,l=i.offset.left,u=i.offset.top,d=l+i.proportions().width,c=u+i.proportions().height;switch(s){case"fit":return a>=l&&d>=r&&o>=u&&c>=h;case"intersect":return a+t.helperProportions.width/2>l&&d>r-t.helperProportions.width/2&&o+t.helperProportions.height/2>u&&c>h-t.helperProportions.height/2;case"pointer":return e(n.pageY,u,i.proportions().height)&&e(n.pageX,l,i.proportions().width);case"touch":return(o>=u&&c>=o||h>=u&&c>=h||u>o&&h>c)&&(a>=l&&d>=a||r>=l&&d>=r||l>a&&r>d);default:return!1}}}(),e.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(t,i){var s,n,a=e.ui.ddmanager.droppables[t.options.scope]||[],o=i?i.type:null,r=(t.currentItem||t.element).find(":data(ui-droppable)").addBack();e:for(s=0;a.length>s;s++)if(!(a[s].options.disabled||t&&!a[s].accept.call(a[s].element[0],t.currentItem||t.element))){for(n=0;r.length>n;n++)if(r[n]===a[s].element[0]){a[s].proportions().height=0;continue e}a[s].visible="none"!==a[s].element.css("display"),a[s].visible&&("mousedown"===o&&a[s]._activate.call(a[s],i),a[s].offset=a[s].element.offset(),a[s].proportions({width:a[s].element[0].offsetWidth,height:a[s].element[0].offsetHeight}))}},drop:function(t,i){var s=!1;return e.each((e.ui.ddmanager.droppables[t.options.scope]||[]).slice(),function(){this.options&&(!this.options.disabled&&this.visible&&e.ui.intersect(t,this,this.options.tolerance,i)&&(s=this._drop.call(this,i)||s),!this.options.disabled&&this.visible&&this.accept.call(this.element[0],t.currentItem||t.element)&&(this.isout=!0,this.isover=!1,this._deactivate.call(this,i)))}),s},dragStart:function(t,i){t.element.parentsUntil("body").bind("scroll.droppable",function(){t.options.refreshPositions||e.ui.ddmanager.prepareOffsets(t,i)})},drag:function(t,i){t.options.refreshPositions&&e.ui.ddmanager.prepareOffsets(t,i),e.each(e.ui.ddmanager.droppables[t.options.scope]||[],function(){if(!this.options.disabled&&!this.greedyChild&&this.visible){var s,n,a,o=e.ui.intersect(t,this,this.options.tolerance,i),r=!o&&this.isover?"isout":o&&!this.isover?"isover":null;r&&(this.options.greedy&&(n=this.options.scope,a=this.element.parents(":data(ui-droppable)").filter(function(){return e(this).droppable("instance").options.scope===n}),a.length&&(s=e(a[0]).droppable("instance"),s.greedyChild="isover"===r)),s&&"isover"===r&&(s.isover=!1,s.isout=!0,s._out.call(s,i)),this[r]=!0,this["isout"===r?"isover":"isout"]=!1,this["isover"===r?"_over":"_out"].call(this,i),s&&"isout"===r&&(s.isout=!1,s.isover=!0,s._over.call(s,i)))}})},dragStop:function(t,i){t.element.parentsUntil("body").unbind("scroll.droppable"),t.options.refreshPositions||e.ui.ddmanager.prepareOffsets(t,i)}},e.ui.droppable,e.widget("ui.selectable",e.ui.mouse,{version:"1.11.2",options:{appendTo:"body",autoRefresh:!0,distance:0,filter:"*",tolerance:"touch",selected:null,selecting:null,start:null,stop:null,unselected:null,unselecting:null},_create:function(){var t,i=this;this.element.addClass("ui-selectable"),this.dragged=!1,this.refresh=function(){t=e(i.options.filter,i.element[0]),t.addClass("ui-selectee"),t.each(function(){var t=e(this),i=t.offset();e.data(this,"selectable-item",{element:this,$element:t,left:i.left,top:i.top,right:i.left+t.outerWidth(),bottom:i.top+t.outerHeight(),startselected:!1,selected:t.hasClass("ui-selected"),selecting:t.hasClass("ui-selecting"),unselecting:t.hasClass("ui-unselecting")})})},this.refresh(),this.selectees=t.addClass("ui-selectee"),this._mouseInit(),this.helper=e("<div class='ui-selectable-helper'></div>")},_destroy:function(){this.selectees.removeClass("ui-selectee").removeData("selectable-item"),this.element.removeClass("ui-selectable ui-selectable-disabled"),this._mouseDestroy()},_mouseStart:function(t){var i=this,s=this.options;this.opos=[t.pageX,t.pageY],this.options.disabled||(this.selectees=e(s.filter,this.element[0]),this._trigger("start",t),e(s.appendTo).append(this.helper),this.helper.css({left:t.pageX,top:t.pageY,width:0,height:0}),s.autoRefresh&&this.refresh(),this.selectees.filter(".ui-selected").each(function(){var s=e.data(this,"selectable-item");s.startselected=!0,t.metaKey||t.ctrlKey||(s.$element.removeClass("ui-selected"),s.selected=!1,s.$element.addClass("ui-unselecting"),s.unselecting=!0,i._trigger("unselecting",t,{unselecting:s.element}))}),e(t.target).parents().addBack().each(function(){var s,n=e.data(this,"selectable-item");return n?(s=!t.metaKey&&!t.ctrlKey||!n.$element.hasClass("ui-selected"),n.$element.removeClass(s?"ui-unselecting":"ui-selected").addClass(s?"ui-selecting":"ui-unselecting"),n.unselecting=!s,n.selecting=s,n.selected=s,s?i._trigger("selecting",t,{selecting:n.element}):i._trigger("unselecting",t,{unselecting:n.element}),!1):void 0}))},_mouseDrag:function(t){if(this.dragged=!0,!this.options.disabled){var i,s=this,n=this.options,a=this.opos[0],o=this.opos[1],r=t.pageX,h=t.pageY;return a>r&&(i=r,r=a,a=i),o>h&&(i=h,h=o,o=i),this.helper.css({left:a,top:o,width:r-a,height:h-o}),this.selectees.each(function(){var i=e.data(this,"selectable-item"),l=!1;i&&i.element!==s.element[0]&&("touch"===n.tolerance?l=!(i.left>r||a>i.right||i.top>h||o>i.bottom):"fit"===n.tolerance&&(l=i.left>a&&r>i.right&&i.top>o&&h>i.bottom),l?(i.selected&&(i.$element.removeClass("ui-selected"),i.selected=!1),i.unselecting&&(i.$element.removeClass("ui-unselecting"),i.unselecting=!1),i.selecting||(i.$element.addClass("ui-selecting"),i.selecting=!0,s._trigger("selecting",t,{selecting:i.element}))):(i.selecting&&((t.metaKey||t.ctrlKey)&&i.startselected?(i.$element.removeClass("ui-selecting"),i.selecting=!1,i.$element.addClass("ui-selected"),i.selected=!0):(i.$element.removeClass("ui-selecting"),i.selecting=!1,i.startselected&&(i.$element.addClass("ui-unselecting"),i.unselecting=!0),s._trigger("unselecting",t,{unselecting:i.element}))),i.selected&&(t.metaKey||t.ctrlKey||i.startselected||(i.$element.removeClass("ui-selected"),i.selected=!1,i.$element.addClass("ui-unselecting"),i.unselecting=!0,s._trigger("unselecting",t,{unselecting:i.element})))))}),!1}},_mouseStop:function(t){var i=this;return this.dragged=!1,e(".ui-unselecting",this.element[0]).each(function(){var s=e.data(this,"selectable-item");s.$element.removeClass("ui-unselecting"),s.unselecting=!1,s.startselected=!1,i._trigger("unselected",t,{unselected:s.element})}),e(".ui-selecting",this.element[0]).each(function(){var s=e.data(this,"selectable-item");s.$element.removeClass("ui-selecting").addClass("ui-selected"),s.selecting=!1,s.selected=!0,s.startselected=!0,i._trigger("selected",t,{selected:s.element})}),this._trigger("stop",t),this.helper.remove(),!1}})});
usr/local/www/widgets/javascript/gmirror_status.js
1
function gmirrorStatusUpdateFromServer(){
2
	$.ajax({
3
		type: 'GET',
4
		url: '/widgets/widgets/gmirror_status.widget.php',
5
		dataType: 'html',
6
		success: function(data){
7
			$('#gmirror_status').html(data);
8
		}
9
	});
10
}
11

  
12
$(document).ready(function(){
13
	setInterval('gmirrorStatusUpdateFromServer()', 60*1000);
14
});
usr/local/www/widgets/javascript/ntp_status.js
5 5
		data: 'updateme=yes',
6 6
		dataType: 'html',
7 7
		success: function(data){
8
			console.log(data);
9 8
			$('#ntp_status_widget').html(data);
10 9
		}
11 10
	});
......
15 14
	// Javascript handles overflowing
16 15
	ntpServerTime.setSeconds(ntpServerTime.getSeconds()+1);
17 16

  
18
	$('#ntpStatusClock').html(ntpServerTime);
17
	$('#ntpStatusClock').html(ntpServerTime.toString());
19 18
}
20 19

  
21 20
$(document).ready(function(){
usr/local/www/widgets/widgets/gmirror_status.widget.php
32 32
require_once("guiconfig.inc");
33 33
require_once("gmirror.inc");
34 34

  
35
if ($_GET['textonly'] == "true") {
36
	header("Cache-Control: no-cache");
37
	echo gmirror_html_status();
38
	exit;
39
}
40 35
?>
41
<table>
42
	<tbody id="gmirror_status_table">
43
		<?php echo gmirror_html_status(); ?>
44
	</tbody>
45
</table>
46

  
47
<script type="text/javascript">
48
//<![CDATA[
49
	var gmirrorupdater = new Ajax.PeriodicalUpdater('gmirror_status_table', '/widgets/widgets/gmirror_status.widget.php?textonly=true',
50
	{ method: 'get', frequency: 5 } );
51
//]]>
52
</script>
36
<div id="gmirror_status">
37
	<?=gmirror_html_status()?>
38
</div>
usr/local/www/widgets/widgets/ntp_status.widget.php
140 140
		<td id="ntpStatusClock">
141 141
			<script>var ntpServerTime = new Date('<?=date_format(date_create(), 'c')?>');</script>
142 142
			<!-- display initial value before javascript takes over -->
143
			<?=date_format(date_create(), 'D j Y H:i:s \G\M\T O (T)');?>
143
			<?=gmdate('D j Y H:i:s \G\M\T O (T)');?>
144 144
		</td>
145 145
	</tr>
146 146
	<tr>
usr/local/www/widgets/widgets/services_status.widget.php
60 60
<table class="table table-striped">
61 61
<thead>
62 62
	<tr>
63
		<th></th>
63 64
		<th>Service</td>
64 65
		<th>Description</td>
65 66
		<th>Action</td>
......
81 82
		$service_desc = explode(".",$service['description']);
82 83
?>
83 84
		<tr>
84
			<th><i class="icon icon-<?=get_service_status($service)? 'ok' : 'remove'?>"></i> <?=$service['name']?></th>
85
			<td><i class="icon icon-<?=get_service_status($service)? 'ok' : 'remove'?>-sign"></i></td>
86
			<td><?=$service['name']?></td>
85 87
			<td><?=$service_desc[0]?></td>
86 88
			<td><?=get_service_control_links($service)?></td>
87 89
		</tr>
usr/local/www/widgets/widgets/smart_status.widget.php
33 33
require_once("/usr/local/www/widgets/include/smart_status.inc");
34 34
?>
35 35

  
36
<table>
37
	<tr>
38
		<td class="widgetsubheader" align="center"><b><?php echo gettext("Drive") ?></b></td>
39
		<td class="widgetsubheader" align="center"><b><?php echo gettext("Ident") ?></b></td>
40
		<td class="widgetsubheader" align="center"><b><?php echo gettext("SMART Status") ?></b></td>
41
	</tr>
42

  
36
<table class="table table-striped">
37
	<thead>
38
		<tr>
39
			<th></th>
40
			<th><?=gettext("Drive")?></th>
41
			<th><?=gettext("Ident")?></th>
42
			<th><?=gettext("SMART Status")?></th>
43
		</tr>
44
	</thead>
45
	<tbody>
43 46
<?php
44 47
$devs = array();
45 48
## Get all adX, daX, and adaX (IDE, SCSI, and AHCI) devices currently installed
46 49
$devs = get_smart_drive_list();
47 50

  
48
if(count($devs) > 0)  {
49
	foreach($devs as $dev)  {	## for each found drive do
50
		$dev_ident = exec("diskinfo -v /dev/$dev | grep ident	| awk '{print $1}'"); ## get identifier from drive
51
		$dev_state = trim(exec("smartctl -H /dev/$dev | awk -F: '/^SMART overall-health self-assessment test result/ {print $2;exit}
51
foreach($devs as $dev):
52
	$dev_ident = exec("diskinfo -v /dev/$dev | grep ident	| awk '{print $1}'"); ## get identifier from drive
53
	$dev_state = trim(exec("smartctl -H /dev/$dev | awk -F: '/^SMART overall-health self-assessment test result/ {print $2;exit}
52 54
/^SMART Health Status/ {print $2;exit}'")); ## get SMART state from drive
53
		switch ($dev_state) {
55
	switch ($dev_state) {
54 56
		case "PASSED":
55 57
		case "OK":
56
			$color = "#90EE90";
58
			$icon = 'ok';
57 59
			break;
58 60
		case "":
59 61
			$dev_state = "Unknown";
60
			$color = "#C0B788";
62
			$icon = 'question';
61 63
			break;
62 64
		default:
63
			$color = "#F08080";
65
			$icon = 'remove';
64 66
			break;
65
		}
67
	}
66 68
?>
67 69
		<tr>
68
			<td class="listlr"><?php echo $dev; ?></td>
69
			<td class="listr" align="center"><?php echo $dev_ident; ?></td>
70
			<td class="listr" align="center"><span style="background-color:<?php echo $color; ?>">&nbsp;<?php echo $dev_state; ?>&nbsp;</span></td>
70
			<td><i class="icon icon-<?=$icon?>-sign"></i></td>
71
			<td><?=$dev?></td>
72
			<td><?=$dev_ident?></td>
73
			<td><?=ucfirst($dev_state)?></td>
71 74
		</tr>
72
<?php	}
73
}
74
?>
75
<?php endforeach; ?>
76
	</tbody>
75 77
</table>
usr/local/www/widgets/widgets/traffic_graphs.widget.php
100 100
?>
101 101
<input type="hidden" id="traffic_graphs-config" name="traffic_graphs-config" value="" />
102 102

  
103
<div id="traffic_graphs-settings" class="widgetconfigdiv" style="display:none;">
103
<div>
104 104
<form action="/widgets/widgets/traffic_graphs.widget.php" method="post" name="iform" id="iform">
105
	<?php foreach ($ifdescrs as $ifname => $ifdescr) { ?>
106
		<input type="hidden" name="shown[<?= $ifname ?>]" value="<?= $shown[$ifname] ? "show" : "hide" ?>" />
107
	<?php } ?>
105
	<?php foreach ($ifdescrs as $ifname => $ifdescr) {?>
106
		<input type="hidden" name="shown[<?= $ifname?>]" value="<?= $shown[$ifname] ? "show" : "hide"?>" />
107
	<?php }?>
108 108
	Default AutoScale:
109 109
		<?php
110 110
			$scale_type_up="checked=\"checked\"";
......
120 120
					$scale_type_follow = "checked=\"checked\"";
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff