Merge pull request #6 from JoshHeaps/UpdateParticleSimulatorButton

Update particle simulator button
This commit is contained in:
Josh Heaps
2025-09-19 16:31:17 -06:00
committed by GitHub
2 changed files with 26 additions and 3 deletions
@@ -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<AAAARecord> Result);
record RecordList([property: JsonPropertyName("result")] List<AAAARecord> Result);
}
+16
View File
@@ -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);
}
}