public ActionResult SaveConfig(string Key, string SpanTime, string StartTime, string EndTime) { S_Json_Base json = new S_Json_Base(); SpanTime = SpanTime.Replace(':', ':').Trim(); StartTime = StartTime.Replace(':', ':').Trim(); EndTime = EndTime.Replace(':', ':').Trim(); try { HeartModel.TimeConfig timeModel = new HeartModel.TimeConfig(); timeModel.Key = Key; timeModel.Span = Convert.ToDateTime(SpanTime).TimeOfDay; timeModel.StartTime = Convert.ToDateTime(StartTime).TimeOfDay; timeModel.EndTime = Convert.ToDateTime(EndTime).TimeOfDay; HeartModel.StateMachine.HeartServerInfo ServerModel = HeartMonitor.HeartServerDirMonitor.Single[Key]; ServerModel.SpanInfo = timeModel; json.Status = 1; json.Message = "配置成功"; } catch (Exception ex) { json.Status = 0; json.Message = ex.Message; } return(this.Json(json)); }
public ActionResult Save(string Key, string Name, string Value, string Description) { Parameter entity = ParameterPool.Single[Key] as Parameter; S_Json_Base json = new S_Json_Base(); json.Status = 1; json.Message = "保存成功"; return(this.Json(json)); }
public ActionResult UpAction(string Name, string Action) { S_Json_Base json = new S_Json_Base(); json.Status = 0; try { HeartModel.StateMachine.HeartServerInfo model = HeartMonitor.HeartServerDirMonitor.Single[Name]; switch (Action) { case "run": model.Run(); break; case "load": model.Load(); break; case "unload": model.Unload(); break; case "pause": model.Pause(); break; default: break; } json.Status = 1; json.Message = "执行成功"; } catch (Exception ex) { json.Message = ex.Message; } return(this.Json(json)); }