updated website
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-21 23:30:17 +02:00
parent cdc4da40e4
commit a9b0f33d9a
6 changed files with 17 additions and 52 deletions

View File

@ -6,7 +6,7 @@
&copy; {{ now.Format "2006" }} <a href="https://git.paulbsd.com/paulbsd">paulbsd</a>. <br> &copy; {{ 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">{{ "{{" }} returnstring {{ "}}" }}</a></footer> <footer id="footer-right">Your IP address : <a id="dip" target="_blank"></a></footer>
</div> </div>
</div> </div>
<script src="{{ .Site.BaseURL }}/js/main.js"> <script src="{{ .Site.BaseURL }}/js/main.js">

View File

@ -17,8 +17,6 @@
<script src="{{ .Site.BaseURL }}/bower_components/d3/d3.min.js"></script> <script src="{{ .Site.BaseURL }}/bower_components/d3/d3.min.js"></script>
<script src="{{ .Site.BaseURL }}/bower_components/cal-heatmap/cal-heatmap.min.js"></script> <script src="{{ .Site.BaseURL }}/bower_components/cal-heatmap/cal-heatmap.min.js"></script>
<script src="{{ .Site.BaseURL }}/bower_components/highlightjs/highlight.pack.min.js"></script> <script src="{{ .Site.BaseURL }}/bower_components/highlightjs/highlight.pack.min.js"></script>
<script src="{{ .Site.BaseURL }}/bower_components/vue/vue.min.js"></script>
<script src="{{ .Site.BaseURL }}/bower_components/axios/axios.min.js"></script>
<script> <script>
hljs.initHighlightingOnLoad(); hljs.initHighlightingOnLoad();
</script> </script>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,41 +1,18 @@
// dip service // dip service
var dip;
var dip = new Vue({ function get_elements() {
el: '#dip', dip = document.getElementById("dip");
data () {
return {
dipjson: {"ip": "", "hostname": "", "city": "", "country": ""},
returnstring: "",
autorefresh: false,
interval: null,
} }
},
mounted () { function get_ip() {
this.updateIP(); let a = fetch("https://ip.paulbsd.com/json");
this.runTimer(); a.then((resp) => {
}, resp.json().then(js => {
dip.innerHTML = js["ip"];
methods: { dip.href = `https://ip.paulbsd.com/${js["ip"]}`;
updateIP: function () { });
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 => {
}); });
},
runTimer: function () {
if (this.autorefresh) {
this.interval = setInterval(this.updateIP,10000);
} }
}
} get_elements();
} get_ip();
);