Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Several minor tweaks for the Settings page #317

Merged
merged 6 commits into from
Jan 2, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions scripts/pi-hole/js/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ $(".confirm-flushlogs").confirm({

$("#DHCPchk").click(function() {
$("input.DHCPgroup").prop("disabled", !this.checked);
$("#dhcpnotice").prop("hidden", !this.checked).addClass("lookatme");
});

var leasetable;
Expand Down
45 changes: 36 additions & 9 deletions settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,16 @@
max-width: none;
white-space: nowrap;
}
@-webkit-keyframes Pulse{
from {color:#630030;-webkit-text-shadow:0 0 9px #333;}
50% {color:#e33100;-webkit-text-shadow:0 0 18px #e33100;}
to {color:#630030;-webkit-text-shadow:0 0 9px #333;}
}
p.lookatme {
-webkit-animation-name: Pulse;
-webkit-animation-duration: 2s;
-webkit-animation-iteration-count: infinite;
}
</style>

<?php if(isset($debug)){ ?>
Expand Down Expand Up @@ -81,6 +91,7 @@
<div class="input-group-addon"><i class="fa fa-plug"></i></div>
<input type="text" class="form-control" disabled value="<?php echo $piHoleIPv6; ?>">
</div>
<?php if (!defined('AF_INET6')){ ?><p style="color: #F00;">Warning: PHP has been compiled without IPv6 support.</p><?php } ?>
</div>
<div class="form-group">
<label>Pi-Hole hostname</label>
Expand All @@ -107,10 +118,18 @@
$DHCPstart = $setupVars["DHCP_START"];
$DHCPend = $setupVars["DHCP_END"];
$DHCProuter = $setupVars["DHCP_ROUTER"];
$DHCPleasetime = $setupVars["DHCP_LEASETIME"];
if(strlen($DHCPleasetime) < 1)
// This setting has been added later, we have to check if it exists
if(isset($setupVars["DHCP_LEASETIME"]))
{
$DHCPleasetime = $setupVars["DHCP_LEASETIME"];
if(strlen($DHCPleasetime) < 1)
{
// Fallback if empty string
$DHCPleasetime = 24;
}
}
else
{
// Fallback if it was not set before
$DHCPleasetime = 24;
}
}
Expand Down Expand Up @@ -143,8 +162,13 @@
</div>
<div class="box-body">
<form role="form" method="post">
<div class="form-group">
<div class="checkbox"><label><input type="checkbox" name="active" <?php if($DHCP){ ?>checked<?php } ?> id="DHCPchk"> DHCP server enabled</label></div>
<div class="col-md-6">
<div class="form-group">
<div class="checkbox"><label><input type="checkbox" name="active" <?php if($DHCP){ ?>checked<?php } ?> id="DHCPchk"> DHCP server enabled</label></div>
</div>
</div>
<div class="col-md-6">
<p id="dhcpnotice" <?php if(!$DHCP){ ?>hidden<?php } ?>>Make sure your router's DHCP server is disabled when using the Pi-hole DHCP server!</p>
</div>
<div class="col-md-12">
<label>Range of IP addresses to hand out</label>
Expand Down Expand Up @@ -403,10 +427,10 @@ function convertseconds($argument) {
<div class="box-body">
<div class="col-lg-12">
<div class="form-group">
<div class="checkbox"><label><input type="checkbox" name="DNSrequiresFQDN" <?php if($DNSrequiresFQDN){ ?>checked<?php } ?>> never forward non-FQDNs</label></div>
<div class="checkbox"><label><input type="checkbox" name="DNSrequiresFQDN" <?php if($DNSrequiresFQDN){ ?>checked<?php } ?> title="domain-needed"> never forward non-FQDNs</label></div>
</div>
<div class="form-group">
<div class="checkbox"><label><input type="checkbox" name="DNSbogusPriv" <?php if($DNSbogusPriv){ ?>checked<?php } ?>> never forward reverse lookups for private IP ranges</label></div>
<div class="checkbox"><label><input type="checkbox" name="DNSbogusPriv" <?php if($DNSbogusPriv){ ?>checked<?php } ?> title="bogus-priv"> never forward reverse lookups for private IP ranges</label></div>
</div>
<p>Note that enabling these two options may increase your privacy slightly, but may also prevent you from being able to access local hostnames if the Pi-Hole is not used as DHCP server</p>
</div>
Expand Down Expand Up @@ -455,6 +479,7 @@ function convertseconds($argument) {
</div>
<div class="box-footer">
<form role="form" method="post">
<button type="button" class="btn btn-default confirm-flushlogs">Flush logs</button>
<input type="hidden" name="field" value="Logging">
<?php if($piHoleLogging) { ?>
<input type="hidden" name="action" value="Disable">
Expand Down Expand Up @@ -562,8 +587,10 @@ function convertseconds($argument) {
</div>
</div>
<h4>Privacy mode</h4>
<div class="form-group">
<div class="checkbox"><label><input type="checkbox" name="privacyMode" <?php if($privacyMode){ ?>checked<?php } ?>> Don't show query results for permitted requests</label></div>
<div class="col-lg-12">
<div class="form-group">
<div class="checkbox"><label><input type="checkbox" name="privacyMode" <?php if($privacyMode){ ?>checked<?php } ?>> Don't show query results for permitted requests</label></div>
</div>
</div>
</div>
<div class="box-footer">
Expand Down