public async Task <IActionResult> Control(string Action) { string Message = ""; switch (Action) { case "Start": _logger.LogInformation("Starting Server..."); Message = await ServerInteractions.StartServer(_logger); _logger.LogInformation(Message); break; case "Stop": _logger.LogInformation("Stopping Server..."); Message = ServerInteractions.StopServer(_logger); _logger.LogInformation(Message); break; case "Generate": _logger.LogInformation("Generating Config..."); Message = await ServerInteractions.UpdateConfig(_logger); break; default: _logger.LogInformation("Unknown Command"); break; } return(RedirectToAction("Index", new { message = Message })); }
public async Task <IActionResult> Index(string message) { var Apps = await FirebaseInteractions.GetApplicationsAsync(_fireBaseToken); if (message != "" && message != null) { ViewBag.message = message; } else { ViewBag.message = "No Message"; } string statusUrl = _configuration.GetValue <string>("StatusUrl"); ViewBag.status = await ServerInteractions.GetStatus(statusUrl, _logger); return(View(Apps)); }