diff --git a/src/SimpleServicesDashboard.Api/Pages/Dashboard.cshtml.cs b/src/SimpleServicesDashboard.Api/Pages/Dashboard.cshtml.cs
index 9ab65f3..fe5e9ed 100644
--- a/src/SimpleServicesDashboard.Api/Pages/Dashboard.cshtml.cs
+++ b/src/SimpleServicesDashboard.Api/Pages/Dashboard.cshtml.cs
@@ -1,10 +1,10 @@
-using System.Linq;
-using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc.RazorPages;
using Microsoft.Extensions.Options;
using SimpleServicesDashboard.Api.Models;
using SimpleServicesDashboard.Application.Services.Interfaces;
using SimpleServicesDashboard.Common.Configuration;
+using System.Linq;
+using System.Threading.Tasks;
namespace SimpleServicesDashboard.Api.Pages;
@@ -37,12 +37,10 @@ private async Task CollectServicesDetails()
{
var details = await _servicesStatusService.GetServicesStatusAsync();
- var model = new DashboardViewModel();
-
// build the model to prepare the data in the block on the page
var servicesGroup = details.Statuses.GroupBy(x => x.Code);
- model.Services = servicesGroup.Select(x =>
+ var services = servicesGroup.Select(x =>
new ServiceViewModel
{
Code = x.Key,
@@ -61,8 +59,12 @@ private async Task CollectServicesDetails()
}).ToList();
// get environments configuration
- model.Environments = _servicesConfiguration.Environments.ToDictionary(x => x.Code, x => x.Name);
+ var environments = _servicesConfiguration.Environments.ToDictionary(x => x.Code, x => x.Name);
- return model;
+ return new DashboardViewModel
+ {
+ Services = services,
+ Environments = environments
+ };
}
}
\ No newline at end of file
diff --git a/src/SimpleServicesDashboard.Api/Pages/ServiceStatus.cshtml b/src/SimpleServicesDashboard.Api/Pages/ServiceStatus.cshtml
index 91d47d3..5f53201 100644
--- a/src/SimpleServicesDashboard.Api/Pages/ServiceStatus.cshtml
+++ b/src/SimpleServicesDashboard.Api/Pages/ServiceStatus.cshtml
@@ -15,7 +15,8 @@
-
+
+
@@ -25,24 +26,65 @@
Details about specific service. This details comes from the Status endpoint on the service and can be fetched for the each service. Here just to check if the service is working.