dip/static/js/main.js
Paul Lecuq fc4b4cc2e6
All checks were successful
continuous-integration/drone/push Build is passing
added asn, fixed bugs
2022-08-19 20:36:59 +02:00

29 lines
619 B
JavaScript

var vue = new Vue({
el: '#dip_main_div',
data () {
return {
title: "Public IP Address service",
dip: {"ip": null,
"hostname": null,
"city": null,
"country": null},
}
},
mounted () {
var ip = "";
if (window.location.pathname.length > 4) {
ip = window.location.pathname.split("/")[1];
console.log(ip);
}
axios.get(`/json/${ip}`)
.then(response => {
this.dip = response.data
})
.catch(err => {
// Manage the state of the application if the request
// has failed
});
}
});