Revision 5f601060
Added by Phil Davis over 10 years ago
usr/local/www/diag_nanobsd.php | ||
---|---|---|
27 | 27 |
POSSIBILITY OF SUCH DAMAGE. |
28 | 28 |
*/ |
29 | 29 |
|
30 |
/*
|
|
30 |
/* |
|
31 | 31 |
pfSense_BUILDER_BINARIES: /sbin/mount /sbin/glabel /usr/bin/grep /usr/bin/cut /usr/bin/head /bin/cp |
32 | 32 |
pfSense_BUILDER_BINARIES: /usr/sbin/boot0cfg /bin/mkdir /sbin/fsck_ufs /sbin/mount /bin/dd /sbin/tunefs |
33 | 33 |
pfSense_MODULE: nanobsd |
... | ... | |
66 | 66 |
|
67 | 67 |
$NANOBSD_SIZE = nanobsd_get_size(); |
68 | 68 |
|
69 |
if($_POST['bootslice']) { |
|
70 |
$statusmsg = gettext("Setting slice information, please wait...");
|
|
69 |
if ($_POST['bootslice']) {
|
|
70 |
$statusmsg = gettext("Setting slice information, please wait..."); |
|
71 | 71 |
echo <<<EOF |
72 |
<div id="loading">
|
|
73 |
<img src="/themes/{$g['theme']}/images/misc/loader.gif">
|
|
72 |
<div id="loading"> |
|
73 |
<img src="/themes/{$g['theme']}/images/misc/loader.gif"> |
|
74 | 74 |
$statusmsg |
75 | 75 |
<p/> |
76 | 76 |
</div> |
... | ... | |
82 | 82 |
|
83 | 83 |
} |
84 | 84 |
|
85 |
if($_POST['destslice']) { |
|
85 |
if ($_POST['destslice']) {
|
|
86 | 86 |
$statusmsg = gettext("Duplicating slice. Please wait, this will take a moment..."); |
87 |
echo <<<EOF |
|
88 |
<div id="loading">
|
|
87 |
echo <<<EOF
|
|
88 |
<div id="loading"> |
|
89 | 89 |
<img src="/themes/{$g['theme']}/images/misc/loader.gif"> |
90 | 90 |
$statusmsg |
91 | 91 |
<p/> |
92 | 92 |
</div> |
93 | 93 |
EOF; |
94 |
if(nanobsd_clone_slice($_POST['destslice'])) { |
|
94 |
if (nanobsd_clone_slice($_POST['destslice'])) {
|
|
95 | 95 |
$savemsg = gettext("The slice has been duplicated.") . "<p/>" . gettext("If you would like to boot from this newly duplicated slice please set it using the bootup information area."); |
96 | 96 |
} else { |
97 | 97 |
$savemsg = gettext("There was an error while duplicating the slice. Operation aborted."); |
... | ... | |
110 | 110 |
|
111 | 111 |
if ($_POST['setrw']) { |
112 | 112 |
conf_mount_rw(); |
113 |
if (isset($_POST['nanobsd_force_rw'])) |
|
113 |
if (isset($_POST['nanobsd_force_rw'])) {
|
|
114 | 114 |
$config['system']['nanobsd_force_rw'] = true; |
115 |
else
|
|
115 |
} else {
|
|
116 | 116 |
unset($config['system']['nanobsd_force_rw']); |
117 |
} |
|
117 | 118 |
|
118 | 119 |
write_config("Changed Permanent Read/Write Setting"); |
119 | 120 |
conf_mount_ro(); |
120 | 121 |
} |
121 | 122 |
|
122 |
if ($savemsg) |
|
123 |
print_info_box($savemsg) |
|
123 |
if ($savemsg) { |
|
124 |
print_info_box($savemsg); |
|
125 |
} |
|
124 | 126 |
|
125 | 127 |
?> |
126 | 128 |
<table width="100%" border="0" cellpadding="0" cellspacing="0"> |
... | ... | |
144 | 146 |
<tr> |
145 | 147 |
<td colspan="2" valign="top" class="listtopic"><?=gettext("Bootup information");?></td> |
146 | 148 |
</tr> |
147 |
<tr>
|
|
149 |
<tr> |
|
148 | 150 |
<td width="22%" valign="top" class="vncell"><?=gettext("NanoBSD Image size");?></td> |
149 | 151 |
<td width="78%" class="vtable"> |
150 | 152 |
<?php echo $NANOBSD_SIZE; ?> |
... | ... | |
163 | 165 |
</tr> |
164 | 166 |
<tr> |
165 | 167 |
<td colspan="2" valign="top" class=""> </td> |
166 |
</tr>
|
|
168 |
</tr> |
|
167 | 169 |
<tr> |
168 | 170 |
<td colspan="2" valign="top" class="listtopic"><?=gettext("Media Read/Write Status");?></td> |
169 | 171 |
</tr> |
... | ... | |
180 | 182 |
$refdisplay = " (reference count " . $refcount . ")"; |
181 | 183 |
} |
182 | 184 |
echo gettext("Read/Write") . $refdisplay; |
183 |
if (!isset($config['system']['nanobsd_force_rw'])) |
|
185 |
if (!isset($config['system']['nanobsd_force_rw'])) {
|
|
184 | 186 |
echo "<br /><input type='submit' name='changero' value='" . gettext("Switch to Read-Only") . "'>"; |
187 |
} |
|
185 | 188 |
} else { |
186 | 189 |
echo gettext("Read-Only"); |
187 |
if (!isset($config['system']['nanobsd_force_rw'])) |
|
190 |
if (!isset($config['system']['nanobsd_force_rw'])) {
|
|
188 | 191 |
echo "<br /><input type='submit' name='changero' value='" . gettext("Switch to Read/Write") . "'>"; |
192 |
} |
|
189 | 193 |
} ?> |
190 | 194 |
</form> |
191 | 195 |
<br /><?php echo gettext("NOTE: This setting is only temporary, and can be switched dynamically in the background."); ?> |
... | ... | |
234 | 238 |
<?=gettext("These options have been relocated to");?> <a href="system_advanced_misc.php"><?=gettext("System > Advanced, Miscellaneous tab")?></a>. |
235 | 239 |
</td> |
236 | 240 |
</tr> |
237 |
<?php if(file_exists("/conf/upgrade_log.txt")): ?> |
|
241 |
<?php if (file_exists("/conf/upgrade_log.txt")): ?>
|
|
238 | 242 |
<tr> |
239 | 243 |
<td colspan="2" valign="top" class=""> </td> |
240 |
</tr>
|
|
244 |
</tr> |
|
241 | 245 |
<tr> |
242 | 246 |
<td colspan="2" valign="top" class="listtopic"><?=gettext("View upgrade log");?></td> |
243 | 247 |
</tr> |
... | ... | |
265 | 269 |
<?php endif; ?> |
266 | 270 |
<tr> |
267 | 271 |
<td colspan="2" valign="top" class=""> </td> |
268 |
</tr>
|
|
272 |
</tr> |
|
269 | 273 |
</table> |
270 | 274 |
</div> |
271 | 275 |
</td> |
... | ... | |
280 | 284 |
// Clear the loading indicator |
281 | 285 |
echo "<script type=\"text/javascript\">"; |
282 | 286 |
echo "jQuery('#loading').html('');"; |
283 |
echo "</script>";
|
|
287 |
echo "</script>"; |
|
284 | 288 |
|
285 | 289 |
?> |
Also available in: Unified diff
Code style usr-local-www diag