From 10bf9b3d30b97fcb73ab547d6f7629abf50ae799 Mon Sep 17 00:00:00 2001 From: jheaps Date: Fri, 19 Sep 2025 16:09:47 -0600 Subject: [PATCH 1/2] Bring debug.js back (I don't remember killing it) --- JoshHeaps.Net/wwwroot/js/Debug/debug.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 JoshHeaps.Net/wwwroot/js/Debug/debug.js diff --git a/JoshHeaps.Net/wwwroot/js/Debug/debug.js b/JoshHeaps.Net/wwwroot/js/Debug/debug.js new file mode 100644 index 0000000..13e2c18 --- /dev/null +++ b/JoshHeaps.Net/wwwroot/js/Debug/debug.js @@ -0,0 +1,16 @@ +document.addEventListener('DOMContentLoaded', () => { + getIpStatus(); +}); + +async function getIpStatus() { + try { + const res = await fetch(`/api/debug/IpCheck`); + if (!res.ok) throw new Error("API failed"); + + const text = await res.text(); + console.log(text); + document.querySelector('#IsIpChecking').textContent = text; + } catch (err) { + console.error("Error in api:", err); + } +} \ No newline at end of file From b4acdee6e3dbd8da323a82a72855e6e568306bd9 Mon Sep 17 00:00:00 2001 From: jheaps Date: Fri, 19 Sep 2025 16:29:44 -0600 Subject: [PATCH 2/2] Fix auto ip updates --- .../Services/Implementations/AutoIpUpdateService.cs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/JoshHeaps.Net/Services/Implementations/AutoIpUpdateService.cs b/JoshHeaps.Net/Services/Implementations/AutoIpUpdateService.cs index 21bec54..81b2c8d 100644 --- a/JoshHeaps.Net/Services/Implementations/AutoIpUpdateService.cs +++ b/JoshHeaps.Net/Services/Implementations/AutoIpUpdateService.cs @@ -1,4 +1,7 @@ -namespace JoshHeaps.Net.Services.Implementations; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace JoshHeaps.Net.Services.Implementations; public class AutoIpUpdateService( IConfiguration config, @@ -99,7 +102,11 @@ public class AutoIpUpdateService( } } - record AAAARecord(string Comment, string Content, string Name, string Id); + record AAAARecord( + [property: JsonPropertyName("comment")] string Comment, + [property: JsonPropertyName("content")] string Content, + [property: JsonPropertyName("name")] string Name, + [property: JsonPropertyName("id")] string Id); - record RecordList(List Result); + record RecordList([property: JsonPropertyName("result")] List Result); }