mirror of
https://github.com/Termix-SSH/Termix.git
synced 2026-10-29 06:35:24 +00:00
feat: finish the host-metrics plugin, move host status into core (B16)
This commit is contained in:
1 parent
14eb558b85
commit
0a3f05d99d
308 files changed
+53073
-8985
No files matched your search
@@ -8,7 +8,11 @@ import {
|
||||
import { resolveGuacdOptions } from "./guacd-config.js";
|
||||
import { registerRoutes } from "./routes.js";
|
||||
import { createLiveSessions } from "./live-sessions.js";
|
||||
import { normalizeImportedHost } from "./host-settings.js";
|
||||
import {
|
||||
normalizeImportedHost,
|
||||
PORT_KEY,
|
||||
readHostSettings,
|
||||
} from "./host-settings.js";
|
||||
import { createLogger } from "./log.js";
|
||||
|
||||
export async function activate(ctx: PluginContext) {
|
||||
@@ -103,6 +107,14 @@ export async function activate(ctx: PluginContext) {
|
||||
"remote-desktop.hostImportNormalizer",
|
||||
normalizeImportedHost,
|
||||
);
|
||||
|
||||
// Core's status dot pings these hosts on the protocol's own port.
|
||||
for (const protocol of ["rdp", "vnc", "telnet"] as const) {
|
||||
ctx.hosts.status.registerPort(protocol, async (hostId) => {
|
||||
const settings = await readHostSettings(ctx, hostId);
|
||||
return settings[PORT_KEY[protocol]] as number;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
export async function deactivate() {}
|
||||
Reference in new issue
Block a user