diff --git a/README.md b/README.md index 5a5d1a3..667ce32 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,7 @@ Provides a control panel interface to conveniently manage clusters (groups of id - Protection rules, choose bot protection mode "none" (whitelist), proof-of-work or proof-of-work+captcha. Can be domain-wide or a domain+path. Path overrides domain-wide. - Global override for protection mode, to enable for all domains in a cluster. - Maintenance mode, disables proxying for selected domains and serves an "under maintenance" page from haproxy. +- Statistics page with server and backend-level breakdowns based on haproxy stats socket data. ##### Todo: - Improved cert management diff --git a/api.js b/api.js index e0bc324..c616ea2 100644 --- a/api.js +++ b/api.js @@ -61,6 +61,11 @@ export async function deleteFromMap(mapName, body, dispatch, errorCallback, rout return ApiCall(`/forms/map/${mapName}/delete`, 'POST', body, dispatch, errorCallback, router, 0.5); } +// Stats +export async function getStats(dispatch, errorCallback, router) { + return ApiCall('/stats.json', 'GET', null, dispatch, errorCallback, router); +} + // Global toggle export async function globalToggle(body, dispatch, errorCallback, router) { return ApiCall('/forms/global/toggle', 'POST', body, dispatch, errorCallback, router, 0.5); diff --git a/components/MenuLinks.js b/components/MenuLinks.js index 22cb1bb..dc4fef8 100644 --- a/components/MenuLinks.js +++ b/components/MenuLinks.js @@ -108,6 +108,14 @@ export default withRouter(function MenuLinks({ router }) { +
  • + + + + Statistics + + +