cyberia 2.8.885
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/.dockerignore +15 -0
- package/.env.development +45 -0
- package/.env.production +50 -0
- package/.env.test +45 -0
- package/.github/workflows/engine-cyberia.cd.yml +31 -0
- package/.github/workflows/engine-cyberia.ci.yml +60 -0
- package/.github/workflows/ghpkg.ci.yml +87 -0
- package/.github/workflows/npmpkg.ci.yml +72 -0
- package/.github/workflows/publish.ci.yml +84 -0
- package/.github/workflows/publish.cyberia.ci.yml +84 -0
- package/.github/workflows/pwa-microservices-template-page.cd.yml +72 -0
- package/.github/workflows/pwa-microservices-template-test.ci.yml +33 -0
- package/.github/workflows/release.cd.yml +37 -0
- package/.nycrc +9 -0
- package/.prettierignore +13 -0
- package/.prettierrc +9 -0
- package/.vscode/extensions.json +51 -0
- package/.vscode/settings.json +87 -0
- package/AUTHORS.md +21 -0
- package/CHANGELOG.md +205 -0
- package/Dockerfile +28 -0
- package/LICENSE +21 -0
- package/README.md +85 -0
- package/bin/build.js +209 -0
- package/bin/cron.js +47 -0
- package/bin/cyberia.js +145 -0
- package/bin/db.js +199 -0
- package/bin/deploy.js +1293 -0
- package/bin/file.js +197 -0
- package/bin/hwt.js +49 -0
- package/bin/index.js +145 -0
- package/bin/ssl.js +63 -0
- package/bin/util.js +80 -0
- package/bin/vs.js +74 -0
- package/cli.md +714 -0
- package/conf.js +204 -0
- package/deployment.yaml +138 -0
- package/jsconfig.json +7 -0
- package/jsdoc.json +32 -0
- package/manifests/deployment/adminer/deployment.yaml +32 -0
- package/manifests/deployment/adminer/kustomization.yaml +7 -0
- package/manifests/deployment/adminer/service.yaml +13 -0
- package/manifests/deployment/dd-default-development/deployment.yaml +167 -0
- package/manifests/deployment/dd-default-development/proxy.yaml +46 -0
- package/manifests/deployment/dd-test-development/deployment.yaml +174 -0
- package/manifests/deployment/dd-test-development/proxy.yaml +51 -0
- package/manifests/deployment/fastapi/backend-deployment.yml +120 -0
- package/manifests/deployment/fastapi/backend-service.yml +19 -0
- package/manifests/deployment/fastapi/frontend-deployment.yml +54 -0
- package/manifests/deployment/fastapi/frontend-service.yml +15 -0
- package/manifests/deployment/fastapi/initial_data.sh +56 -0
- package/manifests/deployment/kafka/deployment.yaml +69 -0
- package/manifests/deployment/mongo-express/deployment.yaml +60 -0
- package/manifests/deployment/phpmyadmin/deployment.yaml +54 -0
- package/manifests/deployment/spark/spark-pi-py.yaml +21 -0
- package/manifests/deployment/tensorflow/tf-gpu-test.yaml +65 -0
- package/manifests/envoy-service-nodeport.yaml +23 -0
- package/manifests/grafana/deployment.yaml +57 -0
- package/manifests/grafana/kustomization.yaml +7 -0
- package/manifests/grafana/pvc.yaml +12 -0
- package/manifests/grafana/service.yaml +14 -0
- package/manifests/kind-config-dev.yaml +12 -0
- package/manifests/kind-config.yaml +12 -0
- package/manifests/kubeadm-calico-config.yaml +119 -0
- package/manifests/kubelet-config.yaml +65 -0
- package/manifests/letsencrypt-prod.yaml +15 -0
- package/manifests/lxd/lxd-admin-profile.yaml +17 -0
- package/manifests/lxd/lxd-preseed.yaml +30 -0
- package/manifests/lxd/underpost-setup.sh +163 -0
- package/manifests/mariadb/config.yaml +10 -0
- package/manifests/mariadb/kustomization.yaml +9 -0
- package/manifests/mariadb/pv.yaml +12 -0
- package/manifests/mariadb/pvc.yaml +10 -0
- package/manifests/mariadb/secret.yaml +8 -0
- package/manifests/mariadb/service.yaml +10 -0
- package/manifests/mariadb/statefulset.yaml +56 -0
- package/manifests/mariadb/storage-class.yaml +10 -0
- package/manifests/mongodb/backup-access.yaml +16 -0
- package/manifests/mongodb/backup-cronjob.yaml +42 -0
- package/manifests/mongodb/backup-pv-pvc.yaml +22 -0
- package/manifests/mongodb/configmap.yaml +26 -0
- package/manifests/mongodb/headless-service.yaml +10 -0
- package/manifests/mongodb/kustomization.yaml +11 -0
- package/manifests/mongodb/pv-pvc.yaml +23 -0
- package/manifests/mongodb/statefulset.yaml +126 -0
- package/manifests/mongodb/storage-class.yaml +9 -0
- package/manifests/mongodb-4.4/kustomization.yaml +7 -0
- package/manifests/mongodb-4.4/pv-pvc.yaml +23 -0
- package/manifests/mongodb-4.4/service-deployment.yaml +63 -0
- package/manifests/mysql/kustomization.yaml +7 -0
- package/manifests/mysql/pv-pvc.yaml +27 -0
- package/manifests/mysql/statefulset.yaml +55 -0
- package/manifests/postgresql/configmap.yaml +9 -0
- package/manifests/postgresql/kustomization.yaml +10 -0
- package/manifests/postgresql/pv.yaml +15 -0
- package/manifests/postgresql/pvc.yaml +13 -0
- package/manifests/postgresql/service.yaml +10 -0
- package/manifests/postgresql/statefulset.yaml +37 -0
- package/manifests/prometheus/deployment.yaml +82 -0
- package/manifests/valkey/kustomization.yaml +7 -0
- package/manifests/valkey/service.yaml +11 -0
- package/manifests/valkey/statefulset.yaml +38 -0
- package/nodemon.json +6 -0
- package/package.json +118 -0
- package/proxy.yaml +35 -0
- package/scripts/device-scan.sh +43 -0
- package/scripts/gpu-diag.sh +19 -0
- package/scripts/maas-setup.sh +120 -0
- package/scripts/nat-iptables.sh +26 -0
- package/scripts/nvim.sh +91 -0
- package/scripts/snap-clean.sh +26 -0
- package/scripts/ssh-cluster-info.sh +14 -0
- package/scripts/ssl.sh +164 -0
- package/src/api/blockchain/blockchain.controller.js +51 -0
- package/src/api/blockchain/blockchain.model.js +90 -0
- package/src/api/blockchain/blockchain.router.js +21 -0
- package/src/api/blockchain/blockchain.service.js +24 -0
- package/src/api/core/core.controller.js +69 -0
- package/src/api/core/core.model.js +11 -0
- package/src/api/core/core.router.js +24 -0
- package/src/api/core/core.service.js +35 -0
- package/src/api/crypto/crypto.controller.js +51 -0
- package/src/api/crypto/crypto.model.js +23 -0
- package/src/api/crypto/crypto.router.js +20 -0
- package/src/api/crypto/crypto.service.js +64 -0
- package/src/api/default/default.controller.js +74 -0
- package/src/api/default/default.model.js +20 -0
- package/src/api/default/default.router.js +27 -0
- package/src/api/default/default.service.js +40 -0
- package/src/api/document/document.controller.js +66 -0
- package/src/api/document/document.model.js +51 -0
- package/src/api/document/document.router.js +24 -0
- package/src/api/document/document.service.js +133 -0
- package/src/api/file/file.controller.js +67 -0
- package/src/api/file/file.model.js +19 -0
- package/src/api/file/file.router.js +22 -0
- package/src/api/file/file.service.js +100 -0
- package/src/api/instance/instance.controller.js +69 -0
- package/src/api/instance/instance.model.js +40 -0
- package/src/api/instance/instance.router.js +34 -0
- package/src/api/instance/instance.service.js +70 -0
- package/src/api/ipfs/ipfs.controller.js +51 -0
- package/src/api/ipfs/ipfs.model.js +17 -0
- package/src/api/ipfs/ipfs.router.js +20 -0
- package/src/api/ipfs/ipfs.service.js +25 -0
- package/src/api/object-layer/README.md +85 -0
- package/src/api/object-layer/object-layer.controller.js +69 -0
- package/src/api/object-layer/object-layer.model.js +181 -0
- package/src/api/object-layer/object-layer.router.js +29 -0
- package/src/api/object-layer/object-layer.service.js +49 -0
- package/src/api/test/test.controller.js +59 -0
- package/src/api/test/test.model.js +14 -0
- package/src/api/test/test.router.js +21 -0
- package/src/api/test/test.service.js +35 -0
- package/src/api/user/postman_collection.json +216 -0
- package/src/api/user/user.build.js +16 -0
- package/src/api/user/user.controller.js +35 -0
- package/src/api/user/user.model.js +100 -0
- package/src/api/user/user.router.js +400 -0
- package/src/api/user/user.service.js +500 -0
- package/src/api.js +23 -0
- package/src/cli/baremetal.js +1310 -0
- package/src/cli/cloud-init.js +548 -0
- package/src/cli/cluster.js +834 -0
- package/src/cli/cron.js +95 -0
- package/src/cli/db.js +414 -0
- package/src/cli/deploy.js +661 -0
- package/src/cli/env.js +101 -0
- package/src/cli/fs.js +256 -0
- package/src/cli/image.js +156 -0
- package/src/cli/index.js +436 -0
- package/src/cli/lxd.js +402 -0
- package/src/cli/monitor.js +260 -0
- package/src/cli/repository.js +274 -0
- package/src/cli/run.js +728 -0
- package/src/cli/script.js +85 -0
- package/src/cli/secrets.js +71 -0
- package/src/cli/ssh.js +46 -0
- package/src/cli/test.js +159 -0
- package/src/client/Cyberia.index.js +50 -0
- package/src/client/CyberiaAdmin.index.js +34 -0
- package/src/client/CyberiaPortal.index.js +36 -0
- package/src/client/Default.index.js +84 -0
- package/src/client/components/core/404.js +20 -0
- package/src/client/components/core/500.js +20 -0
- package/src/client/components/core/Account.js +326 -0
- package/src/client/components/core/AgGrid.js +191 -0
- package/src/client/components/core/Alert.js +77 -0
- package/src/client/components/core/Auth.js +342 -0
- package/src/client/components/core/Badge.js +32 -0
- package/src/client/components/core/Blockchain.js +41 -0
- package/src/client/components/core/Blog.js +9 -0
- package/src/client/components/core/BtnIcon.js +111 -0
- package/src/client/components/core/CalendarCore.js +464 -0
- package/src/client/components/core/Chat.js +64 -0
- package/src/client/components/core/ColorPalette.js +5267 -0
- package/src/client/components/core/CommonJs.js +1010 -0
- package/src/client/components/core/Content.js +196 -0
- package/src/client/components/core/Css.js +1099 -0
- package/src/client/components/core/CssCore.js +882 -0
- package/src/client/components/core/D3Chart.js +44 -0
- package/src/client/components/core/Docs.js +376 -0
- package/src/client/components/core/DropDown.js +223 -0
- package/src/client/components/core/EventsUI.js +133 -0
- package/src/client/components/core/FileExplorer.js +707 -0
- package/src/client/components/core/FullScreen.js +36 -0
- package/src/client/components/core/Input.js +383 -0
- package/src/client/components/core/JoyStick.js +80 -0
- package/src/client/components/core/Keyboard.js +73 -0
- package/src/client/components/core/LoadingAnimation.js +159 -0
- package/src/client/components/core/LogIn.js +190 -0
- package/src/client/components/core/LogOut.js +63 -0
- package/src/client/components/core/Logger.js +29 -0
- package/src/client/components/core/Modal.js +2494 -0
- package/src/client/components/core/NotificationManager.js +84 -0
- package/src/client/components/core/ObjectLayerEngine.js +1229 -0
- package/src/client/components/core/ObjectLayerEngineModal.js +443 -0
- package/src/client/components/core/Pagination.js +207 -0
- package/src/client/components/core/Panel.js +772 -0
- package/src/client/components/core/PanelForm.js +627 -0
- package/src/client/components/core/Polyhedron.js +162 -0
- package/src/client/components/core/Recover.js +207 -0
- package/src/client/components/core/Responsive.js +82 -0
- package/src/client/components/core/RichText.js +43 -0
- package/src/client/components/core/Router.js +317 -0
- package/src/client/components/core/Scroll.js +76 -0
- package/src/client/components/core/SignUp.js +125 -0
- package/src/client/components/core/SocketIo.js +74 -0
- package/src/client/components/core/Stream.js +113 -0
- package/src/client/components/core/ToggleSwitch.js +101 -0
- package/src/client/components/core/ToolTip.js +90 -0
- package/src/client/components/core/Translate.js +522 -0
- package/src/client/components/core/Validator.js +115 -0
- package/src/client/components/core/VanillaJs.js +423 -0
- package/src/client/components/core/Wallet.js +106 -0
- package/src/client/components/core/WebComponent.js +44 -0
- package/src/client/components/core/Webhook.js +25 -0
- package/src/client/components/core/Worker.js +371 -0
- package/src/client/components/core/windowGetDimensions.js +269 -0
- package/src/client/components/cyberia/BagCyberia.js +1253 -0
- package/src/client/components/cyberia/BiomeCyberia.js +130 -0
- package/src/client/components/cyberia/CharacterCyberia.js +321 -0
- package/src/client/components/cyberia/CommonCyberia.js +1834 -0
- package/src/client/components/cyberia/CssCyberia.js +816 -0
- package/src/client/components/cyberia/ElementPreviewCyberia.js +183 -0
- package/src/client/components/cyberia/ElementsCyberia.js +146 -0
- package/src/client/components/cyberia/InteractionPanelCyberia.js +1043 -0
- package/src/client/components/cyberia/JoyStickCyberia.js +53 -0
- package/src/client/components/cyberia/LogInCyberia.js +68 -0
- package/src/client/components/cyberia/LogOutCyberia.js +24 -0
- package/src/client/components/cyberia/MainUserCyberia.js +424 -0
- package/src/client/components/cyberia/MapCyberia.js +160 -0
- package/src/client/components/cyberia/MatrixCyberia.js +147 -0
- package/src/client/components/cyberia/MenuCyberia.js +575 -0
- package/src/client/components/cyberia/PixiCyberia.js +1639 -0
- package/src/client/components/cyberia/PointAndClickMovementCyberia.js +146 -0
- package/src/client/components/cyberia/QuestCyberia.js +1420 -0
- package/src/client/components/cyberia/RoutesCyberia.js +47 -0
- package/src/client/components/cyberia/SettingsCyberia.js +16 -0
- package/src/client/components/cyberia/SignUpCyberia.js +14 -0
- package/src/client/components/cyberia/SkillCyberia.js +124 -0
- package/src/client/components/cyberia/SocketIoCyberia.js +211 -0
- package/src/client/components/cyberia/TileCyberia.js +685 -0
- package/src/client/components/cyberia/TranslateCyberia.js +96 -0
- package/src/client/components/cyberia/UniverseCyberia.js +14 -0
- package/src/client/components/cyberia/WebhookCyberia.js +13 -0
- package/src/client/components/cyberia/WikiCyberia.js +144 -0
- package/src/client/components/cyberia/WorldCyberia.js +680 -0
- package/src/client/components/cyberia-admin/BiomeCyberiaAdmin.js +978 -0
- package/src/client/components/cyberia-admin/CommonCyberiaAdmin.js +29 -0
- package/src/client/components/cyberia-admin/CssCyberiaAdmin.js +15 -0
- package/src/client/components/cyberia-admin/ElementsCyberiaAdmin.js +38 -0
- package/src/client/components/cyberia-admin/InstanceEngineCyberiaAdmin.js +180 -0
- package/src/client/components/cyberia-admin/LogInCyberiaAdmin.js +34 -0
- package/src/client/components/cyberia-admin/LogOutCyberiaAdmin.js +24 -0
- package/src/client/components/cyberia-admin/MenuCyberiaAdmin.js +660 -0
- package/src/client/components/cyberia-admin/RoutesCyberiaAdmin.js +57 -0
- package/src/client/components/cyberia-admin/ServerCyberiaAdmin.js +129 -0
- package/src/client/components/cyberia-admin/SettingsCyberiaAdmin.js +16 -0
- package/src/client/components/cyberia-admin/SignUpCyberiaAdmin.js +11 -0
- package/src/client/components/cyberia-admin/SocketIoCyberiaAdmin.js +53 -0
- package/src/client/components/cyberia-admin/TranslateCyberiaAdmin.js +7 -0
- package/src/client/components/cyberia-biome/CityCyberiaBiome.js +209 -0
- package/src/client/components/cyberia-biome/CityInteriorCyberiaBiome.js +253 -0
- package/src/client/components/cyberia-biome/ColorChaosCyberiaBiome.js +26 -0
- package/src/client/components/cyberia-biome/ForestCyberiaBiome.js +191 -0
- package/src/client/components/cyberia-biome/GridBaseCyberiaBiome.js +364 -0
- package/src/client/components/cyberia-biome/SeedCityCyberiaBiome.js +347 -0
- package/src/client/components/cyberia-biome/ShopCyberiaBiome.js +12 -0
- package/src/client/components/cyberia-biome/SpaceCyberiaBiome.js +58 -0
- package/src/client/components/cyberia-portal/CommonCyberiaPortal.js +29 -0
- package/src/client/components/cyberia-portal/CssCyberiaPortal.js +132 -0
- package/src/client/components/cyberia-portal/ElementsCyberiaPortal.js +38 -0
- package/src/client/components/cyberia-portal/LogInCyberiaPortal.js +18 -0
- package/src/client/components/cyberia-portal/LogOutCyberiaPortal.js +12 -0
- package/src/client/components/cyberia-portal/MenuCyberiaPortal.js +487 -0
- package/src/client/components/cyberia-portal/RoutesCyberiaPortal.js +45 -0
- package/src/client/components/cyberia-portal/ServerCyberiaPortal.js +136 -0
- package/src/client/components/cyberia-portal/SettingsCyberiaPortal.js +16 -0
- package/src/client/components/cyberia-portal/SignUpCyberiaPortal.js +11 -0
- package/src/client/components/cyberia-portal/SocketIoCyberiaPortal.js +52 -0
- package/src/client/components/cyberia-portal/TranslateCyberiaPortal.js +12 -0
- package/src/client/components/default/CommonDefault.js +29 -0
- package/src/client/components/default/CssDefault.js +27 -0
- package/src/client/components/default/ElementsDefault.js +38 -0
- package/src/client/components/default/LogInDefault.js +14 -0
- package/src/client/components/default/LogOutDefault.js +10 -0
- package/src/client/components/default/MenuDefault.js +743 -0
- package/src/client/components/default/RoutesDefault.js +48 -0
- package/src/client/components/default/SettingsDefault.js +16 -0
- package/src/client/components/default/SignUpDefault.js +9 -0
- package/src/client/components/default/SocketIoDefault.js +54 -0
- package/src/client/components/default/TranslateDefault.js +7 -0
- package/src/client/public/default/android-chrome-144x144.png +0 -0
- package/src/client/public/default/android-chrome-192x192.png +0 -0
- package/src/client/public/default/android-chrome-256x256.png +0 -0
- package/src/client/public/default/android-chrome-36x36.png +0 -0
- package/src/client/public/default/android-chrome-384x384.png +0 -0
- package/src/client/public/default/android-chrome-48x48.png +0 -0
- package/src/client/public/default/android-chrome-512x512.png +0 -0
- package/src/client/public/default/android-chrome-72x72.png +0 -0
- package/src/client/public/default/android-chrome-96x96.png +0 -0
- package/src/client/public/default/apple-touch-icon-1024x1024.png +0 -0
- package/src/client/public/default/apple-touch-icon-114x114-precomposed.png +0 -0
- package/src/client/public/default/apple-touch-icon-114x114.png +0 -0
- package/src/client/public/default/apple-touch-icon-120x120-precomposed.png +0 -0
- package/src/client/public/default/apple-touch-icon-120x120.png +0 -0
- package/src/client/public/default/apple-touch-icon-144x144-precomposed.png +0 -0
- package/src/client/public/default/apple-touch-icon-144x144.png +0 -0
- package/src/client/public/default/apple-touch-icon-152x152-precomposed.png +0 -0
- package/src/client/public/default/apple-touch-icon-152x152.png +0 -0
- package/src/client/public/default/apple-touch-icon-167x167.png +0 -0
- package/src/client/public/default/apple-touch-icon-180x180-precomposed.png +0 -0
- package/src/client/public/default/apple-touch-icon-180x180.png +0 -0
- package/src/client/public/default/apple-touch-icon-57x57-precomposed.png +0 -0
- package/src/client/public/default/apple-touch-icon-57x57.png +0 -0
- package/src/client/public/default/apple-touch-icon-60x60-precomposed.png +0 -0
- package/src/client/public/default/apple-touch-icon-60x60.png +0 -0
- package/src/client/public/default/apple-touch-icon-72x72-precomposed.png +0 -0
- package/src/client/public/default/apple-touch-icon-72x72.png +0 -0
- package/src/client/public/default/apple-touch-icon-76x76-precomposed.png +0 -0
- package/src/client/public/default/apple-touch-icon-76x76.png +0 -0
- package/src/client/public/default/apple-touch-icon-precomposed.png +0 -0
- package/src/client/public/default/apple-touch-icon.png +0 -0
- package/src/client/public/default/apple-touch-startup-image-1125x2436.png +0 -0
- package/src/client/public/default/apple-touch-startup-image-1136x640.png +0 -0
- package/src/client/public/default/apple-touch-startup-image-1170x2532.png +0 -0
- package/src/client/public/default/apple-touch-startup-image-1179x2556.png +0 -0
- package/src/client/public/default/apple-touch-startup-image-1242x2208.png +0 -0
- package/src/client/public/default/apple-touch-startup-image-1242x2688.png +0 -0
- package/src/client/public/default/apple-touch-startup-image-1284x2778.png +0 -0
- package/src/client/public/default/apple-touch-startup-image-1290x2796.png +0 -0
- package/src/client/public/default/apple-touch-startup-image-1334x750.png +0 -0
- package/src/client/public/default/apple-touch-startup-image-1488x2266.png +0 -0
- package/src/client/public/default/apple-touch-startup-image-1536x2048.png +0 -0
- package/src/client/public/default/apple-touch-startup-image-1620x2160.png +0 -0
- package/src/client/public/default/apple-touch-startup-image-1640x2160.png +0 -0
- package/src/client/public/default/apple-touch-startup-image-1668x2224.png +0 -0
- package/src/client/public/default/apple-touch-startup-image-1668x2388.png +0 -0
- package/src/client/public/default/apple-touch-startup-image-1792x828.png +0 -0
- package/src/client/public/default/apple-touch-startup-image-2048x1536.png +0 -0
- package/src/client/public/default/apple-touch-startup-image-2048x2732.png +0 -0
- package/src/client/public/default/apple-touch-startup-image-2160x1620.png +0 -0
- package/src/client/public/default/apple-touch-startup-image-2160x1640.png +0 -0
- package/src/client/public/default/apple-touch-startup-image-2208x1242.png +0 -0
- package/src/client/public/default/apple-touch-startup-image-2224x1668.png +0 -0
- package/src/client/public/default/apple-touch-startup-image-2266x1488.png +0 -0
- package/src/client/public/default/apple-touch-startup-image-2388x1668.png +0 -0
- package/src/client/public/default/apple-touch-startup-image-2436x1125.png +0 -0
- package/src/client/public/default/apple-touch-startup-image-2532x1170.png +0 -0
- package/src/client/public/default/apple-touch-startup-image-2556x1179.png +0 -0
- package/src/client/public/default/apple-touch-startup-image-2688x1242.png +0 -0
- package/src/client/public/default/apple-touch-startup-image-2732x2048.png +0 -0
- package/src/client/public/default/apple-touch-startup-image-2778x1284.png +0 -0
- package/src/client/public/default/apple-touch-startup-image-2796x1290.png +0 -0
- package/src/client/public/default/apple-touch-startup-image-640x1136.png +0 -0
- package/src/client/public/default/apple-touch-startup-image-750x1334.png +0 -0
- package/src/client/public/default/apple-touch-startup-image-828x1792.png +0 -0
- package/src/client/public/default/assets/background/dark.jpg +0 -0
- package/src/client/public/default/assets/background/dark.svg +557 -0
- package/src/client/public/default/assets/background/white.jpg +0 -0
- package/src/client/public/default/assets/background/white0-min.jpg +0 -0
- package/src/client/public/default/assets/background/white0.jpg +0 -0
- package/src/client/public/default/assets/logo/base-icon.png +0 -0
- package/src/client/public/default/assets/logo/underpost.gif +0 -0
- package/src/client/public/default/assets/mailer/api-user-check.png +0 -0
- package/src/client/public/default/assets/mailer/api-user-default-avatar.png +0 -0
- package/src/client/public/default/assets/mailer/api-user-invalid-token.png +0 -0
- package/src/client/public/default/assets/mailer/api-user-recover.png +0 -0
- package/src/client/public/default/browserconfig.xml +12 -0
- package/src/client/public/default/favicon-16x16.png +0 -0
- package/src/client/public/default/favicon-32x32.png +0 -0
- package/src/client/public/default/favicon-48x48.png +0 -0
- package/src/client/public/default/favicon.ico +0 -0
- package/src/client/public/default/manifest.webmanifest +69 -0
- package/src/client/public/default/mstile-144x144.png +0 -0
- package/src/client/public/default/mstile-150x150.png +0 -0
- package/src/client/public/default/mstile-310x150.png +0 -0
- package/src/client/public/default/mstile-310x310.png +0 -0
- package/src/client/public/default/mstile-70x70.png +0 -0
- package/src/client/public/default/plantuml/client-conf.svg +1 -0
- package/src/client/public/default/plantuml/client-schema.svg +1 -0
- package/src/client/public/default/plantuml/cron-conf.svg +1 -0
- package/src/client/public/default/plantuml/cron-schema.svg +1 -0
- package/src/client/public/default/plantuml/server-conf.svg +1 -0
- package/src/client/public/default/plantuml/server-schema.svg +1 -0
- package/src/client/public/default/plantuml/ssr-conf.svg +1 -0
- package/src/client/public/default/plantuml/ssr-schema.svg +1 -0
- package/src/client/public/default/safari-pinned-tab.svg +24 -0
- package/src/client/public/default/site.webmanifest +69 -0
- package/src/client/public/default/sitemap +148 -0
- package/src/client/public/default/yandex-browser-50x50.png +0 -0
- package/src/client/public/default/yandex-browser-manifest.json +9 -0
- package/src/client/public/doc/favicon.ico +0 -0
- package/src/client/public/doc/sitemap +148 -0
- package/src/client/public/test/favicon.ico +0 -0
- package/src/client/public/test/sitemap +148 -0
- package/src/client/services/blockchain/blockchain.service.js +73 -0
- package/src/client/services/core/core.service.js +165 -0
- package/src/client/services/crypto/crypto.service.js +73 -0
- package/src/client/services/default/default.management.js +450 -0
- package/src/client/services/default/default.service.js +98 -0
- package/src/client/services/document/document.service.js +97 -0
- package/src/client/services/file/file.service.js +72 -0
- package/src/client/services/instance/instance.management.js +78 -0
- package/src/client/services/instance/instance.service.js +97 -0
- package/src/client/services/ipfs/ipfs.service.js +73 -0
- package/src/client/services/object-layer/object-layer.service.js +93 -0
- package/src/client/services/test/test.service.js +73 -0
- package/src/client/services/user/user.management.js +56 -0
- package/src/client/services/user/user.service.js +108 -0
- package/src/client/ssr/Render.js +237 -0
- package/src/client/ssr/body/404.js +73 -0
- package/src/client/ssr/body/500.js +72 -0
- package/src/client/ssr/body/CacheControl.js +114 -0
- package/src/client/ssr/body/CyberiaDefaultSplashScreen.js +90 -0
- package/src/client/ssr/body/CyberiaSplashScreenLore.js +424 -0
- package/src/client/ssr/body/DefaultSplashScreen.js +90 -0
- package/src/client/ssr/email/DefaultRecoverEmail.js +21 -0
- package/src/client/ssr/email/DefaultVerifyEmail.js +17 -0
- package/src/client/ssr/head/Css.js +241 -0
- package/src/client/ssr/head/CyberiaAdminScripts.js +6 -0
- package/src/client/ssr/head/CyberiaPortalScripts.js +6 -0
- package/src/client/ssr/head/CyberiaScripts.js +6 -0
- package/src/client/ssr/head/DefaultScripts.js +6 -0
- package/src/client/ssr/head/Microdata.js +11 -0
- package/src/client/ssr/head/Production.js +1 -0
- package/src/client/ssr/head/Pwa.js +146 -0
- package/src/client/ssr/head/Seo.js +15 -0
- package/src/client/ssr/mailer/DefaultRecoverEmail.js +21 -0
- package/src/client/ssr/mailer/DefaultVerifyEmail.js +17 -0
- package/src/client/ssr/offline/Maintenance.js +63 -0
- package/src/client/ssr/offline/NoNetworkConnection.js +67 -0
- package/src/client/ssr/pages/404.js +12 -0
- package/src/client/ssr/pages/500.js +12 -0
- package/src/client/ssr/pages/Test.js +198 -0
- package/src/client/ssr/pages/maintenance.js +14 -0
- package/src/client/ssr/pages/offline.js +21 -0
- package/src/client/sw/default.sw.js +108 -0
- package/src/client/sw/template.sw.js +84 -0
- package/src/client.build.js +22 -0
- package/src/client.dev.js +24 -0
- package/src/db/DataBaseProvider.js +98 -0
- package/src/db/mariadb/MariaDB.js +66 -0
- package/src/db/mongo/MongooseDB.js +70 -0
- package/src/index.js +198 -0
- package/src/mailer/EmailRender.js +116 -0
- package/src/mailer/MailerProvider.js +213 -0
- package/src/monitor.js +24 -0
- package/src/proxy.js +22 -0
- package/src/runtime/express/Express.js +256 -0
- package/src/runtime/lampp/Dockerfile +50 -0
- package/src/runtime/lampp/Lampp.js +343 -0
- package/src/server/auth.js +689 -0
- package/src/server/backup.js +96 -0
- package/src/server/client-build-docs.js +205 -0
- package/src/server/client-build-live.js +109 -0
- package/src/server/client-build.js +690 -0
- package/src/server/client-dev-server.js +87 -0
- package/src/server/client-formatted.js +87 -0
- package/src/server/client-icons.js +108 -0
- package/src/server/conf.js +1071 -0
- package/src/server/crypto.js +210 -0
- package/src/server/dns.js +276 -0
- package/src/server/downloader.js +74 -0
- package/src/server/json-schema.js +77 -0
- package/src/server/logger.js +197 -0
- package/src/server/network.js +72 -0
- package/src/server/object-layer.js +294 -0
- package/src/server/peer.js +69 -0
- package/src/server/process.js +171 -0
- package/src/server/proxy.js +110 -0
- package/src/server/runtime.js +170 -0
- package/src/server/ssr.js +127 -0
- package/src/server/start.js +161 -0
- package/src/server/tls.js +251 -0
- package/src/server/valkey.js +293 -0
- package/src/server.js +25 -0
- package/src/ws/IoInterface.js +139 -0
- package/src/ws/IoServer.js +88 -0
- package/src/ws/core/channels/core.ws.chat.js +23 -0
- package/src/ws/core/channels/core.ws.mailer.js +35 -0
- package/src/ws/core/channels/core.ws.stream.js +31 -0
- package/src/ws/core/core.ws.connection.js +62 -0
- package/src/ws/core/core.ws.emit.js +53 -0
- package/src/ws/core/core.ws.server.js +76 -0
- package/src/ws/core/management/core.ws.chat.js +8 -0
- package/src/ws/core/management/core.ws.mailer.js +16 -0
- package/src/ws/core/management/core.ws.stream.js +8 -0
- package/src/ws/cyberia/channels/cyberia.ws.bot.js +56 -0
- package/src/ws/cyberia/channels/cyberia.ws.skill.js +51 -0
- package/src/ws/cyberia/channels/cyberia.ws.user.js +437 -0
- package/src/ws/cyberia/cyberia.ws.connection.js +36 -0
- package/src/ws/cyberia/cyberia.ws.emit.js +14 -0
- package/src/ws/cyberia/cyberia.ws.server.js +67 -0
- package/src/ws/cyberia/management/cyberia.ws.bot.js +669 -0
- package/src/ws/cyberia/management/cyberia.ws.skill.js +441 -0
- package/src/ws/cyberia/management/cyberia.ws.user.js +188 -0
- package/src/ws/default/channels/default.ws.main.js +16 -0
- package/src/ws/default/default.ws.connection.js +22 -0
- package/src/ws/default/default.ws.emit.js +14 -0
- package/src/ws/default/default.ws.server.js +20 -0
- package/src/ws/default/management/default.ws.main.js +8 -0
- package/test/api.test.js +53 -0
- package/test/crypto.test.js +117 -0
|
@@ -0,0 +1,326 @@
|
|
|
1
|
+
import { UserService } from '../../services/user/user.service.js';
|
|
2
|
+
import { Auth } from './Auth.js';
|
|
3
|
+
import { BtnIcon } from './BtnIcon.js';
|
|
4
|
+
import { newInstance, s4 } from './CommonJs.js';
|
|
5
|
+
import { renderStatus, renderWave } from './Css.js';
|
|
6
|
+
import { EventsUI } from './EventsUI.js';
|
|
7
|
+
import { fileFormDataFactory, Input } from './Input.js';
|
|
8
|
+
import { LogIn } from './LogIn.js';
|
|
9
|
+
import { Modal } from './Modal.js';
|
|
10
|
+
import { NotificationManager } from './NotificationManager.js';
|
|
11
|
+
import { Translate } from './Translate.js';
|
|
12
|
+
import { Validator } from './Validator.js';
|
|
13
|
+
import { append, htmls, s } from './VanillaJs.js';
|
|
14
|
+
import { getProxyPath } from './Router.js';
|
|
15
|
+
|
|
16
|
+
const Account = {
|
|
17
|
+
UpdateEvent: {},
|
|
18
|
+
Render: async function (options = { user: {}, bottomRender: async () => '', idModal: '' }) {
|
|
19
|
+
// app profile page design example
|
|
20
|
+
// CSS animated backgrounds
|
|
21
|
+
let { user, idModal } = options;
|
|
22
|
+
const waveAnimationId = 'account-wave';
|
|
23
|
+
const profileFileAccept = ['image/png', 'image/jpeg'];
|
|
24
|
+
setTimeout(async () => {
|
|
25
|
+
append(
|
|
26
|
+
`.wave-animation-container-${waveAnimationId}`,
|
|
27
|
+
html` <div class="abs center account-profile-image-container">
|
|
28
|
+
<img
|
|
29
|
+
class="abs center account-profile-image"
|
|
30
|
+
style="opacity: 1"
|
|
31
|
+
${LogIn.Scope.user.main.model.user.profileImage
|
|
32
|
+
? `src="${LogIn.Scope.user.main.model.user.profileImage.imageSrc}"`
|
|
33
|
+
: ''}
|
|
34
|
+
/>
|
|
35
|
+
</div>
|
|
36
|
+
<div class="abs center account-profile-image-loading" style="color: white"></div>`,
|
|
37
|
+
);
|
|
38
|
+
|
|
39
|
+
const formData = [
|
|
40
|
+
{
|
|
41
|
+
model: 'username',
|
|
42
|
+
id: `account-username`,
|
|
43
|
+
rules: [{ type: 'isEmpty' }, { type: 'isLength', options: { min: 2, max: 20 } }],
|
|
44
|
+
},
|
|
45
|
+
{ model: 'email', id: `account-email`, rules: [{ type: 'isEmpty' }, { type: 'isEmail' }] },
|
|
46
|
+
{
|
|
47
|
+
model: 'password',
|
|
48
|
+
defaultValue: '#Changethis123',
|
|
49
|
+
id: `account-password`,
|
|
50
|
+
rules: [{ type: 'isStrongPassword' }],
|
|
51
|
+
},
|
|
52
|
+
];
|
|
53
|
+
|
|
54
|
+
this.formData = formData;
|
|
55
|
+
|
|
56
|
+
this.instanceModalUiEvents = async ({ user }) => {
|
|
57
|
+
const validators = await Validator.instance(formData);
|
|
58
|
+
|
|
59
|
+
for (const inputData of formData) {
|
|
60
|
+
s(`.${inputData.id}`).value =
|
|
61
|
+
!user[inputData.model] && inputData.defaultValue ? inputData.defaultValue : user[inputData.model];
|
|
62
|
+
}
|
|
63
|
+
let lastUser;
|
|
64
|
+
const submit = async () => {
|
|
65
|
+
lastUser = newInstance(user);
|
|
66
|
+
const { successKeys } = await validators();
|
|
67
|
+
if (successKeys.length === 0) return;
|
|
68
|
+
const body = {};
|
|
69
|
+
for (const inputData of formData) {
|
|
70
|
+
if (!s(`.${inputData.id}`).value || s(`.${inputData.id}`).value === 'undefined') continue;
|
|
71
|
+
if ('model' in inputData && successKeys.includes(inputData.id)) {
|
|
72
|
+
body[inputData.model] = s(`.${inputData.id}`).value;
|
|
73
|
+
user[inputData.model] = s(`.${inputData.id}`).value;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
const result = await UserService.put({ id: user._id, body });
|
|
77
|
+
NotificationManager.Push({
|
|
78
|
+
html:
|
|
79
|
+
result.status === 'error' && result.message
|
|
80
|
+
? result.message
|
|
81
|
+
: Translate.Render(`${result.status}-update-user`),
|
|
82
|
+
status: result.status,
|
|
83
|
+
});
|
|
84
|
+
if (result.status === 'success') {
|
|
85
|
+
user = result.data;
|
|
86
|
+
this.triggerUpdateEvent({ user });
|
|
87
|
+
if (lastUser.emailConfirmed !== user.emailConfirmed) {
|
|
88
|
+
this.renderVerifyEmailStatus(user);
|
|
89
|
+
}
|
|
90
|
+
lastUser = newInstance(user);
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
EventsUI.onClick(`.btn-account`, async (e) => {
|
|
94
|
+
e.preventDefault();
|
|
95
|
+
await submit();
|
|
96
|
+
});
|
|
97
|
+
EventsUI.onClick(`.btn-account-update-username`, async (e) => {
|
|
98
|
+
e.preventDefault();
|
|
99
|
+
await submit();
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
if (s(`.btn-confirm-email`))
|
|
103
|
+
EventsUI.onClick(`.btn-confirm-email`, async (e) => {
|
|
104
|
+
e.preventDefault();
|
|
105
|
+
const result = await UserService.post({
|
|
106
|
+
id: 'mailer/verify-email',
|
|
107
|
+
body: {
|
|
108
|
+
email: s(`.account-email`).value,
|
|
109
|
+
hostname: `${location.hostname}`,
|
|
110
|
+
proxyPath: getProxyPath(),
|
|
111
|
+
},
|
|
112
|
+
});
|
|
113
|
+
NotificationManager.Push({
|
|
114
|
+
html: result.status === 'error' ? result.message : Translate.Render(`email send`),
|
|
115
|
+
status: result.status,
|
|
116
|
+
});
|
|
117
|
+
});
|
|
118
|
+
this.renderVerifyEmailStatus(user);
|
|
119
|
+
|
|
120
|
+
s(`.${waveAnimationId}`).style.cursor = 'pointer';
|
|
121
|
+
s(`.${waveAnimationId}`).onclick = async (e) => {
|
|
122
|
+
e.preventDefault();
|
|
123
|
+
s(`.account-profile-image-input`).click();
|
|
124
|
+
};
|
|
125
|
+
EventsUI.onChange(
|
|
126
|
+
`.account-profile-image-input`,
|
|
127
|
+
async (e) => {
|
|
128
|
+
e.preventDefault();
|
|
129
|
+
s(`.account-profile-image`).style.opacity = 0;
|
|
130
|
+
const formFile = fileFormDataFactory(e, profileFileAccept);
|
|
131
|
+
|
|
132
|
+
const { status, data } = await UserService.put({
|
|
133
|
+
id: `profile-image/${user._id}`,
|
|
134
|
+
body: formFile,
|
|
135
|
+
headerId: 'file',
|
|
136
|
+
});
|
|
137
|
+
|
|
138
|
+
if (status === 'success') {
|
|
139
|
+
user.profileImageId = data.profileImageId;
|
|
140
|
+
delete LogIn.Scope.user.main.model.user.profileImage;
|
|
141
|
+
await LogIn.Trigger({ user });
|
|
142
|
+
s(`.account-profile-image`).src = LogIn.Scope.user.main.model.user.profileImage.imageSrc;
|
|
143
|
+
} else {
|
|
144
|
+
NotificationManager.Push({
|
|
145
|
+
html: Translate.Render('file-upload-failed'),
|
|
146
|
+
status: 'error',
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
s(`.account-profile-image`).style.opacity = 1;
|
|
151
|
+
},
|
|
152
|
+
{ loadingContainer: `.account-profile-image-loading` },
|
|
153
|
+
);
|
|
154
|
+
s(`.btn-account-change-password`).onclick = (e) => {
|
|
155
|
+
e.preventDefault();
|
|
156
|
+
// s(`.btn-close-modal-account`).click();
|
|
157
|
+
s(`.main-btn-recover`).click();
|
|
158
|
+
};
|
|
159
|
+
EventsUI.onClick(
|
|
160
|
+
`.btn-account-delete-confirm`,
|
|
161
|
+
async (e) => {
|
|
162
|
+
e.preventDefault();
|
|
163
|
+
const confirmResult = await Modal.RenderConfirm({
|
|
164
|
+
html: async () => {
|
|
165
|
+
return html`
|
|
166
|
+
<div class="in section-mp" style="text-align: center">
|
|
167
|
+
${Translate.Render('confirm-delete-account')}
|
|
168
|
+
</div>
|
|
169
|
+
`;
|
|
170
|
+
},
|
|
171
|
+
id: 'delete-account-modal',
|
|
172
|
+
});
|
|
173
|
+
if (confirmResult.status === 'cancelled') return;
|
|
174
|
+
s(`.btn-account-delete-confirm`).classList.add('hide');
|
|
175
|
+
s(`.btn-account-delete`).classList.remove('hide');
|
|
176
|
+
s(`.btn-account-delete`).click();
|
|
177
|
+
},
|
|
178
|
+
{ context: 'modal' },
|
|
179
|
+
);
|
|
180
|
+
EventsUI.onClick(`.btn-account-delete`, async (e) => {
|
|
181
|
+
e.preventDefault();
|
|
182
|
+
const result = await UserService.delete({ id: user._id });
|
|
183
|
+
NotificationManager.Push({
|
|
184
|
+
html: result.status === 'error' ? result.message : Translate.Render(`success-delete-account`),
|
|
185
|
+
status: result.status,
|
|
186
|
+
});
|
|
187
|
+
s(`.btn-account-delete-confirm`).classList.remove('hide');
|
|
188
|
+
s(`.btn-account-delete`).classList.add('hide');
|
|
189
|
+
if (result.status === 'success') {
|
|
190
|
+
Modal.onHomeRouterEvent();
|
|
191
|
+
await Auth.sessionOut();
|
|
192
|
+
}
|
|
193
|
+
});
|
|
194
|
+
};
|
|
195
|
+
await this.instanceModalUiEvents({ user });
|
|
196
|
+
});
|
|
197
|
+
return html`
|
|
198
|
+
<label for="account-profile-image-input-label"
|
|
199
|
+
><span class="hide">Profile Image</span>
|
|
200
|
+
<input
|
|
201
|
+
type="file"
|
|
202
|
+
accept="${profileFileAccept.join(', ')}"
|
|
203
|
+
class="account-profile-image-input hide"
|
|
204
|
+
id="account-profile-image-input-label"
|
|
205
|
+
/></label>
|
|
206
|
+
${renderWave({ id: waveAnimationId })}
|
|
207
|
+
|
|
208
|
+
<form class="in">
|
|
209
|
+
<div class="in">
|
|
210
|
+
${await Input.Render({
|
|
211
|
+
id: `account-username`,
|
|
212
|
+
type: 'text',
|
|
213
|
+
label: html`<i class="fa-solid fa-pen-to-square"></i> ${Translate.Render('username')}`,
|
|
214
|
+
containerClass: 'inl section-mp width-mini-box input-container',
|
|
215
|
+
placeholder: true,
|
|
216
|
+
disabled: false,
|
|
217
|
+
extension: async () =>
|
|
218
|
+
html`${await BtnIcon.Render({
|
|
219
|
+
class: `in wfa btn-input-extension btn-account-update-username`,
|
|
220
|
+
type: 'button',
|
|
221
|
+
style: 'text-align: left',
|
|
222
|
+
label: html`${Translate.Render(`update`)}`,
|
|
223
|
+
})}`,
|
|
224
|
+
})}
|
|
225
|
+
</div>
|
|
226
|
+
<div class="in">
|
|
227
|
+
${await Input.Render({
|
|
228
|
+
id: `account-email`,
|
|
229
|
+
type: 'email',
|
|
230
|
+
label: html`<i class="fa-solid fa-envelope"></i> ${Translate.Render('email')}`,
|
|
231
|
+
containerClass: 'inl section-mp width-mini-box input-container',
|
|
232
|
+
placeholder: true,
|
|
233
|
+
autocomplete: 'email',
|
|
234
|
+
disabled: user.emailConfirmed,
|
|
235
|
+
extension: !(options && options.disabled && options.disabled.includes('emailConfirm'))
|
|
236
|
+
? async () => html`<div class="in verify-email-status"></div>
|
|
237
|
+
${await BtnIcon.Render({
|
|
238
|
+
class: `in wfa btn-input-extension btn-confirm-email`,
|
|
239
|
+
type: 'button',
|
|
240
|
+
style: 'text-align: left',
|
|
241
|
+
label: html`<div class="in">
|
|
242
|
+
<i class="fa-solid fa-paper-plane"></i> ${Translate.Render('send')}
|
|
243
|
+
${Translate.Render('verify-email')}
|
|
244
|
+
</div> `,
|
|
245
|
+
})}`
|
|
246
|
+
: undefined,
|
|
247
|
+
})}
|
|
248
|
+
</div>
|
|
249
|
+
<div class="in">
|
|
250
|
+
${await Input.Render({
|
|
251
|
+
id: `account-password`,
|
|
252
|
+
type: 'password',
|
|
253
|
+
autocomplete: 'new-password',
|
|
254
|
+
label: html`<i class="fa-solid fa-lock"></i> ${Translate.Render('password')}`,
|
|
255
|
+
containerClass: 'inl section-mp width-mini-box input-container',
|
|
256
|
+
placeholder: true,
|
|
257
|
+
disabled: true,
|
|
258
|
+
disabledEye: true,
|
|
259
|
+
extension: async () =>
|
|
260
|
+
html`${await BtnIcon.Render({
|
|
261
|
+
class: `in wfa btn-input-extension btn-account-change-password`,
|
|
262
|
+
type: 'button',
|
|
263
|
+
style: 'text-align: left',
|
|
264
|
+
label: html`${Translate.Render(`change-password`)}`,
|
|
265
|
+
})}`,
|
|
266
|
+
})}
|
|
267
|
+
</div>
|
|
268
|
+
${options?.bottomRender ? await options.bottomRender() : ``}
|
|
269
|
+
<div class="in hide">
|
|
270
|
+
${await BtnIcon.Render({
|
|
271
|
+
class: 'in section-mp form-button btn-account',
|
|
272
|
+
label: Translate.Render('update'),
|
|
273
|
+
type: 'submit',
|
|
274
|
+
})}
|
|
275
|
+
</div>
|
|
276
|
+
</form>
|
|
277
|
+
<div class="in">
|
|
278
|
+
${await BtnIcon.Render({
|
|
279
|
+
class: 'in section-mp form-button btn-account-delete hide',
|
|
280
|
+
label: html` ${Translate.Render(`delete-account`)}`,
|
|
281
|
+
type: 'button',
|
|
282
|
+
style: 'color: #5f5f5f',
|
|
283
|
+
})}
|
|
284
|
+
${await BtnIcon.Render({
|
|
285
|
+
class: 'in section-mp form-button btn-account-delete-confirm',
|
|
286
|
+
label: html` ${Translate.Render(`delete-account`)}`,
|
|
287
|
+
type: 'button',
|
|
288
|
+
style: 'color: #5f5f5f',
|
|
289
|
+
})}
|
|
290
|
+
</div>
|
|
291
|
+
`;
|
|
292
|
+
},
|
|
293
|
+
triggerUpdateEvent: async function (options = { user: {} }) {
|
|
294
|
+
for (const updateEvent of Object.keys(this.UpdateEvent)) {
|
|
295
|
+
await this.UpdateEvent[updateEvent](options);
|
|
296
|
+
}
|
|
297
|
+
},
|
|
298
|
+
renderVerifyEmailStatus: function (user) {
|
|
299
|
+
if (s('.verify-email-status')) {
|
|
300
|
+
if (s(`.btn-confirm-email`)) {
|
|
301
|
+
if (user.emailConfirmed) s(`.btn-confirm-email`).classList.add('hide');
|
|
302
|
+
else s(`.btn-confirm-email`).classList.remove('hide');
|
|
303
|
+
}
|
|
304
|
+
htmls(
|
|
305
|
+
'.verify-email-status',
|
|
306
|
+
html`${renderStatus(user.emailConfirmed ? 'success' : 'error', { class: 'inl' })} ${Translate.Render('email')}
|
|
307
|
+
${Translate.Render(user.emailConfirmed ? 'confirmed' : 'unconfirmed')}`,
|
|
308
|
+
);
|
|
309
|
+
if (user.emailConfirmed === true) s(`.account-email`).setAttribute('disabled', '');
|
|
310
|
+
}
|
|
311
|
+
},
|
|
312
|
+
instanceModalUiEvents: async (user) => null,
|
|
313
|
+
updateForm: async function (user) {
|
|
314
|
+
if (!s(`.modal-account`)) return;
|
|
315
|
+
await this.instanceModalUiEvents({ user });
|
|
316
|
+
s(`.account-profile-image`).style.opacity = 0;
|
|
317
|
+
for (const inputData of this.formData)
|
|
318
|
+
if (s(`.${inputData.id}`)) s(`.${inputData.id}`).value = user[inputData.model];
|
|
319
|
+
if (LogIn.Scope.user.main.model.user.profileImage) {
|
|
320
|
+
s(`.account-profile-image`).src = LogIn.Scope.user.main.model.user.profileImage.imageSrc;
|
|
321
|
+
s(`.account-profile-image`).style.opacity = 1;
|
|
322
|
+
}
|
|
323
|
+
},
|
|
324
|
+
};
|
|
325
|
+
|
|
326
|
+
export { Account };
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
// https://www.ag-grid.com/javascript-data-grid/getting-started/
|
|
2
|
+
// https://www.ag-grid.com/javascript-data-grid/themes/
|
|
3
|
+
|
|
4
|
+
import { ThemeEvents, darkTheme } from './Css.js';
|
|
5
|
+
import { append, htmls, s } from './VanillaJs.js';
|
|
6
|
+
import { getProxyPath } from './Router.js';
|
|
7
|
+
import './Pagination.js';
|
|
8
|
+
import { Modal } from './Modal.js';
|
|
9
|
+
|
|
10
|
+
const AgGrid = {
|
|
11
|
+
grids: {},
|
|
12
|
+
theme: `ag-theme-alpine`, // quartz
|
|
13
|
+
Render: async function (options) {
|
|
14
|
+
let { id } = options;
|
|
15
|
+
setTimeout(() => {
|
|
16
|
+
// Grid Options: Contains all of the grid configurations
|
|
17
|
+
const gridOptions = {
|
|
18
|
+
// Row Data: The data to be displayed.
|
|
19
|
+
pagination: false, // Disabled by default, will be handled by the management view
|
|
20
|
+
// paginationPageSize: 100,
|
|
21
|
+
// suppressPaginationPanel: true, // We are using our own custom pagination component
|
|
22
|
+
// rowHeight: 60,
|
|
23
|
+
enableCellChangeFlash: true,
|
|
24
|
+
defaultColDef: {
|
|
25
|
+
editable: false,
|
|
26
|
+
flex: 1,
|
|
27
|
+
minWidth: 50,
|
|
28
|
+
filter: true,
|
|
29
|
+
autoHeight: true,
|
|
30
|
+
},
|
|
31
|
+
rowClassRules: {
|
|
32
|
+
'row-new-highlight': (params) => {
|
|
33
|
+
// a temporary flag we can set on new rows to highlight them
|
|
34
|
+
return params.data && params.data._new;
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
// domLayout: 'autoHeight', || 'normal'
|
|
38
|
+
// Column Definitions: Defines & controls grid columns.
|
|
39
|
+
columnDefs: options?.gridOptions?.rowData?.[0]
|
|
40
|
+
? Object.keys(options.gridOptions.rowData[0]).map((field) => {
|
|
41
|
+
return { field };
|
|
42
|
+
})
|
|
43
|
+
: [],
|
|
44
|
+
...options.gridOptions,
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
// Your Javascript code to create the grid
|
|
48
|
+
const myGridElement = s(`.${id}`);
|
|
49
|
+
if (this.grids[id]) this.grids[id].destroy();
|
|
50
|
+
this.grids[id] = agGrid.createGrid(myGridElement, gridOptions);
|
|
51
|
+
// myGridElement.style.setProperty('width', '100%');
|
|
52
|
+
ThemeEvents[id] = () => {
|
|
53
|
+
if (s(`.${id}`)) {
|
|
54
|
+
s(`.${id}`).classList.remove(darkTheme ? this.theme : this.theme + '-dark');
|
|
55
|
+
s(`.${id}`).classList.add(!darkTheme ? this.theme : this.theme + '-dark');
|
|
56
|
+
} else {
|
|
57
|
+
// console.warn('change theme: grid not found');
|
|
58
|
+
delete ThemeEvents[id];
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
if (!options.style || !options.style.height) {
|
|
63
|
+
if (options.parentModal && Modal.Data[options.parentModal].options.observer) {
|
|
64
|
+
Modal.Data[options.parentModal].onObserverListener[id + '-observer'] = ({ width, height }) => {
|
|
65
|
+
if (s(`.${id}`)) s(`.${id}`).style.height = `${height - 180}px`;
|
|
66
|
+
else delete Modal.Data[options.parentModal].onObserverListener[id + '-observer'];
|
|
67
|
+
};
|
|
68
|
+
s(`.${id}`).style.height = `${s(`.${options.parentModal}`).offsetHeight - 180}px`;
|
|
69
|
+
} else s(`.${id}`).style.height = '500px';
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
const usePagination = options?.usePagination;
|
|
73
|
+
return html`
|
|
74
|
+
<div
|
|
75
|
+
class="${id} ${this.theme}${options?.darkTheme ? `-dark` : ''}"
|
|
76
|
+
style="${options?.style
|
|
77
|
+
? Object.keys(options.style).map((styleKey) => `${styleKey}: ${options.style[styleKey]}; `)
|
|
78
|
+
: ''}"
|
|
79
|
+
></div>
|
|
80
|
+
${usePagination ? `<ag-pagination id="ag-pagination-${id}"></ag-pagination>` : ''}
|
|
81
|
+
`;
|
|
82
|
+
},
|
|
83
|
+
RenderStyle: async function (
|
|
84
|
+
options = {
|
|
85
|
+
eventThemeId: 'AgGrid',
|
|
86
|
+
style: {
|
|
87
|
+
'font-family': '',
|
|
88
|
+
'font-size': '',
|
|
89
|
+
'no-cell-focus-style': false,
|
|
90
|
+
'row-cursor': '',
|
|
91
|
+
},
|
|
92
|
+
},
|
|
93
|
+
) {
|
|
94
|
+
/*
|
|
95
|
+
--ag-foreground-color: rgb(126, 46, 132);
|
|
96
|
+
--ag-background-color: rgb(249, 245, 227);
|
|
97
|
+
--ag-header-foreground-color: rgb(204, 245, 172);
|
|
98
|
+
--ag-header-background-color: rgb(209, 64, 129);
|
|
99
|
+
--ag-odd-row-background-color: rgb(0, 0, 0, 0.03);
|
|
100
|
+
--ag-header-column-resize-handle-color: rgb(126, 46, 132);
|
|
101
|
+
|
|
102
|
+
--ag-font-size: 17px;
|
|
103
|
+
*/
|
|
104
|
+
if (!s(`.ag-grid-base-style`))
|
|
105
|
+
append(
|
|
106
|
+
'head',
|
|
107
|
+
html`<link
|
|
108
|
+
class="ag-grid-base-style"
|
|
109
|
+
rel="stylesheet"
|
|
110
|
+
type="text/css"
|
|
111
|
+
href="${getProxyPath()}styles/ag-grid-community/ag-grid.min.css"
|
|
112
|
+
/><link
|
|
113
|
+
rel="stylesheet"
|
|
114
|
+
type="text/css"
|
|
115
|
+
href="${getProxyPath()}styles/ag-grid-community/${this.theme}.min.css"
|
|
116
|
+
/>`,
|
|
117
|
+
);
|
|
118
|
+
ThemeEvents[options.eventThemeId] = () => {
|
|
119
|
+
htmls(
|
|
120
|
+
`.ag-grid-style`,
|
|
121
|
+
html` ${options.style['font-family']
|
|
122
|
+
? html`<style>
|
|
123
|
+
.ag-theme-alpine,
|
|
124
|
+
.ag-theme-alpine-dark {
|
|
125
|
+
--ag-font-family: '{{ag-font-family}}';
|
|
126
|
+
}
|
|
127
|
+
</style>`.replaceAll('{{ag-font-family}}', options.style['font-family'])
|
|
128
|
+
: ''}
|
|
129
|
+
${options.style['font-size']
|
|
130
|
+
? html`<style>
|
|
131
|
+
.ag-theme-alpine,
|
|
132
|
+
.ag-theme-alpine-dark {
|
|
133
|
+
--ag-font-size: '{{ag-font-size}}';
|
|
134
|
+
}
|
|
135
|
+
</style>`.replaceAll('{{ag-font-size}}', options.style['font-size'])
|
|
136
|
+
: ''}
|
|
137
|
+
${options.style['no-cell-focus-style']
|
|
138
|
+
? html`<style>
|
|
139
|
+
.ag-has-focus .ag-cell-focus {
|
|
140
|
+
border: none !important;
|
|
141
|
+
}
|
|
142
|
+
</style>`
|
|
143
|
+
: ''}
|
|
144
|
+
${options.style['row-cursor']
|
|
145
|
+
? html`<style>
|
|
146
|
+
.ag-row {
|
|
147
|
+
cursor: '{{ag-row-cursor}}';
|
|
148
|
+
}
|
|
149
|
+
</style>`.replaceAll(`'{{ag-row-cursor}}'`, options.style['row-cursor'])
|
|
150
|
+
: ''}
|
|
151
|
+
|
|
152
|
+
<style>
|
|
153
|
+
.ag-btn-renderer {
|
|
154
|
+
font-size: 16px;
|
|
155
|
+
min-width: 90px;
|
|
156
|
+
min-height: 90px;
|
|
157
|
+
}
|
|
158
|
+
</style>
|
|
159
|
+
${darkTheme
|
|
160
|
+
? html`
|
|
161
|
+
<style>
|
|
162
|
+
.ag-row.row-new-highlight {
|
|
163
|
+
background-color: #6d68ff !important;
|
|
164
|
+
transition: background-color 1s ease-out;
|
|
165
|
+
}
|
|
166
|
+
.ag-cell-data-changed,
|
|
167
|
+
.ag-cell-data-changed-animation {
|
|
168
|
+
background-color: #6d68ff !important;
|
|
169
|
+
background: #6d68ff !important;
|
|
170
|
+
color: #e4e4e4 !important;
|
|
171
|
+
}
|
|
172
|
+
</style>
|
|
173
|
+
`
|
|
174
|
+
: html`<style>
|
|
175
|
+
.ag-row.row-new-highlight {
|
|
176
|
+
background-color: #d0eaf8 !important;
|
|
177
|
+
transition: background-color 1s ease-out;
|
|
178
|
+
}
|
|
179
|
+
.ag-cell-data-changed,
|
|
180
|
+
.ag-cell-data-changed-animation {
|
|
181
|
+
background-color: #d1d1d1 !important;
|
|
182
|
+
background: #d1d1d1 !important;
|
|
183
|
+
color: #2e2e2e !important;
|
|
184
|
+
}
|
|
185
|
+
</style>`}`,
|
|
186
|
+
);
|
|
187
|
+
};
|
|
188
|
+
},
|
|
189
|
+
};
|
|
190
|
+
|
|
191
|
+
export { AgGrid };
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { Translate } from './Translate.js';
|
|
2
|
+
|
|
3
|
+
const maintenance = async () => {
|
|
4
|
+
const icon = html`<svg xmlns="http://www.w3.org/2000/svg" width="80" height="80" viewBox="0 0 24 24">
|
|
5
|
+
<path
|
|
6
|
+
fill="none"
|
|
7
|
+
stroke="currentColor"
|
|
8
|
+
stroke-linecap="round"
|
|
9
|
+
stroke-linejoin="round"
|
|
10
|
+
stroke-width="2"
|
|
11
|
+
d="M3 7a3 3 0 0 1 3-3h12a3 3 0 0 1 3 3v2a3 3 0 0 1-3 3H6a3 3 0 0 1-3-3zm9 13H6a3 3 0 0 1-3-3v-2a3 3 0 0 1 3-3h10.5m-.5 6a2 2 0 1 0 4 0a2 2 0 1 0-4 0m2-3.5V16m0 4v1.5m3.032-5.25l-1.299.75m-3.463 2l-1.3.75m0-3.5l1.3.75m3.463 2l1.3.75M7 8v.01M7 16v.01"
|
|
12
|
+
/>
|
|
13
|
+
</svg>`;
|
|
14
|
+
return html` <div class="abs center" style="top: 45%">
|
|
15
|
+
${icon}
|
|
16
|
+
<br />
|
|
17
|
+
<br />${Translate.Render('server-maintenance')}
|
|
18
|
+
</div>`;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
const noInternet = async () => {
|
|
22
|
+
const icon = html`<svg xmlns="http://www.w3.org/2000/svg" width="80" height="80" viewBox="0 0 20 20">
|
|
23
|
+
<path
|
|
24
|
+
fill="currentColor"
|
|
25
|
+
d="M10 18q.128 0 .254-.004a5.5 5.5 0 0 1-.698-1.083c-.536-.207-1.098-.793-1.578-1.821A9.3 9.3 0 0 1 7.42 13.5h1.672q.096-.52.284-1h-2.17A15 15 0 0 1 7 10c0-.883.073-1.725.206-2.5h5.588c.092.541.156 1.115.186 1.713q.48-.138.992-.188a16 16 0 0 0-.165-1.525h2.733c.251.656.406 1.36.448 2.094q.543.276 1.008.66A8 8 0 1 0 10 18m0-15c.657 0 1.407.59 2.022 1.908c.217.466.406 1.002.559 1.592H7.419c.153-.59.342-1.126.56-1.592C8.592 3.59 9.342 3 10 3M7.072 4.485A10.5 10.5 0 0 0 6.389 6.5H3.936a7.02 7.02 0 0 1 3.778-3.118c-.241.33-.456.704-.642 1.103M6.192 7.5A16 16 0 0 0 6 10c0 .87.067 1.712.193 2.5H3.46A7 7 0 0 1 3 10c0-.88.163-1.724.46-2.5zm.197 6c.176.743.407 1.422.683 2.015c.186.399.401.773.642 1.103A7.02 7.02 0 0 1 3.936 13.5zm5.897-10.118A7.02 7.02 0 0 1 16.064 6.5H13.61a10.5 10.5 0 0 0-.683-2.015a6.6 6.6 0 0 0-.642-1.103M19 14.5a4.5 4.5 0 1 1-9 0a4.5 4.5 0 0 1 9 0M14.5 12a.5.5 0 0 0-.5.5v2a.5.5 0 0 0 1 0v-2a.5.5 0 0 0-.5-.5m0 5.125a.625.625 0 1 0 0-1.25a.625.625 0 0 0 0 1.25"
|
|
26
|
+
/>
|
|
27
|
+
</svg>`;
|
|
28
|
+
return html` <div class="abs center" style="top: 45%">
|
|
29
|
+
${icon}
|
|
30
|
+
<br />
|
|
31
|
+
<br />${Translate.Render('no-internet-connection')}
|
|
32
|
+
</div>`;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
const e404 = async () => {
|
|
36
|
+
const icon = html`
|
|
37
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="80" height="80" viewBox="0 0 24 24">
|
|
38
|
+
<path
|
|
39
|
+
fill="currentColor"
|
|
40
|
+
d="M15.097 5.904A6.5 6.5 0 0 0 4 10.504l.001 1h-2v-1a8.5 8.5 0 1 1 15.176 5.258l5.344 5.345l-1.414 1.414l-5.344-5.345A8.48 8.48 0 0 1 10.5 19h-1v-2h1a6.5 6.5 0 0 0 4.596-11.096M1.672 13.257L4.5 16.086l2.829-2.829l1.414 1.415L5.915 17.5l2.828 2.828l-1.414 1.415L4.5 18.914l-2.828 2.829l-1.414-1.415L3.086 17.5L.258 14.672z"
|
|
41
|
+
/>
|
|
42
|
+
</svg>
|
|
43
|
+
`;
|
|
44
|
+
return html` <div class="abs center" style="top: 45%">
|
|
45
|
+
${icon}
|
|
46
|
+
<br />
|
|
47
|
+
<br />
|
|
48
|
+
<span class="bold">404</span>
|
|
49
|
+
<br />
|
|
50
|
+
<br />${Translate.Render('page-not-found')} <br />
|
|
51
|
+
<br />
|
|
52
|
+
<a href="${location.origin}">${Translate.Render('back')}</a>
|
|
53
|
+
</div>`;
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
const e500 = async () => {
|
|
57
|
+
const icon = html`<svg xmlns="http://www.w3.org/2000/svg" width="80" height="80" viewBox="0 0 20 20">
|
|
58
|
+
<path
|
|
59
|
+
fill="currentColor"
|
|
60
|
+
d="M6 2a2 2 0 0 0-2 2v5.207a5.5 5.5 0 0 1 1-.185V4a1 1 0 0 1 1-1h4v3.5A1.5 1.5 0 0 0 11.5 8H15v8a1 1 0 0 1-1 1h-3.6a5.5 5.5 0 0 1-.657 1H14a2 2 0 0 0 2-2V7.414a1.5 1.5 0 0 0-.44-1.06l-3.914-3.915A1.5 1.5 0 0 0 10.586 2zm8.793 5H11.5a.5.5 0 0 1-.5-.5V3.207zM10 14.5a4.5 4.5 0 1 1-9 0a4.5 4.5 0 0 1 9 0M5.5 12a.5.5 0 0 0-.5.5v2a.5.5 0 0 0 1 0v-2a.5.5 0 0 0-.5-.5m0 5.125a.625.625 0 1 0 0-1.25a.625.625 0 0 0 0 1.25"
|
|
61
|
+
/>
|
|
62
|
+
</svg>`;
|
|
63
|
+
return html` <div class="abs center" style="top: 45%">
|
|
64
|
+
${icon}
|
|
65
|
+
<br />
|
|
66
|
+
<br />
|
|
67
|
+
<span class="bold">500</span>
|
|
68
|
+
<br />
|
|
69
|
+
<br />${Translate.Render('page-broken')} <br />
|
|
70
|
+
<br />
|
|
71
|
+
<a href="${location.origin}">${Translate.Render('back')}</a>
|
|
72
|
+
</div>`;
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
const Alert = { maintenance, noInternet, e404, e500 };
|
|
76
|
+
|
|
77
|
+
export { Alert };
|