-
-
Notifications
You must be signed in to change notification settings - Fork 573
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
Tweak the Update Gravity output #2589
Conversation
Replaces every `\r` returned by `pihole-FTL gravity parseList` with a known string to allow overwriting the previous line. Signed-off-by: RD WebDesign <[email protected]>
Signed-off-by: RD WebDesign <[email protected]>
I tried it and with this PR I can see the progress counting. However I fail to see a single occurrence of Is this expected? |
Yes. The |
Ah I see... it's the code right below. You search for the position in the line string and remove everything you don't want. |
The logic is:
On the console, it uses a carriage return followed by an escape code ( This escape sequence is sent to PHP/javascript. PHP replace it with The text is sent to javascript with |
Thanks. Maybe you could adjust the code comments a bit, because the part replacing |
I didn't remove the The
I will try to rewrite this comment to allow a better understanding. |
Signed-off-by: RD WebDesign <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the explanation. My main issue was that I did not know that \r\e[K
and \r�[K
are the same thing.
Yeah,
|
What does this PR aim to accomplish?
This PR is intended to show the progress of the new parseList function introduced by pi-hole/FTL#1559 and pi-hole/pi-hole#5275.
The new
pihole-FTL gravity parseList
command starts every message (including error messages) with\r
, to allow overwriting lines on the command line output.The problem is: this brakes the web interface output and no output is shown for this command.
Replacing the initial
\r
allows the correct output.How does this PR accomplish the above?
Kepping the original
str_replace
and adding a second one, to replace any remaining\r
with'<------'
.Note:
Use all 3 branches when testing: FTL, core and web.
Link documentation PRs if any are needed to support this PR:
none
By submitting this pull request, I confirm the following:
git rebase
)