Add host index support to list files remote command

This commit is contained in:
Stone_Red
2023-12-14 09:09:56 +01:00
parent e20d133936
commit b4a8f83fb7
@@ -90,6 +90,19 @@ public class FileCommands
public void ListFilesRemote(string args)
{
if (int.TryParse(args, out int index))
{
List<NetworkSocket> hosts = hostsManager.ToList();
if (index < 1 || index > hosts.Count)
{
ApiManager.SendNotificationMessageNewLine("Invalid index!", NotificationMessageType.Error);
return;
}
args = $"{hosts[index - 1].IPAddress}:{hosts[index - 1].Port}";
}
string[] parts = args.Split(":");
if (parts.Length != 2)
@@ -145,8 +158,6 @@ public class FileCommands
return;
}
int index = 0;
foreach (HyperFileDto fileInfo in fileInfos)
{
index++;