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

Frontend ~ editable text #533

Conversation

andreaj00
Copy link

NOTE, Merge first the pull request: #527

New Feature:

Added the possibility to modify the logs that each MIR node sends by modifying the incoming message. (For now, only the JSON leaves are modifiable. )
All the JSON types have been taken care of:

  • it's important to notice that once a 'null' field is clicked to modify, it will become a 'string type afterward'.
  • For other types, the type will be preserved if the newly modified value is acceptable for that specific type. For example, inserting 'true' into a boolean field will remain a boolean, but using 'tru' will result in it becoming a string field.

Usage Example:

Modifiable incoming log (highlighted by the border line):
image

Once clicked it becomes editable as a string:
image

By clicking 'Replace' the modified version will be saved (and we will receive the next log in the 'Incoming Log' section):
image

If we click simply 'Accept' we will accept the original version of the incoming log (and we will receive the next log in the 'Incoming Log' section):
image
image
image

If we click 'Decline' will just decline and drop the message (even if modified) (and we will receive the next log in the 'Incoming Log' section)

@matejpavlovic
Copy link
Contributor

Finally almost ready to merge this @andreaj00 ! :-)
It just needs to be rebased on top of the visualization branch. There are some conflicts that can probably be trivially resolved (by you, not by me, even though I tried to have a look at it myself).
I'll merge it as soon as the conflicts are resolved.

@matejpavlovic matejpavlovic merged commit fab12b4 into consensus-shipyard:visualization Feb 16, 2024
3 checks passed
komplexon3 pushed a commit to komplexon3/mir that referenced this pull request Mar 29, 2024
Generalize and simplify the interceptor

Generalize:
The interceptor can now interfere with the intercepted events.
Instead of returning just an error value, it now also returns an `EventList`.
It is those returned events (instead of the input events)
that Mir uses for delivering to its modules.

Simplify:
The `EventRecord`s have been overused in parts of the code where they did not necessarily belong.
They are now replaced by simple `EventList`s wherever appropriate.

Signed-off-by: Matej Pavlovic <matopavlovic@gmail.com>
Co-authored-by: Schmit Catherine <catherine@Schmits-MBP.lan>
Co-authored-by: Matej Pavlovic <matopavlovic@gmail.com>

Add run.sh to pingpong for convenience

Signed-off-by: Matej Pavlovic <matopavlovic@gmail.com>

Implement WebSocket debugger (consensus-shipyard#528)

Signed-off-by: Matej Pavlovic <matopavlovic@gmail.com>
Co-authored-by: Schmit Catherine <catherine@Schmits-MBP.lan>
Co-authored-by: Matej Pavlovic <matopavlovic@gmail.com>

Add Mir debugger frontend (consensus-shipyard#527)

Create frontend to connect to MIR nodes to accept or decline new log messages

Co-authored-by: Andrea Jiang <jianga@ethz.ch>

Event modification through frontend (consensus-shipyard#541)

* added the replace event functionality for the debugger in the backend,
using protojson.Marshal instead of json.Marshal
* Satisfy linter
* Do not re-generate timestamp in debugger
* Update the frontend deparser to support the protojson parsing

Signed-off-by: Matej Pavlovic <matopavlovic@gmail.com>
Co-authored-by: Matej Pavlovic <matopavlovic@gmail.com>
Co-authored-by: Andrea Jiang <jianga@ethz.ch>
Co-authored-by: Schmit Catherine <catherine@Schmits-MBP.lan>

Modify event data using the debugger (consensus-shipyard#533)

Added the possibility to modify the logs
that each MIR node sends by
modifying the incoming message.
(For now, only the JSON leaves are modifiable. )
All the JSON types have been taken care of:

it's important to notice that once
a 'null' field is clicked to modify,
it will become a 'string type afterward'.
For other types, the type will be preserved
if the newly modified value is acceptable for that specific type.
For example, inserting 'true' into a boolean field
will remain a boolean, but using 'tru' will result
in it becoming a string field.

Co-authored-by: Andrea Jiang <jianga@ethz.ch>

Disconnecting the debugger (consensus-shipyard#534)

* Added 'close connection' button to close the connection to the specific websocket
* Decline any current Log when clicking the 'close connection' button

Co-authored-by: Andrea Jiang <jianga@ethz.ch>

Async debug mode (consensus-shipyard#535)

Add the possibility to automatically accept
the incoming logs from the MIR node.

Co-authored-by: Andrea Jiang <jianga@ethz.ch>

Describe debugger events (consensus-shipyard#542)

Co-authored-by: Andrea Jiang <jianga@ethz.ch>

Latest debugger event on top (consensus-shipyard#543)

Co-authored-by: Andrea Jiang <jianga@ethz.ch>

Update debugger log message (consensus-shipyard#544)

Co-authored-by: Andrea Jiang <jianga@ethz.ch>

restructure original visualization code
komplexon3 pushed a commit to komplexon3/mir that referenced this pull request Apr 1, 2024
Generalize and simplify the interceptor

Generalize:
The interceptor can now interfere with the intercepted events.
Instead of returning just an error value, it now also returns an `EventList`.
It is those returned events (instead of the input events)
that Mir uses for delivering to its modules.

Simplify:
The `EventRecord`s have been overused in parts of the code where they did not necessarily belong.
They are now replaced by simple `EventList`s wherever appropriate.

Signed-off-by: Matej Pavlovic <matopavlovic@gmail.com>
Co-authored-by: Schmit Catherine <catherine@Schmits-MBP.lan>
Co-authored-by: Matej Pavlovic <matopavlovic@gmail.com>

Add run.sh to pingpong for convenience

Signed-off-by: Matej Pavlovic <matopavlovic@gmail.com>

Implement WebSocket debugger (consensus-shipyard#528)

Signed-off-by: Matej Pavlovic <matopavlovic@gmail.com>
Co-authored-by: Schmit Catherine <catherine@Schmits-MBP.lan>
Co-authored-by: Matej Pavlovic <matopavlovic@gmail.com>

Add Mir debugger frontend (consensus-shipyard#527)

Create frontend to connect to MIR nodes to accept or decline new log messages

Co-authored-by: Andrea Jiang <jianga@ethz.ch>

Event modification through frontend (consensus-shipyard#541)

* added the replace event functionality for the debugger in the backend,
using protojson.Marshal instead of json.Marshal
* Satisfy linter
* Do not re-generate timestamp in debugger
* Update the frontend deparser to support the protojson parsing

Signed-off-by: Matej Pavlovic <matopavlovic@gmail.com>
Co-authored-by: Matej Pavlovic <matopavlovic@gmail.com>
Co-authored-by: Andrea Jiang <jianga@ethz.ch>
Co-authored-by: Schmit Catherine <catherine@Schmits-MBP.lan>

Modify event data using the debugger (consensus-shipyard#533)

Added the possibility to modify the logs
that each MIR node sends by
modifying the incoming message.
(For now, only the JSON leaves are modifiable. )
All the JSON types have been taken care of:

it's important to notice that once
a 'null' field is clicked to modify,
it will become a 'string type afterward'.
For other types, the type will be preserved
if the newly modified value is acceptable for that specific type.
For example, inserting 'true' into a boolean field
will remain a boolean, but using 'tru' will result
in it becoming a string field.

Co-authored-by: Andrea Jiang <jianga@ethz.ch>

Disconnecting the debugger (consensus-shipyard#534)

* Added 'close connection' button to close the connection to the specific websocket
* Decline any current Log when clicking the 'close connection' button

Co-authored-by: Andrea Jiang <jianga@ethz.ch>

Async debug mode (consensus-shipyard#535)

Add the possibility to automatically accept
the incoming logs from the MIR node.

Co-authored-by: Andrea Jiang <jianga@ethz.ch>

Describe debugger events (consensus-shipyard#542)

Co-authored-by: Andrea Jiang <jianga@ethz.ch>

Latest debugger event on top (consensus-shipyard#543)

Co-authored-by: Andrea Jiang <jianga@ethz.ch>

Update debugger log message (consensus-shipyard#544)

Co-authored-by: Andrea Jiang <jianga@ethz.ch>

restructure original visualization code
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.

None yet

2 participants