Fix graphs not filtering properly for type id
This commit is contained in:
parent
deabedacc5
commit
f6be8ecb7b
@ -96,6 +96,17 @@ QHash<int, QByteArray> LogsModelNg::roleNames() const
|
|||||||
return roles;
|
return roles;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void LogsModelNg::classBegin()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void LogsModelNg::componentComplete()
|
||||||
|
{
|
||||||
|
m_ready = true;
|
||||||
|
fetchMore();
|
||||||
|
}
|
||||||
|
|
||||||
bool LogsModelNg::busy() const
|
bool LogsModelNg::busy() const
|
||||||
{
|
{
|
||||||
return m_busy;
|
return m_busy;
|
||||||
@ -359,6 +370,9 @@ void LogsModelNg::fetchMore(const QModelIndex &parent)
|
|||||||
{
|
{
|
||||||
Q_UNUSED(parent)
|
Q_UNUSED(parent)
|
||||||
|
|
||||||
|
if (!m_ready) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (!m_engine) {
|
if (!m_engine) {
|
||||||
qWarning() << "Cannot update. Engine not set";
|
qWarning() << "Cannot update. Engine not set";
|
||||||
return;
|
return;
|
||||||
@ -404,7 +418,7 @@ void LogsModelNg::fetchMore(const QModelIndex &parent)
|
|||||||
params.insert("limit", m_blockSize);
|
params.insert("limit", m_blockSize);
|
||||||
params.insert("offset", m_list.count());
|
params.insert("offset", m_list.count());
|
||||||
|
|
||||||
qDebug() << "Fetching logs from" << m_startTime.toString() << "to" << m_endTime.toString() << "with offset" << m_list.count() << "and limit" << m_blockSize;
|
qDebug() << "Fetching logs:" << qUtf8Printable(QJsonDocument::fromVariant(params).toJson());
|
||||||
|
|
||||||
m_engine->jsonRpcClient()->sendCommand("Logging.GetLogEntries", params, this, "logsReply");
|
m_engine->jsonRpcClient()->sendCommand("Logging.GetLogEntries", params, this, "logsReply");
|
||||||
// qDebug() << "GetLogEntries called";
|
// qDebug() << "GetLogEntries called";
|
||||||
|
|||||||
@ -36,11 +36,12 @@
|
|||||||
#include <QDateTime>
|
#include <QDateTime>
|
||||||
#include <QLineSeries>
|
#include <QLineSeries>
|
||||||
#include <QUuid>
|
#include <QUuid>
|
||||||
|
#include <QQmlParserStatus>
|
||||||
|
|
||||||
class LogEntry;
|
class LogEntry;
|
||||||
class Engine;
|
class Engine;
|
||||||
|
|
||||||
class LogsModelNg : public QAbstractListModel
|
class LogsModelNg : public QAbstractListModel, public QQmlParserStatus
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
Q_PROPERTY(Engine* engine READ engine WRITE setEngine NOTIFY engineChanged)
|
Q_PROPERTY(Engine* engine READ engine WRITE setEngine NOTIFY engineChanged)
|
||||||
@ -77,6 +78,8 @@ public:
|
|||||||
int rowCount(const QModelIndex &parent = QModelIndex()) const override;
|
int rowCount(const QModelIndex &parent = QModelIndex()) const override;
|
||||||
QVariant data(const QModelIndex &index, int role) const override;
|
QVariant data(const QModelIndex &index, int role) const override;
|
||||||
QHash<int, QByteArray> roleNames() const override;
|
QHash<int, QByteArray> roleNames() const override;
|
||||||
|
void classBegin() override;
|
||||||
|
void componentComplete() override;
|
||||||
|
|
||||||
bool busy() const;
|
bool busy() const;
|
||||||
|
|
||||||
@ -143,6 +146,7 @@ private:
|
|||||||
QDateTime m_viewStartTime;
|
QDateTime m_viewStartTime;
|
||||||
QVariant m_minValue;
|
QVariant m_minValue;
|
||||||
QVariant m_maxValue;
|
QVariant m_maxValue;
|
||||||
|
bool m_ready = false;
|
||||||
|
|
||||||
QtCharts::QXYSeries *m_graphSeries = nullptr;
|
QtCharts::QXYSeries *m_graphSeries = nullptr;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user