blob: 34925f30909da3349f76884f1f5c7c449ff1a114 [file] [log] [blame]
@page
@model BaSyx.Common.UI.Pages.SubmodelRepositoryModel
@using BaSyx.API.Components;
@using BaSyx.Models.Core.AssetAdministrationShell.Generics;
@using BaSyx.Utils.Settings.Types;
@using Microsoft.AspNetCore.Hosting;
@{
ISubmodelRepositoryServiceProvider sp = Model.ServiceProvider;
IEnumerable<ISubmodelServiceProvider> submodelServiceProviders = null;
var retrievedSubmodelServiceProvider = sp.GetSubmodelServiceProviders();
if (retrievedSubmodelServiceProvider.Success && retrievedSubmodelServiceProvider.Entity != null)
{
submodelServiceProviders = retrievedSubmodelServiceProvider.Entity;
}
IHostingEnvironment hostingEnvironment = Model.HostingEnvironment;
ServerSettings settings = Model.Settings;
string pathToCompanyLogo = settings.Miscellaneous.TryGetValue("CompanyLogo", out string path) ? path : string.Empty;
ViewData["Title"] = "Submodel Repository";
ViewData["ApiRoot"] = "/submodels";
ViewData["CompanyLogo"] = pathToCompanyLogo;
ViewData["ApiType"] = "SubmodelRepository";
ViewData["aasId"] = string.Empty;
}
<div class="starter-template">
<h1>Submodel Repository UI</h1>
<p class="lead">Generic UI to discover the Submodel Repository</p>
</div>
@if (submodelServiceProviders?.Count() > 0)
{
foreach (var submodelServiceProvider in submodelServiceProviders)
{
ISubmodel submodel = submodelServiceProvider.GetBinding();
@await Html.PartialAsync("_Submodel", submodel)
}
}