Example #1
0
        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;
            }));
        }
Example #2
0
        private void TasksLogControl_Load(object sender, EventArgs e)
        {
            this.currentDay = DateTime.Today;
            GetLogsResult result = this.GetLogs();

            SetLogDay(result);
            AddIdleTaskLog();
        }
Example #3
0
        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);
        }
Example #4
0
 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();
     }
 }
Example #5
0
 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();
     }
 }
Example #6
0
 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;
 }