Improve action/event log views when there's no data yet
This commit is contained in:
parent
7c50c5b1cd
commit
f33c8f3e6c
@ -648,6 +648,16 @@ int ThingManager::setStateLogging(const QUuid &thingId, const QUuid &stateTypeId
|
|||||||
return m_jsonClient->sendCommand("Integrations.SetStateLogging", {{"thingId", thingId}, {"stateTypeId", stateTypeId}, {"enabled", enabled}}, this, "setStateLoggingResponse");
|
return m_jsonClient->sendCommand("Integrations.SetStateLogging", {{"thingId", thingId}, {"stateTypeId", stateTypeId}, {"enabled", enabled}}, this, "setStateLoggingResponse");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int ThingManager::setActionLogging(const QUuid &thingId, const QUuid &actionTypeId, bool enabled)
|
||||||
|
{
|
||||||
|
return m_jsonClient->sendCommand("Integrations.SetActionLogging", {{"thingId", thingId}, {"actionTypeId", actionTypeId}, {"enabled", enabled}}, this, "setActionLoggingResponse");
|
||||||
|
}
|
||||||
|
|
||||||
|
int ThingManager::setEventLogging(const QUuid &thingId, const QUuid &eventTypeId, bool enabled)
|
||||||
|
{
|
||||||
|
return m_jsonClient->sendCommand("Integrations.SetEventLogging", {{"thingId", thingId}, {"eventTypeId", eventTypeId}, {"enabled", enabled}}, this, "setStateLoggingResponse");
|
||||||
|
}
|
||||||
|
|
||||||
int ThingManager::connectIO(const QUuid &inputThingId, const QUuid &inputStateTypeId, const QUuid &outputThingId, const QUuid &outputStateTypeId, bool inverted)
|
int ThingManager::connectIO(const QUuid &inputThingId, const QUuid &inputStateTypeId, const QUuid &outputThingId, const QUuid &outputStateTypeId, bool inverted)
|
||||||
{
|
{
|
||||||
QVariantMap data;
|
QVariantMap data;
|
||||||
@ -705,6 +715,18 @@ void ThingManager::setStateLoggingResponse(int commandId, const QVariantMap &par
|
|||||||
qCDebug(dcThingManager()) << "Set state logging response" << qUtf8Printable(QJsonDocument::fromVariant(params).toJson());
|
qCDebug(dcThingManager()) << "Set state logging response" << qUtf8Printable(QJsonDocument::fromVariant(params).toJson());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ThingManager::setActionLoggingResponse(int commandId, const QVariantMap ¶ms)
|
||||||
|
{
|
||||||
|
Q_UNUSED(commandId)
|
||||||
|
qCDebug(dcThingManager()) << "Set action logging response" << qUtf8Printable(QJsonDocument::fromVariant(params).toJson());
|
||||||
|
}
|
||||||
|
|
||||||
|
void ThingManager::setEventLoggingResponse(int commandId, const QVariantMap ¶ms)
|
||||||
|
{
|
||||||
|
Q_UNUSED(commandId)
|
||||||
|
qCDebug(dcThingManager()) << "Set event logging response" << qUtf8Printable(QJsonDocument::fromVariant(params).toJson());
|
||||||
|
}
|
||||||
|
|
||||||
Vendor *ThingManager::unpackVendor(const QVariantMap &vendorMap)
|
Vendor *ThingManager::unpackVendor(const QVariantMap &vendorMap)
|
||||||
{
|
{
|
||||||
Vendor *v = new Vendor(vendorMap.value("id").toString(), vendorMap.value("name").toString());
|
Vendor *v = new Vendor(vendorMap.value("id").toString(), vendorMap.value("name").toString());
|
||||||
|
|||||||
@ -99,6 +99,8 @@ public:
|
|||||||
Q_INVOKABLE int executeBrowserItem(const QUuid &thingId, const QString &itemId);
|
Q_INVOKABLE int executeBrowserItem(const QUuid &thingId, const QString &itemId);
|
||||||
Q_INVOKABLE int executeBrowserItemAction(const QUuid &thingId, const QString &itemId, const QUuid &actionTypeId, const QVariantList ¶ms = QVariantList());
|
Q_INVOKABLE int executeBrowserItemAction(const QUuid &thingId, const QString &itemId, const QUuid &actionTypeId, const QVariantList ¶ms = QVariantList());
|
||||||
Q_INVOKABLE int setStateLogging(const QUuid &thingId, const QUuid &stateTypeId, bool enabled);
|
Q_INVOKABLE int setStateLogging(const QUuid &thingId, const QUuid &stateTypeId, bool enabled);
|
||||||
|
Q_INVOKABLE int setActionLogging(const QUuid &thingId, const QUuid &actionTypeId, bool enabled);
|
||||||
|
Q_INVOKABLE int setEventLogging(const QUuid &thingId, const QUuid &eventTypeId, bool enabled);
|
||||||
|
|
||||||
Q_INVOKABLE int connectIO(const QUuid &inputThingId, const QUuid &inputStateTypeId, const QUuid &outputThingId, const QUuid &outputStateTypeId, bool inverted);
|
Q_INVOKABLE int connectIO(const QUuid &inputThingId, const QUuid &inputStateTypeId, const QUuid &outputThingId, const QUuid &outputStateTypeId, bool inverted);
|
||||||
Q_INVOKABLE int disconnectIO(const QUuid &ioConnectionId);
|
Q_INVOKABLE int disconnectIO(const QUuid &ioConnectionId);
|
||||||
@ -125,6 +127,8 @@ private:
|
|||||||
Q_INVOKABLE void connectIOResponse(int commandId, const QVariantMap ¶ms);
|
Q_INVOKABLE void connectIOResponse(int commandId, const QVariantMap ¶ms);
|
||||||
Q_INVOKABLE void disconnectIOResponse(int commandId, const QVariantMap ¶ms);
|
Q_INVOKABLE void disconnectIOResponse(int commandId, const QVariantMap ¶ms);
|
||||||
Q_INVOKABLE void setStateLoggingResponse(int commandId, const QVariantMap ¶ms);
|
Q_INVOKABLE void setStateLoggingResponse(int commandId, const QVariantMap ¶ms);
|
||||||
|
Q_INVOKABLE void setActionLoggingResponse(int commandId, const QVariantMap ¶ms);
|
||||||
|
Q_INVOKABLE void setEventLoggingResponse(int commandId, const QVariantMap ¶ms);
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
ThingGroup* createGroup(Interface *interface, ThingsProxy *things);
|
ThingGroup* createGroup(Interface *interface, ThingsProxy *things);
|
||||||
|
|||||||
@ -145,6 +145,16 @@ Page {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
EmptyViewPlaceholder {
|
||||||
|
anchors.centerIn: parent
|
||||||
|
width: parent.width - app.margins * 2
|
||||||
|
title: qsTr("No data")
|
||||||
|
text: qsTr("This action has not been executed yet.")
|
||||||
|
imageSource: "../images/logs.svg"
|
||||||
|
buttonVisible: false
|
||||||
|
visible: root.isLogged && logsModel.count == 0
|
||||||
|
}
|
||||||
|
|
||||||
EmptyViewPlaceholder {
|
EmptyViewPlaceholder {
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
width: parent.width - app.margins * 2
|
width: parent.width - app.margins * 2
|
||||||
|
|||||||
@ -131,6 +131,16 @@ Page {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
EmptyViewPlaceholder {
|
||||||
|
anchors.centerIn: parent
|
||||||
|
width: parent.width - app.margins * 2
|
||||||
|
title: qsTr("No data")
|
||||||
|
text: qsTr("This event has not been triggered yet.")
|
||||||
|
imageSource: "../images/logs.svg"
|
||||||
|
visible: root.isLogged && logsModel.count == 0
|
||||||
|
buttonVisible: false
|
||||||
|
}
|
||||||
|
|
||||||
EmptyViewPlaceholder {
|
EmptyViewPlaceholder {
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
width: parent.width - app.margins * 2
|
width: parent.width - app.margins * 2
|
||||||
|
|||||||
Reference in New Issue
Block a user