ORE Studio 0.0.4
Loading...
Searching...
No Matches
ComputeDashboardMdiWindow.hpp
1/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2 *
3 * Copyright (C) 2026 Marco Craveiro <marco.craveiro@gmail.com>
4 *
5 * This program is free software; you can redistribute it and/or modify it under
6 * the terms of the GNU General Public License as published by the Free Software
7 * Foundation; either version 3 of the License, or (at your option) any later
8 * version.
9 *
10 * This program is distributed in the hope that it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
13 * details.
14 *
15 * You should have received a copy of the GNU General Public License along with
16 * this program; if not, write to the Free Software Foundation, Inc., 51
17 * Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 *
19 */
20#ifndef ORES_QT_COMPUTE_DASHBOARD_MDI_WINDOW_HPP
21#define ORES_QT_COMPUTE_DASHBOARD_MDI_WINDOW_HPP
22
23#include <QTimer>
24#include <QLabel>
25#include <QWidget>
26#include <QToolBar>
27#include <QGroupBox>
28#include <QGridLayout>
29#include <QVBoxLayout>
30#include "ores.qt/ClientManager.hpp"
31#include "ores.logging/make_logger.hpp"
32
33namespace ores::qt {
34
42class ComputeDashboardMdiWindow final : public QWidget {
43 Q_OBJECT
44
45private:
46 inline static std::string_view logger_name =
47 "ores.qt.compute_dashboard_mdi_window";
48
49 [[nodiscard]] static auto& lg() {
50 using namespace ores::logging;
51 static auto instance = make_logger(logger_name);
52 return instance;
53 }
54
55public:
57 ClientManager* clientManager,
58 QWidget* parent = nullptr);
59 ~ComputeDashboardMdiWindow() override = default;
60
61 QSize sizeHint() const override { return {600, 400}; }
62
63public slots:
64 void refresh();
65
66signals:
67 void statusChanged(const QString& message);
68 void errorOccurred(const QString& error_message);
69
70private slots:
71 void onRefreshToggled(bool checked);
72
73private:
74 void setupUi();
75 void setupToolbar();
76 void loadStats();
77 void updateCountLabel(QLabel* label, int value);
78
79 ClientManager* clientManager_;
80
81 QToolBar* toolbar_;
82 QAction* refreshAction_;
83 QAction* autoRefreshAction_;
84
85 // Grid stats labels (sourced from get_grid_stats_response)
86 QLabel* totalHostsLabel_; // total_hosts
87 QLabel* idleHostsLabel_; // idle_hosts
88 QLabel* totalWorkunitLabel_; // total_workunits
89 QLabel* inProgressLabel_; // results_in_progress
90 QLabel* completedLabel_; // results_done
91 QLabel* successfulLabel_; // outcomes_success (last 24 h)
92
93 // Auto-refresh timer (10 seconds)
94 QTimer* autoRefreshTimer_;
95};
96
97}
98
99#endif
Implements logging infrastructure for ORE Studio.
Definition boost_severity.hpp:28
Qt-based graphical user interface for ORE Studio.
Definition AboutDialog.hpp:29
Manages the lifecycle of the NATS client and login state.
Definition ClientManager.hpp:109
MDI window showing a summary of the compute grid state.
Definition ComputeDashboardMdiWindow.hpp:42