Add sync command

This commit is contained in:
Stone_Red
2023-12-14 10:05:53 +01:00
parent 7913140dcd
commit 6d60f3891d
3 changed files with 67 additions and 0 deletions
@@ -202,4 +202,20 @@ public class HostCommands
ApiManager.SendNotificationMessageNewLine($"Invalid host! Error message: {ex.Message}", NotificationMessageType.Error);
}
}
public void Sync(string _)
{
int newHostsCount = hostsManager.Sync();
ApiManager.SendNotificationMessageNewLine(string.Empty, NotificationMessageType.Info);
if (newHostsCount > 0)
{
ApiManager.SendNotificationMessage($"Added {newHostsCount} new hosts).");
}
else
{
ApiManager.SendNotificationMessage($"No new hosts added.", NotificationMessageType.Warning);
}
}
}