Update code to properly format the AS Tags
This commit is contained in:
@@ -8,15 +8,16 @@ namespace AS1024.CommunityDocumentationPage.Controllers
|
||||
public class HomeController : Controller
|
||||
{
|
||||
private readonly ILogger<HomeController> _logger;
|
||||
private readonly IBgpCommunityDocumentation _documentation;
|
||||
private readonly IBgpCommunity _bgpCommunity;
|
||||
private readonly IConfiguration _configuration;
|
||||
|
||||
public HomeController(ILogger<HomeController> logger,
|
||||
IConfiguration configuration, IBgpCommunityDocumentation documentation)
|
||||
IConfiguration configuration,
|
||||
IBgpCommunity bgpCommunity)
|
||||
{
|
||||
_logger = logger;
|
||||
_configuration = configuration;
|
||||
_documentation = documentation;
|
||||
_bgpCommunity = bgpCommunity;
|
||||
}
|
||||
|
||||
[ResponseCache(Duration = 3600)]
|
||||
@@ -24,11 +25,10 @@ namespace AS1024.CommunityDocumentationPage.Controllers
|
||||
{
|
||||
try
|
||||
{
|
||||
RouteTargets results = await _documentation.GetBgpCommunities();
|
||||
List<Result> filtered = results.Results.Where(b => b.Name.StartsWith(_configuration["ASN"]))
|
||||
.ToList();
|
||||
var result =
|
||||
await _bgpCommunity.GetCommunities();
|
||||
|
||||
return View(filtered);
|
||||
return View(result);
|
||||
} catch (Exception ex)
|
||||
{
|
||||
_logger.LogError($"Failed to obtain data\n{ex}");
|
||||
|
||||
Reference in New Issue
Block a user