mirror of
https://github.com/Termix-SSH/Termix.git
synced 2026-07-16 05:13:36 +00:00
fix: monitoring defaults not saving and OIDC redirect issues
This commit is contained in:
@@ -1001,6 +1001,28 @@ class PollingManager {
|
||||
}
|
||||
}
|
||||
|
||||
refreshAllPolling(): void {
|
||||
const hostsToRefresh: Array<{
|
||||
host: SSHHostWithCredentials;
|
||||
viewerUserId?: string;
|
||||
}> = [];
|
||||
|
||||
for (const [hostId, config] of this.pollingConfigs.entries()) {
|
||||
hostsToRefresh.push({
|
||||
host: config.host,
|
||||
viewerUserId: config.viewerUserId,
|
||||
});
|
||||
}
|
||||
|
||||
for (const hostId of this.pollingConfigs.keys()) {
|
||||
this.stopPollingForHost(hostId, false);
|
||||
}
|
||||
|
||||
for (const { host, viewerUserId } of hostsToRefresh) {
|
||||
this.startPollingForHost(host, { statusOnly: true, viewerUserId });
|
||||
}
|
||||
}
|
||||
|
||||
registerViewer(hostId: number, sessionId: string, userId: string): void {
|
||||
if (!this.activeViewers.has(hostId)) {
|
||||
this.activeViewers.set(hostId, new Set());
|
||||
@@ -1259,9 +1281,8 @@ async function resolveHostCredentials(
|
||||
const isSharedHost = userId !== ownerId;
|
||||
|
||||
if (isSharedHost) {
|
||||
const { SharedCredentialManager } = await import(
|
||||
"../utils/shared-credential-manager.js"
|
||||
);
|
||||
const { SharedCredentialManager } =
|
||||
await import("../utils/shared-credential-manager.js");
|
||||
const sharedCredManager = SharedCredentialManager.getInstance();
|
||||
const sharedCred = await sharedCredManager.getSharedCredentialForUser(
|
||||
host.id as number,
|
||||
@@ -3185,6 +3206,9 @@ app.post("/global-settings", requireAdmin, async (req, res) => {
|
||||
.run(String(metricsInterval));
|
||||
}
|
||||
|
||||
// Refresh all active polling to apply new intervals immediately
|
||||
pollingManager.refreshAllPolling();
|
||||
|
||||
res.json({ success: true });
|
||||
} catch (error) {
|
||||
statsLogger.error("Failed to save global settings", {
|
||||
|
||||
Reference in New Issue
Block a user