Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
fixes #574
In this PR, we can use the "Open File" picker to ingest one or more zeek tsv files.
Notes:
You are able to select multiple "files" even across different directories, but you are not able to select "directories" themselves. This is because on windows, a dialog picker must be either a "files" or "directory picker" according to the Electron Docs.
I have added the ability to upload ndjson logs as well. It sends the default json_types_config, but it appears not to be fully working. I will work with Henri to debug the issue, and fix in a following PR.
This only adds the functionality. There is another ticket to update the design of the file picker to make it clear you can upload zeek logs.
Tech details:
I've refactored the logic in the flows/openPacket.js file. I used a "Transaction" data structure which takes an array of "step" objects that look like
{do: Function, undo: Function}
. All the steps must succeed or else they get rolled back. The transaction calls the "do" function in each step. If a step throws an error, the "undo" function on all previous steps is called.The return value of each "do" function becomes the args of the next "do" function, unless the return value is undefined. In that case, the previous args are passed through.
I think it reads much better now.