You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
62 lines
1.2 KiB
62 lines
1.2 KiB
|
1 month ago
|
using System;
|
||
|
|
|
||
|
|
namespace AuroraDesk.Core.Entities;
|
||
|
|
|
||
|
|
/// <summary>
|
||
|
|
/// 表示 Plink 会话的当前状态
|
||
|
|
/// </summary>
|
||
|
|
public enum PlinkSessionStatus
|
||
|
|
{
|
||
|
|
Disconnected = 0,
|
||
|
|
Connecting = 1,
|
||
|
|
Connected = 2,
|
||
|
|
Error = 3
|
||
|
|
}
|
||
|
|
|
||
|
|
/// <summary>
|
||
|
|
/// 表示 Plink 消息的方向
|
||
|
|
/// </summary>
|
||
|
|
public enum PlinkMessageDirection
|
||
|
|
{
|
||
|
|
Outgoing,
|
||
|
|
Incoming,
|
||
|
|
System
|
||
|
|
}
|
||
|
|
|
||
|
|
/// <summary>
|
||
|
|
/// Plink 消息模型,包含消息内容与元数据
|
||
|
|
/// </summary>
|
||
|
|
public sealed record PlinkMessage(
|
||
|
|
Guid SessionId,
|
||
|
|
PlinkMessageDirection Direction,
|
||
|
|
string Content,
|
||
|
|
DateTime Timestamp,
|
||
|
|
bool IsError = false);
|
||
|
|
|
||
|
|
/// <summary>
|
||
|
|
/// 创建 Plink 会话所需的参数
|
||
|
|
/// </summary>
|
||
|
|
public sealed record PlinkSessionOptions(
|
||
|
|
string Host,
|
||
|
|
int Port,
|
||
|
|
string UserName,
|
||
|
|
string? Password = null,
|
||
|
|
string? PrivateKeyPath = null,
|
||
|
|
string? DisplayName = null,
|
||
|
|
string? AdditionalArguments = null,
|
||
|
|
string? PlinkExecutablePath = null,
|
||
|
|
bool AllowAnyHostKey = true);
|
||
|
|
|
||
|
|
/// <summary>
|
||
|
|
/// Plink 会话的简要信息
|
||
|
|
/// </summary>
|
||
|
|
public sealed record PlinkSessionInfo(
|
||
|
|
Guid SessionId,
|
||
|
|
string DisplayName,
|
||
|
|
string Host,
|
||
|
|
int Port,
|
||
|
|
string UserName,
|
||
|
|
PlinkSessionStatus Status,
|
||
|
|
DateTime CreatedAtUtc);
|
||
|
|
|