Skip to content

dashboard: Replace Dash dashboard with a Flask one, add tree explorer

Franck Bret requested to merge franckbret/swh-scanner:flask-dashboard into master

The previous dashboard was using Dash with Pandas dataframe and solely consists of rendering a sunburst chart of known files. It wasn't really useful especially with big source tree. What is at least needed is the ability to browse the results with a file browser like pattern. We also want to have a simpler and more maintainable stack with less dependencies.

Here is a first attempt using a simple Flask app using Jinja templates, vanilla css, vanilla js.

It renders two routes for now:

  • Dashboard (index): A summary of the results displayed as cards
  • Results: File browser like result's explorer. It shows a tree of directories and files, indicate for each a known percentage (pie plot). On click it display details such as swhid and path. Clicking on swhid bring to the corresponding swhid on the archive, clicking on the name copy the full path to clipboard.

Beautifulsoup has been added to requirements-test so we can test some parts of the dom rendering. For now the plots, dash, pandas dataframe things are kept as long as we keep 'sunburst' as an option of cli scan output-format.

Some screenshots:

Capture_d_écran_de_2024-03-27_09-52-34


Capture_d_écran_de_2024-03-27_09-52-44


Capture_d_écran_de_2024-03-27_09-53-10


Capture_d_écran_de_2024-03-27_09-53-42


Capture_d_écran_de_2024-03-27_09-53-53


Merge request reports