perf(centralui): load template stubs/analysis projections instead of the full tracked graph (review 2026-10-21 07/P-1, 08/P1)

This commit is contained in:
Joseph Doherty
2026-10-22 08:40:49 -04:00
parent 0ebfafa98b
commit c429fb374b
12 changed files with 103 additions and 28 deletions
@@ -107,7 +107,7 @@
{
_siteCount = (await SiteRepository.GetAllSitesAsync()).Count;
_dataConnectionCount = (await SiteRepository.GetAllDataConnectionsAsync()).Count;
_templateCount = (await TemplateEngineRepository.GetAllTemplatesAsync()).Count;
_templateCount = (await TemplateEngineRepository.GetTemplateStubsAsync()).Count;
_apiKeyCount = (await ApiKeyAdmin.ListAsync()).Count;
}
catch
@@ -267,7 +267,7 @@
{
try
{
_templates = (await TemplateEngineRepository.GetAllTemplatesAsync()).ToList();
_templates = (await TemplateEngineRepository.GetTemplateStubsAsync()).ToShellTemplates();
_folders = (await TemplateEngineRepository.GetAllFoldersAsync()).ToList();
_foldersById = _folders.ToDictionary(f => f.Id);
if (TemplateId is int tid)
@@ -1,4 +1,5 @@
@page "/design/templates/create"
@using ZB.MOM.WW.ScadaBridge.CentralUI.Services
@using ZB.MOM.WW.ScadaBridge.Security
@using ZB.MOM.WW.ScadaBridge.Commons.Entities.Templates
@using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Repositories
@@ -73,7 +74,7 @@
{
try
{
_templates = (await TemplateEngineRepository.GetAllTemplatesAsync()).ToList();
_templates = (await TemplateEngineRepository.GetTemplateStubsAsync()).ToShellTemplates();
if (ParentId is int pid && _templates.Any(t => t.Id == pid))
{
_createParentId = pid;
@@ -125,7 +125,7 @@
_loadError = null;
try
{
_templates = (await TemplateEngineRepository.GetAllTemplatesAsync()).ToList();
_templates = (await TemplateEngineRepository.GetAllTemplatesForAnalysisAsync()).ToList();
_selectedTemplate = await TemplateEngineRepository.GetTemplateWithChildrenAsync(Id)
?? _templates.FirstOrDefault(t => t.Id == Id);
@@ -148,7 +148,7 @@
_loading = true;
try
{
_templates = (await TemplateEngineRepository.GetAllTemplatesAsync()).ToList();
_templates = (await TemplateEngineRepository.GetAllTemplatesForAnalysisAsync()).ToList();
_folders = (await TemplateEngineRepository.GetAllFoldersAsync()).ToList();
_templatesById = _templates.ToDictionary(t => t.Id);
_compositionsById = _templates
@@ -1,3 +1,4 @@
using ZB.MOM.WW.ScadaBridge.CentralUI.Services;
using System.Security.Cryptography;
using Microsoft.AspNetCore.Components;
using Microsoft.AspNetCore.Components.Authorization;
@@ -136,7 +137,7 @@ public partial class TransportExport : ComponentBase
_errorMessage = null;
try
{
_templates = (await TemplateRepo.GetAllTemplatesAsync()).ToList();
_templates = (await TemplateRepo.GetTemplateStubsAsync()).ToShellTemplates();
_folders = (await TemplateRepo.GetAllFoldersAsync()).ToList();
_sharedScripts = (await TemplateRepo.GetAllSharedScriptsAsync()).ToList();
_externalSystems = (await ExternalRepo.GetAllExternalSystemsAsync()).ToList();