Skip to content

Commit

Permalink
Improving debug log
Browse files Browse the repository at this point in the history
- add a message to show while loading content;
- add CSS to format the loading message;
- fix yellow log color (light theme);

Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
  • Loading branch information
rdwebdesign committed Mar 14, 2022
1 parent 7c94c13 commit 2d6a78d
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 2 deletions.
4 changes: 4 additions & 0 deletions scripts/pi-hole/js/debug.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ function eventsource() {
"message",
function (e) {
ta.append(e.data);
// scroll page to the bottom (to the last received data)
$('html, body').scrollTop($(document).height());
},
false
);
Expand All @@ -49,6 +51,7 @@ function eventsource() {
"error",
function () {
source.close();
$("#output").removeClass("loading");
},
false
);
Expand All @@ -57,5 +60,6 @@ function eventsource() {
$("#debugBtn").on("click", function () {
$("#debugBtn").prop("disabled", true);
$("#upload").prop("disabled", true);
$("#output").addClass("loading");
eventsource();
});
24 changes: 24 additions & 0 deletions style/pi-hole.css
Original file line number Diff line number Diff line change
Expand Up @@ -758,7 +758,31 @@ table.dataTable tbody > tr > .selected {
}

#output {
position: relative;
margin: 5px 0;
min-height: 36px;
padding: 4px 8px;
}

.loading::before {
content: " ";
position: absolute;
padding: 1em;
left: 0;
right: 0;
bottom: 0;
line-height: 1;
background: rgba(35, 60, 85, 0.8);
box-shadow: 0 0 6px -3px rgba(0, 0, 0, 0.5);
}
.loading::after {
content: "\1F553\FE0E Loading...";
position: absolute;
padding: 1em;
left: 0;
right: 0;
bottom: 0;
color: #fff;
line-height: 1;
animation: 2s infinite Pulse steps(20);
}
3 changes: 1 addition & 2 deletions style/themes/default-light.css
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,7 @@
color: #093;
}
.log-yellow {
color: #e90;
font-weight: bold;
color: #f69600;
}
.log-blue {
color: #04d;
Expand Down

0 comments on commit 2d6a78d

Please sign in to comment.