@qwickapps/server 1.3.1 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +157 -0
- package/dist/core/control-panel.d.ts.map +1 -1
- package/dist/core/control-panel.js +114 -0
- package/dist/core/control-panel.js.map +1 -1
- package/dist/core/types.d.ts +19 -0
- package/dist/core/types.d.ts.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +15 -3
- package/dist/index.js.map +1 -1
- package/dist/plugins/auth/adapter-wrapper.d.ts +47 -0
- package/dist/plugins/auth/adapter-wrapper.d.ts.map +1 -0
- package/dist/plugins/auth/adapter-wrapper.js +166 -0
- package/dist/plugins/auth/adapter-wrapper.js.map +1 -0
- package/dist/plugins/auth/adapter-wrapper.test.d.ts +7 -0
- package/dist/plugins/auth/adapter-wrapper.test.d.ts.map +1 -0
- package/dist/plugins/auth/adapter-wrapper.test.js +303 -0
- package/dist/plugins/auth/adapter-wrapper.test.js.map +1 -0
- package/dist/plugins/auth/config-store.d.ts +11 -0
- package/dist/plugins/auth/config-store.d.ts.map +1 -0
- package/dist/plugins/auth/config-store.js +232 -0
- package/dist/plugins/auth/config-store.js.map +1 -0
- package/dist/plugins/auth/config-store.test.d.ts +7 -0
- package/dist/plugins/auth/config-store.test.d.ts.map +1 -0
- package/dist/plugins/auth/config-store.test.js +299 -0
- package/dist/plugins/auth/config-store.test.js.map +1 -0
- package/dist/plugins/auth/env-config.d.ts +51 -1
- package/dist/plugins/auth/env-config.d.ts.map +1 -1
- package/dist/plugins/auth/env-config.js +640 -7
- package/dist/plugins/auth/env-config.js.map +1 -1
- package/dist/plugins/auth/index.d.ts +6 -2
- package/dist/plugins/auth/index.d.ts.map +1 -1
- package/dist/plugins/auth/index.js +5 -1
- package/dist/plugins/auth/index.js.map +1 -1
- package/dist/plugins/auth/types.d.ts +106 -0
- package/dist/plugins/auth/types.d.ts.map +1 -1
- package/dist/plugins/bans/bans-plugin.d.ts.map +1 -1
- package/dist/plugins/bans/bans-plugin.js +12 -3
- package/dist/plugins/bans/bans-plugin.js.map +1 -1
- package/dist/plugins/devices/__tests__/devices-plugin.test.d.ts +11 -0
- package/dist/plugins/devices/__tests__/devices-plugin.test.d.ts.map +1 -0
- package/dist/plugins/devices/__tests__/devices-plugin.test.js +410 -0
- package/dist/plugins/devices/__tests__/devices-plugin.test.js.map +1 -0
- package/dist/plugins/devices/__tests__/token-utils.test.d.ts +7 -0
- package/dist/plugins/devices/__tests__/token-utils.test.d.ts.map +1 -0
- package/dist/plugins/devices/__tests__/token-utils.test.js +197 -0
- package/dist/plugins/devices/__tests__/token-utils.test.js.map +1 -0
- package/dist/plugins/devices/adapters/compute-adapter.d.ts +36 -0
- package/dist/plugins/devices/adapters/compute-adapter.d.ts.map +1 -0
- package/dist/plugins/devices/adapters/compute-adapter.js +100 -0
- package/dist/plugins/devices/adapters/compute-adapter.js.map +1 -0
- package/dist/plugins/devices/adapters/index.d.ts +12 -0
- package/dist/plugins/devices/adapters/index.d.ts.map +1 -0
- package/dist/plugins/devices/adapters/index.js +10 -0
- package/dist/plugins/devices/adapters/index.js.map +1 -0
- package/dist/plugins/devices/adapters/mobile-adapter.d.ts +41 -0
- package/dist/plugins/devices/adapters/mobile-adapter.d.ts.map +1 -0
- package/dist/plugins/devices/adapters/mobile-adapter.js +131 -0
- package/dist/plugins/devices/adapters/mobile-adapter.js.map +1 -0
- package/dist/plugins/devices/devices-plugin.d.ts +70 -0
- package/dist/plugins/devices/devices-plugin.d.ts.map +1 -0
- package/dist/plugins/devices/devices-plugin.js +453 -0
- package/dist/plugins/devices/devices-plugin.js.map +1 -0
- package/dist/plugins/devices/index.d.ts +18 -0
- package/dist/plugins/devices/index.d.ts.map +1 -0
- package/dist/plugins/devices/index.js +18 -0
- package/dist/plugins/devices/index.js.map +1 -0
- package/dist/plugins/devices/stores/index.d.ts +9 -0
- package/dist/plugins/devices/stores/index.d.ts.map +1 -0
- package/dist/plugins/devices/stores/index.js +9 -0
- package/dist/plugins/devices/stores/index.js.map +1 -0
- package/dist/plugins/devices/stores/postgres-store.d.ts +26 -0
- package/dist/plugins/devices/stores/postgres-store.d.ts.map +1 -0
- package/dist/plugins/devices/stores/postgres-store.js +199 -0
- package/dist/plugins/devices/stores/postgres-store.js.map +1 -0
- package/dist/plugins/devices/token-utils.d.ts +100 -0
- package/dist/plugins/devices/token-utils.d.ts.map +1 -0
- package/dist/plugins/devices/token-utils.js +162 -0
- package/dist/plugins/devices/token-utils.js.map +1 -0
- package/dist/plugins/devices/types.d.ts +307 -0
- package/dist/plugins/devices/types.d.ts.map +1 -0
- package/dist/plugins/devices/types.js +10 -0
- package/dist/plugins/devices/types.js.map +1 -0
- package/dist/plugins/index.d.ts +18 -4
- package/dist/plugins/index.d.ts.map +1 -1
- package/dist/plugins/index.js +16 -2
- package/dist/plugins/index.js.map +1 -1
- package/dist/plugins/notifications/__tests__/notifications-manager.test.d.ts +5 -0
- package/dist/plugins/notifications/__tests__/notifications-manager.test.d.ts.map +1 -0
- package/dist/plugins/notifications/__tests__/notifications-manager.test.js +470 -0
- package/dist/plugins/notifications/__tests__/notifications-manager.test.js.map +1 -0
- package/dist/plugins/notifications/index.d.ts +71 -0
- package/dist/plugins/notifications/index.d.ts.map +1 -0
- package/dist/plugins/notifications/index.js +72 -0
- package/dist/plugins/notifications/index.js.map +1 -0
- package/dist/plugins/notifications/notifications-manager.d.ts +182 -0
- package/dist/plugins/notifications/notifications-manager.d.ts.map +1 -0
- package/dist/plugins/notifications/notifications-manager.js +610 -0
- package/dist/plugins/notifications/notifications-manager.js.map +1 -0
- package/dist/plugins/notifications/notifications-plugin.d.ts +83 -0
- package/dist/plugins/notifications/notifications-plugin.d.ts.map +1 -0
- package/dist/plugins/notifications/notifications-plugin.js +337 -0
- package/dist/plugins/notifications/notifications-plugin.js.map +1 -0
- package/dist/plugins/notifications/types.d.ts +164 -0
- package/dist/plugins/notifications/types.d.ts.map +1 -0
- package/dist/plugins/notifications/types.js +9 -0
- package/dist/plugins/notifications/types.js.map +1 -0
- package/dist/plugins/parental/__tests__/parental-plugin.test.d.ts +12 -0
- package/dist/plugins/parental/__tests__/parental-plugin.test.d.ts.map +1 -0
- package/dist/plugins/parental/__tests__/parental-plugin.test.js +349 -0
- package/dist/plugins/parental/__tests__/parental-plugin.test.js.map +1 -0
- package/dist/plugins/parental/adapters/index.d.ts +8 -0
- package/dist/plugins/parental/adapters/index.d.ts.map +1 -0
- package/dist/plugins/parental/adapters/index.js +7 -0
- package/dist/plugins/parental/adapters/index.js.map +1 -0
- package/dist/plugins/parental/adapters/kids-adapter.d.ts +24 -0
- package/dist/plugins/parental/adapters/kids-adapter.d.ts.map +1 -0
- package/dist/plugins/parental/adapters/kids-adapter.js +174 -0
- package/dist/plugins/parental/adapters/kids-adapter.js.map +1 -0
- package/dist/plugins/parental/index.d.ts +14 -0
- package/dist/plugins/parental/index.d.ts.map +1 -0
- package/dist/plugins/parental/index.js +15 -0
- package/dist/plugins/parental/index.js.map +1 -0
- package/dist/plugins/parental/parental-plugin.d.ts +88 -0
- package/dist/plugins/parental/parental-plugin.d.ts.map +1 -0
- package/dist/plugins/parental/parental-plugin.js +666 -0
- package/dist/plugins/parental/parental-plugin.js.map +1 -0
- package/dist/plugins/parental/stores/index.d.ts +7 -0
- package/dist/plugins/parental/stores/index.d.ts.map +1 -0
- package/dist/plugins/parental/stores/index.js +7 -0
- package/dist/plugins/parental/stores/index.js.map +1 -0
- package/dist/plugins/parental/stores/postgres-store.d.ts +10 -0
- package/dist/plugins/parental/stores/postgres-store.d.ts.map +1 -0
- package/dist/plugins/parental/stores/postgres-store.js +209 -0
- package/dist/plugins/parental/stores/postgres-store.js.map +1 -0
- package/dist/plugins/parental/types.d.ts +154 -0
- package/dist/plugins/parental/types.d.ts.map +1 -0
- package/dist/plugins/parental/types.js +10 -0
- package/dist/plugins/parental/types.js.map +1 -0
- package/dist/plugins/profiles/__tests__/profiles-plugin.test.d.ts +11 -0
- package/dist/plugins/profiles/__tests__/profiles-plugin.test.d.ts.map +1 -0
- package/dist/plugins/profiles/__tests__/profiles-plugin.test.js +243 -0
- package/dist/plugins/profiles/__tests__/profiles-plugin.test.js.map +1 -0
- package/dist/plugins/profiles/index.d.ts +12 -0
- package/dist/plugins/profiles/index.d.ts.map +1 -0
- package/dist/plugins/profiles/index.js +13 -0
- package/dist/plugins/profiles/index.js.map +1 -0
- package/dist/plugins/profiles/profiles-plugin.d.ts +71 -0
- package/dist/plugins/profiles/profiles-plugin.d.ts.map +1 -0
- package/dist/plugins/profiles/profiles-plugin.js +481 -0
- package/dist/plugins/profiles/profiles-plugin.js.map +1 -0
- package/dist/plugins/profiles/stores/index.d.ts +9 -0
- package/dist/plugins/profiles/stores/index.d.ts.map +1 -0
- package/dist/plugins/profiles/stores/index.js +9 -0
- package/dist/plugins/profiles/stores/index.js.map +1 -0
- package/dist/plugins/profiles/stores/postgres-store.d.ts +18 -0
- package/dist/plugins/profiles/stores/postgres-store.d.ts.map +1 -0
- package/dist/plugins/profiles/stores/postgres-store.js +310 -0
- package/dist/plugins/profiles/stores/postgres-store.js.map +1 -0
- package/dist/plugins/profiles/types.d.ts +289 -0
- package/dist/plugins/profiles/types.d.ts.map +1 -0
- package/dist/plugins/profiles/types.js +10 -0
- package/dist/plugins/profiles/types.js.map +1 -0
- package/dist/plugins/rate-limit/__tests__/rate-limit-plugin.test.d.ts +7 -0
- package/dist/plugins/rate-limit/__tests__/rate-limit-plugin.test.d.ts.map +1 -0
- package/dist/plugins/rate-limit/__tests__/rate-limit-plugin.test.js +220 -0
- package/dist/plugins/rate-limit/__tests__/rate-limit-plugin.test.js.map +1 -0
- package/dist/plugins/rate-limit/cleanup.d.ts +40 -0
- package/dist/plugins/rate-limit/cleanup.d.ts.map +1 -0
- package/dist/plugins/rate-limit/cleanup.js +72 -0
- package/dist/plugins/rate-limit/cleanup.js.map +1 -0
- package/dist/plugins/rate-limit/env-config.d.ts +91 -0
- package/dist/plugins/rate-limit/env-config.d.ts.map +1 -0
- package/dist/plugins/rate-limit/env-config.js +318 -0
- package/dist/plugins/rate-limit/env-config.js.map +1 -0
- package/dist/plugins/rate-limit/index.d.ts +76 -0
- package/dist/plugins/rate-limit/index.d.ts.map +1 -0
- package/dist/plugins/rate-limit/index.js +79 -0
- package/dist/plugins/rate-limit/index.js.map +1 -0
- package/dist/plugins/rate-limit/middleware.d.ts +40 -0
- package/dist/plugins/rate-limit/middleware.d.ts.map +1 -0
- package/dist/plugins/rate-limit/middleware.js +169 -0
- package/dist/plugins/rate-limit/middleware.js.map +1 -0
- package/dist/plugins/rate-limit/rate-limit-plugin.d.ts +44 -0
- package/dist/plugins/rate-limit/rate-limit-plugin.d.ts.map +1 -0
- package/dist/plugins/rate-limit/rate-limit-plugin.js +354 -0
- package/dist/plugins/rate-limit/rate-limit-plugin.js.map +1 -0
- package/dist/plugins/rate-limit/rate-limit-service.d.ts +110 -0
- package/dist/plugins/rate-limit/rate-limit-service.d.ts.map +1 -0
- package/dist/plugins/rate-limit/rate-limit-service.js +172 -0
- package/dist/plugins/rate-limit/rate-limit-service.js.map +1 -0
- package/dist/plugins/rate-limit/stores/cache-store.d.ts +33 -0
- package/dist/plugins/rate-limit/stores/cache-store.d.ts.map +1 -0
- package/dist/plugins/rate-limit/stores/cache-store.js +225 -0
- package/dist/plugins/rate-limit/stores/cache-store.js.map +1 -0
- package/dist/plugins/rate-limit/stores/index.d.ts +8 -0
- package/dist/plugins/rate-limit/stores/index.d.ts.map +1 -0
- package/dist/plugins/rate-limit/stores/index.js +8 -0
- package/dist/plugins/rate-limit/stores/index.js.map +1 -0
- package/dist/plugins/rate-limit/stores/postgres-store.d.ts +34 -0
- package/dist/plugins/rate-limit/stores/postgres-store.d.ts.map +1 -0
- package/dist/plugins/rate-limit/stores/postgres-store.js +320 -0
- package/dist/plugins/rate-limit/stores/postgres-store.js.map +1 -0
- package/dist/plugins/rate-limit/strategies/fixed-window.d.ts +21 -0
- package/dist/plugins/rate-limit/strategies/fixed-window.d.ts.map +1 -0
- package/dist/plugins/rate-limit/strategies/fixed-window.js +97 -0
- package/dist/plugins/rate-limit/strategies/fixed-window.js.map +1 -0
- package/dist/plugins/rate-limit/strategies/index.d.ts +14 -0
- package/dist/plugins/rate-limit/strategies/index.d.ts.map +1 -0
- package/dist/plugins/rate-limit/strategies/index.js +27 -0
- package/dist/plugins/rate-limit/strategies/index.js.map +1 -0
- package/dist/plugins/rate-limit/strategies/sliding-window.d.ts +22 -0
- package/dist/plugins/rate-limit/strategies/sliding-window.d.ts.map +1 -0
- package/dist/plugins/rate-limit/strategies/sliding-window.js +122 -0
- package/dist/plugins/rate-limit/strategies/sliding-window.js.map +1 -0
- package/dist/plugins/rate-limit/strategies/token-bucket.d.ts +28 -0
- package/dist/plugins/rate-limit/strategies/token-bucket.d.ts.map +1 -0
- package/dist/plugins/rate-limit/strategies/token-bucket.js +121 -0
- package/dist/plugins/rate-limit/strategies/token-bucket.js.map +1 -0
- package/dist/plugins/rate-limit/types.d.ts +265 -0
- package/dist/plugins/rate-limit/types.d.ts.map +1 -0
- package/dist/plugins/rate-limit/types.js +9 -0
- package/dist/plugins/rate-limit/types.js.map +1 -0
- package/dist/plugins/subscriptions/__tests__/subscriptions-plugin.test.d.ts +11 -0
- package/dist/plugins/subscriptions/__tests__/subscriptions-plugin.test.d.ts.map +1 -0
- package/dist/plugins/subscriptions/__tests__/subscriptions-plugin.test.js +305 -0
- package/dist/plugins/subscriptions/__tests__/subscriptions-plugin.test.js.map +1 -0
- package/dist/plugins/subscriptions/index.d.ts +12 -0
- package/dist/plugins/subscriptions/index.d.ts.map +1 -0
- package/dist/plugins/subscriptions/index.js +13 -0
- package/dist/plugins/subscriptions/index.js.map +1 -0
- package/dist/plugins/subscriptions/stores/index.d.ts +9 -0
- package/dist/plugins/subscriptions/stores/index.d.ts.map +1 -0
- package/dist/plugins/subscriptions/stores/index.js +9 -0
- package/dist/plugins/subscriptions/stores/index.js.map +1 -0
- package/dist/plugins/subscriptions/stores/postgres-store.d.ts +14 -0
- package/dist/plugins/subscriptions/stores/postgres-store.d.ts.map +1 -0
- package/dist/plugins/subscriptions/stores/postgres-store.js +359 -0
- package/dist/plugins/subscriptions/stores/postgres-store.js.map +1 -0
- package/dist/plugins/subscriptions/subscriptions-plugin.d.ts +82 -0
- package/dist/plugins/subscriptions/subscriptions-plugin.d.ts.map +1 -0
- package/dist/plugins/subscriptions/subscriptions-plugin.js +449 -0
- package/dist/plugins/subscriptions/subscriptions-plugin.js.map +1 -0
- package/dist/plugins/subscriptions/types.d.ts +308 -0
- package/dist/plugins/subscriptions/types.d.ts.map +1 -0
- package/dist/plugins/subscriptions/types.js +10 -0
- package/dist/plugins/subscriptions/types.js.map +1 -0
- package/dist/plugins/usage/__tests__/usage-plugin.test.d.ts +11 -0
- package/dist/plugins/usage/__tests__/usage-plugin.test.d.ts.map +1 -0
- package/dist/plugins/usage/__tests__/usage-plugin.test.js +218 -0
- package/dist/plugins/usage/__tests__/usage-plugin.test.js.map +1 -0
- package/dist/plugins/usage/index.d.ts +12 -0
- package/dist/plugins/usage/index.d.ts.map +1 -0
- package/dist/plugins/usage/index.js +13 -0
- package/dist/plugins/usage/index.js.map +1 -0
- package/dist/plugins/usage/stores/index.d.ts +9 -0
- package/dist/plugins/usage/stores/index.d.ts.map +1 -0
- package/dist/plugins/usage/stores/index.js +9 -0
- package/dist/plugins/usage/stores/index.js.map +1 -0
- package/dist/plugins/usage/stores/postgres-store.d.ts +14 -0
- package/dist/plugins/usage/stores/postgres-store.d.ts.map +1 -0
- package/dist/plugins/usage/stores/postgres-store.js +146 -0
- package/dist/plugins/usage/stores/postgres-store.js.map +1 -0
- package/dist/plugins/usage/types.d.ts +195 -0
- package/dist/plugins/usage/types.d.ts.map +1 -0
- package/dist/plugins/usage/types.js +10 -0
- package/dist/plugins/usage/types.js.map +1 -0
- package/dist/plugins/usage/usage-plugin.d.ts +51 -0
- package/dist/plugins/usage/usage-plugin.d.ts.map +1 -0
- package/dist/plugins/usage/usage-plugin.js +412 -0
- package/dist/plugins/usage/usage-plugin.js.map +1 -0
- package/dist/plugins/users/__tests__/postgres-store.test.d.ts +10 -0
- package/dist/plugins/users/__tests__/postgres-store.test.d.ts.map +1 -0
- package/dist/plugins/users/__tests__/postgres-store.test.js +229 -0
- package/dist/plugins/users/__tests__/postgres-store.test.js.map +1 -0
- package/dist/plugins/users/__tests__/users-plugin.test.js +3 -0
- package/dist/plugins/users/__tests__/users-plugin.test.js.map +1 -1
- package/dist/plugins/users/index.d.ts +2 -2
- package/dist/plugins/users/index.d.ts.map +1 -1
- package/dist/plugins/users/index.js +1 -1
- package/dist/plugins/users/index.js.map +1 -1
- package/dist/plugins/users/stores/postgres-store.d.ts.map +1 -1
- package/dist/plugins/users/stores/postgres-store.js +76 -0
- package/dist/plugins/users/stores/postgres-store.js.map +1 -1
- package/dist/plugins/users/types.d.ts +74 -6
- package/dist/plugins/users/types.d.ts.map +1 -1
- package/dist/plugins/users/users-plugin.d.ts +15 -1
- package/dist/plugins/users/users-plugin.d.ts.map +1 -1
- package/dist/plugins/users/users-plugin.js +29 -0
- package/dist/plugins/users/users-plugin.js.map +1 -1
- package/dist-ui/assets/index-CynOqPkb.js +469 -0
- package/dist-ui/assets/{index-BY8OxNgO.js.map → index-CynOqPkb.js.map} +1 -1
- package/dist-ui/index.html +1 -1
- package/dist-ui-lib/api/controlPanelApi.d.ts +187 -0
- package/dist-ui-lib/components/StatCard.d.ts +16 -0
- package/dist-ui-lib/dashboard/widgets/AuthStatusWidget.d.ts +9 -0
- package/dist-ui-lib/dashboard/widgets/IntegrationStatusWidget.d.ts +9 -0
- package/dist-ui-lib/dashboard/widgets/NotificationsStatsWidget.d.ts +12 -0
- package/dist-ui-lib/dashboard/widgets/index.d.ts +3 -0
- package/dist-ui-lib/index.js +3579 -2379
- package/dist-ui-lib/index.js.map +1 -1
- package/dist-ui-lib/pages/IntegrationsPage.d.ts +1 -0
- package/dist-ui-lib/pages/NotificationsPage.d.ts +9 -0
- package/dist-ui-lib/pages/RateLimitPage.d.ts +1 -0
- package/dist-ui-lib/utils/formatters.d.ts +19 -0
- package/package.json +1 -1
- package/src/core/control-panel.ts +128 -0
- package/src/core/types.ts +17 -0
- package/src/index.ts +216 -0
- package/src/plugins/auth/adapter-wrapper.test.ts +395 -0
- package/src/plugins/auth/adapter-wrapper.ts +205 -0
- package/src/plugins/auth/config-store.test.ts +417 -0
- package/src/plugins/auth/config-store.ts +305 -0
- package/src/plugins/auth/env-config.ts +714 -7
- package/src/plugins/auth/index.ts +22 -1
- package/src/plugins/auth/types.ts +138 -0
- package/src/plugins/bans/bans-plugin.ts +15 -3
- package/src/plugins/devices/__tests__/devices-plugin.test.ts +551 -0
- package/src/plugins/devices/__tests__/token-utils.test.ts +264 -0
- package/src/plugins/devices/adapters/compute-adapter.ts +139 -0
- package/src/plugins/devices/adapters/index.ts +13 -0
- package/src/plugins/devices/adapters/mobile-adapter.ts +179 -0
- package/src/plugins/devices/devices-plugin.ts +538 -0
- package/src/plugins/devices/index.ts +69 -0
- package/src/plugins/devices/stores/index.ts +9 -0
- package/src/plugins/devices/stores/postgres-store.ts +304 -0
- package/src/plugins/devices/token-utils.ts +213 -0
- package/src/plugins/devices/types.ts +351 -0
- package/src/plugins/index.ts +267 -0
- package/src/plugins/notifications/__tests__/notifications-manager.test.ts +637 -0
- package/src/plugins/notifications/index.ts +91 -0
- package/src/plugins/notifications/notifications-manager.ts +773 -0
- package/src/plugins/notifications/notifications-plugin.ts +398 -0
- package/src/plugins/notifications/types.ts +207 -0
- package/src/plugins/parental/__tests__/parental-plugin.test.ts +465 -0
- package/src/plugins/parental/adapters/index.ts +8 -0
- package/src/plugins/parental/adapters/kids-adapter.ts +206 -0
- package/src/plugins/parental/index.ts +55 -0
- package/src/plugins/parental/parental-plugin.ts +759 -0
- package/src/plugins/parental/stores/index.ts +7 -0
- package/src/plugins/parental/stores/postgres-store.ts +304 -0
- package/src/plugins/parental/types.ts +180 -0
- package/src/plugins/profiles/__tests__/profiles-plugin.test.ts +321 -0
- package/src/plugins/profiles/index.ts +49 -0
- package/src/plugins/profiles/profiles-plugin.ts +546 -0
- package/src/plugins/profiles/stores/index.ts +9 -0
- package/src/plugins/profiles/stores/postgres-store.ts +439 -0
- package/src/plugins/profiles/types.ts +338 -0
- package/src/plugins/rate-limit/__tests__/rate-limit-plugin.test.ts +259 -0
- package/src/plugins/rate-limit/cleanup.ts +117 -0
- package/src/plugins/rate-limit/env-config.ts +400 -0
- package/src/plugins/rate-limit/index.ts +128 -0
- package/src/plugins/rate-limit/middleware.ts +212 -0
- package/src/plugins/rate-limit/rate-limit-plugin.ts +400 -0
- package/src/plugins/rate-limit/rate-limit-service.ts +228 -0
- package/src/plugins/rate-limit/stores/cache-store.ts +261 -0
- package/src/plugins/rate-limit/stores/index.ts +8 -0
- package/src/plugins/rate-limit/stores/postgres-store.ts +402 -0
- package/src/plugins/rate-limit/strategies/fixed-window.ts +116 -0
- package/src/plugins/rate-limit/strategies/index.ts +30 -0
- package/src/plugins/rate-limit/strategies/sliding-window.ts +157 -0
- package/src/plugins/rate-limit/strategies/token-bucket.ts +154 -0
- package/src/plugins/rate-limit/types.ts +338 -0
- package/src/plugins/subscriptions/__tests__/subscriptions-plugin.test.ts +404 -0
- package/src/plugins/subscriptions/index.ts +51 -0
- package/src/plugins/subscriptions/stores/index.ts +9 -0
- package/src/plugins/subscriptions/stores/postgres-store.ts +482 -0
- package/src/plugins/subscriptions/subscriptions-plugin.ts +530 -0
- package/src/plugins/subscriptions/types.ts +355 -0
- package/src/plugins/usage/__tests__/usage-plugin.test.ts +288 -0
- package/src/plugins/usage/index.ts +39 -0
- package/src/plugins/usage/stores/index.ts +9 -0
- package/src/plugins/usage/stores/postgres-store.ts +213 -0
- package/src/plugins/usage/types.ts +222 -0
- package/src/plugins/usage/usage-plugin.ts +484 -0
- package/src/plugins/users/__tests__/postgres-store.test.ts +326 -0
- package/src/plugins/users/__tests__/users-plugin.test.ts +3 -0
- package/src/plugins/users/index.ts +6 -0
- package/src/plugins/users/stores/postgres-store.ts +104 -0
- package/src/plugins/users/types.ts +82 -6
- package/src/plugins/users/users-plugin.ts +37 -0
- package/ui/src/App.tsx +36 -14
- package/ui/src/api/controlPanelApi.ts +329 -6
- package/ui/src/components/StatCard.tsx +58 -0
- package/ui/src/dashboard/builtInWidgets.tsx +7 -1
- package/ui/src/dashboard/widgets/AuthStatusWidget.tsx +143 -0
- package/ui/src/dashboard/widgets/IntegrationStatusWidget.tsx +135 -0
- package/ui/src/dashboard/widgets/NotificationsStatsWidget.tsx +167 -0
- package/ui/src/dashboard/widgets/index.ts +3 -0
- package/ui/src/pages/AuthPage.tsx +986 -142
- package/ui/src/pages/IntegrationsPage.tsx +288 -0
- package/ui/src/pages/NotificationsPage.tsx +417 -0
- package/ui/src/pages/RateLimitPage.tsx +292 -0
- package/ui/src/utils/formatters.ts +33 -0
- package/dist-ui/assets/index-BY8OxNgO.js +0 -465
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Auth Status Widget
|
|
3
|
+
*
|
|
4
|
+
* Displays the authentication plugin status on the dashboard.
|
|
5
|
+
* Shows whether auth is enabled, the adapter type, and configuration status.
|
|
6
|
+
*
|
|
7
|
+
* Copyright (c) 2025 QwickApps.com. All rights reserved.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import { useState, useEffect } from 'react';
|
|
11
|
+
import { Box, Typography, Chip, CircularProgress, Alert } from '@mui/material';
|
|
12
|
+
import CheckCircleIcon from '@mui/icons-material/CheckCircle';
|
|
13
|
+
import ErrorIcon from '@mui/icons-material/Error';
|
|
14
|
+
import BlockIcon from '@mui/icons-material/Block';
|
|
15
|
+
import { api } from '../../api/controlPanelApi';
|
|
16
|
+
|
|
17
|
+
interface AuthStatus {
|
|
18
|
+
state: 'enabled' | 'disabled' | 'error';
|
|
19
|
+
adapter: string | null;
|
|
20
|
+
error?: string;
|
|
21
|
+
missingVars?: string[];
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const adapterLabels: Record<string, string> = {
|
|
25
|
+
supertokens: 'SuperTokens',
|
|
26
|
+
auth0: 'Auth0',
|
|
27
|
+
supabase: 'Supabase',
|
|
28
|
+
basic: 'Basic Auth',
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export function AuthStatusWidget() {
|
|
32
|
+
const [status, setStatus] = useState<AuthStatus | null>(null);
|
|
33
|
+
const [loading, setLoading] = useState(true);
|
|
34
|
+
const [error, setError] = useState<string | null>(null);
|
|
35
|
+
|
|
36
|
+
useEffect(() => {
|
|
37
|
+
const fetchStatus = async () => {
|
|
38
|
+
try {
|
|
39
|
+
const data = await api.fetch<AuthStatus>('/auth/config/status');
|
|
40
|
+
setStatus(data);
|
|
41
|
+
} catch (err) {
|
|
42
|
+
setError(err instanceof Error ? err.message : 'Failed to fetch auth status');
|
|
43
|
+
} finally {
|
|
44
|
+
setLoading(false);
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
fetchStatus();
|
|
49
|
+
}, []);
|
|
50
|
+
|
|
51
|
+
if (loading) {
|
|
52
|
+
return (
|
|
53
|
+
<Box sx={{ display: 'flex', justifyContent: 'center', py: 2 }}>
|
|
54
|
+
<CircularProgress size={20} />
|
|
55
|
+
</Box>
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
if (error) {
|
|
60
|
+
return (
|
|
61
|
+
<Alert severity="warning" sx={{ py: 0.5, fontSize: 13 }}>
|
|
62
|
+
Unable to load auth status
|
|
63
|
+
</Alert>
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
if (!status) return null;
|
|
68
|
+
|
|
69
|
+
const getStateIcon = () => {
|
|
70
|
+
switch (status.state) {
|
|
71
|
+
case 'enabled':
|
|
72
|
+
return <CheckCircleIcon sx={{ color: 'var(--theme-success)', fontSize: 32 }} />;
|
|
73
|
+
case 'error':
|
|
74
|
+
return <ErrorIcon sx={{ color: 'var(--theme-error)', fontSize: 32 }} />;
|
|
75
|
+
case 'disabled':
|
|
76
|
+
default:
|
|
77
|
+
return <BlockIcon sx={{ color: 'var(--theme-text-secondary)', fontSize: 32 }} />;
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
const getStateColor = () => {
|
|
82
|
+
switch (status.state) {
|
|
83
|
+
case 'enabled':
|
|
84
|
+
return 'var(--theme-success)';
|
|
85
|
+
case 'error':
|
|
86
|
+
return 'var(--theme-error)';
|
|
87
|
+
case 'disabled':
|
|
88
|
+
default:
|
|
89
|
+
return 'var(--theme-text-secondary)';
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
return (
|
|
94
|
+
<Box
|
|
95
|
+
sx={{
|
|
96
|
+
bgcolor: 'var(--theme-surface)',
|
|
97
|
+
borderRadius: 2,
|
|
98
|
+
p: 2,
|
|
99
|
+
border: '1px solid var(--theme-border)',
|
|
100
|
+
}}
|
|
101
|
+
>
|
|
102
|
+
<Box sx={{ display: 'flex', alignItems: 'center', gap: 2 }}>
|
|
103
|
+
{getStateIcon()}
|
|
104
|
+
<Box sx={{ flex: 1 }}>
|
|
105
|
+
<Box sx={{ display: 'flex', alignItems: 'center', gap: 1, mb: 0.5 }}>
|
|
106
|
+
<Typography variant="subtitle1" sx={{ color: 'var(--theme-text-primary)', fontWeight: 600 }}>
|
|
107
|
+
{status.state === 'enabled' && status.adapter
|
|
108
|
+
? adapterLabels[status.adapter] || status.adapter
|
|
109
|
+
: status.state === 'disabled'
|
|
110
|
+
? 'Not Configured'
|
|
111
|
+
: 'Configuration Error'}
|
|
112
|
+
</Typography>
|
|
113
|
+
<Chip
|
|
114
|
+
label={status.state.toUpperCase()}
|
|
115
|
+
size="small"
|
|
116
|
+
sx={{
|
|
117
|
+
bgcolor: `${getStateColor()}20`,
|
|
118
|
+
color: getStateColor(),
|
|
119
|
+
fontWeight: 600,
|
|
120
|
+
fontSize: 10,
|
|
121
|
+
height: 20,
|
|
122
|
+
}}
|
|
123
|
+
/>
|
|
124
|
+
</Box>
|
|
125
|
+
<Typography variant="body2" sx={{ color: 'var(--theme-text-secondary)' }}>
|
|
126
|
+
{status.state === 'enabled'
|
|
127
|
+
? 'Authentication is active'
|
|
128
|
+
: status.state === 'disabled'
|
|
129
|
+
? 'Set AUTH_ADAPTER environment variable'
|
|
130
|
+
: status.error || 'Check configuration'}
|
|
131
|
+
</Typography>
|
|
132
|
+
</Box>
|
|
133
|
+
</Box>
|
|
134
|
+
|
|
135
|
+
{/* Missing vars warning */}
|
|
136
|
+
{status.missingVars && status.missingVars.length > 0 && (
|
|
137
|
+
<Alert severity="warning" sx={{ mt: 2, py: 0.5, '& .MuiAlert-message': { fontSize: 12 } }}>
|
|
138
|
+
Missing: {status.missingVars.join(', ')}
|
|
139
|
+
</Alert>
|
|
140
|
+
)}
|
|
141
|
+
</Box>
|
|
142
|
+
);
|
|
143
|
+
}
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Integration Status Widget
|
|
3
|
+
*
|
|
4
|
+
* Displays the status of configured integrations with their connection status.
|
|
5
|
+
* Used in the dashboard to show a quick overview of integration health.
|
|
6
|
+
*
|
|
7
|
+
* Copyright (c) 2025 QwickApps.com. All rights reserved.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import { useState, useEffect } from 'react';
|
|
11
|
+
import { Box, Typography, Chip, CircularProgress, Alert } from '@mui/material';
|
|
12
|
+
import CheckCircleIcon from '@mui/icons-material/CheckCircle';
|
|
13
|
+
import ErrorIcon from '@mui/icons-material/Error';
|
|
14
|
+
import { api } from '../../api/controlPanelApi';
|
|
15
|
+
|
|
16
|
+
interface Integration {
|
|
17
|
+
id: string;
|
|
18
|
+
name: string;
|
|
19
|
+
description: string;
|
|
20
|
+
configured: boolean;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
interface IntegrationsConfig {
|
|
24
|
+
integrations: Integration[];
|
|
25
|
+
stats: {
|
|
26
|
+
totalRequests: number;
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export function IntegrationStatusWidget() {
|
|
31
|
+
const [config, setConfig] = useState<IntegrationsConfig | null>(null);
|
|
32
|
+
const [loading, setLoading] = useState(true);
|
|
33
|
+
const [error, setError] = useState<string | null>(null);
|
|
34
|
+
|
|
35
|
+
useEffect(() => {
|
|
36
|
+
const fetchConfig = async () => {
|
|
37
|
+
try {
|
|
38
|
+
const data = await api.fetch<IntegrationsConfig>('/ai-proxy/config');
|
|
39
|
+
setConfig(data);
|
|
40
|
+
} catch (err) {
|
|
41
|
+
setError(err instanceof Error ? err.message : 'Failed to fetch integrations');
|
|
42
|
+
} finally {
|
|
43
|
+
setLoading(false);
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
fetchConfig();
|
|
48
|
+
}, []);
|
|
49
|
+
|
|
50
|
+
if (loading) {
|
|
51
|
+
return (
|
|
52
|
+
<Box sx={{ display: 'flex', justifyContent: 'center', py: 2 }}>
|
|
53
|
+
<CircularProgress size={20} />
|
|
54
|
+
</Box>
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
if (error) {
|
|
59
|
+
return (
|
|
60
|
+
<Alert severity="warning" sx={{ py: 0.5, fontSize: 13 }}>
|
|
61
|
+
Unable to load integrations
|
|
62
|
+
</Alert>
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
if (!config) return null;
|
|
67
|
+
|
|
68
|
+
const configuredCount = config.integrations.filter((i) => i.configured).length;
|
|
69
|
+
const totalCount = config.integrations.length;
|
|
70
|
+
|
|
71
|
+
return (
|
|
72
|
+
<Box
|
|
73
|
+
sx={{
|
|
74
|
+
bgcolor: 'var(--theme-surface)',
|
|
75
|
+
borderRadius: 2,
|
|
76
|
+
p: 2,
|
|
77
|
+
border: '1px solid var(--theme-border)',
|
|
78
|
+
}}
|
|
79
|
+
>
|
|
80
|
+
{/* Summary */}
|
|
81
|
+
<Box sx={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', mb: 2 }}>
|
|
82
|
+
<Typography variant="subtitle2" sx={{ color: 'var(--theme-text-secondary)' }}>
|
|
83
|
+
{configuredCount} of {totalCount} configured
|
|
84
|
+
</Typography>
|
|
85
|
+
<Typography variant="subtitle2" sx={{ color: 'var(--theme-text-secondary)' }}>
|
|
86
|
+
{config.stats.totalRequests} requests
|
|
87
|
+
</Typography>
|
|
88
|
+
</Box>
|
|
89
|
+
|
|
90
|
+
{/* Integration List */}
|
|
91
|
+
<Box sx={{ display: 'flex', flexDirection: 'column', gap: 1.5 }}>
|
|
92
|
+
{config.integrations.map((integration) => (
|
|
93
|
+
<Box
|
|
94
|
+
key={integration.id}
|
|
95
|
+
sx={{
|
|
96
|
+
display: 'flex',
|
|
97
|
+
alignItems: 'center',
|
|
98
|
+
justifyContent: 'space-between',
|
|
99
|
+
p: 1.5,
|
|
100
|
+
bgcolor: 'var(--theme-background)',
|
|
101
|
+
borderRadius: 1,
|
|
102
|
+
}}
|
|
103
|
+
>
|
|
104
|
+
<Box sx={{ display: 'flex', alignItems: 'center', gap: 1 }}>
|
|
105
|
+
{integration.configured ? (
|
|
106
|
+
<CheckCircleIcon sx={{ color: 'var(--theme-success)', fontSize: 18 }} />
|
|
107
|
+
) : (
|
|
108
|
+
<ErrorIcon sx={{ color: 'var(--theme-text-secondary)', fontSize: 18 }} />
|
|
109
|
+
)}
|
|
110
|
+
<Box>
|
|
111
|
+
<Typography variant="body2" sx={{ color: 'var(--theme-text-primary)', fontWeight: 500 }}>
|
|
112
|
+
{integration.name}
|
|
113
|
+
</Typography>
|
|
114
|
+
<Typography variant="caption" sx={{ color: 'var(--theme-text-secondary)' }}>
|
|
115
|
+
{integration.description}
|
|
116
|
+
</Typography>
|
|
117
|
+
</Box>
|
|
118
|
+
</Box>
|
|
119
|
+
<Chip
|
|
120
|
+
label={integration.configured ? 'Connected' : 'Not Configured'}
|
|
121
|
+
size="small"
|
|
122
|
+
sx={{
|
|
123
|
+
bgcolor: integration.configured ? 'var(--theme-success)20' : 'transparent',
|
|
124
|
+
color: integration.configured ? 'var(--theme-success)' : 'var(--theme-text-secondary)',
|
|
125
|
+
border: integration.configured ? 'none' : '1px solid var(--theme-border)',
|
|
126
|
+
fontWeight: 500,
|
|
127
|
+
fontSize: 11,
|
|
128
|
+
}}
|
|
129
|
+
/>
|
|
130
|
+
</Box>
|
|
131
|
+
))}
|
|
132
|
+
</Box>
|
|
133
|
+
</Box>
|
|
134
|
+
);
|
|
135
|
+
}
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Notifications Stats Widget
|
|
3
|
+
*
|
|
4
|
+
* Displays realtime notifications connection statistics on the Control Panel dashboard.
|
|
5
|
+
* Shows active clients, events processed, and connection health.
|
|
6
|
+
*
|
|
7
|
+
* Copyright (c) 2025 QwickApps.com. All rights reserved.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import { useState, useEffect } from 'react';
|
|
11
|
+
import { Box, Card, CardContent, Chip, LinearProgress } from '@mui/material';
|
|
12
|
+
import { GridLayout, Text } from '@qwickapps/react-framework';
|
|
13
|
+
import WifiIcon from '@mui/icons-material/Wifi';
|
|
14
|
+
import WifiOffIcon from '@mui/icons-material/WifiOff';
|
|
15
|
+
import DevicesIcon from '@mui/icons-material/Devices';
|
|
16
|
+
import PersonIcon from '@mui/icons-material/Person';
|
|
17
|
+
import SendIcon from '@mui/icons-material/Send';
|
|
18
|
+
import ErrorIcon from '@mui/icons-material/Error';
|
|
19
|
+
import { api } from '../../api/controlPanelApi';
|
|
20
|
+
import type { NotificationsStatsResponse } from '../../api/controlPanelApi';
|
|
21
|
+
import { StatCard } from '../../components/StatCard';
|
|
22
|
+
import { formatNumber, formatDuration } from '../../utils/formatters';
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Notifications Stats Widget Component
|
|
26
|
+
*/
|
|
27
|
+
export function NotificationsStatsWidget() {
|
|
28
|
+
const [stats, setStats] = useState<NotificationsStatsResponse | null>(null);
|
|
29
|
+
const [error, setError] = useState<string | null>(null);
|
|
30
|
+
const [loading, setLoading] = useState(true);
|
|
31
|
+
|
|
32
|
+
useEffect(() => {
|
|
33
|
+
const fetchStats = async () => {
|
|
34
|
+
try {
|
|
35
|
+
const data = await api.getNotificationsStats();
|
|
36
|
+
setStats(data);
|
|
37
|
+
setError(null);
|
|
38
|
+
} catch (err) {
|
|
39
|
+
// Check if it's a 404 (plugin not enabled)
|
|
40
|
+
if (err instanceof Error && err.message.includes('404')) {
|
|
41
|
+
setError('Notifications plugin not enabled');
|
|
42
|
+
} else {
|
|
43
|
+
setError(err instanceof Error ? err.message : 'Failed to fetch stats');
|
|
44
|
+
}
|
|
45
|
+
} finally {
|
|
46
|
+
setLoading(false);
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
fetchStats();
|
|
51
|
+
const interval = setInterval(fetchStats, 5000); // Refresh every 5 seconds
|
|
52
|
+
return () => clearInterval(interval);
|
|
53
|
+
}, []);
|
|
54
|
+
|
|
55
|
+
if (loading) {
|
|
56
|
+
return (
|
|
57
|
+
<Card sx={{ bgcolor: 'var(--theme-surface)' }}>
|
|
58
|
+
<CardContent>
|
|
59
|
+
<LinearProgress />
|
|
60
|
+
</CardContent>
|
|
61
|
+
</Card>
|
|
62
|
+
);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
if (error) {
|
|
66
|
+
return (
|
|
67
|
+
<Card sx={{ bgcolor: 'var(--theme-surface)', border: '1px solid var(--theme-border)' }}>
|
|
68
|
+
<CardContent>
|
|
69
|
+
<Box sx={{ display: 'flex', alignItems: 'center', gap: 1 }}>
|
|
70
|
+
<WifiOffIcon sx={{ color: 'var(--theme-text-secondary)' }} />
|
|
71
|
+
<Text variant="body2" customColor="var(--theme-text-secondary)" content={error} />
|
|
72
|
+
</Box>
|
|
73
|
+
</CardContent>
|
|
74
|
+
</Card>
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
if (!stats) {
|
|
79
|
+
return null;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
const isHealthy = stats.connectionHealth.isHealthy;
|
|
83
|
+
const healthColor = isHealthy ? 'var(--theme-success)' : 'var(--theme-warning)';
|
|
84
|
+
|
|
85
|
+
return (
|
|
86
|
+
<Box>
|
|
87
|
+
{/* Connection Status Bar */}
|
|
88
|
+
<Card sx={{ bgcolor: 'var(--theme-surface)', mb: 2 }}>
|
|
89
|
+
<CardContent sx={{ py: 1, '&:last-child': { pb: 1 } }}>
|
|
90
|
+
<Box sx={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between' }}>
|
|
91
|
+
<Box sx={{ display: 'flex', alignItems: 'center', gap: 1 }}>
|
|
92
|
+
{isHealthy ? (
|
|
93
|
+
<WifiIcon sx={{ color: healthColor, fontSize: 20 }} />
|
|
94
|
+
) : (
|
|
95
|
+
<WifiOffIcon sx={{ color: healthColor, fontSize: 20 }} />
|
|
96
|
+
)}
|
|
97
|
+
<Text
|
|
98
|
+
variant="body2"
|
|
99
|
+
content={isHealthy ? 'Connected' : 'Reconnecting...'}
|
|
100
|
+
customColor={healthColor}
|
|
101
|
+
fontWeight="500"
|
|
102
|
+
/>
|
|
103
|
+
{stats.connectionHealth.isReconnecting && (
|
|
104
|
+
<Chip
|
|
105
|
+
label={`Attempt ${stats.connectionHealth.reconnectAttempts}`}
|
|
106
|
+
size="small"
|
|
107
|
+
sx={{
|
|
108
|
+
bgcolor: 'var(--theme-warning)20',
|
|
109
|
+
color: 'var(--theme-warning)',
|
|
110
|
+
fontSize: '0.7rem',
|
|
111
|
+
height: 18,
|
|
112
|
+
}}
|
|
113
|
+
/>
|
|
114
|
+
)}
|
|
115
|
+
</Box>
|
|
116
|
+
<Box sx={{ display: 'flex', alignItems: 'center', gap: 2 }}>
|
|
117
|
+
<Text
|
|
118
|
+
variant="caption"
|
|
119
|
+
content={`${stats.channels.length} channel${stats.channels.length !== 1 ? 's' : ''}`}
|
|
120
|
+
customColor="var(--theme-text-secondary)"
|
|
121
|
+
/>
|
|
122
|
+
{stats.lastEventAt && (
|
|
123
|
+
<Text
|
|
124
|
+
variant="caption"
|
|
125
|
+
content={`Last event: ${formatDuration(stats.connectionHealth.timeSinceLastEvent)} ago`}
|
|
126
|
+
customColor="var(--theme-text-secondary)"
|
|
127
|
+
/>
|
|
128
|
+
)}
|
|
129
|
+
</Box>
|
|
130
|
+
</Box>
|
|
131
|
+
</CardContent>
|
|
132
|
+
</Card>
|
|
133
|
+
|
|
134
|
+
{/* Stats Grid */}
|
|
135
|
+
<GridLayout columns={4} spacing="small" equalHeight>
|
|
136
|
+
<StatCard
|
|
137
|
+
icon={<DevicesIcon sx={{ fontSize: 28 }} />}
|
|
138
|
+
label="Active Clients"
|
|
139
|
+
value={stats.currentConnections}
|
|
140
|
+
subValue={`${stats.totalConnections} total`}
|
|
141
|
+
color="var(--theme-primary)"
|
|
142
|
+
/>
|
|
143
|
+
<StatCard
|
|
144
|
+
icon={<PersonIcon sx={{ fontSize: 28 }} />}
|
|
145
|
+
label="By Device"
|
|
146
|
+
value={stats.clientsByType.device}
|
|
147
|
+
subValue={`${stats.clientsByType.user} by user`}
|
|
148
|
+
color="var(--theme-info)"
|
|
149
|
+
/>
|
|
150
|
+
<StatCard
|
|
151
|
+
icon={<SendIcon sx={{ fontSize: 28 }} />}
|
|
152
|
+
label="Events Routed"
|
|
153
|
+
value={formatNumber(stats.eventsRouted)}
|
|
154
|
+
subValue={`${formatNumber(stats.eventsProcessed)} processed`}
|
|
155
|
+
color="var(--theme-success)"
|
|
156
|
+
/>
|
|
157
|
+
<StatCard
|
|
158
|
+
icon={<ErrorIcon sx={{ fontSize: 28 }} />}
|
|
159
|
+
label="Dropped"
|
|
160
|
+
value={formatNumber(stats.eventsDroppedNoClients)}
|
|
161
|
+
subValue={`${stats.eventsParseFailed} parse errors`}
|
|
162
|
+
color={stats.eventsDroppedNoClients > 0 ? 'var(--theme-warning)' : 'var(--theme-text-secondary)'}
|
|
163
|
+
/>
|
|
164
|
+
</GridLayout>
|
|
165
|
+
</Box>
|
|
166
|
+
);
|
|
167
|
+
}
|