public async Task <IResponse <GetLogsResult> > GetProjectLogsAsync(GetProjectLogsRequest request) { return((await SendRequestAsync <IList <IDictionary <string, string> > >( new HttpRequestMessageBuilder(HttpMethod.Get, "/logs") .Query(request), project: request.ProjectName)) .Transform((httpHeaders, data) => { var newResult = new GetLogsResult(data) { Count = Convert.ToInt32(httpHeaders.GetValueOrDefault(LogHeaders.Count)), ProcessedRows = Convert.ToInt32(httpHeaders.GetValueOrDefault(LogHeaders.ProcessedRows)), ElapsedMillisecond = Convert.ToInt32(httpHeaders.GetValueOrDefault(LogHeaders.ElapsedMillisecond)), HasSql = Convert.ToBoolean(httpHeaders.GetValueOrDefault(LogHeaders.HasSql)), AggQuery = httpHeaders.GetValueOrDefault(LogHeaders.AggQuery), WhereQuery = httpHeaders.GetValueOrDefault(LogHeaders.WhereQuery) }; // Parse Progress if (Enum.TryParse <LogProgressState>(httpHeaders.GetValueOrDefault(LogHeaders.Progress), true, out var progress)) { newResult.Progress = progress; } // Parse QueryInfo if (httpHeaders.TryGetValue(LogHeaders.QueryInfo, out var queryInfoValue)) { newResult.QueryInfo = JsonConvert.DeserializeObject <LogQueryInfo>(queryInfoValue); } return newResult; })); }
private void TasksLogControl_Load(object sender, EventArgs e) { this.currentDay = DateTime.Today; GetLogsResult result = this.GetLogs(); SetLogDay(result); AddIdleTaskLog(); }
private GetLogsResult GetLogs() { GetLogsResult result = new GetLogsResult(); result.LogList = Logs.GetLogsByDay(this.currentDay.Date); foreach (Log log in result.LogList) { ArrayList applicationLogs = ApplicationsLog.GetApplicationsLog(log.Id); log.ApplicationsLog = applicationLogs; } return(result); }
private void SetLogDay(GetLogsResult result) { try { taskList.BeginUpdate(); foreach (Log log in result.LogList) { Task taskRow = Tasks.FindById(log.TaskId); TreeListViewItem itemA = new TreeListViewItem("", new string[] { "", "" }); SetListItemValues(itemA, log, taskRow); taskList.Items.Insert(0, itemA); foreach (ApplicationLog applicationLog in log.ApplicationsLog) { UpdateApplicationsList(applicationLog, DataRowAction.Add); } } } finally { taskList.EndUpdate(); SetReadyState(); } }
private void SetLogDay(GetLogsResult result) { try { taskList.BeginUpdate(); foreach (Log log in result.LogList) { Task taskRow = Tasks.FindById(log.TaskId); TreeListViewItem itemA = new TreeListViewItem("", new string[] {"", ""}); SetListItemValues(itemA, log, taskRow); taskList.Items.Insert(0, itemA); foreach (ApplicationLog applicationLog in log.ApplicationsLog) { UpdateApplicationsList(applicationLog, DataRowAction.Add); } } } finally { taskList.EndUpdate(); SetReadyState(); } }
private GetLogsResult GetLogs() { GetLogsResult result = new GetLogsResult(); result.LogList = Logs.GetLogsByDay(this.currentDay.Date); foreach (Log log in result.LogList) { ArrayList applicationLogs = ApplicationsLog.GetApplicationsLog(log.Id); log.ApplicationsLog = applicationLogs; } return result; }