@syngrisi/syngrisi 2.2.1
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/.nvmrc +1 -0
- package/LICENSE.md +9 -0
- package/README.md +139 -0
- package/config.js +17 -0
- package/dist/config.js +16 -0
- package/dist/src/server/models/index.js +508 -0
- package/dist/src/server/models/plugins/index.js +4 -0
- package/dist/src/server/models/plugins/paginate.plugin.js +76 -0
- package/dist/src/server/models/plugins/paginateDistinct.plugin.js +76 -0
- package/dist/src/server/models/plugins/toJSON.plugin.js +39 -0
- package/dist/src/server/schemas/createCheck.shema.js +17 -0
- package/dist/src/server/schemas/getBaseline.shema.js +12 -0
- package/dist/src/server/utils/paramsGuard.js +18 -0
- package/dist/src/tasks/backup.js +68 -0
- package/dist/src/tasks/lib/common.js +14 -0
- package/dist/src/tasks/lib/utils.js +14 -0
- package/dist/src/tasks/migrations/2.0.migration.js +86 -0
- package/dist/src/tasks/migrations/2.0.migration_mql.js +57 -0
- package/dist/src/tasks/reindex.js +28 -0
- package/dist/src/tasks/restore.js +86 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/docker-compose.yml +70 -0
- package/mvc/views/react/admin/index.html +22 -0
- package/mvc/views/react/assets/LogicalGroup.95929360.js +15993 -0
- package/mvc/views/react/assets/PasswordInput.8a73fdd2.js +299 -0
- package/mvc/views/react/assets/admin.94703bdc.js +14448 -0
- package/mvc/views/react/assets/auth.748478ef.js +673 -0
- package/mvc/views/react/assets/bg_2_0_dark_L2.3a31edc0.png +0 -0
- package/mvc/views/react/assets/favicon.bf5828d5.svg +7 -0
- package/mvc/views/react/assets/index.a5606313.css +23 -0
- package/mvc/views/react/assets/roboto-v30-latin-100.0f303f31.woff2 +0 -0
- package/mvc/views/react/assets/roboto-v30-latin-100.34e9582c.woff +0 -0
- package/mvc/views/react/assets/roboto-v30-latin-500.9ce7f3ac.woff +0 -0
- package/mvc/views/react/assets/roboto-v30-latin-500.b0195382.woff2 +0 -0
- package/mvc/views/react/assets/roboto-v30-latin-700.e0fd57c0.woff +0 -0
- package/mvc/views/react/assets/roboto-v30-latin-700.f5aebdfe.woff2 +0 -0
- package/mvc/views/react/assets/roboto-v30-latin-regular.f2abf7fb.woff +0 -0
- package/mvc/views/react/assets/roboto-v30-latin-regular.f6734f81.woff2 +0 -0
- package/mvc/views/react/assets/root.136e0ea3.js +25451 -0
- package/mvc/views/react/assets/use-form.57ebe175.js +24472 -0
- package/mvc/views/react/assets/use-form.ecb4391b.css +36 -0
- package/mvc/views/react/auth/index.html +22 -0
- package/mvc/views/react/index.html +19 -0
- package/mvc/views/react/index2/index.html +21 -0
- package/package.json +144 -0
- package/server.js +166 -0
- package/src/server/controllers/app.controller.js +21 -0
- package/src/server/controllers/auth.controller.js +156 -0
- package/src/server/controllers/baseline.controller.js +24 -0
- package/src/server/controllers/check.controller.js +56 -0
- package/src/server/controllers/client.controller.js +173 -0
- package/src/server/controllers/index.js +12 -0
- package/src/server/controllers/logs.controller.js +30 -0
- package/src/server/controllers/runs.controller.js +25 -0
- package/src/server/controllers/settings.controller.js +23 -0
- package/src/server/controllers/snapshots.controller.js +17 -0
- package/src/server/controllers/suite.controller.js +24 -0
- package/src/server/controllers/tasks.controller.js +47 -0
- package/src/server/controllers/test.controller.js +70 -0
- package/src/server/controllers/users.controller.js +79 -0
- package/src/server/data/custom_devices.json +8 -0
- package/src/server/data/devices.json +773 -0
- package/src/server/data/get_devices.sh +2 -0
- package/src/server/lib/AppSettings.js +56 -0
- package/src/server/lib/admin.json +9 -0
- package/src/server/lib/comparator.js +147 -0
- package/src/server/lib/compareImagesNode.js +60 -0
- package/src/server/lib/dbItems.js +215 -0
- package/src/server/lib/ensureLogin/ensureLoggedIn.js +223 -0
- package/src/server/lib/ensureLogin/ensureLoggedOut.js +44 -0
- package/src/server/lib/getElementsByPixPositionsFromDump.js +72 -0
- package/src/server/lib/guest.json +9 -0
- package/src/server/lib/initialAppSettings.json +18 -0
- package/src/server/lib/logger.js +95 -0
- package/src/server/lib/onStart.js +53 -0
- package/src/server/lib/parseDiff.js.bak +72 -0
- package/src/server/lib/testAdmin.json +9 -0
- package/src/server/lib/testUsers.json +41 -0
- package/src/server/middlewares/authorization.js +50 -0
- package/src/server/middlewares/disableCors.js +19 -0
- package/src/server/models/index.js +534 -0
- package/src/server/models/plugins/index.js +3 -0
- package/src/server/models/plugins/paginate.plugin.js +83 -0
- package/src/server/models/plugins/paginateDistinct.plugin.js +80 -0
- package/src/server/models/plugins/toJSON.plugin.js +44 -0
- package/src/server/routes/ui/admin.js +20 -0
- package/src/server/routes/ui/auth.js +15 -0
- package/src/server/routes/ui/index.js +19 -0
- package/src/server/routes/v1/app.route.js +9 -0
- package/src/server/routes/v1/auth.route.js +12 -0
- package/src/server/routes/v1/baselines.route.js +14 -0
- package/src/server/routes/v1/checks.route.js +25 -0
- package/src/server/routes/v1/client.route.js +39 -0
- package/src/server/routes/v1/index.js +82 -0
- package/src/server/routes/v1/logs.route.js +16 -0
- package/src/server/routes/v1/runs.route.js +15 -0
- package/src/server/routes/v1/settings.route.js +23 -0
- package/src/server/routes/v1/snapshots.route.js +11 -0
- package/src/server/routes/v1/suites.route.js +15 -0
- package/src/server/routes/v1/tasks.route.js +59 -0
- package/src/server/routes/v1/test.route.js +20 -0
- package/src/server/routes/v1/test_distinct.route.js +14 -0
- package/src/server/routes/v1/users.route.js +36 -0
- package/src/server/schemas/createCheck.shema.ts +17 -0
- package/src/server/schemas/getBaseline.shema.ts +12 -0
- package/src/server/services/app.service.js +23 -0
- package/src/server/services/check.service.js +178 -0
- package/src/server/services/client.service.js +648 -0
- package/src/server/services/generic.service.js +51 -0
- package/src/server/services/index.js +12 -0
- package/src/server/services/logs.service.js +38 -0
- package/src/server/services/run.service.js +40 -0
- package/src/server/services/suite.service.js +39 -0
- package/src/server/services/tasks.service.js +536 -0
- package/src/server/services/test.service.js +72 -0
- package/src/server/services/user.service.js +128 -0
- package/src/server/utils/ApiError.js +14 -0
- package/src/server/utils/catchAsync.js +8 -0
- package/src/server/utils/check.js +58 -0
- package/src/server/utils/dateToISO8601.js +2 -0
- package/src/server/utils/deserializeIfJSON.js +9 -0
- package/src/server/utils/formatISOToDateTime.js +6 -0
- package/src/server/utils/index.js +10 -0
- package/src/server/utils/isJSON.js +6 -0
- package/src/server/utils/paramsGuard.ts +15 -0
- package/src/server/utils/pick.js +15 -0
- package/src/server/utils/prettyCheckParams.js +13 -0
- package/src/server/utils/snapshots.js +73 -0
- package/src/server/utils/subDays.js +7 -0
- package/src/server/utils/tests.js +36 -0
- package/src/server/utils/utils.js +146 -0
- package/src/tasks/backup.js.bak +84 -0
- package/src/tasks/backup.ts +53 -0
- package/src/tasks/lib/common.js +24 -0
- package/src/tasks/lib/utils.js +15 -0
- package/src/tasks/migrations/2.0.migration.js +86 -0
- package/src/tasks/migrations/2.0.migration.ts +95 -0
- package/src/tasks/migrations/2.0.migration_mql.js +63 -0
- package/src/tasks/reindex.js +36 -0
- package/src/tasks/restore.js.bak +100 -0
- package/src/tasks/restore.ts +75 -0
- package/src/ui-app/.eslintrc.json +119 -0
- package/src/ui-app/README.md +15 -0
- package/src/ui-app/admin/AdminLayout.tsx +38 -0
- package/src/ui-app/admin/App.tsx +108 -0
- package/src/ui-app/admin/AppContext.ts +3 -0
- package/src/ui-app/admin/components/Header/AdminHeader.tsx +148 -0
- package/src/ui-app/admin/components/Logs/AdminLogs.tsx +142 -0
- package/src/ui-app/admin/components/Logs/RefreshActionIcon.tsx +60 -0
- package/src/ui-app/admin/components/Logs/Table/AdminLogsTable.tsx +81 -0
- package/src/ui-app/admin/components/Logs/Table/AdminLogsTableFilter.tsx +170 -0
- package/src/ui-app/admin/components/Logs/Table/AdminLogsTableHeads.tsx +50 -0
- package/src/ui-app/admin/components/Logs/Table/AdminLogsTableRows.tsx +207 -0
- package/src/ui-app/admin/components/Logs/Table/AdminLogsTableSettings.tsx +95 -0
- package/src/ui-app/admin/components/Logs/Table/InfinityScrollSkeleton.tsx +77 -0
- package/src/ui-app/admin/components/Logs/Table/InfinityScrollSkeletonFIller.tsx +57 -0
- package/src/ui-app/admin/components/Logs/Table/PagesCountAffix.tsx +61 -0
- package/src/ui-app/admin/components/Logs/Table/adminLogsCreateStyle.tsx +36 -0
- package/src/ui-app/admin/components/Logs/Table/adminLogsTableColumns.ts +52 -0
- package/src/ui-app/admin/components/Logs/UnfoldActionIcon.tsx +39 -0
- package/src/ui-app/admin/components/Navbar/AdminNavbar.tsx +50 -0
- package/src/ui-app/admin/components/Navbar/NavbarLinksGroup.tsx +104 -0
- package/src/ui-app/admin/components/Settings/AdminSettings.tsx +51 -0
- package/src/ui-app/admin/components/Settings/Forms/Boolean.tsx +59 -0
- package/src/ui-app/admin/components/Settings/Forms/FormWrapper.tsx +45 -0
- package/src/ui-app/admin/components/Settings/Forms/index.tsx +5 -0
- package/src/ui-app/admin/components/Settings/Forms/interfaces.tsx +17 -0
- package/src/ui-app/admin/components/Tasks/Task.tsx +138 -0
- package/src/ui-app/admin/components/Tasks/TaskWrapper.tsx +11 -0
- package/src/ui-app/admin/components/Tasks/tasksList.ts +59 -0
- package/src/ui-app/admin/components/Users/AdminUsers.tsx +182 -0
- package/src/ui-app/admin/components/Users/UserAddForm.tsx +137 -0
- package/src/ui-app/admin/components/Users/UserForm.tsx +196 -0
- package/src/ui-app/admin/hooks/useParams.tsx +18 -0
- package/src/ui-app/admin/index.html +17 -0
- package/src/ui-app/admin/main.tsx +24 -0
- package/src/ui-app/asserts/css/auth/index.css +23 -0
- package/src/ui-app/asserts/css/styles.css +36 -0
- package/src/ui-app/asserts/fonts/roboto/roboto-v30-latin-100.eot +0 -0
- package/src/ui-app/asserts/fonts/roboto/roboto-v30-latin-100.svg +313 -0
- package/src/ui-app/asserts/fonts/roboto/roboto-v30-latin-100.ttf +0 -0
- package/src/ui-app/asserts/fonts/roboto/roboto-v30-latin-100.woff +0 -0
- package/src/ui-app/asserts/fonts/roboto/roboto-v30-latin-100.woff2 +0 -0
- package/src/ui-app/asserts/fonts/roboto/roboto-v30-latin-500.eot +0 -0
- package/src/ui-app/asserts/fonts/roboto/roboto-v30-latin-500.svg +305 -0
- package/src/ui-app/asserts/fonts/roboto/roboto-v30-latin-500.ttf +0 -0
- package/src/ui-app/asserts/fonts/roboto/roboto-v30-latin-500.woff +0 -0
- package/src/ui-app/asserts/fonts/roboto/roboto-v30-latin-500.woff2 +0 -0
- package/src/ui-app/asserts/fonts/roboto/roboto-v30-latin-700.eot +0 -0
- package/src/ui-app/asserts/fonts/roboto/roboto-v30-latin-700.svg +309 -0
- package/src/ui-app/asserts/fonts/roboto/roboto-v30-latin-700.ttf +0 -0
- package/src/ui-app/asserts/fonts/roboto/roboto-v30-latin-700.woff +0 -0
- package/src/ui-app/asserts/fonts/roboto/roboto-v30-latin-700.woff2 +0 -0
- package/src/ui-app/asserts/fonts/roboto/roboto-v30-latin-regular.eot +0 -0
- package/src/ui-app/asserts/fonts/roboto/roboto-v30-latin-regular.svg +308 -0
- package/src/ui-app/asserts/fonts/roboto/roboto-v30-latin-regular.ttf +0 -0
- package/src/ui-app/asserts/fonts/roboto/roboto-v30-latin-regular.woff +0 -0
- package/src/ui-app/asserts/fonts/roboto/roboto-v30-latin-regular.woff2 +0 -0
- package/src/ui-app/asserts/images/background.jpg +0 -0
- package/src/ui-app/asserts/images/bg_2_0_dark_L2.png +0 -0
- package/src/ui-app/asserts/images/favicon.svg +7 -0
- package/src/ui-app/auth/App.tsx +82 -0
- package/src/ui-app/auth/commonStyles.tsx +26 -0
- package/src/ui-app/auth/components/AuthFooter.tsx +51 -0
- package/src/ui-app/auth/components/AuthLogo.tsx +58 -0
- package/src/ui-app/auth/components/ChangePasswordForm.tsx +216 -0
- package/src/ui-app/auth/components/ChangePasswordSuccessForm.tsx +38 -0
- package/src/ui-app/auth/components/LoginForm.tsx +148 -0
- package/src/ui-app/auth/components/LogoutForm.tsx +89 -0
- package/src/ui-app/auth/components/ToggleThemeButton.tsx +41 -0
- package/src/ui-app/auth/components/change-password/Bars.tsx +45 -0
- package/src/ui-app/auth/components/change-password/PasswordRequirement.tsx +14 -0
- package/src/ui-app/auth/components/change-password/requirements.tsx +6 -0
- package/src/ui-app/auth/index.html +17 -0
- package/src/ui-app/auth/main.tsx +12 -0
- package/src/ui-app/auth/routes.tsx +26 -0
- package/src/ui-app/config.ts +15 -0
- package/src/ui-app/index.html +12 -0
- package/src/ui-app/index2/App.tsx +162 -0
- package/src/ui-app/index2/AppContext.ts +3 -0
- package/src/ui-app/index2/IndexLayout.tsx +34 -0
- package/src/ui-app/index2/components/Header/HeaderIndex.tsx +248 -0
- package/src/ui-app/index2/components/Header/QuickFilter.tsx +312 -0
- package/src/ui-app/index2/components/Navbar/Items/AcceptStatusItem.tsx +42 -0
- package/src/ui-app/index2/components/Navbar/Items/BaseItemWrapper.tsx +94 -0
- package/src/ui-app/index2/components/Navbar/Items/BrowserItem.tsx +42 -0
- package/src/ui-app/index2/components/Navbar/Items/PlatformItem.tsx +42 -0
- package/src/ui-app/index2/components/Navbar/Items/RemoveItemModalAsk.tsx +71 -0
- package/src/ui-app/index2/components/Navbar/Items/RemoveItemPopover.tsx +58 -0
- package/src/ui-app/index2/components/Navbar/Items/RemoveSuiteModalAsk.tsx +61 -0
- package/src/ui-app/index2/components/Navbar/Items/RunItem.tsx +149 -0
- package/src/ui-app/index2/components/Navbar/Items/StatusItem.tsx +42 -0
- package/src/ui-app/index2/components/Navbar/Items/SuiteItem.tsx +109 -0
- package/src/ui-app/index2/components/Navbar/Items/index.tsx +6 -0
- package/src/ui-app/index2/components/Navbar/NavbarFilter.tsx +93 -0
- package/src/ui-app/index2/components/Navbar/NavbarGroupBySelect.tsx +83 -0
- package/src/ui-app/index2/components/Navbar/NavbarIndex.tsx +247 -0
- package/src/ui-app/index2/components/Navbar/NavbarItems.tsx +38 -0
- package/src/ui-app/index2/components/Navbar/NavbarSort.tsx +105 -0
- package/src/ui-app/index2/components/Navbar/Skeletons/RunsDummySkeleton.tsx +27 -0
- package/src/ui-app/index2/components/Navbar/Skeletons/SimpleDummySkeleton.tsx +23 -0
- package/src/ui-app/index2/components/Navbar/Skeletons/SkeletonWrapper.tsx +45 -0
- package/src/ui-app/index2/components/Navbar/Skeletons/SuitesDummySkeleton.tsx +27 -0
- package/src/ui-app/index2/components/Tests/Table/AcceptTestModalAsk.tsx +68 -0
- package/src/ui-app/index2/components/Tests/Table/AcceptTestsButton.tsx +44 -0
- package/src/ui-app/index2/components/Tests/Table/Cells/Branch.tsx +35 -0
- package/src/ui-app/index2/components/Tests/Table/Cells/BrowserName.tsx +33 -0
- package/src/ui-app/index2/components/Tests/Table/Cells/BrowserVersion.tsx +31 -0
- package/src/ui-app/index2/components/Tests/Table/Cells/CellWrapper.tsx +49 -0
- package/src/ui-app/index2/components/Tests/Table/Cells/Os.tsx +32 -0
- package/src/ui-app/index2/components/Tests/Table/Cells/StartDate.tsx +34 -0
- package/src/ui-app/index2/components/Tests/Table/Cells/Status.tsx +50 -0
- package/src/ui-app/index2/components/Tests/Table/Cells/ViewPort.tsx +46 -0
- package/src/ui-app/index2/components/Tests/Table/Checks/AcceptButton.tsx +142 -0
- package/src/ui-app/index2/components/Tests/Table/Checks/Check.tsx +281 -0
- package/src/ui-app/index2/components/Tests/Table/Checks/CheckDetails/Canvas/Canvas.tsx +36 -0
- package/src/ui-app/index2/components/Tests/Table/Checks/CheckDetails/Canvas/helpers.ts +72 -0
- package/src/ui-app/index2/components/Tests/Table/Checks/CheckDetails/Canvas/mainView.ts +495 -0
- package/src/ui-app/index2/components/Tests/Table/Checks/CheckDetails/Canvas/sideToSideView.ts +398 -0
- package/src/ui-app/index2/components/Tests/Table/Checks/CheckDetails/Canvas/simpleView.ts +21 -0
- package/src/ui-app/index2/components/Tests/Table/Checks/CheckDetails/CheckDetails.tsx +237 -0
- package/src/ui-app/index2/components/Tests/Table/Checks/CheckDetails/Header.tsx +221 -0
- package/src/ui-app/index2/components/Tests/Table/Checks/CheckDetails/RelatedChecks/RelatedCheckItem.tsx +167 -0
- package/src/ui-app/index2/components/Tests/Table/Checks/CheckDetails/RelatedChecks/RelatedCheckSort.tsx +81 -0
- package/src/ui-app/index2/components/Tests/Table/Checks/CheckDetails/RelatedChecks/RelatedChecks.tsx +197 -0
- package/src/ui-app/index2/components/Tests/Table/Checks/CheckDetails/RelatedChecks/RelatedChecksItems.tsx +31 -0
- package/src/ui-app/index2/components/Tests/Table/Checks/CheckDetails/RelatedChecks/RelatedChecksSkeleton.tsx +37 -0
- package/src/ui-app/index2/components/Tests/Table/Checks/CheckDetails/Toolbar/HighlightButton.tsx +56 -0
- package/src/ui-app/index2/components/Tests/Table/Checks/CheckDetails/Toolbar/RegionsToolbar.tsx +150 -0
- package/src/ui-app/index2/components/Tests/Table/Checks/CheckDetails/Toolbar/ScreenshotDetails.tsx +137 -0
- package/src/ui-app/index2/components/Tests/Table/Checks/CheckDetails/Toolbar/Toolbar.tsx +101 -0
- package/src/ui-app/index2/components/Tests/Table/Checks/CheckDetails/Toolbar/ViewSegmentedControl.tsx +159 -0
- package/src/ui-app/index2/components/Tests/Table/Checks/CheckDetails/Toolbar/ZoomToolbar.tsx +326 -0
- package/src/ui-app/index2/components/Tests/Table/Checks/CheckDetails/Toolbar/highlightDiff.ts +167 -0
- package/src/ui-app/index2/components/Tests/Table/Checks/CheckDetails/hooks/useRelatedChecks.tsx +43 -0
- package/src/ui-app/index2/components/Tests/Table/Checks/CheckModal.tsx +119 -0
- package/src/ui-app/index2/components/Tests/Table/Checks/Checks.tsx +91 -0
- package/src/ui-app/index2/components/Tests/Table/Checks/ChecksSkeleton.tsx +21 -0
- package/src/ui-app/index2/components/Tests/Table/Checks/PreviewCheckTooltipLabel.tsx +121 -0
- package/src/ui-app/index2/components/Tests/Table/Checks/RemoveButton.tsx +63 -0
- package/src/ui-app/index2/components/Tests/Table/Checks/ViewPortLabel.tsx +94 -0
- package/src/ui-app/index2/components/Tests/Table/Checks/checkSizes.ts +27 -0
- package/src/ui-app/index2/components/Tests/Table/Filter.tsx +179 -0
- package/src/ui-app/index2/components/Tests/Table/Heads.tsx +54 -0
- package/src/ui-app/index2/components/Tests/Table/InfinityScrollSkeleton.tsx +71 -0
- package/src/ui-app/index2/components/Tests/Table/PagesCountAffix.tsx +61 -0
- package/src/ui-app/index2/components/Tests/Table/RefreshActionIcon.tsx +65 -0
- package/src/ui-app/index2/components/Tests/Table/RemoveTestModalAsk.tsx +66 -0
- package/src/ui-app/index2/components/Tests/Table/RemoveTestsButton.tsx +43 -0
- package/src/ui-app/index2/components/Tests/Table/Row.tsx +128 -0
- package/src/ui-app/index2/components/Tests/Table/Rows.tsx +87 -0
- package/src/ui-app/index2/components/Tests/Table/Settings.tsx +121 -0
- package/src/ui-app/index2/components/Tests/Table/TestsTable.tsx +140 -0
- package/src/ui-app/index2/components/Tests/Table/UnfoldActionIcon.tsx +39 -0
- package/src/ui-app/index2/components/Tests/Table/tableColumns.ts +80 -0
- package/src/ui-app/index2/components/Tests/Table/testsCreateStyle.tsx +35 -0
- package/src/ui-app/index2/components/Tests/Tests.tsx +157 -0
- package/src/ui-app/index2/hooks/useIndexSubpageEffect.tsx +14 -0
- package/src/ui-app/index2/hooks/useNavbarActiveItems.tsx +66 -0
- package/src/ui-app/index2/hooks/useParams.tsx +25 -0
- package/src/ui-app/index2/index.html +17 -0
- package/src/ui-app/index2/main.tsx +33 -0
- package/src/ui-app/package-lock.json +6150 -0
- package/src/ui-app/package.json +58 -0
- package/src/ui-app/shared/components/ActionPopoverIcon.tsx +116 -0
- package/src/ui-app/shared/components/Check/AcceptedStatusIcon.tsx +51 -0
- package/src/ui-app/shared/components/Check/BrowserIcon.tsx +50 -0
- package/src/ui-app/shared/components/Check/OsIcon.tsx +73 -0
- package/src/ui-app/shared/components/Check/Status.tsx +37 -0
- package/src/ui-app/shared/components/Check/StatusIcon.tsx +66 -0
- package/src/ui-app/shared/components/Email.tsx +83 -0
- package/src/ui-app/shared/components/Header/ApiKeyModalAsk.tsx +31 -0
- package/src/ui-app/shared/components/Header/ApiKeyModalResult.tsx +89 -0
- package/src/ui-app/shared/components/Header/HeaderLogo.tsx +82 -0
- package/src/ui-app/shared/components/Header/UserInfoModal.tsx +92 -0
- package/src/ui-app/shared/components/Header/UserMenu.tsx +151 -0
- package/src/ui-app/shared/components/Password.tsx +95 -0
- package/src/ui-app/shared/components/RelativeDrawer.tsx +43 -0
- package/src/ui-app/shared/components/SafeSelect.tsx +95 -0
- package/src/ui-app/shared/components/Tests/StatusesRing.tsx +66 -0
- package/src/ui-app/shared/components/ToggleThemeButton.tsx +33 -0
- package/src/ui-app/shared/components/Users/LabelUser.tsx +60 -0
- package/src/ui-app/shared/components/errors/ErrorFallback.tsx +66 -0
- package/src/ui-app/shared/components/filter/AcceptedFilter.tsx +20 -0
- package/src/ui-app/shared/components/filter/BrowserNameFilter.tsx +20 -0
- package/src/ui-app/shared/components/filter/CommonDistinctFilter.tsx +104 -0
- package/src/ui-app/shared/components/filter/DateFilter.tsx +54 -0
- package/src/ui-app/shared/components/filter/FilterWrapper.tsx +80 -0
- package/src/ui-app/shared/components/filter/IdFilter.tsx +60 -0
- package/src/ui-app/shared/components/filter/LogLevelFilter.tsx +77 -0
- package/src/ui-app/shared/components/filter/LogicalGroup.tsx +179 -0
- package/src/ui-app/shared/components/filter/OsFilter.tsx +20 -0
- package/src/ui-app/shared/components/filter/StatusFilter.tsx +20 -0
- package/src/ui-app/shared/components/filter/StringFilter.tsx +55 -0
- package/src/ui-app/shared/components/filter/index.ts +19 -0
- package/src/ui-app/shared/components/heaserLinks.tsx +4 -0
- package/src/ui-app/shared/hooks/index.ts +3 -0
- package/src/ui-app/shared/hooks/useColorSheme.ts +22 -0
- package/src/ui-app/shared/hooks/useDistinctLogQuery.tsx +33 -0
- package/src/ui-app/shared/hooks/useDistinctQuery.tsx +37 -0
- package/src/ui-app/shared/hooks/useInfinityScroll.tsx +163 -0
- package/src/ui-app/shared/hooks/useInfinityScrollRelatedChecks.tsx +60 -0
- package/src/ui-app/shared/hooks/useNavProgressFetchEffect.tsx +17 -0
- package/src/ui-app/shared/hooks/useSubpageEffect.tsx +28 -0
- package/src/ui-app/shared/hooks/user.hooks.ts +49 -0
- package/src/ui-app/shared/interfaces/ILog.tsx +13 -0
- package/src/ui-app/shared/interfaces/IUser.tsx +13 -0
- package/src/ui-app/shared/interfaces/logQueries.tsx +31 -0
- package/src/ui-app/shared/navigation/interfaces.tsx +7 -0
- package/src/ui-app/shared/navigation/navigationData.tsx +191 -0
- package/src/ui-app/shared/services/checks.service.ts +39 -0
- package/src/ui-app/shared/services/generic.service.ts +115 -0
- package/src/ui-app/shared/services/index.ts +6 -0
- package/src/ui-app/shared/services/runs.service.ts +20 -0
- package/src/ui-app/shared/services/suites.service.ts +20 -0
- package/src/ui-app/shared/services/tests.service.ts +39 -0
- package/src/ui-app/shared/services/users.service.ts +29 -0
- package/src/ui-app/shared/utils/Logger.ts +12 -0
- package/src/ui-app/shared/utils/SearchParams.ts +17 -0
- package/src/ui-app/shared/utils/filters.tsx +14 -0
- package/src/ui-app/shared/utils/index.ts +5 -0
- package/src/ui-app/shared/utils/utils.tsx +70 -0
- package/src/ui-app/stub.html +12 -0
- package/src/ui-app/stub.tsx +58 -0
- package/src/ui-app/stubDemoColors.tsx +47 -0
- package/src/ui-app/stubDemoNav.tsx +41 -0
- package/src/ui-app/tsconfig.json +21 -0
- package/src/ui-app/tsconfig.node.json +12 -0
- package/static/A.png +0 -0
- package/static/B.png +0 -0
- package/static/affected.html +39 -0
- package/static/affected_2.html +40 -0
- package/static/data/custom_devices.json +14 -0
- package/static/grids/desktop-higher.html +72 -0
- package/static/grids/desktop-wider.html +72 -0
- package/static/grids/desktop.html +61 -0
- package/static/grids/fit-in-view.html +62 -0
- package/static/js/canvasjs.min.js.bak +957 -0
- package/static/js/chart.js.bak +92 -0
- package/static/js/jquery-3.3.1.slim.js.bak +8269 -0
- package/static/js/jquery-3.3.1.slim.min.js.bak +2 -0
- package/static/js/moment.min.js.bak +2 -0
- package/static/low_diff_0.png +0 -0
- package/static/low_diff_1.png +0 -0
- package/static/vShift.png +0 -0
- package/static/vShift_bottom.png +0 -0
- package/static/vShift_top.png +0 -0
|
@@ -0,0 +1,673 @@
|
|
|
1
|
+
import { c as createStyles, u as useQuery, k as ky, a as config, l as log, j as jsxs, C as Center, A as Anchor, b as jsx, N as NR, T as Text, d as useMantineTheme, e as Container, P as Paper, B as Box, f as useDocumentTitle, r as react, L as LoadingOverlay, z as zB, w as wN, g as Title, h as Button, i as Progress, G as Group, m as dj, n as lAe, o as useSearchParams, p as useForm, q as TextInput, s as Checkbox, S as Switch, t as GCe, v as Nie, Q as QueryClient, x as useRoutes, y as useLocalStorage, D as useHotkeys, E as QueryClientProvider, F as ColorSchemeProvider, M as MantineProvider, H as createRoot, I as BrowserRouter } from "./use-form.57ebe175.js";
|
|
2
|
+
import { P as PasswordInput } from "./PasswordInput.8a73fdd2.js";
|
|
3
|
+
const index = "";
|
|
4
|
+
const useStyle = createStyles((theme) => ({
|
|
5
|
+
footer: {
|
|
6
|
+
marginTop: 120,
|
|
7
|
+
borderTop: `1px solid ${theme.colorScheme === "dark" ? theme.colors.dark[5] : theme.colors.gray[2]}`
|
|
8
|
+
},
|
|
9
|
+
footerText: {
|
|
10
|
+
color: "white",
|
|
11
|
+
fontSize: "1rem"
|
|
12
|
+
},
|
|
13
|
+
footerLink: {
|
|
14
|
+
margin: "8px",
|
|
15
|
+
color: "white",
|
|
16
|
+
fontSize: "1rem",
|
|
17
|
+
":hover": {
|
|
18
|
+
textDecoration: "underline",
|
|
19
|
+
filter: "brightness(120%)"
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}));
|
|
23
|
+
function AuthFooter() {
|
|
24
|
+
const {
|
|
25
|
+
classes
|
|
26
|
+
} = useStyle();
|
|
27
|
+
const {
|
|
28
|
+
isLoading,
|
|
29
|
+
isError,
|
|
30
|
+
data,
|
|
31
|
+
error
|
|
32
|
+
} = useQuery(["version"], () => ky(`${config.baseUri}/v1/app/info`).then((res) => res.json()));
|
|
33
|
+
if (isError) {
|
|
34
|
+
log.error(error);
|
|
35
|
+
return null;
|
|
36
|
+
}
|
|
37
|
+
if (isLoading)
|
|
38
|
+
return null;
|
|
39
|
+
const tagUrl = `https://github.com/syngrisi/syngrisi/releases/tag/v${data.version}`;
|
|
40
|
+
return /* @__PURE__ */ jsxs(Center, {
|
|
41
|
+
children: [/* @__PURE__ */ jsxs(Anchor, {
|
|
42
|
+
href: "https://github.com/syngrisi/syngrisi/tree/main/packages/syngrisi",
|
|
43
|
+
target: "_blank",
|
|
44
|
+
className: classes.footerLink,
|
|
45
|
+
children: [/* @__PURE__ */ jsx(NR, {
|
|
46
|
+
size: "1rem",
|
|
47
|
+
stroke: 1
|
|
48
|
+
}), "GitHub"]
|
|
49
|
+
}), /* @__PURE__ */ jsx(Text, {
|
|
50
|
+
component: "span",
|
|
51
|
+
className: classes.footerText,
|
|
52
|
+
children: "|"
|
|
53
|
+
}), /* @__PURE__ */ jsx(Anchor, {
|
|
54
|
+
className: classes.footerLink,
|
|
55
|
+
href: tagUrl,
|
|
56
|
+
children: `v${data.version}`
|
|
57
|
+
})]
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
function AuthLogo() {
|
|
61
|
+
const theme = useMantineTheme();
|
|
62
|
+
const {
|
|
63
|
+
colorScheme
|
|
64
|
+
} = theme;
|
|
65
|
+
return /* @__PURE__ */ jsxs(Container, {
|
|
66
|
+
style: {
|
|
67
|
+
paddingTop: "50px",
|
|
68
|
+
display: "flex",
|
|
69
|
+
alignItems: "center"
|
|
70
|
+
},
|
|
71
|
+
children: [/* @__PURE__ */ jsx(Paper, {
|
|
72
|
+
style: {
|
|
73
|
+
display: "flex",
|
|
74
|
+
alignItems: "center",
|
|
75
|
+
padding: "5px 8px",
|
|
76
|
+
borderRadius: "2px 20px 2px 20px"
|
|
77
|
+
},
|
|
78
|
+
children: /* @__PURE__ */ jsxs("svg", {
|
|
79
|
+
width: "54",
|
|
80
|
+
viewBox: "0 0 64 67",
|
|
81
|
+
fill: "none",
|
|
82
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
83
|
+
children: [/* @__PURE__ */ jsx("path", {
|
|
84
|
+
d: "M62.245 64.6094L7.36118 36.1968C6.98858 36.0039 6.98859 35.471 7.36118 35.2781L62.245 6.86548C62.5893 6.68725 63 6.93713 63 7.32482V64.1501C63 64.5378 62.5893 64.7876 62.245 64.6094Z",
|
|
85
|
+
fill: "#2B8A3E",
|
|
86
|
+
fillOpacity: "0.38",
|
|
87
|
+
stroke: "#2B8A3E",
|
|
88
|
+
strokeOpacity: "0.6",
|
|
89
|
+
strokeWidth: "1.63692"
|
|
90
|
+
}), /* @__PURE__ */ jsx("path", {
|
|
91
|
+
d: "M1.74625 59.1348L56.63 30.7222C57.0026 30.5293 57.0026 29.9964 56.63 29.8035L1.74625 1.39087C1.40196 1.21264 0.991211 1.46252 0.991211 1.85021V58.6755C0.991211 59.0631 1.40196 59.313 1.74625 59.1348Z",
|
|
92
|
+
fill: "#1C7ED6",
|
|
93
|
+
fillOpacity: "0.4",
|
|
94
|
+
stroke: "#1C7ED6",
|
|
95
|
+
strokeOpacity: "0.6",
|
|
96
|
+
strokeWidth: "1.63692"
|
|
97
|
+
})]
|
|
98
|
+
})
|
|
99
|
+
}), /* @__PURE__ */ jsx(Box, {
|
|
100
|
+
style: {
|
|
101
|
+
color: "white",
|
|
102
|
+
fontSize: "3rem",
|
|
103
|
+
paddingLeft: "8px",
|
|
104
|
+
fontFamily: "Roboto, sans-serif",
|
|
105
|
+
fontWeight: 500
|
|
106
|
+
},
|
|
107
|
+
children: /* @__PURE__ */ jsx(Paper, {
|
|
108
|
+
style: {
|
|
109
|
+
backgroundColor: "rgba(0, 0, 0, 0)"
|
|
110
|
+
},
|
|
111
|
+
children: /* @__PURE__ */ jsx(Text, {
|
|
112
|
+
color: colorScheme === "dark" ? "gray.4" : "white",
|
|
113
|
+
children: "Syngrisi"
|
|
114
|
+
})
|
|
115
|
+
})
|
|
116
|
+
})]
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
function LogoutForm() {
|
|
120
|
+
useDocumentTitle("Logout page");
|
|
121
|
+
react.exports.useEffect(() => {
|
|
122
|
+
ky(`${config.baseUri}/v1/auth/logout`);
|
|
123
|
+
}, []);
|
|
124
|
+
const logoutInfo = useQuery(["logout"], () => ky(`${config.baseUri}/v1/auth/logout`).then((res) => res.json()), {
|
|
125
|
+
refetchOnWindowFocus: false
|
|
126
|
+
});
|
|
127
|
+
const userInfo = useQuery(["current_user", logoutInfo], () => ky(`${config.baseUri}/v1/users/current`).then((res) => res.json()), {
|
|
128
|
+
refetchOnWindowFocus: false
|
|
129
|
+
});
|
|
130
|
+
if (userInfo.isError) {
|
|
131
|
+
log.error(userInfo.error);
|
|
132
|
+
}
|
|
133
|
+
const success = !userInfo.isLoading && Object.keys(userInfo.data).length === 0;
|
|
134
|
+
return /* @__PURE__ */ jsxs(Container, {
|
|
135
|
+
size: 420,
|
|
136
|
+
my: 40,
|
|
137
|
+
children: [/* @__PURE__ */ jsx(LoadingOverlay, {
|
|
138
|
+
visible: userInfo.isLoading,
|
|
139
|
+
transitionDuration: 300,
|
|
140
|
+
overlayBlur: 1,
|
|
141
|
+
loaderProps: {
|
|
142
|
+
color: "green"
|
|
143
|
+
}
|
|
144
|
+
}), /* @__PURE__ */ jsxs(Paper, {
|
|
145
|
+
withBorder: true,
|
|
146
|
+
shadow: "md",
|
|
147
|
+
p: 30,
|
|
148
|
+
mt: 30,
|
|
149
|
+
radius: "md",
|
|
150
|
+
hidden: userInfo.isLoading,
|
|
151
|
+
children: [success ? /* @__PURE__ */ jsx(Text, {
|
|
152
|
+
align: "center",
|
|
153
|
+
color: "green",
|
|
154
|
+
children: /* @__PURE__ */ jsx(zB, {
|
|
155
|
+
size: "6rem"
|
|
156
|
+
})
|
|
157
|
+
}) : /* @__PURE__ */ jsx(Text, {
|
|
158
|
+
align: "center",
|
|
159
|
+
color: "red",
|
|
160
|
+
children: /* @__PURE__ */ jsx(wN, {
|
|
161
|
+
size: "6rem"
|
|
162
|
+
})
|
|
163
|
+
}), /* @__PURE__ */ jsx(Title, {
|
|
164
|
+
align: "center",
|
|
165
|
+
children: success ? "Success!" : "Failed"
|
|
166
|
+
}), /* @__PURE__ */ jsx(Text, {
|
|
167
|
+
align: "center",
|
|
168
|
+
size: 16,
|
|
169
|
+
mt: "md",
|
|
170
|
+
children: success ? "You have been successfully logged out. Click Sign In to login again." : "Something went wrong"
|
|
171
|
+
}), /* @__PURE__ */ jsx(Button, {
|
|
172
|
+
fullWidth: true,
|
|
173
|
+
id: "submit",
|
|
174
|
+
mt: "xl",
|
|
175
|
+
color: "green",
|
|
176
|
+
type: "submit",
|
|
177
|
+
component: "a",
|
|
178
|
+
href: "/auth/",
|
|
179
|
+
children: "Sign In"
|
|
180
|
+
})]
|
|
181
|
+
})]
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
const requirements = [{
|
|
185
|
+
re: /[0-9]/,
|
|
186
|
+
label: "Includes number",
|
|
187
|
+
id: "include-numbers"
|
|
188
|
+
}, {
|
|
189
|
+
re: /[a-z]/,
|
|
190
|
+
label: "Includes lowercase letter",
|
|
191
|
+
id: "include-lowercase"
|
|
192
|
+
}, {
|
|
193
|
+
re: /[A-Z]/,
|
|
194
|
+
label: "Includes uppercase letter",
|
|
195
|
+
id: "include-uppercase"
|
|
196
|
+
}, {
|
|
197
|
+
re: /[$&+,:;=?@#|'<>.^*()%!-]/,
|
|
198
|
+
label: "Includes special symbol",
|
|
199
|
+
id: "include-special"
|
|
200
|
+
}];
|
|
201
|
+
function Bars({
|
|
202
|
+
value
|
|
203
|
+
}) {
|
|
204
|
+
function getStrength(password) {
|
|
205
|
+
let multiplier = password.length > 5 ? 0 : 1;
|
|
206
|
+
requirements.forEach((requirement) => {
|
|
207
|
+
if (!requirement.re.test(password)) {
|
|
208
|
+
multiplier += 1;
|
|
209
|
+
}
|
|
210
|
+
});
|
|
211
|
+
return Math.max(100 - 100 / (requirements.length + 1) * multiplier, 0);
|
|
212
|
+
}
|
|
213
|
+
const strength = getStrength(value);
|
|
214
|
+
const bars = Array(4).fill(0).map((_, index2) => /* @__PURE__ */ jsx(Progress, {
|
|
215
|
+
styles: {
|
|
216
|
+
bar: {
|
|
217
|
+
transitionDuration: "0ms"
|
|
218
|
+
}
|
|
219
|
+
},
|
|
220
|
+
value: value.length > 0 && index2 === 0 ? 100 : strength >= (index2 + 1) / 4 * 100 ? 100 : 0,
|
|
221
|
+
color: strength > 80 ? "teal" : strength > 50 ? "yellow" : "red",
|
|
222
|
+
size: 4
|
|
223
|
+
}, index2));
|
|
224
|
+
return /* @__PURE__ */ jsx(Group, {
|
|
225
|
+
spacing: 5,
|
|
226
|
+
grow: true,
|
|
227
|
+
mt: "xs",
|
|
228
|
+
mb: "md",
|
|
229
|
+
children: bars
|
|
230
|
+
});
|
|
231
|
+
}
|
|
232
|
+
function PasswordRequirement({
|
|
233
|
+
meets,
|
|
234
|
+
label,
|
|
235
|
+
id
|
|
236
|
+
}) {
|
|
237
|
+
return /* @__PURE__ */ jsx(Text, {
|
|
238
|
+
color: meets ? "teal" : "red",
|
|
239
|
+
mt: 5,
|
|
240
|
+
size: "sm",
|
|
241
|
+
id,
|
|
242
|
+
children: /* @__PURE__ */ jsxs(Center, {
|
|
243
|
+
inline: true,
|
|
244
|
+
children: [meets ? /* @__PURE__ */ jsx(dj, {
|
|
245
|
+
size: 14,
|
|
246
|
+
stroke: 1.5
|
|
247
|
+
}) : /* @__PURE__ */ jsx(lAe, {
|
|
248
|
+
size: 14,
|
|
249
|
+
stroke: 1.5
|
|
250
|
+
}), /* @__PURE__ */ jsx(Box, {
|
|
251
|
+
ml: 7,
|
|
252
|
+
children: label
|
|
253
|
+
})]
|
|
254
|
+
})
|
|
255
|
+
});
|
|
256
|
+
}
|
|
257
|
+
function ChangePasswordForm() {
|
|
258
|
+
useDocumentTitle("Change Password Page");
|
|
259
|
+
const [searchParams] = useSearchParams();
|
|
260
|
+
const isFirstRun = !!searchParams.get("first_run");
|
|
261
|
+
let validatedRequirements;
|
|
262
|
+
const form = useForm({
|
|
263
|
+
initialValues: {
|
|
264
|
+
currentPassword: "",
|
|
265
|
+
newPassword: "",
|
|
266
|
+
newPasswordConfirmation: ""
|
|
267
|
+
},
|
|
268
|
+
validate: {
|
|
269
|
+
currentPassword: (val) => {
|
|
270
|
+
if (isFirstRun)
|
|
271
|
+
return null;
|
|
272
|
+
return val !== "" ? null : "Old password is Empty";
|
|
273
|
+
},
|
|
274
|
+
newPassword: (val) => {
|
|
275
|
+
if (validatedRequirements.some((x) => !x.meets)) {
|
|
276
|
+
return "The password doesn't meet the requirements";
|
|
277
|
+
}
|
|
278
|
+
return null;
|
|
279
|
+
},
|
|
280
|
+
newPasswordConfirmation: (val) => val === form.values.newPassword ? null : "New password and password confirmation must be match"
|
|
281
|
+
}
|
|
282
|
+
});
|
|
283
|
+
const [errorMessage, setErrorMessage] = react.exports.useState("");
|
|
284
|
+
const [loader, setLoader] = react.exports.useState(false);
|
|
285
|
+
validatedRequirements = requirements.map((requirement) => ({
|
|
286
|
+
key: requirement.id,
|
|
287
|
+
id: requirement.id,
|
|
288
|
+
label: requirement.label,
|
|
289
|
+
meets: requirement.re.test(form.values.newPassword)
|
|
290
|
+
}));
|
|
291
|
+
const checks = validatedRequirements.map((requirement) => /* @__PURE__ */ jsx(PasswordRequirement, {
|
|
292
|
+
id: requirement.id,
|
|
293
|
+
label: requirement.label,
|
|
294
|
+
meets: requirement.meets
|
|
295
|
+
}, requirement.id));
|
|
296
|
+
function handleNewPasswordFields(event, path) {
|
|
297
|
+
form.setFieldValue(path, event.currentTarget.value);
|
|
298
|
+
}
|
|
299
|
+
async function handleFormSubmissions(values) {
|
|
300
|
+
try {
|
|
301
|
+
setErrorMessage("");
|
|
302
|
+
setLoader(true);
|
|
303
|
+
const url = isFirstRun ? `${config.baseUri}/v1/auth/change_first_run` : `${config.baseUri}/v1/auth/change`;
|
|
304
|
+
const resp = await ky(url, {
|
|
305
|
+
throwHttpErrors: false,
|
|
306
|
+
method: "POST",
|
|
307
|
+
credentials: "include",
|
|
308
|
+
body: JSON.stringify({
|
|
309
|
+
currentPassword: isFirstRun ? "" : values.currentPassword,
|
|
310
|
+
newPassword: values.newPassword,
|
|
311
|
+
isFirstRun
|
|
312
|
+
}),
|
|
313
|
+
headers: {
|
|
314
|
+
"content-type": "application/json"
|
|
315
|
+
}
|
|
316
|
+
});
|
|
317
|
+
const result = await resp.json();
|
|
318
|
+
setLoader(false);
|
|
319
|
+
if (result.message === "success") {
|
|
320
|
+
return window.location.assign("/auth/changeSuccess");
|
|
321
|
+
}
|
|
322
|
+
if (result.message) {
|
|
323
|
+
log.error(typeof result === "object" ? JSON.stringify(result) : result.toString());
|
|
324
|
+
return setErrorMessage(result.message);
|
|
325
|
+
}
|
|
326
|
+
log.error(typeof result === "object" ? JSON.stringify(result) : result.toString());
|
|
327
|
+
return setErrorMessage(result.message);
|
|
328
|
+
} catch (e) {
|
|
329
|
+
log.error(e.stack || e.toString());
|
|
330
|
+
setErrorMessage("Connection error");
|
|
331
|
+
} finally {
|
|
332
|
+
setLoader(false);
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
return /* @__PURE__ */ jsx(Container, {
|
|
336
|
+
size: 420,
|
|
337
|
+
my: 40,
|
|
338
|
+
children: /* @__PURE__ */ jsx(Paper, {
|
|
339
|
+
withBorder: true,
|
|
340
|
+
shadow: "md",
|
|
341
|
+
p: 30,
|
|
342
|
+
mt: 30,
|
|
343
|
+
radius: "md",
|
|
344
|
+
children: /* @__PURE__ */ jsxs("form", {
|
|
345
|
+
onSubmit: form.onSubmit((values) => handleFormSubmissions(values)),
|
|
346
|
+
children: [/* @__PURE__ */ jsx(Title, {
|
|
347
|
+
order: isFirstRun ? 3 : 2,
|
|
348
|
+
id: "title",
|
|
349
|
+
children: isFirstRun ? "Change Password for default Administrator" : "Change Password"
|
|
350
|
+
}), /* @__PURE__ */ jsx(PasswordInput, {
|
|
351
|
+
label: "Current Password",
|
|
352
|
+
placeholder: "Enter current password",
|
|
353
|
+
id: "current-password",
|
|
354
|
+
value: isFirstRun ? "---------------" : form.values.currentPassword,
|
|
355
|
+
onChange: (event) => form.setFieldValue("currentPassword", event.currentTarget.value),
|
|
356
|
+
error: form.errors.currentPassword && "Invalid password",
|
|
357
|
+
disabled: isFirstRun || false,
|
|
358
|
+
required: true
|
|
359
|
+
}), /* @__PURE__ */ jsx(
|
|
360
|
+
PasswordInput,
|
|
361
|
+
{
|
|
362
|
+
value: form.values.newPassword,
|
|
363
|
+
onChange: (event) => handleNewPasswordFields(event, "newPassword"),
|
|
364
|
+
placeholder: "New Password",
|
|
365
|
+
id: "new-password",
|
|
366
|
+
label: "New Password",
|
|
367
|
+
error: form.errors.newPassword,
|
|
368
|
+
required: true
|
|
369
|
+
}
|
|
370
|
+
), /* @__PURE__ */ jsx(PasswordInput, {
|
|
371
|
+
value: form.values.newPasswordConfirmation,
|
|
372
|
+
onChange: (event) => handleNewPasswordFields(event, "newPasswordConfirmation"),
|
|
373
|
+
placeholder: "New Password",
|
|
374
|
+
id: "new-password-confirmation",
|
|
375
|
+
label: "New Password Confirmation",
|
|
376
|
+
error: form.errors.newPasswordConfirmation,
|
|
377
|
+
required: true
|
|
378
|
+
}), /* @__PURE__ */ jsx(Bars, {
|
|
379
|
+
value: form.values.newPassword
|
|
380
|
+
}), /* @__PURE__ */ jsx(PasswordRequirement, {
|
|
381
|
+
label: "Has at least 6 characters",
|
|
382
|
+
id: "include-six-chars",
|
|
383
|
+
meets: form.values.newPassword.length > 5
|
|
384
|
+
}), checks, errorMessage && /* @__PURE__ */ jsx(Text, {
|
|
385
|
+
size: "sm",
|
|
386
|
+
color: "red",
|
|
387
|
+
mt: "md",
|
|
388
|
+
id: "error-message",
|
|
389
|
+
hidden: false,
|
|
390
|
+
children: errorMessage
|
|
391
|
+
}), /* @__PURE__ */ jsx(Button, {
|
|
392
|
+
fullWidth: true,
|
|
393
|
+
id: "change-password",
|
|
394
|
+
mt: "xl",
|
|
395
|
+
color: "green",
|
|
396
|
+
type: "submit",
|
|
397
|
+
children: "Update password"
|
|
398
|
+
}), /* @__PURE__ */ jsx(LoadingOverlay, {
|
|
399
|
+
visible: loader,
|
|
400
|
+
transitionDuration: 300,
|
|
401
|
+
overlayBlur: 1,
|
|
402
|
+
loaderProps: {
|
|
403
|
+
color: "green"
|
|
404
|
+
}
|
|
405
|
+
})]
|
|
406
|
+
})
|
|
407
|
+
})
|
|
408
|
+
});
|
|
409
|
+
}
|
|
410
|
+
function LoginForm() {
|
|
411
|
+
useDocumentTitle("Login Page");
|
|
412
|
+
const form = useForm({
|
|
413
|
+
initialValues: {
|
|
414
|
+
email: "",
|
|
415
|
+
password: "",
|
|
416
|
+
rememberMe: true
|
|
417
|
+
},
|
|
418
|
+
validate: {
|
|
419
|
+
email: (val) => {
|
|
420
|
+
if (val === "Test" || val === "Administrator")
|
|
421
|
+
return null;
|
|
422
|
+
return /^\S+@\S+$/.test(val) ? null : "Invalid email";
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
});
|
|
426
|
+
const [errorMessage, setErrorMessage] = react.exports.useState("");
|
|
427
|
+
const [searchParams, setSearchParams] = useSearchParams();
|
|
428
|
+
const [loader, setLoader] = react.exports.useState(false);
|
|
429
|
+
const successRedirectUrl = searchParams.get("origin") || "/";
|
|
430
|
+
async function handleFormSubmissions(values) {
|
|
431
|
+
try {
|
|
432
|
+
setErrorMessage("");
|
|
433
|
+
setLoader(true);
|
|
434
|
+
const resp = await ky(`${config.baseUri}/v1/auth/login`, {
|
|
435
|
+
throwHttpErrors: false,
|
|
436
|
+
method: "POST",
|
|
437
|
+
credentials: "include",
|
|
438
|
+
body: JSON.stringify({
|
|
439
|
+
username: values.email,
|
|
440
|
+
password: values.password,
|
|
441
|
+
rememberMe: values.rememberMe
|
|
442
|
+
}),
|
|
443
|
+
headers: {
|
|
444
|
+
"content-type": "application/json"
|
|
445
|
+
}
|
|
446
|
+
});
|
|
447
|
+
const result = await resp.json();
|
|
448
|
+
setLoader(false);
|
|
449
|
+
if (result.message === "success") {
|
|
450
|
+
return window.location.assign(successRedirectUrl);
|
|
451
|
+
}
|
|
452
|
+
if (result.message) {
|
|
453
|
+
log.error(typeof result === "object" ? JSON.stringify(result) : result.toString());
|
|
454
|
+
return setErrorMessage(result.message);
|
|
455
|
+
}
|
|
456
|
+
log.error(typeof result === "object" ? JSON.stringify(result) : result.toString());
|
|
457
|
+
setErrorMessage("Connection error");
|
|
458
|
+
} catch (e) {
|
|
459
|
+
log.error(e.stack || e.toString());
|
|
460
|
+
setErrorMessage("Connection error");
|
|
461
|
+
} finally {
|
|
462
|
+
setLoader(false);
|
|
463
|
+
}
|
|
464
|
+
}
|
|
465
|
+
return /* @__PURE__ */ jsx(Container, {
|
|
466
|
+
size: 420,
|
|
467
|
+
my: 40,
|
|
468
|
+
children: /* @__PURE__ */ jsx(Paper, {
|
|
469
|
+
withBorder: true,
|
|
470
|
+
shadow: "md",
|
|
471
|
+
p: 30,
|
|
472
|
+
mt: 30,
|
|
473
|
+
radius: "md",
|
|
474
|
+
children: /* @__PURE__ */ jsxs("form", {
|
|
475
|
+
onSubmit: form.onSubmit((values) => handleFormSubmissions(values)),
|
|
476
|
+
children: [/* @__PURE__ */ jsx(Title, {
|
|
477
|
+
children: "Sign in"
|
|
478
|
+
}), /* @__PURE__ */ jsx(TextInput, {
|
|
479
|
+
label: "Email",
|
|
480
|
+
id: "email",
|
|
481
|
+
placeholder: "username@domain.com",
|
|
482
|
+
value: form.values.email,
|
|
483
|
+
onChange: (event) => form.setFieldValue("email", event.currentTarget.value),
|
|
484
|
+
error: form.errors.email && "Invalid email",
|
|
485
|
+
required: true
|
|
486
|
+
}), /* @__PURE__ */ jsx(PasswordInput, {
|
|
487
|
+
label: "Password",
|
|
488
|
+
id: "password",
|
|
489
|
+
placeholder: "Your password",
|
|
490
|
+
value: form.values.password,
|
|
491
|
+
onChange: (event) => form.setFieldValue("password", event.currentTarget.value),
|
|
492
|
+
required: true,
|
|
493
|
+
mt: "md"
|
|
494
|
+
}), /* @__PURE__ */ jsx(Group, {
|
|
495
|
+
position: "apart",
|
|
496
|
+
mt: "md",
|
|
497
|
+
children: /* @__PURE__ */ jsx(Checkbox, {
|
|
498
|
+
label: "Remember me",
|
|
499
|
+
onChange: (event) => form.setFieldValue("rememberMe", event.currentTarget.checked)
|
|
500
|
+
})
|
|
501
|
+
}), errorMessage && /* @__PURE__ */ jsx(Text, {
|
|
502
|
+
size: "sm",
|
|
503
|
+
color: "red",
|
|
504
|
+
mt: "md",
|
|
505
|
+
id: "error-message",
|
|
506
|
+
hidden: false,
|
|
507
|
+
children: errorMessage
|
|
508
|
+
}), /* @__PURE__ */ jsx(Button, {
|
|
509
|
+
fullWidth: true,
|
|
510
|
+
id: "submit",
|
|
511
|
+
mt: "xl",
|
|
512
|
+
color: "green",
|
|
513
|
+
type: "submit",
|
|
514
|
+
children: "Sign in"
|
|
515
|
+
}), /* @__PURE__ */ jsx(LoadingOverlay, {
|
|
516
|
+
visible: loader,
|
|
517
|
+
transitionDuration: 300,
|
|
518
|
+
overlayBlur: 1,
|
|
519
|
+
loaderProps: {
|
|
520
|
+
color: "green"
|
|
521
|
+
}
|
|
522
|
+
})]
|
|
523
|
+
})
|
|
524
|
+
})
|
|
525
|
+
});
|
|
526
|
+
}
|
|
527
|
+
function ChangePasswordSuccessForm() {
|
|
528
|
+
useDocumentTitle("Success");
|
|
529
|
+
return /* @__PURE__ */ jsx(Container, {
|
|
530
|
+
size: 420,
|
|
531
|
+
my: 40,
|
|
532
|
+
children: /* @__PURE__ */ jsxs(Paper, {
|
|
533
|
+
withBorder: true,
|
|
534
|
+
shadow: "md",
|
|
535
|
+
p: 30,
|
|
536
|
+
mt: 30,
|
|
537
|
+
radius: "md",
|
|
538
|
+
children: [/* @__PURE__ */ jsx(Text, {
|
|
539
|
+
align: "center",
|
|
540
|
+
color: "green",
|
|
541
|
+
children: /* @__PURE__ */ jsx(zB, {
|
|
542
|
+
size: "6rem"
|
|
543
|
+
})
|
|
544
|
+
}), /* @__PURE__ */ jsx(Title, {
|
|
545
|
+
align: "center",
|
|
546
|
+
children: "Success!"
|
|
547
|
+
}), /* @__PURE__ */ jsx(Text, {
|
|
548
|
+
align: "center",
|
|
549
|
+
size: 16,
|
|
550
|
+
mt: "md",
|
|
551
|
+
children: "Your Password has been changed. Please use your new password to login!"
|
|
552
|
+
}), /* @__PURE__ */ jsx(Button, {
|
|
553
|
+
fullWidth: true,
|
|
554
|
+
id: "submit",
|
|
555
|
+
mt: "xl",
|
|
556
|
+
color: "green",
|
|
557
|
+
type: "submit",
|
|
558
|
+
component: "a",
|
|
559
|
+
href: "/auth/",
|
|
560
|
+
children: "Sign In"
|
|
561
|
+
})]
|
|
562
|
+
})
|
|
563
|
+
});
|
|
564
|
+
}
|
|
565
|
+
const routesItems = [{
|
|
566
|
+
path: "/auth/logout",
|
|
567
|
+
element: /* @__PURE__ */ jsx(LogoutForm, {})
|
|
568
|
+
}, {
|
|
569
|
+
path: "/auth/change",
|
|
570
|
+
element: /* @__PURE__ */ jsx(ChangePasswordForm, {})
|
|
571
|
+
}, {
|
|
572
|
+
path: "/auth/changeSuccess",
|
|
573
|
+
element: /* @__PURE__ */ jsx(ChangePasswordSuccessForm, {})
|
|
574
|
+
}, {
|
|
575
|
+
path: "/auth/",
|
|
576
|
+
element: /* @__PURE__ */ jsx(LoginForm, {})
|
|
577
|
+
}];
|
|
578
|
+
function ToggleThemeButton({
|
|
579
|
+
colorScheme,
|
|
580
|
+
toggleColorScheme
|
|
581
|
+
}) {
|
|
582
|
+
const dark = colorScheme === "dark";
|
|
583
|
+
const theme = useMantineTheme();
|
|
584
|
+
return /* @__PURE__ */ jsx(Group, {
|
|
585
|
+
mr: 28,
|
|
586
|
+
position: "right",
|
|
587
|
+
title: `Switch to ${dark ? "light" : "dark"} theme`,
|
|
588
|
+
children: /* @__PURE__ */ jsx(Switch, {
|
|
589
|
+
"data-test": "theme-button",
|
|
590
|
+
size: "md",
|
|
591
|
+
styles: () => ({
|
|
592
|
+
track: {
|
|
593
|
+
backgroundColor: theme.colors.gray[8],
|
|
594
|
+
borderColor: theme.colors.gray[8]
|
|
595
|
+
}
|
|
596
|
+
}),
|
|
597
|
+
color: "gray.8",
|
|
598
|
+
checked: colorScheme === "light",
|
|
599
|
+
onChange: () => {
|
|
600
|
+
toggleColorScheme();
|
|
601
|
+
},
|
|
602
|
+
onLabel: /* @__PURE__ */ jsx(GCe, {
|
|
603
|
+
size: 16,
|
|
604
|
+
stroke: 2.5,
|
|
605
|
+
color: theme.colors.yellow[4]
|
|
606
|
+
}),
|
|
607
|
+
offLabel: /* @__PURE__ */ jsx(Nie, {
|
|
608
|
+
size: 16,
|
|
609
|
+
stroke: 2.5,
|
|
610
|
+
color: theme.colors.blue[6]
|
|
611
|
+
})
|
|
612
|
+
})
|
|
613
|
+
});
|
|
614
|
+
}
|
|
615
|
+
const queryClient = new QueryClient();
|
|
616
|
+
function App() {
|
|
617
|
+
const routes = useRoutes(routesItems);
|
|
618
|
+
const [colorScheme, setColorScheme] = useLocalStorage({
|
|
619
|
+
key: "mantine-color-scheme",
|
|
620
|
+
defaultValue: "light",
|
|
621
|
+
getInitialValueInEffect: true
|
|
622
|
+
});
|
|
623
|
+
const isDark = () => colorScheme === "dark";
|
|
624
|
+
react.exports.useEffect(function onColorSchemeChange() {
|
|
625
|
+
if (!isDark()) {
|
|
626
|
+
document.body.style.backgroundColor = "#1e1e1e";
|
|
627
|
+
document.body.style.setProperty("--before-opacity", "0.7");
|
|
628
|
+
return;
|
|
629
|
+
}
|
|
630
|
+
document.body.style.backgroundColor = "#000000";
|
|
631
|
+
document.body.style.setProperty("--before-opacity", "0.7");
|
|
632
|
+
}, [colorScheme]);
|
|
633
|
+
const toggleColorScheme = (value) => {
|
|
634
|
+
setColorScheme(value || (isDark() ? "light" : "dark"));
|
|
635
|
+
};
|
|
636
|
+
useHotkeys([["mod+J", () => toggleColorScheme()]]);
|
|
637
|
+
return /* @__PURE__ */ jsx(QueryClientProvider, {
|
|
638
|
+
client: queryClient,
|
|
639
|
+
children: /* @__PURE__ */ jsxs(ColorSchemeProvider, {
|
|
640
|
+
colorScheme,
|
|
641
|
+
toggleColorScheme,
|
|
642
|
+
children: [/* @__PURE__ */ jsx(ToggleThemeButton, {
|
|
643
|
+
colorScheme,
|
|
644
|
+
toggleColorScheme
|
|
645
|
+
}), /* @__PURE__ */ jsxs(MantineProvider, {
|
|
646
|
+
withGlobalStyles: true,
|
|
647
|
+
withNormalizeCSS: true,
|
|
648
|
+
theme: {
|
|
649
|
+
fontSizes: {
|
|
650
|
+
md: 24
|
|
651
|
+
},
|
|
652
|
+
colorScheme
|
|
653
|
+
},
|
|
654
|
+
children: [/* @__PURE__ */ jsx(Box, {
|
|
655
|
+
sx: () => ({
|
|
656
|
+
display: "flex",
|
|
657
|
+
justifyContent: "center"
|
|
658
|
+
}),
|
|
659
|
+
children: /* @__PURE__ */ jsx(AuthLogo, {})
|
|
660
|
+
}), /* @__PURE__ */ jsx(Box, {
|
|
661
|
+
children: routes
|
|
662
|
+
}), /* @__PURE__ */ jsx(Box, {
|
|
663
|
+
children: /* @__PURE__ */ jsx(AuthFooter, {})
|
|
664
|
+
})]
|
|
665
|
+
})]
|
|
666
|
+
})
|
|
667
|
+
});
|
|
668
|
+
}
|
|
669
|
+
createRoot(document.getElementById("root")).render(/* @__PURE__ */ jsx(react.exports.StrictMode, {
|
|
670
|
+
children: /* @__PURE__ */ jsx(BrowserRouter, {
|
|
671
|
+
children: /* @__PURE__ */ jsx(App, {})
|
|
672
|
+
})
|
|
673
|
+
}));
|
|
Binary file
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
<svg width="77" height="73" viewBox="0 0 77 73" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M0 3C0 1.89543 0.895431 1 2 1H52C65.8071 1 77 12.1929 77 26V70C77 71.1046 76.1046 72 75 72H25C11.1929 72 0 60.8071 0 47V3Z" fill="white"/>
|
|
3
|
+
<path d="M65.1919 63.2747L15.4083 39.071C15.0202 38.8824 15.0202 38.3294 15.4083 38.1407L65.1919 13.937C65.5355 13.77 65.9353 14.0202 65.9353 14.4022V62.8096C65.9353 63.1916 65.5355 63.4418 65.1919 63.2747Z" fill="#2B8A3E" fill-opacity="0.6"/>
|
|
4
|
+
<path d="M66.0664 61.4761C66.0658 61.4758 66.0652 61.4755 66.0646 61.4752L66.0664 61.4761ZM16.2828 39.9394C16.2835 39.939 16.2842 39.9387 16.2849 39.9383L16.2828 39.9394ZM16.2849 37.2734C16.2842 37.273 16.2835 37.2727 16.2828 37.2724L16.2849 37.2734ZM64.3174 65.0734L14.5338 40.8697C12.645 39.9514 12.645 37.2603 14.5338 36.342L64.3174 12.1383C65.9894 11.3254 67.9353 12.5431 67.9353 14.4022V62.8096C67.9353 64.6686 65.9894 65.8863 64.3174 65.0734Z" stroke="#2B8A3E" stroke-opacity="0.8" stroke-width="4"/>
|
|
5
|
+
<path d="M10.6787 59.0326L60.4624 34.8289C60.8505 34.6402 60.8505 34.0872 60.4624 33.8985L10.6787 9.6948C10.3352 9.52777 9.93533 9.77798 9.93533 10.16V58.5674C9.93533 58.9494 10.3352 59.1996 10.6787 59.0326Z" fill="#1C7ED6" fill-opacity="0.6"/>
|
|
6
|
+
<path d="M9.80425 57.2339C9.80488 57.2336 9.8055 57.2333 9.80613 57.233L9.80425 57.2339ZM59.5858 33.0312C59.5865 33.0309 59.5872 33.0305 59.5879 33.0302L59.5858 33.0312ZM11.5532 60.8312L61.3369 36.6275C63.2257 35.7092 63.2256 33.0181 61.3369 32.0998L11.5532 7.89611C9.88129 7.08326 7.93533 8.30091 7.93533 10.16V58.5674C7.93533 60.4264 9.88129 61.6441 11.5532 60.8312Z" stroke="#1C7ED6" stroke-opacity="0.8" stroke-width="4"/>
|
|
7
|
+
</svg>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
--before-opacity: 1;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
body {
|
|
6
|
+
opacity: 1;
|
|
7
|
+
width: 101%;
|
|
8
|
+
height: 101%;
|
|
9
|
+
position: fixed;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
body::before {
|
|
13
|
+
content: "";
|
|
14
|
+
z-index: -1;
|
|
15
|
+
position: inherit;
|
|
16
|
+
left: inherit;
|
|
17
|
+
top: inherit;
|
|
18
|
+
width: inherit;
|
|
19
|
+
height: inherit;
|
|
20
|
+
background-image: url("/assets/bg_2_0_dark_L2.3a31edc0.png");
|
|
21
|
+
background-size: cover;
|
|
22
|
+
opacity: var(--before-opacity);
|
|
23
|
+
}
|