fixed bug in js stuff
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing

This commit is contained in:
Paul 2023-07-17 21:12:44 +02:00
parent 9b2e68ae0a
commit f79bc57d83

View File

@ -1,4 +1,5 @@
function main() {
let ip = "";
let dip_ip = document.getElementById("dip_ip");
let dip_hostname = document.getElementById("dip_hostname");
let dip_city = document.getElementById("dip_city");
@ -6,6 +7,10 @@ function main() {
let dip_as_number = document.getElementById("dip_as_number");
let dip_as_org = document.getElementById("dip_as_org");
if (window.location.pathname.length > 4) {
ip = window.location.pathname.split("/")[1];
}
fetch(`/json/${ip}`).then((response) => {
response.json().then((res) => {
dip_ip.innerHTML = res["ip"];