amliq-dashboard 2.0.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/.env.example +3 -0
- package/.env.production +1 -0
- package/Dockerfile +26 -0
- package/QUICK_START.md +267 -0
- package/README.md +161 -0
- package/TESTING_GUIDE.md +322 -0
- package/dist/.well-known/ai-plugin.json +15 -0
- package/dist/_headers +8 -0
- package/dist/_redirects +1 -0
- package/dist/assets/APIKeys-BvwFauIs.js +6 -0
- package/dist/assets/APIKeys-DaMSBZQL.js +1 -0
- package/dist/assets/AdverseMedia-DckXfMzS.js +4 -0
- package/dist/assets/AlertDetailPage-Bc2_zwu_.js +1 -0
- package/dist/assets/AlertQueue-DFtBiRoM.js +8 -0
- package/dist/assets/Analytics-DtruB5lQ.js +1 -0
- package/dist/assets/AuditTrail-BK68ePu0.js +1 -0
- package/dist/assets/AuthDivider-gRHEt7gx.js +1 -0
- package/dist/assets/Badge-B9VFkofy.js +1 -0
- package/dist/assets/BatchJobs-Bz6KFnXD.js +6 -0
- package/dist/assets/BillingPage-R9nQ5nFb.js +11 -0
- package/dist/assets/Card-Cw-T_-oU.js +1 -0
- package/dist/assets/CaseDetail-DYs7Zg_y.js +7 -0
- package/dist/assets/CaseManagement-B1Q4Dp1Y.js +1 -0
- package/dist/assets/ComplianceReport-Dhssqc9T.js +1 -0
- package/dist/assets/Configuration-B92kl9T0.js +1 -0
- package/dist/assets/CryptoScreening-C7yFlskC.js +1 -0
- package/dist/assets/Dashboard-w4-Nhv9q.js +17 -0
- package/dist/assets/DataSources-u3-Ri_5_.js +3 -0
- package/dist/assets/EDDWorkflow-CFzlEO0e.js +1 -0
- package/dist/assets/EmptyState-Do0xJAT9.js +6 -0
- package/dist/assets/ForgotPassword-BPYyQFQp.js +1 -0
- package/dist/assets/LandingPage-CjaP0zw4.js +41 -0
- package/dist/assets/ListsMarketplace-CG6KkT9B.js +6 -0
- package/dist/assets/Login-677LEGP1.js +1 -0
- package/dist/assets/MFASetup-BxqCPvui.js +1 -0
- package/dist/assets/Monitoring-9TN9MK4y.js +1 -0
- package/dist/assets/Onboarding-Cf0Y83lX.js +1 -0
- package/dist/assets/Operations-CcXwc2xw.js +10 -0
- package/dist/assets/Overview-B_Ky0VWV.js +1 -0
- package/dist/assets/PEPScreening-pUQjTH9c.js +1 -0
- package/dist/assets/PageHeader-BObHFn0i.js +1 -0
- package/dist/assets/PrivacyPolicy-DZ2xrKir.js +1 -0
- package/dist/assets/ResetPassword-AtxtpIG1.js +1 -0
- package/dist/assets/RiskAssessment-Dzuh1Usv.js +1 -0
- package/dist/assets/SARForm-D8w2ZGe-.js +1 -0
- package/dist/assets/SanctionsLists-CPA3UH2v.js +1 -0
- package/dist/assets/ScheduledTasks-Dsjk-6UR.js +1 -0
- package/dist/assets/ScreenEntity-D1U0YL7v.js +3 -0
- package/dist/assets/ScreeningProgress-BW49PzoB.js +66 -0
- package/dist/assets/SearchField-CulFKdiI.js +1 -0
- package/dist/assets/Signup-C0FmFOo_.js +1 -0
- package/dist/assets/SystemHealth-B_8u4eva.js +1 -0
- package/dist/assets/TaskHistory-BCmEM89q.js +3 -0
- package/dist/assets/Team-CUo_FlU7.js +1 -0
- package/dist/assets/TenantDetail-CgZQHUY8.js +1 -0
- package/dist/assets/Tenants-RB9E9ick.js +2 -0
- package/dist/assets/TermsOfService-BfL-kndX.js +1 -0
- package/dist/assets/TransactionMonitoring-DGh_T22s.js +14 -0
- package/dist/assets/TxnScreening-B7cm2-eh.js +1 -0
- package/dist/assets/UBOChain-falXAsCo.js +1 -0
- package/dist/assets/Users-Doakpg9c.js +1 -0
- package/dist/assets/Webhooks-BZpAfaxv.js +1 -0
- package/dist/assets/alert-triangle-YCFVm7B_.js +6 -0
- package/dist/assets/alerts-COUnTwWY.js +1 -0
- package/dist/assets/arrow-left-9ApLqP95.js +6 -0
- package/dist/assets/check-VTcvVtIU.js +6 -0
- package/dist/assets/check-circle-2-Dn-lG5YQ.js +6 -0
- package/dist/assets/code-DIJRWFVv.js +6 -0
- package/dist/assets/fingerprint-C0MGVtax.js +6 -0
- package/dist/assets/flag-B8_Gwxh6.js +6 -0
- package/dist/assets/index-CfdYcqRM.js +289 -0
- package/dist/assets/index-HPU_Rhdu.css +1 -0
- package/dist/assets/layers-zHz2o4vo.js +6 -0
- package/dist/assets/loader-B9_dNihg.js +6 -0
- package/dist/assets/mail-BijL2qwp.js +6 -0
- package/dist/assets/plus-i0oBIIPS.js +6 -0
- package/dist/assets/refresh-cw-CSuAwutt.js +6 -0
- package/dist/assets/useAnalytics-Bj8IONcw.js +72 -0
- package/dist/assets/x-circle-DLGKvijE.js +6 -0
- package/dist/favicon.svg +15 -0
- package/dist/index.html +51 -0
- package/dist/llms.txt +28 -0
- package/dist/logo.png +0 -0
- package/dist/logo.svg +17 -0
- package/dist/manifest.json +44 -0
- package/dist/robots.txt +15 -0
- package/dist/schema.json +13 -0
- package/dist/sitemap.xml +28 -0
- package/dist/sw.js +67 -0
- package/e2e/auth-setup.ts +20 -0
- package/e2e/billing.spec.ts +50 -0
- package/e2e/cases.spec.ts +53 -0
- package/e2e/compliance.spec.ts +65 -0
- package/e2e/config.spec.ts +56 -0
- package/e2e/dashboard.spec.ts +47 -0
- package/e2e/fixtures.ts +33 -0
- package/e2e/lists.spec.ts +43 -0
- package/e2e/login.spec.ts +64 -0
- package/e2e/media.spec.ts +48 -0
- package/e2e/mocks.ts +51 -0
- package/e2e/monitoring.spec.ts +44 -0
- package/e2e/navigation.spec.ts +56 -0
- package/e2e/onboarding.spec.ts +49 -0
- package/e2e/responsive.spec.ts +40 -0
- package/e2e/risk.spec.ts +61 -0
- package/e2e/screening.spec.ts +76 -0
- package/e2e/team.spec.ts +53 -0
- package/index.html +50 -0
- package/package.json +47 -0
- package/playwright.config.ts +35 -0
- package/postcss.config.js +6 -0
- package/public/.well-known/ai-plugin.json +15 -0
- package/public/_headers +8 -0
- package/public/_redirects +1 -0
- package/public/favicon.svg +15 -0
- package/public/llms.txt +28 -0
- package/public/logo.png +0 -0
- package/public/logo.svg +17 -0
- package/public/manifest.json +44 -0
- package/public/robots.txt +15 -0
- package/public/schema.json +13 -0
- package/public/sitemap.xml +28 -0
- package/public/sw.js +67 -0
- package/scripts/test-runner.sh +152 -0
- package/src/App.tsx +48 -0
- package/src/api/alerts.ts +19 -0
- package/src/api/analytics.ts +6 -0
- package/src/api/audit.ts +11 -0
- package/src/api/auth.ts +26 -0
- package/src/api/billing.ts +54 -0
- package/src/api/cases.ts +48 -0
- package/src/api/client.ts +50 -0
- package/src/api/config.ts +30 -0
- package/src/api/edd.ts +25 -0
- package/src/api/enforcement.ts +33 -0
- package/src/api/lists.ts +24 -0
- package/src/api/monitoring.ts +82 -0
- package/src/api/pep.ts +30 -0
- package/src/api/risk.ts +26 -0
- package/src/api/screening.ts +37 -0
- package/src/api/team.ts +27 -0
- package/src/api/transactions.ts +37 -0
- package/src/components/admin/TenantCards.tsx +51 -0
- package/src/components/alerts/AlertActions.test.tsx +80 -0
- package/src/components/alerts/AlertActions.tsx +68 -0
- package/src/components/alerts/AlertCard.test.tsx +86 -0
- package/src/components/alerts/AlertCard.tsx +60 -0
- package/src/components/alerts/AlertDetailSidebar.tsx +63 -0
- package/src/components/alerts/AlertFilters.test.tsx +73 -0
- package/src/components/alerts/AlertFilters.tsx +88 -0
- package/src/components/alerts/EntityDetailsCard.test.tsx +61 -0
- package/src/components/alerts/EntityDetailsCard.tsx +37 -0
- package/src/components/alerts/NotesCard.test.tsx +39 -0
- package/src/components/alerts/NotesCard.tsx +28 -0
- package/src/components/auth/AuthDivider.tsx +18 -0
- package/src/components/auth/LoginForm.tsx +62 -0
- package/src/components/auth/LoginLeftPanel.tsx +43 -0
- package/src/components/auth/PasswordStrength.tsx +26 -0
- package/src/components/auth/SignInButtons.tsx +46 -0
- package/src/components/auth/SignupLeftPanel.tsx +35 -0
- package/src/components/auth/countries.ts +17 -0
- package/src/components/charts/AreaChart.tsx +45 -0
- package/src/components/charts/BarChart.tsx +48 -0
- package/src/components/charts/DonutChart.tsx +47 -0
- package/src/components/compliance/CaseActions.tsx +74 -0
- package/src/components/compliance/CaseTimeline.tsx +68 -0
- package/src/components/compliance/MediaResultCard.tsx +87 -0
- package/src/components/compliance/PEPResultCard.tsx +78 -0
- package/src/components/config/MatchingModesCard.test.tsx +75 -0
- package/src/components/config/MatchingModesCard.tsx +40 -0
- package/src/components/config/ScreeningLayersCard.test.tsx +57 -0
- package/src/components/config/ScreeningLayersCard.tsx +36 -0
- package/src/components/config/ThresholdsCard.test.tsx +79 -0
- package/src/components/config/ThresholdsCard.tsx +51 -0
- package/src/components/dashboard/ActivityFeed.tsx +93 -0
- package/src/components/dashboard/DashboardGreeting.tsx +23 -0
- package/src/components/dashboard/DashboardSkeleton.tsx +35 -0
- package/src/components/dashboard/QuickActions.tsx +52 -0
- package/src/components/dashboard/TopEntitiesTable.tsx +63 -0
- package/src/components/data/ComplianceMetrics.test.tsx +32 -0
- package/src/components/data/ComplianceMetrics.tsx +40 -0
- package/src/components/data/ConfidenceScore.test.tsx +62 -0
- package/src/components/data/ConfidenceScore.tsx +27 -0
- package/src/components/data/StatCard.test.tsx +72 -0
- package/src/components/data/StatCard.tsx +63 -0
- package/src/components/data/StatusBadge.test.tsx +63 -0
- package/src/components/data/StatusBadge.tsx +39 -0
- package/src/components/layout/AppShell.tsx +48 -0
- package/src/components/layout/Breadcrumbs.tsx +48 -0
- package/src/components/layout/CommandPalette.tsx +81 -0
- package/src/components/layout/DashboardLayout.tsx +19 -0
- package/src/components/layout/MobileHeader.tsx +30 -0
- package/src/components/layout/NavGroup.test.tsx +63 -0
- package/src/components/layout/NavGroup.tsx +64 -0
- package/src/components/layout/NotificationBell.tsx +89 -0
- package/src/components/layout/PageHeader.test.tsx +61 -0
- package/src/components/layout/PageHeader.tsx +19 -0
- package/src/components/layout/ProtectedRoute.tsx +31 -0
- package/src/components/layout/PublicLayout.tsx +17 -0
- package/src/components/layout/Sidebar.test.tsx +67 -0
- package/src/components/layout/Sidebar.tsx +92 -0
- package/src/components/layout/Toolbar.test.tsx +47 -0
- package/src/components/layout/Toolbar.tsx +68 -0
- package/src/components/layout/navItems.ts +94 -0
- package/src/components/lists/ListCard.tsx +78 -0
- package/src/components/lists/ListMarketplaceCard.tsx +77 -0
- package/src/components/screening/CircularConfidence.tsx +38 -0
- package/src/components/screening/LimitReachedBanner.tsx +31 -0
- package/src/components/screening/ListSelector.tsx +64 -0
- package/src/components/screening/MatchDetailHeader.tsx +64 -0
- package/src/components/screening/MatchEntityInfo.tsx +56 -0
- package/src/components/screening/MatchEvidenceBars.tsx +65 -0
- package/src/components/screening/MatchMetadata.tsx +95 -0
- package/src/components/screening/ScreenResults.tsx +49 -0
- package/src/components/screening/ScreeningForm.test.tsx +83 -0
- package/src/components/screening/ScreeningForm.tsx +100 -0
- package/src/components/screening/ScreeningLayersList.test.tsx +33 -0
- package/src/components/screening/ScreeningLayersList.tsx +46 -0
- package/src/components/screening/ScreeningProgress.tsx +91 -0
- package/src/components/screening/ScreeningQuotaBanner.tsx +64 -0
- package/src/components/screening/ScreeningResultCard.tsx +47 -0
- package/src/components/screening/ScreeningResultRow.tsx +45 -0
- package/src/components/screening/ScreeningResults.test.tsx +37 -0
- package/src/components/screening/ScreeningResults.tsx +33 -0
- package/src/components/screening/ShareResults.tsx +103 -0
- package/src/components/screening/ThresholdSlider.tsx +23 -0
- package/src/components/transactions/WebhookCTA.tsx +63 -0
- package/src/components/ui/Avatar.test.tsx +47 -0
- package/src/components/ui/Avatar.tsx +35 -0
- package/src/components/ui/Badge.test.tsx +49 -0
- package/src/components/ui/Badge.tsx +33 -0
- package/src/components/ui/Button.test.tsx +56 -0
- package/src/components/ui/Button.tsx +46 -0
- package/src/components/ui/Card.test.tsx +61 -0
- package/src/components/ui/Card.tsx +29 -0
- package/src/components/ui/ConfirmModal.tsx +67 -0
- package/src/components/ui/Divider.test.tsx +24 -0
- package/src/components/ui/Divider.tsx +5 -0
- package/src/components/ui/EmptyState.test.tsx +49 -0
- package/src/components/ui/EmptyState.tsx +22 -0
- package/src/components/ui/ErrorBoundary.tsx +44 -0
- package/src/components/ui/ExportMenu.tsx +71 -0
- package/src/components/ui/LanguageSwitcher.tsx +37 -0
- package/src/components/ui/LoadingSpinner.test.tsx +41 -0
- package/src/components/ui/LoadingSpinner.tsx +21 -0
- package/src/components/ui/MetricCard.tsx +63 -0
- package/src/components/ui/ScoreRing.tsx +51 -0
- package/src/components/ui/SearchField.test.tsx +55 -0
- package/src/components/ui/SearchField.tsx +31 -0
- package/src/components/ui/SeverityBadge.tsx +57 -0
- package/src/components/ui/ThemeToggle.tsx +37 -0
- package/src/components/ui/Toast.test.tsx +79 -0
- package/src/components/ui/Toast.tsx +75 -0
- package/src/components/ui/Toggle.test.tsx +85 -0
- package/src/components/ui/Toggle.tsx +46 -0
- package/src/context/AuthContext.tsx +71 -0
- package/src/data/pepProfiles.ts +76 -0
- package/src/data/pepProfilesExtra.ts +58 -0
- package/src/hooks/useAlerts.ts +36 -0
- package/src/hooks/useAnalytics.ts +23 -0
- package/src/hooks/useApi.test.ts +79 -0
- package/src/hooks/useApi.ts +33 -0
- package/src/hooks/useAudit.ts +28 -0
- package/src/hooks/useBilling.ts +38 -0
- package/src/hooks/useConfig.ts +35 -0
- package/src/hooks/useDebounce.test.ts +84 -0
- package/src/hooks/useDebounce.ts +15 -0
- package/src/hooks/useDirection.ts +15 -0
- package/src/hooks/useLists.ts +34 -0
- package/src/hooks/useMediaQuery.test.ts +97 -0
- package/src/hooks/useMediaQuery.ts +28 -0
- package/src/hooks/useScreening.ts +33 -0
- package/src/hooks/useSidebar.ts +18 -0
- package/src/hooks/useUsage.ts +27 -0
- package/src/i18n/config.ts +33 -0
- package/src/i18n/locales/ar/admin.json +19 -0
- package/src/i18n/locales/ar/alerts.json +52 -0
- package/src/i18n/locales/ar/analytics.json +9 -0
- package/src/i18n/locales/ar/audit.json +12 -0
- package/src/i18n/locales/ar/auth.json +60 -0
- package/src/i18n/locales/ar/batch.json +5 -0
- package/src/i18n/locales/ar/billing.json +41 -0
- package/src/i18n/locales/ar/common.json +65 -0
- package/src/i18n/locales/ar/compliance.json +83 -0
- package/src/i18n/locales/ar/config.json +13 -0
- package/src/i18n/locales/ar/dashboard.json +19 -0
- package/src/i18n/locales/ar/errors.json +9 -0
- package/src/i18n/locales/ar/index.ts +29 -0
- package/src/i18n/locales/ar/legal.json +10 -0
- package/src/i18n/locales/ar/lists.json +6 -0
- package/src/i18n/locales/ar/marketing.json +110 -0
- package/src/i18n/locales/ar/monitoring.json +15 -0
- package/src/i18n/locales/ar/nav.json +35 -0
- package/src/i18n/locales/ar/onboarding.json +25 -0
- package/src/i18n/locales/ar/platform.json +23 -0
- package/src/i18n/locales/ar/screening.json +26 -0
- package/src/i18n/locales/ar/team.json +11 -0
- package/src/i18n/locales/en/admin.json +21 -0
- package/src/i18n/locales/en/alerts.json +52 -0
- package/src/i18n/locales/en/analytics.json +9 -0
- package/src/i18n/locales/en/audit.json +12 -0
- package/src/i18n/locales/en/auth.json +60 -0
- package/src/i18n/locales/en/batch.json +5 -0
- package/src/i18n/locales/en/billing.json +87 -0
- package/src/i18n/locales/en/common.json +65 -0
- package/src/i18n/locales/en/compliance.json +83 -0
- package/src/i18n/locales/en/config.json +29 -0
- package/src/i18n/locales/en/dashboard.json +23 -0
- package/src/i18n/locales/en/errors.json +9 -0
- package/src/i18n/locales/en/index.ts +29 -0
- package/src/i18n/locales/en/legal.json +114 -0
- package/src/i18n/locales/en/lists.json +6 -0
- package/src/i18n/locales/en/marketing.json +174 -0
- package/src/i18n/locales/en/monitoring.json +15 -0
- package/src/i18n/locales/en/nav.json +35 -0
- package/src/i18n/locales/en/onboarding.json +31 -0
- package/src/i18n/locales/en/platform.json +25 -0
- package/src/i18n/locales/en/screening.json +26 -0
- package/src/i18n/locales/en/team.json +12 -0
- package/src/i18n/locales/he/admin.json +19 -0
- package/src/i18n/locales/he/alerts.json +52 -0
- package/src/i18n/locales/he/analytics.json +9 -0
- package/src/i18n/locales/he/audit.json +12 -0
- package/src/i18n/locales/he/auth.json +60 -0
- package/src/i18n/locales/he/batch.json +5 -0
- package/src/i18n/locales/he/billing.json +41 -0
- package/src/i18n/locales/he/common.json +65 -0
- package/src/i18n/locales/he/compliance.json +83 -0
- package/src/i18n/locales/he/config.json +13 -0
- package/src/i18n/locales/he/dashboard.json +19 -0
- package/src/i18n/locales/he/errors.json +9 -0
- package/src/i18n/locales/he/index.ts +29 -0
- package/src/i18n/locales/he/legal.json +10 -0
- package/src/i18n/locales/he/lists.json +6 -0
- package/src/i18n/locales/he/marketing.json +110 -0
- package/src/i18n/locales/he/monitoring.json +15 -0
- package/src/i18n/locales/he/nav.json +35 -0
- package/src/i18n/locales/he/onboarding.json +25 -0
- package/src/i18n/locales/he/platform.json +23 -0
- package/src/i18n/locales/he/screening.json +26 -0
- package/src/i18n/locales/he/team.json +11 -0
- package/src/index.css +112 -0
- package/src/main.tsx +15 -0
- package/src/pages/APIKeys.tsx +120 -0
- package/src/pages/AddMonitorModal.tsx +30 -0
- package/src/pages/AdverseMedia.test.tsx +18 -0
- package/src/pages/AdverseMedia.tsx +89 -0
- package/src/pages/AlertDetailPage.tsx +64 -0
- package/src/pages/AlertQueue.test.tsx +48 -0
- package/src/pages/AlertQueue.tsx +63 -0
- package/src/pages/Analytics.tsx +50 -0
- package/src/pages/AuditTrail.tsx +64 -0
- package/src/pages/BatchJobs.tsx +79 -0
- package/src/pages/CaseDetail.tsx +72 -0
- package/src/pages/CaseManagement.test.tsx +31 -0
- package/src/pages/CaseManagement.tsx +92 -0
- package/src/pages/Configuration.test.tsx +96 -0
- package/src/pages/Configuration.tsx +123 -0
- package/src/pages/CryptoScreening.tsx +109 -0
- package/src/pages/Dashboard.test.tsx +51 -0
- package/src/pages/Dashboard.tsx +66 -0
- package/src/pages/EDDWorkflow.test.tsx +29 -0
- package/src/pages/EDDWorkflow.tsx +73 -0
- package/src/pages/ForgotPassword.test.tsx +49 -0
- package/src/pages/ForgotPassword.tsx +67 -0
- package/src/pages/ListsMarketplace.tsx +102 -0
- package/src/pages/Login.test.tsx +100 -0
- package/src/pages/Login.tsx +57 -0
- package/src/pages/MFASetup.tsx +114 -0
- package/src/pages/MonitorProfileCard.tsx +27 -0
- package/src/pages/Monitoring.tsx +68 -0
- package/src/pages/Onboarding.test.tsx +36 -0
- package/src/pages/Onboarding.tsx +60 -0
- package/src/pages/PEPScreening.test.tsx +15 -0
- package/src/pages/PEPScreening.tsx +100 -0
- package/src/pages/ResetPassword.tsx +81 -0
- package/src/pages/RiskAssessment.test.tsx +15 -0
- package/src/pages/RiskAssessment.tsx +108 -0
- package/src/pages/SanctionsLists.tsx +74 -0
- package/src/pages/ScreenEntity.test.tsx +82 -0
- package/src/pages/ScreenEntity.tsx +76 -0
- package/src/pages/Signup.test.tsx +98 -0
- package/src/pages/Signup.tsx +92 -0
- package/src/pages/TaskHistory.tsx +183 -0
- package/src/pages/Team.test.tsx +15 -0
- package/src/pages/Team.tsx +140 -0
- package/src/pages/TransactionMonitoring.test.tsx +18 -0
- package/src/pages/TransactionMonitoring.tsx +118 -0
- package/src/pages/TxnScreening.tsx +125 -0
- package/src/pages/UBOChain.test.tsx +35 -0
- package/src/pages/UBOChain.tsx +65 -0
- package/src/pages/Webhooks.tsx +137 -0
- package/src/pages/admin/DataSources.tsx +230 -0
- package/src/pages/admin/Operations.tsx +103 -0
- package/src/pages/admin/ScheduledTasks.tsx +155 -0
- package/src/pages/admin/SystemHealth.tsx +58 -0
- package/src/pages/admin/TenantDetail.tsx +62 -0
- package/src/pages/admin/Tenants.test.tsx +20 -0
- package/src/pages/admin/Tenants.tsx +63 -0
- package/src/pages/admin/opsRunners.ts +81 -0
- package/src/pages/admin/opsTerminal.tsx +63 -0
- package/src/pages/billing/ActiveSubscriptions.tsx +41 -0
- package/src/pages/billing/AddProductModal.tsx +99 -0
- package/src/pages/billing/BillingPage.test.tsx +30 -0
- package/src/pages/billing/BillingPage.tsx +67 -0
- package/src/pages/billing/CurrentPlan.tsx +50 -0
- package/src/pages/billing/InvoiceList.tsx +104 -0
- package/src/pages/billing/InvoiceRow.tsx +37 -0
- package/src/pages/billing/LemonSqueezySetup.tsx +51 -0
- package/src/pages/billing/PaymentAlert.tsx +33 -0
- package/src/pages/billing/PlanComparison.tsx +53 -0
- package/src/pages/billing/ProductUsage.tsx +43 -0
- package/src/pages/billing/PromoCodeInput.tsx +58 -0
- package/src/pages/billing/SeatManager.tsx +80 -0
- package/src/pages/billing/SeatRow.tsx +32 -0
- package/src/pages/billing/SubscriptionCard.tsx +73 -0
- package/src/pages/billing/UpgradeModal.tsx +53 -0
- package/src/pages/billing/UsageHistory.tsx +37 -0
- package/src/pages/billing/UsageMeter.tsx +26 -0
- package/src/pages/billing/UsageOverview.tsx +38 -0
- package/src/pages/legal/PrivacyPolicy.tsx +25 -0
- package/src/pages/legal/TermsOfService.tsx +25 -0
- package/src/pages/marketing/BundleCallout.tsx +24 -0
- package/src/pages/marketing/CTASection.tsx +48 -0
- package/src/pages/marketing/CaseStudy.tsx +37 -0
- package/src/pages/marketing/ComparisonTable.tsx +66 -0
- package/src/pages/marketing/CompetitiveEdge.tsx +55 -0
- package/src/pages/marketing/DataCoverage.tsx +54 -0
- package/src/pages/marketing/DataRain.tsx +30 -0
- package/src/pages/marketing/EnterpriseCTA.tsx +26 -0
- package/src/pages/marketing/FAQItem.tsx +27 -0
- package/src/pages/marketing/FAQSchema.tsx +43 -0
- package/src/pages/marketing/FAQSection.tsx +19 -0
- package/src/pages/marketing/FeatureDetail.tsx +19 -0
- package/src/pages/marketing/FeaturesGrid.tsx +60 -0
- package/src/pages/marketing/FeaturesSpotlight.tsx +68 -0
- package/src/pages/marketing/FooterSection.tsx +92 -0
- package/src/pages/marketing/GradientOrbs.tsx +26 -0
- package/src/pages/marketing/HeroSearch.tsx +113 -0
- package/src/pages/marketing/HeroSection.tsx +72 -0
- package/src/pages/marketing/LandingPage.tsx +45 -0
- package/src/pages/marketing/LogoCloud.tsx +31 -0
- package/src/pages/marketing/LogoMarquee.tsx +45 -0
- package/src/pages/marketing/MarketingNav.tsx +80 -0
- package/src/pages/marketing/MatchingLayers.tsx +78 -0
- package/src/pages/marketing/MobileMenu.tsx +45 -0
- package/src/pages/marketing/PricingCard.tsx +57 -0
- package/src/pages/marketing/PricingFeatureRow.tsx +16 -0
- package/src/pages/marketing/PricingSection.tsx +103 -0
- package/src/pages/marketing/PricingToggle.tsx +40 -0
- package/src/pages/marketing/ProductPricingCards.tsx +23 -0
- package/src/pages/marketing/ProductShowcase.tsx +81 -0
- package/src/pages/marketing/ProductTabs.tsx +45 -0
- package/src/pages/marketing/QuoteRotator.tsx +56 -0
- package/src/pages/marketing/StatsBar.tsx +81 -0
- package/src/pages/marketing/StatsSection.tsx +44 -0
- package/src/pages/marketing/TestimonialCard.tsx +38 -0
- package/src/pages/marketing/TestimonialsSection.tsx +32 -0
- package/src/pages/marketing/animations.tsx +56 -0
- package/src/pages/onboarding/CountryStep.tsx +38 -0
- package/src/pages/onboarding/ListsStep.tsx +44 -0
- package/src/pages/onboarding/StepIndicator.tsx +34 -0
- package/src/pages/onboarding/ThresholdStep.tsx +49 -0
- package/src/pages/platform/APIKeys.tsx +102 -0
- package/src/pages/platform/Overview.tsx +58 -0
- package/src/pages/platform/Users.tsx +110 -0
- package/src/pages/reporting/ComplianceReport.tsx +99 -0
- package/src/pages/reporting/SARForm.tsx +99 -0
- package/src/routes/appRoutes.tsx +60 -0
- package/src/routes/compliance.tsx +28 -0
- package/src/routes/lazyCompliance.ts +34 -0
- package/src/routes/lazyPages.ts +35 -0
- package/src/routes/lazyPlatform.ts +5 -0
- package/src/routes/platform.tsx +15 -0
- package/src/styles/effects.css +76 -0
- package/src/test/setup.ts +25 -0
- package/src/test/utils.tsx +49 -0
- package/src/types/alert.ts +31 -0
- package/src/types/analytics.ts +16 -0
- package/src/types/audit.ts +11 -0
- package/src/types/billing.ts +60 -0
- package/src/types/common.ts +15 -0
- package/src/types/config.ts +19 -0
- package/src/types/entity.ts +34 -0
- package/src/types/index.ts +8 -0
- package/src/types/list.ts +15 -0
- package/src/types/screening.ts +32 -0
- package/src/vite-env.d.ts +1 -0
- package/tailwind.config.js +65 -0
- package/tsconfig.json +22 -0
- package/vite.config.ts +11 -0
- package/vitest.config.ts +19 -0
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { useState, useRef, useEffect } from 'react'
|
|
2
|
+
import { Database, RefreshCw, Fingerprint, Globe, Wallet } from 'lucide-react'
|
|
3
|
+
import { PageHeader } from '../../components/layout/PageHeader'
|
|
4
|
+
import { TerminalBar, TermLine, BlinkingCursor, now } from './opsTerminal'
|
|
5
|
+
import { runTaskOp, runDirectOp } from './opsRunners'
|
|
6
|
+
import type { LogLine } from './opsTerminal'
|
|
7
|
+
|
|
8
|
+
const ops = [
|
|
9
|
+
{ id: 'migrate', name: 'migrate', label: 'Run Migrations',
|
|
10
|
+
desc: 'Apply pending DB schema migrations', icon: Database,
|
|
11
|
+
endpoint: '/admin/ops/migrate', color: '#60A5FA', method: 'post' },
|
|
12
|
+
{ id: 'seed', name: 'seed_extra', label: 'Seed Extra',
|
|
13
|
+
desc: 'Normalize & enrich entity metadata', icon: RefreshCw,
|
|
14
|
+
endpoint: '/admin/ops/seed', color: '#34D399', method: 'post' },
|
|
15
|
+
{ id: 'sync-fp', name: 'sync_fingerprints', label: 'Sync Fingerprints',
|
|
16
|
+
desc: 'Rebuild search fingerprint index', icon: Fingerprint,
|
|
17
|
+
endpoint: '/admin/ops/sync-fingerprints', color: '#FBBF24', method: 'post' },
|
|
18
|
+
{ id: 'sync-crypto', name: 'sync_crypto', label: 'Sync Crypto Wallets',
|
|
19
|
+
desc: 'Sync sanctioned wallet addresses (OFAC + NBCTF)', icon: Wallet,
|
|
20
|
+
endpoint: '/admin/ops/sync-crypto', color: '#A78BFA', method: 'post' },
|
|
21
|
+
{ id: 'test-il', name: 'test_il_sources', label: 'Test IL Sources',
|
|
22
|
+
desc: 'Test connectivity to Israeli gov sanctions sources', icon: Globe,
|
|
23
|
+
endpoint: '/admin/ops/test-fetch', color: '#F472B6', method: 'get' },
|
|
24
|
+
] as const
|
|
25
|
+
|
|
26
|
+
export default function AdminOperations() {
|
|
27
|
+
const [lines, setLines] = useState<LogLine[]>([
|
|
28
|
+
{ ts: now(), text: 'AMLIQ Admin Console v2.0 — ready', type: 'out' },
|
|
29
|
+
])
|
|
30
|
+
const [running, setRunning] = useState<string | null>(null)
|
|
31
|
+
const termRef = useRef<HTMLDivElement>(null)
|
|
32
|
+
|
|
33
|
+
useEffect(() => {
|
|
34
|
+
termRef.current?.scrollTo(0, termRef.current.scrollHeight)
|
|
35
|
+
}, [lines])
|
|
36
|
+
|
|
37
|
+
const addLine = (text: string, type: LogLine['type'] = 'out') =>
|
|
38
|
+
setLines(prev => [...prev, { ts: now(), text, type }])
|
|
39
|
+
|
|
40
|
+
const runOp = async (op: typeof ops[number]) => {
|
|
41
|
+
if (running) return
|
|
42
|
+
setRunning(op.id)
|
|
43
|
+
addLine(`$ amliq ${op.name}`, 'cmd')
|
|
44
|
+
addLine(`Starting ${op.label}...`)
|
|
45
|
+
try {
|
|
46
|
+
if (op.method === 'get') {
|
|
47
|
+
await runDirectOp(op.endpoint, addLine)
|
|
48
|
+
} else {
|
|
49
|
+
await runTaskOp(op.endpoint, op.name, addLine)
|
|
50
|
+
}
|
|
51
|
+
} catch (err) {
|
|
52
|
+
addLine(err instanceof Error ? err.message : 'Request failed', 'err')
|
|
53
|
+
} finally {
|
|
54
|
+
setRunning(null)
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
return (
|
|
59
|
+
<div>
|
|
60
|
+
<PageHeader
|
|
61
|
+
title="Admin Operations"
|
|
62
|
+
description="System maintenance console (admin only)"
|
|
63
|
+
/>
|
|
64
|
+
<div className="flex flex-wrap gap-sm mb-lg">
|
|
65
|
+
{ops.map(op => (
|
|
66
|
+
<OpButton key={op.id} op={op} running={running}
|
|
67
|
+
onClick={() => runOp(op)} />
|
|
68
|
+
))}
|
|
69
|
+
</div>
|
|
70
|
+
<div className="rounded-apple-lg overflow-hidden border border-white/10"
|
|
71
|
+
style={{ background: '#0D1117' }}>
|
|
72
|
+
<TerminalBar />
|
|
73
|
+
<div ref={termRef}
|
|
74
|
+
className="p-md font-mono text-[13px] leading-relaxed overflow-y-auto
|
|
75
|
+
max-h-[60vh] min-h-[300px] scroll-smooth"
|
|
76
|
+
style={{ color: '#C9D1D9' }}>
|
|
77
|
+
{lines.map((line, i) => <TermLine key={i} line={line} />)}
|
|
78
|
+
{running && <BlinkingCursor />}
|
|
79
|
+
</div>
|
|
80
|
+
</div>
|
|
81
|
+
</div>
|
|
82
|
+
)
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
function OpButton({ op, running, onClick }: {
|
|
86
|
+
op: typeof ops[number]; running: string | null; onClick: () => void
|
|
87
|
+
}) {
|
|
88
|
+
const Icon = op.icon
|
|
89
|
+
const active = running === op.id
|
|
90
|
+
return (
|
|
91
|
+
<button onClick={onClick} disabled={running !== null}
|
|
92
|
+
className="flex items-center gap-sm px-lg py-sm rounded-apple-lg
|
|
93
|
+
border border-white/10 hover:border-white/20
|
|
94
|
+
disabled:opacity-40 disabled:cursor-not-allowed
|
|
95
|
+
transition-all cursor-pointer"
|
|
96
|
+
style={{ borderColor: active ? op.color : undefined }}>
|
|
97
|
+
<Icon className="w-4 h-4" style={{ color: op.color }} />
|
|
98
|
+
<span className="text-sm font-medium">{op.label}</span>
|
|
99
|
+
{active && <span className="w-2 h-2 rounded-full animate-pulse"
|
|
100
|
+
style={{ background: op.color }} />}
|
|
101
|
+
</button>
|
|
102
|
+
)
|
|
103
|
+
}
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
import { useState, useEffect } from 'react'
|
|
2
|
+
import { Clock, CheckCircle, XCircle, Loader } from 'lucide-react'
|
|
3
|
+
import { PageHeader } from '../../components/layout/PageHeader'
|
|
4
|
+
import { LoadingSpinner } from '../../components/ui/LoadingSpinner'
|
|
5
|
+
import { Badge } from '../../components/ui/Badge'
|
|
6
|
+
import { api } from '../../api/client'
|
|
7
|
+
|
|
8
|
+
interface TaskEntry {
|
|
9
|
+
id: string
|
|
10
|
+
task_name: string
|
|
11
|
+
tenant_id?: string
|
|
12
|
+
trigger: string
|
|
13
|
+
status: 'running' | 'success' | 'failed' | 'canceled'
|
|
14
|
+
started_at: string
|
|
15
|
+
ended_at?: string
|
|
16
|
+
duration_ms: number
|
|
17
|
+
output?: string
|
|
18
|
+
error?: string
|
|
19
|
+
actor_id?: string
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export default function ScheduledTasks() {
|
|
23
|
+
const [tasks, setTasks] = useState<TaskEntry[]>([])
|
|
24
|
+
const [loading, setLoading] = useState(true)
|
|
25
|
+
|
|
26
|
+
const fetchTasks = () => {
|
|
27
|
+
api.get<{ tasks: TaskEntry[] }>('/admin/tasks?limit=100')
|
|
28
|
+
.then(d => setTasks(d?.tasks ?? []))
|
|
29
|
+
.catch(() => setTasks([]))
|
|
30
|
+
.finally(() => setLoading(false))
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
useEffect(() => {
|
|
34
|
+
fetchTasks()
|
|
35
|
+
const iv = setInterval(fetchTasks, 10_000)
|
|
36
|
+
return () => clearInterval(iv)
|
|
37
|
+
}, [])
|
|
38
|
+
|
|
39
|
+
if (loading) {
|
|
40
|
+
return (
|
|
41
|
+
<div className="flex items-center justify-center h-96">
|
|
42
|
+
<LoadingSpinner />
|
|
43
|
+
</div>
|
|
44
|
+
)
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
return (
|
|
48
|
+
<div>
|
|
49
|
+
<PageHeader
|
|
50
|
+
title="Scheduled Tasks"
|
|
51
|
+
description={`${tasks.length} task executions`}
|
|
52
|
+
/>
|
|
53
|
+
|
|
54
|
+
{/* Desktop table */}
|
|
55
|
+
<div className="hidden md:block glass-panel rounded-apple-lg overflow-hidden">
|
|
56
|
+
<table className="w-full text-sm">
|
|
57
|
+
<thead>
|
|
58
|
+
<tr className="text-left text-apple-label-secondary border-b border-white/10">
|
|
59
|
+
<th className="px-lg py-md">Task</th>
|
|
60
|
+
<th className="px-lg py-md">Trigger</th>
|
|
61
|
+
<th className="px-lg py-md">Status</th>
|
|
62
|
+
<th className="px-lg py-md">Duration</th>
|
|
63
|
+
<th className="px-lg py-md">Started</th>
|
|
64
|
+
<th className="px-lg py-md">Output</th>
|
|
65
|
+
</tr>
|
|
66
|
+
</thead>
|
|
67
|
+
<tbody>
|
|
68
|
+
{tasks.map(t => (
|
|
69
|
+
<TaskRow key={t.id} task={t} />
|
|
70
|
+
))}
|
|
71
|
+
</tbody>
|
|
72
|
+
</table>
|
|
73
|
+
</div>
|
|
74
|
+
|
|
75
|
+
{/* Mobile cards */}
|
|
76
|
+
<div className="md:hidden space-y-sm">
|
|
77
|
+
{tasks.map(t => (
|
|
78
|
+
<TaskCard key={t.id} task={t} />
|
|
79
|
+
))}
|
|
80
|
+
</div>
|
|
81
|
+
|
|
82
|
+
{tasks.length === 0 && (
|
|
83
|
+
<p className="text-center py-xl text-apple-label-tertiary sf-body">
|
|
84
|
+
No task executions yet
|
|
85
|
+
</p>
|
|
86
|
+
)}
|
|
87
|
+
</div>
|
|
88
|
+
)
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
function TaskRow({ task }: { task: TaskEntry }) {
|
|
92
|
+
return (
|
|
93
|
+
<tr className="border-b border-white/5 hover:bg-white/5">
|
|
94
|
+
<td className="px-lg py-md font-medium">{task.task_name}</td>
|
|
95
|
+
<td className="px-lg py-md">
|
|
96
|
+
<Badge size="sm" color={task.trigger === 'manual' ? 'blue' : 'gray'}>
|
|
97
|
+
{task.trigger}
|
|
98
|
+
</Badge>
|
|
99
|
+
</td>
|
|
100
|
+
<td className="px-lg py-md"><StatusBadge status={task.status} /></td>
|
|
101
|
+
<td className="px-lg py-md">{formatDuration(task.duration_ms)}</td>
|
|
102
|
+
<td className="px-lg py-md text-apple-label-secondary text-xs">
|
|
103
|
+
{new Date(task.started_at).toLocaleString()}
|
|
104
|
+
</td>
|
|
105
|
+
<td className="px-lg py-md text-xs max-w-[200px] truncate">
|
|
106
|
+
{task.error || task.output || '—'}
|
|
107
|
+
</td>
|
|
108
|
+
</tr>
|
|
109
|
+
)
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
function TaskCard({ task }: { task: TaskEntry }) {
|
|
113
|
+
return (
|
|
114
|
+
<div className="glass-panel rounded-apple-lg p-lg">
|
|
115
|
+
<div className="flex items-center justify-between mb-sm">
|
|
116
|
+
<span className="font-medium text-sm">{task.task_name}</span>
|
|
117
|
+
<StatusBadge status={task.status} />
|
|
118
|
+
</div>
|
|
119
|
+
<div className="flex items-center gap-sm mb-xs">
|
|
120
|
+
<Badge size="sm" color={task.trigger === 'manual' ? 'blue' : 'gray'}>
|
|
121
|
+
{task.trigger}
|
|
122
|
+
</Badge>
|
|
123
|
+
<span className="sf-caption text-apple-label-secondary">
|
|
124
|
+
{formatDuration(task.duration_ms)}
|
|
125
|
+
</span>
|
|
126
|
+
</div>
|
|
127
|
+
{(task.output || task.error) && (
|
|
128
|
+
<p className="sf-caption text-apple-label-tertiary mt-xs truncate">
|
|
129
|
+
{task.error || task.output}
|
|
130
|
+
</p>
|
|
131
|
+
)}
|
|
132
|
+
</div>
|
|
133
|
+
)
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
function StatusBadge({ status }: { status: TaskEntry['status'] }) {
|
|
137
|
+
const map = {
|
|
138
|
+
running: { color: 'blue' as const, Icon: Loader },
|
|
139
|
+
success: { color: 'green' as const, Icon: CheckCircle },
|
|
140
|
+
failed: { color: 'red' as const, Icon: XCircle },
|
|
141
|
+
canceled: { color: 'gray' as const, Icon: Clock },
|
|
142
|
+
}
|
|
143
|
+
const { color, Icon } = map[status] ?? map.canceled
|
|
144
|
+
return (
|
|
145
|
+
<Badge size="sm" color={color}>
|
|
146
|
+
<Icon className="w-3 h-3 mr-1 inline" />{status}
|
|
147
|
+
</Badge>
|
|
148
|
+
)
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
function formatDuration(ms: number): string {
|
|
152
|
+
if (!ms) return '—'
|
|
153
|
+
if (ms < 1000) return `${ms}ms`
|
|
154
|
+
return `${(ms / 1000).toFixed(1)}s`
|
|
155
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { useEffect, useState } from 'react'
|
|
2
|
+
import { useTranslation } from 'react-i18next'
|
|
3
|
+
import { PageHeader } from '../../components/layout/PageHeader'
|
|
4
|
+
|
|
5
|
+
interface HealthData { status: string; version: string; time: string }
|
|
6
|
+
interface ReadyData { ready: boolean; database: string }
|
|
7
|
+
|
|
8
|
+
const API_BASE = import.meta.env.VITE_API_URL || 'http://localhost:8080'
|
|
9
|
+
|
|
10
|
+
export function SystemHealth() {
|
|
11
|
+
const { t } = useTranslation('admin')
|
|
12
|
+
const [health, setHealth] = useState<HealthData | null>(null)
|
|
13
|
+
const [ready, setReady] = useState<ReadyData | null>(null)
|
|
14
|
+
const [error, setError] = useState('')
|
|
15
|
+
|
|
16
|
+
useEffect(() => {
|
|
17
|
+
Promise.all([
|
|
18
|
+
fetch(`${API_BASE}/health`).then(r => r.json()),
|
|
19
|
+
fetch(`${API_BASE}/ready`).then(r => r.json()),
|
|
20
|
+
])
|
|
21
|
+
.then(([h, r]) => {
|
|
22
|
+
setHealth(h.data ?? h ?? null)
|
|
23
|
+
setReady(r.data ?? r ?? null)
|
|
24
|
+
})
|
|
25
|
+
.catch(() => setError(t('health.fetch_error')))
|
|
26
|
+
}, [])
|
|
27
|
+
|
|
28
|
+
if (error) return <p className="p-xl text-apple-red sf-body">{error}</p>
|
|
29
|
+
|
|
30
|
+
return (
|
|
31
|
+
<div>
|
|
32
|
+
<PageHeader title={t('health.title')} />
|
|
33
|
+
<div className="grid grid-cols-1 md:grid-cols-3 gap-lg">
|
|
34
|
+
<StatusCard title={t('health.api_status')}
|
|
35
|
+
value={health?.status ?? 'loading'} ok={health?.status === 'healthy'} />
|
|
36
|
+
<StatusCard title={t('health.database')}
|
|
37
|
+
value={ready?.database ?? 'loading'} ok={ready?.database === 'connected'} />
|
|
38
|
+
<StatusCard title={t('health.version')}
|
|
39
|
+
value={health?.version ?? '-'} ok={true} />
|
|
40
|
+
</div>
|
|
41
|
+
</div>
|
|
42
|
+
)
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function StatusCard({ title, value, ok }: {
|
|
46
|
+
title: string; value: string; ok: boolean
|
|
47
|
+
}) {
|
|
48
|
+
const color = ok ? 'text-apple-green' : 'text-apple-red'
|
|
49
|
+
const bg = ok ? 'bg-apple-green/10' : 'bg-apple-red/10'
|
|
50
|
+
return (
|
|
51
|
+
<div className={`card-vibrancy p-xl ${bg}`}>
|
|
52
|
+
<p className="sf-caption mb-xs">{title}</p>
|
|
53
|
+
<p className={`sf-headline text-xl ${color}`}>{value}</p>
|
|
54
|
+
</div>
|
|
55
|
+
)
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export default SystemHealth
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { useEffect, useState } from 'react'
|
|
2
|
+
import { useTranslation } from 'react-i18next'
|
|
3
|
+
import { useParams } from 'react-router-dom'
|
|
4
|
+
import { PageHeader } from '../../components/layout/PageHeader'
|
|
5
|
+
import { ScreeningSection, ConfigSection } from '../../components/admin/TenantCards'
|
|
6
|
+
import { api } from '../../api/client'
|
|
7
|
+
|
|
8
|
+
interface TenantInfo {
|
|
9
|
+
tenant: { ID: string; Name: string; DisplayName: string }
|
|
10
|
+
screening_count: number
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export function TenantDetail() {
|
|
14
|
+
const { t } = useTranslation('admin')
|
|
15
|
+
const { id } = useParams<{ id: string }>()
|
|
16
|
+
const [data, setData] = useState<TenantInfo | null>(null)
|
|
17
|
+
const [threshold, setThreshold] = useState('75')
|
|
18
|
+
|
|
19
|
+
useEffect(() => {
|
|
20
|
+
api.get<TenantInfo>(`/admin/tenants/${id}`)
|
|
21
|
+
.then(d => setData(d))
|
|
22
|
+
.catch(() => setData(null))
|
|
23
|
+
}, [id])
|
|
24
|
+
|
|
25
|
+
const saveConfig = () => {
|
|
26
|
+
api.put(`/admin/tenants/${id}/config`, {
|
|
27
|
+
match_threshold: parseFloat(threshold) / 100,
|
|
28
|
+
})
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
if (!data) {
|
|
32
|
+
return (
|
|
33
|
+
<p className="sf-body p-xl" role="status" aria-live="polite">
|
|
34
|
+
{t('tenant_detail.loading')}
|
|
35
|
+
</p>
|
|
36
|
+
)
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
return (
|
|
40
|
+
<div>
|
|
41
|
+
<PageHeader
|
|
42
|
+
title={data.tenant.DisplayName}
|
|
43
|
+
description={data.tenant.ID}
|
|
44
|
+
/>
|
|
45
|
+
<div className="grid grid-cols-1 md:grid-cols-2 gap-lg">
|
|
46
|
+
<ScreeningSection
|
|
47
|
+
label={t('tenant_detail.screening_history')}
|
|
48
|
+
count={data.screening_count}
|
|
49
|
+
t={t}
|
|
50
|
+
/>
|
|
51
|
+
<ConfigSection
|
|
52
|
+
threshold={threshold}
|
|
53
|
+
setThreshold={setThreshold}
|
|
54
|
+
onSave={saveConfig}
|
|
55
|
+
t={t}
|
|
56
|
+
/>
|
|
57
|
+
</div>
|
|
58
|
+
</div>
|
|
59
|
+
)
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export default TenantDetail
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest'
|
|
2
|
+
|
|
3
|
+
describe('AdminTenants', () => {
|
|
4
|
+
it('should have the correct page title', () => {
|
|
5
|
+
expect(true).toBe(true)
|
|
6
|
+
})
|
|
7
|
+
|
|
8
|
+
it('should filter tenants by search', () => {
|
|
9
|
+
const tenants = [
|
|
10
|
+
{ id: '1', name: 'acme', display_name: 'Acme Corp' },
|
|
11
|
+
{ id: '2', name: 'beta', display_name: 'Beta Inc' },
|
|
12
|
+
]
|
|
13
|
+
const search = 'acme'
|
|
14
|
+
const filtered = tenants.filter(
|
|
15
|
+
t => t.name.includes(search) || t.display_name.toLowerCase().includes(search)
|
|
16
|
+
)
|
|
17
|
+
expect(filtered).toHaveLength(1)
|
|
18
|
+
expect(filtered[0].name).toBe('acme')
|
|
19
|
+
})
|
|
20
|
+
})
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { useEffect, useState } from 'react'
|
|
2
|
+
import { useTranslation } from 'react-i18next'
|
|
3
|
+
import { useNavigate } from 'react-router-dom'
|
|
4
|
+
import { PageHeader } from '../../components/layout/PageHeader'
|
|
5
|
+
import { SearchField } from '../../components/ui/SearchField'
|
|
6
|
+
import { api } from '../../api/client'
|
|
7
|
+
|
|
8
|
+
interface TenantSummary {
|
|
9
|
+
id: string
|
|
10
|
+
name: string
|
|
11
|
+
display_name: string
|
|
12
|
+
created_at: string
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export function AdminTenants() {
|
|
16
|
+
const { t } = useTranslation('admin')
|
|
17
|
+
const [tenants, setTenants] = useState<TenantSummary[]>([])
|
|
18
|
+
const [search, setSearch] = useState('')
|
|
19
|
+
const navigate = useNavigate()
|
|
20
|
+
|
|
21
|
+
useEffect(() => {
|
|
22
|
+
api.get<{ tenants: TenantSummary[] }>('/admin/tenants')
|
|
23
|
+
.then(d => setTenants(d?.tenants ?? []))
|
|
24
|
+
.catch(() => setTenants([]))
|
|
25
|
+
}, [])
|
|
26
|
+
|
|
27
|
+
const q = search.toLowerCase()
|
|
28
|
+
const filtered = tenants.filter(
|
|
29
|
+
t => (t.name ?? '').toLowerCase().includes(q)
|
|
30
|
+
|| (t.display_name ?? '').toLowerCase().includes(q)
|
|
31
|
+
)
|
|
32
|
+
|
|
33
|
+
return (
|
|
34
|
+
<div>
|
|
35
|
+
<PageHeader title={t('tenants.title')} />
|
|
36
|
+
<div className="mb-lg">
|
|
37
|
+
<SearchField
|
|
38
|
+
placeholder={t('tenants.search_placeholder')}
|
|
39
|
+
value={search}
|
|
40
|
+
onChange={setSearch}
|
|
41
|
+
/>
|
|
42
|
+
</div>
|
|
43
|
+
<div className="card-vibrancy divide-y divide-white/10">
|
|
44
|
+
{filtered.map(t => (
|
|
45
|
+
<button key={t.id}
|
|
46
|
+
onClick={() => navigate(`/admin/tenants/${t.id}`)}
|
|
47
|
+
className="w-full text-left px-lg py-md flex items-center
|
|
48
|
+
justify-between hover:bg-white/5 transition-colors cursor-pointer">
|
|
49
|
+
<span className="sf-headline">{t.display_name || t.name}</span>
|
|
50
|
+
<span className="sf-caption">{t.id}</span>
|
|
51
|
+
</button>
|
|
52
|
+
))}
|
|
53
|
+
{filtered.length === 0 && (
|
|
54
|
+
<p className="sf-caption text-center py-xl">
|
|
55
|
+
{t('tenants.search_placeholder')}
|
|
56
|
+
</p>
|
|
57
|
+
)}
|
|
58
|
+
</div>
|
|
59
|
+
</div>
|
|
60
|
+
)
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export default AdminTenants
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { api } from '../../api/client'
|
|
2
|
+
import type { LogLine } from './opsTerminal'
|
|
3
|
+
|
|
4
|
+
type AddLine = (text: string, type?: LogLine['type']) => void
|
|
5
|
+
|
|
6
|
+
interface TaskEntry {
|
|
7
|
+
id: string
|
|
8
|
+
task_name: string
|
|
9
|
+
status: 'running' | 'success' | 'failed'
|
|
10
|
+
started_at: string
|
|
11
|
+
ended_at?: string
|
|
12
|
+
duration_ms: number
|
|
13
|
+
output?: string
|
|
14
|
+
error?: string
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
interface OpResult { task_id: string; message: string }
|
|
18
|
+
|
|
19
|
+
interface FetchTestResult {
|
|
20
|
+
name: string; url: string; status: string
|
|
21
|
+
bytes: number; elapsed: string; error?: string
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export async function runTaskOp(endpoint: string, name: string, addLine: AddLine) {
|
|
25
|
+
const res = await api.post<OpResult>(endpoint, {})
|
|
26
|
+
addLine(`Task queued: ${res?.task_id ?? 'unknown'}`)
|
|
27
|
+
addLine('Polling for result...')
|
|
28
|
+
await pollTask(res?.task_id ?? '', name, addLine)
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export async function runDirectOp(endpoint: string, addLine: AddLine) {
|
|
32
|
+
const data = await api.get<{ results: FetchTestResult[]; total: number }>(endpoint)
|
|
33
|
+
if (!data?.results) {
|
|
34
|
+
addLine('No results returned', 'err')
|
|
35
|
+
return
|
|
36
|
+
}
|
|
37
|
+
addLine(`Testing ${data.total} Israeli gov sources...`)
|
|
38
|
+
addLine('')
|
|
39
|
+
for (const r of data.results) {
|
|
40
|
+
if (r.status === 'OK') {
|
|
41
|
+
addLine(`OK ${r.name}: ${r.bytes} bytes (${r.elapsed})`, 'ok')
|
|
42
|
+
} else {
|
|
43
|
+
addLine(`FAIL ${r.name}: ${r.error ?? 'unknown'} (${r.elapsed})`, 'err')
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
addLine('')
|
|
47
|
+
const ok = data.results.filter(r => r.status === 'OK').length
|
|
48
|
+
const fail = data.results.length - ok
|
|
49
|
+
if (fail === 0) {
|
|
50
|
+
addLine(`All ${ok} sources reachable`, 'ok')
|
|
51
|
+
} else {
|
|
52
|
+
addLine(`${ok} OK, ${fail} FAILED out of ${data.results.length}`, 'err')
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
async function pollTask(taskId: string, taskName: string, addLine: AddLine) {
|
|
57
|
+
for (let i = 0; i < 30; i++) {
|
|
58
|
+
await new Promise(r => setTimeout(r, 2000))
|
|
59
|
+
try {
|
|
60
|
+
const data = await api.get<{ tasks: TaskEntry[] }>('/admin/tasks?limit=20')
|
|
61
|
+
const task = (data?.tasks ?? []).find(t => t.id === taskId)
|
|
62
|
+
if (!task) { addLine(`Waiting for ${taskName}...`); continue }
|
|
63
|
+
if (task.status === 'running') {
|
|
64
|
+
addLine(`[${taskName}] still running... (${(i + 1) * 2}s)`)
|
|
65
|
+
continue
|
|
66
|
+
}
|
|
67
|
+
if (task.status === 'success') {
|
|
68
|
+
if (task.output) addLine(task.output)
|
|
69
|
+
addLine(`[${taskName}] completed in ${task.duration_ms}ms`, 'ok')
|
|
70
|
+
return
|
|
71
|
+
}
|
|
72
|
+
if (task.status === 'failed') {
|
|
73
|
+
addLine(`[${taskName}] FAILED: ${task.error || 'unknown'}`, 'err')
|
|
74
|
+
return
|
|
75
|
+
}
|
|
76
|
+
} catch {
|
|
77
|
+
addLine('Poll error, retrying...', 'err')
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
addLine(`[${taskName}] timed out after 60s`, 'err')
|
|
81
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { ChevronRight, Terminal } from 'lucide-react'
|
|
2
|
+
|
|
3
|
+
export type LogLine = {
|
|
4
|
+
ts: string
|
|
5
|
+
text: string
|
|
6
|
+
type: 'cmd' | 'out' | 'err' | 'ok'
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export function TerminalBar() {
|
|
10
|
+
return (
|
|
11
|
+
<div className="flex items-center gap-sm px-md py-sm border-b border-white/10"
|
|
12
|
+
style={{ background: '#161B22' }}>
|
|
13
|
+
<div className="flex gap-[6px]">
|
|
14
|
+
<span className="w-3 h-3 rounded-full bg-[#FF5F56]" />
|
|
15
|
+
<span className="w-3 h-3 rounded-full bg-[#FFBD2E]" />
|
|
16
|
+
<span className="w-3 h-3 rounded-full bg-[#27C93F]" />
|
|
17
|
+
</div>
|
|
18
|
+
<div className="flex items-center gap-xs ml-md">
|
|
19
|
+
<Terminal className="w-3.5 h-3.5 text-white/40" />
|
|
20
|
+
<span className="text-xs text-white/40 font-mono">amliq-admin</span>
|
|
21
|
+
</div>
|
|
22
|
+
</div>
|
|
23
|
+
)
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export function TermLine({ line }: { line: LogLine }) {
|
|
27
|
+
const colors: Record<LogLine['type'], string> = {
|
|
28
|
+
cmd: '#58A6FF', out: '#C9D1D9', err: '#F85149', ok: '#3FB950',
|
|
29
|
+
}
|
|
30
|
+
return (
|
|
31
|
+
<div className="flex gap-sm items-start">
|
|
32
|
+
<span className="text-white/20 text-[11px] shrink-0 select-none w-[52px] text-right">
|
|
33
|
+
{line.ts}
|
|
34
|
+
</span>
|
|
35
|
+
{line.type === 'cmd' && (
|
|
36
|
+
<ChevronRight className="w-3.5 h-3.5 shrink-0 mt-[2px]"
|
|
37
|
+
style={{ color: '#3FB950' }} />
|
|
38
|
+
)}
|
|
39
|
+
<span style={{ color: colors[line.type] }}
|
|
40
|
+
className={line.type === 'cmd' ? 'font-semibold' : ''}>
|
|
41
|
+
{line.text}
|
|
42
|
+
</span>
|
|
43
|
+
</div>
|
|
44
|
+
)
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export function BlinkingCursor() {
|
|
48
|
+
return (
|
|
49
|
+
<div className="flex gap-sm items-center mt-xs">
|
|
50
|
+
<span className="text-white/20 text-[11px] w-[52px] text-right select-none">
|
|
51
|
+
{now()}
|
|
52
|
+
</span>
|
|
53
|
+
<ChevronRight className="w-3.5 h-3.5 text-[#3FB950]" />
|
|
54
|
+
<span className="w-2 h-4 bg-[#58A6FF] animate-pulse rounded-sm" />
|
|
55
|
+
</div>
|
|
56
|
+
)
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export function now() {
|
|
60
|
+
return new Date().toLocaleTimeString('en-US', {
|
|
61
|
+
hour12: false, hour: '2-digit', minute: '2-digit', second: '2-digit',
|
|
62
|
+
})
|
|
63
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import React, { useState, useEffect } from 'react'
|
|
2
|
+
import { useTranslation } from 'react-i18next'
|
|
3
|
+
import { getSubscriptions } from '../../api/billing'
|
|
4
|
+
import { SubscriptionCard } from './SubscriptionCard'
|
|
5
|
+
import { Subscription } from '../../types/billing'
|
|
6
|
+
|
|
7
|
+
export function ActiveSubscriptions() {
|
|
8
|
+
const { t } = useTranslation('billing')
|
|
9
|
+
const [subscriptions, setSubscriptions] = useState<Subscription[]>([])
|
|
10
|
+
const [loading, setLoading] = useState(true)
|
|
11
|
+
|
|
12
|
+
useEffect(() => {
|
|
13
|
+
getSubscriptions()
|
|
14
|
+
.then(subs => setSubscriptions(Array.isArray(subs) ? subs : []))
|
|
15
|
+
.catch(() => setSubscriptions([]))
|
|
16
|
+
.finally(() => setLoading(false))
|
|
17
|
+
}, [])
|
|
18
|
+
|
|
19
|
+
if (loading) {
|
|
20
|
+
return <div className="sf-body text-apple-label-secondary">{t('subscriptions.loading')}</div>
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
if (subscriptions.length === 0) {
|
|
24
|
+
return (
|
|
25
|
+
<div className="text-center py-lg rounded-apple-lg border border-white/10 bg-white/5">
|
|
26
|
+
<p className="sf-body text-apple-label-secondary mb-md">{t('subscriptions.no_subscriptions')}</p>
|
|
27
|
+
<button className="px-lg py-sm bg-apple-blue hover:bg-apple-blue/80 text-white rounded-apple-md sf-body transition-colors cursor-pointer">
|
|
28
|
+
{t('add_product')}
|
|
29
|
+
</button>
|
|
30
|
+
</div>
|
|
31
|
+
)
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
return (
|
|
35
|
+
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-lg">
|
|
36
|
+
{subscriptions.map(sub => (
|
|
37
|
+
<SubscriptionCard key={sub.id} subscription={sub} />
|
|
38
|
+
))}
|
|
39
|
+
</div>
|
|
40
|
+
)
|
|
41
|
+
}
|