20#ifndef ORES_QT_CLIENT_APP_VERSION_MODEL_HPP
21#define ORES_QT_CLIENT_APP_VERSION_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_version.hpp"
45 inline static std::string_view logger_name =
46 "ores.qt.client_app_version_model";
48 [[nodiscard]]
static auto& lg() {
50 static auto instance = make_logger(logger_name);
71 QObject* parent =
nullptr);
75 int rowCount(
const QModelIndex& parent = QModelIndex())
const override;
76 int columnCount(
const QModelIndex& parent = QModelIndex())
const override;
77 QVariant data(
const QModelIndex& index,
int role = Qt::DisplayRole)
const override;
78 QVariant headerData(
int section, Qt::Orientation orientation,
79 int role = Qt::DisplayRole)
const override;
97 void load_page(std::uint32_t offset, std::uint32_t limit);
124 void onVersionsLoaded();
125 void onPulseStateChanged(
bool isOn);
126 void onPulsingComplete();
129 QVariant recency_foreground_color(
const std::string& code)
const;
133 std::vector<compute::domain::app_version> app_versions;
134 std::uint32_t total_available_count;
135 QString error_message;
136 QString error_details;
139 void fetch_app_versions(std::uint32_t offset, std::uint32_t limit);
141 ClientManager* clientManager_;
142 std::vector<compute::domain::app_version> app_versions_;
143 QFutureWatcher<FetchResult>* watcher_;
144 std::uint32_t page_size_{100};
145 std::uint32_t total_available_count_{0};
146 bool is_fetching_{
false};
149 RecencyTracker<compute::domain::app_version, AppVersionKeyExtractor> recencyTracker_;
150 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 versioned wrapper+engine bundle for a compute grid application.
Definition app_version.hpp:37
Base class for all client-side entity models.
Definition AbstractClientModel.hpp:36
Model for displaying app versions fetched from the server.
Definition ClientAppVersionModel.hpp:41
void set_page_size(std::uint32_t size)
Set the page size for pagination.
Definition ClientAppVersionModel.cpp:275
void refresh()
Refresh app version data from server asynchronously.
Definition ClientAppVersionModel.cpp:142
std::uint32_t total_available_count() const
Get the total number of records available on the server.
Definition ClientAppVersionModel.hpp:112
void load_page(std::uint32_t offset, std::uint32_t limit)
Load a specific page of data.
Definition ClientAppVersionModel.cpp:168
std::uint32_t page_size() const
Get the page size used for pagination.
Definition ClientAppVersionModel.hpp:102
const compute::domain::app_version * getVersion(int row) const
Get app version at the specified row.
Definition ClientAppVersionModel.cpp:287
Column
Enumeration of table columns for type-safe column access.
Definition ClientAppVersionModel.hpp:58
Manages the lifecycle of the NATS client and login state.
Definition ClientManager.hpp:109