mirror of
https://github.com/gosticks/web.git
synced 2026-12-04 10:11:38 +00:00
Merge branch 'development' into fix/query-log-debounce
This commit is contained in:
Generated
+228
-210
@@ -1428,9 +1428,9 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"camelcase": {
|
||||
"version": "5.0.0",
|
||||
"resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.0.0.tgz",
|
||||
"integrity": "sha512-faqwZqnWxbxn+F1d399ygeamQNy3lPp/H9H6rNrqYh4FSVCtcY+3cub1MxA8o9mDd55mM8Aghuu/kuyYA6VTsA==",
|
||||
"version": "5.2.0",
|
||||
"resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.2.0.tgz",
|
||||
"integrity": "sha512-IXFsBS2pC+X0j0N/GE7Dm7j3bsEBp+oTpb7F50dwEVX7rf3IgwO9XatnegTsDtniKCUtEJH4fSU6Asw7uoVLfQ==",
|
||||
"dev": true
|
||||
}
|
||||
}
|
||||
@@ -1587,21 +1587,21 @@
|
||||
"dev": true
|
||||
},
|
||||
"@types/prop-types": {
|
||||
"version": "15.5.8",
|
||||
"resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.5.8.tgz",
|
||||
"integrity": "sha512-3AQoUxQcQtLHsK25wtTWIoIpgYjH3vSDroZOUr7PpCHw/jLY1RB9z9E8dBT/OSmwStVgkRNvdh+ZHNiomRieaw==",
|
||||
"version": "15.7.0",
|
||||
"resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.0.tgz",
|
||||
"integrity": "sha512-eItQyV43bj4rR3JPV0Skpl1SncRCdziTEK9/v8VwXmV6d/qOUO8/EuWeHBbCZcsfSHfzI5UyMJLCSXtxxznyZg==",
|
||||
"dev": true
|
||||
},
|
||||
"@types/q": {
|
||||
"version": "1.5.1",
|
||||
"resolved": "https://registry.npmjs.org/@types/q/-/q-1.5.1.tgz",
|
||||
"integrity": "sha512-eqz8c/0kwNi/OEHQfvIuJVLTst3in0e7uTKeuY+WL/zfKn0xVujOTp42bS/vUUokhK5P2BppLd9JXMOMHcgbjA==",
|
||||
"version": "1.5.2",
|
||||
"resolved": "https://registry.npmjs.org/@types/q/-/q-1.5.2.tgz",
|
||||
"integrity": "sha512-ce5d3q03Ex0sy4R14722Rmt6MT07Ua+k4FwDfdcToYJcMKNtRVQvJ6JCAPdAmAnbRb6CsX6aYb9m96NGod9uTw==",
|
||||
"dev": true
|
||||
},
|
||||
"@types/react": {
|
||||
"version": "16.7.20",
|
||||
"resolved": "https://registry.npmjs.org/@types/react/-/react-16.7.20.tgz",
|
||||
"integrity": "sha512-Qd5RWkwl6SL7R2XzLk/cicjVQm1Mhc6HqXY5Ei4pWd1Vi8Fkbd5O0sA398x8fRSTPAuHdDYD9nrWmJMYTJI0vQ==",
|
||||
"version": "16.8.8",
|
||||
"resolved": "https://registry.npmjs.org/@types/react/-/react-16.8.8.tgz",
|
||||
"integrity": "sha512-xwEvyet96u7WnB96kqY0yY7qxx/pEpU51QeACkKFtrgjjXITQn0oO1iwPEraXVgh10ZFPix7gs1R4OJXF7P5sg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@types/prop-types": "*",
|
||||
@@ -1629,9 +1629,9 @@
|
||||
}
|
||||
},
|
||||
"@types/react-dom": {
|
||||
"version": "16.0.11",
|
||||
"resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-16.0.11.tgz",
|
||||
"integrity": "sha512-x6zUx9/42B5Kl2Vl9HlopV8JF64wLpX3c+Pst9kc1HgzrsH+mkehe/zmHMQTplIrR48H2gpU7ZqurQolYu8XBA==",
|
||||
"version": "16.8.2",
|
||||
"resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-16.8.2.tgz",
|
||||
"integrity": "sha512-MX7n1wq3G/De15RGAAqnmidzhr2Y9O/ClxPxyqaNg96pGyeXUYPSvujgzEVpLo9oIP4Wn1UETl+rxTN02KEpBw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@types/react": "*"
|
||||
@@ -2019,9 +2019,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"ansi-colors": {
|
||||
"version": "3.2.3",
|
||||
"resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-3.2.3.tgz",
|
||||
"integrity": "sha512-LEHHyuhlPY3TmuUYMh2oz89lTShfvgbmzaBcxve9t/9Wuy7Dwf4yoAKcND7KFT1HAQfqZ12qtc+DUrBMeKF9nw==",
|
||||
"version": "3.2.4",
|
||||
"resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-3.2.4.tgz",
|
||||
"integrity": "sha512-hHUXGagefjN2iRrID63xckIvotOXOojhQKWIPUZ4mNUZ9nLZW+7FMNoE1lOkEhNWYsx/7ysGIuJYCiMAA9FnrA==",
|
||||
"dev": true
|
||||
},
|
||||
"ansi-escapes": {
|
||||
@@ -2610,13 +2610,13 @@
|
||||
"dev": true
|
||||
},
|
||||
"autoprefixer": {
|
||||
"version": "9.4.9",
|
||||
"resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-9.4.9.tgz",
|
||||
"integrity": "sha512-OyUl7KvbGBoFQbGQu51hMywz1aaVeud/6uX8r1R1DNcqFvqGUUy6+BDHnAZE8s5t5JyEObaSw+O1DpAdjAmLuw==",
|
||||
"version": "9.5.0",
|
||||
"resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-9.5.0.tgz",
|
||||
"integrity": "sha512-hMKcyHsZn5+qL6AUeP3c8OyuteZ4VaUlg+fWbyl8z7PqsKHF/Bf8/px3K6AT8aMzDkBo8Bc11245MM+itDBOxQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"browserslist": "^4.4.2",
|
||||
"caniuse-lite": "^1.0.30000939",
|
||||
"caniuse-lite": "^1.0.30000947",
|
||||
"normalize-range": "^0.1.2",
|
||||
"num2fraction": "^1.2.2",
|
||||
"postcss": "^7.0.14",
|
||||
@@ -2995,9 +2995,9 @@
|
||||
}
|
||||
},
|
||||
"babel-preset-react-app": {
|
||||
"version": "7.0.1",
|
||||
"resolved": "https://registry.npmjs.org/babel-preset-react-app/-/babel-preset-react-app-7.0.1.tgz",
|
||||
"integrity": "sha512-cic2V+GftWwt82XNMKGxvkFAVvuaBISy0/mzNLLPlALXXJxUvxJgVy2DI8HVk311oewJsmBiu/unE4wINUCvkg==",
|
||||
"version": "7.0.2",
|
||||
"resolved": "https://registry.npmjs.org/babel-preset-react-app/-/babel-preset-react-app-7.0.2.tgz",
|
||||
"integrity": "sha512-mwCk/u2wuiO8qQqblN5PlDa44taY0acq7hw6W+a70W522P7a9mIcdggL1fe5/LgAT7tqCq46q9wwhqaMoYKslQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@babel/core": "7.2.2",
|
||||
@@ -3643,14 +3643,14 @@
|
||||
}
|
||||
},
|
||||
"browserslist": {
|
||||
"version": "4.4.2",
|
||||
"resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.4.2.tgz",
|
||||
"integrity": "sha512-ISS/AIAiHERJ3d45Fz0AVYKkgcy+F/eJHzKEvv1j0wwKGKD9T3BrwKr/5g45L+Y4XIK5PlTqefHciRFcfE1Jxg==",
|
||||
"version": "4.5.0",
|
||||
"resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.5.0.tgz",
|
||||
"integrity": "sha512-92IS3knByY3wF7DDozdKwLxkvp23Ydn2O5L0qVwR1p/ioN7oIDl7d/eyPMc11rTVofT/6IbcdwP9eTId7orGZQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"caniuse-lite": "^1.0.30000939",
|
||||
"electron-to-chromium": "^1.3.113",
|
||||
"node-releases": "^1.1.8"
|
||||
"caniuse-lite": "^1.0.30000948",
|
||||
"electron-to-chromium": "^1.3.116",
|
||||
"node-releases": "^1.1.10"
|
||||
}
|
||||
},
|
||||
"bser": {
|
||||
@@ -3871,9 +3871,9 @@
|
||||
}
|
||||
},
|
||||
"caniuse-lite": {
|
||||
"version": "1.0.30000939",
|
||||
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30000939.tgz",
|
||||
"integrity": "sha512-oXB23ImDJOgQpGjRv1tCtzAvJr4/OvrHi5SO2vUgB0g0xpdZZoA/BxfImiWfdwoYdUTtQrPsXsvYU/dmCSM8gg==",
|
||||
"version": "1.0.30000949",
|
||||
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30000949.tgz",
|
||||
"integrity": "sha512-jIF/jphmuJ7oAWmfYO0qAxRAvCa0zNquALO6Ykfe6qo8qwh882Cgcs+OWmm21L3x6nu4TVLFeEZ9/q6VuKCfSg==",
|
||||
"dev": true
|
||||
},
|
||||
"capture-exit": {
|
||||
@@ -4743,9 +4743,9 @@
|
||||
}
|
||||
},
|
||||
"confusing-browser-globals": {
|
||||
"version": "1.0.5",
|
||||
"resolved": "https://registry.npmjs.org/confusing-browser-globals/-/confusing-browser-globals-1.0.5.tgz",
|
||||
"integrity": "sha512-tHo1tQL/9Ox5RELbkCAJhnViqWlzBz3MG1bB2czbHjH2mWd4aYUgNCNLfysFL7c4LoDws7pjg2tj48Gmpw4QHA==",
|
||||
"version": "1.0.6",
|
||||
"resolved": "https://registry.npmjs.org/confusing-browser-globals/-/confusing-browser-globals-1.0.6.tgz",
|
||||
"integrity": "sha512-GzyX86c2TvaagAOR+lHL2Yq4T4EnoBcnojZBcNbxVKSunxmGTnioXHR5Mo2ha/XnCoQw8eurvj6Ta+SwPEPkKg==",
|
||||
"dev": true
|
||||
},
|
||||
"connect-history-api-fallback": {
|
||||
@@ -5373,9 +5373,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"cssdb": {
|
||||
"version": "4.3.0",
|
||||
"resolved": "https://registry.npmjs.org/cssdb/-/cssdb-4.3.0.tgz",
|
||||
"integrity": "sha512-VHPES/+c9s+I0ryNj+PXvp84nz+ms843z/efpaEINwP/QfGsINL3gpLp5qjapzDNzNzbXxur8uxKxSXImrg4ag==",
|
||||
"version": "4.4.0",
|
||||
"resolved": "https://registry.npmjs.org/cssdb/-/cssdb-4.4.0.tgz",
|
||||
"integrity": "sha512-LsTAR1JPEM9TpGhl/0p3nQecC2LJ0kD8X5YARu1hk/9I1gril5vDtMZyNxcEpxxDj34YNck/ucjuoUd66K03oQ==",
|
||||
"dev": true
|
||||
},
|
||||
"cssesc": {
|
||||
@@ -6310,9 +6310,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"electron-to-chromium": {
|
||||
"version": "1.3.113",
|
||||
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.113.tgz",
|
||||
"integrity": "sha512-De+lPAxEcpxvqPTyZAXELNpRZXABRxf+uL/rSykstQhzj/B0l1150G/ExIIxKc16lI89Hgz81J0BHAcbTqK49g==",
|
||||
"version": "1.3.116",
|
||||
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.116.tgz",
|
||||
"integrity": "sha512-NKwKAXzur5vFCZYBHpdWjTMO8QptNLNP80nItkSIgUOapPAo9Uia+RvkCaZJtO7fhQaVElSvBPWEc2ku6cKsPA==",
|
||||
"dev": true
|
||||
},
|
||||
"elliptic": {
|
||||
@@ -6646,9 +6646,9 @@
|
||||
}
|
||||
},
|
||||
"ajv": {
|
||||
"version": "6.9.2",
|
||||
"resolved": "https://registry.npmjs.org/ajv/-/ajv-6.9.2.tgz",
|
||||
"integrity": "sha512-4UFy0/LgDo7Oa/+wOAlj44tp9K78u38E5/359eSrqEp1Z5PdVfimCcs7SluXMP755RUQu6d2b4AvF0R1C9RZjg==",
|
||||
"version": "6.10.0",
|
||||
"resolved": "https://registry.npmjs.org/ajv/-/ajv-6.10.0.tgz",
|
||||
"integrity": "sha512-nffhOpkymDECQyR0mnsUtoCE8RlX38G0rYP+wgLWFyZuUyuuojSSvi/+euOiQBIn63whYwYVIIH1TvE3tu4OEg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"fast-deep-equal": "^2.0.1",
|
||||
@@ -6706,9 +6706,9 @@
|
||||
}
|
||||
},
|
||||
"eslint-scope": {
|
||||
"version": "4.0.2",
|
||||
"resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.2.tgz",
|
||||
"integrity": "sha512-5q1+B/ogmHl8+paxtOKx38Z8LtWkVGuNt3+GQNErqwLl6ViNp/gdJGMCjZNxZ8j/VYjDNZ2Fo+eQc1TAVPIzbg==",
|
||||
"version": "4.0.3",
|
||||
"resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.3.tgz",
|
||||
"integrity": "sha512-p7VutNr1O/QrxysMo3E45FjYDTeXBy0iTltPFNSqKAIfjDSXC+4dj+qfyuD8bfAXrW/y6lW3O76VaYNPKfpKrg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"esrecurse": "^4.1.0",
|
||||
@@ -6776,12 +6776,12 @@
|
||||
}
|
||||
},
|
||||
"eslint-config-react-app": {
|
||||
"version": "3.0.7",
|
||||
"resolved": "https://registry.npmjs.org/eslint-config-react-app/-/eslint-config-react-app-3.0.7.tgz",
|
||||
"integrity": "sha512-Mmmc9lIY/qvX6OEV09+ZLqVTz1aX8VVCrgCjBHXdmMGaC+pldD+87oj3BiJWXMSfcYs5iOo9gy0mGnQ8f/fMsQ==",
|
||||
"version": "3.0.8",
|
||||
"resolved": "https://registry.npmjs.org/eslint-config-react-app/-/eslint-config-react-app-3.0.8.tgz",
|
||||
"integrity": "sha512-Ovi6Bva67OjXrom9Y/SLJRkrGqKhMAL0XCH8BizPhjEVEhYczl2ZKiNZI2CuqO5/CJwAfMwRXAVGY0KToWr1aA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"confusing-browser-globals": "^1.0.5"
|
||||
"confusing-browser-globals": "^1.0.6"
|
||||
}
|
||||
},
|
||||
"eslint-import-resolver-node": {
|
||||
@@ -7929,13 +7929,13 @@
|
||||
}
|
||||
},
|
||||
"find-cache-dir": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-2.0.0.tgz",
|
||||
"integrity": "sha512-LDUY6V1Xs5eFskUVYtIwatojt6+9xC9Chnlk/jYOOvn3FAFfSaWddxahDGyNHh0b2dMXa6YW2m0tk8TdVaXHlA==",
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-2.1.0.tgz",
|
||||
"integrity": "sha512-Tq6PixE0w/VMFfCgbONnkiQIVol/JJL7nRMi20fqzA4NRs9AfeqMGeRdPi3wIhYkxjeBaWh2rxwapn5Tu3IqOQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"commondir": "^1.0.1",
|
||||
"make-dir": "^1.0.0",
|
||||
"make-dir": "^2.0.0",
|
||||
"pkg-dir": "^3.0.0"
|
||||
}
|
||||
},
|
||||
@@ -8035,19 +8035,18 @@
|
||||
"integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=",
|
||||
"dev": true
|
||||
},
|
||||
"fork-ts-checker-webpack-plugin-alt": {
|
||||
"version": "0.4.14",
|
||||
"resolved": "https://registry.npmjs.org/fork-ts-checker-webpack-plugin-alt/-/fork-ts-checker-webpack-plugin-alt-0.4.14.tgz",
|
||||
"integrity": "sha512-s0wjOBuPdylMRBzZ4yO8LSJuzem3g0MYZFxsjRXrFDQyL5KJBVSq30+GoHM/t/r2CRU4tI6zi04sq6OXK0UYnw==",
|
||||
"fork-ts-checker-webpack-plugin": {
|
||||
"version": "1.0.0-alpha.6",
|
||||
"resolved": "https://registry.npmjs.org/fork-ts-checker-webpack-plugin/-/fork-ts-checker-webpack-plugin-1.0.0-alpha.6.tgz",
|
||||
"integrity": "sha512-s/V+58nLrUjuXyzYk8AL11XG8bxIirTbafDLMn26sL59HQx8QvvsRTqOkhq4MV0coIkog1jZuH/E9Abm8zFZ2g==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"babel-code-frame": "^6.22.0",
|
||||
"chalk": "^2.4.1",
|
||||
"chokidar": "^2.0.4",
|
||||
"lodash": "^4.17.11",
|
||||
"micromatch": "^3.1.10",
|
||||
"minimatch": "^3.0.4",
|
||||
"resolve": "^1.5.0",
|
||||
"semver": "^5.6.0",
|
||||
"tapable": "^1.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
@@ -8369,6 +8368,12 @@
|
||||
"integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=",
|
||||
"dev": true
|
||||
},
|
||||
"semver": {
|
||||
"version": "5.6.0",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-5.6.0.tgz",
|
||||
"integrity": "sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg==",
|
||||
"dev": true
|
||||
},
|
||||
"supports-color": {
|
||||
"version": "5.5.0",
|
||||
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz",
|
||||
@@ -8503,14 +8508,12 @@
|
||||
"balanced-match": {
|
||||
"version": "1.0.0",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true
|
||||
"dev": true
|
||||
},
|
||||
"brace-expansion": {
|
||||
"version": "1.1.11",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"balanced-match": "^1.0.0",
|
||||
"concat-map": "0.0.1"
|
||||
@@ -8525,20 +8528,17 @@
|
||||
"code-point-at": {
|
||||
"version": "1.1.0",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true
|
||||
"dev": true
|
||||
},
|
||||
"concat-map": {
|
||||
"version": "0.0.1",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true
|
||||
"dev": true
|
||||
},
|
||||
"console-control-strings": {
|
||||
"version": "1.1.0",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true
|
||||
"dev": true
|
||||
},
|
||||
"core-util-is": {
|
||||
"version": "1.0.2",
|
||||
@@ -8655,8 +8655,7 @@
|
||||
"inherits": {
|
||||
"version": "2.0.3",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true
|
||||
"dev": true
|
||||
},
|
||||
"ini": {
|
||||
"version": "1.3.5",
|
||||
@@ -8668,7 +8667,6 @@
|
||||
"version": "1.0.0",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"number-is-nan": "^1.0.0"
|
||||
}
|
||||
@@ -8683,7 +8681,6 @@
|
||||
"version": "3.0.4",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"brace-expansion": "^1.1.7"
|
||||
}
|
||||
@@ -8795,8 +8792,7 @@
|
||||
"number-is-nan": {
|
||||
"version": "1.0.1",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true
|
||||
"dev": true
|
||||
},
|
||||
"object-assign": {
|
||||
"version": "4.1.1",
|
||||
@@ -8808,7 +8804,6 @@
|
||||
"version": "1.4.0",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"wrappy": "1"
|
||||
}
|
||||
@@ -8930,7 +8925,6 @@
|
||||
"version": "1.0.2",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"code-point-at": "^1.0.0",
|
||||
"is-fullwidth-code-point": "^1.0.0",
|
||||
@@ -10287,18 +10281,18 @@
|
||||
}
|
||||
},
|
||||
"strip-ansi": {
|
||||
"version": "5.0.0",
|
||||
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.0.0.tgz",
|
||||
"integrity": "sha512-Uu7gQyZI7J7gn5qLn1Np3G9vcYGTVqB+lFTytnDJv83dd8T22aGH451P3jueT2/QemInJDfxHB5Tde5OzgG1Ow==",
|
||||
"version": "5.1.0",
|
||||
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.1.0.tgz",
|
||||
"integrity": "sha512-TjxrkPONqO2Z8QDCpeE2j6n0M6EwxzyDgzEeGp+FbdvaJAt//ClYi6W5my+3ROlC/hZX2KACUwDfK49Ka5eDvg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"ansi-regex": "^4.0.0"
|
||||
"ansi-regex": "^4.1.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"ansi-regex": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.0.0.tgz",
|
||||
"integrity": "sha512-iB5Dda8t/UqpPI/IjsejXu5jOGDrzn41wJyljwPH65VCIbk6+1BzFIMJGFwTNrYXT1CrD+B4l19U7awiQ8rk7w==",
|
||||
"version": "4.1.0",
|
||||
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz",
|
||||
"integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==",
|
||||
"dev": true
|
||||
}
|
||||
}
|
||||
@@ -11846,9 +11840,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"source-map-support": {
|
||||
"version": "0.5.10",
|
||||
"resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.10.tgz",
|
||||
"integrity": "sha512-YfQ3tQFTK/yzlGJuX8pTwa4tifQj4QS2Mj7UegOu8jAz59MqIiMGPXxQhVQiIMNzayuUSF/jEuVnfFF5JqybmQ==",
|
||||
"version": "0.5.11",
|
||||
"resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.11.tgz",
|
||||
"integrity": "sha512-//sajEx/fGL3iw6fltKMdPvy8kL3kJ2O3iuYlRoT3k9Kb4BjOoZ+BZzaNHeuaruSt+Kf3Zk9tnfAQg9/AJqUVQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"buffer-from": "^1.0.0",
|
||||
@@ -12276,9 +12270,9 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"ansi-regex": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.0.0.tgz",
|
||||
"integrity": "sha512-iB5Dda8t/UqpPI/IjsejXu5jOGDrzn41wJyljwPH65VCIbk6+1BzFIMJGFwTNrYXT1CrD+B4l19U7awiQ8rk7w==",
|
||||
"version": "4.1.0",
|
||||
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz",
|
||||
"integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==",
|
||||
"dev": true
|
||||
},
|
||||
"ansi-styles": {
|
||||
@@ -12317,12 +12311,12 @@
|
||||
"dev": true
|
||||
},
|
||||
"strip-ansi": {
|
||||
"version": "5.0.0",
|
||||
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.0.0.tgz",
|
||||
"integrity": "sha512-Uu7gQyZI7J7gn5qLn1Np3G9vcYGTVqB+lFTytnDJv83dd8T22aGH451P3jueT2/QemInJDfxHB5Tde5OzgG1Ow==",
|
||||
"version": "5.1.0",
|
||||
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.1.0.tgz",
|
||||
"integrity": "sha512-TjxrkPONqO2Z8QDCpeE2j6n0M6EwxzyDgzEeGp+FbdvaJAt//ClYi6W5my+3ROlC/hZX2KACUwDfK49Ka5eDvg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"ansi-regex": "^4.0.0"
|
||||
"ansi-regex": "^4.1.0"
|
||||
}
|
||||
},
|
||||
"supports-color": {
|
||||
@@ -12998,18 +12992,25 @@
|
||||
}
|
||||
},
|
||||
"make-dir": {
|
||||
"version": "1.3.0",
|
||||
"resolved": "https://registry.npmjs.org/make-dir/-/make-dir-1.3.0.tgz",
|
||||
"integrity": "sha512-2w31R7SJtieJJnQtGc7RVL2StM2vGYVfqUOvUDxH6bC6aJTxPxTF0GnIgCyu7tjockiUWAYQRbxa7vKn34s5sQ==",
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz",
|
||||
"integrity": "sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"pify": "^3.0.0"
|
||||
"pify": "^4.0.1",
|
||||
"semver": "^5.6.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"pify": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz",
|
||||
"integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=",
|
||||
"version": "4.0.1",
|
||||
"resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz",
|
||||
"integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==",
|
||||
"dev": true
|
||||
},
|
||||
"semver": {
|
||||
"version": "5.6.0",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-5.6.0.tgz",
|
||||
"integrity": "sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg==",
|
||||
"dev": true
|
||||
}
|
||||
}
|
||||
@@ -13615,9 +13616,9 @@
|
||||
}
|
||||
},
|
||||
"node-releases": {
|
||||
"version": "1.1.8",
|
||||
"resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.8.tgz",
|
||||
"integrity": "sha512-gQm+K9mGCiT/NXHy+V/ZZS1N/LOaGGqRAAJJs3X9Ah1g+CIbRcBgNyoNYQ+SEtcyAtB9KqDruu+fF7nWjsqRaA==",
|
||||
"version": "1.1.11",
|
||||
"resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.11.tgz",
|
||||
"integrity": "sha512-8v1j5KfP+s5WOTa1spNUAOfreajQPN12JXbRR0oDE+YrJBQCXBnNqUDj27EKpPLOoSiU3tKi3xGPB+JaOdUEQQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"semver": "^5.3.0"
|
||||
@@ -14664,9 +14665,9 @@
|
||||
}
|
||||
},
|
||||
"p-limit": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.1.0.tgz",
|
||||
"integrity": "sha512-NhURkNcrVB+8hNfLuysU8enY5xn2KXphsHBaC2YmRNTZRc7RWusw6apSpdEj3jo4CMb6W9nrF6tTnsJsJeyu6g==",
|
||||
"version": "2.2.0",
|
||||
"resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.2.0.tgz",
|
||||
"integrity": "sha512-pZbTJpoUsCzV48Mc9Nh51VbwO0X9cuPFE8gYwx9BTCt9SF8/b7Zljd2fVgOxhIF/HDTKgpVzs+GPhyKfjLLFRQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"p-try": "^2.0.0"
|
||||
@@ -20079,20 +20080,31 @@
|
||||
}
|
||||
},
|
||||
"react": {
|
||||
"version": "16.7.0",
|
||||
"resolved": "https://registry.npmjs.org/react/-/react-16.7.0.tgz",
|
||||
"integrity": "sha512-StCz3QY8lxTb5cl2HJxjwLFOXPIFQp+p+hxQfc8WE0QiLfCtIlKj8/+5tjjKm8uSTlAW+fCPaavGFS06V9Ar3A==",
|
||||
"version": "16.8.4",
|
||||
"resolved": "https://registry.npmjs.org/react/-/react-16.8.4.tgz",
|
||||
"integrity": "sha512-0GQ6gFXfUH7aZcjGVymlPOASTuSjlQL4ZtVC5YKH+3JL6bBLCVO21DknzmaPlI90LN253ojj02nsapy+j7wIjg==",
|
||||
"requires": {
|
||||
"loose-envify": "^1.1.0",
|
||||
"object-assign": "^4.1.1",
|
||||
"prop-types": "^15.6.2",
|
||||
"scheduler": "^0.12.0"
|
||||
"scheduler": "^0.13.4"
|
||||
},
|
||||
"dependencies": {
|
||||
"scheduler": {
|
||||
"version": "0.13.4",
|
||||
"resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.13.4.tgz",
|
||||
"integrity": "sha512-cvSOlRPxOHs5dAhP9yiS/6IDmVAVxmk33f0CtTJRkmUWcb1Us+t7b1wqdzoC0REw2muC9V5f1L/w5R5uKGaepA==",
|
||||
"requires": {
|
||||
"loose-envify": "^1.1.0",
|
||||
"object-assign": "^4.1.1"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"react-app-polyfill": {
|
||||
"version": "0.2.1",
|
||||
"resolved": "https://registry.npmjs.org/react-app-polyfill/-/react-app-polyfill-0.2.1.tgz",
|
||||
"integrity": "sha512-rcpR+WKmLOoYGDAxXaLlxl5Sw6jqbcD1qg2Okn1Ta2RHCxLuQv75B9Em2L2GvuOTx3lAxDpNl/TYGWbKnO/Aag==",
|
||||
"version": "0.2.2",
|
||||
"resolved": "https://registry.npmjs.org/react-app-polyfill/-/react-app-polyfill-0.2.2.tgz",
|
||||
"integrity": "sha512-mAYn96B/nB6kWG87Ry70F4D4rsycU43VYTj3ZCbKP+SLJXwC0x6YCbwcICh3uW8/C9s1VgP197yx+w7SCWeDdQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"core-js": "2.6.4",
|
||||
@@ -20207,9 +20219,9 @@
|
||||
}
|
||||
},
|
||||
"react-dev-utils": {
|
||||
"version": "7.0.3",
|
||||
"resolved": "https://registry.npmjs.org/react-dev-utils/-/react-dev-utils-7.0.3.tgz",
|
||||
"integrity": "sha512-KEFsH1CewnmddPLXIuU+QWKTH/hpJKZClL2+74XN54NkPnR2KnB5gGmuQ0E7DwcCkUpdMxxqBX+rB7aB5sZS4A==",
|
||||
"version": "8.0.0",
|
||||
"resolved": "https://registry.npmjs.org/react-dev-utils/-/react-dev-utils-8.0.0.tgz",
|
||||
"integrity": "sha512-TK8cj7eghvxfe7bfBluLGpI/upo4EXC+G74hYmPucAG8C2XcbT+vKnlWPwLnABb75Zk+mR6D556Da+yvDjljrw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@babel/code-frame": "7.0.0",
|
||||
@@ -20221,6 +20233,7 @@
|
||||
"escape-string-regexp": "1.0.5",
|
||||
"filesize": "3.6.1",
|
||||
"find-up": "3.0.0",
|
||||
"fork-ts-checker-webpack-plugin": "1.0.0-alpha.6",
|
||||
"global-modules": "2.0.0",
|
||||
"globby": "8.0.2",
|
||||
"gzip-size": "5.0.0",
|
||||
@@ -20230,7 +20243,7 @@
|
||||
"loader-utils": "1.2.3",
|
||||
"opn": "5.4.0",
|
||||
"pkg-up": "2.0.0",
|
||||
"react-error-overlay": "^5.1.3",
|
||||
"react-error-overlay": "^5.1.4",
|
||||
"recursive-readdir": "2.2.2",
|
||||
"shell-quote": "1.6.1",
|
||||
"sockjs-client": "1.3.0",
|
||||
@@ -20370,9 +20383,9 @@
|
||||
}
|
||||
},
|
||||
"p-limit": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.1.0.tgz",
|
||||
"integrity": "sha512-NhURkNcrVB+8hNfLuysU8enY5xn2KXphsHBaC2YmRNTZRc7RWusw6apSpdEj3jo4CMb6W9nrF6tTnsJsJeyu6g==",
|
||||
"version": "2.2.0",
|
||||
"resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.2.0.tgz",
|
||||
"integrity": "sha512-pZbTJpoUsCzV48Mc9Nh51VbwO0X9cuPFE8gYwx9BTCt9SF8/b7Zljd2fVgOxhIF/HDTKgpVzs+GPhyKfjLLFRQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"p-try": "^2.0.0"
|
||||
@@ -20436,9 +20449,9 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"ansi-regex": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.0.0.tgz",
|
||||
"integrity": "sha512-iB5Dda8t/UqpPI/IjsejXu5jOGDrzn41wJyljwPH65VCIbk6+1BzFIMJGFwTNrYXT1CrD+B4l19U7awiQ8rk7w==",
|
||||
"version": "4.1.0",
|
||||
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz",
|
||||
"integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==",
|
||||
"dev": true
|
||||
}
|
||||
}
|
||||
@@ -20455,20 +20468,31 @@
|
||||
}
|
||||
},
|
||||
"react-dom": {
|
||||
"version": "16.7.0",
|
||||
"resolved": "https://registry.npmjs.org/react-dom/-/react-dom-16.7.0.tgz",
|
||||
"integrity": "sha512-D0Ufv1ExCAmF38P2Uh1lwpminZFRXEINJe53zRAbm4KPwSyd6DY/uDoS0Blj9jvPpn1+wivKpZYc8aAAN/nAkg==",
|
||||
"version": "16.8.4",
|
||||
"resolved": "https://registry.npmjs.org/react-dom/-/react-dom-16.8.4.tgz",
|
||||
"integrity": "sha512-Ob2wK7XG2tUDt7ps7LtLzGYYB6DXMCLj0G5fO6WeEICtT4/HdpOi7W/xLzZnR6RCG1tYza60nMdqtxzA8FaPJQ==",
|
||||
"requires": {
|
||||
"loose-envify": "^1.1.0",
|
||||
"object-assign": "^4.1.1",
|
||||
"prop-types": "^15.6.2",
|
||||
"scheduler": "^0.12.0"
|
||||
"scheduler": "^0.13.4"
|
||||
},
|
||||
"dependencies": {
|
||||
"scheduler": {
|
||||
"version": "0.13.4",
|
||||
"resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.13.4.tgz",
|
||||
"integrity": "sha512-cvSOlRPxOHs5dAhP9yiS/6IDmVAVxmk33f0CtTJRkmUWcb1Us+t7b1wqdzoC0REw2muC9V5f1L/w5R5uKGaepA==",
|
||||
"requires": {
|
||||
"loose-envify": "^1.1.0",
|
||||
"object-assign": "^4.1.1"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"react-error-overlay": {
|
||||
"version": "5.1.3",
|
||||
"resolved": "https://registry.npmjs.org/react-error-overlay/-/react-error-overlay-5.1.3.tgz",
|
||||
"integrity": "sha512-GoqeM3Xadie7XUApXOjkY3Qhs8RkwB/Za4WMedBGrOKH1eTuKGyoAECff7jiVonJchOx6KZ9i8ILO5XIoHB+Tg==",
|
||||
"version": "5.1.4",
|
||||
"resolved": "https://registry.npmjs.org/react-error-overlay/-/react-error-overlay-5.1.4.tgz",
|
||||
"integrity": "sha512-fp+U98OMZcnduQ+NSEiQa4s/XMsbp+5KlydmkbESOw4P69iWZ68ZMFM5a2BuE0FgqPBKApJyRuYHR95jM8lAmg==",
|
||||
"dev": true
|
||||
},
|
||||
"react-i18next": {
|
||||
@@ -20606,9 +20630,9 @@
|
||||
}
|
||||
},
|
||||
"react-scripts": {
|
||||
"version": "2.1.5",
|
||||
"resolved": "https://registry.npmjs.org/react-scripts/-/react-scripts-2.1.5.tgz",
|
||||
"integrity": "sha512-NaDKSxBLlU/jmO3TjTChz0PnnGToaQn0R/y4l4/Uk1vZdrIUsKCGdOWV1z0SJoRg7bFgNKxh55yS0qMr8rFwCg==",
|
||||
"version": "2.1.8",
|
||||
"resolved": "https://registry.npmjs.org/react-scripts/-/react-scripts-2.1.8.tgz",
|
||||
"integrity": "sha512-mDC8fYWCyuB9VROti8OCPdHE79UEchVVZmuS/yaIs47VkvZpgZqUvzghYBswZRchqnW0aARNY8xXrzoFRhhK7A==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@babel/core": "7.2.2",
|
||||
@@ -20618,21 +20642,20 @@
|
||||
"babel-jest": "23.6.0",
|
||||
"babel-loader": "8.0.5",
|
||||
"babel-plugin-named-asset-import": "^0.3.1",
|
||||
"babel-preset-react-app": "^7.0.1",
|
||||
"babel-preset-react-app": "^7.0.2",
|
||||
"bfj": "6.1.1",
|
||||
"case-sensitive-paths-webpack-plugin": "2.2.0",
|
||||
"css-loader": "1.0.0",
|
||||
"dotenv": "6.0.0",
|
||||
"dotenv-expand": "4.2.0",
|
||||
"eslint": "5.12.0",
|
||||
"eslint-config-react-app": "^3.0.7",
|
||||
"eslint-config-react-app": "^3.0.8",
|
||||
"eslint-loader": "2.1.1",
|
||||
"eslint-plugin-flowtype": "2.50.1",
|
||||
"eslint-plugin-import": "2.14.0",
|
||||
"eslint-plugin-jsx-a11y": "6.1.2",
|
||||
"eslint-plugin-react": "7.12.4",
|
||||
"file-loader": "2.0.0",
|
||||
"fork-ts-checker-webpack-plugin-alt": "0.4.14",
|
||||
"fs-extra": "7.0.1",
|
||||
"fsevents": "1.2.4",
|
||||
"html-webpack-plugin": "4.0.0-alpha.2",
|
||||
@@ -20648,8 +20671,8 @@
|
||||
"postcss-loader": "3.0.0",
|
||||
"postcss-preset-env": "6.5.0",
|
||||
"postcss-safe-parser": "4.0.1",
|
||||
"react-app-polyfill": "^0.2.1",
|
||||
"react-dev-utils": "^7.0.3",
|
||||
"react-app-polyfill": "^0.2.2",
|
||||
"react-dev-utils": "^8.0.0",
|
||||
"resolve": "1.10.0",
|
||||
"sass-loader": "7.1.0",
|
||||
"style-loader": "0.23.1",
|
||||
@@ -20894,9 +20917,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"regenerate-unicode-properties": {
|
||||
"version": "7.0.0",
|
||||
"resolved": "https://registry.npmjs.org/regenerate-unicode-properties/-/regenerate-unicode-properties-7.0.0.tgz",
|
||||
"integrity": "sha512-s5NGghCE4itSlUS+0WUj88G6cfMVMmH8boTPNvABf8od+2dhT9WDlWu8n01raQAJZMOK8Ch6jSexaRO7swd6aw==",
|
||||
"version": "8.0.2",
|
||||
"resolved": "https://registry.npmjs.org/regenerate-unicode-properties/-/regenerate-unicode-properties-8.0.2.tgz",
|
||||
"integrity": "sha512-SbA/iNrBUf6Pv2zU8Ekv1Qbhv92yxL4hiDa2siuxs4KKn4oOoMDHXjAf7+Nz9qinUQ46B1LcWEi/PhJfPWpZWQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"regenerate": "^1.4.0"
|
||||
@@ -20950,17 +20973,17 @@
|
||||
"dev": true
|
||||
},
|
||||
"regexpu-core": {
|
||||
"version": "4.4.0",
|
||||
"resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-4.4.0.tgz",
|
||||
"integrity": "sha512-eDDWElbwwI3K0Lo6CqbQbA6FwgtCz4kYTarrri1okfkRLZAqstU+B3voZBCjg8Fl6iq0gXrJG6MvRgLthfvgOA==",
|
||||
"version": "4.5.4",
|
||||
"resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-4.5.4.tgz",
|
||||
"integrity": "sha512-BtizvGtFQKGPUcTy56o3nk1bGRp4SZOTYrDtGNlqCQufptV5IkkLN6Emw+yunAJjzf+C9FQFtvq7IoA3+oMYHQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"regenerate": "^1.4.0",
|
||||
"regenerate-unicode-properties": "^7.0.0",
|
||||
"regenerate-unicode-properties": "^8.0.2",
|
||||
"regjsgen": "^0.5.0",
|
||||
"regjsparser": "^0.6.0",
|
||||
"unicode-match-property-ecmascript": "^1.0.4",
|
||||
"unicode-match-property-value-ecmascript": "^1.0.2"
|
||||
"unicode-match-property-value-ecmascript": "^1.1.0"
|
||||
}
|
||||
},
|
||||
"regjsgen": {
|
||||
@@ -21757,6 +21780,7 @@
|
||||
"version": "0.12.0",
|
||||
"resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.12.0.tgz",
|
||||
"integrity": "sha512-t7MBR28Akcp4Jm+QoR63XgAi9YgCUmgvDHqf5otgAj4QvdoBE4ImCX0ffehefePPG+aitiYHp0g/mW6s4Tp+dw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"loose-envify": "^1.1.0",
|
||||
"object-assign": "^4.1.1"
|
||||
@@ -21774,9 +21798,9 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"ajv": {
|
||||
"version": "6.9.2",
|
||||
"resolved": "https://registry.npmjs.org/ajv/-/ajv-6.9.2.tgz",
|
||||
"integrity": "sha512-4UFy0/LgDo7Oa/+wOAlj44tp9K78u38E5/359eSrqEp1Z5PdVfimCcs7SluXMP755RUQu6d2b4AvF0R1C9RZjg==",
|
||||
"version": "6.10.0",
|
||||
"resolved": "https://registry.npmjs.org/ajv/-/ajv-6.10.0.tgz",
|
||||
"integrity": "sha512-nffhOpkymDECQyR0mnsUtoCE8RlX38G0rYP+wgLWFyZuUyuuojSSvi/+euOiQBIn63whYwYVIIH1TvE3tu4OEg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"fast-deep-equal": "^2.0.1",
|
||||
@@ -22976,9 +23000,9 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"ajv": {
|
||||
"version": "6.9.2",
|
||||
"resolved": "https://registry.npmjs.org/ajv/-/ajv-6.9.2.tgz",
|
||||
"integrity": "sha512-4UFy0/LgDo7Oa/+wOAlj44tp9K78u38E5/359eSrqEp1Z5PdVfimCcs7SluXMP755RUQu6d2b4AvF0R1C9RZjg==",
|
||||
"version": "6.10.0",
|
||||
"resolved": "https://registry.npmjs.org/ajv/-/ajv-6.10.0.tgz",
|
||||
"integrity": "sha512-nffhOpkymDECQyR0mnsUtoCE8RlX38G0rYP+wgLWFyZuUyuuojSSvi/+euOiQBIn63whYwYVIIH1TvE3tu4OEg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"fast-deep-equal": "^2.0.1",
|
||||
@@ -22988,9 +23012,9 @@
|
||||
}
|
||||
},
|
||||
"ansi-regex": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.0.0.tgz",
|
||||
"integrity": "sha512-iB5Dda8t/UqpPI/IjsejXu5jOGDrzn41wJyljwPH65VCIbk6+1BzFIMJGFwTNrYXT1CrD+B4l19U7awiQ8rk7w==",
|
||||
"version": "4.1.0",
|
||||
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz",
|
||||
"integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==",
|
||||
"dev": true
|
||||
},
|
||||
"fast-deep-equal": {
|
||||
@@ -23012,23 +23036,23 @@
|
||||
"dev": true
|
||||
},
|
||||
"string-width": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/string-width/-/string-width-3.0.0.tgz",
|
||||
"integrity": "sha512-rr8CUxBbvOZDUvc5lNIJ+OC1nPVpz+Siw9VBtUjB9b6jZehZLFt0JMCZzShFHIsI8cbhm0EsNIfWJMFV3cu3Ew==",
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz",
|
||||
"integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"emoji-regex": "^7.0.1",
|
||||
"is-fullwidth-code-point": "^2.0.0",
|
||||
"strip-ansi": "^5.0.0"
|
||||
"strip-ansi": "^5.1.0"
|
||||
}
|
||||
},
|
||||
"strip-ansi": {
|
||||
"version": "5.0.0",
|
||||
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.0.0.tgz",
|
||||
"integrity": "sha512-Uu7gQyZI7J7gn5qLn1Np3G9vcYGTVqB+lFTytnDJv83dd8T22aGH451P3jueT2/QemInJDfxHB5Tde5OzgG1Ow==",
|
||||
"version": "5.1.0",
|
||||
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.1.0.tgz",
|
||||
"integrity": "sha512-TjxrkPONqO2Z8QDCpeE2j6n0M6EwxzyDgzEeGp+FbdvaJAt//ClYi6W5my+3ROlC/hZX2KACUwDfK49Ka5eDvg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"ansi-regex": "^4.0.0"
|
||||
"ansi-regex": "^4.1.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -23051,22 +23075,16 @@
|
||||
}
|
||||
},
|
||||
"terser": {
|
||||
"version": "3.16.1",
|
||||
"resolved": "https://registry.npmjs.org/terser/-/terser-3.16.1.tgz",
|
||||
"integrity": "sha512-JDJjgleBROeek2iBcSNzOHLKsB/MdDf+E/BOAJ0Tk9r7p9/fVobfv7LMJ/g/k3v9SXdmjZnIlFd5nfn/Rt0Xow==",
|
||||
"version": "3.17.0",
|
||||
"resolved": "https://registry.npmjs.org/terser/-/terser-3.17.0.tgz",
|
||||
"integrity": "sha512-/FQzzPJmCpjAH9Xvk2paiWrFq+5M6aVOf+2KRbwhByISDX/EujxsK+BAvrhb6H+2rtrLCHK9N01wO014vrIwVQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"commander": "~2.17.1",
|
||||
"commander": "^2.19.0",
|
||||
"source-map": "~0.6.1",
|
||||
"source-map-support": "~0.5.9"
|
||||
"source-map-support": "~0.5.10"
|
||||
},
|
||||
"dependencies": {
|
||||
"commander": {
|
||||
"version": "2.17.1",
|
||||
"resolved": "https://registry.npmjs.org/commander/-/commander-2.17.1.tgz",
|
||||
"integrity": "sha512-wPMUt6FnH2yzG95SA6mzjQOEKUU3aLaDEmzs1ti+1E9h+CsrZghRlqEM/EJ4KscsQVG8uNN4uVreUeT8+drlgg==",
|
||||
"dev": true
|
||||
},
|
||||
"source-map": {
|
||||
"version": "0.6.1",
|
||||
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
|
||||
@@ -23074,9 +23092,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"source-map-support": {
|
||||
"version": "0.5.10",
|
||||
"resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.10.tgz",
|
||||
"integrity": "sha512-YfQ3tQFTK/yzlGJuX8pTwa4tifQj4QS2Mj7UegOu8jAz59MqIiMGPXxQhVQiIMNzayuUSF/jEuVnfFF5JqybmQ==",
|
||||
"version": "0.5.11",
|
||||
"resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.11.tgz",
|
||||
"integrity": "sha512-//sajEx/fGL3iw6fltKMdPvy8kL3kJ2O3iuYlRoT3k9Kb4BjOoZ+BZzaNHeuaruSt+Kf3Zk9tnfAQg9/AJqUVQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"buffer-from": "^1.0.0",
|
||||
@@ -23385,21 +23403,15 @@
|
||||
"dev": true
|
||||
},
|
||||
"uglify-js": {
|
||||
"version": "3.4.9",
|
||||
"resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.4.9.tgz",
|
||||
"integrity": "sha512-8CJsbKOtEbnJsTyv6LE6m6ZKniqMiFWmm9sRbopbkGs3gMPPfd3Fh8iIA4Ykv5MgaTbqHr4BaoGLJLZNhsrW1Q==",
|
||||
"version": "3.4.10",
|
||||
"resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.4.10.tgz",
|
||||
"integrity": "sha512-Y2VsbPVs0FIshJztycsO2SfPk7/KAF/T72qzv9u5EpQ4kB2hQoHlhNQTsNyy6ul7lQtqJN/AoWeS23OzEiEFxw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"commander": "~2.17.1",
|
||||
"commander": "~2.19.0",
|
||||
"source-map": "~0.6.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"commander": {
|
||||
"version": "2.17.1",
|
||||
"resolved": "https://registry.npmjs.org/commander/-/commander-2.17.1.tgz",
|
||||
"integrity": "sha512-wPMUt6FnH2yzG95SA6mzjQOEKUU3aLaDEmzs1ti+1E9h+CsrZghRlqEM/EJ4KscsQVG8uNN4uVreUeT8+drlgg==",
|
||||
"dev": true
|
||||
},
|
||||
"source-map": {
|
||||
"version": "0.6.1",
|
||||
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
|
||||
@@ -23425,15 +23437,15 @@
|
||||
}
|
||||
},
|
||||
"unicode-match-property-value-ecmascript": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-1.0.2.tgz",
|
||||
"integrity": "sha512-Rx7yODZC1L/T8XKo/2kNzVAQaRE88AaMvI1EF/Xnj3GW2wzN6fop9DDWuFAKUVFH7vozkz26DzP0qyWLKLIVPQ==",
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-1.1.0.tgz",
|
||||
"integrity": "sha512-hDTHvaBk3RmFzvSl0UVrUmC3PuW9wKVnpoUDYH0JDkSIovzw+J5viQmeYHxVSBptubnr7PbH2e0fnpDRQnQl5g==",
|
||||
"dev": true
|
||||
},
|
||||
"unicode-property-aliases-ecmascript": {
|
||||
"version": "1.0.4",
|
||||
"resolved": "https://registry.npmjs.org/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-1.0.4.tgz",
|
||||
"integrity": "sha512-2WSLa6OdYd2ng8oqiGIWnJqyFArvhn+5vgx5GTxMbUYjCYKUcuKS62YLFF0R/BDGlB1yzXjQOLtPAfHsgirEpg==",
|
||||
"version": "1.0.5",
|
||||
"resolved": "https://registry.npmjs.org/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-1.0.5.tgz",
|
||||
"integrity": "sha512-L5RAqCfXqAwR3RriF8pM0lU0w4Ryf/GgzONwi6KnL1taJQa7x1TCxdJnILX59WIGOwR57IVxn7Nej0fz1Ny6fw==",
|
||||
"dev": true
|
||||
},
|
||||
"unified": {
|
||||
@@ -23912,9 +23924,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"ajv": {
|
||||
"version": "6.9.2",
|
||||
"resolved": "https://registry.npmjs.org/ajv/-/ajv-6.9.2.tgz",
|
||||
"integrity": "sha512-4UFy0/LgDo7Oa/+wOAlj44tp9K78u38E5/359eSrqEp1Z5PdVfimCcs7SluXMP755RUQu6d2b4AvF0R1C9RZjg==",
|
||||
"version": "6.10.0",
|
||||
"resolved": "https://registry.npmjs.org/ajv/-/ajv-6.10.0.tgz",
|
||||
"integrity": "sha512-nffhOpkymDECQyR0mnsUtoCE8RlX38G0rYP+wgLWFyZuUyuuojSSvi/+euOiQBIn63whYwYVIIH1TvE3tu4OEg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"fast-deep-equal": "^2.0.1",
|
||||
@@ -23974,9 +23986,9 @@
|
||||
}
|
||||
},
|
||||
"eslint-scope": {
|
||||
"version": "4.0.2",
|
||||
"resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.2.tgz",
|
||||
"integrity": "sha512-5q1+B/ogmHl8+paxtOKx38Z8LtWkVGuNt3+GQNErqwLl6ViNp/gdJGMCjZNxZ8j/VYjDNZ2Fo+eQc1TAVPIzbg==",
|
||||
"version": "4.0.3",
|
||||
"resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.3.tgz",
|
||||
"integrity": "sha512-p7VutNr1O/QrxysMo3E45FjYDTeXBy0iTltPFNSqKAIfjDSXC+4dj+qfyuD8bfAXrW/y6lW3O76VaYNPKfpKrg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"esrecurse": "^4.1.0",
|
||||
@@ -24436,16 +24448,22 @@
|
||||
}
|
||||
},
|
||||
"mem": {
|
||||
"version": "4.1.0",
|
||||
"resolved": "https://registry.npmjs.org/mem/-/mem-4.1.0.tgz",
|
||||
"integrity": "sha512-I5u6Q1x7wxO0kdOpYBB28xueHADYps5uty/zg936CiG8NTe5sJL8EjrCuLneuDW3PlMdZBGDIn8BirEVdovZvg==",
|
||||
"version": "4.2.0",
|
||||
"resolved": "https://registry.npmjs.org/mem/-/mem-4.2.0.tgz",
|
||||
"integrity": "sha512-5fJxa68urlY0Ir8ijatKa3eRz5lwXnRCTvo9+TbTGAuTFJOwpGcY0X05moBd0nW45965Njt4CDI2GFQoG8DvqA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"map-age-cleaner": "^0.1.1",
|
||||
"mimic-fn": "^1.0.0",
|
||||
"mimic-fn": "^2.0.0",
|
||||
"p-is-promise": "^2.0.0"
|
||||
}
|
||||
},
|
||||
"mimic-fn": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.0.0.tgz",
|
||||
"integrity": "sha512-jbex9Yd/3lmICXwYT6gA/j2mNQGU48wCh/VzRd+/Y/PjYQtlg1gLMdZqvu9s/xH7qKvngxRObl56XZR609IMbA==",
|
||||
"dev": true
|
||||
},
|
||||
"os-locale": {
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/os-locale/-/os-locale-3.1.0.tgz",
|
||||
@@ -24458,9 +24476,9 @@
|
||||
}
|
||||
},
|
||||
"p-limit": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.1.0.tgz",
|
||||
"integrity": "sha512-NhURkNcrVB+8hNfLuysU8enY5xn2KXphsHBaC2YmRNTZRc7RWusw6apSpdEj3jo4CMb6W9nrF6tTnsJsJeyu6g==",
|
||||
"version": "2.2.0",
|
||||
"resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.2.0.tgz",
|
||||
"integrity": "sha512-pZbTJpoUsCzV48Mc9Nh51VbwO0X9cuPFE8gYwx9BTCt9SF8/b7Zljd2fVgOxhIF/HDTKgpVzs+GPhyKfjLLFRQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"p-try": "^2.0.0"
|
||||
|
||||
+5
-5
@@ -13,10 +13,10 @@
|
||||
"@types/jest": "^23.3.13",
|
||||
"@types/lodash.debounce": "^4.0.4",
|
||||
"@types/node": "^10.12.18",
|
||||
"@types/react": "^16.7.20",
|
||||
"@types/react": "^16.8.8",
|
||||
"@types/react-bootstrap-daterangepicker": "0.0.26",
|
||||
"@types/react-bootstrap-typeahead": "^3.4.0",
|
||||
"@types/react-dom": "^16.0.11",
|
||||
"@types/react-dom": "^16.8.2",
|
||||
"@types/react-router-dom": "^4.3.1",
|
||||
"@types/react-table": "^6.7.21",
|
||||
"@types/reactstrap": "^6.4.4",
|
||||
@@ -33,7 +33,7 @@
|
||||
"node-sass-chokidar": "^1.3.4",
|
||||
"npm-run-all": "^4.1.5",
|
||||
"prettier": "^1.15.3",
|
||||
"react-scripts": "^2.1.5",
|
||||
"react-scripts": "^2.1.8",
|
||||
"react-test-renderer": "^16.7.0",
|
||||
"typescript": "^3.2.4"
|
||||
},
|
||||
@@ -53,11 +53,11 @@
|
||||
"lodash.debounce": "^4.0.8",
|
||||
"moment": "^2.23.0",
|
||||
"prop-types": "^15.6.2",
|
||||
"react": "^16.7.0",
|
||||
"react": "^16.8.4",
|
||||
"react-bootstrap-daterangepicker": "^4.1.0",
|
||||
"react-bootstrap-typeahead": "^3.2.4",
|
||||
"react-chartjs-2": "^2.7.4",
|
||||
"react-dom": "^16.7.0",
|
||||
"react-dom": "^16.8.4",
|
||||
"react-i18next": "^9.0.3",
|
||||
"react-router-dom": "^4.3.1",
|
||||
"react-table": "^6.8.6",
|
||||
|
||||
@@ -9,8 +9,6 @@
|
||||
"Total Queries ({{count}} clients)_plural": "Total Queries ({{count}} clients)",
|
||||
"Queries Blocked": "Queries Blocked",
|
||||
"Percent Blocked": "Percent Blocked",
|
||||
"Queries Over Last 24 Hours": "Queries Over Last 24 Hours",
|
||||
"Clients Over Last 24 Hours": "Clients Over Last 24 Hours",
|
||||
"Queries Answered By": "Queries Answered By",
|
||||
"Queries from {{from}} to {{to}}": "Queries from {{from}} to {{to}}",
|
||||
"Total Queries": "Total Queries",
|
||||
@@ -19,5 +17,7 @@
|
||||
"{{percent}}% of {{total}}": "{{percent}}% of {{total}}",
|
||||
"No Clients Found": "No Clients Found",
|
||||
"No Domains Found": "No Domains Found",
|
||||
"Queries Answered By Destination": "Queries Answered By Destination"
|
||||
"Queries Answered By Destination": "Queries Answered By Destination",
|
||||
"Queries Over {{range}}": "Queries Over {{range}}",
|
||||
"Clients Over {{range}}": "Clients Over {{range}}"
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"Last 24 Hours": "Last 24 Hours",
|
||||
"Today": "Today",
|
||||
"Yesterday": "Yesterday",
|
||||
"Last 7 Days": "Last 7 Days",
|
||||
"Last 30 Days": "Last 30 Days",
|
||||
"This Month": "This Month",
|
||||
"Last Month": "Last Month",
|
||||
"This Year": "This Year",
|
||||
"All Time": "All Time"
|
||||
}
|
||||
@@ -14,7 +14,7 @@ import React, { Component, FormEvent } from "react";
|
||||
import { WithNamespaces, withNamespaces } from "react-i18next";
|
||||
import NavButton from "./NavButton";
|
||||
import NavDropdown from "./NavDropdown";
|
||||
import { StatusContext } from "./context";
|
||||
import { StatusContext } from "./context/StatusContext";
|
||||
import { CancelablePromise, makeCancelable } from "../../util";
|
||||
import api from "../../util/api";
|
||||
import {
|
||||
|
||||
@@ -10,6 +10,8 @@
|
||||
|
||||
import React, { MouseEvent } from "react";
|
||||
import { Link } from "react-router-dom";
|
||||
import { TimeRangeSelectorContainer } from "../dashboard/TimeRangeSelector";
|
||||
import api from "../../util/api";
|
||||
|
||||
//const sidebarToggle = e => {
|
||||
// e.preventDefault();
|
||||
@@ -70,6 +72,11 @@ export default () => (
|
||||
☰
|
||||
</button>
|
||||
</li>
|
||||
{api.loggedIn && window.location.pathname.endsWith("/dashboard") ? (
|
||||
<li>
|
||||
<TimeRangeSelectorContainer />
|
||||
</li>
|
||||
) : null}
|
||||
</ul>
|
||||
</header>
|
||||
);
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
* Please see LICENSE file for your rights under this license. */
|
||||
|
||||
import React from "react";
|
||||
import { PreferencesContext } from "./context";
|
||||
import { PreferencesContext } from "./context/PreferencesContext";
|
||||
import i18n from "i18next";
|
||||
|
||||
const applyLanguage = (language: string) => {
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
* Please see LICENSE file for your rights under this license. */
|
||||
|
||||
import React from "react";
|
||||
import { PreferencesContext } from "./context";
|
||||
import { PreferencesContext } from "./context/PreferencesContext";
|
||||
|
||||
/**
|
||||
* Update the web interface layout
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
import React, { Component } from "react";
|
||||
import { WithNamespaces, withNamespaces } from "react-i18next";
|
||||
import { StatusContext } from "./context";
|
||||
import { StatusContext } from "./context/StatusContext";
|
||||
|
||||
export interface StatusBadgeProps extends WithNamespaces {
|
||||
status: string;
|
||||
|
||||
@@ -19,6 +19,11 @@ export interface WithAPIDataProps<T> {
|
||||
interval: number;
|
||||
};
|
||||
|
||||
/**
|
||||
* If the data should be cleared when the props update. Defaults to true.
|
||||
*/
|
||||
flushOnUpdate: boolean;
|
||||
|
||||
/**
|
||||
* Render the children before the first API request is done
|
||||
*/
|
||||
@@ -61,7 +66,8 @@ export class WithAPIData<T> extends Component<
|
||||
repeatOptions: {
|
||||
ignoreCancel: true,
|
||||
interval: 0
|
||||
}
|
||||
},
|
||||
flushOnUpdate: true
|
||||
};
|
||||
|
||||
state: WithAPIDataState<T> = {
|
||||
@@ -132,6 +138,24 @@ export class WithAPIData<T> extends Component<
|
||||
}
|
||||
}
|
||||
|
||||
componentDidUpdate(
|
||||
prevProps: Readonly<WithAPIDataProps<T>>,
|
||||
prevState: Readonly<WithAPIDataState<T>>,
|
||||
snapshot?: any
|
||||
): void {
|
||||
if (prevProps === this.props) {
|
||||
// Don't do anything if the props didn't change
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.props.flushOnUpdate) {
|
||||
// The props changed, so trigger a full reload of the data. Current data is
|
||||
// cleared so that loading indicators are shown.
|
||||
this.setState({ apiResult: null });
|
||||
this.loadData();
|
||||
}
|
||||
}
|
||||
|
||||
render() {
|
||||
if (!this.state.apiResult) {
|
||||
return this.props.renderInitial();
|
||||
|
||||
+24
-65
@@ -3,32 +3,32 @@
|
||||
* Network-wide ad blocking via your own hardware.
|
||||
*
|
||||
* Web Interface
|
||||
* React context objects
|
||||
* Preferences context
|
||||
*
|
||||
* This file is copyright under the latest version of the EUPL.
|
||||
* Please see LICENSE file for your rights under this license. */
|
||||
|
||||
import React, { ReactNode } from "react";
|
||||
import { WithAPIData } from "./WithAPIData";
|
||||
import api from "../../util/api";
|
||||
|
||||
export interface StatusContextType {
|
||||
status: Status;
|
||||
refresh: (data?: ApiStatus) => void;
|
||||
}
|
||||
import { WithAPIData } from "../WithAPIData";
|
||||
import api from "../../../util/api";
|
||||
|
||||
/**
|
||||
* The data shared by the preferences context
|
||||
*/
|
||||
export interface PreferencesContextType {
|
||||
settings: ApiPreferences;
|
||||
refresh: (data?: ApiPreferences) => void;
|
||||
}
|
||||
|
||||
/**
|
||||
* The key used to store preferences in local storage
|
||||
*/
|
||||
export const WEB_PREFERENCES_STORAGE_KEY = "webPreferences";
|
||||
|
||||
const initialStatus: StatusContextType = {
|
||||
status: "unknown",
|
||||
refresh: () => {}
|
||||
};
|
||||
|
||||
/**
|
||||
* The default preferences. These preferences are used until the API responds
|
||||
* with the real preferences, unless there are cached preferences available.
|
||||
*/
|
||||
export const defaultPreferences: ApiPreferences = {
|
||||
layout: "boxed",
|
||||
language: "en"
|
||||
@@ -55,62 +55,19 @@ export const loadInitialPreferences = (): ApiPreferences => {
|
||||
}
|
||||
};
|
||||
|
||||
const initialPreferences: PreferencesContextType = {
|
||||
/**
|
||||
* The context which will be used initially, until the API responds with the
|
||||
* real preferences. These preferences are loaded from cache if available.
|
||||
*/
|
||||
const initialContext: PreferencesContextType = {
|
||||
settings: loadInitialPreferences(),
|
||||
refresh: () => {}
|
||||
};
|
||||
|
||||
export const StatusContext = React.createContext(initialStatus);
|
||||
export const PreferencesContext = React.createContext(initialPreferences);
|
||||
|
||||
/**
|
||||
* Provide all of the necessary context needed at the root level to its
|
||||
* children. Currently, this includes status and preferences.
|
||||
* The React context which provides the preferences to consumers
|
||||
*/
|
||||
export const GlobalContextProvider = ({
|
||||
children
|
||||
}: {
|
||||
children: ReactNode;
|
||||
}) => (
|
||||
<StatusProvider>
|
||||
<PreferencesProvider>{children}</PreferencesProvider>
|
||||
</StatusProvider>
|
||||
);
|
||||
|
||||
/**
|
||||
* Provide the blocking status via React context.
|
||||
* Sub-components can use the `StatusContext.Consumer` component to get the
|
||||
* status.
|
||||
*/
|
||||
export const StatusProvider = ({
|
||||
children,
|
||||
...props
|
||||
}: {
|
||||
children: ReactNode;
|
||||
}) => (
|
||||
<WithAPIData
|
||||
apiCall={api.getStatus}
|
||||
repeatOptions={{ interval: 5000, ignoreCancel: true }}
|
||||
renderInitial={() => (
|
||||
<StatusContext.Provider value={initialStatus} {...props}>
|
||||
{children}
|
||||
</StatusContext.Provider>
|
||||
)}
|
||||
renderOk={(data, refresh) => (
|
||||
<StatusContext.Provider
|
||||
value={{ status: data.status, refresh }}
|
||||
{...props}
|
||||
>
|
||||
{children}
|
||||
</StatusContext.Provider>
|
||||
)}
|
||||
renderErr={(_, refresh) => (
|
||||
<StatusContext.Provider value={{ status: "unknown", refresh }} {...props}>
|
||||
{children}
|
||||
</StatusContext.Provider>
|
||||
)}
|
||||
/>
|
||||
);
|
||||
export const PreferencesContext = React.createContext(initialContext);
|
||||
|
||||
/**
|
||||
* Provide the web interface preferences via React context.
|
||||
@@ -126,7 +83,7 @@ export const PreferencesProvider = ({
|
||||
<WithAPIData
|
||||
apiCall={api.getPreferences}
|
||||
renderInitial={() => (
|
||||
<PreferencesContext.Provider value={initialPreferences} {...props}>
|
||||
<PreferencesContext.Provider value={initialContext} {...props}>
|
||||
{children}
|
||||
</PreferencesContext.Provider>
|
||||
)}
|
||||
@@ -145,7 +102,9 @@ export const PreferencesProvider = ({
|
||||
}}
|
||||
renderErr={(_, refresh) => (
|
||||
<PreferencesContext.Provider
|
||||
value={{ settings: { layout: "boxed", language: "en" }, refresh }}
|
||||
// Reload the initial settings here, as the cache may have been updated
|
||||
// between page load and when the error occurred
|
||||
value={{ settings: loadInitialPreferences(), refresh }}
|
||||
{...props}
|
||||
>
|
||||
{children}
|
||||
@@ -0,0 +1,74 @@
|
||||
/* Pi-hole: A black hole for Internet advertisements
|
||||
* (c) 2019 Pi-hole, LLC (https://pi-hole.net)
|
||||
* Network-wide ad blocking via your own hardware.
|
||||
*
|
||||
* Web Interface
|
||||
* Status context
|
||||
*
|
||||
* This file is copyright under the latest version of the EUPL.
|
||||
* Please see LICENSE file for your rights under this license. */
|
||||
|
||||
import React, { ReactNode } from "react";
|
||||
import { WithAPIData } from "../WithAPIData";
|
||||
import api from "../../../util/api";
|
||||
|
||||
/**
|
||||
* The data shared by the status context
|
||||
*/
|
||||
export interface StatusContextType {
|
||||
status: Status;
|
||||
refresh: (data?: ApiStatus) => void;
|
||||
}
|
||||
|
||||
/**
|
||||
* The status data which will be used initially, until the API responds with the
|
||||
* real status data.
|
||||
*/
|
||||
const initialContext: StatusContextType = {
|
||||
status: "unknown",
|
||||
refresh: () => {}
|
||||
};
|
||||
|
||||
/**
|
||||
* The React context which provides the status data to consumers
|
||||
*/
|
||||
export const StatusContext = React.createContext(initialContext);
|
||||
|
||||
/**
|
||||
* Provide the blocking status via React context.
|
||||
* Sub-components can use the `StatusContext.Consumer` component to get the
|
||||
* status.
|
||||
*/
|
||||
export const StatusProvider = ({
|
||||
children,
|
||||
...props
|
||||
}: {
|
||||
children: ReactNode;
|
||||
}) => (
|
||||
<WithAPIData
|
||||
apiCall={api.getStatus}
|
||||
repeatOptions={{ interval: 5000, ignoreCancel: true }}
|
||||
flushOnUpdate={false}
|
||||
renderInitial={() => (
|
||||
<StatusContext.Provider value={initialContext} {...props}>
|
||||
{children}
|
||||
</StatusContext.Provider>
|
||||
)}
|
||||
renderOk={(data, refresh) => (
|
||||
<StatusContext.Provider
|
||||
value={{ status: data.status, refresh }}
|
||||
{...props}
|
||||
>
|
||||
{children}
|
||||
</StatusContext.Provider>
|
||||
)}
|
||||
renderErr={(_, refresh) => (
|
||||
<StatusContext.Provider
|
||||
value={{ status: initialContext.status, refresh }}
|
||||
{...props}
|
||||
>
|
||||
{children}
|
||||
</StatusContext.Provider>
|
||||
)}
|
||||
/>
|
||||
);
|
||||
@@ -0,0 +1,63 @@
|
||||
/* Pi-hole: A black hole for Internet advertisements
|
||||
* (c) 2019 Pi-hole, LLC (https://pi-hole.net)
|
||||
* Network-wide ad blocking via your own hardware.
|
||||
*
|
||||
* Web Interface
|
||||
* Context used for sharing a time range
|
||||
*
|
||||
* This file is copyright under the latest version of the EUPL.
|
||||
* Please see LICENSE file for your rights under this license. */
|
||||
|
||||
import { Moment } from "moment";
|
||||
import React, { ReactNode, useState } from "react";
|
||||
|
||||
/**
|
||||
* Represents a range of time
|
||||
*/
|
||||
export interface TimeRange {
|
||||
from: Moment;
|
||||
until: Moment;
|
||||
name: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* The type of the data shared by the time range context
|
||||
*/
|
||||
export interface TimeRangeContextType {
|
||||
range: TimeRange | null;
|
||||
|
||||
/**
|
||||
* Update the time range
|
||||
*
|
||||
* @param range The new time range
|
||||
*/
|
||||
update: (range: TimeRange | null) => void;
|
||||
}
|
||||
|
||||
/**
|
||||
* The initial data shared by the time range context
|
||||
*/
|
||||
const initialContext: TimeRangeContextType = {
|
||||
range: null,
|
||||
update: () => {}
|
||||
};
|
||||
|
||||
/**
|
||||
* The React context which provides the time range to consumers
|
||||
*/
|
||||
export const TimeRangeContext = React.createContext(initialContext);
|
||||
|
||||
/**
|
||||
* Provide the time range via React context.
|
||||
* Sub-components can use the `TimeRangeContext.Consumer` component to get the
|
||||
* time range.
|
||||
*/
|
||||
export const TimeRangeProvider = ({ children }: { children: ReactNode }) => {
|
||||
const [range, setRange] = useState(initialContext.range);
|
||||
|
||||
return (
|
||||
<TimeRangeContext.Provider value={{ range, update: setRange }}>
|
||||
{children}
|
||||
</TimeRangeContext.Provider>
|
||||
);
|
||||
};
|
||||
+1
-1
@@ -12,7 +12,7 @@ import {
|
||||
defaultPreferences,
|
||||
loadInitialPreferences,
|
||||
WEB_PREFERENCES_STORAGE_KEY
|
||||
} from "../context";
|
||||
} from "../PreferencesContext";
|
||||
|
||||
it("loads the default preferences if none are cached", () => {
|
||||
const preferences = loadInitialPreferences();
|
||||
@@ -0,0 +1,31 @@
|
||||
/* Pi-hole: A black hole for Internet advertisements
|
||||
* (c) 2019 Pi-hole, LLC (https://pi-hole.net)
|
||||
* Network-wide ad blocking via your own hardware.
|
||||
*
|
||||
* Web Interface
|
||||
* React context objects
|
||||
*
|
||||
* This file is copyright under the latest version of the EUPL.
|
||||
* Please see LICENSE file for your rights under this license. */
|
||||
|
||||
import React, { ReactNode } from "react";
|
||||
import { StatusProvider } from "./StatusContext";
|
||||
import { PreferencesProvider } from "./PreferencesContext";
|
||||
import { TimeRangeProvider } from "./TimeRangeContext";
|
||||
|
||||
/**
|
||||
* Provide all of the necessary context needed at the root level to the
|
||||
* children. Currently, this includes status, preferences, and time range (for
|
||||
* the dashboard).
|
||||
*/
|
||||
export const GlobalContextProvider = ({
|
||||
children
|
||||
}: {
|
||||
children: ReactNode;
|
||||
}) => (
|
||||
<StatusProvider>
|
||||
<PreferencesProvider>
|
||||
<TimeRangeProvider>{children}</TimeRangeProvider>
|
||||
</PreferencesProvider>
|
||||
</StatusProvider>
|
||||
);
|
||||
@@ -12,15 +12,21 @@ import React, { Component, RefObject } from "react";
|
||||
import ReactDOM from "react-dom";
|
||||
import { Line } from "react-chartjs-2";
|
||||
import { WithNamespaces, withNamespaces } from "react-i18next";
|
||||
import { padNumber } from "../../util";
|
||||
import { getIntervalForRange, padNumber } from "../../util";
|
||||
import api from "../../util/api";
|
||||
import ChartTooltip from "./ChartTooltip";
|
||||
import { WithAPIData } from "../common/WithAPIData";
|
||||
import { ChartDataSets, ChartOptions } from "chart.js";
|
||||
import { ChartDataSets, ChartOptions, TimeUnit } from "chart.js";
|
||||
import {
|
||||
TimeRange,
|
||||
TimeRangeContext
|
||||
} from "../common/context/TimeRangeContext";
|
||||
|
||||
export interface ClientsGraphProps {
|
||||
loading: boolean;
|
||||
labels: Array<string>;
|
||||
timeUnit: TimeUnit;
|
||||
rangeName?: string;
|
||||
datasets: Array<ChartDataSets>;
|
||||
}
|
||||
|
||||
@@ -69,7 +75,7 @@ class ClientsGraph extends Component<ClientsGraphProps & WithNamespaces, {}> {
|
||||
{
|
||||
type: "time",
|
||||
time: {
|
||||
unit: "hour",
|
||||
unit: this.props.timeUnit,
|
||||
displayFormats: { hour: "HH:mm" },
|
||||
tooltipFormat: "HH:mm"
|
||||
}
|
||||
@@ -85,9 +91,15 @@ class ClientsGraph extends Component<ClientsGraphProps & WithNamespaces, {}> {
|
||||
maintainAspectRatio: false
|
||||
};
|
||||
|
||||
const range = this.props.rangeName
|
||||
? this.props.rangeName
|
||||
: t("Last 24 Hours");
|
||||
|
||||
return (
|
||||
<div className="card">
|
||||
<div className="card-header">{t("Clients Over Last 24 Hours")}</div>
|
||||
<div className="card-header">
|
||||
{t("Clients Over {{range}}", { range })}
|
||||
</div>
|
||||
<div className="card-body">
|
||||
<Line
|
||||
width={970}
|
||||
@@ -131,13 +143,26 @@ class ClientsGraph extends Component<ClientsGraphProps & WithNamespaces, {}> {
|
||||
/**
|
||||
* Transform the API data into props for ClientsGraph
|
||||
*
|
||||
* @param data the API data
|
||||
* @param data The API data
|
||||
* @param range The time range to use
|
||||
* @returns {{labels: Date[], datasets: Array, loading: boolean}} ClientsGraph
|
||||
* props
|
||||
*/
|
||||
export const transformData = (data: ApiClientsGraph) => {
|
||||
// Remove last data point as it's not yet finished
|
||||
const overTime = data.over_time.slice(0, -1);
|
||||
export const transformData = (
|
||||
data: ApiClientsGraph,
|
||||
range: TimeRange | null
|
||||
) => {
|
||||
let timeUnit: TimeUnit = "hour";
|
||||
let overTime = data.over_time;
|
||||
|
||||
if (range) {
|
||||
if (range.until.diff(range.from, "day") > 1) {
|
||||
timeUnit = "day";
|
||||
}
|
||||
} else {
|
||||
// Remove last data point as it's not yet finished
|
||||
overTime = data.over_time.slice(0, -1);
|
||||
}
|
||||
|
||||
const colors = [
|
||||
"#20a8d8",
|
||||
@@ -186,33 +211,64 @@ export const transformData = (data: ApiClientsGraph) => {
|
||||
|
||||
datasets.sort((a, b) => a.label!.localeCompare(b.label!));
|
||||
|
||||
return { labels, datasets, loading: false };
|
||||
return {
|
||||
labels,
|
||||
datasets,
|
||||
loading: false,
|
||||
timeUnit,
|
||||
rangeName: range ? range.name : undefined
|
||||
};
|
||||
};
|
||||
|
||||
/**
|
||||
* The props used to show a loading state (either initial load or error)
|
||||
*/
|
||||
export const loadingProps = {
|
||||
export const loadingProps: ClientsGraphProps = {
|
||||
loading: true,
|
||||
labels: [],
|
||||
timeUnit: "hour",
|
||||
rangeName: "---",
|
||||
datasets: []
|
||||
};
|
||||
|
||||
export const TranslatedClientsGraph = withNamespaces("dashboard")(ClientsGraph);
|
||||
export const TranslatedClientsGraph = withNamespaces([
|
||||
"dashboard",
|
||||
"time-ranges"
|
||||
])(ClientsGraph);
|
||||
|
||||
export default (props: any) => (
|
||||
<WithAPIData
|
||||
apiCall={api.getClientsGraph}
|
||||
repeatOptions={{
|
||||
interval: 10 * 60 * 1000,
|
||||
ignoreCancel: true
|
||||
}}
|
||||
renderInitial={() => (
|
||||
<TranslatedClientsGraph {...loadingProps} {...props} />
|
||||
<TimeRangeContext.Consumer>
|
||||
{context => (
|
||||
<WithAPIData
|
||||
apiCall={() =>
|
||||
context.range
|
||||
? api.getClientsGraphDb(
|
||||
context.range,
|
||||
getIntervalForRange(context.range)
|
||||
)
|
||||
: api.getClientsGraph()
|
||||
}
|
||||
repeatOptions={
|
||||
context.range
|
||||
? undefined
|
||||
: {
|
||||
interval: 10 * 60 * 1000,
|
||||
ignoreCancel: true
|
||||
}
|
||||
}
|
||||
renderInitial={() => (
|
||||
<TranslatedClientsGraph {...loadingProps} {...props} />
|
||||
)}
|
||||
renderOk={data => (
|
||||
<TranslatedClientsGraph
|
||||
{...transformData(data, context.range)}
|
||||
{...props}
|
||||
/>
|
||||
)}
|
||||
renderErr={() => (
|
||||
<TranslatedClientsGraph {...loadingProps} {...props} />
|
||||
)}
|
||||
/>
|
||||
)}
|
||||
renderOk={data => (
|
||||
<TranslatedClientsGraph {...transformData(data)} {...props} />
|
||||
)}
|
||||
renderErr={() => <TranslatedClientsGraph {...loadingProps} {...props} />}
|
||||
/>
|
||||
</TimeRangeContext.Consumer>
|
||||
);
|
||||
|
||||
@@ -10,15 +10,21 @@
|
||||
|
||||
import React, { Component } from "react";
|
||||
import { WithNamespaces, withNamespaces } from "react-i18next";
|
||||
import { padNumber } from "../../util";
|
||||
import { getIntervalForRange, padNumber } from "../../util";
|
||||
import api from "../../util/api";
|
||||
import { WithAPIData } from "../common/WithAPIData";
|
||||
import { ChartData, ChartOptions } from "chart.js";
|
||||
import { ChartData, ChartOptions, TimeUnit } from "chart.js";
|
||||
import { Line } from "react-chartjs-2";
|
||||
import {
|
||||
TimeRange,
|
||||
TimeRangeContext
|
||||
} from "../common/context/TimeRangeContext";
|
||||
|
||||
export interface QueriesGraphProps {
|
||||
loading: boolean;
|
||||
labels: Array<Date>;
|
||||
timeUnit: TimeUnit;
|
||||
rangeName?: string;
|
||||
domains_over_time: Array<number>;
|
||||
blocked_over_time: Array<number>;
|
||||
}
|
||||
@@ -107,7 +113,7 @@ class QueriesGraph extends Component<QueriesGraphProps & WithNamespaces, {}> {
|
||||
{
|
||||
type: "time",
|
||||
time: {
|
||||
unit: "hour",
|
||||
unit: this.props.timeUnit,
|
||||
displayFormats: { hour: "HH:mm" },
|
||||
tooltipFormat: "HH:mm"
|
||||
}
|
||||
@@ -122,9 +128,15 @@ class QueriesGraph extends Component<QueriesGraphProps & WithNamespaces, {}> {
|
||||
maintainAspectRatio: false
|
||||
};
|
||||
|
||||
const range = this.props.rangeName
|
||||
? this.props.rangeName
|
||||
: t("Last 24 Hours");
|
||||
|
||||
return (
|
||||
<div className="card">
|
||||
<div className="card-header">{t("Queries Over Last 24 Hours")}</div>
|
||||
<div className="card-header">
|
||||
{t("Queries Over {{range}}", { range })}
|
||||
</div>
|
||||
<div className="card-body">
|
||||
<Line width={970} height={170} data={data} options={options} />
|
||||
</div>
|
||||
@@ -152,15 +164,24 @@ class QueriesGraph extends Component<QueriesGraphProps & WithNamespaces, {}> {
|
||||
/**
|
||||
* Transform the API data into props for QueriesGraph
|
||||
*
|
||||
* @param data the API data
|
||||
* @returns {{loading: boolean, labels: Date[], domains_over_time: *,
|
||||
* blocked_over_time: any[]}} QueriesGraph props
|
||||
* @param data The API data
|
||||
* @param range The time range to use
|
||||
* @returns QueriesGraphProps QueriesGraph props
|
||||
*/
|
||||
export const transformData = (
|
||||
data: Array<ApiHistoryGraphItem>
|
||||
data: Array<ApiHistoryGraphItem>,
|
||||
range: TimeRange | null
|
||||
): QueriesGraphProps => {
|
||||
// Remove last data point as it's not yet finished
|
||||
data = data.slice(0, -1);
|
||||
let timeUnit: TimeUnit = "hour";
|
||||
|
||||
if (range) {
|
||||
if (range.until.diff(range.from, "day") > 1) {
|
||||
timeUnit = "day";
|
||||
}
|
||||
} else {
|
||||
// Remove last data point as it's not yet finished
|
||||
data = data.slice(0, -1);
|
||||
}
|
||||
|
||||
const labels = data.map(step => new Date(1000 * step.timestamp));
|
||||
const domains_over_time = data.map(step => step.total_queries);
|
||||
@@ -169,6 +190,8 @@ export const transformData = (
|
||||
return {
|
||||
loading: false,
|
||||
labels,
|
||||
timeUnit,
|
||||
rangeName: range ? range.name : undefined,
|
||||
domains_over_time,
|
||||
blocked_over_time
|
||||
};
|
||||
@@ -177,28 +200,53 @@ export const transformData = (
|
||||
/**
|
||||
* The props used to show a loading state (either initial load or error)
|
||||
*/
|
||||
export const loadingProps = {
|
||||
export const loadingProps: QueriesGraphProps = {
|
||||
loading: true,
|
||||
labels: [],
|
||||
timeUnit: "hour",
|
||||
rangeName: "---",
|
||||
domains_over_time: [],
|
||||
blocked_over_time: []
|
||||
};
|
||||
|
||||
export const TranslatedQueriesGraph = withNamespaces("dashboard")(QueriesGraph);
|
||||
export const TranslatedQueriesGraph = withNamespaces([
|
||||
"dashboard",
|
||||
"time-ranges"
|
||||
])(QueriesGraph);
|
||||
|
||||
export default (props: any) => (
|
||||
<WithAPIData
|
||||
apiCall={api.getHistoryGraph}
|
||||
repeatOptions={{
|
||||
interval: 10 * 60 * 1000,
|
||||
ignoreCancel: true
|
||||
}}
|
||||
renderInitial={() => (
|
||||
<TranslatedQueriesGraph {...loadingProps} {...props} />
|
||||
<TimeRangeContext.Consumer>
|
||||
{context => (
|
||||
<WithAPIData
|
||||
apiCall={() =>
|
||||
context.range
|
||||
? api.getHistoryGraphDb(
|
||||
context.range,
|
||||
getIntervalForRange(context.range)
|
||||
)
|
||||
: api.getHistoryGraph()
|
||||
}
|
||||
repeatOptions={
|
||||
context.range
|
||||
? undefined
|
||||
: {
|
||||
interval: 10 * 60 * 1000,
|
||||
ignoreCancel: true
|
||||
}
|
||||
}
|
||||
renderInitial={() => (
|
||||
<TranslatedQueriesGraph {...loadingProps} {...props} />
|
||||
)}
|
||||
renderOk={data => (
|
||||
<TranslatedQueriesGraph
|
||||
{...transformData(data, context.range)}
|
||||
{...props}
|
||||
/>
|
||||
)}
|
||||
renderErr={() => (
|
||||
<TranslatedQueriesGraph {...loadingProps} {...props} />
|
||||
)}
|
||||
/>
|
||||
)}
|
||||
renderOk={data => (
|
||||
<TranslatedQueriesGraph {...transformData(data)} {...props} />
|
||||
)}
|
||||
renderErr={() => <TranslatedQueriesGraph {...loadingProps} {...props} />}
|
||||
/>
|
||||
</TimeRangeContext.Consumer>
|
||||
);
|
||||
|
||||
@@ -12,11 +12,15 @@ import React from "react";
|
||||
import { WithNamespaces, withNamespaces } from "react-i18next";
|
||||
import api from "../../util/api";
|
||||
import GenericDoughnutChart from "./GenericDoughnutChart";
|
||||
import { TimeRangeContext } from "../common/context/TimeRangeContext";
|
||||
|
||||
const QueryTypesChart = ({ t }: WithNamespaces) => (
|
||||
const QueryTypesChart = ({
|
||||
t,
|
||||
apiCall
|
||||
}: WithNamespaces & { apiCall: () => Promise<Array<ApiQueryType>> }) => (
|
||||
<GenericDoughnutChart
|
||||
title={t("Query Types")}
|
||||
apiCall={api.getQueryTypes}
|
||||
apiCall={apiCall}
|
||||
apiHandler={data => {
|
||||
const total = data.reduce(
|
||||
(previous, current) => previous + current.count,
|
||||
@@ -31,4 +35,19 @@ const QueryTypesChart = ({ t }: WithNamespaces) => (
|
||||
/>
|
||||
);
|
||||
|
||||
export default withNamespaces("dashboard")(QueryTypesChart);
|
||||
export const QueryTypesChartContainer = (props: WithNamespaces) => (
|
||||
<TimeRangeContext.Consumer>
|
||||
{context => (
|
||||
<QueryTypesChart
|
||||
{...props}
|
||||
apiCall={() =>
|
||||
context.range
|
||||
? api.getQueryTypesDb(context.range)
|
||||
: api.getQueryTypes()
|
||||
}
|
||||
/>
|
||||
)}
|
||||
</TimeRangeContext.Consumer>
|
||||
);
|
||||
|
||||
export default withNamespaces("dashboard")(QueryTypesChartContainer);
|
||||
|
||||
@@ -12,6 +12,7 @@ import React, { Component, Fragment } from "react";
|
||||
import { WithNamespaces, withNamespaces } from "react-i18next";
|
||||
import { WithAPIData } from "../common/WithAPIData";
|
||||
import api from "../../util/api";
|
||||
import { TimeRangeContext } from "../common/context/TimeRangeContext";
|
||||
|
||||
export interface SummaryStatsProps {
|
||||
totalQueries: string;
|
||||
@@ -132,15 +133,23 @@ export const TranslatedSummaryStats = withNamespaces(["common", "dashboard"])(
|
||||
);
|
||||
|
||||
export default (props: any) => (
|
||||
<WithAPIData
|
||||
apiCall={api.getSummary}
|
||||
repeatOptions={{ interval: 5000, ignoreCancel: true }}
|
||||
renderInitial={() => (
|
||||
<TranslatedSummaryStats {...initialProps} {...props} />
|
||||
<TimeRangeContext.Consumer>
|
||||
{context => (
|
||||
<WithAPIData
|
||||
apiCall={() =>
|
||||
context.range ? api.getSummaryDb(context.range) : api.getSummary()
|
||||
}
|
||||
repeatOptions={
|
||||
context.range ? undefined : { interval: 5000, ignoreCancel: true }
|
||||
}
|
||||
renderInitial={() => (
|
||||
<TranslatedSummaryStats {...initialProps} {...props} />
|
||||
)}
|
||||
renderOk={data => (
|
||||
<TranslatedSummaryStats {...transformData(data)} {...props} />
|
||||
)}
|
||||
renderErr={() => <TranslatedSummaryStats {...errorProps} {...props} />}
|
||||
/>
|
||||
)}
|
||||
renderOk={data => (
|
||||
<TranslatedSummaryStats {...transformData(data)} {...props} />
|
||||
)}
|
||||
renderErr={() => <TranslatedSummaryStats {...errorProps} {...props} />}
|
||||
/>
|
||||
</TimeRangeContext.Consumer>
|
||||
);
|
||||
|
||||
@@ -0,0 +1,136 @@
|
||||
/* Pi-hole: A black hole for Internet advertisements
|
||||
* (c) 2019 Pi-hole, LLC (https://pi-hole.net)
|
||||
* Network-wide ad blocking via your own hardware.
|
||||
*
|
||||
* Web Interface
|
||||
* Selector For Time Range Context
|
||||
*
|
||||
* This file is copyright under the latest version of the EUPL.
|
||||
* Please see LICENSE file for your rights under this license. */
|
||||
|
||||
import React, { Fragment } from "react";
|
||||
import DateRangePicker from "react-bootstrap-daterangepicker";
|
||||
import { Button } from "reactstrap";
|
||||
import {
|
||||
TimeRange,
|
||||
TimeRangeContext
|
||||
} from "../common/context/TimeRangeContext";
|
||||
import "bootstrap-daterangepicker/daterangepicker.css";
|
||||
import { WithNamespaces, withNamespaces } from "react-i18next";
|
||||
import { dateRanges } from "../../util/dateRanges";
|
||||
|
||||
export interface TimeRangeSelectorProps {
|
||||
/**
|
||||
* The range to show
|
||||
*/
|
||||
range: TimeRange | null;
|
||||
|
||||
/**
|
||||
* Called when a new range is selected
|
||||
*
|
||||
* @param range The new range, or null if "Last 24 Hours" is selected
|
||||
*/
|
||||
onSelect: (range: TimeRange | null) => void;
|
||||
|
||||
/**
|
||||
* If the chosen label should be shown outside of the selector
|
||||
*/
|
||||
showLabel: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the label to be shown next to the selector button
|
||||
*
|
||||
* @param props The selector props
|
||||
*/
|
||||
const renderLabel = (
|
||||
props: TimeRangeSelectorProps & WithNamespaces
|
||||
): string | null => {
|
||||
const { t } = props;
|
||||
|
||||
if (!props.showLabel) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (!props.range) {
|
||||
return t("Last 24 Hours");
|
||||
}
|
||||
|
||||
if (props.range.name === "Custom Range") {
|
||||
return (
|
||||
props.range.from.toDate().toLocaleString() +
|
||||
" - " +
|
||||
props.range.until.toDate().toLocaleString()
|
||||
);
|
||||
}
|
||||
|
||||
return props.range.name;
|
||||
};
|
||||
|
||||
/**
|
||||
* A time range selector which shows the selected time range (label if
|
||||
* predefined, or time range if custom)
|
||||
*/
|
||||
export const TimeRangeSelector = (
|
||||
props: TimeRangeSelectorProps & WithNamespaces
|
||||
) => {
|
||||
const { range, onSelect, t } = props;
|
||||
|
||||
const translatedDateRanges = dateRanges(t);
|
||||
const last24Hours = t("Last 24 Hours");
|
||||
const today = t("Today");
|
||||
const label = renderLabel(props);
|
||||
|
||||
return (
|
||||
<DateRangePicker
|
||||
startDate={range ? range.from : translatedDateRanges[last24Hours][0]}
|
||||
endDate={range ? range.until : translatedDateRanges[last24Hours][1]}
|
||||
maxDate={translatedDateRanges[today][1]}
|
||||
onApply={(event, picker) => {
|
||||
if (
|
||||
picker.startDate.isSame(translatedDateRanges[last24Hours][0]) &&
|
||||
picker.endDate.isSame(translatedDateRanges[last24Hours][1])
|
||||
) {
|
||||
// Set to null so we fetch data from FTL instead of the database
|
||||
onSelect(null);
|
||||
} else {
|
||||
// Set the time range so we fetch from the database
|
||||
onSelect({
|
||||
from: picker.startDate,
|
||||
until: picker.endDate,
|
||||
name: picker.chosenLabel
|
||||
});
|
||||
}
|
||||
}}
|
||||
timePicker={true}
|
||||
showDropdowns={true}
|
||||
ranges={translatedDateRanges}
|
||||
>
|
||||
<Button color="light" size="sm">
|
||||
<i className="far fa-clock fa-lg" />
|
||||
{label ? (
|
||||
<Fragment>
|
||||
|
||||
{label}
|
||||
</Fragment>
|
||||
) : null}
|
||||
</Button>
|
||||
</DateRangePicker>
|
||||
);
|
||||
};
|
||||
|
||||
export const TranslatedTimeRangeSelector = withNamespaces("time-ranges")(
|
||||
TimeRangeSelector
|
||||
);
|
||||
|
||||
export const TimeRangeSelectorContainer = () => (
|
||||
<TimeRangeContext.Consumer>
|
||||
{context => (
|
||||
<TranslatedTimeRangeSelector
|
||||
range={context.range}
|
||||
onSelect={context.update}
|
||||
showLabel={true}
|
||||
/>
|
||||
)}
|
||||
</TimeRangeContext.Consumer>
|
||||
);
|
||||
@@ -13,6 +13,7 @@ import { WithNamespaces, withNamespaces } from "react-i18next";
|
||||
import api from "../../util/api";
|
||||
import TopTable from "./TopTable";
|
||||
import i18next from "i18next";
|
||||
import { TimeRangeContext } from "../common/context/TimeRangeContext";
|
||||
|
||||
export interface TopBlockedData {
|
||||
totalBlocked: number;
|
||||
@@ -65,7 +66,11 @@ export const generateRows = (t: i18next.TranslationFunction) => (
|
||||
});
|
||||
};
|
||||
|
||||
const TopBlocked = ({ t, ...props }: WithNamespaces) => (
|
||||
const TopBlocked = ({
|
||||
apiCall,
|
||||
t,
|
||||
...props
|
||||
}: WithNamespaces & { apiCall: () => Promise<ApiTopBlocked> }) => (
|
||||
<TopTable
|
||||
{...props}
|
||||
title={t("Top Blocked Domains")}
|
||||
@@ -76,10 +81,25 @@ const TopBlocked = ({ t, ...props }: WithNamespaces) => (
|
||||
headers={[t("Domain"), t("Hits"), t("Frequency")]}
|
||||
emptyMessage={t("No Domains Found")}
|
||||
isEmpty={data => data.topBlocked.length === 0}
|
||||
apiCall={api.getTopBlocked}
|
||||
apiCall={apiCall}
|
||||
apiHandler={transformData}
|
||||
generateRows={generateRows(t)}
|
||||
/>
|
||||
);
|
||||
|
||||
export default withNamespaces(["common", "dashboard"])(TopBlocked);
|
||||
const TopBlockedContainer = (props: WithNamespaces) => (
|
||||
<TimeRangeContext.Consumer>
|
||||
{context => (
|
||||
<TopBlocked
|
||||
{...props}
|
||||
apiCall={() =>
|
||||
context.range
|
||||
? api.getTopBlockedDb(context.range)
|
||||
: api.getTopBlocked()
|
||||
}
|
||||
/>
|
||||
)}
|
||||
</TimeRangeContext.Consumer>
|
||||
);
|
||||
|
||||
export default withNamespaces(["common", "dashboard"])(TopBlockedContainer);
|
||||
|
||||
@@ -13,6 +13,7 @@ import { WithNamespaces, withNamespaces } from "react-i18next";
|
||||
import api from "../../util/api";
|
||||
import TopTable from "./TopTable";
|
||||
import i18next from "i18next";
|
||||
import { TimeRangeContext } from "../common/context/TimeRangeContext";
|
||||
|
||||
export interface TopClientsData {
|
||||
totalQueries: number;
|
||||
@@ -65,7 +66,11 @@ export const generateRows = (t: i18next.TranslationFunction) => (
|
||||
});
|
||||
};
|
||||
|
||||
const TopClients = ({ t, ...props }: WithNamespaces) => (
|
||||
const TopClients = ({
|
||||
apiCall,
|
||||
t,
|
||||
...props
|
||||
}: WithNamespaces & { apiCall: () => Promise<ApiTopClients> }) => (
|
||||
<TopTable
|
||||
{...props}
|
||||
title={t("Top Clients")}
|
||||
@@ -76,10 +81,25 @@ const TopClients = ({ t, ...props }: WithNamespaces) => (
|
||||
headers={[t("Client"), t("Requests"), t("Frequency")]}
|
||||
emptyMessage={t("No Clients Found")}
|
||||
isEmpty={data => data.topClients.length === 0}
|
||||
apiCall={api.getTopClients}
|
||||
apiCall={apiCall}
|
||||
apiHandler={transformData}
|
||||
generateRows={generateRows(t)}
|
||||
/>
|
||||
);
|
||||
|
||||
export default withNamespaces(["common", "dashboard"])(TopClients);
|
||||
const TopClientsContainer = (props: WithNamespaces) => (
|
||||
<TimeRangeContext.Consumer>
|
||||
{context => (
|
||||
<TopClients
|
||||
{...props}
|
||||
apiCall={() =>
|
||||
context.range
|
||||
? api.getTopClientsDb(context.range)
|
||||
: api.getTopClients()
|
||||
}
|
||||
/>
|
||||
)}
|
||||
</TimeRangeContext.Consumer>
|
||||
);
|
||||
|
||||
export default withNamespaces(["common", "dashboard"])(TopClientsContainer);
|
||||
|
||||
@@ -13,6 +13,7 @@ import { WithNamespaces, withNamespaces } from "react-i18next";
|
||||
import api from "../../util/api";
|
||||
import TopTable from "./TopTable";
|
||||
import i18next from "i18next";
|
||||
import { TimeRangeContext } from "../common/context/TimeRangeContext";
|
||||
|
||||
export interface TopDomainsData {
|
||||
totalQueries: number;
|
||||
@@ -65,7 +66,11 @@ export const generateRows = (t: i18next.TranslationFunction) => (
|
||||
});
|
||||
};
|
||||
|
||||
const TopDomains = ({ t, ...props }: WithNamespaces) => (
|
||||
const TopDomains = ({
|
||||
apiCall,
|
||||
t,
|
||||
...props
|
||||
}: WithNamespaces & { apiCall: () => Promise<ApiTopDomains> }) => (
|
||||
<TopTable
|
||||
{...props}
|
||||
title={t("Top Permitted Domains")}
|
||||
@@ -76,10 +81,25 @@ const TopDomains = ({ t, ...props }: WithNamespaces) => (
|
||||
headers={[t("Domain"), t("Hits"), t("Frequency")]}
|
||||
emptyMessage={t("No Domains Found")}
|
||||
isEmpty={data => data.topDomains.length === 0}
|
||||
apiCall={api.getTopDomains}
|
||||
apiCall={apiCall}
|
||||
apiHandler={transformData}
|
||||
generateRows={generateRows(t)}
|
||||
/>
|
||||
);
|
||||
|
||||
export default withNamespaces(["common", "dashboard"])(TopDomains);
|
||||
const TopDomainsContainer = (props: WithNamespaces) => (
|
||||
<TimeRangeContext.Consumer>
|
||||
{context => (
|
||||
<TopDomains
|
||||
{...props}
|
||||
apiCall={() =>
|
||||
context.range
|
||||
? api.getTopDomainsDb(context.range)
|
||||
: api.getTopDomains()
|
||||
}
|
||||
/>
|
||||
)}
|
||||
</TimeRangeContext.Consumer>
|
||||
);
|
||||
|
||||
export default withNamespaces(["common", "dashboard"])(TopDomainsContainer);
|
||||
|
||||
@@ -12,11 +12,15 @@ import React from "react";
|
||||
import { WithNamespaces, withNamespaces } from "react-i18next";
|
||||
import api from "../../util/api";
|
||||
import GenericDoughnutChart from "./GenericDoughnutChart";
|
||||
import { TimeRangeContext } from "../common/context/TimeRangeContext";
|
||||
|
||||
const UpstreamsChart = ({ t }: WithNamespaces) => (
|
||||
const UpstreamsChart = ({
|
||||
t,
|
||||
apiCall
|
||||
}: WithNamespaces & { apiCall: () => Promise<ApiUpstreams> }) => (
|
||||
<GenericDoughnutChart
|
||||
title={t("Queries Answered By Destination")}
|
||||
apiCall={api.getUpstreams}
|
||||
apiCall={apiCall}
|
||||
apiHandler={data =>
|
||||
data.upstreams.map(upstream => ({
|
||||
name: upstream.name,
|
||||
@@ -27,4 +31,17 @@ const UpstreamsChart = ({ t }: WithNamespaces) => (
|
||||
/>
|
||||
);
|
||||
|
||||
export default withNamespaces("dashboard")(UpstreamsChart);
|
||||
export const UpstreamsChartContainer = (props: WithNamespaces) => (
|
||||
<TimeRangeContext.Consumer>
|
||||
{context => (
|
||||
<UpstreamsChart
|
||||
{...props}
|
||||
apiCall={() =>
|
||||
context.range ? api.getUpstreamsDb(context.range) : api.getUpstreams()
|
||||
}
|
||||
/>
|
||||
)}
|
||||
</TimeRangeContext.Consumer>
|
||||
);
|
||||
|
||||
export default withNamespaces("dashboard")(UpstreamsChartContainer);
|
||||
|
||||
@@ -53,7 +53,7 @@ it("hides loading indicator correctly", async () => {
|
||||
});
|
||||
|
||||
it("loads API data correctly", async () => {
|
||||
const data = transformData(fakeData);
|
||||
const data = transformData(fakeData, null);
|
||||
|
||||
expect(data.labels[0]).toEqual(
|
||||
new Date(1000 * fakeData.over_time[0].timestamp)
|
||||
|
||||
@@ -15,13 +15,11 @@ import ReactTable, {
|
||||
RowInfo,
|
||||
RowRenderProps
|
||||
} from "react-table";
|
||||
import DateRangePicker from "react-bootstrap-daterangepicker";
|
||||
import { Button } from "reactstrap";
|
||||
import i18n from "i18next";
|
||||
import i18next from "i18next";
|
||||
import { WithNamespaces, withNamespaces } from "react-i18next";
|
||||
import debounce from "lodash.debounce";
|
||||
import moment, { Moment } from "moment";
|
||||
import moment from "moment";
|
||||
import {
|
||||
CancelablePromise,
|
||||
ignoreCancel,
|
||||
@@ -29,6 +27,9 @@ import {
|
||||
padNumber
|
||||
} from "../../util";
|
||||
import api from "../../util/api";
|
||||
import { dateRanges } from "../../util/dateRanges";
|
||||
import { TranslatedTimeRangeSelector } from "../dashboard/TimeRangeSelector";
|
||||
import { TimeRange } from "../common/context/TimeRangeContext";
|
||||
import "react-table/react-table.css";
|
||||
import "bootstrap-daterangepicker/daterangepicker.css";
|
||||
|
||||
@@ -41,6 +42,22 @@ export interface QueryLogState {
|
||||
filters: Array<Filter>;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the default time range for the query log
|
||||
*
|
||||
* @param t The translation function
|
||||
*/
|
||||
const getDefaultRange = (t: i18next.TranslationFunction): TimeRange => {
|
||||
const translatedDateRanges = dateRanges(t);
|
||||
const last24Hours = t("Last 24 Hours");
|
||||
|
||||
return {
|
||||
from: translatedDateRanges[last24Hours][0],
|
||||
until: translatedDateRanges[last24Hours][1],
|
||||
name: last24Hours
|
||||
};
|
||||
};
|
||||
|
||||
class QueryLog extends Component<WithNamespaces, QueryLogState> {
|
||||
private updateHandler: null | CancelablePromise<ApiHistoryResponse> = null;
|
||||
|
||||
@@ -56,15 +73,14 @@ class QueryLog extends Component<WithNamespaces, QueryLogState> {
|
||||
constructor(props: WithNamespaces) {
|
||||
super(props);
|
||||
|
||||
// This happens in the constructor to avoid using dateRanges before it's
|
||||
// created
|
||||
const { t } = this.props;
|
||||
|
||||
// This happens in the constructor to more easily use the translated date
|
||||
// ranges
|
||||
this.state.filters = [
|
||||
{
|
||||
id: "time",
|
||||
value: {
|
||||
start: dateRanges.Today[0],
|
||||
end: dateRanges.Today[1]
|
||||
}
|
||||
value: getDefaultRange(t)
|
||||
}
|
||||
];
|
||||
}
|
||||
@@ -109,16 +125,8 @@ class QueryLog extends Component<WithNamespaces, QueryLogState> {
|
||||
for (const filter of tableFilters) {
|
||||
switch (filter.id) {
|
||||
case "time":
|
||||
filters.from = Math.floor(
|
||||
moment(filter.value.start)
|
||||
.utc()
|
||||
.valueOf() / 1000
|
||||
);
|
||||
filters.until = Math.floor(
|
||||
moment(filter.value.end)
|
||||
.utc()
|
||||
.valueOf() / 1000
|
||||
);
|
||||
filters.from = moment(filter.value.from).unix();
|
||||
filters.until = moment(filter.value.until).unix();
|
||||
break;
|
||||
case "queryType":
|
||||
if (filter.value === "all") {
|
||||
@@ -380,34 +388,6 @@ const selectionFilter = (
|
||||
);
|
||||
};
|
||||
|
||||
/**
|
||||
* Preconfigured date ranges listed in the date range picker
|
||||
*/
|
||||
const dateRanges: { [name: string]: [Moment, Moment] } = {
|
||||
Today: [moment().startOf("day"), moment()],
|
||||
Yesterday: [
|
||||
moment()
|
||||
.subtract(1, "days")
|
||||
.startOf("day"),
|
||||
moment()
|
||||
.subtract(1, "days")
|
||||
.endOf("day")
|
||||
],
|
||||
"Last 7 Days": [moment().subtract(6, "days"), moment()],
|
||||
"Last 30 Days": [moment().subtract(29, "days"), moment()],
|
||||
"This Month": [moment().startOf("month"), moment()],
|
||||
"Last Month": [
|
||||
moment()
|
||||
.subtract(1, "month")
|
||||
.startOf("month"),
|
||||
moment()
|
||||
.subtract(1, "month")
|
||||
.endOf("month")
|
||||
],
|
||||
"This Year": [moment().startOf("year"), moment()],
|
||||
"All Time": [moment(0), moment()]
|
||||
};
|
||||
|
||||
/**
|
||||
* The columns of the Query Log. Some pieces are translated, so you must pass in
|
||||
* the translation function before using the columns.
|
||||
@@ -445,21 +425,17 @@ const columns = (t: i18next.TranslationFunction) => [
|
||||
filter: Filter;
|
||||
onChange: ReactTableFunction;
|
||||
}) => (
|
||||
<DateRangePicker
|
||||
startDate={filter ? filter.value.start : dateRanges.Today[0]}
|
||||
endDate={filter ? filter.value.end : dateRanges.Today[1]}
|
||||
maxDate={dateRanges.Today[1]}
|
||||
onApply={(event, picker) =>
|
||||
onChange({ start: picker.startDate, end: picker.endDate })
|
||||
}
|
||||
timePicker={true}
|
||||
showDropdowns={true}
|
||||
ranges={dateRanges}
|
||||
>
|
||||
<Button color="light" size="sm">
|
||||
<i className="far fa-clock fa-lg" />
|
||||
</Button>
|
||||
</DateRangePicker>
|
||||
<TranslatedTimeRangeSelector
|
||||
range={filter ? filter.value : null}
|
||||
onSelect={range => {
|
||||
if (range) {
|
||||
onChange(range);
|
||||
} else {
|
||||
onChange(getDefaultRange(t));
|
||||
}
|
||||
}}
|
||||
showLabel={false}
|
||||
/>
|
||||
)
|
||||
},
|
||||
{
|
||||
@@ -566,4 +542,4 @@ const columns = (t: i18next.TranslationFunction) => [
|
||||
}
|
||||
];
|
||||
|
||||
export default withNamespaces(["common", "query-log"])(QueryLog);
|
||||
export default withNamespaces(["common", "query-log", "time-ranges"])(QueryLog);
|
||||
|
||||
@@ -14,7 +14,7 @@ import { CancelablePromise, ignoreCancel, makeCancelable } from "../../util";
|
||||
import api from "../../util/api";
|
||||
import Alert, { AlertType } from "../common/Alert";
|
||||
import { Button, Col, Form, FormGroup, Input, Label } from "reactstrap";
|
||||
import { PreferencesContext } from "../common/context";
|
||||
import { PreferencesContext } from "../common/context/PreferencesContext";
|
||||
import languages from "../../languages.json";
|
||||
|
||||
export interface PreferenceSettingsProps {
|
||||
|
||||
+44
-1
@@ -8,8 +8,9 @@
|
||||
* This file is copyright under the latest version of the EUPL.
|
||||
* Please see LICENSE file for your rights under this license. */
|
||||
|
||||
import http, { paramsToString } from "./http";
|
||||
import http, { paramsToString, timeRangeToParams } from "./http";
|
||||
import config from "../config";
|
||||
import { TimeRange } from "../components/common/context/TimeRangeContext";
|
||||
|
||||
export default {
|
||||
loggedIn: false,
|
||||
@@ -24,21 +25,55 @@ export default {
|
||||
getSummary(): Promise<ApiSummary> {
|
||||
return http.get("stats/summary");
|
||||
},
|
||||
getSummaryDb(range: TimeRange): Promise<ApiSummary> {
|
||||
return http.get("stats/database/summary?" + timeRangeToParams(range));
|
||||
},
|
||||
getHistoryGraph(): Promise<Array<ApiHistoryGraphItem>> {
|
||||
return http.get("stats/overTime/history");
|
||||
},
|
||||
getHistoryGraphDb(
|
||||
range: TimeRange,
|
||||
interval: number
|
||||
): Promise<Array<ApiHistoryGraphItem>> {
|
||||
return http.get(
|
||||
"stats/database/overTime/history?interval=" +
|
||||
interval +
|
||||
"&" +
|
||||
timeRangeToParams(range)
|
||||
);
|
||||
},
|
||||
getClientsGraph(): Promise<ApiClientsGraph> {
|
||||
return http.get("stats/overTime/clients");
|
||||
},
|
||||
getClientsGraphDb(
|
||||
range: TimeRange,
|
||||
interval: number
|
||||
): Promise<ApiClientsGraph> {
|
||||
return http.get(
|
||||
"stats/database/overTime/clients?interval=" +
|
||||
interval +
|
||||
"&" +
|
||||
timeRangeToParams(range)
|
||||
);
|
||||
},
|
||||
getQueryTypes(): Promise<Array<ApiQueryType>> {
|
||||
return http.get("stats/query_types");
|
||||
},
|
||||
getQueryTypesDb(range: TimeRange): Promise<Array<ApiQueryType>> {
|
||||
return http.get("stats/database/query_types?" + timeRangeToParams(range));
|
||||
},
|
||||
getUpstreams(): Promise<ApiUpstreams> {
|
||||
return http.get("stats/upstreams");
|
||||
},
|
||||
getUpstreamsDb(range: TimeRange): Promise<ApiUpstreams> {
|
||||
return http.get("stats/database/upstreams?" + timeRangeToParams(range));
|
||||
},
|
||||
getTopDomains(): Promise<ApiTopDomains> {
|
||||
return http.get("stats/top_domains");
|
||||
},
|
||||
getTopDomainsDb(range: TimeRange): Promise<ApiTopDomains> {
|
||||
return http.get("stats/database/top_domains?" + timeRangeToParams(range));
|
||||
},
|
||||
getTopBlocked(): Promise<ApiTopBlocked> {
|
||||
// The API uses a GET parameter to differentiate top domains from top
|
||||
// blocked, but the fake API is not able to handle GET parameters right now.
|
||||
@@ -48,9 +83,17 @@ export default {
|
||||
|
||||
return http.get(url);
|
||||
},
|
||||
getTopBlockedDb(range: TimeRange): Promise<ApiTopBlocked> {
|
||||
return http.get(
|
||||
"stats/database/top_domains?blocked=true&" + timeRangeToParams(range)
|
||||
);
|
||||
},
|
||||
getTopClients(): Promise<ApiTopClients> {
|
||||
return http.get("stats/top_clients");
|
||||
},
|
||||
getTopClientsDb(range: TimeRange): Promise<ApiTopClients> {
|
||||
return http.get("stats/database/top_clients?" + timeRangeToParams(range));
|
||||
},
|
||||
getHistory(params: any): Promise<ApiHistoryResponse> {
|
||||
return http.get("stats/history?" + paramsToString(params));
|
||||
},
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
import moment, { Moment } from "moment";
|
||||
import i18next from "i18next";
|
||||
|
||||
const now = moment();
|
||||
const oneDayAgo = moment().subtract(1, "day");
|
||||
const startOfDay = moment().startOf("day");
|
||||
const startOfYesterday = moment()
|
||||
.subtract(1, "days")
|
||||
.startOf("day");
|
||||
const endOfYesterday = moment()
|
||||
.subtract(1, "days")
|
||||
.endOf("day");
|
||||
const lastWeek = moment().subtract(7, "days");
|
||||
const lastMonth = moment().subtract(30, "days");
|
||||
const startOfMonth = moment().startOf("month");
|
||||
const startOfLastMonth = moment()
|
||||
.subtract(1, "month")
|
||||
.startOf("month");
|
||||
const endOfLastMonth = moment()
|
||||
.subtract(1, "month")
|
||||
.endOf("month");
|
||||
const startOfYear = moment().startOf("year");
|
||||
const epoch = moment(0);
|
||||
|
||||
/**
|
||||
* Preconfigured date ranges for use in a date range picker. The keys are
|
||||
* translated, so this object must be computed using the translation function.
|
||||
*
|
||||
* @param t The translation function
|
||||
*/
|
||||
export const dateRanges: (
|
||||
t: i18next.TranslationFunction
|
||||
) => { [name: string]: [Moment, Moment] } = t => ({
|
||||
[t("Last 24 Hours")]: [oneDayAgo, now],
|
||||
[t("Today")]: [startOfDay, now],
|
||||
[t("Yesterday")]: [startOfYesterday, endOfYesterday],
|
||||
[t("Last 7 Days")]: [lastWeek, now],
|
||||
[t("Last 30 Days")]: [lastMonth, now],
|
||||
[t("This Month")]: [startOfMonth, now],
|
||||
[t("Last Month")]: [startOfLastMonth, endOfLastMonth],
|
||||
[t("This Year")]: [startOfYear, now],
|
||||
[t("All Time")]: [epoch, now]
|
||||
});
|
||||
@@ -10,6 +10,7 @@
|
||||
|
||||
import api from "./api";
|
||||
import config from "../config";
|
||||
import { TimeRange } from "../components/common/context/TimeRangeContext";
|
||||
|
||||
/**
|
||||
* A group of HTTP functions. Each function parses the response checks for
|
||||
@@ -182,3 +183,15 @@ export const paramsToString = (params: any) =>
|
||||
Object.keys(params)
|
||||
.map(key => key + "=" + params[key])
|
||||
.join("&");
|
||||
|
||||
/**
|
||||
* Convert a time range into GET parameters
|
||||
*
|
||||
* @param range The time range to convert
|
||||
* @return The time range as GET parameters
|
||||
*/
|
||||
export const timeRangeToParams = (range: TimeRange) =>
|
||||
paramsToString({
|
||||
from: range.from.unix(),
|
||||
until: range.until.unix()
|
||||
});
|
||||
|
||||
+2
-1
@@ -34,7 +34,8 @@ export function setupI18n() {
|
||||
"query-log",
|
||||
"settings",
|
||||
"api-errors",
|
||||
"preferences"
|
||||
"preferences",
|
||||
"time-ranges"
|
||||
],
|
||||
nsSeparator: false,
|
||||
keySeparator: false,
|
||||
|
||||
+13
-1
@@ -8,6 +8,8 @@
|
||||
* This file is copyright under the latest version of the EUPL.
|
||||
* Please see LICENSE file for your rights under this license. */
|
||||
|
||||
import { TimeRange } from "../components/common/context/TimeRangeContext";
|
||||
|
||||
/**
|
||||
* Pad a two digit number
|
||||
*
|
||||
@@ -18,6 +20,16 @@ export const padNumber = (num: number) => {
|
||||
return ("00" + num).substr(-2, 2);
|
||||
};
|
||||
|
||||
/**
|
||||
* Dynamically calculate a time interval so there are always 144 data points
|
||||
* (144 so that every point represents 10 minutes when the range is 24 hours)
|
||||
*
|
||||
* @param range The range to find the interval for
|
||||
*/
|
||||
export const getIntervalForRange = (range: TimeRange): number => {
|
||||
return Math.ceil((range.until.unix() - range.from.unix()) / 144);
|
||||
};
|
||||
|
||||
export interface CancelablePromise<T> {
|
||||
promise: Promise<T>;
|
||||
cancel: () => void;
|
||||
@@ -27,7 +39,7 @@ export interface CancelableOptions {
|
||||
/**
|
||||
* The function to call to repeat the promise
|
||||
*/
|
||||
repeat: (() => void);
|
||||
repeat: () => void;
|
||||
|
||||
/**
|
||||
* The amount of time to wait until repeating
|
||||
|
||||
Reference in New Issue
Block a user