Exemplo n.º 1
0
 public PowerController(ILogger <SystemInformationController> logger, IConfiguration config, IOptions <ConfigEnvironment> envOpt)
 {
     if (envOpt.Value.UseSsh)
     {
         var credentials = new OSCommander.Dtos.SshCredentials(
             config["Ssh:Host"],
             config["Ssh:Username"],
             config["Ssh:Password"]);
         _power = new Power(logger, credentials);
     }
     else
     {
         _power = new Power(logger);
     }
 }
Exemplo n.º 2
0
 public PartitionController(
     DbContextOptions <AppDbContext> options,
     ILogger <SystemInformationController> logger,
     IConfiguration config,
     IOptions <ConfigEnvironment> envOpt
     )
 {
     _context = new AppDbContext(options);
     if (envOpt.Value.UseSsh)
     {
         var credentials = new OSCommander.Dtos.SshCredentials(
             config["Ssh:Host"],
             config["Ssh:Username"],
             config["Ssh:Password"]);
         _service    = new PartitionService(logger, credentials);
         _sysService = new SystemService(logger, credentials);
     }
     else
     {
         _service    = new PartitionService(logger);
         _sysService = new SystemService(logger);
     }
 }
Exemplo n.º 3
0
 public PartitionService(ILogger logger, OSCommander.Dtos.SshCredentials ssh)
 {
     _mount = new Mount(logger, ssh);
     _cron  = new Cron(logger, ssh);
 }