From 4705bedc2dea93d6315281a52d758326d570851b Mon Sep 17 00:00:00 2001 From: snyk-bot Date: Sat, 23 Jul 2022 04:25:08 +0000 Subject: [PATCH 1/6] fix: upgrade vue from 2.6.14 to 2.7.0 Snyk has created this PR to upgrade vue from 2.6.14 to 2.7.0. See this package in npm: See this project in Snyk: https://app.snyk.io/org/lissy93/project/564ca11b-8665-48b8-befa-ccd607c3e09a?utm_source=github&utm_medium=referral&page=upgrade-pr --- package.json | 2 +- yarn.lock | 45 +++++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 44 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index c4a71454..54764276 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,7 @@ "simple-icons": "^6.9.0", "v-jsoneditor": "^1.4.5", "v-tooltip": "^2.1.3", - "vue": "^2.6.14", + "vue": "^2.7.0", "vue-i18n": "^8.27.2", "vue-js-modal": "^2.0.1", "vue-json-tree-view": "^2.1.6", diff --git a/yarn.lock b/yarn.lock index d92b3b68..2f2607c0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -372,6 +372,11 @@ resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.18.4.tgz#6774231779dd700e0af29f6ad8d479582d7ce5ef" integrity sha512-FDge0dFazETFcxGw/EXzOkN8uJp0PC7Qbm+Pe9T+av2zlBpOgunFHkQPPn+eRuClU73JF+98D531UgayY89tow== +"@babel/parser@^7.18.4": + version "7.18.9" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.18.9.tgz#f2dde0c682ccc264a9a8595efd030a5cc8fd2539" + integrity sha512-9uJveS9eY9DJ0t64YbIBZICtJy8a5QrDEVdiLCG97fVLpDTpGX7t8mMSb6OWw6Lrnjqj4O8zwjELX3dhoMgiBg== + "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@^7.17.12": version "7.17.12" resolved "https://registry.yarnpkg.com/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression/-/plugin-bugfix-safari-id-destructuring-collision-in-function-expression-7.17.12.tgz#1dca338caaefca368639c9ffb095afbd4d420b1e" @@ -1708,6 +1713,15 @@ semver "^6.1.0" strip-ansi "^6.0.0" +"@vue/compiler-sfc@2.7.8": + version "2.7.8" + resolved "https://registry.yarnpkg.com/@vue/compiler-sfc/-/compiler-sfc-2.7.8.tgz#731aadd6beafdb9c72fd8614ce189ac6cee87612" + integrity sha512-2DK4YWKfgLnW9VDR9gnju1gcYRk3flKj8UNsms7fsRmFcg35slVTZEkqwBtX+wJBXaamFfn6NxSsZh3h12Ix/Q== + dependencies: + "@babel/parser" "^7.18.4" + postcss "^8.4.14" + source-map "^0.6.1" + "@vue/component-compiler-utils@^3.1.0", "@vue/component-compiler-utils@^3.1.2": version "3.3.0" resolved "https://registry.yarnpkg.com/@vue/component-compiler-utils/-/component-compiler-utils-3.3.0.tgz#f9f5fb53464b0c37b2c8d2f3fbfe44df60f61dc9" @@ -3597,6 +3611,11 @@ csso@^4.0.2: dependencies: css-tree "^1.1.2" +csstype@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/csstype/-/csstype-3.1.0.tgz#4ddcac3718d787cf9df0d1b7d15033925c8f29f2" + integrity sha512-uX1KG+x9h5hIJsaKR9xHUeUraxf8IODOwq9JLNPq6BwB04a/xgpq3rcx47l5BZu5zBPlgD342tdke3Hom/nJRA== + cyclist@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/cyclist/-/cyclist-1.0.1.tgz#596e9698fd0c80e12038c2b82d6eb1b35b6224d9" @@ -6895,6 +6914,11 @@ nan@^2.12.1: resolved "https://registry.yarnpkg.com/nan/-/nan-2.16.0.tgz#664f43e45460fb98faf00edca0bb0d7b8dce7916" integrity sha512-UdAqHyFngu7TfQKsCBgAA6pWDkT8MAO7d0jyOecVhN5354xbLqdn8mV9Tat9gepAupm0bt2DbeaSC8vS52MuFA== +nanoid@^3.3.4: + version "3.3.4" + resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.4.tgz#730b67e3cd09e2deacf03c027c81c9d9dbc5e8ab" + integrity sha512-MqBkQh/OHTS2egovRtLk45wEyNXwF+cokD+1YPf9u5VfJiRdAiRwB2froX5Co9Rh20xs4siNPm8naNotSD6RBw== + nanomatch@^1.2.9: version "1.2.13" resolved "https://registry.yarnpkg.com/nanomatch/-/nanomatch-1.2.13.tgz#b87a8aa4fc0de8fe6be88895b38983ff265bd119" @@ -7967,6 +7991,15 @@ postcss@^7.0.0, postcss@^7.0.1, postcss@^7.0.14, postcss@^7.0.27, postcss@^7.0.3 picocolors "^0.2.1" source-map "^0.6.1" +postcss@^8.4.14: + version "8.4.14" + resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.14.tgz#ee9274d5622b4858c1007a74d76e42e56fd21caf" + integrity sha512-E398TUmfAYFPBSdzgeieK2Y1+1cpdxJx8yXbK/m57nRhKSmk1GB2tO4lbLBtlkfPQTDKfe4Xqv1ASWPpayPEig== + dependencies: + nanoid "^3.3.4" + picocolors "^1.0.0" + source-map-js "^1.0.2" + prelude-ls@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396" @@ -8980,7 +9013,7 @@ source-list-map@^2.0.0: resolved "https://registry.yarnpkg.com/source-list-map/-/source-list-map-2.0.1.tgz#3993bd873bfc48479cca9ea3a547835c7c154b34" integrity sha512-qnQ7gVMxGNxsiL4lEuJwe/To8UnK7fAnmbGEEH8RpLouuKbeEm0lhbQVFIrNSuB+G7tVrAlVsZgETT5nljf+Iw== -"source-map-js@>=0.6.2 <2.0.0": +"source-map-js@>=0.6.2 <2.0.0", source-map-js@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-1.0.2.tgz#adbc361d9c62df380125e7f161f71c826f1e490c" integrity sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw== @@ -10090,11 +10123,19 @@ vue-toasted@^1.1.28: resolved "https://registry.yarnpkg.com/vue-toasted/-/vue-toasted-1.1.28.tgz#dbabb83acc89f7a9e8765815e491d79f0dc65c26" integrity sha512-UUzr5LX51UbbiROSGZ49GOgSzFxaMHK6L00JV8fir/CYNJCpIIvNZ5YmS4Qc8Y2+Z/4VVYRpeQL2UO0G800Raw== -vue@^2.5.16, vue@^2.6.14: +vue@^2.5.16: version "2.6.14" resolved "https://registry.yarnpkg.com/vue/-/vue-2.6.14.tgz#e51aa5250250d569a3fbad3a8a5a687d6036e235" integrity sha512-x2284lgYvjOMj3Za7kqzRcUSxBboHqtgRE2zlos1qWaOye5yUmHn42LB1250NJBLRwEcdrB0JRwyPTEPhfQjiQ== +vue@^2.7.0: + version "2.7.8" + resolved "https://registry.yarnpkg.com/vue/-/vue-2.7.8.tgz#34e06553137611d8cecc4b0cd78b7a59f80b1299" + integrity sha512-ncwlZx5qOcn754bCu5/tS/IWPhXHopfit79cx+uIlLMyt3vCMGcXai5yCG5y+I6cDmEj4ukRYyZail9FTQh7lQ== + dependencies: + "@vue/compiler-sfc" "2.7.8" + csstype "^3.1.0" + vuex@^3.6.2: version "3.6.2" resolved "https://registry.yarnpkg.com/vuex/-/vuex-3.6.2.tgz#236bc086a870c3ae79946f107f16de59d5895e71" From b025fdfb580b8930f6eea9d36230ba554af246a1 Mon Sep 17 00:00:00 2001 From: Alicia Sykes Date: Sat, 23 Jul 2022 13:05:45 +0100 Subject: [PATCH 2/6] =?UTF-8?q?=F0=9F=93=9D=20Adds=20troubleshooting=20for?= =?UTF-8?q?=20widget=20inaccurate=20info?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/troubleshooting.md | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/docs/troubleshooting.md b/docs/troubleshooting.md index 2f2419e2..2f863133 100644 --- a/docs/troubleshooting.md +++ b/docs/troubleshooting.md @@ -32,6 +32,7 @@ - [Fixing Widget CORS Errors](#widget-cors-errors) - [Widget Shows Error Incorrectly](#widget-shows-error-incorrectly) - [Weather Forecast Widget 401](#weather-forecast-widget-401) +- [Widget Displaying Inaccurate Data](#widget-displaying-inaccurate-data) - [Font Awesome Icons not Displaying](#font-awesome-icons-not-displaying) - [Copy to Clipboard not Working](#copy-to-clipboard-not-working) - [How to Reset Local Settings](#how-to-reset-local-settings) @@ -447,7 +448,19 @@ Since the forecasting API requires an upgraded plan. ULPT: You can get a free, p A future update will be pushed out, to use a free weather forecasting API. -See also: [#803](https://github.com/Lissy93/dashy/issues/803), [#789](https://github.com/Lissy93/dashy/issues/789), [#577](https://github.com/Lissy93/dashy/issues/577), [#621](https://github.com/Lissy93/dashy/issues/621), [#578](https://github.com/Lissy93/dashy/issues/578) +See also: [#803](https://github.com/Lissy93/dashy/issues/803), [#789](https://github.com/Lissy93/dashy/issues/789), [#577](https://github.com/Lissy93/dashy/issues/577), [#621](https://github.com/Lissy93/dashy/issues/621), [#578](https://github.com/Lissy93/dashy/issues/578), [#806](https://github.com/Lissy93/dashy/discussions/806) + +--- + +## Widget Displaying Inaccurate Data + +If any widget is not displaying the data you expect, first confirm that your config is correct, then try manually calling the API endpoint. + +If the raw API output is correct, yet the widget is rendering incorrect results, then it is likely a bug, and a ticket should be raised. You can start to debug the issue, by looking at the widget's code ([here](https://github.com/Lissy93/dashy/tree/master/src/components/Widgets)), and the browser console + networking tab. + +If the API itself is returning incorrect, incomplete or inaccurate data then an issue needs to be raised **with the API provider** (not Dashy!). You can find the API provider included within the widget docs, or for a full list see the [Privacy Docs](https://github.com/Lissy93/dashy/blob/master/docs/privacy.md#widgets). + +See also: [#807](https://github.com/Lissy93/dashy/issues/807) (re, domain monitor) --- From 57be9d20e24913c3e55920da0dc6305c90827109 Mon Sep 17 00:00:00 2001 From: Alicia Sykes Date: Sat, 23 Jul 2022 14:24:55 +0100 Subject: [PATCH 3/6] =?UTF-8?q?=E2=AC=86=20Updates=20vue=20and=20vue-templ?= =?UTF-8?q?ate-compiler=20to=202.7.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- yarn.lock | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index 54764276..e7a82693 100644 --- a/package.json +++ b/package.json @@ -63,7 +63,7 @@ "sass-loader": "^7.1.0", "vue-cli-plugin-yaml": "^1.0.2", "vue-svg-loader": "^0.16.0", - "vue-template-compiler": "^2.6.14" + "vue-template-compiler": "^2.7.0" }, "engines": { "node": ">=16.0.0" diff --git a/yarn.lock b/yarn.lock index 2f2607c0..3108069a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5258,7 +5258,7 @@ hash.js@^1.0.0, hash.js@^1.0.3: inherits "^2.0.3" minimalistic-assert "^1.0.1" -he@1.2.x, he@^1.1.0: +he@1.2.x, he@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/he/-/he-1.2.0.tgz#84ae65fa7eafb165fddb61566ae14baf05664f0f" integrity sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw== @@ -10105,13 +10105,13 @@ vue-swatches@^2.1.1: resolved "https://registry.yarnpkg.com/vue-swatches/-/vue-swatches-2.1.1.tgz#26c467fb7648ff4ee0887aea36d1e03b15032b83" integrity sha512-YugkNbByxMz1dnx1nZyHSL3VSf/TnBH3/NQD+t8JKxPSqUmX87sVGBxjEaqH5IMraOLfVmU0pHCHl2BfXNypQg== -vue-template-compiler@^2.6.14: - version "2.6.14" - resolved "https://registry.yarnpkg.com/vue-template-compiler/-/vue-template-compiler-2.6.14.tgz#a2f0e7d985670d42c9c9ee0d044fed7690f4f763" - integrity sha512-ODQS1SyMbjKoO1JBJZojSw6FE4qnh9rIpUZn2EUT86FKizx9uH5z6uXiIrm4/Nb/gwxTi/o17ZDEGWAXHvtC7g== +vue-template-compiler@^2.7.0: + version "2.7.8" + resolved "https://registry.yarnpkg.com/vue-template-compiler/-/vue-template-compiler-2.7.8.tgz#eadd54ed8fbff55b7deb07093a976c07f451a1dc" + integrity sha512-eQqdcUpJKJpBRPDdxCNsqUoT0edNvdt1jFjtVnVS/LPPmr0BU2jWzXlrf6BVMeODtdLewB3j8j3WjNiB+V+giw== dependencies: de-indent "^1.0.2" - he "^1.1.0" + he "^1.2.0" vue-template-es2015-compiler@^1.9.0: version "1.9.1" From ad9df7a67cc653caef48f6f2bfd1cb6290c044a0 Mon Sep 17 00:00:00 2001 From: Alicia Sykes Date: Sat, 23 Jul 2022 14:33:23 +0100 Subject: [PATCH 4/6] =?UTF-8?q?=F0=9F=9A=A8=20Fix=20lint=20errors=20in=20G?= =?UTF-8?q?luetun=20widget?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Widgets/GluetunStatus.vue | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/components/Widgets/GluetunStatus.vue b/src/components/Widgets/GluetunStatus.vue index 381265e6..99cd6e06 100644 --- a/src/components/Widgets/GluetunStatus.vue +++ b/src/components/Widgets/GluetunStatus.vue @@ -55,20 +55,20 @@ export default { methods: { /* Make GET request to Gluetun publicip API endpoint */ fetchData() { - this.makeRequest(this.options.hostname + "/v1/publicip/ip").then(this.processData); + this.makeRequest(`${this.options.hostname}/v1/publicip/ip`).then(this.processData); }, /* Assign data variables to the returned data */ processData(ipInfo) { - var fields = this.options.visibleFields.split(","); - this.public_ip = fields.includes("public_ip") ? ipInfo.public_ip : null; - this.country = fields.includes("country") ? ipInfo.country : null; - this.region = fields.includes("region") ? ipInfo.region : null; - this.city = fields.includes("city") ? ipInfo.city : null; - this.location = fields.includes("location") ? ipInfo.location : null; - this.organization = fields.includes("organization") ? ipInfo.organization : null; - this.postal_code = fields.includes("postal_code") ? ipInfo.postal_code : null; - this.timezone = fields.includes("timezone") ? ipInfo.timezone : null; - } + const fields = this.options.visibleFields.split(','); + this.public_ip = fields.includes('public_ip') ? ipInfo.public_ip : null; + this.country = fields.includes('country') ? ipInfo.country : null; + this.region = fields.includes('region') ? ipInfo.region : null; + this.city = fields.includes('city') ? ipInfo.city : null; + this.location = fields.includes('location') ? ipInfo.location : null; + this.organization = fields.includes('organization') ? ipInfo.organization : null; + this.postal_code = fields.includes('postal_code') ? ipInfo.postal_code : null; + this.timezone = fields.includes('timezone') ? ipInfo.timezone : null; + }, }, }; From 37954eaeb097056ec1046386e794c42249ce5fa3 Mon Sep 17 00:00:00 2001 From: Alicia Sykes Date: Sat, 23 Jul 2022 14:42:26 +0100 Subject: [PATCH 5/6] =?UTF-8?q?=F0=9F=A5=85=20Catches=20errors=20if=20caus?= =?UTF-8?q?ed=20by=20undefined=20options?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/widgets.md | 2 +- src/components/Widgets/GluetunStatus.vue | 13 +++++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/docs/widgets.md b/docs/widgets.md index a45a2591..7a31041c 100644 --- a/docs/widgets.md +++ b/docs/widgets.md @@ -1838,7 +1838,7 @@ Display info from the Gluetun VPN container public IP API. This can show the IP **Field** | **Type** | **Required** | **Description** --- | --- | --- | --- -**`visibleFields`** | `string` | Required | A comma separated list of the fields you want visible in the widget. You can have any number of the following : `public_ip`, `region`, `country`, `city`, `location`, `organisation`, `postal_code`, `timezone` +**`visibleFields`** | `string` | Required | A comma separated list of the fields you want visible in the widget. You can have any number of the following : `public_ip`, `region`, `country`, `city`, `location`, `organisation`, `postal_code`, `timezone`. Defaults to just `public_ip` **`host`** | `string` | Required | The url to the gluetun HTTP control server. E.g. `http://gluetun:8000` diff --git a/src/components/Widgets/GluetunStatus.vue b/src/components/Widgets/GluetunStatus.vue index 99cd6e06..3a51c636 100644 --- a/src/components/Widgets/GluetunStatus.vue +++ b/src/components/Widgets/GluetunStatus.vue @@ -52,14 +52,23 @@ export default { timezone: null, }; }, + computed: { + visibleFields() { + return this.options.visibleFields || 'public_ip'; + }, + hostname() { + if (!this.options.hostname) this.error('`hostname` is required'); + return this.options.hostname; + }, + }, methods: { /* Make GET request to Gluetun publicip API endpoint */ fetchData() { - this.makeRequest(`${this.options.hostname}/v1/publicip/ip`).then(this.processData); + this.makeRequest(`${this.hostname}/v1/publicip/ip`).then(this.processData); }, /* Assign data variables to the returned data */ processData(ipInfo) { - const fields = this.options.visibleFields.split(','); + const fields = this.visibleFields.split(','); this.public_ip = fields.includes('public_ip') ? ipInfo.public_ip : null; this.country = fields.includes('country') ? ipInfo.country : null; this.region = fields.includes('region') ? ipInfo.region : null; From ac9d585a17a222377782b4a8fd4075b37a397801 Mon Sep 17 00:00:00 2001 From: Alicia Sykes Date: Sat, 23 Jul 2022 14:50:48 +0100 Subject: [PATCH 6/6] =?UTF-8?q?=F0=9F=92=AC=20Makes=20hard-coded=20text=20?= =?UTF-8?q?translatable?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/assets/locales/en.json | 10 ++++++++++ src/components/Widgets/GluetunStatus.vue | 16 ++++++++-------- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/src/assets/locales/en.json b/src/assets/locales/en.json index efdaf631..404e3da8 100644 --- a/src/assets/locales/en.json +++ b/src/assets/locales/en.json @@ -304,6 +304,16 @@ "up": "Up", "down": "Down" }, + "gluetun-status": { + "vpn-ip": "VPN IP", + "country": "Country", + "region": "Region", + "city": "City", + "post-code": "Post Code", + "location": "Location", + "timezone": "Timezone", + "organization": "Organization" + }, "nextcloud": { "active": "active", "and": "and", diff --git a/src/components/Widgets/GluetunStatus.vue b/src/components/Widgets/GluetunStatus.vue index 3a51c636..c07e96e2 100644 --- a/src/components/Widgets/GluetunStatus.vue +++ b/src/components/Widgets/GluetunStatus.vue @@ -1,35 +1,35 @@