20#ifndef ORES_QT_CLIENT_APP_MODEL_HPP
21#define ORES_QT_CLIENT_APP_MODEL_HPP
24#include <QFutureWatcher>
25#include <QAbstractTableModel>
26#include "ores.qt/AbstractClientModel.hpp"
27#include "ores.qt/ClientManager.hpp"
28#include "ores.qt/RecencyPulseManager.hpp"
29#include "ores.qt/RecencyTracker.hpp"
30#include "ores.logging/make_logger.hpp"
31#include "ores.compute.api/domain/app.hpp"
45 inline static std::string_view logger_name =
46 "ores.qt.client_app_model";
48 [[nodiscard]]
static auto& lg() {
50 static auto instance = make_logger(logger_name);
67 QObject* parent =
nullptr);
71 int rowCount(
const QModelIndex& parent = QModelIndex())
const override;
72 int columnCount(
const QModelIndex& parent = QModelIndex())
const override;
73 QVariant data(
const QModelIndex& index,
int role = Qt::DisplayRole)
const override;
74 QVariant headerData(
int section, Qt::Orientation orientation,
75 int role = Qt::DisplayRole)
const override;
93 void load_page(std::uint32_t offset, std::uint32_t limit);
98 std::uint32_t
page_size()
const {
return page_size_; }
121 void onPulseStateChanged(
bool isOn);
122 void onPulsingComplete();
125 QVariant recency_foreground_color(
const std::string& code)
const;
129 std::vector<compute::domain::app> apps;
130 std::uint32_t total_available_count;
131 QString error_message;
132 QString error_details;
135 void fetch_apps(std::uint32_t offset, std::uint32_t limit);
137 ClientManager* clientManager_;
138 std::vector<compute::domain::app> apps_;
139 QFutureWatcher<FetchResult>* watcher_;
140 std::uint32_t page_size_{100};
141 std::uint32_t total_available_count_{0};
142 bool is_fetching_{
false};
145 RecencyTracker<compute::domain::app, AppKeyExtractor> recencyTracker_;
146 RecencyPulseManager* pulseManager_;
Implements logging infrastructure for ORE Studio.
Definition boost_severity.hpp:28
Qt-based graphical user interface for ORE Studio.
Definition AboutDialog.hpp:29
A registered application engine in the compute grid.
Definition app.hpp:34
Base class for all client-side entity models.
Definition AbstractClientModel.hpp:36
Model for displaying compute apps fetched from the server.
Definition ClientAppModel.hpp:41
void set_page_size(std::uint32_t size)
Set the page size for pagination.
Definition ClientAppModel.cpp:253
const compute::domain::app * getApp(int row) const
Get compute app at the specified row.
Definition ClientAppModel.cpp:265
void refresh()
Refresh compute app data from server asynchronously.
Definition ClientAppModel.cpp:120
std::uint32_t total_available_count() const
Get the total number of records available on the server.
Definition ClientAppModel.hpp:108
void load_page(std::uint32_t offset, std::uint32_t limit)
Load a specific page of data.
Definition ClientAppModel.cpp:146
std::uint32_t page_size() const
Get the page size used for pagination.
Definition ClientAppModel.hpp:98
Column
Enumeration of table columns for type-safe column access.
Definition ClientAppModel.hpp:58
Manages the lifecycle of the NATS client and login state.
Definition ClientManager.hpp:109