Ejemplo n.º 1
0
        public ActionResult FalconQueryAPISettings(FalconQueryAPIConfigViewModel model)
        {
            if (ModelState.IsValid)
            {
                try
                {
                    repo.UpdateFalconQueryAPISettings(model);
                    return(PartialView("_Success", "Falcon Query API settings have been updated"));
                }
                catch (Exception e)
                {
                    return(PartialView("_Error", e.Message));
                }
            }
            List <string> errors = ModelState.Where(x => x.Value.Errors.Count > 0).SelectMany(x => x.Value.Errors).Select(x => x.ErrorMessage).ToList();

            return(PartialView("_ValidationError", errors));
        }
 public void UpdateFalconQueryAPISettings(FalconQueryAPIConfigViewModel model)
 {
     config.FALCON_QUERY_URL      = model.Url;
     config.FALCON_QUERY_USERNAME = model.Username;
     config.FALCON_QUERY_PASSWORD = model.Password;
 }