Add debug
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace JoshHeaps.Net.Controllers;
|
||||
|
||||
[ApiController]
|
||||
[Route("api/[controller]")]
|
||||
public class DebugController : ControllerBase
|
||||
{
|
||||
[HttpGet("IpCheck")]
|
||||
public ActionResult<string> GetIpCheckingStatus()
|
||||
{
|
||||
return Ok(Program.CheckingForIpUpdates.ToString());
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
@@ -11,7 +11,9 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="wwwroot\css\debug\" />
|
||||
<Folder Include="wwwroot\images\Chess Images\" />
|
||||
<Folder Include="wwwroot\images\Game Images\" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
@page
|
||||
@model JoshHeaps.Net.Pages.GameModel
|
||||
@{
|
||||
ViewData["Title"] = "Game";
|
||||
Layout = "_Layout";
|
||||
}
|
||||
|
||||
<div id="IpChecking">
|
||||
<label id="IpCheckingLabel">Is checking for ip updates:</label>
|
||||
<div id="IsIpChecking">...</div>
|
||||
</div>
|
||||
|
||||
@section Scripts {
|
||||
<script src="~/js/Debug/debug.js"></script>
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||
|
||||
namespace JoshHeaps.Net.Pages
|
||||
{
|
||||
public class DebugModel : PageModel
|
||||
{
|
||||
public void OnGet()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,6 +2,15 @@ using JoshHeaps.Net.Hubs;
|
||||
using JoshHeaps.Net.Services.Implementations;
|
||||
using JoshHeaps.Net.Services.Interfaces;
|
||||
|
||||
namespace JoshHeaps.Net;
|
||||
|
||||
// need to declare the class so I can add the public static bool
|
||||
public class Program
|
||||
{
|
||||
public static bool CheckingForIpUpdates { get; private set; } = false;
|
||||
|
||||
public static void Main(string[] args)
|
||||
{
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
|
||||
// Add services to the container.
|
||||
@@ -51,9 +60,11 @@ app.MapControllers();
|
||||
app.MapHub<ChessHub>("/chessHub");
|
||||
|
||||
app.Run();
|
||||
}
|
||||
|
||||
static async Task Run(IConfiguration config)
|
||||
{
|
||||
CheckingForIpUpdates = true;
|
||||
HttpClient httpClient = new();
|
||||
AAAARecord dnsRecord = await GetDnsRecordAsync(config);
|
||||
string lastKnownIp = dnsRecord.content;
|
||||
@@ -146,3 +157,4 @@ static async Task UpdateDnsIpAsync(IConfiguration config, AAAARecord record, str
|
||||
record AAAARecord(string comment, string content, string name, string id);
|
||||
|
||||
record RecordList(List<AAAARecord> result);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user