Skip to content

Commit 636a2fd

Browse files
authored
Add files via upload
1 parent 3147769 commit 636a2fd

File tree

83 files changed

+87252
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+87252
-0
lines changed
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
using HTTP_ECGridOS_API_v4._1_.NET_6_ASPNET_Core_MVC.Models;
2+
using HTTP_ECGridOS_API_v4._1_.NET_6_ASPNET_Core_MVC.Services;
3+
4+
using Microsoft.AspNetCore.Mvc;
5+
6+
using System.Diagnostics;
7+
8+
namespace HTTP_ECGridOS_API_v4._1_.NET_6_ASPNET_Core_MVC.Controllers;
9+
public class HomeController : Controller
10+
{
11+
private readonly ILogger<HomeController> _logger;
12+
private readonly IConfiguration _Configuration;
13+
private readonly IECGridOSClient _ECGridOSClient;
14+
private readonly string APIKey = String.Empty;
15+
16+
public HomeController(ILogger<HomeController> logger, IConfiguration Configuration, IECGridOSClient ECGridOSClient)
17+
{
18+
_logger = logger;
19+
_Configuration = Configuration;
20+
_ECGridOSClient = ECGridOSClient;
21+
APIKey = _Configuration["ECGridOS:APIKey"];
22+
}
23+
24+
public async Task<IActionResult> Index()
25+
{
26+
string APIVersion = await _ECGridOSClient.Version();
27+
if (!string.IsNullOrEmpty(APIVersion))
28+
{
29+
ViewData["EGridVersion"] = APIVersion;
30+
}
31+
else
32+
{
33+
ViewData["EGridVersion"] = "No result returned, ECGridOS might not be running.";
34+
}
35+
36+
SessionInfo sessionInfo = await _ECGridOSClient.WhoAmI(APIKey);
37+
38+
return View(sessionInfo);
39+
}
40+
41+
public IActionResult Privacy()
42+
{
43+
return View();
44+
}
45+
46+
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
47+
public IActionResult Error()
48+
{
49+
return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier });
50+
}
51+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<Project Sdk="Microsoft.NET.Sdk.Web">
2+
3+
<PropertyGroup>
4+
<TargetFramework>net6.0</TargetFramework>
5+
<Nullable>enable</Nullable>
6+
<ImplicitUsings>enable</ImplicitUsings>
7+
<RootNamespace>HTTP_ECGridOS_API_v4._1_.NET_6_ASPNET_Core_MVC</RootNamespace>
8+
</PropertyGroup>
9+
10+
<ItemGroup>
11+
<Folder Include="Services\" />
12+
</ItemGroup>
13+
14+
</Project>

0 commit comments

Comments
 (0)