ORE Studio 0.0.4
Loading...
Searching...
No Matches
SchedulerMonitorMdiWindow.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_SCHEDULER_MONITOR_MDI_WINDOW_HPP
21#define ORES_QT_SCHEDULER_MONITOR_MDI_WINDOW_HPP
22
23#include <vector>
24#include <QTimer>
25#include <QWidget>
26#include <QAction>
27#include <QSpinBox>
28#include <QToolBar>
29#include <QTableWidget>
30#include <QVBoxLayout>
31#include <QCloseEvent>
32#include "ores.qt/ClientManager.hpp"
33#include "ores.logging/make_logger.hpp"
34#include "ores.scheduler.api/messaging/scheduler_protocol.hpp"
35
36namespace ores::qt {
37
44class SchedulerMonitorMdiWindow final : public QWidget {
45 Q_OBJECT
46
47private:
48 inline static std::string_view logger_name =
49 "ores.qt.scheduler_monitor_mdi_window";
50
51 [[nodiscard]] static auto& lg() {
52 using namespace ores::logging;
53 static auto instance = make_logger(logger_name);
54 return instance;
55 }
56
57public:
59 ClientManager* clientManager,
60 QWidget* parent = nullptr);
61 ~SchedulerMonitorMdiWindow() override = default;
62
63 QSize sizeHint() const override { return {860, 500}; }
64
65signals:
66 void statusChanged(const QString& message);
67 void errorOccurred(const QString& error);
68
69public slots:
70 void refresh();
71
72private slots:
73 void onAutoRefreshToggled(bool enabled);
74 void onAutoRefreshIntervalChanged(int seconds);
75
76private:
77 void setupUi();
78 void applyStatus(const std::vector<scheduler::messaging::job_schedule_status>& jobs);
79
80 enum Col {
81 ColJobName = 0,
82 ColSchedule = 1,
83 ColActive = 2,
84 ColLastRun = 3,
85 ColLastStatus= 4,
86 ColNextFire = 5,
87 ColRunning = 6,
88 ColCount = 7
89 };
90
91 ClientManager* clientManager_;
92
93 QToolBar* toolbar_;
94 QAction* refreshAction_;
95 QAction* autoRefreshAction_;
96 QSpinBox* intervalSpin_;
97 QTableWidget* table_;
98 QTimer* autoRefreshTimer_;
99};
100
101}
102
103#endif
Implements logging infrastructure for ORE Studio.
Definition boost_severity.hpp:28
Qt-based graphical user interface for ORE Studio.
Definition AccountController.hpp:32
Manages the lifecycle of the NATS client and login state.
Definition ClientManager.hpp:123
Singleton MDI window showing a live per-job scheduler status.
Definition SchedulerMonitorMdiWindow.hpp:44