Commit 7fe5a8cf authored by Franco Fichtner's avatar Franco Fichtner

system: brush up last bits of config history

parent 4297e7c7
...@@ -225,42 +225,40 @@ $( document ).ready(function() { ...@@ -225,42 +225,40 @@ $( document ).ready(function() {
</div> </div>
</form> </form>
<?php if ($diff): ?> <?php if ($diff): ?>
<section style="margin-bottom:15px;"> <div class="content-box tab-content table-responsive __mb" style="overflow: scroll;">
<div class="content-box"> <table class="table table-striped">
<header class="content-box-head container-fluid"> <tr>
<h3><?=gettext("Configuration diff from");?> <?= date(gettext("n/j/y H:i:s"), $oldtime); ?> <?=gettext("to");?> <?=date(gettext("n/j/y H:i:s"), $newtime); ?></h3> <th colspan="2" valign="top" class="listtopic">
</header> <?= sprintf(
<div class="content-box-main"> gettext('Configuration diff from %s to %s'),
<div class="container-fluid __mb"> date(gettext('n/j/y H:i:s'), $oldtime),
<div class="table-responsive" style="overflow: scroll;"> date(gettext('n/j/y H:i:s'), $newtime)
<table class="table table-condensed table-striped"> ); ?>
</th>
</tr>
<tr>
<td>
<?php <?php
foreach ($diff as $line): foreach ($diff as $line):
switch (substr($line, 0, 1)) { switch (substr($line, 0, 1)) {
case '+': case '+':
$color = '#3bbb33'; $color = '#3bbb33';
break; break;
case '-': case '-':
$color = '#c13928'; $color = '#c13928';
break; break;
case '@': case '@':
$color = '#3bb9c3'; $color = '#3bb9c3';
break; break;
default: default:
$color = '#000000'; $color = '#000000';
} } ?>
?> <span style="color: <?=$color;?>; white-space: pre-wrap; font-family: monospace;"><?=htmlentities($line);?></span><br/>
<tr> <?php endforeach; ?>
<td style="color: <?=$color;?>; white-space: pre-wrap; font-family: monospace;"><?=htmlentities($line);?></td> </td>
</tr> </tr>
<?php </table>
endforeach;?> </div>
</table>
</div>
</div>
</div>
</div>
</section>
<?php endif; ?> <?php endif; ?>
<?php if (count($confvers)): ?> <?php if (count($confvers)): ?>
<form method="get"> <form method="get">
...@@ -269,79 +267,75 @@ $( document ).ready(function() { ...@@ -269,79 +267,75 @@ $( document ).ready(function() {
<header class="content-box-head container-fluid"> <header class="content-box-head container-fluid">
<h3><?=gettext('History');?></h3> <h3><?=gettext('History');?></h3>
</header> </header>
<div class="content-box-main"> <table class="table table-responsive">
<div class="container-fluid __mb"> <tr>
<table class="table table-condensed"> <td>
<tr> <button type="submit" name="diff" class="btn btn-primary pull-left" value="Diff">
<td> <?=gettext('View differences');?>
<button type="submit" name="diff" class="btn btn-primary pull-left" value="Diff"> </button>
<?=gettext('View differences');?> </td>
</button> <td>
</td> <?= gettext("To view the differences between an older configuration and a newer configuration, select the older configuration using the left column of radio options and select the newer configuration in the right column, then press the button."); ?>
<td> </td>
<?= gettext("To view the differences between an older configuration and a newer configuration, select the older configuration using the left column of radio options and select the newer configuration in the right column, then press the button."); ?> </tr>
</td> </table>
</tr> <table class="table table-striped">
</table> <thead>
</div> <tr>
<table class="table table-striped"> <th colspan="2"><?=gettext("Diff");?></th>
<thead> <th><?=gettext("Date");?></th>
<tr> <th><?=gettext("Version");?></th>
<th colspan="2"><?=gettext("Diff");?></th> <th><?=gettext("Size");?></th>
<th><?=gettext("Date");?></th> <th><?=gettext("Configuration Change");?></th>
<th><?=gettext("Version");?></th> <th>&nbsp;</th>
<th><?=gettext("Size");?></th> </tr>
<th><?=gettext("Configuration Change");?></th> </thead>
<th>&nbsp;</th> <tbody>
</tr> <tr>
</thead> <td></td>
<tbody> <td>
<tr> <input type="radio" name="newtime" value="current" <?= !isset($newcheck) || $newcheck == 'current' ? 'checked="checked"' : '' ?>/>
<td></td> </td>
<td> <td> <?=date(gettext("n/j/y H:i:s"), $config['revision']['time']) ?></td>
<input type="radio" name="newtime" value="current" <?= !isset($newcheck) || $newcheck == 'current' ? 'checked="checked"' : '' ?>/> <td> <?=$config['version'] ?></td>
</td> <td> <?=format_bytes(filesize("/conf/config.xml")) ?></td>
<td> <?=date(gettext("n/j/y H:i:s"), $config['revision']['time']) ?></td> <td> <?="{$config['revision']['username']}: {$config['revision']['description']}" ?></td>
<td> <?=$config['version'] ?></td> <td><b><?=gettext("Current");?></b></td>
<td> <?=format_bytes(filesize("/conf/config.xml")) ?></td> </tr>
<td> <?="{$config['revision']['username']}: {$config['revision']['description']}" ?></td>
<td><b><?=gettext("Current");?></b></td>
</tr>
<?php <?php
$last = count($confvers); $last = count($confvers);
$curr = 1; $curr = 1;
foreach($confvers as $version):?> foreach($confvers as $version):?>
<tr> <tr>
<td> <td>
<input type="radio" name="oldtime" value="<?=$version['time'];?>" <?= (!isset($oldcheck) && $curr == 1) || (isset($oldcheck) && $oldcheck == $version['time']) ? 'checked="checked"' : '' ?>/> <input type="radio" name="oldtime" value="<?=$version['time'];?>" <?= (!isset($oldcheck) && $curr == 1) || (isset($oldcheck) && $oldcheck == $version['time']) ? 'checked="checked"' : '' ?>/>
</td> </td>
<td> <td>
<?php if ($curr != $last): ?> <?php if ($curr != $last): ?>
<input type="radio" name="newtime" value="<?=$version['time'];?>" <?= isset($newcheck) && $newcheck == $version['time'] ? 'checked="checked"' : ''?>/> <input type="radio" name="newtime" value="<?=$version['time'];?>" <?= isset($newcheck) && $newcheck == $version['time'] ? 'checked="checked"' : ''?>/>
<?php endif ?> <?php endif ?>
</td> </td>
<td> <?= date(gettext("n/j/y H:i:s"), $version['time']) ?></td> <td> <?= date(gettext("n/j/y H:i:s"), $version['time']) ?></td>
<td> <?= $version['version'] ?></td> <td> <?= $version['version'] ?></td>
<td> <?= format_bytes($version['filesize']) ?></td> <td> <?= format_bytes($version['filesize']) ?></td>
<td> <?= "{$version['username']}: {$version['description']}" ?></td> <td> <?= "{$version['username']}: {$version['description']}" ?></td>
<td> <td>
<a data-id="<?=$version['time'];?>" href="#" class="act_revert btn btn-default btn-xs" data-toggle="tooltip" title="<?=gettext("Revert to this configuration");?>"> <a data-id="<?=$version['time'];?>" href="#" class="act_revert btn btn-default btn-xs" data-toggle="tooltip" title="<?=gettext("Revert to this configuration");?>">
<span class="glyphicon glyphicon-log-in"></span> <span class="glyphicon glyphicon-log-in"></span>
</a>
<a data-id="<?=$version['time'];?>" href="#" class="act_delete btn btn-default btn-xs" data-toggle="tooltip" title="<?=gettext("Remove this backup");?>" >
<span class="fa fa-trash text-muted"></span>
</a>
<a href="diag_confbak.php?getcfg=<?=$version['time'];?>" class="btn btn-default btn-xs" title="<?=gettext("Download this backup");?>">
<span class="glyphicon glyphicon-download"></span>
</a> </a>
</td> <a data-id="<?=$version['time'];?>" href="#" class="act_delete btn btn-default btn-xs" data-toggle="tooltip" title="<?=gettext("Remove this backup");?>" >
</tr> <span class="fa fa-trash text-muted"></span>
</a>
<a href="diag_confbak.php?getcfg=<?=$version['time'];?>" class="btn btn-default btn-xs" title="<?=gettext("Download this backup");?>">
<span class="glyphicon glyphicon-download"></span>
</a>
</td>
</tr>
<?php <?php
$curr++; $curr++;
endforeach;?> endforeach;?>
</tbody> </tbody>
</table> </table>
</div>
</div> </div>
</section> </section>
</form> </form>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment