Skip to content

Commit

Permalink
chore: update
Browse files Browse the repository at this point in the history
  • Loading branch information
Qinyouzeng committed Aug 9, 2024
1 parent c11234f commit 4f5068b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
6 changes: 2 additions & 4 deletions src/Services/Masa.Tsc.Service.Admin/Services/ApmService.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
// Copyright (c) MASA Stack All rights reserved.
// Licensed under the Apache License. See LICENSE.txt in the project root for license information.

using Masa.BuildingBlocks.Authentication.Identity;
using Masa.BuildingBlocks.Isolation;
using System.Linq;

namespace Masa.Tsc.Service.Admin.Services;

public class ApmService : ServiceBase
Expand Down Expand Up @@ -203,8 +199,10 @@ private async Task<Dictionary<string, List<string>>> GetTeamAppsAsync(IAuthClien
var projects = await pmClient.ProjectService.GetListByTeamIdsAsync(new List<Guid> { teamId }, env);
if (projects == null) continue;
var apps = await pmClient.AppService.GetListByProjectIdsAsync(projects.Select(item => item.Id).ToList());
//var apps = await pmClient.ProjectService.GetProjectAppsAsync(env);
result.Add(env, apps.Select(item => item.Identity).ToList());
}

return result;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ public partial class ApmSearchComponent
[Inject]
public GlobalConfig GlobalConfig { get; set; } = default!;
private static bool hasMonitorTeamId = false;
protected static Guid TeamId { get; set; }

private static List<(ApmComparisonTypes value, string text)> listComparisons = new()
{
Expand Down Expand Up @@ -166,12 +165,12 @@ protected override void OnInitialized()

private void TeamChanged(Guid teamId)
{
TeamId = teamId;
GlobalConfig.CurrentTeamId = teamId;
var task = InvokeAsync(async () =>
{
await LoadEnvironmentAsync();
StateHasChanged();
});
});
}
private async Task LoadServiceAsync()
{
Expand All @@ -197,7 +196,7 @@ private async Task LoadServiceAsync()
private async Task LoadEnvironmentAsync()
{
isEnvLoading = true;
var result = await ApiCaller.ApmService.GetEnviromentServiceAsync(TeamId, Search.Start, Search.End);
var result = await ApiCaller.ApmService.GetEnviromentServiceAsync(GlobalConfig.CurrentTeamId, Search.Start, Search.End);
enviromentServices = result;
environments = result.Keys.ToList();
if (!string.IsNullOrEmpty(Search.Environment) && !environments.Contains(Search.Environment))
Expand Down

0 comments on commit 4f5068b

Please sign in to comment.