Skip to content

Commit

Permalink
feat: query log add service name
Browse files Browse the repository at this point in the history
  • Loading branch information
Qinyouzeng committed Sep 2, 2024
1 parent 195efec commit 3abb25e
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,7 @@ public class RequestLogLatestDto : FromUri<RequestLogLatestDto>

public DateTime End { get; set; }

public string Service { get; set; }

public bool IsDesc { get; set; } = true;
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

namespace Masa.Tsc.Service.Admin.Application.Logs;

public record LatestLogQuery(DateTime Start, DateTime End, string Query, bool IsDesc = true) : Query<LogResponseDto>
public record LatestLogQuery(DateTime Start, DateTime End,string Service, string Query, bool IsDesc = true) : Query<LogResponseDto>
{
public override LogResponseDto Result { get; set; }
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ public async Task GetLatestDataAsync(LatestLogQuery queryData)
Start = queryData.Start,
End = queryData.End,
RawQuery = queryData.Query,
Service=queryData.Service,
Page = 1,
PageSize = 1,
Sort = new FieldOrderDto { Name = StorageConst.Current.Timestimap, IsDesc = !queryData.IsDesc }
Expand Down
2 changes: 1 addition & 1 deletion src/Services/Masa.Tsc.Service.Admin/Services/LogService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ private async Task<object> AggregateAsync([FromServices] IEventBus eventBus, [Fr

private async Task<LogResponseDto> GetLatestAsync([FromServices] IEventBus eventBus, [FromBody] RequestLogLatestDto param)
{
var query = new LatestLogQuery(param.Start, param.End, param.Query, param.IsDesc);
var query = new LatestLogQuery(param.Start, param.End, param.Service, param.Query, param.IsDesc);
await eventBus.PublishAsync(query);
return query.Result;
}
Expand Down
1 change: 1 addition & 0 deletions src/Web/Masa.Tsc.Web.Admin.Server/Pages/_Layout.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,6 @@
<script src="https://cdn.masastack.com/npm/sortable/Sortable.min.js"></script>
<script src="https://gw.alipayobjects.com/os/antv/pkg/_antv.g2-3.5.5/dist/g2.min.js"></script>
<script src="https://gw.alipayobjects.com/os/antv/pkg/_antv.data-set-0.10.1/dist/data-set.min.js"></script>
<script src="https://cdn.masastack.com/npm/masonry/masonry.pkgd.min.js"></script>
</body>
</html>

0 comments on commit 3abb25e

Please sign in to comment.