update
This commit is contained in:
@@ -7,7 +7,7 @@ import { getDbInstance, runDb, getDb as getDbRow, allDb } from '../database/conn
|
|||||||
|
|
||||||
interface ImportedConnectionData {
|
interface ImportedConnectionData {
|
||||||
name: string;
|
name: string;
|
||||||
type: 'SSH' | 'RDP'; // Add type field
|
type: 'SSH' | 'RDP' | 'VNC'; // Add type field
|
||||||
host: string;
|
host: string;
|
||||||
port: number;
|
port: number;
|
||||||
username: string;
|
username: string;
|
||||||
@@ -158,7 +158,7 @@ export const importConnections = async (fileBuffer: Buffer): Promise<ImportResul
|
|||||||
try {
|
try {
|
||||||
|
|
||||||
// Validate imported data, including type
|
// Validate imported data, including type
|
||||||
if (!connData.type || !['SSH', 'RDP'].includes(connData.type)) {
|
if (!connData.type || !['SSH', 'RDP', 'VNC'].includes(connData.type)) {
|
||||||
throw new Error('缺少或无效的连接类型 (type)。');
|
throw new Error('缺少或无效的连接类型 (type)。');
|
||||||
}
|
}
|
||||||
if (!connData.name || !connData.host || !connData.port || !connData.username) {
|
if (!connData.name || !connData.host || !connData.port || !connData.username) {
|
||||||
@@ -205,7 +205,7 @@ export const importConnections = async (fileBuffer: Buffer): Promise<ImportResul
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Prepare data for repository, ensuring correct auth_method for RDP
|
// Prepare data for repository, ensuring correct auth_method for RDP
|
||||||
const authMethodForDb = connData.type === 'RDP' ? 'password' : connData.auth_method!;
|
const authMethodForDb = (connData.type === 'RDP' || connData.type === 'VNC') ? 'password' : connData.auth_method!;
|
||||||
connectionsToInsert.push({
|
connectionsToInsert.push({
|
||||||
name: connData.name,
|
name: connData.name,
|
||||||
type: connData.type, // Add type
|
type: connData.type, // Add type
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@nexus-terminal/frontend",
|
"name": "@nexus-terminal/frontend",
|
||||||
"version": "0.3.5",
|
"version": "0.4",
|
||||||
"private": true,
|
"private": true,
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
Reference in New Issue
Block a user