设备监控-回写

This commit is contained in:
flower_linux
2026-03-20 17:19:29 +08:00
parent 903c349e1d
commit 51fa0bb51b
27 changed files with 402 additions and 19 deletions

View File

@@ -31,6 +31,19 @@ public:
QVector<DeviceTreeNode>& nodesMutable() { return m_nodes; }
const DeviceTreeNode* findById(const QString& id) const;
int findIndexById(const QString& id) const;
int findIndexByStableKey(const QString& stableKey) const;
// Monitor/register path: upsert or mark online/offline
QString upsertNodeByStableKey(const QString& stableKey,
const QString& preferredId,
const QString& type,
const QString& endpoint,
const QString& name,
const QJsonObject& extraParams,
bool online,
const QString& lastSeenTs);
bool markOfflineByStableKey(const QString& stableKey, const QString& lastSeenTs);
// 序列化为 daemon_config.json 所需格式
QJsonArray toDeviceTreeJson() const;