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

Support for ANSI color code #27

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

Conversation

Pixelbo
Copy link

@Pixelbo Pixelbo commented Dec 9, 2023

Hey, je suis français mais puisque tout ce github parle anglais, i'm going to speak the king's.

First of all, I don't have a great knowledge in Vue.js at all, I've made this modification for my robotics team at INSA Rennes. (all help is appreciated 👈(゚ヮ゚👈) )

I've added support to ANSI color coding (at least tried) to log messages, charts title and single values (text).

Tests

I made small modification of ansi_up code which convert ANSI coloring into HTML div with style (foreground et background text).

In DataSeries.js and Telemetry.js, I added a colored_name member which contain the HTML colored text, the name member still have the ANSI code with the text in it.

Because ANSI code have semi-colons in it, I've had to modify serverMessageReading.js to allow semi-colons in the text if and only if the telemetry is a text.

Vue.js double mustache {{serie.name}} parse the variable inside of it as text but we have the text inside a div, so I used v-html to counter this restriction (see vue docs).

I know there can still be some problems somewhere, I look forward to fix them!

@Pixelbo Pixelbo marked this pull request as ready for review December 16, 2023 23:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant