@underpostnet/cyberia 3.2.80
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 +14 -0
- package/.env.example +144 -0
- package/.github/workflows/cyberia-client.cd.yml +40 -0
- package/.github/workflows/cyberia-server.cd.yml +40 -0
- package/.github/workflows/docker-image.cyberia-client.ci.yml +71 -0
- package/.github/workflows/docker-image.cyberia-client.dev.ci.yml +70 -0
- package/.github/workflows/docker-image.cyberia-server.ci.yml +71 -0
- package/.github/workflows/docker-image.cyberia-server.dev.ci.yml +71 -0
- package/.github/workflows/docker-image.engine-cyberia.ci.yml +53 -0
- package/.github/workflows/docker-image.engine-cyberia.dev.ci.yml +53 -0
- package/.github/workflows/engine-cyberia.cd.yml +157 -0
- package/.github/workflows/engine-cyberia.ci.yml +125 -0
- package/.github/workflows/ghpkg.ci.yml +160 -0
- package/.github/workflows/gitlab.ci.yml +20 -0
- package/.github/workflows/hardhat.ci.yml +82 -0
- package/.github/workflows/npmpkg.ci.yml +126 -0
- package/.github/workflows/publish.ci.yml +87 -0
- package/.github/workflows/publish.cyberia.ci.yml +79 -0
- package/.github/workflows/pwa-microservices-template-page.cd.yml +65 -0
- package/.github/workflows/pwa-microservices-template-test.ci.yml +33 -0
- package/.github/workflows/release.cd.yml +46 -0
- package/.nycrc +9 -0
- package/.prettierignore +12 -0
- package/.prettierrc +9 -0
- package/.vscode/extensions.json +10 -0
- package/.vscode/settings.json +26 -0
- package/CHANGELOG.md +2516 -0
- package/CLI-HELP.md +1099 -0
- package/Dockerfile +161 -0
- package/Dockerfile.dev +161 -0
- package/Dockerfile.test +165 -0
- package/LICENSE +21 -0
- package/README.md +259 -0
- package/baremetal/commission-workflows.json +211 -0
- package/baremetal/packer-workflows.json +24 -0
- package/bin/build.js +261 -0
- package/bin/build.template.js +33 -0
- package/bin/cyberia.js +5627 -0
- package/bin/deploy.js +1547 -0
- package/bin/index.js +5627 -0
- package/bump.config.js +27 -0
- package/compose.env +144 -0
- package/conf.js +952 -0
- package/deployment.yaml +418 -0
- package/docker-compose.yml +434 -0
- package/examples/static-page/README.md +150 -0
- package/examples/static-page/ssr-components/CustomPage.js +554 -0
- package/examples/static-page/static-config-example.json +57 -0
- package/hardhat/.env.example +31 -0
- package/hardhat/contracts/ObjectLayerToken.sol +391 -0
- package/hardhat/deployments/.gitkeep +0 -0
- package/hardhat/deployments/hardhat-ObjectLayerToken.json +11 -0
- package/hardhat/hardhat.config.js +136 -0
- package/hardhat/ignition/modules/.gitkeep +0 -0
- package/hardhat/ignition/modules/ObjectLayerToken.js +21 -0
- package/hardhat/networks/besu-object-layer.network.json +138 -0
- package/hardhat/package-lock.json +2871 -0
- package/hardhat/package.json +43 -0
- package/hardhat/scripts/deployObjectLayerToken.js +98 -0
- package/hardhat/test/ObjectLayerToken.js +696 -0
- package/hardhat/types/ethers-contracts/ObjectLayerToken.ts +690 -0
- package/hardhat/types/ethers-contracts/common.ts +92 -0
- package/hardhat/types/ethers-contracts/factories/ObjectLayerToken__factory.ts +1055 -0
- package/hardhat/types/ethers-contracts/factories/index.ts +4 -0
- package/hardhat/types/ethers-contracts/hardhat.d.ts +47 -0
- package/hardhat/types/ethers-contracts/index.ts +6 -0
- package/ipfs/configure-ipfs.sh +13 -0
- package/jsconfig.json +9 -0
- package/manifests/cronjobs/dd-cron/dd-cron-backup.yaml +48 -0
- package/manifests/cronjobs/dd-cron/dd-cron-dns.yaml +48 -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-cyberia-development/deployment.yaml +418 -0
- package/manifests/deployment/dd-cyberia-development/grpc-service.yaml +17 -0
- package/manifests/deployment/dd-cyberia-development/proxy.yaml +189 -0
- package/manifests/deployment/dd-cyberia-development/pv-pvc.yaml +164 -0
- package/manifests/deployment/dd-default-development/deployment.yaml +163 -0
- package/manifests/deployment/dd-default-development/proxy.yaml +46 -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 +8 -0
- package/manifests/deployment/kafka/deployment.yaml +67 -0
- package/manifests/deployment/mongo-express/deployment.yaml +62 -0
- package/manifests/deployment/phpmyadmin/deployment.yaml +54 -0
- package/manifests/deployment/playwright/deployment.yaml +52 -0
- package/manifests/deployment/spark/spark-pi-py.yaml +20 -0
- package/manifests/deployment/tensorflow/tf-gpu-test.yaml +63 -0
- package/manifests/envoy-service-nodeport.yaml +22 -0
- package/manifests/grafana/deployment.yaml +64 -0
- package/manifests/grafana/kustomization.yaml +7 -0
- package/manifests/grafana/pvc.yaml +12 -0
- package/manifests/grafana/service.yaml +14 -0
- package/manifests/grafana/storage-class.yaml +9 -0
- package/manifests/ipfs/configmap.yaml +64 -0
- package/manifests/ipfs/headless-service.yaml +35 -0
- package/manifests/ipfs/kustomization.yaml +8 -0
- package/manifests/ipfs/statefulset.yaml +149 -0
- package/manifests/ipfs/storage-class.yaml +9 -0
- package/manifests/kind-config-dev.yaml +20 -0
- package/manifests/kind-config.yaml +12 -0
- package/manifests/kubeadm-calico-config.yaml +14 -0
- package/manifests/letsencrypt-prod.yaml +14 -0
- package/manifests/lxd/lxd-admin-profile.yaml +26 -0
- package/manifests/lxd/lxd-preseed.yaml +30 -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/service.yaml +10 -0
- package/manifests/mariadb/statefulset.yaml +56 -0
- package/manifests/mariadb/storage-class.yaml +10 -0
- package/manifests/mongodb/headless-service.yaml +10 -0
- package/manifests/mongodb/kustomization.yaml +11 -0
- package/manifests/mongodb/pv-pvc.yaml +59 -0
- package/manifests/mongodb/statefulset.yaml +113 -0
- package/manifests/mongodb/storage-class.yaml +9 -0
- package/manifests/mongodb-4.4/headless-service.yaml +10 -0
- package/manifests/mongodb-4.4/kustomization.yaml +9 -0
- package/manifests/mongodb-4.4/mongodb-nodeport.yaml +17 -0
- package/manifests/mongodb-4.4/pv-pvc.yaml +19 -0
- package/manifests/mongodb-4.4/service-deployment.yaml +61 -0
- package/manifests/mongodb-4.4/statefulset.yaml +79 -0
- package/manifests/mongodb-4.4/storage-class.yaml +9 -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/pv-pvc-dd.yaml +34 -0
- package/manifests/valkey/kustomization.yaml +7 -0
- package/manifests/valkey/service.yaml +10 -0
- package/manifests/valkey/statefulset.yaml +37 -0
- package/manifests/valkey/valkey-nodeport.yaml +17 -0
- package/mongodb/entrypoint.sh +76 -0
- package/nginx.conf +128 -0
- package/nodemon.json +6 -0
- package/package.json +101 -0
- package/packer/images/Rocky9Amd64/Makefile +62 -0
- package/packer/images/Rocky9Amd64/QUICKSTART.md +113 -0
- package/packer/images/Rocky9Amd64/README.md +122 -0
- package/packer/images/Rocky9Amd64/http/rocky9.ks.pkrtpl.hcl +114 -0
- package/packer/images/Rocky9Amd64/rocky9.pkr.hcl +164 -0
- package/packer/images/Rocky9Arm64/Makefile +69 -0
- package/packer/images/Rocky9Arm64/README.md +122 -0
- package/packer/images/Rocky9Arm64/http/rocky9.ks.pkrtpl.hcl +114 -0
- package/packer/images/Rocky9Arm64/rocky9.pkr.hcl +171 -0
- package/packer/scripts/fuse-nbd +64 -0
- package/packer/scripts/fuse-tar-root +63 -0
- package/proxy.yaml +189 -0
- package/pv-pvc.yaml +164 -0
- package/scripts/device-scan.sh +65 -0
- package/scripts/disk-clean.sh +182 -0
- package/scripts/disk-devices.sh +13 -0
- package/scripts/gen-fqdns.sh +14 -0
- package/scripts/gpu-diag.sh +19 -0
- package/scripts/ip-info.sh +118 -0
- package/scripts/ipxe-setup.sh +200 -0
- package/scripts/k3s-node-setup.sh +124 -0
- package/scripts/kubeadm-node-setup.sh +317 -0
- package/scripts/link-local-underpost-cli.sh +6 -0
- package/scripts/lxd-vm-setup.sh +208 -0
- package/scripts/maas-nat-firewalld.sh +145 -0
- package/scripts/maas-setup.sh +135 -0
- package/scripts/maas-upload-boot-resource.sh +183 -0
- package/scripts/nat-iptables.sh +111 -0
- package/scripts/nvim.sh +91 -0
- package/scripts/packer-init-vars-file.sh +40 -0
- package/scripts/packer-setup.sh +289 -0
- package/scripts/ports-ls.sh +33 -0
- package/scripts/quick-tftp.sh +19 -0
- package/scripts/rhel-grpc-setup.sh +56 -0
- package/scripts/rocky-kickstart.sh +986 -0
- package/scripts/rocky-pwa.sh +200 -0
- package/scripts/rocky-setup.sh +106 -0
- package/scripts/rpmfusion-ffmpeg-setup.sh +32 -0
- package/scripts/ssl.sh +170 -0
- package/scripts/test-monitor.sh +248 -0
- package/src/api/atlas-sprite-sheet/atlas-sprite-sheet.controller.js +30 -0
- package/src/api/atlas-sprite-sheet/atlas-sprite-sheet.model.js +155 -0
- package/src/api/atlas-sprite-sheet/atlas-sprite-sheet.router.js +39 -0
- package/src/api/atlas-sprite-sheet/atlas-sprite-sheet.service.js +382 -0
- package/src/api/core/core.controller.js +8 -0
- package/src/api/core/core.model.js +11 -0
- package/src/api/core/core.router.js +23 -0
- package/src/api/core/core.service.js +30 -0
- package/src/api/crypto/crypto.controller.js +10 -0
- package/src/api/crypto/crypto.model.js +23 -0
- package/src/api/crypto/crypto.router.js +23 -0
- package/src/api/crypto/crypto.service.js +64 -0
- package/src/api/cyberia-action/cyberia-action.controller.js +8 -0
- package/src/api/cyberia-action/cyberia-action.model.js +79 -0
- package/src/api/cyberia-action/cyberia-action.router.js +21 -0
- package/src/api/cyberia-action/cyberia-action.service.js +58 -0
- package/src/api/cyberia-client-hints/cyberia-client-hints.controller.js +27 -0
- package/src/api/cyberia-client-hints/cyberia-client-hints.model.js +100 -0
- package/src/api/cyberia-client-hints/cyberia-client-hints.router.js +70 -0
- package/src/api/cyberia-client-hints/cyberia-client-hints.service.js +152 -0
- package/src/api/cyberia-dialogue/cyberia-dialogue.controller.js +8 -0
- package/src/api/cyberia-dialogue/cyberia-dialogue.model.js +36 -0
- package/src/api/cyberia-dialogue/cyberia-dialogue.router.js +20 -0
- package/src/api/cyberia-dialogue/cyberia-dialogue.service.js +57 -0
- package/src/api/cyberia-entity/cyberia-entity.controller.js +6 -0
- package/src/api/cyberia-entity/cyberia-entity.model.js +25 -0
- package/src/api/cyberia-entity/cyberia-entity.router.js +17 -0
- package/src/api/cyberia-entity/cyberia-entity.service.js +42 -0
- package/src/api/cyberia-entity-type-default/cyberia-entity-type-default.controller.js +6 -0
- package/src/api/cyberia-entity-type-default/cyberia-entity-type-default.model.js +67 -0
- package/src/api/cyberia-entity-type-default/cyberia-entity-type-default.router.js +17 -0
- package/src/api/cyberia-entity-type-default/cyberia-entity-type-default.service.js +46 -0
- package/src/api/cyberia-instance/cyberia-fallback-world.js +337 -0
- package/src/api/cyberia-instance/cyberia-instance-boot.service.js +57 -0
- package/src/api/cyberia-instance/cyberia-instance-map.service.js +583 -0
- package/src/api/cyberia-instance/cyberia-instance.controller.js +42 -0
- package/src/api/cyberia-instance/cyberia-instance.model.js +117 -0
- package/src/api/cyberia-instance/cyberia-instance.router.js +75 -0
- package/src/api/cyberia-instance/cyberia-instance.service.js +190 -0
- package/src/api/cyberia-instance/cyberia-portal-connector.js +260 -0
- package/src/api/cyberia-instance/cyberia-world-generator.js +618 -0
- package/src/api/cyberia-instance-conf/cyberia-instance-conf.controller.js +6 -0
- package/src/api/cyberia-instance-conf/cyberia-instance-conf.model.js +200 -0
- package/src/api/cyberia-instance-conf/cyberia-instance-conf.router.js +17 -0
- package/src/api/cyberia-instance-conf/cyberia-instance-conf.service.js +46 -0
- package/src/api/cyberia-map/cyberia-map.controller.js +6 -0
- package/src/api/cyberia-map/cyberia-map.model.js +33 -0
- package/src/api/cyberia-map/cyberia-map.router.js +19 -0
- package/src/api/cyberia-map/cyberia-map.service.js +76 -0
- package/src/api/cyberia-quest/cyberia-quest.controller.js +9 -0
- package/src/api/cyberia-quest/cyberia-quest.model.js +67 -0
- package/src/api/cyberia-quest/cyberia-quest.router.js +26 -0
- package/src/api/cyberia-quest/cyberia-quest.service.js +97 -0
- package/src/api/cyberia-quest-progress/cyberia-quest-progress.controller.js +6 -0
- package/src/api/cyberia-quest-progress/cyberia-quest-progress.model.js +49 -0
- package/src/api/cyberia-quest-progress/cyberia-quest-progress.router.js +21 -0
- package/src/api/cyberia-quest-progress/cyberia-quest-progress.service.js +42 -0
- package/src/api/cyberia-saga/cyberia-saga.controller.js +6 -0
- package/src/api/cyberia-saga/cyberia-saga.model.js +59 -0
- package/src/api/cyberia-saga/cyberia-saga.router.js +17 -0
- package/src/api/cyberia-saga/cyberia-saga.service.js +42 -0
- package/src/api/cyberia-server-defaults/cyberia-server-defaults.js +1076 -0
- package/src/api/cyberia-skill/cyberia-skill.controller.js +6 -0
- package/src/api/cyberia-skill/cyberia-skill.model.js +50 -0
- package/src/api/cyberia-skill/cyberia-skill.router.js +17 -0
- package/src/api/cyberia-skill/cyberia-skill.service.js +42 -0
- package/src/api/default/default.controller.js +6 -0
- package/src/api/default/default.model.js +20 -0
- package/src/api/default/default.router.js +21 -0
- package/src/api/default/default.service.js +42 -0
- package/src/api/document/document.controller.js +9 -0
- package/src/api/document/document.model.js +95 -0
- package/src/api/document/document.router.js +32 -0
- package/src/api/document/document.service.js +633 -0
- package/src/api/file/file.controller.js +15 -0
- package/src/api/file/file.model.js +127 -0
- package/src/api/file/file.ref.json +39 -0
- package/src/api/file/file.router.js +36 -0
- package/src/api/file/file.service.js +499 -0
- package/src/api/instance/instance.controller.js +8 -0
- package/src/api/instance/instance.model.js +34 -0
- package/src/api/instance/instance.router.js +27 -0
- package/src/api/instance/instance.service.js +75 -0
- package/src/api/ipfs/ipfs.controller.js +8 -0
- package/src/api/ipfs/ipfs.model.js +77 -0
- package/src/api/ipfs/ipfs.router.js +26 -0
- package/src/api/ipfs/ipfs.service.js +145 -0
- package/src/api/object-layer/object-layer.controller.js +18 -0
- package/src/api/object-layer/object-layer.model.js +200 -0
- package/src/api/object-layer/object-layer.router.js +729 -0
- package/src/api/object-layer/object-layer.service.js +894 -0
- package/src/api/object-layer-render-frames/object-layer-render-frames.controller.js +6 -0
- package/src/api/object-layer-render-frames/object-layer-render-frames.model.js +93 -0
- package/src/api/object-layer-render-frames/object-layer-render-frames.router.js +17 -0
- package/src/api/object-layer-render-frames/object-layer-render-frames.service.js +46 -0
- package/src/api/test/test.controller.js +14 -0
- package/src/api/test/test.model.js +14 -0
- package/src/api/test/test.router.js +23 -0
- package/src/api/test/test.service.js +35 -0
- package/src/api/types.js +24 -0
- package/src/api/user/guest.service.js +100 -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 +142 -0
- package/src/api/user/user.router.js +367 -0
- package/src/api/user/user.service.js +582 -0
- package/src/api.js +23 -0
- package/src/cli/baremetal.js +3947 -0
- package/src/cli/cloud-init.js +673 -0
- package/src/cli/cluster.js +1395 -0
- package/src/cli/db.js +1533 -0
- package/src/cli/deploy.js +1542 -0
- package/src/cli/docker-compose.js +802 -0
- package/src/cli/env.js +177 -0
- package/src/cli/fs.js +380 -0
- package/src/cli/image.js +389 -0
- package/src/cli/index.js +1059 -0
- package/src/cli/ipfs.js +182 -0
- package/src/cli/kickstart.js +271 -0
- package/src/cli/kubectl.js +214 -0
- package/src/cli/lxd.js +1232 -0
- package/src/cli/monitor.js +659 -0
- package/src/cli/release.js +595 -0
- package/src/cli/repository.js +1969 -0
- package/src/cli/run.js +3326 -0
- package/src/cli/secrets.js +151 -0
- package/src/cli/ssh.js +975 -0
- package/src/cli/static.js +653 -0
- package/src/cli/system.js +332 -0
- package/src/cli/test.js +176 -0
- package/src/client/Cryptokoyn.index.js +30 -0
- package/src/client/CyberiaPortal.index.js +31 -0
- package/src/client/Default.index.js +77 -0
- package/src/client/Itemledger.index.js +35 -0
- package/src/client/Underpost.index.js +31 -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 +630 -0
- package/src/client/components/core/AgGrid.js +238 -0
- package/src/client/components/core/Alert.js +76 -0
- package/src/client/components/core/AppStore.js +69 -0
- package/src/client/components/core/Auth.js +353 -0
- package/src/client/components/core/Badge.js +26 -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 +109 -0
- package/src/client/components/core/CalendarCore.js +437 -0
- package/src/client/components/core/Chat.js +62 -0
- package/src/client/components/core/ClientEvents.js +163 -0
- package/src/client/components/core/ColorPaletteElement.js +309 -0
- package/src/client/components/core/CommonJs.js +1014 -0
- package/src/client/components/core/Content.js +349 -0
- package/src/client/components/core/Css.js +1134 -0
- package/src/client/components/core/CssCore.js +881 -0
- package/src/client/components/core/D3Chart.js +44 -0
- package/src/client/components/core/Docs.js +478 -0
- package/src/client/components/core/DropDown.js +321 -0
- package/src/client/components/core/EventBus.js +96 -0
- package/src/client/components/core/EventsUI.js +130 -0
- package/src/client/components/core/FileExplorer.js +1406 -0
- package/src/client/components/core/FullScreen.js +201 -0
- package/src/client/components/core/Input.js +537 -0
- package/src/client/components/core/Keyboard.js +80 -0
- package/src/client/components/core/KeyboardAvoidance.js +145 -0
- package/src/client/components/core/LoadingAnimation.js +152 -0
- package/src/client/components/core/LogIn.js +212 -0
- package/src/client/components/core/LogOut.js +72 -0
- package/src/client/components/core/Logger.js +22 -0
- package/src/client/components/core/Modal.js +2956 -0
- package/src/client/components/core/NotificationManager.js +80 -0
- package/src/client/components/core/Pagination.js +252 -0
- package/src/client/components/core/Panel.js +1308 -0
- package/src/client/components/core/PanelForm.js +915 -0
- package/src/client/components/core/Polyhedron.js +947 -0
- package/src/client/components/core/PublicProfile.js +895 -0
- package/src/client/components/core/Recover.js +211 -0
- package/src/client/components/core/Responsive.js +146 -0
- package/src/client/components/core/RichText.js +33 -0
- package/src/client/components/core/Router.js +523 -0
- package/src/client/components/core/Scroll.js +76 -0
- package/src/client/components/core/SearchBox.js +1007 -0
- package/src/client/components/core/SignUp.js +153 -0
- package/src/client/components/core/SocketIo.js +163 -0
- package/src/client/components/core/SocketIoHandler.js +75 -0
- package/src/client/components/core/Stream.js +161 -0
- package/src/client/components/core/ToggleSwitch.js +89 -0
- package/src/client/components/core/ToolTip.js +78 -0
- package/src/client/components/core/Translate.js +694 -0
- package/src/client/components/core/Validator.js +140 -0
- package/src/client/components/core/VanillaJs.js +485 -0
- package/src/client/components/core/Wallet.js +95 -0
- package/src/client/components/core/WebComponent.js +44 -0
- package/src/client/components/core/Webhook.js +58 -0
- package/src/client/components/core/Worker.js +313 -0
- package/src/client/components/core/windowGetDimensions.js +269 -0
- package/src/client/components/cryptokoyn/AppShellCryptokoyn.js +352 -0
- package/src/client/components/cryptokoyn/AppStoreCryptokoyn.js +5 -0
- package/src/client/components/cryptokoyn/CssCryptokoyn.js +212 -0
- package/src/client/components/cryptokoyn/LogInCryptokoyn.js +16 -0
- package/src/client/components/cryptokoyn/LogOutCryptokoyn.js +12 -0
- package/src/client/components/cryptokoyn/RouterCryptokoyn.js +37 -0
- package/src/client/components/cryptokoyn/SettingsCryptokoyn.js +16 -0
- package/src/client/components/cryptokoyn/SignUpCryptokoyn.js +11 -0
- package/src/client/components/cryptokoyn/SocketIoCryptokoyn.js +6 -0
- package/src/client/components/cyberia/ActionEngineCyberia.js +1867 -0
- package/src/client/components/cyberia/EntityEngineCyberia.js +585 -0
- package/src/client/components/cyberia/InstanceEngineCyberia.js +1088 -0
- package/src/client/components/cyberia/InstanceSelectionView.js +900 -0
- package/src/client/components/cyberia/MapEngineCyberia.js +1976 -0
- package/src/client/components/cyberia/ObjectLayerEngine.js +1540 -0
- package/src/client/components/cyberia/ObjectLayerEngineModal.js +2420 -0
- package/src/client/components/cyberia/ObjectLayerEngineViewer.js +1522 -0
- package/src/client/components/cyberia/SharedDefaultsCyberia.js +528 -0
- package/src/client/components/cyberia-portal/AppShellCyberiaPortal.js +772 -0
- package/src/client/components/cyberia-portal/AppStoreCyberiaPortal.js +5 -0
- package/src/client/components/cyberia-portal/CssCyberiaPortal.js +254 -0
- package/src/client/components/cyberia-portal/LogInCyberiaPortal.js +21 -0
- package/src/client/components/cyberia-portal/LogOutCyberiaPortal.js +16 -0
- package/src/client/components/cyberia-portal/MainBodyCyberiaPortal.js +518 -0
- package/src/client/components/cyberia-portal/RouterCyberiaPortal.js +72 -0
- package/src/client/components/cyberia-portal/SettingsCyberiaPortal.js +16 -0
- package/src/client/components/cyberia-portal/SignUpCyberiaPortal.js +13 -0
- package/src/client/components/cyberia-portal/SocketIoCyberiaPortal.js +6 -0
- package/src/client/components/cyberia-portal/TranslateCyberiaPortal.js +48 -0
- package/src/client/components/default/AppShellDefault.js +765 -0
- package/src/client/components/default/AppStoreDefault.js +5 -0
- package/src/client/components/default/CommonDefault.js +29 -0
- package/src/client/components/default/CssDefault.js +27 -0
- package/src/client/components/default/LogInDefault.js +16 -0
- package/src/client/components/default/LogOutDefault.js +12 -0
- package/src/client/components/default/RouterDefault.js +47 -0
- package/src/client/components/default/SettingsDefault.js +16 -0
- package/src/client/components/default/SignUpDefault.js +11 -0
- package/src/client/components/default/SocketIoDefault.js +6 -0
- package/src/client/components/default/TranslateDefault.js +7 -0
- package/src/client/components/itemledger/AppShellItemledger.js +353 -0
- package/src/client/components/itemledger/AppStoreItemledger.js +5 -0
- package/src/client/components/itemledger/CssItemledger.js +212 -0
- package/src/client/components/itemledger/LogInItemledger.js +17 -0
- package/src/client/components/itemledger/LogOutItemledger.js +12 -0
- package/src/client/components/itemledger/RouterItemledger.js +38 -0
- package/src/client/components/itemledger/SettingsItemledger.js +16 -0
- package/src/client/components/itemledger/SignUpItemledger.js +11 -0
- package/src/client/components/itemledger/SocketIoItemledger.js +6 -0
- package/src/client/components/itemledger/TranslateItemledger.js +7 -0
- package/src/client/components/underpost/AppShellUnderpost.js +691 -0
- package/src/client/components/underpost/AppStoreUnderpost.js +5 -0
- package/src/client/components/underpost/CssUnderpost.js +281 -0
- package/src/client/components/underpost/CyberpunkBloggerUnderpost.js +879 -0
- package/src/client/components/underpost/DocumentSearchProvider.js +448 -0
- package/src/client/components/underpost/LabGalleryUnderpost.js +79 -0
- package/src/client/components/underpost/LogInUnderpost.js +25 -0
- package/src/client/components/underpost/LogOutUnderpost.js +17 -0
- package/src/client/components/underpost/RouterUnderpost.js +45 -0
- package/src/client/components/underpost/SettingsUnderpost.js +16 -0
- package/src/client/components/underpost/SignUpUnderpost.js +11 -0
- package/src/client/components/underpost/SocketIoUnderpost.js +6 -0
- package/src/client/components/underpost/TranslateUnderpost.js +10 -0
- package/src/client/public/cryptokoyn/assets/banner/koyn-social.png +0 -0
- package/src/client/public/cryptokoyn/assets/logo/base-icon.png +0 -0
- package/src/client/public/cryptokoyn/assets/logo/cryptokoyn.png +0 -0
- package/src/client/public/cryptokoyn/assets/splash/android-chrome-144x144.png +0 -0
- package/src/client/public/cryptokoyn/assets/splash/android-chrome-192x192.png +0 -0
- package/src/client/public/cryptokoyn/assets/splash/android-chrome-256x256.png +0 -0
- package/src/client/public/cryptokoyn/assets/splash/android-chrome-36x36.png +0 -0
- package/src/client/public/cryptokoyn/assets/splash/android-chrome-48x48.png +0 -0
- package/src/client/public/cryptokoyn/assets/splash/android-chrome-72x72.png +0 -0
- package/src/client/public/cryptokoyn/assets/splash/android-chrome-96x96.png +0 -0
- package/src/client/public/cryptokoyn/assets/splash/apple-touch-icon-114x114-precomposed.png +0 -0
- package/src/client/public/cryptokoyn/assets/splash/apple-touch-icon-114x114.png +0 -0
- package/src/client/public/cryptokoyn/assets/splash/apple-touch-icon-120x120-precomposed.png +0 -0
- package/src/client/public/cryptokoyn/assets/splash/apple-touch-icon-120x120.png +0 -0
- package/src/client/public/cryptokoyn/assets/splash/apple-touch-icon-144x144-precomposed.png +0 -0
- package/src/client/public/cryptokoyn/assets/splash/apple-touch-icon-144x144.png +0 -0
- package/src/client/public/cryptokoyn/assets/splash/apple-touch-icon-152x152-precomposed.png +0 -0
- package/src/client/public/cryptokoyn/assets/splash/apple-touch-icon-152x152.png +0 -0
- package/src/client/public/cryptokoyn/assets/splash/apple-touch-icon-180x180-precomposed.png +0 -0
- package/src/client/public/cryptokoyn/assets/splash/apple-touch-icon-180x180.png +0 -0
- package/src/client/public/cryptokoyn/assets/splash/apple-touch-icon-57x57-precomposed.png +0 -0
- package/src/client/public/cryptokoyn/assets/splash/apple-touch-icon-57x57.png +0 -0
- package/src/client/public/cryptokoyn/assets/splash/apple-touch-icon-60x60-precomposed.png +0 -0
- package/src/client/public/cryptokoyn/assets/splash/apple-touch-icon-60x60.png +0 -0
- package/src/client/public/cryptokoyn/assets/splash/apple-touch-icon-72x72-precomposed.png +0 -0
- package/src/client/public/cryptokoyn/assets/splash/apple-touch-icon-72x72.png +0 -0
- package/src/client/public/cryptokoyn/assets/splash/apple-touch-icon-76x76-precomposed.png +0 -0
- package/src/client/public/cryptokoyn/assets/splash/apple-touch-icon-76x76.png +0 -0
- package/src/client/public/cryptokoyn/assets/splash/apple-touch-icon-precomposed.png +0 -0
- package/src/client/public/cryptokoyn/assets/splash/apple-touch-icon.png +0 -0
- package/src/client/public/cryptokoyn/assets/splash/favicon-16x16.png +0 -0
- package/src/client/public/cryptokoyn/assets/splash/favicon-32x32.png +0 -0
- package/src/client/public/cryptokoyn/assets/splash/mstile-144x144.png +0 -0
- package/src/client/public/cryptokoyn/assets/splash/mstile-150x150.png +0 -0
- package/src/client/public/cryptokoyn/assets/splash/mstile-310x150.png +0 -0
- package/src/client/public/cryptokoyn/assets/splash/mstile-310x310.png +0 -0
- package/src/client/public/cryptokoyn/assets/splash/mstile-70x70.png +0 -0
- package/src/client/public/cryptokoyn/assets/splash/safari-pinned-tab.svg +42 -0
- package/src/client/public/cryptokoyn/browserconfig.xml +12 -0
- package/src/client/public/cryptokoyn/favicon.ico +0 -0
- package/src/client/public/cryptokoyn/microdata.json +85 -0
- package/src/client/public/cryptokoyn/site.webmanifest +57 -0
- package/src/client/public/cryptokoyn/sitemap +148 -0
- package/src/client/public/cyberia-docs/ACTION-SYSTEM.md +307 -0
- package/src/client/public/cyberia-docs/ARCHITECTURE.md +309 -0
- package/src/client/public/cyberia-docs/CYBERIA-CLI.md +204 -0
- package/src/client/public/cyberia-docs/CYBERIA-CLIENT.md +341 -0
- package/src/client/public/cyberia-docs/CYBERIA-LORE.md +84 -0
- package/src/client/public/cyberia-docs/CYBERIA-SAGA.md +394 -0
- package/src/client/public/cyberia-docs/CYBERIA-SERVER.md +294 -0
- package/src/client/public/cyberia-docs/CYBERIA.md +259 -0
- package/src/client/public/cyberia-docs/ENTITY-PROFILE.md +242 -0
- package/src/client/public/cyberia-docs/HARDHAT-MODULE.md +300 -0
- package/src/client/public/cyberia-docs/OFF-CHAIN-ECONOMY.md +309 -0
- package/src/client/public/cyberia-docs/QUEST-SYSTEM.md +228 -0
- package/src/client/public/cyberia-docs/ROADMAP.md +240 -0
- package/src/client/public/cyberia-docs/UNDERPOST-PLATFORM.md +106 -0
- package/src/client/public/cyberia-docs/WHITE-PAPER.md +740 -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/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/itemledger/android-chrome-144x144.png +0 -0
- package/src/client/public/itemledger/android-chrome-192x192.png +0 -0
- package/src/client/public/itemledger/android-chrome-256x256.png +0 -0
- package/src/client/public/itemledger/android-chrome-36x36.png +0 -0
- package/src/client/public/itemledger/android-chrome-384x384.png +0 -0
- package/src/client/public/itemledger/android-chrome-48x48.png +0 -0
- package/src/client/public/itemledger/android-chrome-512x512.png +0 -0
- package/src/client/public/itemledger/android-chrome-72x72.png +0 -0
- package/src/client/public/itemledger/android-chrome-96x96.png +0 -0
- package/src/client/public/itemledger/apple-touch-icon-1024x1024.png +0 -0
- package/src/client/public/itemledger/apple-touch-icon-114x114.png +0 -0
- package/src/client/public/itemledger/apple-touch-icon-120x120.png +0 -0
- package/src/client/public/itemledger/apple-touch-icon-144x144.png +0 -0
- package/src/client/public/itemledger/apple-touch-icon-152x152.png +0 -0
- package/src/client/public/itemledger/apple-touch-icon-167x167.png +0 -0
- package/src/client/public/itemledger/apple-touch-icon-180x180.png +0 -0
- package/src/client/public/itemledger/apple-touch-icon-57x57.png +0 -0
- package/src/client/public/itemledger/apple-touch-icon-60x60.png +0 -0
- package/src/client/public/itemledger/apple-touch-icon-72x72.png +0 -0
- package/src/client/public/itemledger/apple-touch-icon-76x76.png +0 -0
- package/src/client/public/itemledger/apple-touch-icon-precomposed.png +0 -0
- package/src/client/public/itemledger/apple-touch-icon.png +0 -0
- package/src/client/public/itemledger/apple-touch-startup-image-1125x2436.png +0 -0
- package/src/client/public/itemledger/apple-touch-startup-image-1136x640.png +0 -0
- package/src/client/public/itemledger/apple-touch-startup-image-1170x2532.png +0 -0
- package/src/client/public/itemledger/apple-touch-startup-image-1179x2556.png +0 -0
- package/src/client/public/itemledger/apple-touch-startup-image-1242x2208.png +0 -0
- package/src/client/public/itemledger/apple-touch-startup-image-1242x2688.png +0 -0
- package/src/client/public/itemledger/apple-touch-startup-image-1284x2778.png +0 -0
- package/src/client/public/itemledger/apple-touch-startup-image-1290x2796.png +0 -0
- package/src/client/public/itemledger/apple-touch-startup-image-1334x750.png +0 -0
- package/src/client/public/itemledger/apple-touch-startup-image-1488x2266.png +0 -0
- package/src/client/public/itemledger/apple-touch-startup-image-1536x2048.png +0 -0
- package/src/client/public/itemledger/apple-touch-startup-image-1620x2160.png +0 -0
- package/src/client/public/itemledger/apple-touch-startup-image-1640x2160.png +0 -0
- package/src/client/public/itemledger/apple-touch-startup-image-1668x2224.png +0 -0
- package/src/client/public/itemledger/apple-touch-startup-image-1668x2388.png +0 -0
- package/src/client/public/itemledger/apple-touch-startup-image-1792x828.png +0 -0
- package/src/client/public/itemledger/apple-touch-startup-image-2048x1536.png +0 -0
- package/src/client/public/itemledger/apple-touch-startup-image-2048x2732.png +0 -0
- package/src/client/public/itemledger/apple-touch-startup-image-2160x1620.png +0 -0
- package/src/client/public/itemledger/apple-touch-startup-image-2160x1640.png +0 -0
- package/src/client/public/itemledger/apple-touch-startup-image-2208x1242.png +0 -0
- package/src/client/public/itemledger/apple-touch-startup-image-2224x1668.png +0 -0
- package/src/client/public/itemledger/apple-touch-startup-image-2266x1488.png +0 -0
- package/src/client/public/itemledger/apple-touch-startup-image-2388x1668.png +0 -0
- package/src/client/public/itemledger/apple-touch-startup-image-2436x1125.png +0 -0
- package/src/client/public/itemledger/apple-touch-startup-image-2532x1170.png +0 -0
- package/src/client/public/itemledger/apple-touch-startup-image-2556x1179.png +0 -0
- package/src/client/public/itemledger/apple-touch-startup-image-2688x1242.png +0 -0
- package/src/client/public/itemledger/apple-touch-startup-image-2732x2048.png +0 -0
- package/src/client/public/itemledger/apple-touch-startup-image-2778x1284.png +0 -0
- package/src/client/public/itemledger/apple-touch-startup-image-2796x1290.png +0 -0
- package/src/client/public/itemledger/apple-touch-startup-image-640x1136.png +0 -0
- package/src/client/public/itemledger/apple-touch-startup-image-750x1334.png +0 -0
- package/src/client/public/itemledger/apple-touch-startup-image-828x1792.png +0 -0
- package/src/client/public/itemledger/assets/logo/base-icon.png +0 -0
- package/src/client/public/itemledger/browserconfig.xml +12 -0
- package/src/client/public/itemledger/favicon-16x16.png +0 -0
- package/src/client/public/itemledger/favicon-32x32.png +0 -0
- package/src/client/public/itemledger/favicon-48x48.png +0 -0
- package/src/client/public/itemledger/favicon.ico +0 -0
- package/src/client/public/itemledger/manifest.webmanifest +69 -0
- package/src/client/public/itemledger/microdata.json +71 -0
- package/src/client/public/itemledger/mstile-144x144.png +0 -0
- package/src/client/public/itemledger/mstile-150x150.png +0 -0
- package/src/client/public/itemledger/mstile-310x150.png +0 -0
- package/src/client/public/itemledger/mstile-310x310.png +0 -0
- package/src/client/public/itemledger/mstile-70x70.png +0 -0
- package/src/client/public/itemledger/sitemap +148 -0
- package/src/client/public/itemledger/yandex-browser-50x50.png +0 -0
- package/src/client/public/itemledger/yandex-browser-manifest.json +9 -0
- package/src/client/public/test/favicon.ico +0 -0
- package/src/client/public/test/sitemap +148 -0
- package/src/client/services/atlas-sprite-sheet/atlas-sprite-sheet.service.js +137 -0
- package/src/client/services/core/core.service.js +309 -0
- package/src/client/services/crypto/crypto.service.js +68 -0
- package/src/client/services/cyberia-action/cyberia-action.service.js +99 -0
- package/src/client/services/cyberia-client-hints/cyberia-client-hints.service.js +99 -0
- package/src/client/services/cyberia-dialogue/cyberia-dialogue.service.js +99 -0
- package/src/client/services/cyberia-entity/cyberia-entity.management.js +57 -0
- package/src/client/services/cyberia-entity/cyberia-entity.service.js +99 -0
- package/src/client/services/cyberia-entity-type-default/cyberia-entity-type-default.service.js +99 -0
- package/src/client/services/cyberia-instance/cyberia-instance.management.js +194 -0
- package/src/client/services/cyberia-instance/cyberia-instance.service.js +137 -0
- package/src/client/services/cyberia-instance-conf/cyberia-instance-conf.service.js +99 -0
- package/src/client/services/cyberia-map/cyberia-map.management.js +193 -0
- package/src/client/services/cyberia-map/cyberia-map.service.js +120 -0
- package/src/client/services/cyberia-quest/cyberia-quest.service.js +99 -0
- package/src/client/services/cyberia-quest-progress/cyberia-quest-progress.service.js +99 -0
- package/src/client/services/cyberia-saga/cyberia-saga.service.js +99 -0
- package/src/client/services/cyberia-skill/cyberia-skill.service.js +99 -0
- package/src/client/services/default/default.management.js +1015 -0
- package/src/client/services/default/default.service.js +99 -0
- package/src/client/services/document/document.service.js +134 -0
- package/src/client/services/file/file.service.js +94 -0
- package/src/client/services/instance/instance.management.js +78 -0
- package/src/client/services/instance/instance.service.js +107 -0
- package/src/client/services/ipfs/ipfs.service.js +118 -0
- package/src/client/services/object-layer/object-layer.management.js +414 -0
- package/src/client/services/object-layer/object-layer.service.js +208 -0
- package/src/client/services/object-layer-render-frames/object-layer-render-frames.service.js +99 -0
- package/src/client/services/test/test.service.js +68 -0
- package/src/client/services/user/guest.service.js +86 -0
- package/src/client/services/user/user.management.js +51 -0
- package/src/client/services/user/user.service.js +106 -0
- package/src/client/ssr/RootDocument.js +237 -0
- package/src/client/ssr/body/404.js +77 -0
- package/src/client/ssr/body/500.js +76 -0
- package/src/client/ssr/body/CacheControl.js +117 -0
- package/src/client/ssr/body/CyberiaDefaultSplashScreen.js +97 -0
- package/src/client/ssr/body/DefaultSplashScreen.js +97 -0
- package/src/client/ssr/body/SwaggerDarkMode.js +285 -0
- package/src/client/ssr/body/UnderpostDefaultSplashScreen.js +90 -0
- package/src/client/ssr/head/CryptokoynScripts.js +4 -0
- package/src/client/ssr/head/Css.js +241 -0
- package/src/client/ssr/head/CyberiaPortalScripts.js +6 -0
- package/src/client/ssr/head/DefaultScripts.js +6 -0
- package/src/client/ssr/head/ItemledgerScripts.js +4 -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/PwaItemledger.js +197 -0
- package/src/client/ssr/head/Seo.js +15 -0
- package/src/client/ssr/head/UnderpostScripts.js +6 -0
- package/src/client/ssr/mailer/DefaultRecoverEmail.js +20 -0
- package/src/client/ssr/mailer/DefaultVerifyEmail.js +16 -0
- package/src/client/ssr/views/Cyberia404.js +328 -0
- package/src/client/ssr/views/CyberiaServerMetrics.js +1070 -0
- package/src/client/ssr/views/Maintenance.js +64 -0
- package/src/client/ssr/views/NoNetworkConnection.js +68 -0
- package/src/client/ssr/views/Test.js +199 -0
- package/src/client/sw/core.sw.js +274 -0
- package/src/client-builder/client-build-docs.js +493 -0
- package/src/client-builder/client-build-live.js +100 -0
- package/src/client-builder/client-build.js +1092 -0
- package/src/client-builder/client-dev-server.js +88 -0
- package/src/client-builder/client-formatted.js +170 -0
- package/src/client-builder/client-icons.js +108 -0
- package/src/client-builder/ssr.js +124 -0
- package/src/client.build.js +17 -0
- package/src/client.dev.js +21 -0
- package/src/db/DataBaseProvider.js +213 -0
- package/src/db/mariadb/MariaDB.js +72 -0
- package/src/db/mongo/MongoBootstrap.js +657 -0
- package/src/db/mongo/MongooseDB.js +199 -0
- package/src/grpc/cyberia/grpc-server.js +162 -0
- package/src/index.js +357 -0
- package/src/mailer/EmailRender.js +116 -0
- package/src/mailer/MailerProvider.js +213 -0
- package/src/projects/cyberia/atlas-sprite-sheet-generator.js +413 -0
- package/src/projects/cyberia/besu-genesis-generator.js +1630 -0
- package/src/projects/cyberia/catalog-cyberia.js +90 -0
- package/src/projects/cyberia/gemini-client.js +175 -0
- package/src/projects/cyberia/generate-saga.js +2137 -0
- package/src/projects/cyberia/hot-reload-trigger.js +163 -0
- package/src/projects/cyberia/instance-data.js +719 -0
- package/src/projects/cyberia/ipfs-client.js +599 -0
- package/src/projects/cyberia/map-preview-generator.js +304 -0
- package/src/projects/cyberia/object-layer.js +978 -0
- package/src/projects/cyberia/semantic-layer-generator-floor.js +319 -0
- package/src/projects/cyberia/semantic-layer-generator-resource.js +259 -0
- package/src/projects/cyberia/semantic-layer-generator-skin.js +1164 -0
- package/src/projects/cyberia/semantic-layer-generator.js +753 -0
- package/src/projects/cyberia/shape-generator.js +1060 -0
- package/src/projects/underpost/catalog-underpost.js +60 -0
- package/src/proxy.js +19 -0
- package/src/runtime/cyberia-client/Dockerfile +49 -0
- package/src/runtime/cyberia-client/Dockerfile.dev +75 -0
- package/src/runtime/cyberia-server/Dockerfile +43 -0
- package/src/runtime/cyberia-server/Dockerfile.dev +56 -0
- package/src/runtime/engine-cyberia/Dockerfile +161 -0
- package/src/runtime/engine-cyberia/Dockerfile.dev +161 -0
- package/src/runtime/engine-cyberia/Dockerfile.test +165 -0
- package/src/runtime/engine-cyberia/compose.env +144 -0
- package/src/runtime/engine-cyberia/docker-compose.yml +434 -0
- package/src/runtime/engine-cyberia/ipfs/configure-ipfs.sh +13 -0
- package/src/runtime/engine-cyberia/mongodb/entrypoint.sh +76 -0
- package/src/runtime/engine-cyberia/nginx.conf +128 -0
- package/src/runtime/express/Dockerfile +45 -0
- package/src/runtime/express/Express.js +285 -0
- package/src/runtime/lampp/Dockerfile +62 -0
- package/src/runtime/lampp/Lampp.js +359 -0
- package/src/runtime/nginx/Nginx.js +250 -0
- package/src/runtime/wp/Dockerfile +62 -0
- package/src/runtime/wp/Wp.js +642 -0
- package/src/server/auth.js +713 -0
- package/src/server/backup.js +102 -0
- package/src/server/catalog.js +72 -0
- package/src/server/conf.js +2316 -0
- package/src/server/cron.js +476 -0
- package/src/server/crypto.js +210 -0
- package/src/server/data-query.js +461 -0
- package/src/server/dns.js +553 -0
- package/src/server/downloader.js +73 -0
- package/src/server/logger.js +229 -0
- package/src/server/middlewares.js +152 -0
- package/src/server/peer.js +75 -0
- package/src/server/process.js +299 -0
- package/src/server/proxy.js +139 -0
- package/src/server/runtime-status.js +252 -0
- package/src/server/runtime.js +183 -0
- package/src/server/start.js +272 -0
- package/src/server/tls.js +254 -0
- package/src/server/valkey.js +201 -0
- package/src/server.js +25 -0
- package/src/ws/IoInterface.js +129 -0
- package/src/ws/IoServer.js +68 -0
- package/src/ws/core/channels/core.ws.chat.js +68 -0
- package/src/ws/core/channels/core.ws.mailer.js +116 -0
- package/src/ws/core/channels/core.ws.stream.js +90 -0
- package/src/ws/core/core.ws.connection.js +41 -0
- package/src/ws/core/core.ws.emit.js +37 -0
- package/src/ws/core/core.ws.server.js +44 -0
- package/src/ws/default/channels/default.ws.main.js +57 -0
- package/src/ws/default/default.ws.connection.js +35 -0
- package/src/ws/default/default.ws.emit.js +14 -0
- package/src/ws/default/default.ws.server.js +39 -0
- package/test/api.test.js +53 -0
- package/test/crypto.test.js +117 -0
- package/test/cyberia-instance-conf-defaults.test.js +140 -0
- package/test/deploy-monitor.test.js +267 -0
- package/test/shape-generator.test.js +463 -0
- package/tsconfig.docs.json +15 -0
- package/typedoc.dd-cyberia.json +31 -0
- package/typedoc.json +31 -0
|
@@ -0,0 +1,1406 @@
|
|
|
1
|
+
import { getApiBaseUrl } from '../../services/core/core.service.js';
|
|
2
|
+
import { DocumentService } from '../../services/document/document.service.js';
|
|
3
|
+
import { FileService } from '../../services/file/file.service.js';
|
|
4
|
+
import { AgGrid } from './AgGrid.js';
|
|
5
|
+
import { Auth } from './Auth.js';
|
|
6
|
+
import { BtnIcon } from './BtnIcon.js';
|
|
7
|
+
import { getSubpaths, uniqueArray } from './CommonJs.js';
|
|
8
|
+
import { Css, darkTheme, dynamicCol, renderCssAttr, Themes } from './Css.js';
|
|
9
|
+
import { EventsUI } from './EventsUI.js';
|
|
10
|
+
import { fileFormDataFactory, Input, InputFile } from './Input.js';
|
|
11
|
+
import { loggerFactory } from './Logger.js';
|
|
12
|
+
import { Modal, renderViewTitle } from './Modal.js';
|
|
13
|
+
import { NotificationManager } from './NotificationManager.js';
|
|
14
|
+
import { RouterEvents } from './Router.js';
|
|
15
|
+
import { Translate } from './Translate.js';
|
|
16
|
+
import { Validator } from './Validator.js';
|
|
17
|
+
import { copyData, downloadFile, s } from './VanillaJs.js';
|
|
18
|
+
import { getProxyPath, getQueryParams, setPath, setQueryParams, listenQueryParamsChange } from './Router.js';
|
|
19
|
+
const logger = loggerFactory(import.meta);
|
|
20
|
+
class LoadFolderRenderer {
|
|
21
|
+
eGui;
|
|
22
|
+
async init(params) {
|
|
23
|
+
console.log('LoadFolderRenderer created', params);
|
|
24
|
+
// params.data._id
|
|
25
|
+
this.eGui = document.createElement('div');
|
|
26
|
+
this.eGui.innerHTML = html`<i class="fas fa-folder"></i> ${params.data.location}`;
|
|
27
|
+
}
|
|
28
|
+
getGui() {
|
|
29
|
+
return this.eGui;
|
|
30
|
+
}
|
|
31
|
+
refresh(params) {
|
|
32
|
+
console.log('LoadFolderRenderer refreshed', params);
|
|
33
|
+
return true;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
class LoadFileNameRenderer {
|
|
37
|
+
eGui;
|
|
38
|
+
async init(params) {
|
|
39
|
+
console.log('LoadFileNameRenderer created', params);
|
|
40
|
+
// params.data._id
|
|
41
|
+
this.eGui = document.createElement('div');
|
|
42
|
+
this.eGui.innerHTML = html`<i class="fas fa-file"></i> ${params.data.name}`;
|
|
43
|
+
}
|
|
44
|
+
getGui() {
|
|
45
|
+
return this.eGui;
|
|
46
|
+
}
|
|
47
|
+
refresh(params) {
|
|
48
|
+
console.log('LoadFileNameRenderer refreshed', params);
|
|
49
|
+
return true;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
class FolderHeaderComp {
|
|
53
|
+
eGui;
|
|
54
|
+
async init(params) {
|
|
55
|
+
console.log('FolderHeaderComp created', params);
|
|
56
|
+
// params.data._id
|
|
57
|
+
this.eGui = document.createElement('div');
|
|
58
|
+
this.eGui.innerHTML = html`<i class="fas fa-file"></i>`;
|
|
59
|
+
}
|
|
60
|
+
getGui() {
|
|
61
|
+
return this.eGui;
|
|
62
|
+
}
|
|
63
|
+
refresh(params) {
|
|
64
|
+
console.log('FolderHeaderComp refreshed', params);
|
|
65
|
+
return true;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
class FileExplorer {
|
|
69
|
+
static Api = {};
|
|
70
|
+
static async instance(options = { idModal: '' }) {
|
|
71
|
+
const { idModal } = options;
|
|
72
|
+
FileExplorer.Api[idModal] = options;
|
|
73
|
+
const gridFolderId = 'folder-explorer-grid';
|
|
74
|
+
const gridFileId = 'file-explorer-grid';
|
|
75
|
+
const idDropFileInput = 'file-explorer';
|
|
76
|
+
let formBodyFiles;
|
|
77
|
+
const query = getQueryParams();
|
|
78
|
+
let location = query?.location ? FileExplorer.locationFormat({ f: query }) : '/';
|
|
79
|
+
let files, folders, documentId, documentInstance;
|
|
80
|
+
// Simple pagination state
|
|
81
|
+
const PAGE_SIZE = 5;
|
|
82
|
+
let currentPage = query?.page ? parseInt(query.page) - 1 : 0;
|
|
83
|
+
if (currentPage < 0) currentPage = 0;
|
|
84
|
+
let displayedFiles = [];
|
|
85
|
+
// Search filter state - initialize from URL query param
|
|
86
|
+
let searchFilters = {
|
|
87
|
+
title: query?.title || '',
|
|
88
|
+
mdFile: query?.mdFile || '',
|
|
89
|
+
file: query?.file || '',
|
|
90
|
+
};
|
|
91
|
+
let filteredFiles = [];
|
|
92
|
+
let isProcessingQueryChange = false; // Prevent recursion during URL sync
|
|
93
|
+
const queryParamsListenerId = `file-explorer-${idModal}`;
|
|
94
|
+
const cleanData = () => {
|
|
95
|
+
files = [];
|
|
96
|
+
folders = [];
|
|
97
|
+
documentId = '';
|
|
98
|
+
documentInstance = [];
|
|
99
|
+
};
|
|
100
|
+
cleanData();
|
|
101
|
+
const applySearchFilter = () => {
|
|
102
|
+
filteredFiles = files;
|
|
103
|
+
};
|
|
104
|
+
const updatePaginationUI = () => {
|
|
105
|
+
const paginationInfo = s(`.file-explorer-pagination-info`);
|
|
106
|
+
const prevBtn = s(`.file-explorer-prev-btn`);
|
|
107
|
+
const nextBtn = s(`.file-explorer-next-btn`);
|
|
108
|
+
if (paginationInfo) {
|
|
109
|
+
const totalPages = Math.ceil(filteredFiles.length / PAGE_SIZE);
|
|
110
|
+
const showing =
|
|
111
|
+
searchFilters.title || searchFilters.mdFile || searchFilters.file
|
|
112
|
+
? `${filteredFiles.length}/${files.length}`
|
|
113
|
+
: `${files.length}`;
|
|
114
|
+
paginationInfo.textContent = `${currentPage + 1} / ${totalPages || 1} (${showing} files)`;
|
|
115
|
+
}
|
|
116
|
+
if (prevBtn) {
|
|
117
|
+
prevBtn.disabled = currentPage === 0;
|
|
118
|
+
prevBtn.style.opacity = currentPage === 0 ? '0.5' : '1';
|
|
119
|
+
prevBtn.style.cursor = currentPage === 0 ? 'not-allowed' : 'pointer';
|
|
120
|
+
}
|
|
121
|
+
if (nextBtn) {
|
|
122
|
+
const isDisabled = (currentPage + 1) * PAGE_SIZE >= filteredFiles.length;
|
|
123
|
+
nextBtn.disabled = isDisabled;
|
|
124
|
+
nextBtn.style.opacity = isDisabled ? '0.5' : '1';
|
|
125
|
+
nextBtn.style.cursor = isDisabled ? 'not-allowed' : 'pointer';
|
|
126
|
+
}
|
|
127
|
+
};
|
|
128
|
+
const getPagedFiles = () => {
|
|
129
|
+
const start = currentPage * PAGE_SIZE;
|
|
130
|
+
const end = start + PAGE_SIZE;
|
|
131
|
+
return filteredFiles.slice(start, end);
|
|
132
|
+
};
|
|
133
|
+
FileExplorer.Api[idModal].displayList = async () => {
|
|
134
|
+
if (!s(`.${idModal}`)) return;
|
|
135
|
+
const query = getQueryParams();
|
|
136
|
+
location = query?.location ? FileExplorer.locationFormat({ f: query }) : '/';
|
|
137
|
+
s(`.file-explorer-query-nav`).value = location;
|
|
138
|
+
// Sync search filters from URL
|
|
139
|
+
searchFilters = {
|
|
140
|
+
title: query?.title || '',
|
|
141
|
+
mdFile: query?.mdFile || '',
|
|
142
|
+
file: query?.file || '',
|
|
143
|
+
};
|
|
144
|
+
if (s(`.file-explorer-search-title`)) s(`.file-explorer-search-title`).value = searchFilters.title;
|
|
145
|
+
if (s(`.file-explorer-search-md-file`)) s(`.file-explorer-search-md-file`).value = searchFilters.mdFile;
|
|
146
|
+
if (s(`.file-explorer-search-file`)) s(`.file-explorer-search-file`).value = searchFilters.file;
|
|
147
|
+
const format = FileExplorer.documentDataFormat({ document: documentInstance, location, searchFilters });
|
|
148
|
+
files = format.files;
|
|
149
|
+
folders = format.folders;
|
|
150
|
+
applySearchFilter();
|
|
151
|
+
const queryPage = query?.page ? parseInt(query.page) - 1 : 0;
|
|
152
|
+
currentPage = queryPage >= 0 ? queryPage : 0;
|
|
153
|
+
displayedFiles = getPagedFiles();
|
|
154
|
+
AgGrid.grids[gridFileId].setGridOption('rowData', displayedFiles);
|
|
155
|
+
AgGrid.grids[gridFolderId].setGridOption('rowData', folders);
|
|
156
|
+
updatePaginationUI();
|
|
157
|
+
};
|
|
158
|
+
FileExplorer.Api[idModal].updateData = async (optionsUpdate = { display: false }) => {
|
|
159
|
+
if (!s(`.${idModal}`)) return;
|
|
160
|
+
if (Auth.getToken()) {
|
|
161
|
+
try {
|
|
162
|
+
const { status, data: responseData } = await DocumentService.get({
|
|
163
|
+
params: {
|
|
164
|
+
searchTitle: searchFilters.title,
|
|
165
|
+
searchMdFile: searchFilters.mdFile,
|
|
166
|
+
searchFile: searchFilters.file,
|
|
167
|
+
location,
|
|
168
|
+
},
|
|
169
|
+
});
|
|
170
|
+
// Handle both old format (array) and new format with pagination
|
|
171
|
+
const document = Array.isArray(responseData) ? responseData : responseData.data || [];
|
|
172
|
+
const format = FileExplorer.documentDataFormat({ document, location, searchFilters });
|
|
173
|
+
files = format.files;
|
|
174
|
+
documentId = format.documentId;
|
|
175
|
+
folders = format.folders;
|
|
176
|
+
documentInstance = document;
|
|
177
|
+
applySearchFilter();
|
|
178
|
+
} catch (error) {
|
|
179
|
+
logger.error(error);
|
|
180
|
+
NotificationManager.Push({
|
|
181
|
+
html: error.message,
|
|
182
|
+
status: 'error',
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
} else cleanData();
|
|
186
|
+
setTimeout(async () => {
|
|
187
|
+
if (s(`.${idModal}`) && optionsUpdate && optionsUpdate.display) await FileExplorer.Api[idModal].displayList();
|
|
188
|
+
});
|
|
189
|
+
};
|
|
190
|
+
RouterEvents['file-explorer'] = ({ path, pushPath, route }) => {
|
|
191
|
+
if (route === 'cloud')
|
|
192
|
+
setTimeout(async () => {
|
|
193
|
+
// await this.Api[idModal].updateData();
|
|
194
|
+
await FileExplorer.Api[idModal].displayList();
|
|
195
|
+
});
|
|
196
|
+
};
|
|
197
|
+
// Listen for query param changes (browser back/forward navigation)
|
|
198
|
+
listenQueryParamsChange({
|
|
199
|
+
id: queryParamsListenerId,
|
|
200
|
+
event: async (queryParams) => {
|
|
201
|
+
if (!s(`.${idModal}`)) return;
|
|
202
|
+
if (isProcessingQueryChange) return;
|
|
203
|
+
const tab = queryParams?.tab || '';
|
|
204
|
+
if (tab === 'upload') {
|
|
205
|
+
s(`.file-explorer-nav`).style.display = 'none';
|
|
206
|
+
s(`.file-explorer-uploader`).style.display = 'block';
|
|
207
|
+
} else {
|
|
208
|
+
s(`.file-explorer-nav`).style.display = 'block';
|
|
209
|
+
s(`.file-explorer-uploader`).style.display = 'none';
|
|
210
|
+
}
|
|
211
|
+
const page = queryParams?.page ? parseInt(queryParams.page) - 1 : 0;
|
|
212
|
+
if (page !== currentPage) {
|
|
213
|
+
currentPage = page >= 0 ? page : 0;
|
|
214
|
+
displayedFiles = getPagedFiles();
|
|
215
|
+
if (AgGrid.grids[gridFileId]) {
|
|
216
|
+
AgGrid.grids[gridFileId].setGridOption('rowData', displayedFiles);
|
|
217
|
+
}
|
|
218
|
+
updatePaginationUI();
|
|
219
|
+
}
|
|
220
|
+
const newFilters = {
|
|
221
|
+
title: queryParams?.title || '',
|
|
222
|
+
mdFile: queryParams?.mdFile || '',
|
|
223
|
+
file: queryParams?.file || '',
|
|
224
|
+
};
|
|
225
|
+
if (
|
|
226
|
+
newFilters.title !== searchFilters.title ||
|
|
227
|
+
newFilters.mdFile !== searchFilters.mdFile ||
|
|
228
|
+
newFilters.file !== searchFilters.file
|
|
229
|
+
) {
|
|
230
|
+
isProcessingQueryChange = true;
|
|
231
|
+
searchFilters = newFilters;
|
|
232
|
+
if (s(`.file-explorer-search-title`)) s(`.file-explorer-search-title`).value = searchFilters.title;
|
|
233
|
+
if (s(`.file-explorer-search-md-file`)) s(`.file-explorer-search-md-file`).value = searchFilters.mdFile;
|
|
234
|
+
if (s(`.file-explorer-search-file`)) s(`.file-explorer-search-file`).value = searchFilters.file;
|
|
235
|
+
await FileExplorer.Api[idModal].updateData({ display: true });
|
|
236
|
+
setTimeout(() => {
|
|
237
|
+
isProcessingQueryChange = false;
|
|
238
|
+
}, 100);
|
|
239
|
+
}
|
|
240
|
+
},
|
|
241
|
+
});
|
|
242
|
+
// Pagination button event handlers
|
|
243
|
+
setTimeout(() => {
|
|
244
|
+
EventsUI.onClick(`.file-explorer-prev-btn`, (e) => {
|
|
245
|
+
e.preventDefault();
|
|
246
|
+
if (currentPage > 0) {
|
|
247
|
+
setQueryParams({ page: currentPage }, { replace: false });
|
|
248
|
+
}
|
|
249
|
+
});
|
|
250
|
+
EventsUI.onClick(`.file-explorer-next-btn`, (e) => {
|
|
251
|
+
e.preventDefault();
|
|
252
|
+
if ((currentPage + 1) * PAGE_SIZE < filteredFiles.length) {
|
|
253
|
+
setQueryParams({ page: currentPage + 2 }, { replace: false });
|
|
254
|
+
}
|
|
255
|
+
});
|
|
256
|
+
// Search input handlers
|
|
257
|
+
let searchTimeout;
|
|
258
|
+
const setupSearchInput = (selector, key) => {
|
|
259
|
+
const el = s(selector);
|
|
260
|
+
if (el) {
|
|
261
|
+
if (searchFilters[key]) el.value = searchFilters[key];
|
|
262
|
+
el.addEventListener('input', (e) => {
|
|
263
|
+
clearTimeout(searchTimeout);
|
|
264
|
+
searchTimeout = setTimeout(async () => {
|
|
265
|
+
const val = e.target.value.trim();
|
|
266
|
+
if (val === searchFilters[key]) return;
|
|
267
|
+
isProcessingQueryChange = true;
|
|
268
|
+
searchFilters[key] = val;
|
|
269
|
+
await FileExplorer.Api[idModal].updateData({ display: true });
|
|
270
|
+
const queryParams = {};
|
|
271
|
+
if (searchFilters.title) queryParams.title = searchFilters.title;
|
|
272
|
+
if (searchFilters.mdFile) queryParams.mdFile = searchFilters.mdFile;
|
|
273
|
+
if (searchFilters.file) queryParams.file = searchFilters.file;
|
|
274
|
+
if (!searchFilters.title) queryParams.title = null;
|
|
275
|
+
if (!searchFilters.mdFile) queryParams.mdFile = null;
|
|
276
|
+
if (!searchFilters.file) queryParams.file = null;
|
|
277
|
+
queryParams.page = 1;
|
|
278
|
+
setQueryParams(queryParams, { replace: false });
|
|
279
|
+
setTimeout(() => {
|
|
280
|
+
isProcessingQueryChange = false;
|
|
281
|
+
}, 100);
|
|
282
|
+
}, 300);
|
|
283
|
+
});
|
|
284
|
+
el.addEventListener('keydown', (e) => {
|
|
285
|
+
if (e.key === 'Enter') e.preventDefault();
|
|
286
|
+
});
|
|
287
|
+
}
|
|
288
|
+
};
|
|
289
|
+
setupSearchInput(`.file-explorer-search-title`, 'title');
|
|
290
|
+
setupSearchInput(`.file-explorer-search-md-file`, 'mdFile');
|
|
291
|
+
setupSearchInput(`.file-explorer-search-file`, 'file');
|
|
292
|
+
// Submit search button
|
|
293
|
+
EventsUI.onClick(`.file-explorer-search-submit`, async (e) => {
|
|
294
|
+
e.preventDefault();
|
|
295
|
+
clearTimeout(searchTimeout);
|
|
296
|
+
const titleVal = s(`.file-explorer-search-title`)?.value.trim() || '';
|
|
297
|
+
const mdFileVal = s(`.file-explorer-search-md-file`)?.value.trim() || '';
|
|
298
|
+
const fileVal = s(`.file-explorer-search-file`)?.value.trim() || '';
|
|
299
|
+
searchFilters = { title: titleVal, mdFile: mdFileVal, file: fileVal };
|
|
300
|
+
isProcessingQueryChange = true;
|
|
301
|
+
const queryParams = {};
|
|
302
|
+
if (searchFilters.title) queryParams.title = searchFilters.title;
|
|
303
|
+
if (searchFilters.mdFile) queryParams.mdFile = searchFilters.mdFile;
|
|
304
|
+
if (searchFilters.file) queryParams.file = searchFilters.file;
|
|
305
|
+
if (!searchFilters.title) queryParams.title = null;
|
|
306
|
+
if (!searchFilters.mdFile) queryParams.mdFile = null;
|
|
307
|
+
if (!searchFilters.file) queryParams.file = null;
|
|
308
|
+
queryParams.page = 1;
|
|
309
|
+
setQueryParams(queryParams, { replace: false });
|
|
310
|
+
await FileExplorer.Api[idModal].updateData({ display: true });
|
|
311
|
+
setTimeout(() => {
|
|
312
|
+
isProcessingQueryChange = false;
|
|
313
|
+
}, 100);
|
|
314
|
+
});
|
|
315
|
+
// Clear search button
|
|
316
|
+
EventsUI.onClick(`.file-explorer-search-clear`, (e) => {
|
|
317
|
+
e.preventDefault();
|
|
318
|
+
if (!searchFilters.title && !searchFilters.mdFile && !searchFilters.file) return;
|
|
319
|
+
isProcessingQueryChange = true;
|
|
320
|
+
if (s(`.file-explorer-search-title`)) s(`.file-explorer-search-title`).value = '';
|
|
321
|
+
if (s(`.file-explorer-search-md-file`)) s(`.file-explorer-search-md-file`).value = '';
|
|
322
|
+
if (s(`.file-explorer-search-file`)) s(`.file-explorer-search-file`).value = '';
|
|
323
|
+
searchFilters = { title: '', mdFile: '', file: '' };
|
|
324
|
+
applySearchFilter();
|
|
325
|
+
currentPage = 0;
|
|
326
|
+
displayedFiles = getPagedFiles();
|
|
327
|
+
AgGrid.grids[gridFileId].setGridOption('rowData', displayedFiles);
|
|
328
|
+
updatePaginationUI();
|
|
329
|
+
setQueryParams({ title: null, mdFile: null, file: null, page: 1 }, { replace: false });
|
|
330
|
+
setTimeout(() => {
|
|
331
|
+
isProcessingQueryChange = false;
|
|
332
|
+
}, 100);
|
|
333
|
+
});
|
|
334
|
+
});
|
|
335
|
+
setTimeout(async () => {
|
|
336
|
+
FileExplorer.Api[idModal].updateData({ display: true });
|
|
337
|
+
const formData = [
|
|
338
|
+
{
|
|
339
|
+
model: 'location',
|
|
340
|
+
id: `file-explorer-query-nav`,
|
|
341
|
+
rules: [], // { type: 'isEmpty' }
|
|
342
|
+
},
|
|
343
|
+
];
|
|
344
|
+
const validators = await Validator.instance(formData);
|
|
345
|
+
EventsUI.onClick(`.btn-input-file-explorer`, async (e) => {
|
|
346
|
+
e.preventDefault();
|
|
347
|
+
// Check authentication before upload
|
|
348
|
+
if (!Auth.getToken()) {
|
|
349
|
+
return NotificationManager.Push({
|
|
350
|
+
html: Translate.instance(`error-user-not-authenticated`),
|
|
351
|
+
status: 'error',
|
|
352
|
+
});
|
|
353
|
+
}
|
|
354
|
+
const { errorMessage } = await validators();
|
|
355
|
+
if (!formBodyFiles)
|
|
356
|
+
return NotificationManager.Push({
|
|
357
|
+
html: Translate.instance(`warning-upload-no-selects-file`),
|
|
358
|
+
status: 'warning',
|
|
359
|
+
});
|
|
360
|
+
if (errorMessage) return;
|
|
361
|
+
let fileData;
|
|
362
|
+
{
|
|
363
|
+
const { status, data } = await FileService.post({ body: formBodyFiles });
|
|
364
|
+
if (status === 'error' || !data) {
|
|
365
|
+
return NotificationManager.Push({
|
|
366
|
+
html: Translate.instance(`error-upload-file`),
|
|
367
|
+
status: 'error',
|
|
368
|
+
});
|
|
369
|
+
}
|
|
370
|
+
fileData = data;
|
|
371
|
+
}
|
|
372
|
+
{
|
|
373
|
+
// const body = {};
|
|
374
|
+
// for (const inputData of formData) {
|
|
375
|
+
// if ('model' in inputData) body[inputData.model] = s(`.${inputData.id}`).value;
|
|
376
|
+
// }
|
|
377
|
+
location = FileExplorer.locationFormat({ f: { location: s(`.file-explorer-query-nav`).value } });
|
|
378
|
+
let status = 'success';
|
|
379
|
+
for (const file of fileData) {
|
|
380
|
+
const result = await DocumentService.post({
|
|
381
|
+
body: {
|
|
382
|
+
fileId: file._id,
|
|
383
|
+
location,
|
|
384
|
+
title: file.name,
|
|
385
|
+
},
|
|
386
|
+
});
|
|
387
|
+
if (result.status === 'success') documentInstance.push({ ...result.data, fileId: file });
|
|
388
|
+
else if (status !== 'error') status = 'error';
|
|
389
|
+
}
|
|
390
|
+
const format = FileExplorer.documentDataFormat({ document: documentInstance, location });
|
|
391
|
+
files = format.files;
|
|
392
|
+
folders = format.folders;
|
|
393
|
+
applySearchFilter();
|
|
394
|
+
currentPage = 0;
|
|
395
|
+
displayedFiles = getPagedFiles();
|
|
396
|
+
AgGrid.grids[gridFileId].setGridOption('rowData', displayedFiles);
|
|
397
|
+
AgGrid.grids[gridFolderId].setGridOption('rowData', folders);
|
|
398
|
+
updatePaginationUI();
|
|
399
|
+
NotificationManager.Push({
|
|
400
|
+
html: Translate.instance(`${status}-upload-file`),
|
|
401
|
+
status,
|
|
402
|
+
});
|
|
403
|
+
if (status === 'success') {
|
|
404
|
+
// Clear the file input
|
|
405
|
+
s(`.btn-clear-input-file-${idDropFileInput}`).click();
|
|
406
|
+
// Switch to explorer view with the uploaded location
|
|
407
|
+
setQueryParams({ tab: null, location: location }, { replace: false });
|
|
408
|
+
// Show explorer view, hide upload view
|
|
409
|
+
s(`.file-explorer-nav`).style.display = 'block';
|
|
410
|
+
s(`.file-explorer-uploader`).style.display = 'none';
|
|
411
|
+
s(`.file-explorer-query-nav`).value = location;
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
});
|
|
415
|
+
EventsUI.onClick(`.btn-input-go-explorer`, async (e) => {
|
|
416
|
+
e.preventDefault();
|
|
417
|
+
const newLocation = FileExplorer.locationFormat({ f: { location: s(`.file-explorer-query-nav`).value } });
|
|
418
|
+
if (newLocation === location) return;
|
|
419
|
+
location = newLocation;
|
|
420
|
+
setPath(`${window.location.pathname}?location=${location}`);
|
|
421
|
+
s(`.file-explorer-query-nav`).value = location;
|
|
422
|
+
// const format = this.documentDataFormat({ document: documentInstance, location });
|
|
423
|
+
await FileExplorer.Api[idModal].updateData({ display: true });
|
|
424
|
+
});
|
|
425
|
+
EventsUI.onClick(`.btn-input-home-directory`, async (e) => {
|
|
426
|
+
e.preventDefault();
|
|
427
|
+
if (getQueryParams()?.tab === 'upload') {
|
|
428
|
+
setQueryParams({ tab: null }, { replace: false });
|
|
429
|
+
return;
|
|
430
|
+
}
|
|
431
|
+
let newLocation = '/';
|
|
432
|
+
if (newLocation === location) return;
|
|
433
|
+
location = newLocation;
|
|
434
|
+
setPath(`${window.location.pathname}?location=${location}`);
|
|
435
|
+
s(`.file-explorer-query-nav`).value = location;
|
|
436
|
+
const format = FileExplorer.documentDataFormat({ document: documentInstance, location });
|
|
437
|
+
files = format.files;
|
|
438
|
+
folders = format.folders;
|
|
439
|
+
applySearchFilter();
|
|
440
|
+
currentPage = 0;
|
|
441
|
+
displayedFiles = getPagedFiles();
|
|
442
|
+
AgGrid.grids[gridFileId].setGridOption('rowData', displayedFiles);
|
|
443
|
+
AgGrid.grids[gridFolderId].setGridOption('rowData', folders);
|
|
444
|
+
updatePaginationUI();
|
|
445
|
+
});
|
|
446
|
+
EventsUI.onClick(`.btn-input-copy-directory`, async (e) => {
|
|
447
|
+
e.preventDefault();
|
|
448
|
+
await copyData(window.location.href);
|
|
449
|
+
NotificationManager.Push({
|
|
450
|
+
html: Translate.instance('success-copy-data'),
|
|
451
|
+
status: 'success',
|
|
452
|
+
});
|
|
453
|
+
});
|
|
454
|
+
EventsUI.onClick(`.btn-input-back-explorer`, async (e) => {
|
|
455
|
+
e.preventDefault();
|
|
456
|
+
window.history.back();
|
|
457
|
+
});
|
|
458
|
+
EventsUI.onClick(`.btn-input-forward-explorer`, async (e) => {
|
|
459
|
+
e.preventDefault();
|
|
460
|
+
window.history.forward();
|
|
461
|
+
});
|
|
462
|
+
EventsUI.onClick(`.btn-input-upload-file`, async (e) => {
|
|
463
|
+
e.preventDefault();
|
|
464
|
+
setQueryParams({ tab: 'upload' }, { replace: false });
|
|
465
|
+
});
|
|
466
|
+
});
|
|
467
|
+
class LoadFileActionsRenderer {
|
|
468
|
+
eGui;
|
|
469
|
+
async init(params) {
|
|
470
|
+
console.log('LoadFileActionsRenderer created', params);
|
|
471
|
+
// params.data._id
|
|
472
|
+
this.eGui = document.createElement('div');
|
|
473
|
+
const isPublic = params.data.isPublic;
|
|
474
|
+
const toggleId = `toggle-public-${params.data._id}`;
|
|
475
|
+
const hasGenericFile = !!params.data.hasGenericFile;
|
|
476
|
+
const hasMdFile = !!params.data.hasMdFile;
|
|
477
|
+
this.eGui.innerHTML = html`
|
|
478
|
+
<div class="fl">
|
|
479
|
+
${await BtnIcon.instance({
|
|
480
|
+
class: `in fll management-table-btn-mini btn-file-download-${params.data._id}${!hasGenericFile ? ' btn-disabled' : ''}`,
|
|
481
|
+
label: html` <i class="fas fa-download"></i>`,
|
|
482
|
+
type: 'button',
|
|
483
|
+
})}
|
|
484
|
+
${await BtnIcon.instance({
|
|
485
|
+
class: `in fll management-table-btn-mini btn-file-delete-${params.data._id}`,
|
|
486
|
+
label: html` <i class="fa-solid fa-circle-xmark"></i>`,
|
|
487
|
+
type: 'button',
|
|
488
|
+
})}
|
|
489
|
+
${await BtnIcon.instance({
|
|
490
|
+
class: `in fll management-table-btn-mini btn-file-view-${params.data._id}`,
|
|
491
|
+
label: html` <i class="fas fa-eye"></i>`,
|
|
492
|
+
type: 'button',
|
|
493
|
+
})}
|
|
494
|
+
${await BtnIcon.instance({
|
|
495
|
+
class: `in fll management-table-btn-mini btn-file-copy-content-link-${params.data._id}${!hasGenericFile ? ' btn-disabled' : ''}`,
|
|
496
|
+
label: html`<i class="fas fa-copy"></i>`,
|
|
497
|
+
type: 'button',
|
|
498
|
+
})}
|
|
499
|
+
${await BtnIcon.instance({
|
|
500
|
+
class: `in fll management-table-btn-mini btn-file-copy-md-link-${params.data._id}${!hasMdFile ? ' btn-disabled' : ''}`,
|
|
501
|
+
label: html`<i class="fas fa-file-code"></i>`,
|
|
502
|
+
type: 'button',
|
|
503
|
+
})}
|
|
504
|
+
${await BtnIcon.instance({
|
|
505
|
+
class: `in fll management-table-btn-mini btn-file-edit-${params.data._id}`,
|
|
506
|
+
label: html`<i class="fas fa-edit"></i>`,
|
|
507
|
+
type: 'button',
|
|
508
|
+
})}
|
|
509
|
+
${await BtnIcon.instance({
|
|
510
|
+
class: `in fll management-table-btn-mini ${toggleId}`,
|
|
511
|
+
label: isPublic
|
|
512
|
+
? html`<i class="fas fa-globe" style="color: #4caf50;"></i>`
|
|
513
|
+
: html`<i class="fas fa-lock" style="color: #9e9e9e;"></i>`,
|
|
514
|
+
type: 'button',
|
|
515
|
+
})}
|
|
516
|
+
</div>
|
|
517
|
+
`;
|
|
518
|
+
setTimeout(() => {
|
|
519
|
+
const uri = `${getProxyPath()}content/?cid=${params.data._id}`;
|
|
520
|
+
const url = `${window.location.origin}${uri}`;
|
|
521
|
+
const originObj = documentInstance.find((d) => d._id === params.data._id);
|
|
522
|
+
const blobUri =
|
|
523
|
+
originObj && originObj.fileId
|
|
524
|
+
? getApiBaseUrl({ id: originObj.fileId._id, endpoint: 'file/blob' })
|
|
525
|
+
: undefined;
|
|
526
|
+
const mdBlobUri =
|
|
527
|
+
originObj && originObj.mdFileId
|
|
528
|
+
? getApiBaseUrl({ id: originObj.mdFileId._id, endpoint: 'file/blob' })
|
|
529
|
+
: undefined;
|
|
530
|
+
if (!originObj) {
|
|
531
|
+
s(`.btn-file-view-${params.data._id}`).classList.add('hide');
|
|
532
|
+
s(`.btn-file-copy-content-link-${params.data._id}`).classList.add('hide');
|
|
533
|
+
}
|
|
534
|
+
// Disable download button if no generic file
|
|
535
|
+
if (!hasGenericFile) {
|
|
536
|
+
const dlBtn = s(`.btn-file-download-${params.data._id}`);
|
|
537
|
+
if (dlBtn) {
|
|
538
|
+
dlBtn.style.opacity = '0.4';
|
|
539
|
+
dlBtn.style.cursor = 'not-allowed';
|
|
540
|
+
dlBtn.style.pointerEvents = 'none';
|
|
541
|
+
}
|
|
542
|
+
}
|
|
543
|
+
// Disable copy generic file link button if no generic file
|
|
544
|
+
if (!hasGenericFile) {
|
|
545
|
+
const copyBtn = s(`.btn-file-copy-content-link-${params.data._id}`);
|
|
546
|
+
if (copyBtn) {
|
|
547
|
+
copyBtn.style.opacity = '0.4';
|
|
548
|
+
copyBtn.style.cursor = 'not-allowed';
|
|
549
|
+
copyBtn.style.pointerEvents = 'none';
|
|
550
|
+
}
|
|
551
|
+
}
|
|
552
|
+
// Disable copy md file link button if no md file
|
|
553
|
+
if (!hasMdFile) {
|
|
554
|
+
const mdCopyBtn = s(`.btn-file-copy-md-link-${params.data._id}`);
|
|
555
|
+
if (mdCopyBtn) {
|
|
556
|
+
mdCopyBtn.style.opacity = '0.4';
|
|
557
|
+
mdCopyBtn.style.cursor = 'not-allowed';
|
|
558
|
+
mdCopyBtn.style.pointerEvents = 'none';
|
|
559
|
+
}
|
|
560
|
+
}
|
|
561
|
+
EventsUI.onClick(`.btn-file-view-${params.data._id}`, async (e) => {
|
|
562
|
+
e.preventDefault();
|
|
563
|
+
if (location.href !== url) {
|
|
564
|
+
setPath(uri);
|
|
565
|
+
s(`.main-btn-content`).click();
|
|
566
|
+
}
|
|
567
|
+
});
|
|
568
|
+
EventsUI.onClick(`.btn-file-copy-content-link-${params.data._id}`, async (e) => {
|
|
569
|
+
e.preventDefault();
|
|
570
|
+
if (!hasGenericFile || !blobUri) return;
|
|
571
|
+
await copyData(blobUri);
|
|
572
|
+
NotificationManager.Push({
|
|
573
|
+
html: Translate.instance('success-copy-data'),
|
|
574
|
+
status: 'success',
|
|
575
|
+
});
|
|
576
|
+
});
|
|
577
|
+
EventsUI.onClick(`.btn-file-copy-md-link-${params.data._id}`, async (e) => {
|
|
578
|
+
e.preventDefault();
|
|
579
|
+
if (!hasMdFile || !mdBlobUri) return;
|
|
580
|
+
await copyData(mdBlobUri);
|
|
581
|
+
NotificationManager.Push({
|
|
582
|
+
html: Translate.instance('success-copy-data'),
|
|
583
|
+
status: 'success',
|
|
584
|
+
});
|
|
585
|
+
});
|
|
586
|
+
EventsUI.onClick(`.btn-file-download-${params.data._id}`, async (e) => {
|
|
587
|
+
e.preventDefault();
|
|
588
|
+
if (!hasGenericFile) return;
|
|
589
|
+
try {
|
|
590
|
+
// Use FileService with blob/ prefix for blob fetching
|
|
591
|
+
const { data: blobArray, status } = await FileService.get({ id: `blob/${params.data.fileId}` });
|
|
592
|
+
if (status === 'success' && blobArray && blobArray[0]) {
|
|
593
|
+
downloadFile(blobArray[0], params.data.name);
|
|
594
|
+
} else {
|
|
595
|
+
throw new Error('Failed to fetch file blob');
|
|
596
|
+
}
|
|
597
|
+
} catch (error) {
|
|
598
|
+
logger.error('Download failed:', error);
|
|
599
|
+
NotificationManager.Push({
|
|
600
|
+
html: 'Download failed',
|
|
601
|
+
status: 'error',
|
|
602
|
+
});
|
|
603
|
+
}
|
|
604
|
+
});
|
|
605
|
+
EventsUI.onClick(
|
|
606
|
+
`.btn-file-delete-${params.data._id}`,
|
|
607
|
+
async (e) => {
|
|
608
|
+
e.preventDefault();
|
|
609
|
+
{
|
|
610
|
+
const confirmResult = await Modal.RenderConfirm({
|
|
611
|
+
html: async () => {
|
|
612
|
+
return html`
|
|
613
|
+
<div class="in section-mp" style="text-align: center">
|
|
614
|
+
${Translate.instance('confirm-delete-item')}
|
|
615
|
+
<br />
|
|
616
|
+
"${params.data.title}"
|
|
617
|
+
</div>
|
|
618
|
+
`;
|
|
619
|
+
},
|
|
620
|
+
id: `delete-${params.data._id}`,
|
|
621
|
+
});
|
|
622
|
+
if (confirmResult.status !== 'confirm') return;
|
|
623
|
+
const { data, status, message } = await FileService.delete({
|
|
624
|
+
id: params.data.fileId,
|
|
625
|
+
});
|
|
626
|
+
NotificationManager.Push({
|
|
627
|
+
html: status,
|
|
628
|
+
status,
|
|
629
|
+
});
|
|
630
|
+
if (status === 'error') return;
|
|
631
|
+
}
|
|
632
|
+
const { data, status, message } = await DocumentService.delete({
|
|
633
|
+
id: params.data._id,
|
|
634
|
+
});
|
|
635
|
+
NotificationManager.Push({
|
|
636
|
+
html: status,
|
|
637
|
+
status,
|
|
638
|
+
});
|
|
639
|
+
if (status === 'error') return;
|
|
640
|
+
documentInstance = documentInstance.filter((f) => f._id !== params.data._id);
|
|
641
|
+
const format = FileExplorer.documentDataFormat({ document: documentInstance, location });
|
|
642
|
+
files = format.files;
|
|
643
|
+
folders = format.folders;
|
|
644
|
+
applySearchFilter();
|
|
645
|
+
// AgGrid.grids[gridFileId].setGridOption('rowData', files);
|
|
646
|
+
// const selectedData = gridApi.getSelectedRows();
|
|
647
|
+
AgGrid.grids[gridFileId].applyTransaction({ remove: [params.data] });
|
|
648
|
+
AgGrid.grids[gridFolderId].setGridOption('rowData', folders);
|
|
649
|
+
updatePaginationUI();
|
|
650
|
+
},
|
|
651
|
+
{ context: 'modal' },
|
|
652
|
+
);
|
|
653
|
+
// Toggle public/private status
|
|
654
|
+
EventsUI.onClick(
|
|
655
|
+
`.${toggleId}`,
|
|
656
|
+
async (e) => {
|
|
657
|
+
e.preventDefault();
|
|
658
|
+
// If document is currently private, show confirmation before making public
|
|
659
|
+
if (!params.data.isPublic) {
|
|
660
|
+
const confirmResult = await Modal.RenderConfirm({
|
|
661
|
+
html: async () => {
|
|
662
|
+
return html`
|
|
663
|
+
<div class="in section-mp" style="text-align: center">
|
|
664
|
+
${Translate.instance('confirm-make-public')}
|
|
665
|
+
<br />
|
|
666
|
+
"${params.data.title}"
|
|
667
|
+
</div>
|
|
668
|
+
`;
|
|
669
|
+
},
|
|
670
|
+
id: `confirm-toggle-public-${params.data._id}`,
|
|
671
|
+
});
|
|
672
|
+
if (confirmResult.status !== 'confirm') return;
|
|
673
|
+
}
|
|
674
|
+
try {
|
|
675
|
+
const { data, status } = await DocumentService.patch({
|
|
676
|
+
id: params.data._id,
|
|
677
|
+
action: 'toggle-public',
|
|
678
|
+
});
|
|
679
|
+
if (status === 'success') {
|
|
680
|
+
// Update local data
|
|
681
|
+
params.data.isPublic = data.isPublic;
|
|
682
|
+
// Update documentInstance
|
|
683
|
+
const docIndex = documentInstance.findIndex((d) => d._id === params.data._id);
|
|
684
|
+
if (docIndex !== -1) {
|
|
685
|
+
documentInstance[docIndex].isPublic = data.isPublic;
|
|
686
|
+
}
|
|
687
|
+
// Refresh the isPublic column cell in the grid
|
|
688
|
+
const rowNode = AgGrid.grids[gridFileId].getRowNode(params.node.id);
|
|
689
|
+
if (rowNode) {
|
|
690
|
+
rowNode.setDataValue('isPublic', data.isPublic);
|
|
691
|
+
}
|
|
692
|
+
// Update button icon
|
|
693
|
+
const btnElement = s(`.${toggleId}`);
|
|
694
|
+
if (btnElement) {
|
|
695
|
+
const iconElement = btnElement.querySelector('i');
|
|
696
|
+
if (iconElement) {
|
|
697
|
+
if (data.isPublic) {
|
|
698
|
+
iconElement.className = 'fas fa-globe';
|
|
699
|
+
iconElement.style.color = '#4caf50';
|
|
700
|
+
} else {
|
|
701
|
+
iconElement.className = 'fas fa-lock';
|
|
702
|
+
iconElement.style.color = '#9e9e9e';
|
|
703
|
+
}
|
|
704
|
+
}
|
|
705
|
+
}
|
|
706
|
+
NotificationManager.Push({
|
|
707
|
+
html: data.isPublic
|
|
708
|
+
? Translate.instance('document-now-public')
|
|
709
|
+
: Translate.instance('document-now-private'),
|
|
710
|
+
status: 'success',
|
|
711
|
+
});
|
|
712
|
+
} else {
|
|
713
|
+
throw new Error('Failed to toggle public status');
|
|
714
|
+
}
|
|
715
|
+
} catch (error) {
|
|
716
|
+
logger.error('Toggle public failed:', error);
|
|
717
|
+
NotificationManager.Push({
|
|
718
|
+
html: Translate.instance('error-toggle-public'),
|
|
719
|
+
status: 'error',
|
|
720
|
+
});
|
|
721
|
+
}
|
|
722
|
+
},
|
|
723
|
+
{ context: 'modal' },
|
|
724
|
+
);
|
|
725
|
+
// Edit document button
|
|
726
|
+
EventsUI.onClick(
|
|
727
|
+
`.btn-file-edit-${params.data._id}`,
|
|
728
|
+
async (e) => {
|
|
729
|
+
e.preventDefault();
|
|
730
|
+
// Get the original document data from documentInstance
|
|
731
|
+
const originDoc = documentInstance.find((d) => d._id === params.data._id);
|
|
732
|
+
const editModalId = `edit-doc-${params.data._id}`;
|
|
733
|
+
// Check file existence for proper UX
|
|
734
|
+
const hasMdFile = !!(originDoc && originDoc.mdFileId);
|
|
735
|
+
const hasGenericFile = !!(originDoc && originDoc.fileId);
|
|
736
|
+
const mdFileMimetype = hasMdFile ? originDoc.mdFileId.mimetype : '';
|
|
737
|
+
const genericFileMimetype = hasGenericFile ? originDoc.fileId.mimetype : '';
|
|
738
|
+
const editFormHtml = async () => {
|
|
739
|
+
return html`
|
|
740
|
+
<div class="in edit-document-form" style="max-width: 600px; margin: 0 auto; padding: 20px;">
|
|
741
|
+
<!-- Header -->
|
|
742
|
+
<div
|
|
743
|
+
class="in"
|
|
744
|
+
style="text-align: center; margin-bottom: 25px; padding-bottom: 15px; border-bottom: 1px solid rgba(128,128,128,0.3);"
|
|
745
|
+
>
|
|
746
|
+
<p style="color: #888; font-size: 14px; margin: 0;">
|
|
747
|
+
${Translate.instance('editing')}: <strong style="color: inherit;">${params.data.title}</strong>
|
|
748
|
+
</p>
|
|
749
|
+
</div>
|
|
750
|
+
|
|
751
|
+
<!-- Document Title -->
|
|
752
|
+
<div class="in section-mp" style="margin-bottom: 20px;">
|
|
753
|
+
${await Input.instance({
|
|
754
|
+
id: `edit-doc-title-${params.data._id}`,
|
|
755
|
+
type: 'text',
|
|
756
|
+
label: html`<i class="fas fa-heading"></i> ${Translate.instance('doc-title')}`,
|
|
757
|
+
containerClass: 'in section-mp input-container-width',
|
|
758
|
+
placeholder: true,
|
|
759
|
+
value: params.data.title || '',
|
|
760
|
+
})}
|
|
761
|
+
</div>
|
|
762
|
+
|
|
763
|
+
<!-- MD File Name -->
|
|
764
|
+
<div class="in section-mp" style="margin-bottom: 20px;">
|
|
765
|
+
${hasMdFile
|
|
766
|
+
? await Input.instance({
|
|
767
|
+
id: `edit-doc-md-file-${params.data._id}`,
|
|
768
|
+
type: 'text',
|
|
769
|
+
label: html`<i class="fas fa-file-code"></i> ${Translate.instance('md-file-name')}
|
|
770
|
+
<span style="font-size: 11px; color: #888; margin-left: 8px;">(${mdFileMimetype})</span>`,
|
|
771
|
+
containerClass: 'in section-mp input-container-width',
|
|
772
|
+
placeholder: true,
|
|
773
|
+
value: params.data.mdFileName || '',
|
|
774
|
+
})
|
|
775
|
+
: html`
|
|
776
|
+
<div class="in section-mp input-container-width" style="opacity: 0.6;">
|
|
777
|
+
<label style="display: block; margin-bottom: 5px;">
|
|
778
|
+
<i class="fas fa-file-code"></i> ${Translate.instance('md-file-name')}
|
|
779
|
+
</label>
|
|
780
|
+
<div
|
|
781
|
+
style="padding: 10px 12px; border: 1px dashed rgba(128,128,128,0.5); border-radius: 4px; color: #888; font-style: italic;"
|
|
782
|
+
>
|
|
783
|
+
<i class="fas fa-info-circle"></i> ${Translate.instance('no-md-file-attached')}
|
|
784
|
+
</div>
|
|
785
|
+
</div>
|
|
786
|
+
`}
|
|
787
|
+
</div>
|
|
788
|
+
|
|
789
|
+
<!-- Generic File Name -->
|
|
790
|
+
<div class="in section-mp" style="margin-bottom: 20px;">
|
|
791
|
+
${hasGenericFile
|
|
792
|
+
? await Input.instance({
|
|
793
|
+
id: `edit-doc-file-${params.data._id}`,
|
|
794
|
+
type: 'text',
|
|
795
|
+
label: html`<i class="fas fa-file"></i> ${Translate.instance('generic-file-name')}
|
|
796
|
+
<span style="font-size: 11px; color: #888; margin-left: 8px;"
|
|
797
|
+
>(${genericFileMimetype})</span
|
|
798
|
+
>`,
|
|
799
|
+
containerClass: 'in section-mp input-container-width',
|
|
800
|
+
placeholder: true,
|
|
801
|
+
value: params.data.fileName || '',
|
|
802
|
+
})
|
|
803
|
+
: html`
|
|
804
|
+
<div class="in section-mp input-container-width" style="opacity: 0.6;">
|
|
805
|
+
<label style="display: block; margin-bottom: 5px;">
|
|
806
|
+
<i class="fas fa-file"></i> ${Translate.instance('generic-file-name')}
|
|
807
|
+
</label>
|
|
808
|
+
<div
|
|
809
|
+
style="padding: 10px 12px; border: 1px dashed rgba(128,128,128,0.5); border-radius: 4px; color: #888; font-style: italic;"
|
|
810
|
+
>
|
|
811
|
+
<i class="fas fa-info-circle"></i> ${Translate.instance('no-generic-file-attached')}
|
|
812
|
+
</div>
|
|
813
|
+
</div>
|
|
814
|
+
`}
|
|
815
|
+
</div>
|
|
816
|
+
|
|
817
|
+
<!-- Location -->
|
|
818
|
+
<div class="in section-mp" style="margin-bottom: 25px;">
|
|
819
|
+
${await Input.instance({
|
|
820
|
+
id: `edit-doc-location-${params.data._id}`,
|
|
821
|
+
type: 'text',
|
|
822
|
+
label: html`<i class="fas fa-folder"></i> ${Translate.instance('location')}`,
|
|
823
|
+
containerClass: 'in section-mp input-container-width',
|
|
824
|
+
placeholder: true,
|
|
825
|
+
value: params.data.location || '/',
|
|
826
|
+
})}
|
|
827
|
+
</div>
|
|
828
|
+
|
|
829
|
+
<!-- Buttons -->
|
|
830
|
+
<div
|
|
831
|
+
class="fl"
|
|
832
|
+
style="margin-top: 30px; border-top: 1px solid rgba(128,128,128,0.3); padding-top: 20px;"
|
|
833
|
+
>
|
|
834
|
+
<div class="in fll" style="width: 50%; padding: 5px;">
|
|
835
|
+
${await BtnIcon.instance({
|
|
836
|
+
class: `in wfa btn-edit-doc-cancel-${params.data._id}`,
|
|
837
|
+
label: html`<i class="fas fa-times"></i> ${Translate.instance('cancel')}`,
|
|
838
|
+
type: 'button',
|
|
839
|
+
})}
|
|
840
|
+
</div>
|
|
841
|
+
<div class="in fll" style="width: 50%; padding: 5px;">
|
|
842
|
+
${await BtnIcon.instance({
|
|
843
|
+
class: `in wfa btn-edit-doc-submit-${params.data._id}`,
|
|
844
|
+
label: html`<i class="fas fa-save"></i> ${Translate.instance('save')}`,
|
|
845
|
+
type: 'button',
|
|
846
|
+
})}
|
|
847
|
+
</div>
|
|
848
|
+
</div>
|
|
849
|
+
</div>
|
|
850
|
+
`;
|
|
851
|
+
};
|
|
852
|
+
const { barConfig } = await Themes[Css.currentTheme]();
|
|
853
|
+
await Modal.instance({
|
|
854
|
+
id: editModalId,
|
|
855
|
+
barConfig,
|
|
856
|
+
title: renderViewTitle({
|
|
857
|
+
icon: html`<i class="fas fa-edit"></i>`,
|
|
858
|
+
text: Translate.instance('edit-document'),
|
|
859
|
+
}),
|
|
860
|
+
html: editFormHtml,
|
|
861
|
+
handleType: 'bar',
|
|
862
|
+
maximize: true,
|
|
863
|
+
mode: 'view',
|
|
864
|
+
slideMenu: 'modal-menu',
|
|
865
|
+
RouterInstance: Modal.Data[options.idModal].options.RouterInstance,
|
|
866
|
+
barMode: Modal.Data[options.idModal].options.barMode,
|
|
867
|
+
});
|
|
868
|
+
// Handle submit button
|
|
869
|
+
setTimeout(() => {
|
|
870
|
+
EventsUI.onClick(
|
|
871
|
+
`.btn-edit-doc-submit-${params.data._id}`,
|
|
872
|
+
async (ev) => {
|
|
873
|
+
ev.preventDefault();
|
|
874
|
+
const newTitle = s(`.edit-doc-title-${params.data._id}`).value.trim();
|
|
875
|
+
const newLocation = s(`.edit-doc-location-${params.data._id}`).value.trim();
|
|
876
|
+
// Get file names only if files exist
|
|
877
|
+
const newMdFileName = hasMdFile ? s(`.edit-doc-md-file-${params.data._id}`)?.value.trim() : null;
|
|
878
|
+
const newFileName = hasGenericFile ? s(`.edit-doc-file-${params.data._id}`)?.value.trim() : null;
|
|
879
|
+
if (!newTitle) {
|
|
880
|
+
NotificationManager.Push({
|
|
881
|
+
html: Translate.instance('error-title-required'),
|
|
882
|
+
status: 'error',
|
|
883
|
+
});
|
|
884
|
+
return;
|
|
885
|
+
}
|
|
886
|
+
const formattedLocation = FileExplorer.locationFormat({ f: { location: newLocation || '/' } });
|
|
887
|
+
try {
|
|
888
|
+
const updateBody = {
|
|
889
|
+
title: newTitle,
|
|
890
|
+
location: formattedLocation,
|
|
891
|
+
};
|
|
892
|
+
// Preserve existing fields from the original document
|
|
893
|
+
if (originDoc) {
|
|
894
|
+
if (originDoc.fileId) updateBody.fileId = originDoc.fileId._id || originDoc.fileId;
|
|
895
|
+
if (originDoc.mdFileId) updateBody.mdFileId = originDoc.mdFileId._id || originDoc.mdFileId;
|
|
896
|
+
if (originDoc.tags) updateBody.tags = originDoc.tags;
|
|
897
|
+
if (typeof originDoc.isPublic !== 'undefined') updateBody.isPublic = originDoc.isPublic;
|
|
898
|
+
}
|
|
899
|
+
// Include file name updates if files exist and names changed
|
|
900
|
+
if (hasMdFile && newMdFileName && newMdFileName !== params.data.mdFileName) {
|
|
901
|
+
updateBody.mdFileName = newMdFileName;
|
|
902
|
+
}
|
|
903
|
+
if (hasGenericFile && newFileName && newFileName !== params.data.fileName) {
|
|
904
|
+
updateBody.fileName = newFileName;
|
|
905
|
+
}
|
|
906
|
+
const { data, status } = await DocumentService.put({
|
|
907
|
+
id: params.data._id,
|
|
908
|
+
body: updateBody,
|
|
909
|
+
});
|
|
910
|
+
if (status === 'success') {
|
|
911
|
+
// Check if location changed
|
|
912
|
+
const locationChanged = formattedLocation !== params.data.location;
|
|
913
|
+
// Update local data
|
|
914
|
+
params.data.title = newTitle;
|
|
915
|
+
params.data.name = newTitle;
|
|
916
|
+
params.data.location = formattedLocation;
|
|
917
|
+
if (hasMdFile && newMdFileName) params.data.mdFileName = newMdFileName;
|
|
918
|
+
if (hasGenericFile && newFileName) params.data.fileName = newFileName;
|
|
919
|
+
// Update documentInstance
|
|
920
|
+
const docIndex = documentInstance.findIndex((d) => d._id === params.data._id);
|
|
921
|
+
if (docIndex !== -1) {
|
|
922
|
+
documentInstance[docIndex].title = newTitle;
|
|
923
|
+
documentInstance[docIndex].location = formattedLocation;
|
|
924
|
+
// Update file names in the referenced file objects
|
|
925
|
+
if (hasMdFile && newMdFileName && documentInstance[docIndex].mdFileId) {
|
|
926
|
+
documentInstance[docIndex].mdFileId.name = newMdFileName;
|
|
927
|
+
}
|
|
928
|
+
if (hasGenericFile && newFileName && documentInstance[docIndex].fileId) {
|
|
929
|
+
documentInstance[docIndex].fileId.name = newFileName;
|
|
930
|
+
}
|
|
931
|
+
}
|
|
932
|
+
// Refresh the grid with new location
|
|
933
|
+
const format = FileExplorer.documentDataFormat({ document: documentInstance, location });
|
|
934
|
+
files = format.files;
|
|
935
|
+
folders = format.folders;
|
|
936
|
+
applySearchFilter();
|
|
937
|
+
currentPage = 0;
|
|
938
|
+
displayedFiles = getPagedFiles();
|
|
939
|
+
AgGrid.grids[gridFileId].setGridOption('rowData', displayedFiles);
|
|
940
|
+
AgGrid.grids[gridFolderId].setGridOption('rowData', folders);
|
|
941
|
+
updatePaginationUI();
|
|
942
|
+
NotificationManager.Push({
|
|
943
|
+
html: Translate.instance('success-update-document'),
|
|
944
|
+
status: 'success',
|
|
945
|
+
});
|
|
946
|
+
// If location changed, navigate to the new location
|
|
947
|
+
if (!s(`.file-explorer-query-nav`)) s(`.main-btn-cloud`).click();
|
|
948
|
+
if (locationChanged)
|
|
949
|
+
setTimeout(() => {
|
|
950
|
+
location = formattedLocation;
|
|
951
|
+
setPath(`${window.location.pathname}?location=${location}`);
|
|
952
|
+
s(`.file-explorer-query-nav`).value = location;
|
|
953
|
+
});
|
|
954
|
+
Modal.removeModal(editModalId);
|
|
955
|
+
} else {
|
|
956
|
+
throw new Error('Failed to update document');
|
|
957
|
+
}
|
|
958
|
+
} catch (error) {
|
|
959
|
+
logger.error('Update document failed:', error);
|
|
960
|
+
NotificationManager.Push({
|
|
961
|
+
html: Translate.instance('error-update-document'),
|
|
962
|
+
status: 'error',
|
|
963
|
+
});
|
|
964
|
+
}
|
|
965
|
+
},
|
|
966
|
+
{ context: 'modal' },
|
|
967
|
+
);
|
|
968
|
+
// Handle cancel button
|
|
969
|
+
EventsUI.onClick(
|
|
970
|
+
`.btn-edit-doc-cancel-${params.data._id}`,
|
|
971
|
+
async (ev) => {
|
|
972
|
+
ev.preventDefault();
|
|
973
|
+
Modal.removeModal(editModalId);
|
|
974
|
+
},
|
|
975
|
+
{ context: 'modal' },
|
|
976
|
+
);
|
|
977
|
+
});
|
|
978
|
+
},
|
|
979
|
+
{ context: 'modal' },
|
|
980
|
+
);
|
|
981
|
+
});
|
|
982
|
+
}
|
|
983
|
+
getGui() {
|
|
984
|
+
return this.eGui;
|
|
985
|
+
}
|
|
986
|
+
refresh(params) {
|
|
987
|
+
console.log('LoadFileActionsRenderer refreshed', params);
|
|
988
|
+
return true;
|
|
989
|
+
}
|
|
990
|
+
}
|
|
991
|
+
class LoadFolderActionsRenderer {
|
|
992
|
+
eGui;
|
|
993
|
+
async init(params) {
|
|
994
|
+
console.log('LoadFolderActionsRenderer created', params);
|
|
995
|
+
// params.data._id
|
|
996
|
+
const id = params.data.locationId;
|
|
997
|
+
this.eGui = document.createElement('div');
|
|
998
|
+
this.eGui.innerHTML = html`
|
|
999
|
+
<div class="fl">
|
|
1000
|
+
${await BtnIcon.instance({
|
|
1001
|
+
class: `in fll management-table-btn-mini btn-folder-delete-${id}`,
|
|
1002
|
+
label: html` <i class="fa-solid fa-circle-xmark"></i>`,
|
|
1003
|
+
type: 'button',
|
|
1004
|
+
})}
|
|
1005
|
+
</div>
|
|
1006
|
+
`;
|
|
1007
|
+
setTimeout(() => {
|
|
1008
|
+
EventsUI.onClick(
|
|
1009
|
+
`.btn-folder-delete-${id}`,
|
|
1010
|
+
async (e) => {
|
|
1011
|
+
const confirmResult = await Modal.RenderConfirm({
|
|
1012
|
+
html: async () => {
|
|
1013
|
+
return html`
|
|
1014
|
+
<div class="in section-mp" style="text-align: center">
|
|
1015
|
+
${Translate.instance('confirm-delete-item')}
|
|
1016
|
+
<br />
|
|
1017
|
+
"${params.data.location}"
|
|
1018
|
+
</div>
|
|
1019
|
+
`;
|
|
1020
|
+
},
|
|
1021
|
+
id: `delete-${id}`,
|
|
1022
|
+
});
|
|
1023
|
+
if (confirmResult.status !== 'confirm') return;
|
|
1024
|
+
e.preventDefault();
|
|
1025
|
+
const idFilesDelete = [];
|
|
1026
|
+
for (const file of documentInstance.filter(
|
|
1027
|
+
(f) => FileExplorer.locationFormat({ f }) === params.data.location,
|
|
1028
|
+
)) {
|
|
1029
|
+
{
|
|
1030
|
+
const { data, status, message } = await FileService.delete({
|
|
1031
|
+
id: file.fileId._id,
|
|
1032
|
+
});
|
|
1033
|
+
}
|
|
1034
|
+
{
|
|
1035
|
+
idFilesDelete.push(file._id);
|
|
1036
|
+
const { data, status, message } = await DocumentService.delete({
|
|
1037
|
+
id: file._id,
|
|
1038
|
+
});
|
|
1039
|
+
}
|
|
1040
|
+
}
|
|
1041
|
+
NotificationManager.Push({
|
|
1042
|
+
html: Translate.instance('success-delete'),
|
|
1043
|
+
status: 'success',
|
|
1044
|
+
});
|
|
1045
|
+
documentInstance = documentInstance.filter((f) => !idFilesDelete.includes(f._id));
|
|
1046
|
+
const format = FileExplorer.documentDataFormat({ document: documentInstance, location });
|
|
1047
|
+
files = format.files;
|
|
1048
|
+
folders = format.folders;
|
|
1049
|
+
applySearchFilter();
|
|
1050
|
+
currentPage = 0;
|
|
1051
|
+
displayedFiles = getPagedFiles();
|
|
1052
|
+
AgGrid.grids[gridFileId].setGridOption('rowData', displayedFiles);
|
|
1053
|
+
AgGrid.grids[gridFolderId].setGridOption('rowData', folders);
|
|
1054
|
+
updatePaginationUI();
|
|
1055
|
+
},
|
|
1056
|
+
{ context: 'modal' },
|
|
1057
|
+
);
|
|
1058
|
+
});
|
|
1059
|
+
}
|
|
1060
|
+
getGui() {
|
|
1061
|
+
return this.eGui;
|
|
1062
|
+
}
|
|
1063
|
+
refresh(params) {
|
|
1064
|
+
console.log('LoadFolderActionsRenderer refreshed', params);
|
|
1065
|
+
return true;
|
|
1066
|
+
}
|
|
1067
|
+
}
|
|
1068
|
+
return html`
|
|
1069
|
+
<form>
|
|
1070
|
+
<div class="fl">
|
|
1071
|
+
${await BtnIcon.instance({
|
|
1072
|
+
class: 'in fll management-table-btn-mini btn-input-home-directory',
|
|
1073
|
+
label: html`<i class="fas fa-home"></i>
|
|
1074
|
+
<!-- ${Translate.instance('home-directory')} -->`,
|
|
1075
|
+
type: 'button',
|
|
1076
|
+
})}
|
|
1077
|
+
${await BtnIcon.instance({
|
|
1078
|
+
class: 'in fll management-table-btn-mini btn-input-back-explorer',
|
|
1079
|
+
label: html` <i class="fa-solid fa-circle-left"></i>
|
|
1080
|
+
<!-- ${Translate.instance('go')} -->`,
|
|
1081
|
+
type: 'button',
|
|
1082
|
+
})}
|
|
1083
|
+
${await BtnIcon.instance({
|
|
1084
|
+
class: 'in fll management-table-btn-mini btn-input-forward-explorer',
|
|
1085
|
+
label: html` <i class="fa-solid fa-circle-right"></i>
|
|
1086
|
+
<!-- ${Translate.instance('go')} -->`,
|
|
1087
|
+
type: 'button',
|
|
1088
|
+
})}
|
|
1089
|
+
${await BtnIcon.instance({
|
|
1090
|
+
class: 'in fll management-table-btn-mini btn-input-go-explorer',
|
|
1091
|
+
label: html`<i class="fas fa-sync-alt"></i>
|
|
1092
|
+
<!-- ${Translate.instance('go')} -->`,
|
|
1093
|
+
type: 'submit',
|
|
1094
|
+
})}
|
|
1095
|
+
${await BtnIcon.instance({
|
|
1096
|
+
class: 'in fll management-table-btn-mini btn-input-copy-directory',
|
|
1097
|
+
label: html`<i class="fas fa-copy"></i>
|
|
1098
|
+
<!-- ${Translate.instance('home-directory')} -->`,
|
|
1099
|
+
type: 'button',
|
|
1100
|
+
})}
|
|
1101
|
+
${await BtnIcon.instance({
|
|
1102
|
+
class: 'in fll management-table-btn-mini btn-input-upload-file',
|
|
1103
|
+
label: html`<i class="fa-solid fa-cloud-arrow-up"></i>
|
|
1104
|
+
<!-- ${Translate.instance('home-directory')} -->`,
|
|
1105
|
+
type: 'button',
|
|
1106
|
+
})}
|
|
1107
|
+
</div>
|
|
1108
|
+
<div class="in">
|
|
1109
|
+
${await Input.instance({
|
|
1110
|
+
id: `file-explorer-query-nav`,
|
|
1111
|
+
type: 'text',
|
|
1112
|
+
label: html`<i class="fab fa-wpexplorer"></i> ${Translate.instance('current-path')}`,
|
|
1113
|
+
containerClass: 'in section-mp input-container-width',
|
|
1114
|
+
placeholder: true,
|
|
1115
|
+
value: location,
|
|
1116
|
+
})}
|
|
1117
|
+
</div>
|
|
1118
|
+
${dynamicCol({
|
|
1119
|
+
containerSelector: 'file-explorer-search-container',
|
|
1120
|
+
id: 'file-explorer-search',
|
|
1121
|
+
type: 'search-inputs',
|
|
1122
|
+
})}
|
|
1123
|
+
<div class="fl file-explorer-search-container">
|
|
1124
|
+
<div class="in fll file-explorer-search-col-a">
|
|
1125
|
+
${await Input.instance({
|
|
1126
|
+
id: `file-explorer-search-title`,
|
|
1127
|
+
type: 'text',
|
|
1128
|
+
label: html`<i class="fas fa-search"></i> ${Translate.instance('doc-title')}`,
|
|
1129
|
+
containerClass: 'in section-mp input-container-width',
|
|
1130
|
+
placeholder: true,
|
|
1131
|
+
})}
|
|
1132
|
+
</div>
|
|
1133
|
+
<div class="in fll file-explorer-search-col-b">
|
|
1134
|
+
${await Input.instance({
|
|
1135
|
+
id: `file-explorer-search-md-file`,
|
|
1136
|
+
type: 'text',
|
|
1137
|
+
label: html`<i class="fas fa-file-code"></i> ${Translate.instance('md-file-name')}`,
|
|
1138
|
+
containerClass: 'in section-mp input-container-width',
|
|
1139
|
+
placeholder: true,
|
|
1140
|
+
})}
|
|
1141
|
+
</div>
|
|
1142
|
+
<div class="in fll file-explorer-search-col-c">
|
|
1143
|
+
${await Input.instance({
|
|
1144
|
+
id: `file-explorer-search-file`,
|
|
1145
|
+
type: 'text',
|
|
1146
|
+
label: html`<i class="fas fa-file"></i> ${Translate.instance('generic-file-name')}`,
|
|
1147
|
+
containerClass: 'in section-mp input-container-width',
|
|
1148
|
+
placeholder: true,
|
|
1149
|
+
})}
|
|
1150
|
+
</div>
|
|
1151
|
+
<div
|
|
1152
|
+
class="in fll file-explorer-search-col-d"
|
|
1153
|
+
style="display: flex; align-items: center; justify-content: center; height: 100%;"
|
|
1154
|
+
>
|
|
1155
|
+
${await BtnIcon.instance({
|
|
1156
|
+
class: 'in management-table-btn-mini file-explorer-search-submit',
|
|
1157
|
+
label: html`<i class="fas fa-search"></i>`,
|
|
1158
|
+
type: 'button',
|
|
1159
|
+
style: 'top: 10px; margin-right: 5px;',
|
|
1160
|
+
})}
|
|
1161
|
+
${await BtnIcon.instance({
|
|
1162
|
+
class: 'in management-table-btn-mini file-explorer-search-clear',
|
|
1163
|
+
label: html`<i class="fas fa-broom"></i>`,
|
|
1164
|
+
type: 'button',
|
|
1165
|
+
style: 'top: 10px',
|
|
1166
|
+
})}
|
|
1167
|
+
</div>
|
|
1168
|
+
</div>
|
|
1169
|
+
</form>
|
|
1170
|
+
<div class="fl file-explorer-nav">
|
|
1171
|
+
<div class="in fll explorer-file-col">
|
|
1172
|
+
<div class="in explorer-file-sub-col section-mp">
|
|
1173
|
+
<div class="in">
|
|
1174
|
+
${await AgGrid.instance({
|
|
1175
|
+
id: gridFolderId,
|
|
1176
|
+
darkTheme,
|
|
1177
|
+
// style: {
|
|
1178
|
+
// height: '200px',
|
|
1179
|
+
// },
|
|
1180
|
+
gridOptions: {
|
|
1181
|
+
defaultColDef: {
|
|
1182
|
+
editable: false,
|
|
1183
|
+
minWidth: 100,
|
|
1184
|
+
filter: true,
|
|
1185
|
+
autoHeight: true,
|
|
1186
|
+
},
|
|
1187
|
+
rowData: folders,
|
|
1188
|
+
columnDefs: [
|
|
1189
|
+
{
|
|
1190
|
+
field: 'location',
|
|
1191
|
+
headerName: 'Folder',
|
|
1192
|
+
minWidth: 200,
|
|
1193
|
+
flex: 1,
|
|
1194
|
+
cellStyle: function (params) {
|
|
1195
|
+
return { cursor: 'pointer' };
|
|
1196
|
+
},
|
|
1197
|
+
cellRenderer: LoadFolderRenderer,
|
|
1198
|
+
onCellClicked: (event) => {
|
|
1199
|
+
// console.warn('onCellClicked', event);
|
|
1200
|
+
const newLocation = event.data.location;
|
|
1201
|
+
if (newLocation === location) return;
|
|
1202
|
+
location = newLocation;
|
|
1203
|
+
setPath(`${window.location.pathname}?location=${location}`);
|
|
1204
|
+
s(`.file-explorer-query-nav`).value = location;
|
|
1205
|
+
const format = FileExplorer.documentDataFormat({ document: documentInstance, location });
|
|
1206
|
+
files = format.files;
|
|
1207
|
+
folders = format.folders;
|
|
1208
|
+
applySearchFilter();
|
|
1209
|
+
currentPage = 0;
|
|
1210
|
+
displayedFiles = getPagedFiles();
|
|
1211
|
+
AgGrid.grids[gridFileId].setGridOption('rowData', displayedFiles);
|
|
1212
|
+
AgGrid.grids[gridFolderId].setGridOption('rowData', folders);
|
|
1213
|
+
updatePaginationUI();
|
|
1214
|
+
},
|
|
1215
|
+
},
|
|
1216
|
+
{
|
|
1217
|
+
// suppressHeaderMenuButton: true,
|
|
1218
|
+
// sortable: false,
|
|
1219
|
+
field: 'fileCount',
|
|
1220
|
+
headerName: '🗎',
|
|
1221
|
+
width: 60,
|
|
1222
|
+
cellStyle: function (params) {
|
|
1223
|
+
return { cursor: 'pointer' };
|
|
1224
|
+
},
|
|
1225
|
+
// headerComponent: FolderHeaderComp,
|
|
1226
|
+
// headerComponentParams: {
|
|
1227
|
+
// menuIcon: 'fa-bars',
|
|
1228
|
+
// template: `test`,
|
|
1229
|
+
// },
|
|
1230
|
+
},
|
|
1231
|
+
{ headerName: '', width: 60, cellRenderer: LoadFolderActionsRenderer },
|
|
1232
|
+
],
|
|
1233
|
+
rowSelection: 'single',
|
|
1234
|
+
onSelectionChanged: (event) => {
|
|
1235
|
+
return;
|
|
1236
|
+
const selectedRows = AgGrid.grids[gridFolderId].getSelectedRows();
|
|
1237
|
+
console.log('selectedRows', { event, selectedRows });
|
|
1238
|
+
if (selectedRows[0]) {
|
|
1239
|
+
const newLocation = selectedRows[0].location;
|
|
1240
|
+
if (newLocation === location) return;
|
|
1241
|
+
location = newLocation;
|
|
1242
|
+
setPath(`${window.location.pathname}?location=${location}`);
|
|
1243
|
+
s(`.file-explorer-query-nav`).value = location;
|
|
1244
|
+
const format = FileExplorer.documentDataFormat({ document: documentInstance, location });
|
|
1245
|
+
files = format.files;
|
|
1246
|
+
folders = format.folders;
|
|
1247
|
+
applySearchFilter();
|
|
1248
|
+
currentPage = 0;
|
|
1249
|
+
displayedFiles = getPagedFiles();
|
|
1250
|
+
AgGrid.grids[gridFileId].setGridOption('rowData', displayedFiles);
|
|
1251
|
+
AgGrid.grids[gridFolderId].setGridOption('rowData', folders);
|
|
1252
|
+
updatePaginationUI();
|
|
1253
|
+
}
|
|
1254
|
+
},
|
|
1255
|
+
},
|
|
1256
|
+
})}
|
|
1257
|
+
</div>
|
|
1258
|
+
</div>
|
|
1259
|
+
</div>
|
|
1260
|
+
<div class="in fll explorer-file-col">
|
|
1261
|
+
<div class="in explorer-file-sub-col section-mp">
|
|
1262
|
+
<div class="in">
|
|
1263
|
+
${await AgGrid.instance({
|
|
1264
|
+
id: gridFileId,
|
|
1265
|
+
darkTheme,
|
|
1266
|
+
// style: {
|
|
1267
|
+
// height: '200px',
|
|
1268
|
+
// },
|
|
1269
|
+
gridOptions: {
|
|
1270
|
+
defaultColDef: {
|
|
1271
|
+
editable: false,
|
|
1272
|
+
minWidth: 100,
|
|
1273
|
+
filter: true,
|
|
1274
|
+
autoHeight: true,
|
|
1275
|
+
},
|
|
1276
|
+
// rowData: files,
|
|
1277
|
+
rowData: undefined,
|
|
1278
|
+
columnDefs: [
|
|
1279
|
+
{ field: 'name', flex: 2, headerName: 'Title', cellRenderer: LoadFileNameRenderer },
|
|
1280
|
+
{ field: 'mdFileName', flex: 1, headerName: 'MD File Name' },
|
|
1281
|
+
{ field: 'fileName', flex: 1, headerName: 'Generic File Name' },
|
|
1282
|
+
{
|
|
1283
|
+
field: 'isPublic',
|
|
1284
|
+
headerName: 'Public',
|
|
1285
|
+
width: 90,
|
|
1286
|
+
cellDataType: 'boolean',
|
|
1287
|
+
},
|
|
1288
|
+
{ headerName: '', width: 180, cellRenderer: LoadFileActionsRenderer },
|
|
1289
|
+
],
|
|
1290
|
+
},
|
|
1291
|
+
})}
|
|
1292
|
+
</div>
|
|
1293
|
+
<div class="fl file-explorer-pagination" style="padding: 5px 0;">
|
|
1294
|
+
<div class="in fll" style="width: 33.33%;">
|
|
1295
|
+
${await BtnIcon.instance({
|
|
1296
|
+
class: 'in wfa file-explorer-prev-btn',
|
|
1297
|
+
label: html`<i class="fa-solid fa-chevron-left"></i> ${Translate.instance('previous')}`,
|
|
1298
|
+
type: 'button',
|
|
1299
|
+
})}
|
|
1300
|
+
</div>
|
|
1301
|
+
<div class="in fll" style="width: 33.33%; text-align: center;">
|
|
1302
|
+
<span
|
|
1303
|
+
class="file-explorer-pagination-info"
|
|
1304
|
+
style="display: inline-block; padding: 8px 0; min-width: 100px;"
|
|
1305
|
+
>1 / 1 (0 files)</span
|
|
1306
|
+
>
|
|
1307
|
+
</div>
|
|
1308
|
+
<div class="in fll" style="width: 33.33%;">
|
|
1309
|
+
${await BtnIcon.instance({
|
|
1310
|
+
class: 'in wfa file-explorer-next-btn',
|
|
1311
|
+
label: html`${Translate.instance('next')} <i class="fa-solid fa-chevron-right"></i>`,
|
|
1312
|
+
type: 'button',
|
|
1313
|
+
})}
|
|
1314
|
+
</div>
|
|
1315
|
+
</div>
|
|
1316
|
+
</div>
|
|
1317
|
+
</div>
|
|
1318
|
+
</div>
|
|
1319
|
+
<form class="file-explorer-uploader" style="display: none">
|
|
1320
|
+
${await InputFile.instance(
|
|
1321
|
+
{
|
|
1322
|
+
id: idDropFileInput,
|
|
1323
|
+
multiple: true,
|
|
1324
|
+
},
|
|
1325
|
+
{
|
|
1326
|
+
clear: () => {
|
|
1327
|
+
console.log('file explorer clear file');
|
|
1328
|
+
formBodyFiles = undefined;
|
|
1329
|
+
},
|
|
1330
|
+
change: (e) => {
|
|
1331
|
+
console.log('file explorer change file', e);
|
|
1332
|
+
formBodyFiles = fileFormDataFactory(e);
|
|
1333
|
+
},
|
|
1334
|
+
},
|
|
1335
|
+
)}
|
|
1336
|
+
<div class="in">
|
|
1337
|
+
${await BtnIcon.instance({
|
|
1338
|
+
class: 'wfa section-mp btn-input-file-explorer',
|
|
1339
|
+
style: renderCssAttr({
|
|
1340
|
+
style: {
|
|
1341
|
+
'font-size': '25px',
|
|
1342
|
+
'text-align': 'center',
|
|
1343
|
+
padding: '20px',
|
|
1344
|
+
},
|
|
1345
|
+
}),
|
|
1346
|
+
label: html`<i class="fa-solid fa-cloud-arrow-up"></i> ${Translate.instance('upload')}`,
|
|
1347
|
+
type: 'submit',
|
|
1348
|
+
})}
|
|
1349
|
+
</div>
|
|
1350
|
+
</form>
|
|
1351
|
+
`;
|
|
1352
|
+
}
|
|
1353
|
+
static locationFormat({ f }) {
|
|
1354
|
+
if (f.location[0] !== '/') f.location = `/${f.location}`;
|
|
1355
|
+
if (f.location !== '/' && f.location[f.location.length - 1] === '/') f.location = f.location.slice(0, -1);
|
|
1356
|
+
return f.location;
|
|
1357
|
+
}
|
|
1358
|
+
static documentDataFormat({ document, location, searchFilters }) {
|
|
1359
|
+
let files = document.map((f) => {
|
|
1360
|
+
return {
|
|
1361
|
+
location: FileExplorer.locationFormat({ f }),
|
|
1362
|
+
name: f.title,
|
|
1363
|
+
mdFileName: f.mdFileId?.name || '',
|
|
1364
|
+
fileName: f.fileId?.name || '',
|
|
1365
|
+
// Use the actual file ID for operations (prefer generic file, fallback to md file)
|
|
1366
|
+
fileId: f.fileId?._id || f.mdFileId?._id || null,
|
|
1367
|
+
_id: f._id,
|
|
1368
|
+
title: f.title,
|
|
1369
|
+
isPublic: f.isPublic || false,
|
|
1370
|
+
// Track file existence for edit form
|
|
1371
|
+
hasMdFile: !!f.mdFileId,
|
|
1372
|
+
hasGenericFile: !!f.fileId,
|
|
1373
|
+
};
|
|
1374
|
+
});
|
|
1375
|
+
let documentId = document._id;
|
|
1376
|
+
let folders = [];
|
|
1377
|
+
for (const folderPath of uniqueArray(files.map((f) => f.location)))
|
|
1378
|
+
folders = ['/'].concat(folders.concat(getSubpaths(folderPath)));
|
|
1379
|
+
folders = uniqueArray(folders).map((f, i) => {
|
|
1380
|
+
return {
|
|
1381
|
+
location: f,
|
|
1382
|
+
locationId: `loc-${i}`,
|
|
1383
|
+
};
|
|
1384
|
+
});
|
|
1385
|
+
const isSearching = searchFilters && (searchFilters.title || searchFilters.mdFile || searchFilters.file);
|
|
1386
|
+
if (!isSearching) {
|
|
1387
|
+
files = files.filter((f) => f.location === location);
|
|
1388
|
+
folders = folders
|
|
1389
|
+
.filter((f) => f.location.startsWith(location))
|
|
1390
|
+
.map((f) => {
|
|
1391
|
+
f.fileCount = document.filter((file) => file.location === f.location).length;
|
|
1392
|
+
return f;
|
|
1393
|
+
})
|
|
1394
|
+
.filter((f) => f.fileCount > 0);
|
|
1395
|
+
} else {
|
|
1396
|
+
folders = folders
|
|
1397
|
+
.map((f) => {
|
|
1398
|
+
f.fileCount = files.filter((file) => file.location === f.location).length;
|
|
1399
|
+
return f;
|
|
1400
|
+
})
|
|
1401
|
+
.filter((f) => f.fileCount > 0);
|
|
1402
|
+
}
|
|
1403
|
+
return { files, documentId, folders };
|
|
1404
|
+
}
|
|
1405
|
+
}
|
|
1406
|
+
export { FileExplorer };
|