Skip to content

Add Network Diagram page - visual topology view of Bacula components#12

Open
podheitor wants to merge 1 commit intobacularis:masterfrom
podheitor:feature/network-diagram
Open

Add Network Diagram page - visual topology view of Bacula components#12
podheitor wants to merge 1 commit intobacularis:masterfrom
podheitor:feature/network-diagram

Conversation

@podheitor
Copy link
Copy Markdown

Network Diagram Feature

This PR adds a new Network Diagram page to Bacularis that renders a graphical topology of all Bacula components with real-time status indicators.

Features

  • SVG-based network topology diagram with dark theme
  • Shows Director, PostgreSQL, Clients, Storages, and Pools
  • Color-coded status indicators (🟢 Online, 🟡 Degraded, 🔴 Offline, Unknown)
  • Displays IP addresses and ports for each component
  • Real-time data gathered via bconsole commands
  • Sidebar menu integration with role-based access control

Files Changed

File Change
Web/Pages/NetworkDiagram.php New - PHP page class with data gathering
Web/Pages/NetworkDiagram.page New - Page template with SVG container
Web/JavaScript/network-diagram.js New - Diagram rendering logic
Web/Portlets/MainSideBar.tpl Modified - Added sidebar menu link
Web/endpoints.xml Modified - Registered new endpoint

Testing

  • Tested on Bacularis 6.0.0 with Bacula Community 15.0.3
  • Compatible with all installation methods (RPM/DEB packages, Docker, Composer, manual)
  • Follows PSR-12 coding standards
  • Includes proper AGPLv3 license headers and PHPDoc documentation

Screenshot

SVG-based dark-themed diagram showing Director at center with connected Clients, Storages, PostgreSQL, and Pools, each with status indicators and IP:port labels.


Closes bacularis/bacularis-app#118

- New NetworkDiagram page with SVG-based network topology diagram
- Shows Director, PostgreSQL, Clients, Storages, and Pools
- Color-coded status indicators (green/yellow/red/gray)
- Displays IP addresses and ports for each component
- Data gathered via bconsole commands (status dir/client/storage, list pools)
- Added sidebar menu integration and endpoint registration
- Follows PSR-12 coding standards with proper AGPLv3 license headers
- Compatible with all Bacularis installation methods

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
@ganiuszka
Copy link
Copy Markdown
Member

Hello @podheitor,

Thank you for contributing. I think your network diagram idea is a great idea for a feature like this in Bacularis, and I thank you again for it. Regarding the changes made, there are several important areas that are inconsistent with the Bacularis architecture and many underlying errors. To add the network diagram to Bacularis, the feature needs to be redesigned to fit into Bacularis and the errors fixed. This requires understanding how Bacularis works from the inside.

I'd like to encourage you to familiarize yourself with the PRADO framework. This documentation sheds a lot of light on Bacularis.

https://www.pradoframework.net/demos/quickstart/

The Bacularis documentation will also be helpful, especially the sections describing Bacularis components and their dependencies:

https://bacularis.app/doc/remote/basic.html
https://bacularis.app/getting-started/architecture

You can find documentation for all current API endpoints here:

https://bacularis.app/api

If you have any question or you experience any problem with it, please let us know. We will help you.

Below you will find errors divided into three categories: Base issues, minor issues, and working issues.

Base issues

  • executing Bacula bconsole in the web interface part
  • page code does all server side work (executing, parsing, low-level data ...)
  • missing MySQL and MariaDB support
  • technical description does not match to implementation (PHP executes bconsole commands via shell_exec() using SUDO => no sudo support)
  • using temporary files in non-Bacularis path
  • determining Director address on the web interface by javascript: dir_ip = window.location.hostname || '127.0.0.1';
  • many hardcoded strings in code (binary paths, IP addresses, ports, component names...)

Minor issues

  • Baculum license statement instead of Bacularis statement
  • used custom icons for components (Bacularis uses FontAwesome icons for components)
  • new page for this diagram (I would propose to use existing Graphs page and new Network diagram tab there for this diagram)
  • using console.log() in normal working

Working issues

  • diagram shows online storage and client if bconsole is not available
  • list storage and clients does not work

I encourage you to work on this feature, as it's definitely worth the effort. We wish you good luck with these changes, and we're here for any questions or help.

Best regards,
Marcin Haba (gani)

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.

Feature Request: Network Diagram Page - Visual Topology View of Bacula Components

2 participants