diff --git a/src/Services/Masa.Tsc.Service.Admin/Services/ApmService.cs b/src/Services/Masa.Tsc.Service.Admin/Services/ApmService.cs index fb3f6a9e..8caac2b9 100644 --- a/src/Services/Masa.Tsc.Service.Admin/Services/ApmService.cs +++ b/src/Services/Masa.Tsc.Service.Admin/Services/ApmService.cs @@ -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 @@ -203,8 +199,10 @@ private async Task>> GetTeamAppsAsync(IAuthClien var projects = await pmClient.ProjectService.GetListByTeamIdsAsync(new List { 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; } diff --git a/src/Web/Masa.Tsc.Web.Admin.Rcl/Components/Apm/ApmSearchComponent.razor.cs b/src/Web/Masa.Tsc.Web.Admin.Rcl/Components/Apm/ApmSearchComponent.razor.cs index 7005e573..d2479a76 100644 --- a/src/Web/Masa.Tsc.Web.Admin.Rcl/Components/Apm/ApmSearchComponent.razor.cs +++ b/src/Web/Masa.Tsc.Web.Admin.Rcl/Components/Apm/ApmSearchComponent.razor.cs @@ -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() { @@ -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() { @@ -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))