public async Task <ActionResult> OnGetAsync(string start = null, string stop = null) { try { //Stop Services if (!string.IsNullOrWhiteSpace(stop)) { await _bitClientProcessor.StopServiceAsync(); } //Start Services if (!string.IsNullOrWhiteSpace(start)) { await _bitClientProcessor.StartServiceAync(); } this._queueStatus = this._bitClientProcessor.GetCurrentStatus(); if (!string.IsNullOrWhiteSpace(stop) || !string.IsNullOrWhiteSpace(start)) { return(RedirectToAction(string.Empty)); } return(Page()); } catch (Exception ex) { return(RedirectToAction(string.Empty)); } }
public IndexModel(ILogger <IndexModel> logger, IBitClientProcessor bitClientProcessor) { _logger = logger; this._bitClientProcessor = bitClientProcessor; this._queueStatus = bitClientProcessor.GetCurrentStatus(); }