From 08a6b46d15e443dbfd04e1f190bdab2edf879cec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20K=C3=B6nig?= Date: Fri, 21 Oct 2022 21:52:42 +0200 Subject: [PATCH 01/23] Require auth for more API endpoints MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Christian König --- api_FTL.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/api_FTL.php b/api_FTL.php index 158ee08bf..f25c514d7 100644 --- a/api_FTL.php +++ b/api_FTL.php @@ -19,7 +19,7 @@ $data['version'] = 3; } -if (isset($_GET['status'])) { +if (isset($_GET['status']) && $auth) { $return = callFTLAPI('stats'); if (array_key_exists('FTLnotrunning', $return)) { $data = array('FTLnotrunning' => true); @@ -32,7 +32,7 @@ } } -if (isset($_GET['summary']) || isset($_GET['summaryRaw']) || !count($_GET)) { +if (isset($_GET['summary']) || isset($_GET['summaryRaw']) || !count($_GET) && $auth) { require_once 'scripts/pi-hole/php/gravity.php'; $return = callFTLAPI('stats'); @@ -77,7 +77,7 @@ } } -if (isset($_GET['overTimeData10mins'])) { +if (isset($_GET['overTimeData10mins']) && $auth) { $return = callFTLAPI('overTime'); if (array_key_exists('FTLnotrunning', $return)) { $data = array('FTLnotrunning' => true); From 97200b8462c93dd26de1e6b6946cbad351a0de6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20K=C3=B6nig?= Date: Thu, 3 Nov 2022 22:37:39 +0100 Subject: [PATCH 02/23] Add missing Parentheses MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Christian König --- api_FTL.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api_FTL.php b/api_FTL.php index f25c514d7..7e7fb1fa2 100644 --- a/api_FTL.php +++ b/api_FTL.php @@ -32,7 +32,7 @@ } } -if (isset($_GET['summary']) || isset($_GET['summaryRaw']) || !count($_GET) && $auth) { +if ((isset($_GET['summary']) || isset($_GET['summaryRaw']) || !count($_GET)) && $auth) { require_once 'scripts/pi-hole/php/gravity.php'; $return = callFTLAPI('stats'); From 90ba0a449d29f4c3a10e98ea4df73882f1c9b081 Mon Sep 17 00:00:00 2001 From: XhmikosR Date: Tue, 15 Nov 2022 09:15:09 +0200 Subject: [PATCH 03/23] Increase small-box footer contrast ratio Contrast ratio is still low, but this should improve things. Generally, it's advised to aim for a contrast ratio of 4.5. Signed-off-by: XhmikosR --- style/pi-hole.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/style/pi-hole.css b/style/pi-hole.css index 40eaaa1df..f43c316e2 100644 --- a/style/pi-hole.css +++ b/style/pi-hole.css @@ -447,7 +447,7 @@ td.lookatme { } .small-box > .small-box-footer { - color: rgba(255, 255, 255, 0.5); + color: rgba(255, 255, 255, 0.75); transition: all 0.5s; } From f841f309a21fe3bc1070b15cd3ff4c2be1687dbe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20K=C3=B6nig?= Date: Thu, 17 Nov 2022 14:29:20 +0100 Subject: [PATCH 04/23] Fix doughnutTooltip if total percentage of shown slices is less than 0.1% MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Christian König --- scripts/pi-hole/js/index.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/pi-hole/js/index.js b/scripts/pi-hole/js/index.js index b9ccf2fe6..430385ae8 100644 --- a/scripts/pi-hole/js/index.js +++ b/scripts/pi-hole/js/index.js @@ -732,7 +732,7 @@ function doughnutTooltip(tooltipLabel) { // in case the item share is really small it could be rounded to 0.0 // we compensate for this var itemPercentage = - tooltipLabel.parsed.toFixed(1) === 0 ? "< 0.1" : tooltipLabel.parsed.toFixed(1); + tooltipLabel.parsed.toFixed(1) === "0.0" ? "< 0.1" : tooltipLabel.parsed.toFixed(1); // even if no doughnut slice is hidden, sometimes percentageTotalShown is slightly less then 100 // we therefore use 99.9 to decide if slices are hidden (we only show with 0.1 precision) @@ -740,6 +740,9 @@ function doughnutTooltip(tooltipLabel) { // All items shown return label + ": " + itemPercentage + "%"; } else { + // set percentageTotalShown again without rounding to account + // for cases where the total shown percentage would be <0.1% of all + percentageTotalShown = tooltipLabel.chart._metasets[0].total; return ( label + ":
• " + From 1edd6223bd4b7c3fa5199e183da230f4d8f31240 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 26 Nov 2022 10:01:43 +0000 Subject: [PATCH 05/23] Bump prettier from 2.7.1 to 2.8.0 Bumps [prettier](https://github.com/prettier/prettier) from 2.7.1 to 2.8.0. - [Release notes](https://github.com/prettier/prettier/releases) - [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md) - [Commits](https://github.com/prettier/prettier/compare/2.7.1...2.8.0) --- updated-dependencies: - dependency-name: prettier dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 16a71929c..d871b8f91 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2808,9 +2808,9 @@ "dev": true }, "prettier": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.7.1.tgz", - "integrity": "sha512-ujppO+MkdPqoVINuDFDRLClm7D78qbDt0/NR+wp5FqEZOoTNAjPHWj17QRhu7geIHJfcNhRk1XVQmF8Bp3ye+g==", + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.0.tgz", + "integrity": "sha512-9Lmg8hTFZKG0Asr/kW9Bp8tJjRVluO8EJQVfY2T7FMw9T5jy4I/Uvx0Rca/XWf50QQ1/SS48+6IJWnrb+2yemA==", "dev": true }, "prettier-linter-helpers": { diff --git a/package.json b/package.json index f4a307a4e..378121d8e 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,7 @@ "eslint-plugin-compat": "^4.0.2", "postcss": "^8.4.19", "postcss-cli": "^10.0.0", - "prettier": "2.7.1", + "prettier": "2.8.0", "xo": "^0.52.4" }, "browserslist": [ From ad468b711bea04f59474540b6430ad64b4cd5ae7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 19 Nov 2022 10:04:12 +0000 Subject: [PATCH 06/23] Bump xo from 0.52.4 to 0.53.0 Bumps [xo](https://github.com/xojs/xo) from 0.52.4 to 0.53.0. - [Release notes](https://github.com/xojs/xo/releases) - [Commits](https://github.com/xojs/xo/compare/v0.52.4...v0.53.0) --- updated-dependencies: - dependency-name: xo dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package-lock.json | 628 +++++++++++++++++++++++++++------------------- package.json | 2 +- 2 files changed, 369 insertions(+), 261 deletions(-) diff --git a/package-lock.json b/package-lock.json index d871b8f91..a6cc2d35c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -48,14 +48,14 @@ } }, "@humanwhocodes/config-array": { - "version": "0.10.7", - "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.10.7.tgz", - "integrity": "sha512-MDl6D6sBsaV452/QSdX+4CXIjZhIcI0PELsxUjk4U828yd58vk3bTIvk/6w5FY+4hIy9sLW0sfrV7K7Kc++j/w==", + "version": "0.11.7", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.7.tgz", + "integrity": "sha512-kBbPWzN8oVMLb0hOUYXhmxggL/1cJE6ydvjDIGi9EnAGUyA7cLVKQg+d/Dsm+KZwx2czGHrCmMVLiyg8s5JPKw==", "dev": true, "requires": { "@humanwhocodes/object-schema": "^1.2.1", "debug": "^4.1.1", - "minimatch": "^3.0.4" + "minimatch": "^3.0.5" } }, "@humanwhocodes/module-importer": { @@ -149,9 +149,9 @@ "dev": true }, "acorn": { - "version": "8.8.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.0.tgz", - "integrity": "sha512-QOxyigPVrpZ2GXT+PFyZTl6TtOFc5egxHIP9IlQ+RbupQuX4RkT/Bee4/kQuC02Xkzg84JcT7oLYtDIQxp+v7w==", + "version": "8.8.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.1.tgz", + "integrity": "sha512-7zFpHzhnqYKrkYdUjF1HI1bzd0VygEGX8lFk4k5zVMqHEoES+P+7TKI+EvLO9WVMJ8eekdO0aDEK044xTXwPPA==", "dev": true }, "acorn-jsx": { @@ -227,33 +227,27 @@ "dev": true }, "array-includes": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.5.tgz", - "integrity": "sha512-iSDYZMMyTPkiFasVqfuAQnWAYcvO/SeBSCGKePoEthjp4LEMTe4uLc7b025o4jAZpHhihh8xPo99TNWUWWkGDQ==", + "version": "3.1.6", + "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.6.tgz", + "integrity": "sha512-sgTbLvL6cNnw24FnbaDyjmvddQ2ML8arZsgaJhoABMoplz/4QRhtrYS+alr1BUM1Bwp6dhx8vVCBSLG+StwOFw==", "dev": true, "requires": { "call-bind": "^1.0.2", "define-properties": "^1.1.4", - "es-abstract": "^1.19.5", - "get-intrinsic": "^1.1.1", + "es-abstract": "^1.20.4", + "get-intrinsic": "^1.1.3", "is-string": "^1.0.7" } }, - "array-union": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", - "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", - "dev": true - }, "array.prototype.flat": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.3.0.tgz", - "integrity": "sha512-12IUEkHsAhA4DY5s0FPgNXIdc8VRSqD9Zp78a5au9abH/SOBrsp082JOWFNTjkMozh8mqcdiKuaLGhPeYztxSw==", + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.3.1.tgz", + "integrity": "sha512-roTU0KWIOmJ4DRLmwKd19Otg0/mT3qPNt0Qb3GWW8iObuZXxrjB/pzn0R3hqpRSWg4HCwqx+0vwOnWnvlOyeIA==", "dev": true, "requires": { "call-bind": "^1.0.2", - "define-properties": "^1.1.3", - "es-abstract": "^1.19.2", + "define-properties": "^1.1.4", + "es-abstract": "^1.20.4", "es-shim-unscopables": "^1.0.0" } }, @@ -402,27 +396,27 @@ "dev": true }, "camelcase": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", - "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-7.0.0.tgz", + "integrity": "sha512-JToIvOmz6nhGsUhAYScbo2d6Py5wojjNfoxoc2mEVLUdJ70gJK2gnd+ABY1Tc3sVMyK7QDPtN0T/XdlCQWITyQ==", "dev": true }, "camelcase-keys": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-7.0.2.tgz", - "integrity": "sha512-Rjs1H+A9R+Ig+4E/9oyB66UC5Mj9Xq3N//vcLf2WzgdTi/3gUu3Z9KoqmlrEG4VuuLK8wJHofxzdQXz/knhiYg==", + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-8.0.2.tgz", + "integrity": "sha512-qMKdlOfsjlezMqxkUGGMaWWs17i2HoL15tM+wtx8ld4nLrUwU58TFdvyGOz/piNP842KeO8yXvggVQSdQ828NA==", "dev": true, "requires": { - "camelcase": "^6.3.0", - "map-obj": "^4.1.0", - "quick-lru": "^5.1.1", - "type-fest": "^1.2.1" + "camelcase": "^7.0.0", + "map-obj": "^4.3.0", + "quick-lru": "^6.1.1", + "type-fest": "^2.13.0" }, "dependencies": { "type-fest": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-1.4.0.tgz", - "integrity": "sha512-yGSza74xk0UG8k+pLh5oeoYirvIiWo5t0/o3zHHAO2tRDiZcxWP7fywNlXhqb6/r6sWvwi+RsyQMWhVLe4BVuA==", + "version": "2.19.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-2.19.0.tgz", + "integrity": "sha512-RAH822pAdBgcNMAfWnCBU3CFZcfZ/i1eZjwFU/dsLKumyuuP3niueg2UAukXYF0E2AAoc82ZSSf9J0WQBinzHA==", "dev": true } } @@ -487,9 +481,9 @@ } }, "ci-info": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.4.0.tgz", - "integrity": "sha512-t5QdPT5jq3o262DOQ8zA6E1tlH2upmUc4Hlvrbx1pGYJuiiHl7O7rvVNI+l8HTVhd/q3Qc9vqimkNk5yiXsAug==", + "version": "3.6.1", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.6.1.tgz", + "integrity": "sha512-up5ggbaDqOqJ4UqLKZ2naVkyqSJQgJi5lwD6b6mM748ysrghDBX0bx/qJTUHzw7zu6Mq4gycviSF5hJnwceD8w==", "dev": true }, "clean-regexp": { @@ -527,10 +521,10 @@ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, - "commondir": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", - "integrity": "sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg==", + "common-path-prefix": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/common-path-prefix/-/common-path-prefix-3.0.0.tgz", + "integrity": "sha512-QE33hToZseCH3jS0qN96O/bSh3kaw/h+Tq7ngyY9eWDUnTlTNUyqfqvCXioLe5Na5jFsL78ra/wuBU4iuEgd4w==", "dev": true }, "concat-map": { @@ -552,9 +546,9 @@ "dev": true }, "cosmiconfig": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-7.0.1.tgz", - "integrity": "sha512-a1YWNUV2HwGimB7dU2s1wUMurNKjpx60HxBB6xUM8Re+2s1g1IIfJvFR0/iCF+XHdE0GMTKTuLR32UQff4TEyQ==", + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-7.1.0.tgz", + "integrity": "sha512-AdmX6xUzdNASswsFtmwSt7Vj8po9IuqXm0UXz7QKPuEUmPB4XyjGfaAr2PSuELMwkRMVH1EpIkX5bTZGRB3eCA==", "dev": true, "requires": { "@types/parse-json": "^4.0.0", @@ -585,15 +579,15 @@ } }, "decamelize": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-5.0.1.tgz", - "integrity": "sha512-VfxadyCECXgQlkoEAjeghAr5gY3Hf+IKjKb+X8tGVDtveCjN+USwprd2q3QXBR9T1+x2DG0XZF5/w+7HAtSaXA==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-6.0.0.tgz", + "integrity": "sha512-Fv96DCsdOgB6mdGl67MT5JaTNKRzrzill5OH5s8bjYJXVlcXyPYGyPsUkWyGV5p1TXI5esYIYMMeDJL0hEIwaA==", "dev": true }, "decamelize-keys": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/decamelize-keys/-/decamelize-keys-1.1.0.tgz", - "integrity": "sha512-ocLWuYzRPoS9bfiSdDd3cxvrzovVMZnRDVEzAs+hWIVXGDbHxWMECij2OBuyB/An0FFW/nLuq6Kv1i/YC5Qfzg==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/decamelize-keys/-/decamelize-keys-1.1.1.tgz", + "integrity": "sha512-WiPxgEirIV0/eIOMcnFBA3/IJZAZqKnwAwWyvvdi4lsr1WCN22nhdf/3db3DoZcUjTV2SqfzIwNyp6y2xs3nmg==", "dev": true, "requires": { "decamelize": "^1.1.0", @@ -772,14 +766,15 @@ "dev": true }, "eslint": { - "version": "8.25.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.25.0.tgz", - "integrity": "sha512-DVlJOZ4Pn50zcKW5bYH7GQK/9MsoQG2d5eDH0ebEkE8PbgzTTmtt/VTH9GGJ4BfeZCpBLqFfvsjX35UacUL83A==", + "version": "8.28.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.28.0.tgz", + "integrity": "sha512-S27Di+EVyMxcHiwDrFzk8dJYAaD+/5SoWKxL1ri/71CRHsnJnRDPNt2Kzj24+MT9FDupf4aqqyqPrvI8MvQ4VQ==", "dev": true, "requires": { "@eslint/eslintrc": "^1.3.3", - "@humanwhocodes/config-array": "^0.10.5", + "@humanwhocodes/config-array": "^0.11.6", "@humanwhocodes/module-importer": "^1.0.1", + "@nodelib/fs.walk": "^1.2.8", "ajv": "^6.10.0", "chalk": "^4.0.0", "cross-spawn": "^7.0.2", @@ -795,14 +790,14 @@ "fast-deep-equal": "^3.1.3", "file-entry-cache": "^6.0.1", "find-up": "^5.0.0", - "glob-parent": "^6.0.1", + "glob-parent": "^6.0.2", "globals": "^13.15.0", - "globby": "^11.1.0", "grapheme-splitter": "^1.0.4", "ignore": "^5.2.0", "import-fresh": "^3.0.0", "imurmurhash": "^0.1.4", "is-glob": "^4.0.0", + "is-path-inside": "^3.0.3", "js-sdsl": "^4.1.4", "js-yaml": "^4.1.0", "json-stable-stringify-without-jsonify": "^1.0.1", @@ -853,32 +848,12 @@ } } }, - "globby": { - "version": "11.1.0", - "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", - "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", - "dev": true, - "requires": { - "array-union": "^2.1.0", - "dir-glob": "^3.0.1", - "fast-glob": "^3.2.9", - "ignore": "^5.2.0", - "merge2": "^1.4.1", - "slash": "^3.0.0" - } - }, "has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true }, - "slash": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", - "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", - "dev": true - }, "strip-ansi": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", @@ -906,9 +881,9 @@ "dev": true }, "eslint-config-xo": { - "version": "0.42.0", - "resolved": "https://registry.npmjs.org/eslint-config-xo/-/eslint-config-xo-0.42.0.tgz", - "integrity": "sha512-HIfd+AM6tHFoaZ/NXYDV3Mr/CJrAj/DoP6IOYt1/v+90XtCwVYOfW7LXbRDYDmhQMzT16h7eqPRcex72waRqdA==", + "version": "0.43.1", + "resolved": "https://registry.npmjs.org/eslint-config-xo/-/eslint-config-xo-0.43.1.tgz", + "integrity": "sha512-azv1L2PysRA0NkZOgbndUpN+581L7wPqkgJOgxxw3hxwXAbJgD6Hqb/SjHRiACifXt/AvxCzE/jIKFAlI7XjvQ==", "dev": true, "requires": { "confusing-browser-globals": "1.0.11" @@ -1168,19 +1143,19 @@ } }, "eslint-plugin-n": { - "version": "15.3.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-n/-/eslint-plugin-n-15.3.0.tgz", - "integrity": "sha512-IyzPnEWHypCWasDpxeJnim60jhlumbmq0pubL6IOcnk8u2y53s5QfT8JnXy7skjHJ44yWHRb11PLtDHuu1kg/Q==", + "version": "15.5.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-n/-/eslint-plugin-n-15.5.1.tgz", + "integrity": "sha512-kAd+xhZm7brHoFLzKLB7/FGRFJNg/srmv67mqb7tto22rpr4wv/LV6RuXzAfv3jbab7+k1wi42PsIhGviywaaw==", "dev": true, "requires": { "builtins": "^5.0.1", "eslint-plugin-es": "^4.1.0", "eslint-utils": "^3.0.0", "ignore": "^5.1.1", - "is-core-module": "^2.10.0", + "is-core-module": "^2.11.0", "minimatch": "^3.1.2", "resolve": "^1.22.1", - "semver": "^7.3.7" + "semver": "^7.3.8" }, "dependencies": { "semver": { @@ -1216,25 +1191,36 @@ } }, "eslint-plugin-unicorn": { - "version": "42.0.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-unicorn/-/eslint-plugin-unicorn-42.0.0.tgz", - "integrity": "sha512-ixBsbhgWuxVaNlPTT8AyfJMlhyC5flCJFjyK3oKE8TRrwBnaHvUbuIkCM1lqg8ryYrFStL/T557zfKzX4GKSlg==", + "version": "44.0.2", + "resolved": "https://registry.npmjs.org/eslint-plugin-unicorn/-/eslint-plugin-unicorn-44.0.2.tgz", + "integrity": "sha512-GLIDX1wmeEqpGaKcnMcqRvMVsoabeF0Ton0EX4Th5u6Kmf7RM9WBl705AXFEsns56ESkEs0uyelLuUTvz9Tr0w==", "dev": true, "requires": { - "@babel/helper-validator-identifier": "^7.15.7", - "ci-info": "^3.3.0", + "@babel/helper-validator-identifier": "^7.19.1", + "ci-info": "^3.4.0", "clean-regexp": "^1.0.0", "eslint-utils": "^3.0.0", "esquery": "^1.4.0", "indent-string": "^4.0.0", - "is-builtin-module": "^3.1.0", + "is-builtin-module": "^3.2.0", "lodash": "^4.17.21", "pluralize": "^8.0.0", "read-pkg-up": "^7.0.1", "regexp-tree": "^0.1.24", "safe-regex": "^2.1.1", - "semver": "^7.3.5", + "semver": "^7.3.7", "strip-indent": "^3.0.0" + }, + "dependencies": { + "semver": { + "version": "7.3.8", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", + "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", + "dev": true, + "requires": { + "lru-cache": "^6.0.0" + } + } } }, "eslint-rule-docs": { @@ -1287,9 +1273,9 @@ } }, "espree": { - "version": "9.4.0", - "resolved": "https://registry.npmjs.org/espree/-/espree-9.4.0.tgz", - "integrity": "sha512-DQmnRpLj7f6TgN/NYb0MTzJXL+vJF9h3pHy4JhCIs3zwcgez8xmGg3sXHcEO97BrmO2OSvCwMdfdlyl+E9KjOw==", + "version": "9.4.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.4.1.tgz", + "integrity": "sha512-XwctdmTO6SIvCzd9810yyNzIrOrqNYV9Koizx4C/mRhf9uq0o4yHoCEU/670pOxOL/MSraektvSAji79kX90Vg==", "dev": true, "requires": { "acorn": "^8.8.0", @@ -1415,61 +1401,72 @@ } }, "find-cache-dir": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-3.3.2.tgz", - "integrity": "sha512-wXZV5emFEjrridIgED11OoUKLxiYjAcqot/NJdAkOhlJ+vGzwhOAfcG5OX1jP+S0PcjEn8bdMJv+g2jwQ3Onig==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-4.0.0.tgz", + "integrity": "sha512-9ZonPT4ZAK4a+1pUPVPZJapbi7O5qbbJPdYw/NOQWZZbVLdDTYM3A4R9z/DpAM08IDaFGsvPgiGZ82WEwUDWjg==", "dev": true, "requires": { - "commondir": "^1.0.1", - "make-dir": "^3.0.2", - "pkg-dir": "^4.1.0" + "common-path-prefix": "^3.0.0", + "pkg-dir": "^7.0.0" }, "dependencies": { "find-up": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", - "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-6.3.0.tgz", + "integrity": "sha512-v2ZsoEuVHYy8ZIlYqwPe/39Cy+cFDzp4dXPaxNvkEuouymu+2Jbz0PxpKarJHYJTmv2HWT3O382qY8l4jMWthw==", "dev": true, "requires": { - "locate-path": "^5.0.0", - "path-exists": "^4.0.0" + "locate-path": "^7.1.0", + "path-exists": "^5.0.0" } }, "locate-path": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", - "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-7.1.1.tgz", + "integrity": "sha512-vJXaRMJgRVD3+cUZs3Mncj2mxpt5mP0EmNOsxRSZRMlbqjvxzDEOIUWXGmavo0ZC9+tNZCBLQ66reA11nbpHZg==", "dev": true, "requires": { - "p-locate": "^4.1.0" + "p-locate": "^6.0.0" } }, "p-limit": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", - "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-4.0.0.tgz", + "integrity": "sha512-5b0R4txpzjPWVw/cXXUResoD4hb6U/x9BH08L7nw+GN1sezDzPdxeRvpc9c433fZhBan/wusjbCsqwqm4EIBIQ==", "dev": true, "requires": { - "p-try": "^2.0.0" + "yocto-queue": "^1.0.0" } }, "p-locate": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", - "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-6.0.0.tgz", + "integrity": "sha512-wPrq66Llhl7/4AGC6I+cqxT07LhXvWL08LNXz1fENOw0Ap4sRZZ/gZpTTJ5jpurzzzfS2W/Ge9BY3LgLjCShcw==", "dev": true, "requires": { - "p-limit": "^2.2.0" + "p-limit": "^4.0.0" } }, + "path-exists": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-5.0.0.tgz", + "integrity": "sha512-RjhtfwJOxzcFmNOi6ltcbcu4Iu+FL3zEj83dk4kAS+fVpTxXLO1b38RvJgT/0QwvV/L3aY9TAnyv0EOqW4GoMQ==", + "dev": true + }, "pkg-dir": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", - "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-7.0.0.tgz", + "integrity": "sha512-Ie9z/WINcxxLp27BKOCHGde4ITq9UklYKDzVo1nhk5sqGEXU3FpkwP5GM2voTGJkGd9B3Otl+Q4uwSOeSUtOBA==", "dev": true, "requires": { - "find-up": "^4.0.0" + "find-up": "^6.3.0" } + }, + "yocto-queue": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-1.0.0.tgz", + "integrity": "sha512-9bnSc/HEW2uRy67wc+T8UwauLuPJVn28jb+GtJY16iiKWyvmYJRXVT4UamsAEGQfPohgr2q4Tq0sQbQlxTfi1g==", + "dev": true } } }, @@ -1628,9 +1625,9 @@ } }, "globals": { - "version": "13.17.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.17.0.tgz", - "integrity": "sha512-1C+6nQRb1GwGMKm2dH/E7enFAMxGTmGI7/dEdhy/DNelv85w9B72t3uc5frtMNXIbzrarJJ/lTCjcaZwbLJmyw==", + "version": "13.18.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.18.0.tgz", + "integrity": "sha512-/mR4KI8Ps2spmoc0Ulu9L7agOF0du1CZNQ3dke8yItYlyKNmGrkONemBbd6V8UTc1Wgcqn21t3WYB7dbRmh6/A==", "dev": true, "requires": { "type-fest": "^0.20.2" @@ -1871,9 +1868,9 @@ "dev": true }, "is-core-module": { - "version": "2.10.0", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.10.0.tgz", - "integrity": "sha512-Erxj2n/LDAZ7H8WNJXd9tw38GYM3dv8rk8Zcs+jJuxYTW7sozH+SS8NtrSjVL1/vpLvWi1hxy96IzjJ3EHTJJg==", + "version": "2.11.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.11.0.tgz", + "integrity": "sha512-RRjxlvLDkD1YJwDbroBHMb+cukurkDWNyHx7D3oNB5x9rb5ogcksMC5wHCadcXoo67gVr/+3GFySh3134zi6rw==", "dev": true, "requires": { "has": "^1.0.3" @@ -1971,6 +1968,12 @@ "obj-props": "^1.0.0" } }, + "is-path-inside": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", + "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", + "dev": true + }, "is-plain-obj": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", @@ -2275,23 +2278,6 @@ "yallist": "^4.0.0" } }, - "make-dir": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", - "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", - "dev": true, - "requires": { - "semver": "^6.0.0" - }, - "dependencies": { - "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true - } - } - }, "map-obj": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-4.3.0.tgz", @@ -2305,73 +2291,174 @@ "dev": true }, "meow": { - "version": "10.1.5", - "resolved": "https://registry.npmjs.org/meow/-/meow-10.1.5.tgz", - "integrity": "sha512-/d+PQ4GKmGvM9Bee/DPa8z3mXs/pkvJE2KEThngVNOqtmljC6K7NMPxtc2JeZYTmpWb9k/TmxjeL18ez3h7vCw==", + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/meow/-/meow-11.0.0.tgz", + "integrity": "sha512-Cl0yeeIrko6d94KpUo1M+0X1sB14ikoaqlIGuTH1fW4I+E3+YljL54/hb/BWmVfrV9tTV9zU04+xjw08Fh2WkA==", "dev": true, "requires": { "@types/minimist": "^1.2.2", - "camelcase-keys": "^7.0.0", - "decamelize": "^5.0.0", + "camelcase-keys": "^8.0.2", + "decamelize": "^6.0.0", "decamelize-keys": "^1.1.0", "hard-rejection": "^2.1.0", "minimist-options": "4.1.0", - "normalize-package-data": "^3.0.2", - "read-pkg-up": "^8.0.0", + "normalize-package-data": "^4.0.1", + "read-pkg-up": "^9.1.0", "redent": "^4.0.0", "trim-newlines": "^4.0.2", - "type-fest": "^1.2.2", - "yargs-parser": "^20.2.9" + "type-fest": "^3.1.0", + "yargs-parser": "^21.1.1" }, "dependencies": { + "find-up": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-6.3.0.tgz", + "integrity": "sha512-v2ZsoEuVHYy8ZIlYqwPe/39Cy+cFDzp4dXPaxNvkEuouymu+2Jbz0PxpKarJHYJTmv2HWT3O382qY8l4jMWthw==", + "dev": true, + "requires": { + "locate-path": "^7.1.0", + "path-exists": "^5.0.0" + } + }, "hosted-git-info": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-4.1.0.tgz", - "integrity": "sha512-kyCuEOWjJqZuDbRHzL8V93NzQhwIB71oFWSyzVo+KPZI+pnQPPxucdkrOZvkLRnrf5URsQM+IJ09Dw29cRALIA==", + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-5.2.1.tgz", + "integrity": "sha512-xIcQYMnhcx2Nr4JTjsFmwwnr9vldugPy9uVm0o87bjqqWMv9GaqsTeT+i99wTl0mk1uLxJtHxLb8kymqTENQsw==", "dev": true, "requires": { - "lru-cache": "^6.0.0" + "lru-cache": "^7.5.1" + } + }, + "locate-path": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-7.1.1.tgz", + "integrity": "sha512-vJXaRMJgRVD3+cUZs3Mncj2mxpt5mP0EmNOsxRSZRMlbqjvxzDEOIUWXGmavo0ZC9+tNZCBLQ66reA11nbpHZg==", + "dev": true, + "requires": { + "p-locate": "^6.0.0" } }, + "lru-cache": { + "version": "7.14.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.14.1.tgz", + "integrity": "sha512-ysxwsnTKdAx96aTRdhDOCQfDgbHnt8SK0KY8SEjO0wHinhWOFTESbjVCMPbU1uGXg/ch4lifqx0wfjOawU2+WA==", + "dev": true + }, "normalize-package-data": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-3.0.3.tgz", - "integrity": "sha512-p2W1sgqij3zMMyRC067Dg16bfzVH+w7hyegmpIvZ4JNjqtGOVAIvLmjBx3yP7YTe9vKJgkoNOPjwQGogDoMXFA==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-4.0.1.tgz", + "integrity": "sha512-EBk5QKKuocMJhB3BILuKhmaPjI8vNRSpIfO9woLC6NyHVkKKdVEdAO1mrT0ZfxNR1lKwCcTkuZfmGIFdizZ8Pg==", "dev": true, "requires": { - "hosted-git-info": "^4.0.1", - "is-core-module": "^2.5.0", - "semver": "^7.3.4", - "validate-npm-package-license": "^3.0.1" + "hosted-git-info": "^5.0.0", + "is-core-module": "^2.8.1", + "semver": "^7.3.5", + "validate-npm-package-license": "^3.0.4" } }, - "read-pkg": { + "p-limit": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-4.0.0.tgz", + "integrity": "sha512-5b0R4txpzjPWVw/cXXUResoD4hb6U/x9BH08L7nw+GN1sezDzPdxeRvpc9c433fZhBan/wusjbCsqwqm4EIBIQ==", + "dev": true, + "requires": { + "yocto-queue": "^1.0.0" + } + }, + "p-locate": { "version": "6.0.0", - "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-6.0.0.tgz", - "integrity": "sha512-X1Fu3dPuk/8ZLsMhEj5f4wFAF0DWoK7qhGJvgaijocXxBmSToKfbFtqbxMO7bVjNA1dmE5huAzjXj/ey86iw9Q==", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-6.0.0.tgz", + "integrity": "sha512-wPrq66Llhl7/4AGC6I+cqxT07LhXvWL08LNXz1fENOw0Ap4sRZZ/gZpTTJ5jpurzzzfS2W/Ge9BY3LgLjCShcw==", + "dev": true, + "requires": { + "p-limit": "^4.0.0" + } + }, + "path-exists": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-5.0.0.tgz", + "integrity": "sha512-RjhtfwJOxzcFmNOi6ltcbcu4Iu+FL3zEj83dk4kAS+fVpTxXLO1b38RvJgT/0QwvV/L3aY9TAnyv0EOqW4GoMQ==", + "dev": true + }, + "read-pkg": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-7.1.0.tgz", + "integrity": "sha512-5iOehe+WF75IccPc30bWTbpdDQLOCc3Uu8bi3Dte3Eueij81yx1Mrufk8qBx/YAbR4uL1FdUr+7BKXDwEtisXg==", "dev": true, "requires": { - "@types/normalize-package-data": "^2.4.0", + "@types/normalize-package-data": "^2.4.1", "normalize-package-data": "^3.0.2", "parse-json": "^5.2.0", - "type-fest": "^1.0.1" + "type-fest": "^2.0.0" + }, + "dependencies": { + "hosted-git-info": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-4.1.0.tgz", + "integrity": "sha512-kyCuEOWjJqZuDbRHzL8V93NzQhwIB71oFWSyzVo+KPZI+pnQPPxucdkrOZvkLRnrf5URsQM+IJ09Dw29cRALIA==", + "dev": true, + "requires": { + "lru-cache": "^6.0.0" + } + }, + "lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "requires": { + "yallist": "^4.0.0" + } + }, + "normalize-package-data": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-3.0.3.tgz", + "integrity": "sha512-p2W1sgqij3zMMyRC067Dg16bfzVH+w7hyegmpIvZ4JNjqtGOVAIvLmjBx3yP7YTe9vKJgkoNOPjwQGogDoMXFA==", + "dev": true, + "requires": { + "hosted-git-info": "^4.0.1", + "is-core-module": "^2.5.0", + "semver": "^7.3.4", + "validate-npm-package-license": "^3.0.1" + } + }, + "type-fest": { + "version": "2.19.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-2.19.0.tgz", + "integrity": "sha512-RAH822pAdBgcNMAfWnCBU3CFZcfZ/i1eZjwFU/dsLKumyuuP3niueg2UAukXYF0E2AAoc82ZSSf9J0WQBinzHA==", + "dev": true + } } }, "read-pkg-up": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-8.0.0.tgz", - "integrity": "sha512-snVCqPczksT0HS2EC+SxUndvSzn6LRCwpfSvLrIfR5BKDQQZMaI6jPRC9dYvYFDRAuFEAnkwww8kBBNE/3VvzQ==", + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-9.1.0.tgz", + "integrity": "sha512-vaMRR1AC1nrd5CQM0PhlRsO5oc2AAigqr7cCrZ/MW/Rsaflz4RlgzkpL4qoU/z1F6wrbd85iFv1OQj/y5RdGvg==", "dev": true, "requires": { - "find-up": "^5.0.0", - "read-pkg": "^6.0.0", - "type-fest": "^1.0.1" + "find-up": "^6.3.0", + "read-pkg": "^7.1.0", + "type-fest": "^2.5.0" + }, + "dependencies": { + "type-fest": { + "version": "2.19.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-2.19.0.tgz", + "integrity": "sha512-RAH822pAdBgcNMAfWnCBU3CFZcfZ/i1eZjwFU/dsLKumyuuP3niueg2UAukXYF0E2AAoc82ZSSf9J0WQBinzHA==", + "dev": true + } } }, "type-fest": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-1.4.0.tgz", - "integrity": "sha512-yGSza74xk0UG8k+pLh5oeoYirvIiWo5t0/o3zHHAO2tRDiZcxWP7fywNlXhqb6/r6sWvwi+RsyQMWhVLe4BVuA==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-3.2.0.tgz", + "integrity": "sha512-Il3wdLRzWvbAEtocgxGQA9YOoRVeVUGOMBtel5LdEpNeEAol6GJTLw8GbX6Z8EIMfvfhoOXs2bwOijtAZdK5og==", + "dev": true + }, + "yocto-queue": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-1.0.0.tgz", + "integrity": "sha512-9bnSc/HEW2uRy67wc+T8UwauLuPJVn28jb+GtJY16iiKWyvmYJRXVT4UamsAEGQfPohgr2q4Tq0sQbQlxTfi1g==", "dev": true } } @@ -2426,9 +2513,9 @@ } }, "minimist": { - "version": "1.2.6", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz", - "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==", + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.7.tgz", + "integrity": "sha512-bzfL1YUZsP41gmu/qjrEk0Q6i2ix/cVeAhbCbqH9u3zYutS1cLg00qhrD0M2MVdCcx4Sc0UpP2eBWo9rotpq6g==", "dev": true }, "minimist-options": { @@ -2546,14 +2633,14 @@ } }, "object.values": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.5.tgz", - "integrity": "sha512-QUZRW0ilQ3PnPpbNtgdNV1PDbEqLIiSFB3l+EnGtBQ/8SUTLj1PZwtQHABZtLgwpJZTSZhuGLOGk57Drx2IvYg==", + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.6.tgz", + "integrity": "sha512-FVVTkD1vENCsAcwNs9k6jea2uHC/X0+JcjG8YA60FN5CMaJmG95wT9jek/xX9nornqGRrBkKtzuAu2wuHpKqvw==", "dev": true, "requires": { "call-bind": "^1.0.2", - "define-properties": "^1.1.3", - "es-abstract": "^1.19.1" + "define-properties": "^1.1.4", + "es-abstract": "^1.20.4" } }, "once": { @@ -2847,9 +2934,9 @@ "dev": true }, "quick-lru": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-5.1.1.tgz", - "integrity": "sha512-WuyALRjWPDGtt/wzJiadO5AXY+8hZ80hVpe6MyivgraREW751X3SbhRvG3eLKOYN+8VEvqLcf3wdnt44Z4S4SA==", + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-6.1.1.tgz", + "integrity": "sha512-S27GBT+F0NTRiehtbrgaSE1idUAJ5bX8dPAQTdylEyNlrdcH5X4Lz7Edz3DYzecbsCluD5zO8ZNEe04z3D3u6Q==", "dev": true }, "read-cache": { @@ -3160,25 +3247,25 @@ } }, "string.prototype.trimend": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.5.tgz", - "integrity": "sha512-I7RGvmjV4pJ7O3kdf+LXFpVfdNOxtCW/2C8f6jNiW4+PQchwxkCDzlk1/7p+Wl4bqFIZeF47qAHXLuHHWKAxog==", + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.6.tgz", + "integrity": "sha512-JySq+4mrPf9EsDBEDYMOb/lM7XQLulwg5R/m1r0PXEFqrV0qHvl58sdTilSXtKOflCsK2E8jxf+GKC0T07RWwQ==", "dev": true, "requires": { "call-bind": "^1.0.2", "define-properties": "^1.1.4", - "es-abstract": "^1.19.5" + "es-abstract": "^1.20.4" } }, "string.prototype.trimstart": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.5.tgz", - "integrity": "sha512-THx16TJCGlsN0o6dl2o6ncWUsdgnLRSA23rRE5pyGBw/mLr3Ej/R2LaqCtgP8VNMGZsvMWnf9ooZPyY2bHvUFg==", + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.6.tgz", + "integrity": "sha512-omqjMDaY92pbn5HOX7f9IccLA+U1tA9GvtU4JrodiXFfYB7jPzzHpRzpglLAjtUV6bB557zwClJezTqnAiYnQA==", "dev": true, "requires": { "call-bind": "^1.0.2", "define-properties": "^1.1.4", - "es-abstract": "^1.19.5" + "es-abstract": "^1.20.4" } }, "strip-ansi": { @@ -3341,9 +3428,9 @@ "dev": true }, "typescript": { - "version": "4.8.4", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.8.4.tgz", - "integrity": "sha512-QCh+85mCy+h0IGff8r5XWzOVSbBO+KfeYrMQh7NJ58QujwcE22u+NUSmUxqF+un70P9GXKxa2HCNiTTMJknyjQ==", + "version": "4.9.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.3.tgz", + "integrity": "sha512-CIfGzTelbKNEnLpLdGFgdyKhG23CKdKgQPOBc+OUNrkJ2vr+KSzsSV5kq5iWhEQbok+quxgGzrAtGWCyU7tHnA==", "dev": true }, "unbox-primitive": { @@ -3451,47 +3538,47 @@ "dev": true }, "xo": { - "version": "0.52.4", - "resolved": "https://registry.npmjs.org/xo/-/xo-0.52.4.tgz", - "integrity": "sha512-5K+2bSy+nPO1fE6TS5KydgqhZ5pyXvO1P6Rw98aflxHi2LFWoShLmDpJOCxSpIP5867LVOCdH/WO+7iXk6/WVQ==", + "version": "0.53.0", + "resolved": "https://registry.npmjs.org/xo/-/xo-0.53.0.tgz", + "integrity": "sha512-sWLhl4IwuZ1Q8vza6qW3rEExEh1dFRYShW4iwsiHu6RxrRJtkUxP8TJZortF+kbi5fF7eloPMYXG8pYQZHdDQg==", "dev": true, "requires": { - "@eslint/eslintrc": "^1.3.0", - "@typescript-eslint/eslint-plugin": "*", - "@typescript-eslint/parser": "*", + "@eslint/eslintrc": "^1.3.3", + "@typescript-eslint/eslint-plugin": "^5.43.0", + "@typescript-eslint/parser": "^5.43.0", "arrify": "^3.0.0", - "cosmiconfig": "^7.0.1", + "cosmiconfig": "^7.1.0", "define-lazy-prop": "^3.0.0", - "eslint": "^8.22.0", + "eslint": "^8.27.0", "eslint-config-prettier": "^8.5.0", - "eslint-config-xo": "^0.42.0", - "eslint-config-xo-typescript": "*", + "eslint-config-xo": "^0.43.1", + "eslint-config-xo-typescript": "^0.55.0", "eslint-formatter-pretty": "^4.1.0", "eslint-import-resolver-webpack": "^0.13.2", "eslint-plugin-ava": "^13.2.0", "eslint-plugin-eslint-comments": "^3.2.0", "eslint-plugin-import": "^2.26.0", - "eslint-plugin-n": "^15.2.5", + "eslint-plugin-n": "^15.5.1", "eslint-plugin-no-use-extend-native": "^0.5.0", - "eslint-plugin-prettier": "^4.0.0", - "eslint-plugin-unicorn": "^42.0.0", + "eslint-plugin-prettier": "^4.2.1", + "eslint-plugin-unicorn": "^44.0.2", "esm-utils": "^4.1.0", - "find-cache-dir": "^3.3.2", + "find-cache-dir": "^4.0.0", "find-up": "^6.3.0", "get-stdin": "^9.0.0", - "globby": "^13.1.1", + "globby": "^13.1.2", "imurmurhash": "^0.1.4", "json-stable-stringify-without-jsonify": "^1.0.1", "json5": "^2.2.1", "lodash-es": "^4.17.21", - "meow": "^10.1.2", + "meow": "^11.0.0", "micromatch": "^4.0.5", "open-editor": "^4.0.0", - "prettier": "^2.6.2", - "semver": "^7.3.7", - "slash": "^4.0.0", + "prettier": "^2.7.1", + "semver": "^7.3.8", + "slash": "^5.0.0", "to-absolute-glob": "^2.0.2", - "typescript": "^4.7.3" + "typescript": "^4.9.3" }, "dependencies": { "@nodelib/fs.scandir": { @@ -3522,64 +3609,70 @@ "bundled": true, "dev": true }, + "@types/semver": { + "version": "7.3.13", + "bundled": true, + "dev": true + }, "@typescript-eslint/eslint-plugin": { - "version": "5.39.0", + "version": "5.43.0", "bundled": true, "dev": true, "requires": { - "@typescript-eslint/scope-manager": "5.39.0", - "@typescript-eslint/type-utils": "5.39.0", - "@typescript-eslint/utils": "5.39.0", + "@typescript-eslint/scope-manager": "5.43.0", + "@typescript-eslint/type-utils": "5.43.0", + "@typescript-eslint/utils": "5.43.0", "debug": "^4.3.4", "ignore": "^5.2.0", + "natural-compare-lite": "^1.4.0", "regexpp": "^3.2.0", "semver": "^7.3.7", "tsutils": "^3.21.0" } }, "@typescript-eslint/parser": { - "version": "5.39.0", + "version": "5.43.0", "bundled": true, "dev": true, "requires": { - "@typescript-eslint/scope-manager": "5.39.0", - "@typescript-eslint/types": "5.39.0", - "@typescript-eslint/typescript-estree": "5.39.0", + "@typescript-eslint/scope-manager": "5.43.0", + "@typescript-eslint/types": "5.43.0", + "@typescript-eslint/typescript-estree": "5.43.0", "debug": "^4.3.4" } }, "@typescript-eslint/scope-manager": { - "version": "5.39.0", + "version": "5.43.0", "bundled": true, "dev": true, "requires": { - "@typescript-eslint/types": "5.39.0", - "@typescript-eslint/visitor-keys": "5.39.0" + "@typescript-eslint/types": "5.43.0", + "@typescript-eslint/visitor-keys": "5.43.0" } }, "@typescript-eslint/type-utils": { - "version": "5.39.0", + "version": "5.43.0", "bundled": true, "dev": true, "requires": { - "@typescript-eslint/typescript-estree": "5.39.0", - "@typescript-eslint/utils": "5.39.0", + "@typescript-eslint/typescript-estree": "5.43.0", + "@typescript-eslint/utils": "5.43.0", "debug": "^4.3.4", "tsutils": "^3.21.0" } }, "@typescript-eslint/types": { - "version": "5.39.0", + "version": "5.43.0", "bundled": true, "dev": true }, "@typescript-eslint/typescript-estree": { - "version": "5.39.0", + "version": "5.43.0", "bundled": true, "dev": true, "requires": { - "@typescript-eslint/types": "5.39.0", - "@typescript-eslint/visitor-keys": "5.39.0", + "@typescript-eslint/types": "5.43.0", + "@typescript-eslint/visitor-keys": "5.43.0", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", @@ -3608,24 +3701,26 @@ } }, "@typescript-eslint/utils": { - "version": "5.39.0", + "version": "5.43.0", "bundled": true, "dev": true, "requires": { "@types/json-schema": "^7.0.9", - "@typescript-eslint/scope-manager": "5.39.0", - "@typescript-eslint/types": "5.39.0", - "@typescript-eslint/typescript-estree": "5.39.0", + "@types/semver": "^7.3.12", + "@typescript-eslint/scope-manager": "5.43.0", + "@typescript-eslint/types": "5.43.0", + "@typescript-eslint/typescript-estree": "5.43.0", "eslint-scope": "^5.1.1", - "eslint-utils": "^3.0.0" + "eslint-utils": "^3.0.0", + "semver": "^7.3.7" } }, "@typescript-eslint/visitor-keys": { - "version": "5.39.0", + "version": "5.43.0", "bundled": true, "dev": true, "requires": { - "@typescript-eslint/types": "5.39.0", + "@typescript-eslint/types": "5.43.0", "eslint-visitor-keys": "^3.3.0" } }, @@ -3666,7 +3761,7 @@ } }, "eslint-config-xo-typescript": { - "version": "0.53.0", + "version": "0.55.0", "bundled": true, "dev": true }, @@ -3797,14 +3892,6 @@ "p-locate": "^6.0.0" } }, - "lru-cache": { - "version": "6.0.0", - "bundled": true, - "dev": true, - "requires": { - "yallist": "^4.0.0" - } - }, "merge2": { "version": "1.4.1", "bundled": true, @@ -3819,6 +3906,11 @@ "picomatch": "^2.3.1" } }, + "natural-compare-lite": { + "version": "1.4.0", + "bundled": true, + "dev": true + }, "p-limit": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-4.0.0.tgz", @@ -3877,13 +3969,29 @@ } }, "semver": { - "version": "7.3.7", + "version": "7.3.8", "bundled": true, "dev": true, "requires": { "lru-cache": "^6.0.0" + }, + "dependencies": { + "lru-cache": { + "version": "6.0.0", + "bundled": true, + "dev": true, + "requires": { + "yallist": "^4.0.0" + } + } } }, + "slash": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-5.0.0.tgz", + "integrity": "sha512-n6KkmvKS0623igEVj3FF0OZs1gYYJ0o0Hj939yc1fyxl2xt+xYpLnzJB6xBSqOfV9ZFLEWodBBN/heZJahuIJQ==", + "dev": true + }, "to-regex-range": { "version": "5.0.1", "bundled": true, @@ -3980,9 +4088,9 @@ } }, "yargs-parser": { - "version": "20.2.9", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", - "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", "dev": true }, "yocto-queue": { diff --git a/package.json b/package.json index 378121d8e..9474c7662 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,7 @@ "postcss": "^8.4.19", "postcss-cli": "^10.0.0", "prettier": "2.8.0", - "xo": "^0.52.4" + "xo": "^0.53.0" }, "browserslist": [ "defaults", From 7a9cf91def2ef92c1b66dbc6a0a138f497fea0b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20K=C3=B6nig?= Date: Sun, 20 Nov 2022 11:29:30 +0100 Subject: [PATCH 07/23] Use xo 0.53.0 and fix errors MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Christian König --- scripts/pi-hole/js/db_queries.js | 94 +++++++++++++++++++------- scripts/pi-hole/js/footer.js | 21 ++++-- scripts/pi-hole/js/groups-adlists.js | 56 +++++++++++----- scripts/pi-hole/js/groups-clients.js | 11 +++- scripts/pi-hole/js/groups-domains.js | 23 +++++-- scripts/pi-hole/js/groups.js | 15 +++-- scripts/pi-hole/js/index.js | 45 +++++++++---- scripts/pi-hole/js/messages.js | 33 ++++++---- scripts/pi-hole/js/queries.js | 99 ++++++++++++++++++++-------- scripts/pi-hole/js/utils.js | 20 ++++-- 10 files changed, 303 insertions(+), 114 deletions(-) diff --git a/scripts/pi-hole/js/db_queries.js b/scripts/pi-hole/js/db_queries.js index efa85074f..3feafb85b 100644 --- a/scripts/pi-hole/js/db_queries.js +++ b/scripts/pi-hole/js/db_queries.js @@ -233,24 +233,35 @@ $(function () { var replyid = parseInt(data[6], 10); var dnssecStatus; switch (data[8]) { - case 1: + case 1: { dnssecStatus = '
SECURE'; break; - case 2: + } + + case 2: { dnssecStatus = '
INSECURE'; break; - case 3: + } + + case 3: { dnssecStatus = '
BOGUS'; break; - case 4: + } + + case 4: { dnssecStatus = '
ABANDONED'; break; - case 5: + } + + case 5: { dnssecStatus = '
UNKNOWN'; break; - default: + } + + default: { // No DNSSEC dnssecStatus = ""; + } } if (dnssecStatus.length > 0) { @@ -262,13 +273,15 @@ $(function () { buttontext = "", blocked = false; switch (data[4]) { - case 1: + case 1: { fieldtext = "Blocked (gravity)"; buttontext = ''; blocked = true; break; - case 2: + } + + case 2: { fieldtext = replyid === 0 ? "OK (sent to " @@ -277,91 +290,124 @@ $(function () { buttontext = ''; break; - case 3: + } + + case 3: { fieldtext = "OK (cache)" + dnssecStatus; buttontext = ''; break; - case 4: + } + + case 4: { fieldtext = "Blocked (regex blacklist)"; buttontext = ''; blocked = true; break; - case 5: + } + + case 5: { fieldtext = "Blocked (exact blacklist)"; buttontext = ''; blocked = true; break; - case 6: + } + + case 6: { fieldtext = "Blocked (external, IP)"; blocked = true; break; - case 7: + } + + case 7: { fieldtext = "Blocked (external, NULL)"; blocked = true; break; - case 8: + } + + case 8: { fieldtext = "Blocked (external, NXRA)"; blocked = true; break; - case 9: + } + + case 9: { fieldtext = "Blocked (gravity, CNAME)"; buttontext = ''; blocked = true; break; - case 10: + } + + case 10: { fieldtext = "Blocked (regex blacklist, CNAME)"; buttontext = ''; blocked = true; break; - case 11: + } + + case 11: { fieldtext = "Blocked (exact blacklist, CNAME)"; buttontext = ''; blocked = true; break; - case 12: + } + + case 12: { fieldtext = "Retried"; break; - case 13: + } + + case 13: { fieldtext = "Retried (ignored)"; break; - case 14: + } + + case 14: { fieldtext = "OK (already forwarded)" + dnssecStatus; buttontext = ''; break; - case 15: + } + + case 15: { fieldtext = "Blocked (database is busy)"; blocked = true; break; - case 16: + } + + case 16: { fieldtext = "Blocked (special domain)"; blocked = true; break; - case 17: + } + + case 17: { fieldtext = "OK (stale cache)" + dnssecStatus; buttontext = ''; break; - default: + } + + default: { fieldtext = "Unknown (" + parseInt(data[4], 10) + ")"; + } } // Cannot block internal queries of this type diff --git a/scripts/pi-hole/js/footer.js b/scripts/pi-hole/js/footer.js index 73ab2107b..fc4836fbf 100644 --- a/scripts/pi-hole/js/footer.js +++ b/scripts/pi-hole/js/footer.js @@ -23,18 +23,20 @@ function piholeChanged(action) { var dis = $("#pihole-disable"); switch (action) { - case "enabled": + case "enabled": { status.html(" Active"); ena.hide(); dis.show(); dis.removeClass("active"); break; + } - case "disabled": + case "disabled": { status.html(" Blocking disabled"); ena.show(); dis.hide(); break; + } default: // nothing @@ -71,7 +73,7 @@ function piholeChange(action, duration) { var btnStatus; switch (action) { - case "enable": + case "enable": { btnStatus = $("#flip-status-enable"); btnStatus.html(" "); $.getJSON("api.php?enable&token=" + token, function (data) { @@ -81,8 +83,9 @@ function piholeChange(action, duration) { } }); break; + } - case "disable": + case "disable": { btnStatus = $("#flip-status-disable"); btnStatus.html(" "); $.getJSON("api.php?disable=" + duration + "&token=" + token, function (data) { @@ -96,6 +99,7 @@ function piholeChange(action, duration) { } }); break; + } default: // nothing @@ -168,19 +172,22 @@ function initCPUtemp() { var displaytemp = $("#tempdisplay"); if (!isNaN(temperature)) { switch (unit) { - case "K": + case "K": { temperature += 273.15; displaytemp.html(temperature.toFixed(1) + " K"); break; + } - case "F": + case "F": { temperature = (temperature * 9) / 5 + 32; displaytemp.html(temperature.toFixed(1) + " °F"); break; + } - default: + default: { displaytemp.html(temperature.toFixed(1) + " °C"); break; + } } } } diff --git a/scripts/pi-hole/js/groups-adlists.js b/scripts/pi-hole/js/groups-adlists.js index e8e9cb2c5..06c4d5a39 100644 --- a/scripts/pi-hole/js/groups-adlists.js +++ b/scripts/pi-hole/js/groups-adlists.js @@ -44,34 +44,44 @@ function format(data) { var numbers = true; if (data.status !== null) { switch (parseInt(data.status, 10)) { - case 0: + case 0: { statusText = data.enabled === 0 ? "List is disabled and not checked" : "List was not downloaded so far"; numbers = false; break; - case 1: + } + + case 1: { statusText = 'List download was successful (OK)'; break; - case 2: + } + + case 2: { statusText = 'List unchanged upstream, Pi-hole used a local copy (OK)'; break; - case 3: + } + + case 3: { statusText = 'List unavailable, Pi-hole used a local copy (check list)'; break; - case 4: + } + + case 4: { statusText = 'List unavailable, there is no local copy of this list available on your Pi-hole (replace list)'; numbers = false; break; + } - default: + default: { statusText = 'Unknown (' + parseInt(data.status, 10) + ")"; break; + } } } @@ -168,21 +178,30 @@ function initTable() { } switch (statusCode) { - case 1: + case 1: { statusIcon = "fa-check"; break; - case 2: + } + + case 2: { statusIcon = "fa-history"; break; - case 3: + } + + case 3: { statusIcon = "fa-exclamation-circle"; break; - case 4: + } + + case 4: { statusIcon = "fa-times"; break; - default: + } + + default: { statusIcon = "fa-question-circle"; break; + } } // Append red exclamation-triangle when there are invalid lines on the list @@ -567,7 +586,7 @@ function editAdlist() { var done = "edited"; var notDone = "editing"; switch (elem) { - case "status_" + id: + case "status_" + id: { if (status === 0) { done = "disabled"; notDone = "disabling"; @@ -577,17 +596,24 @@ function editAdlist() { } break; - case "comment_" + id: + } + + case "comment_" + id: { done = "edited comment of"; notDone = "editing comment of"; break; - case "multiselect_" + id: + } + + case "multiselect_" + id: { done = "edited groups of"; notDone = "editing groups of"; break; - default: + } + + default: { alert("bad element or invalid data-id!"); return; + } } utils.disableAll(); diff --git a/scripts/pi-hole/js/groups-clients.js b/scripts/pi-hole/js/groups-clients.js index ec77bc61d..52c12391e 100644 --- a/scripts/pi-hole/js/groups-clients.js +++ b/scripts/pi-hole/js/groups-clients.js @@ -467,17 +467,22 @@ function editClient() { var done = "edited"; var notDone = "editing"; switch (elem) { - case "multiselect_" + id: + case "multiselect_" + id: { done = "edited groups of"; notDone = "editing groups of"; break; - case "comment_" + id: + } + + case "comment_" + id: { done = "edited comment of"; notDone = "editing comment of"; break; - default: + } + + default: { alert("bad element or invalid data-id!"); return; + } } if (name.length > 0) { diff --git a/scripts/pi-hole/js/groups-domains.js b/scripts/pi-hole/js/groups-domains.js index f1228dd53..c681a6f6b 100644 --- a/scripts/pi-hole/js/groups-domains.js +++ b/scripts/pi-hole/js/groups-domains.js @@ -596,7 +596,7 @@ function editDomain() { var done = "edited"; var notDone = "editing"; switch (elem) { - case "status_" + id: + case "status_" + id: { if (status === 0) { done = "disabled"; notDone = "disabling"; @@ -606,25 +606,36 @@ function editDomain() { } break; - case "name_" + id: + } + + case "name_" + id: { done = "edited name of"; notDone = "editing name of"; break; - case "comment_" + id: + } + + case "comment_" + id: { done = "edited comment of"; notDone = "editing comment of"; break; - case "type_" + id: + } + + case "type_" + id: { done = "edited type of"; notDone = "editing type of"; break; - case "multiselect_" + id: + } + + case "multiselect_" + id: { done = "edited groups of"; notDone = "editing groups of"; break; - default: + } + + default: { alert("bad element or invalid data-id!"); return; + } } utils.disableAll(); diff --git a/scripts/pi-hole/js/groups.js b/scripts/pi-hole/js/groups.js index 8f21d460d..27d5a4936 100644 --- a/scripts/pi-hole/js/groups.js +++ b/scripts/pi-hole/js/groups.js @@ -312,7 +312,7 @@ function editGroup() { var done = "edited"; var notDone = "editing"; switch (elem) { - case "status_" + id: + case "status_" + id: { if (status === 0) { done = "disabled"; notDone = "disabling"; @@ -322,17 +322,24 @@ function editGroup() { } break; - case "name_" + id: + } + + case "name_" + id: { done = "edited name of"; notDone = "editing name of"; break; - case "desc_" + id: + } + + case "desc_" + id: { done = "edited description of"; notDone = "editing description of"; break; - default: + } + + default: { alert("bad element or invalid data-id!"); return; + } } utils.disableAll(); diff --git a/scripts/pi-hole/js/index.js b/scripts/pi-hole/js/index.js index 430385ae8..f079c567a 100644 --- a/scripts/pi-hole/js/index.js +++ b/scripts/pi-hole/js/index.js @@ -123,7 +123,7 @@ var customTooltips = function (context) { tooltipX = offsetX + caretX; if (tooltip.yAlign === "top" || tooltip.yAlign === "bottom") { switch (tooltip.xAlign) { - case "center": + case "center": { // set a minimal X position to 5px to prevent // the tooltip to stick out left of the viewport var minX = 5; @@ -135,30 +135,44 @@ var customTooltips = function (context) { } break; - case "left": + } + + case "left": { tooltipX -= arrowMinIndent; arrowX = arrowMinIndent; break; - case "right": + } + + case "right": { tooltipX -= tooltipWidth - arrowMinIndent; arrowX = tooltipWidth - arrowMinIndent; break; - default: + } + + default: { break; + } } } else if (tooltip.yAlign === "center") { switch (tooltip.xAlign) { - case "left": + case "left": { tooltipX += caretPadding; break; - case "right": + } + + case "right": { tooltipX -= tooltipWidth - caretPadding; break; - case "center": + } + + case "center": { tooltipX -= tooltipWidth / 2; break; - default: + } + + default: { break; + } } } } else { @@ -179,10 +193,12 @@ var customTooltips = function (context) { // Compute Y position switch (tooltip.yAlign) { - case "top": + case "top": { tooltipY = offsetY + caretY + arrowSize + caretPadding; break; - case "center": + } + + case "center": { tooltipY = offsetY + caretY - tooltipHeight / 2; if (tooltip.xAlign === "left") { tooltipX += arrowSize; @@ -191,11 +207,16 @@ var customTooltips = function (context) { } break; - case "bottom": + } + + case "bottom": { tooltipY = offsetY + caretY - tooltipHeight - arrowSize - caretPadding; break; - default: + } + + default: { break; + } } // Position tooltip and display diff --git a/scripts/pi-hole/js/messages.js b/scripts/pi-hole/js/messages.js index a480d550c..ceb755437 100644 --- a/scripts/pi-hole/js/messages.js +++ b/scripts/pi-hole/js/messages.js @@ -26,7 +26,7 @@ function multiline(input) { function renderMessage(data, type, row) { // Display and search content switch (row.type) { - case "REGEX": + case "REGEX": { return ( 'Encountered an error when processing " ); + } - case "SUBNET": + case "SUBNET": { return ( "Client " + row.message + @@ -56,8 +57,9 @@ function renderMessage(data, type, row) { row.blob4 + " to get the group configuration for this client." ); + } - case "HOSTNAME": + case "HOSTNAME": { // eslint-disable-next-line unicorn/no-new-array var hint = new Array(row.blob2 + row.message.length + 3).join(" "); return ( @@ -73,11 +75,13 @@ function renderMessage(data, type, row) { hint + "↑" ); + } - case "DNSMASQ_CONFIG": + case "DNSMASQ_CONFIG": { return "FTL failed to start due to " + row.message; + } - case "RATE_LIMIT": + case "RATE_LIMIT": { return ( "Client " + row.message + @@ -87,15 +91,17 @@ function renderMessage(data, type, row) { parseInt(row.blob2, 10) + " seconds)" ); + } - case "DNSMASQ_WARN": + case "DNSMASQ_WARN": { return ( "Warning in dnsmasq core:
" +
         row.message +
         '
Check out
our documentation for further information.' ); + } - case "LOAD": + case "LOAD": { return ( "Long-term load (15min avg) larger than number of processors: " + parseFloat(row.blob1).toFixed(1) + @@ -103,8 +109,9 @@ function renderMessage(data, type, row) { parseInt(row.blob2, 10) + "
This may slow down DNS resolution and can cause bottlenecks." ); + } - case "SHMEM": + case "SHMEM": { return ( "RAM shortage (" + utils.escapeHtml(row.message) + @@ -114,8 +121,9 @@ function renderMessage(data, type, row) { utils.escapeHtml(row.blob2) + "" ); + } - case "DISK": + case "DISK": { return ( "Disk shortage (" + utils.escapeHtml(row.message) + @@ -125,8 +133,9 @@ function renderMessage(data, type, row) { utils.escapeHtml(row.blob2) + "" ); + } - case "ADLIST": + case "ADLIST": { return ( '" ); + } - default: + default: { return "Unknown message type
" + JSON.stringify(row) + "
"; + } } } diff --git a/scripts/pi-hole/js/queries.js b/scripts/pi-hole/js/queries.js index 163d282b8..6ba8d29c0 100644 --- a/scripts/pi-hole/js/queries.js +++ b/scripts/pi-hole/js/queries.js @@ -80,26 +80,37 @@ $(function () { var replyid = parseInt(data[5], 10); // DNSSEC status var dnssecStatus; - var ede = data[11] ? data[11] : ""; + var ede = data[11] ?? ""; switch (data[6]) { - case "1": + case "1": { dnssecStatus = '
SECURE'; break; - case "2": + } + + case "2": { dnssecStatus = '
INSECURE'; break; - case "3": + } + + case "3": { dnssecStatus = '
BOGUS'; break; - case "4": + } + + case "4": { dnssecStatus = '
ABANDONED'; break; - case "5": + } + + case "5": { dnssecStatus = '
UNKNOWN'; break; - default: + } + + default: { // No DNSSEC dnssecStatus = ""; + } } if (dnssecStatus.length > 0) { @@ -121,13 +132,15 @@ $(function () { } switch (data[4]) { - case "1": + case "1": { fieldtext = "Blocked (gravity)"; buttontext = ''; blocked = true; break; - case "2": + } + + case "2": { fieldtext = replyid === 0 ? "OK (sent to " @@ -137,42 +150,57 @@ $(function () { buttontext = ''; break; - case "3": + } + + case "3": { fieldtext = "OK (cache)" + dnssecStatus; buttontext = ''; break; - case "4": - fieldtext = "Blocked (regex blacklist)"; + } + + case "4": { + fieldtext = + "Blocked
" ); - } - case "SUBNET": { + case "SUBNET": return ( "Client " + row.message + @@ -57,9 +56,8 @@ function renderMessage(data, type, row) { row.blob4 + " to get the group configuration for this client." ); - } - case "HOSTNAME": { + case "HOSTNAME": // eslint-disable-next-line unicorn/no-new-array var hint = new Array(row.blob2 + row.message.length + 3).join(" "); return ( @@ -75,13 +73,11 @@ function renderMessage(data, type, row) { hint + "↑" ); - } - case "DNSMASQ_CONFIG": { + case "DNSMASQ_CONFIG": return "FTL failed to start due to " + row.message; - } - case "RATE_LIMIT": { + case "RATE_LIMIT": return ( "Client " + row.message + @@ -91,17 +87,15 @@ function renderMessage(data, type, row) { parseInt(row.blob2, 10) + " seconds)" ); - } - case "DNSMASQ_WARN": { + case "DNSMASQ_WARN": return ( "Warning in dnsmasq core:
" +
         row.message +
         '
Check out
our documentation for further information.' ); - } - case "LOAD": { + case "LOAD": return ( "Long-term load (15min avg) larger than number of processors: " + parseFloat(row.blob1).toFixed(1) + @@ -109,9 +103,8 @@ function renderMessage(data, type, row) { parseInt(row.blob2, 10) + "
This may slow down DNS resolution and can cause bottlenecks." ); - } - case "SHMEM": { + case "SHMEM": return ( "RAM shortage (" + utils.escapeHtml(row.message) + @@ -121,9 +114,8 @@ function renderMessage(data, type, row) { utils.escapeHtml(row.blob2) + "" ); - } - case "DISK": { + case "DISK": return ( "Disk shortage (" + utils.escapeHtml(row.message) + @@ -133,9 +125,8 @@ function renderMessage(data, type, row) { utils.escapeHtml(row.blob2) + "" ); - } - case "ADLIST": { + case "ADLIST": return ( '" ); - } - default: { + default: return "Unknown message type
" + JSON.stringify(row) + "
"; - } } } diff --git a/scripts/pi-hole/js/queries.js b/scripts/pi-hole/js/queries.js index b97837613..163d282b8 100644 --- a/scripts/pi-hole/js/queries.js +++ b/scripts/pi-hole/js/queries.js @@ -82,35 +82,24 @@ $(function () { var dnssecStatus; var ede = data[11] ? data[11] : ""; switch (data[6]) { - case "1": { + case "1": dnssecStatus = '
SECURE'; break; - } - - case "2": { + case "2": dnssecStatus = '
INSECURE'; break; - } - - case "3": { + case "3": dnssecStatus = '
BOGUS'; break; - } - - case "4": { + case "4": dnssecStatus = '
ABANDONED'; break; - } - - case "5": { + case "5": dnssecStatus = '
UNKNOWN'; break; - } - - default: { + default: // No DNSSEC dnssecStatus = ""; - } } if (dnssecStatus.length > 0) { @@ -132,15 +121,13 @@ $(function () { } switch (data[4]) { - case "1": { + case "1": fieldtext = "Blocked (gravity)"; buttontext = ''; blocked = true; break; - } - - case "2": { + case "2": fieldtext = replyid === 0 ? "OK (sent to " @@ -150,57 +137,42 @@ $(function () { buttontext = ''; break; - } - - case "3": { + case "3": fieldtext = "OK (cache)" + dnssecStatus; buttontext = ''; break; - } - - case "4": { - fieldtext = - "Blocked