using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.SignalR;
using NetPanel.Bl;
using NetPanel.Help;
using Renci.SshNet;
using System.Diagnostics;
using System.Text;

namespace NetPanel.Controllers.SSH
{
    public class SSHController : Controller
    {





        public async Task<IActionResult> SSH()
        {

            //SshBl sshBl = new SshBl("172.29.119.239", "root", "123456789", 80, 24, 800, 600);



            //var output = sshBl.ReadLine();

            //sshBl.WriteLine("top");
            //int cc = 0;
            //while (true)
            //{
            //    var outpu3 = sshBl.Read();

            //    if (cc == 0)
            //    {
            //        await Task.Delay(5000);
            //        sshBl.WriteLine("\x03");

            //        cc = 1;
            //    }
            //    else if (cc == 2)
            //    {
            //        break;
            //    }

            //}



            //sshBl.Dispose();

            ////string tt = sshBl.ServerVersion();
            //StringBuilder sbStr = new StringBuilder();
            //string tt = "";
            //var reader = sshBl.RunCommand("top");
            //string outStr = null;
            //while ((outStr = reader.ReadLine()) != null)
            //{
            //    sbStr.Append(outStr + "/r/n");
            //}


            //tt = sbStr.ToString();

            //reader = sshBl.RunCommand("uname -a");
            //outStr = null;
            //while ((outStr = reader.ReadLine()) != null)
            //{
            //    sbStr.Append(outStr);
            //}


            //tt = sbStr.ToString();

            //sshBl.Dispose();
            return View();
        }





    }
}
