mirror of
https://github.com/Termix-SSH/Termix.git
synced 2026-07-15 21:03:47 +00:00
fix: no db entry for connection protocols
This commit is contained in:
@@ -673,10 +673,12 @@ router.post(
|
|||||||
(effectiveConnectionType !== "ssh" ? "password" : undefined);
|
(effectiveConnectionType !== "ssh" ? "password" : undefined);
|
||||||
const effectiveUsername =
|
const effectiveUsername =
|
||||||
username || rdpUser || vncUser || telnetUser || "";
|
username || rdpUser || vncUser || telnetUser || "";
|
||||||
|
const effectiveName =
|
||||||
|
name || (effectiveUsername ? `${effectiveUsername}@${ip}` : String(ip));
|
||||||
const sshDataObj: Record<string, unknown> = {
|
const sshDataObj: Record<string, unknown> = {
|
||||||
userId: userId,
|
userId: userId,
|
||||||
connectionType: effectiveConnectionType,
|
connectionType: effectiveConnectionType,
|
||||||
name,
|
name: effectiveName,
|
||||||
folder: folder || null,
|
folder: folder || null,
|
||||||
tags: Array.isArray(tags) ? tags.join(",") : tags || "",
|
tags: Array.isArray(tags) ? tags.join(",") : tags || "",
|
||||||
ip,
|
ip,
|
||||||
@@ -1207,9 +1209,11 @@ router.put(
|
|||||||
const effectiveAuthType = authType || authMethod;
|
const effectiveAuthType = authType || authMethod;
|
||||||
const effectiveUsername =
|
const effectiveUsername =
|
||||||
username || rdpUser || vncUser || telnetUser || "";
|
username || rdpUser || vncUser || telnetUser || "";
|
||||||
|
const effectiveName =
|
||||||
|
name || (effectiveUsername ? `${effectiveUsername}@${ip}` : String(ip));
|
||||||
const sshDataObj: Record<string, unknown> = {
|
const sshDataObj: Record<string, unknown> = {
|
||||||
connectionType: connectionType || "ssh",
|
connectionType: connectionType || "ssh",
|
||||||
name,
|
name: effectiveName,
|
||||||
folder,
|
folder,
|
||||||
tags: Array.isArray(tags) ? tags.join(",") : tags || "",
|
tags: Array.isArray(tags) ? tags.join(",") : tags || "",
|
||||||
ip,
|
ip,
|
||||||
@@ -1583,6 +1587,20 @@ router.get(
|
|||||||
guacamoleConfig: hosts.guacamoleConfig,
|
guacamoleConfig: hosts.guacamoleConfig,
|
||||||
macAddress: hosts.macAddress,
|
macAddress: hosts.macAddress,
|
||||||
dockerConfig: hosts.dockerConfig,
|
dockerConfig: hosts.dockerConfig,
|
||||||
|
enableSsh: hosts.enableSsh,
|
||||||
|
enableRdp: hosts.enableRdp,
|
||||||
|
enableVnc: hosts.enableVnc,
|
||||||
|
enableTelnet: hosts.enableTelnet,
|
||||||
|
sshPort: hosts.sshPort,
|
||||||
|
rdpPort: hosts.rdpPort,
|
||||||
|
vncPort: hosts.vncPort,
|
||||||
|
telnetPort: hosts.telnetPort,
|
||||||
|
rdpUser: hosts.rdpUser,
|
||||||
|
rdpDomain: hosts.rdpDomain,
|
||||||
|
rdpSecurity: hosts.rdpSecurity,
|
||||||
|
rdpIgnoreCert: hosts.rdpIgnoreCert,
|
||||||
|
vncUser: hosts.vncUser,
|
||||||
|
telnetUser: hosts.telnetUser,
|
||||||
|
|
||||||
ownerId: hosts.userId,
|
ownerId: hosts.userId,
|
||||||
isShared: sql<boolean>`${hostAccess.id} IS NOT NULL AND ${hosts.userId} != ${userId}`,
|
isShared: sql<boolean>`${hostAccess.id} IS NOT NULL AND ${hosts.userId} != ${userId}`,
|
||||||
|
|||||||
Reference in New Issue
Block a user