server: basic auth. object stats.

This commit is contained in:
Koushik Dutta
2021-09-18 20:55:53 -07:00
parent 4c963260ff
commit 2ce5812ff5
5 changed files with 179 additions and 15 deletions

View File

@@ -67,9 +67,14 @@ export class PluginComponent {
async getPluginInfo(pluginId: string) {
const plugin = await this.scrypted.datastore.tryGet(Plugin, pluginId);
const host = this.scrypted.plugins[pluginId];
let rpcObjects = 0;
if (host.peer) {
rpcObjects = host.peer.localProxied.size + Object.keys(host.peer.remoteWeakProxies).length;
}
return {
pid: host?.worker?.process.pid,
stats: host?.stats,
rpcObjects,
packageJson: plugin.packageJson,
id: this.scrypted.findPluginDevice(pluginId),
}