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>
|
||||
{{ with .Site.Params.copyright }}{{ . | markdownify}}{{ end }}
|
||||
</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>
|
||||
</footer>
|
||||
|
@ -8,20 +8,5 @@
|
||||
<script>
|
||||
hljs.initHighlightingOnLoad();
|
||||
</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>
|
||||
|
@ -5,8 +5,8 @@ var dip = new Vue({
|
||||
|
||||
data () {
|
||||
return {
|
||||
title: "Public IP Address Service",
|
||||
dipjson: {"ip": null, "hostname": null, "city": null, "country": null},
|
||||
dipjson: {"ip": "", "hostname": "", "city": "", "country": ""},
|
||||
returnstring: "",
|
||||
autorefresh: false,
|
||||
interval: null,
|
||||
}
|
||||
@ -22,10 +22,13 @@ var dip = new Vue({
|
||||
axios.get("https://ip.paulbsd.com/json")
|
||||
.then(response => {
|
||||
this.dipjson = response.data;
|
||||
if (this.dipjson.hostname != "") {
|
||||
this.returnstring = this.dipjson.ip + '/' + this.dipjson.hostname;
|
||||
} else {
|
||||
this.returnstring = this.dipjson.ip;
|
||||
}
|
||||
})
|
||||
.catch(err => {
|
||||
// Manage the state of the application if the request
|
||||
// has failed
|
||||
});
|
||||
},
|
||||
runTimer: function () {
|
||||
|
Loading…
Reference in New Issue
Block a user