Cybersecurity-Projects/PROJECTS/beginner/network-traffic-analyzer/cpp/include/TUI/view.hpp

41 lines
962 B
C++

#ifndef VIEW_HPP
#define VIEW_HPP
#include "../stats/protocolStats.hpp"
#include <ftxui/dom/elements.hpp>
class View {
public:
ftxui::Element render(
const StatsSnapshot& data,
const std::string& interface,
const std::string& filter,
bool capture_finished,
std::chrono::seconds timer
);
private:
ftxui::Element render_header(
const StatsSnapshot& data,
const std::string& interface,
const std::string& filter
);
ftxui::Element render_stats(const StatsSnapshot& data);
ftxui::Element render_transport(const StatsSnapshot& data);
ftxui::Element render_application(const StatsSnapshot& data);
ftxui::Element render_ip(const StatsSnapshot& data);
ftxui::Element render_pairs(const StatsSnapshot& data);
ftxui::Element render_bandwidth(const StatsSnapshot& data);
ftxui::Element render_packets(const StatsSnapshot& data);
ftxui::Element render_footer(
bool capture_finished,
std::chrono::seconds timer
);
};
#endif //VIEW_HPP