updated dipjson management
This commit is contained in:
parent
823bf0a613
commit
ca3719a6e5
@ -5,7 +5,7 @@
|
|||||||
© {{ now.Format "2006" }} <a href="https://git.paulbsd.com/paulbsd">paulbsd</a>. <br>
|
© {{ now.Format "2006" }} <a href="https://git.paulbsd.com/paulbsd">paulbsd</a>. <br>
|
||||||
{{ with .Site.Params.copyright }}{{ . | markdownify}}{{ end }}
|
{{ with .Site.Params.copyright }}{{ . | markdownify}}{{ end }}
|
||||||
</footer>
|
</footer>
|
||||||
<footer id="footer-right">Your IP address : <a id="dip">{{ "{{" }} dipjson.ip {{ "}}" }}/{{ "{{" }} dipjson.hostname {{ "}}" }}</a></footer>
|
<footer id="footer-right">Your IP address : <a id="dip">{{ "{{" }} returnstring {{ "}}" }}</a></footer>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
|
@ -8,20 +8,5 @@
|
|||||||
<script>
|
<script>
|
||||||
hljs.initHighlightingOnLoad();
|
hljs.initHighlightingOnLoad();
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<!--
|
|
||||||
{{ "<!-- MathJax -->" | safeHTML }}
|
|
||||||
<script type="text/x-mathjax-config">
|
|
||||||
MathJax.Hub.Config({
|
|
||||||
tex2jax: {
|
|
||||||
inlineMath: [['$','$'], ['\\(','\\)']]}
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
<script src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
|
|
||||||
</script>
|
|
||||||
-->
|
|
||||||
<!--
|
|
||||||
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
|
|
||||||
-->
|
|
||||||
<script type="text/javascript" src="https://raw.githubusercontent.com/jeresig/jquery.hotkeys/master/jquery.hotkeys.js">
|
<script type="text/javascript" src="https://raw.githubusercontent.com/jeresig/jquery.hotkeys/master/jquery.hotkeys.js">
|
||||||
</script>
|
</script>
|
||||||
|
@ -5,8 +5,8 @@ var dip = new Vue({
|
|||||||
|
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
title: "Public IP Address Service",
|
dipjson: {"ip": "", "hostname": "", "city": "", "country": ""},
|
||||||
dipjson: {"ip": null, "hostname": null, "city": null, "country": null},
|
returnstring: "",
|
||||||
autorefresh: false,
|
autorefresh: false,
|
||||||
interval: null,
|
interval: null,
|
||||||
}
|
}
|
||||||
@ -22,10 +22,13 @@ var dip = new Vue({
|
|||||||
axios.get("https://ip.paulbsd.com/json")
|
axios.get("https://ip.paulbsd.com/json")
|
||||||
.then(response => {
|
.then(response => {
|
||||||
this.dipjson = response.data;
|
this.dipjson = response.data;
|
||||||
|
if (this.dipjson.hostname != "") {
|
||||||
|
this.returnstring = this.dipjson.ip + '/' + this.dipjson.hostname;
|
||||||
|
} else {
|
||||||
|
this.returnstring = this.dipjson.ip;
|
||||||
|
}
|
||||||
})
|
})
|
||||||
.catch(err => {
|
.catch(err => {
|
||||||
// Manage the state of the application if the request
|
|
||||||
// has failed
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
runTimer: function () {
|
runTimer: function () {
|
||||||
|
Loading…
Reference in New Issue
Block a user