From ca3719a6e5f86079cefe17e68c4991a36f01c94a Mon Sep 17 00:00:00 2001 From: Paul Lecuq Date: Sun, 3 May 2020 13:00:08 +0200 Subject: [PATCH] updated dipjson management --- .../hugo-theme-wave/layouts/partials/footer.html | 2 +- .../layouts/partials/footer_js.html | 15 --------------- themes/hugo-theme-wave/static/js/main.js | 11 +++++++---- 3 files changed, 8 insertions(+), 20 deletions(-) diff --git a/themes/hugo-theme-wave/layouts/partials/footer.html b/themes/hugo-theme-wave/layouts/partials/footer.html index a136d52..3eca991 100644 --- a/themes/hugo-theme-wave/layouts/partials/footer.html +++ b/themes/hugo-theme-wave/layouts/partials/footer.html @@ -5,7 +5,7 @@ © {{ now.Format "2006" }} paulbsd.
{{ with .Site.Params.copyright }}{{ . | markdownify}}{{ end }} - + diff --git a/themes/hugo-theme-wave/layouts/partials/footer_js.html b/themes/hugo-theme-wave/layouts/partials/footer_js.html index ece4b0f..0e79d9f 100644 --- a/themes/hugo-theme-wave/layouts/partials/footer_js.html +++ b/themes/hugo-theme-wave/layouts/partials/footer_js.html @@ -8,20 +8,5 @@ - -" | safeHTML }} - - - --> - diff --git a/themes/hugo-theme-wave/static/js/main.js b/themes/hugo-theme-wave/static/js/main.js index 30c7584..32491dd 100644 --- a/themes/hugo-theme-wave/static/js/main.js +++ b/themes/hugo-theme-wave/static/js/main.js @@ -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 () {