summaryrefslogtreecommitdiffstats
path: root/usr/local/www/diag_confbak.php
diff options
context:
space:
mode:
authorjim-p <jim@pingle.org>2010-03-17 21:00:33 -0400
committerjim-p <jim@pingle.org>2010-03-17 21:01:31 -0400
commitdb67053af0da5e1ceebc60a3d5435a53bcec353f (patch)
treecf3ea4091e8a08a24b346f885e3b7da30f6c4282 /usr/local/www/diag_confbak.php
parent40a721c0b8ca331fdb67dd496f2f878577d40a19 (diff)
downloadpfsense-db67053af0da5e1ceebc60a3d5435a53bcec353f.zip
pfsense-db67053af0da5e1ceebc60a3d5435a53bcec353f.tar.gz
Colorize config diff, fix wrapping (should still copy/paste as a single line). Add diff button at the top which doubles as a column header.
Diffstat (limited to 'usr/local/www/diag_confbak.php')
-rwxr-xr-xusr/local/www/diag_confbak.php25
1 files changed, 20 insertions, 5 deletions
diff --git a/usr/local/www/diag_confbak.php b/usr/local/www/diag_confbak.php
index e164194..5d0458b 100755
--- a/usr/local/www/diag_confbak.php
+++ b/usr/local/www/diag_confbak.php
@@ -106,14 +106,29 @@ include("head.inc");
print_info_box($savemsg);
?>
<? if ($diff) { ?>
- <table align="center" width="100%" border="0" cellpadding="6" cellspacing="0">
+ <table align="center" valign="middle" width="100%" border="0" cellspacing="0" style="padding-top: 4px; padding-bottom: 4px;">
<tr><td>Configuration diff from <?php echo date("n/j/y H:i:s", $oldtime); ?> to <?php echo date("n/j/y H:i:s", $newtime); ?></td></tr>
+ <?php foreach ($diff as $line) {
+ switch (substr($line, 0, 1)) {
+ case "+":
+ $color = "#caffd3";
+ break;
+ case "-":
+ $color = "#ffe8e8";
+ break;
+ case "@":
+ $color = "#a0a0a0";
+ break;
+ default:
+ $color = "";
+ }
+ ?>
<tr>
- <td>
- <pre><?php echo htmlentities(implode($diff, "\n"));?></pre>
- </td>
+ <td valign="middle" bgcolor="<?php echo $color; ?>" style="white-space: pre-wrap;"><?php echo htmlentities($line);?></td>
</tr>
+ <?php } ?>
</table>
+ <br />
<? } ?>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
@@ -133,7 +148,7 @@ include("head.inc");
<table class="tabcont" align="center" width="100%" border="0" cellpadding="6" cellspacing="0">
<?php if (is_array($confvers)): ?>
<tr>
- <td colspan="2" valign="middle" align="center" class="list" nowrap><b>Diff</b></td>
+ <td colspan="2" valign="middle" align="center" class="list" nowrap><input type="submit" name="diff" value="Diff"></td>
<td width="30%" class="listhdrr">Date</td>
<td width="70%" class="listhdrr">Configuration Change</td>
</tr>
OpenPOWER on IntegriCloud