Improve File Manger UI scaling, fix file manager disconnect, disable more than one file manager at a time.

This commit is contained in:
LukeGus
2025-08-27 22:17:28 -05:00
parent b046aedcee
commit 487919cedc
14 changed files with 323 additions and 557 deletions

View File

@@ -115,10 +115,29 @@ function buildSshConfig(host: HostRecord): ConnectConfig {
(base as any).password = host.password || '';
} else if (host.authType === 'key') {
if (host.key) {
(base as any).privateKey = Buffer.from(host.key, 'utf8');
}
if (host.keyPassword) {
(base as any).passphrase = host.keyPassword;
try {
if (!host.key.includes('-----BEGIN') || !host.key.includes('-----END')) {
throw new Error('Invalid private key format');
}
const cleanKey = host.key.trim().replace(/\r\n/g, '\n').replace(/\r/g, '\n');
(base as any).privateKey = Buffer.from(cleanKey, 'utf8');
if (host.keyPassword) {
(base as any).passphrase = host.keyPassword;
}
logger.info(`SSH key authentication configured for host ${host.ip}`);
} catch (keyError) {
logger.error(`SSH key format error for host ${host.ip}: ${keyError.message}`);
if (host.password) {
(base as any).password = host.password;
logger.info(`Falling back to password authentication for host ${host.ip}`);
} else {
throw new Error(`Invalid SSH key format for host ${host.ip}`);
}
}
}
}
return base;
@@ -413,10 +432,4 @@ app.listen(PORT, async () => {
} catch (err) {
logger.error('Initial poll failed', err);
}
});
// Disable automatic background polling to prevent log flooding
// setInterval(() => {
// pollStatusesOnce().catch(err => logger.error('Background poll failed', err));
// }, 60_000);
});