Skip to content

Commit

Permalink
Merge pull request #327 from pi-hole/tweaks
Browse files Browse the repository at this point in the history
Tweaks for the webUI
  • Loading branch information
AzureMarker authored Jan 3, 2017
2 parents c1f997c + 5d0da1a commit 2314970
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions scripts/pi-hole/js/footer.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ function piholeChange(action, duration)
case "enable":
btnStatus = $("#flip-status-enable");
btnStatus.html("<i class='fa fa-spinner'> </i>");
$.getJSON("api.php?enable&token=" + token, (data) => {
$.getJSON("api.php?enable&token=" + token, function(data) {
if(data.status === "enabled") {
btnStatus.html("");
piholeChanged("enabled");
Expand All @@ -51,7 +51,7 @@ function piholeChange(action, duration)
case "disable":
btnStatus = $("#flip-status-disable");
btnStatus.html("<i class='fa fa-spinner'> </i>");
$.getJSON("api.php?disable=" + duration + "&token=" + token, (data) => {
$.getJSON("api.php?disable=" + duration + "&token=" + token, function(data) {
if(data.status === "disabled") {
btnStatus.html("");
piholeChanged("disabled");
Expand Down
18 changes: 9 additions & 9 deletions scripts/pi-hole/php/header.php
Original file line number Diff line number Diff line change
Expand Up @@ -293,33 +293,33 @@
?>
<br/>
<?php
echo '<a href="#"><i class="fa fa-circle" style="color:';
echo "<a href=\"#\"><i class=\"fa fa-circle\" style=\"color:";
if ($loaddata[0] > $nproc) {
echo '#FF0000';
echo "#FF0000";
}
else
{
echo '#7FFF00';
echo "#7FFF00";
}
echo '""></i> Load:&nbsp;&nbsp;' . $loaddata[0] . '&nbsp;&nbsp;' . $loaddata[1] . '&nbsp;&nbsp;'. $loaddata[2] . '</a>';
echo "\"></i> Load:&nbsp;&nbsp;" . $loaddata[0] . "&nbsp;&nbsp;" . $loaddata[1] . "&nbsp;&nbsp;". $loaddata[2] . "</a>";
?>
<br/>
<?php
echo '<a href="#"><i class="fa fa-circle" style="color:';
echo "<a href=\"#\"><i class=\"fa fa-circle\" style=\"color:";
if ($memory_usage > 0.75 || $memory_usage < 0.0) {
echo '#FF0000';
echo "#FF0000";
}
else
{
echo '#7FFF00';
echo "#7FFF00";
}
if($memory_usage > 0.0)
{
echo '""></i> Memory usage:&nbsp;&nbsp;' . sprintf("%.1f",100.0*$memory_usage) . '%</a>';
echo "\"></i> Memory usage:&nbsp;&nbsp;" . sprintf("%.1f",100.0*$memory_usage) . "%</a>";
}
else
{
echo '""></i> Memory usage:&nbsp;&nbsp; N/A</a>';
echo "\"></i> Memory usage:&nbsp;&nbsp; N/A</a>";
}
?>
</div>
Expand Down

0 comments on commit 2314970

Please sign in to comment.