diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index b0d85197..8efed61c 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -21,7 +21,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v3.3.0 + uses: actions/checkout@v3.5.2 # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL uses: github/codeql-action/init@v2 diff --git a/.github/workflows/codespell.yml b/.github/workflows/codespell.yml index 03a72d2f..219dc2fd 100644 --- a/.github/workflows/codespell.yml +++ b/.github/workflows/codespell.yml @@ -11,7 +11,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v3.3.0 + uses: actions/checkout@v3.5.2 - name: Spell-Checking uses: codespell-project/actions-codespell@master diff --git a/.github/workflows/editorconfig-checker.yml b/.github/workflows/editorconfig-checker.yml index fb47c4a2..4e46ea1b 100644 --- a/.github/workflows/editorconfig-checker.yml +++ b/.github/workflows/editorconfig-checker.yml @@ -9,6 +9,6 @@ jobs: name: editorconfig-checker runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3.3.0 + - uses: actions/checkout@v3.5.2 - uses: editorconfig-checker/action-editorconfig-checker@main - run: editorconfig-checker diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index 6c6a2eae..5c91d176 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -13,7 +13,7 @@ jobs: issues: write steps: - - uses: actions/stale@v7.0.0 + - uses: actions/stale@v8.0.0 with: repo-token: ${{ secrets.GITHUB_TOKEN }} days-before-stale: 30 diff --git a/.github/workflows/stale_pr.yml b/.github/workflows/stale_pr.yml index ff04afd9..17cd31e3 100644 --- a/.github/workflows/stale_pr.yml +++ b/.github/workflows/stale_pr.yml @@ -17,7 +17,7 @@ jobs: pull-requests: write steps: - - uses: actions/stale@v7.0.0 + - uses: actions/stale@v8.0.0 with: repo-token: ${{ secrets.GITHUB_TOKEN }} # Do not automatically mark PR/issue as stale diff --git a/.github/workflows/sync-back-to-dev.yml b/.github/workflows/sync-back-to-dev.yml index 5a8bde29..ee08adff 100644 --- a/.github/workflows/sync-back-to-dev.yml +++ b/.github/workflows/sync-back-to-dev.yml @@ -11,7 +11,7 @@ jobs: name: Syncing branches steps: - name: Checkout - uses: actions/checkout@v3.3.0 + uses: actions/checkout@v3.5.2 - name: Opening pull request run: gh pr create -B devel -H master --title 'Sync master back into development' --body 'Created by Github action' --label 'internal' env: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5cfc6fa9..b4a75a06 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -19,7 +19,7 @@ jobs: steps: - name: Clone repository - uses: actions/checkout@v3.3.0 + uses: actions/checkout@v3.5.2 - name: Set up Node.js uses: actions/setup-node@v3.6.0 diff --git a/composer.lock b/composer.lock index 60b5305c..ea267b84 100644 --- a/composer.lock +++ b/composer.lock @@ -8,16 +8,16 @@ "packages": [ { "name": "phpstan/phpstan", - "version": "1.9.14", + "version": "1.10.14", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "e5fcc96289cf737304286a9b505fbed091f02e58" + "reference": "d232901b09e67538e5c86a724be841bea5768a7c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/e5fcc96289cf737304286a9b505fbed091f02e58", - "reference": "e5fcc96289cf737304286a9b505fbed091f02e58", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/d232901b09e67538e5c86a724be841bea5768a7c", + "reference": "d232901b09e67538e5c86a724be841bea5768a7c", "shasum": "" }, "require": { @@ -46,8 +46,11 @@ "static analysis" ], "support": { + "docs": "https://phpstan.org/user-guide/getting-started", + "forum": "https://github.com/phpstan/phpstan/discussions", "issues": "https://github.com/phpstan/phpstan/issues", - "source": "https://github.com/phpstan/phpstan/tree/1.9.14" + "security": "https://github.com/phpstan/phpstan/security/policy", + "source": "https://github.com/phpstan/phpstan-src" }, "funding": [ { @@ -63,7 +66,7 @@ "type": "tidelift" } ], - "time": "2023-01-19T10:47:09+00:00" + "time": "2023-04-19T13:47:27+00:00" } ], "packages-dev": [], diff --git a/index.php b/index.php index 4bc2fddd..50003af1 100644 --- a/index.php +++ b/index.php @@ -10,11 +10,6 @@ $indexpage = true; require 'scripts/pi-hole/php/header_authenticated.php'; ?> - - - - -
diff --git a/package-lock.json b/package-lock.json index 1e2a4b18..01aa1431 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,11 +9,11 @@ "version": "1.0.0", "license": "EUPL-1.2", "devDependencies": { - "autoprefixer": "^10.4.13", - "eslint-plugin-compat": "^4.0.2", - "postcss": "^8.4.21", + "autoprefixer": "^10.4.14", + "eslint-plugin-compat": "^4.1.4", + "postcss": "^8.4.23", "postcss-cli": "^10.1.0", - "prettier": "2.8.3", + "prettier": "2.8.8", "xo": "^0.53.1" } }, @@ -244,9 +244,9 @@ } }, "node_modules/@mdn/browser-compat-data": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/@mdn/browser-compat-data/-/browser-compat-data-4.2.1.tgz", - "integrity": "sha512-EWUguj2kd7ldmrF9F+vI5hUOralPd+sdsUnYbRy33vZTuZkduC1shE9TtEMEjAQwyfyMb4ole5KtjF8MsnQOlA==", + "version": "5.2.49", + "resolved": "https://registry.npmjs.org/@mdn/browser-compat-data/-/browser-compat-data-5.2.49.tgz", + "integrity": "sha512-tXJUP9EFcfeTcn3hpn616qtcbaLMrhqfgsljRnIv/qYckL8ywLodk7Cj3oJlZed3zWLZLnE9LHHsfpO8w4yJuw==", "dev": true }, "node_modules/@nodelib/fs.scandir": { @@ -284,6 +284,12 @@ "node": ">= 8" } }, + "node_modules/@tsconfig/node14": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.3.tgz", + "integrity": "sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==", + "dev": true + }, "node_modules/@types/eslint": { "version": "7.29.0", "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-7.29.0.tgz", @@ -706,24 +712,18 @@ } }, "node_modules/ast-metadata-inferer": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/ast-metadata-inferer/-/ast-metadata-inferer-0.7.0.tgz", - "integrity": "sha512-OkMLzd8xelb3gmnp6ToFvvsHLtS6CbagTkFQvQ+ZYFe3/AIl9iKikNR9G7pY3GfOR/2Xc222hwBjzI7HLkE76Q==", + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/ast-metadata-inferer/-/ast-metadata-inferer-0.8.0.tgz", + "integrity": "sha512-jOMKcHht9LxYIEQu+RVd22vtgrPaVCtDRQ/16IGmurdzxvYbDd5ynxjnyrzLnieG96eTcAyaoj/wN/4/1FyyeA==", "dev": true, "dependencies": { - "@mdn/browser-compat-data": "^3.3.14" + "@mdn/browser-compat-data": "^5.2.34" } }, - "node_modules/ast-metadata-inferer/node_modules/@mdn/browser-compat-data": { - "version": "3.3.14", - "resolved": "https://registry.npmjs.org/@mdn/browser-compat-data/-/browser-compat-data-3.3.14.tgz", - "integrity": "sha512-n2RC9d6XatVbWFdHLimzzUJxJ1KY8LdjqrW6YvGPiRmsHkhOUx74/Ct10x5Yo7bC/Jvqx7cDEW8IMPv/+vwEzA==", - "dev": true - }, "node_modules/autoprefixer": { - "version": "10.4.13", - "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-10.4.13.tgz", - "integrity": "sha512-49vKpMqcZYsJjwotvt4+h/BCjJVnhGwcLpDt5xkcaOG3eLrG/HUYLagrihYsQ+qrIBgIzX1Rw7a6L8I/ZA1Atg==", + "version": "10.4.14", + "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-10.4.14.tgz", + "integrity": "sha512-FQzyfOsTlwVzjHxKEqRIAdJx9niO6VCBCoEwax/VLSoQF29ggECcPuBqUMZ+u8jCZOPSy8b8/8KnuFbp0SaFZQ==", "dev": true, "funding": [ { @@ -736,8 +736,8 @@ } ], "dependencies": { - "browserslist": "^4.21.4", - "caniuse-lite": "^1.0.30001426", + "browserslist": "^4.21.5", + "caniuse-lite": "^1.0.30001464", "fraction.js": "^4.2.0", "normalize-range": "^0.1.2", "picocolors": "^1.0.0", @@ -803,9 +803,9 @@ } }, "node_modules/browserslist": { - "version": "4.21.4", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.21.4.tgz", - "integrity": "sha512-CBHJJdDmgjl3daYjN5Cp5kbTf1mUhZoS+beLklHIvkOWscs83YAhLlF3Wsh/lciQYAcbBJgTOD44VtG31ZM4Hw==", + "version": "4.21.5", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.21.5.tgz", + "integrity": "sha512-tUkiguQGW7S3IhB7N+c2MV/HZPSCPAAiYBZXLsBhFB/PCy6ZKKsZrmBayHV9fdGV/ARIfJ14NkxKzRDjvp7L6w==", "dev": true, "funding": [ { @@ -818,10 +818,10 @@ } ], "dependencies": { - "caniuse-lite": "^1.0.30001400", - "electron-to-chromium": "^1.4.251", - "node-releases": "^2.0.6", - "update-browserslist-db": "^1.0.9" + "caniuse-lite": "^1.0.30001449", + "electron-to-chromium": "^1.4.284", + "node-releases": "^2.0.8", + "update-browserslist-db": "^1.0.10" }, "bin": { "browserslist": "cli.js" @@ -923,9 +923,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001442", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001442.tgz", - "integrity": "sha512-239m03Pqy0hwxYPYR5JwOIxRJfLTWtle9FV8zosfV5pHg+/51uD4nxcUlM8+mWWGfwKtt8lJNHnD3cWw9VZ6ow==", + "version": "1.0.30001476", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001476.tgz", + "integrity": "sha512-JmpktFppVSvyUN4gsLS0bShY2L9ZUslHLE72vgemBkS43JD2fOvKTKs+GtRwuxrtRGnwJFW0ye7kWRRlLJS9vQ==", "dev": true, "funding": [ { @@ -935,6 +935,10 @@ { "type": "tidelift", "url": "https://tidelift.com/funding/github/npm/caniuse-lite" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" } ] }, @@ -1096,17 +1100,6 @@ "integrity": "sha512-JsPKdmh8ZkmnHxDk55FZ1TqVLvEQTvoByJZRN9jzI0UjxK/QgAmsphz7PGtqgPieQZ/CQcHWXCR7ATDNhGe+YA==", "dev": true }, - "node_modules/core-js": { - "version": "3.27.1", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.27.1.tgz", - "integrity": "sha512-GutwJLBChfGCpwwhbYoqfv03LAfmiz7e7D/BNxzeMxwQf10GRSzqiOjx7AmtEk+heiD/JWmBuyBPgFtx0Sg1ww==", - "dev": true, - "hasInstallScript": true, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/core-js" - } - }, "node_modules/cosmiconfig": { "version": "7.1.0", "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-7.1.0.tgz", @@ -1678,22 +1671,22 @@ } }, "node_modules/eslint-plugin-compat": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/eslint-plugin-compat/-/eslint-plugin-compat-4.0.2.tgz", - "integrity": "sha512-xqvoO54CLTVaEYGMzhu35Wzwk/As7rCvz/2dqwnFiWi0OJccEtGIn+5qq3zqIu9nboXlpdBN579fZcItC73Ycg==", + "version": "4.1.4", + "resolved": "https://registry.npmjs.org/eslint-plugin-compat/-/eslint-plugin-compat-4.1.4.tgz", + "integrity": "sha512-RxySWBmzfIROLFKgeJBJue2BU/6vM2KJWXWAUq+oW4QtrsZXRxbjgxmO1OfF3sHcRuuIenTS/wgo3GyUWZF24w==", "dev": true, "dependencies": { - "@mdn/browser-compat-data": "^4.1.5", - "ast-metadata-inferer": "^0.7.0", - "browserslist": "^4.16.8", - "caniuse-lite": "^1.0.30001304", - "core-js": "^3.16.2", + "@mdn/browser-compat-data": "^5.2.47", + "@tsconfig/node14": "^1.0.3", + "ast-metadata-inferer": "^0.8.0", + "browserslist": "^4.21.5", + "caniuse-lite": "^1.0.30001473", "find-up": "^5.0.0", "lodash.memoize": "4.1.2", - "semver": "7.3.5" + "semver": "7.3.8" }, "engines": { - "node": ">=9.x" + "node": ">=14.x" }, "peerDependencies": { "eslint": "^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0" @@ -1849,21 +1842,6 @@ "eslint": ">=7.0.0" } }, - "node_modules/eslint-plugin-n/node_modules/semver": { - "version": "7.3.8", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", - "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", - "dev": true, - "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/eslint-plugin-no-use-extend-native": { "version": "0.5.0", "resolved": "https://registry.npmjs.org/eslint-plugin-no-use-extend-native/-/eslint-plugin-no-use-extend-native-0.5.0.tgz", @@ -1931,21 +1909,6 @@ "eslint": ">=8.23.1" } }, - "node_modules/eslint-plugin-unicorn/node_modules/semver": { - "version": "7.3.8", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", - "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", - "dev": true, - "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/eslint-rule-docs": { "version": "1.1.235", "resolved": "https://registry.npmjs.org/eslint-rule-docs/-/eslint-rule-docs-1.1.235.tgz", @@ -3917,10 +3880,16 @@ "dev": true }, "node_modules/nanoid": { - "version": "3.3.4", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.4.tgz", - "integrity": "sha512-MqBkQh/OHTS2egovRtLk45wEyNXwF+cokD+1YPf9u5VfJiRdAiRwB2froX5Co9Rh20xs4siNPm8naNotSD6RBw==", + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.6.tgz", + "integrity": "sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA==", "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], "bin": { "nanoid": "bin/nanoid.cjs" }, @@ -4314,9 +4283,9 @@ } }, "node_modules/postcss": { - "version": "8.4.21", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.21.tgz", - "integrity": "sha512-tP7u/Sn/dVxK2NnruI4H9BG+x+Wxz6oeZ1cJ8P6G/PZY0IKk4k/63TDsQf2kQq3+qoJeLm2kIBUNlZe3zgb4Zg==", + "version": "8.4.23", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.23.tgz", + "integrity": "sha512-bQ3qMcpF6A/YjR55xtoTr0jGOlnPOKAIMdOWiv0EIT6HVPEaJiJB4NLljSbiHoC2RX7DN5Uvjtpbg1NPdwv1oA==", "dev": true, "funding": [ { @@ -4326,10 +4295,14 @@ { "type": "tidelift", "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" } ], "dependencies": { - "nanoid": "^3.3.4", + "nanoid": "^3.3.6", "picocolors": "^1.0.0", "source-map-js": "^1.0.2" }, @@ -4431,9 +4404,9 @@ } }, "node_modules/prettier": { - "version": "2.8.3", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.3.tgz", - "integrity": "sha512-tJ/oJ4amDihPoufT5sM0Z1SKEuKay8LfVAMlbbhnnkvt6BUserZylqo2PN+p9KeljLr0OHa2rXHU1T8reeoTrw==", + "version": "2.8.8", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.8.tgz", + "integrity": "sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==", "dev": true, "bin": { "prettier": "bin-prettier.js" @@ -4904,9 +4877,9 @@ } }, "node_modules/semver": { - "version": "7.3.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", - "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", + "version": "7.3.8", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", + "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", "dev": true, "dependencies": { "lru-cache": "^6.0.0" @@ -5465,9 +5438,9 @@ } }, "node_modules/webpack": { - "version": "5.75.0", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.75.0.tgz", - "integrity": "sha512-piaIaoVJlqMsPtX/+3KTTO6jfvrSYgauFVdt8cr9LTHKmcq/AMd4mhzsiP7ZF/PGRNPGA8336jldh9l2Kt2ogQ==", + "version": "5.76.3", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.76.3.tgz", + "integrity": "sha512-18Qv7uGPU8b2vqGeEEObnfICyw2g39CHlDEK4I7NK13LOur1d0HGmGNKGT58Eluwddpn3oEejwvBPoP4M7/KSA==", "dev": true, "peer": true, "dependencies": { @@ -6500,9 +6473,9 @@ "dev": true }, "node_modules/yaml": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.2.1.tgz", - "integrity": "sha512-e0WHiYql7+9wr4cWMx3TVQrNwejKaEe7/rHNmQmqRjazfOP5W8PB6Jpebb5o6fIapbz9o9+2ipcaTM2ZwDI6lw==", + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.2.2.tgz", + "integrity": "sha512-CBKFWExMn46Foo4cldiChEzn7S7SRV+wqiluAb6xmueD/fGyRHIhX8m14vVGgeFWjN540nKCNVj6P21eQjgTuA==", "dev": true, "engines": { "node": ">= 14" diff --git a/package.json b/package.json index dc66de04..139ccce6 100644 --- a/package.json +++ b/package.json @@ -25,11 +25,11 @@ "testpr": "npm run prettier:fix && git diff --ws-error-highlight=all --color=always --exit-code && npm run xo:check" }, "devDependencies": { - "autoprefixer": "^10.4.13", - "eslint-plugin-compat": "^4.0.2", - "postcss": "^8.4.21", + "autoprefixer": "^10.4.14", + "eslint-plugin-compat": "^4.1.4", + "postcss": "^8.4.23", "postcss-cli": "^10.1.0", - "prettier": "2.8.3", + "prettier": "2.8.8", "xo": "^0.53.1" }, "browserslist": [ diff --git a/scripts/pi-hole/js/footer.js b/scripts/pi-hole/js/footer.js index 3ac2693d..7f0ad18f 100644 --- a/scripts/pi-hole/js/footer.js +++ b/scripts/pi-hole/js/footer.js @@ -6,6 +6,7 @@ * Please see LICENSE file for your rights under this license. */ /* global utils:false, moment:false */ + //The following functions allow us to display time until pi-hole is enabled after disabling. //Works between all pages diff --git a/scripts/pi-hole/js/index.js b/scripts/pi-hole/js/index.js index c6642ce3..21d5c916 100644 --- a/scripts/pi-hole/js/index.js +++ b/scripts/pi-hole/js/index.js @@ -223,9 +223,9 @@ function updateQueriesOverTime() { timeLineChart.data.datasets = []; var labels = ["Blocked DNS Queries", "Cached DNS Queries", "Forwarded DNS Queries"]; - var blockedColor = $(".queries-blocked").css("background-color"); - var cachedColor = $(".queries-cached").css("background-color"); - var permittedColor = $(".queries-permitted").css("background-color"); + var cachedColor = utils.getCSSval("queries-cached", "background-color"); + var blockedColor = utils.getCSSval("queries-blocked", "background-color"); + var permittedColor = utils.getCSSval("queries-permitted", "background-color"); var colors = [blockedColor, cachedColor, permittedColor]; // Collect values and colors, and labels @@ -740,8 +740,8 @@ $(function () { // Pull in data via AJAX updateSummaryData(); - var gridColor = $(".graphs-grid").css("background-color"); - var ticksColor = $(".graphs-ticks").css("color"); + var gridColor = utils.getCSSval("graphs-grid", "background-color"); + var ticksColor = utils.getCSSval("graphs-ticks", "color"); var ctx = document.getElementById("queryOverTimeChart").getContext("2d"); timeLineChart = new Chart(ctx, { type: utils.getGraphType(), diff --git a/scripts/pi-hole/js/queries.js b/scripts/pi-hole/js/queries.js index 689e49c7..d4faa1ca 100644 --- a/scripts/pi-hole/js/queries.js +++ b/scripts/pi-hole/js/queries.js @@ -1,4 +1,4 @@ -/* Pi-hole: A black hole for Internet advertisements + /* Pi-hole: A black hole for Internet advertisements * (c) 2017 Pi-hole, LLC (https://pi-hole.net) * Network-wide ad blocking via your own hardware. * @@ -91,21 +91,21 @@ function parseQueryStatus(data) { icon = "fa-solid fa-ban"; fieldtext = "Blocked (gravity)"; buttontext = - ''; + ''; break; case "FORWARDED": colorClass = "text-green"; icon = "fa-solid fa-cloud-download-alt"; fieldtext = "Forwarded to " + data.upstream; buttontext = - ''; + ''; break; case "CACHE": colorClass = "text-green"; icon = "fa-solid fa-database"; fieldtext = "Served from cache"; buttontext = - ''; + ''; break; case "REGEX": colorClass = "text-red"; @@ -113,14 +113,14 @@ function parseQueryStatus(data) { fieldtext = "Blocked (regex)"; regexLink = data.regex > 0; buttontext = - ''; + ''; break; case "DENYLIST": colorClass = "text-red"; icon = "fa-solid fa-ban"; fieldtext = "Blocked (exact)"; buttontext = - ''; + ''; break; case "EXTERNAL_BLOCKED_IP": colorClass = "text-red"; @@ -145,7 +145,7 @@ function parseQueryStatus(data) { icon = "fa-solid fa-ban"; fieldtext = "Blocked (gravity, CNAME)"; buttontext = - ''; + ''; isCNAME = true; break; case "REGEX_CNAME": @@ -154,7 +154,7 @@ function parseQueryStatus(data) { fieldtext = "Blocked (regex diened, CNAME)"; regexLink = data.regex > 0; buttontext = - ''; + ''; isCNAME = true; break; case "DENYLIST_CNAME": @@ -162,7 +162,7 @@ function parseQueryStatus(data) { icon = "fa-solid fa-ban"; fieldtext = "Blocked (exact diened, CNAME)"; buttontext = - ''; + ''; isCNAME = true; break; case "RETRIED": @@ -182,14 +182,14 @@ function parseQueryStatus(data) { icon = "fa-solid fa-hourglass-half"; fieldtext = "Already forwarded, awaiting reply"; buttontext = - ''; + ''; break; case "CACHE_STALE": colorClass = "text-green"; icon = "fa-solid fa-infinity"; fieldtext = "Served by cache optimizer"; buttontext = - ''; + ''; break; default: colorClass = "text-orange"; diff --git a/scripts/pi-hole/js/restartdns.js b/scripts/pi-hole/js/restartdns.js new file mode 100644 index 00000000..248fac07 --- /dev/null +++ b/scripts/pi-hole/js/restartdns.js @@ -0,0 +1,39 @@ +/* Pi-hole: A black hole for Internet advertisements + * (c) 2017 Pi-hole, LLC (https://pi-hole.net) + * Network-wide ad blocking via your own hardware. + * + * This file is copyright under the latest version of the EUPL. + * Please see LICENSE file for your rights under this license. */ + +var timeleft = 60; +var status = -1; +var reloadMsg = + "FTL was restarted: Reload FTL details."; +var warningMsg = "FTL was not able to reload after " + timeleft + " seconds."; +var counterMsg = "FTL is reloading: "; + +var reloadTimer = setInterval(function () { + $.getJSON("api.php?dns-port", function (data) { + if ("FTLnotrunning" in data) { + return; + } + + status = data["dns-port"]; + }); + + if (timeleft <= 0 || status >= 0) { + clearInterval(reloadTimer); + if (status < 0) { + // FTL was not restarted in 60 seconds. Show warning message + document.getElementById("restart-countdown").innerHTML = warningMsg; + } else { + // FTL restartd. + document.getElementById("restart-countdown").innerHTML = reloadMsg; + } + } else { + document.getElementById("restart-countdown").innerHTML = + counterMsg + timeleft + " seconds remaining..."; + } + + timeleft -= 1; +}, 1000); diff --git a/scripts/pi-hole/js/utils.js b/scripts/pi-hole/js/utils.js index 7ad8a609..7af6d303 100644 --- a/scripts/pi-hole/js/utils.js +++ b/scripts/pi-hole/js/utils.js @@ -480,6 +480,13 @@ function changeTableButtonStates(table) { } } +function getCSSval(cssclass, cssproperty) { + var elem = $("
"), + val = elem.appendTo("body").css(cssproperty); + elem.remove(); + return val; +} + window.utils = (function () { return { escapeHtml: escapeHtml, @@ -509,5 +516,6 @@ window.utils = (function () { renderTimespan: renderTimespan, htmlPass: htmlPass, changeTableButtonStates: changeTableButtonStates, + getCSSval: getCSSval, }; })(); diff --git a/scripts/pi-hole/php/header.php b/scripts/pi-hole/php/header.php index c98e8bd7..98e95bfc 100644 --- a/scripts/pi-hole/php/header.php +++ b/scripts/pi-hole/php/header.php @@ -26,24 +26,13 @@ $hostname = gethostname() ? gethostname() : ''; - + - + - - - - - - - - - - +