@riddix/hamh 2.1.0-alpha.779 → 2.1.0-alpha.780
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/backend/cli.js
CHANGED
|
@@ -165023,9 +165023,20 @@ var ServerModeBridge = class {
|
|
|
165023
165023
|
const sessionManager = this.server.env.get(SessionManager);
|
|
165024
165024
|
const sessions = [...sessionManager.sessions];
|
|
165025
165025
|
let totalSubscriptions = 0;
|
|
165026
|
+
const fabricMap = /* @__PURE__ */ new Map();
|
|
165026
165027
|
const sessionList = sessions.map((s) => {
|
|
165027
165028
|
const subCount = s.subscriptions.size;
|
|
165028
165029
|
totalSubscriptions += subCount;
|
|
165030
|
+
const fi = typeof s.fabric?.fabricIndex === "number" ? s.fabric.fabricIndex : null;
|
|
165031
|
+
if (fi !== null) {
|
|
165032
|
+
const existing = fabricMap.get(fi) ?? {
|
|
165033
|
+
sessions: 0,
|
|
165034
|
+
subscriptions: 0
|
|
165035
|
+
};
|
|
165036
|
+
existing.sessions++;
|
|
165037
|
+
existing.subscriptions += subCount;
|
|
165038
|
+
fabricMap.set(fi, existing);
|
|
165039
|
+
}
|
|
165029
165040
|
const nowMs = Date.now();
|
|
165030
165041
|
const lastActiveMsAgo = typeof s.activeTimestamp === "number" && s.activeTimestamp > 0 ? nowMs - s.activeTimestamp : null;
|
|
165031
165042
|
const lastAnyActivityMsAgo = typeof s.timestamp === "number" ? nowMs - s.timestamp : null;
|
|
@@ -165033,6 +165044,7 @@ var ServerModeBridge = class {
|
|
|
165033
165044
|
return {
|
|
165034
165045
|
id: s.id,
|
|
165035
165046
|
peerNodeId: String(s.peerNodeId),
|
|
165047
|
+
fabricIndex: fi,
|
|
165036
165048
|
subscriptionCount: subCount,
|
|
165037
165049
|
lastActiveMsAgo,
|
|
165038
165050
|
lastAnyActivityMsAgo,
|
|
@@ -165040,16 +165052,23 @@ var ServerModeBridge = class {
|
|
|
165040
165052
|
ageMsFromOpen: startedAt != null ? nowMs - startedAt : null
|
|
165041
165053
|
};
|
|
165042
165054
|
});
|
|
165055
|
+
const fabrics = [...fabricMap.entries()].map(([fabricIndex, data]) => ({
|
|
165056
|
+
fabricIndex,
|
|
165057
|
+
sessions: data.sessions,
|
|
165058
|
+
subscriptions: data.subscriptions
|
|
165059
|
+
}));
|
|
165043
165060
|
return {
|
|
165044
165061
|
sessions: sessionList,
|
|
165045
165062
|
totalSessions: sessions.length,
|
|
165046
|
-
totalSubscriptions
|
|
165063
|
+
totalSubscriptions,
|
|
165064
|
+
fabrics
|
|
165047
165065
|
};
|
|
165048
165066
|
} catch {
|
|
165049
165067
|
return {
|
|
165050
165068
|
sessions: [],
|
|
165051
165069
|
totalSessions: 0,
|
|
165052
|
-
totalSubscriptions: 0
|
|
165070
|
+
totalSubscriptions: 0,
|
|
165071
|
+
fabrics: []
|
|
165053
165072
|
};
|
|
165054
165073
|
}
|
|
165055
165074
|
}
|