create-windy 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +114 -0
- package/assets/LICENSE-Apache-2.0.txt +201 -0
- package/dist/cli.js +1662 -0
- package/package.json +37 -0
- package/template/.dockerignore +11 -0
- package/template/.oxfmtrc.json +9 -0
- package/template/.oxlintrc.json +119 -0
- package/template/.windy-template.json +71 -0
- package/template/AGENTS.md +87 -0
- package/template/README.md +128 -0
- package/template/apps/server/Dockerfile +34 -0
- package/template/apps/server/package.json +30 -0
- package/template/apps/server/src/access-guards.ts +112 -0
- package/template/apps/server/src/admin/routes.test.ts +105 -0
- package/template/apps/server/src/admin/routes.ts +95 -0
- package/template/apps/server/src/agent/data-scope-routes.test.ts +143 -0
- package/template/apps/server/src/agent/routes.test.ts +244 -0
- package/template/apps/server/src/agent/routes.ts +257 -0
- package/template/apps/server/src/api-app.ts +32 -0
- package/template/apps/server/src/application-services.ts +154 -0
- package/template/apps/server/src/audit/contracts.ts +21 -0
- package/template/apps/server/src/audit/drizzle-log-store.ts +150 -0
- package/template/apps/server/src/audit/policy.ts +18 -0
- package/template/apps/server/src/audit/recovery-queue.test.ts +42 -0
- package/template/apps/server/src/audit/recovery-queue.ts +63 -0
- package/template/apps/server/src/audit/redaction.ts +55 -0
- package/template/apps/server/src/audit/reliable-writer.test.ts +200 -0
- package/template/apps/server/src/audit/reliable-writer.ts +201 -0
- package/template/apps/server/src/audit/search-summary.ts +32 -0
- package/template/apps/server/src/auth/actor-resolver.test.ts +138 -0
- package/template/apps/server/src/auth/actor-resolver.ts +109 -0
- package/template/apps/server/src/auth/authentication-provider.test.ts +180 -0
- package/template/apps/server/src/auth/authentication-provider.ts +117 -0
- package/template/apps/server/src/auth/authorization-snapshot.test.ts +117 -0
- package/template/apps/server/src/auth/authorization-snapshot.ts +98 -0
- package/template/apps/server/src/auth/bearer-token.ts +5 -0
- package/template/apps/server/src/auth/bootstrap-admin.ts +33 -0
- package/template/apps/server/src/auth/credential-restriction.ts +29 -0
- package/template/apps/server/src/auth/credential-routes.test.ts +190 -0
- package/template/apps/server/src/auth/credential-service.ts +165 -0
- package/template/apps/server/src/auth/development-bypass.ts +22 -0
- package/template/apps/server/src/auth/drizzle-repository.ts +315 -0
- package/template/apps/server/src/auth/drizzle-session-operations.ts +119 -0
- package/template/apps/server/src/auth/login-routes.ts +121 -0
- package/template/apps/server/src/auth/own-session-routes.test.ts +248 -0
- package/template/apps/server/src/auth/own-session-routes.ts +110 -0
- package/template/apps/server/src/auth/password.test.ts +30 -0
- package/template/apps/server/src/auth/password.ts +46 -0
- package/template/apps/server/src/auth/repository.test.ts +61 -0
- package/template/apps/server/src/auth/repository.ts +305 -0
- package/template/apps/server/src/auth/routes.test.ts +350 -0
- package/template/apps/server/src/auth/routes.ts +237 -0
- package/template/apps/server/src/auth/runtime.ts +20 -0
- package/template/apps/server/src/auth/service.ts +329 -0
- package/template/apps/server/src/auth/session-service.ts +123 -0
- package/template/apps/server/src/background/task-guard.test.ts +66 -0
- package/template/apps/server/src/background/task-guard.ts +49 -0
- package/template/apps/server/src/bulk-data/artifact-store.ts +82 -0
- package/template/apps/server/src/bulk-data/dictionary-handler.ts +122 -0
- package/template/apps/server/src/bulk-data/drizzle-repository.integration.test.ts +156 -0
- package/template/apps/server/src/bulk-data/drizzle-repository.ts +298 -0
- package/template/apps/server/src/bulk-data/helpers.ts +36 -0
- package/template/apps/server/src/bulk-data/input-validation.ts +99 -0
- package/template/apps/server/src/bulk-data/repository.ts +246 -0
- package/template/apps/server/src/bulk-data/resource-handler.ts +27 -0
- package/template/apps/server/src/bulk-data/routes.test.ts +169 -0
- package/template/apps/server/src/bulk-data/routes.ts +248 -0
- package/template/apps/server/src/bulk-data/scheduler-integration.test.ts +142 -0
- package/template/apps/server/src/bulk-data/service.test.ts +347 -0
- package/template/apps/server/src/bulk-data/service.ts +319 -0
- package/template/apps/server/src/bulk-data/types.ts +73 -0
- package/template/apps/server/src/configuration/bootstrap.ts +59 -0
- package/template/apps/server/src/configuration/definition.ts +89 -0
- package/template/apps/server/src/configuration/drizzle-repository.ts +166 -0
- package/template/apps/server/src/configuration/repository.ts +138 -0
- package/template/apps/server/src/configuration/routes.test.ts +178 -0
- package/template/apps/server/src/configuration/routes.ts +260 -0
- package/template/apps/server/src/configuration/service.test.ts +128 -0
- package/template/apps/server/src/configuration/service.ts +187 -0
- package/template/apps/server/src/data-access/context.ts +162 -0
- package/template/apps/server/src/data-access/department-tree.ts +27 -0
- package/template/apps/server/src/data-access/drizzle-predicate.test.ts +86 -0
- package/template/apps/server/src/data-access/drizzle-predicate.ts +50 -0
- package/template/apps/server/src/data-access/errors.ts +5 -0
- package/template/apps/server/src/data-access/platform-actor.ts +25 -0
- package/template/apps/server/src/data-access/query-specification.test.ts +82 -0
- package/template/apps/server/src/data-access/query-specification.ts +77 -0
- package/template/apps/server/src/data-access/scoped-repository.integration.test.ts +203 -0
- package/template/apps/server/src/data-access/scoped-repository.ts +268 -0
- package/template/apps/server/src/data-access/scoped-resource.test.ts +158 -0
- package/template/apps/server/src/data-access/scoped-resource.ts +141 -0
- package/template/apps/server/src/data-governance/export/approval-port.ts +84 -0
- package/template/apps/server/src/data-governance/export/authorization-port.test.ts +103 -0
- package/template/apps/server/src/data-governance/export/authorization-port.ts +69 -0
- package/template/apps/server/src/data-governance/export/drizzle-repository.integration.test.ts +88 -0
- package/template/apps/server/src/data-governance/export/drizzle-repository.ts +97 -0
- package/template/apps/server/src/data-governance/export/job-runtime.test.ts +339 -0
- package/template/apps/server/src/data-governance/export/job-runtime.ts +242 -0
- package/template/apps/server/src/data-governance/export/ndjson-stream.ts +62 -0
- package/template/apps/server/src/data-governance/export/postgres-api-actors.ts +140 -0
- package/template/apps/server/src/data-governance/export/postgres-api-assertions.ts +76 -0
- package/template/apps/server/src/data-governance/export/postgres-api-fixture.ts +265 -0
- package/template/apps/server/src/data-governance/export/postgres-api.integration.test.ts +298 -0
- package/template/apps/server/src/data-governance/export/postgres-recovery.integration.test.ts +344 -0
- package/template/apps/server/src/data-governance/export/repository.test.ts +55 -0
- package/template/apps/server/src/data-governance/export/repository.ts +83 -0
- package/template/apps/server/src/data-governance/export/request-fingerprint.test.ts +51 -0
- package/template/apps/server/src/data-governance/export/request-fingerprint.ts +45 -0
- package/template/apps/server/src/data-governance/export/routes-integrity.test.ts +90 -0
- package/template/apps/server/src/data-governance/export/routes-test-fixture.ts +239 -0
- package/template/apps/server/src/data-governance/export/routes.test.ts +182 -0
- package/template/apps/server/src/data-governance/export/routes.ts +215 -0
- package/template/apps/server/src/data-governance/export/scope-snapshot.test.ts +45 -0
- package/template/apps/server/src/data-governance/export/scope-snapshot.ts +27 -0
- package/template/apps/server/src/data-governance/export/service.ts +337 -0
- package/template/apps/server/src/data-governance/export/source.ts +69 -0
- package/template/apps/server/src/data-governance/export/types.ts +55 -0
- package/template/apps/server/src/data-governance/plaintext-access.test.ts +70 -0
- package/template/apps/server/src/data-governance/plaintext-access.ts +88 -0
- package/template/apps/server/src/data-governance/plaintext-postgres.integration.test.ts +223 -0
- package/template/apps/server/src/data-governance/user-plaintext-routes.test.ts +287 -0
- package/template/apps/server/src/data-governance/user-plaintext-routes.ts +181 -0
- package/template/apps/server/src/data-governance/user-projection.ts +54 -0
- package/template/apps/server/src/data-governance/user-sensitive-read-service.ts +54 -0
- package/template/apps/server/src/example-modules.ts +62 -0
- package/template/apps/server/src/example-permissions.ts +5 -0
- package/template/apps/server/src/feature/manifest-feature-repository.test.ts +187 -0
- package/template/apps/server/src/feature/manifest-feature-repository.ts +200 -0
- package/template/apps/server/src/feature/routes.authorization.test.ts +199 -0
- package/template/apps/server/src/feature/routes.ts +193 -0
- package/template/apps/server/src/foundation-access.test.ts +50 -0
- package/template/apps/server/src/foundation-access.ts +34 -0
- package/template/apps/server/src/foundation-route.ts +55 -0
- package/template/apps/server/src/foundation.ts +85 -0
- package/template/apps/server/src/guards.test.ts +74 -0
- package/template/apps/server/src/guards.ts +214 -0
- package/template/apps/server/src/http-app.test.ts +77 -0
- package/template/apps/server/src/http-app.ts +51 -0
- package/template/apps/server/src/index.ts +374 -0
- package/template/apps/server/src/jobs/artifact-service.test.ts +78 -0
- package/template/apps/server/src/jobs/artifact-service.ts +94 -0
- package/template/apps/server/src/jobs/drizzle-artifact.ts +63 -0
- package/template/apps/server/src/jobs/drizzle-claim.ts +111 -0
- package/template/apps/server/src/jobs/drizzle-execution-repository.ts +299 -0
- package/template/apps/server/src/jobs/drizzle-execution.integration.test.ts +232 -0
- package/template/apps/server/src/jobs/drizzle-lease.ts +21 -0
- package/template/apps/server/src/jobs/drizzle-mappers.ts +121 -0
- package/template/apps/server/src/jobs/drizzle-recovery-repository.ts +214 -0
- package/template/apps/server/src/jobs/drizzle-repository.integration.test.ts +135 -0
- package/template/apps/server/src/jobs/drizzle-repository.ts +268 -0
- package/template/apps/server/src/jobs/execution-repository.ts +72 -0
- package/template/apps/server/src/jobs/execution.test.ts +303 -0
- package/template/apps/server/src/jobs/handler-registry.ts +81 -0
- package/template/apps/server/src/jobs/in-memory-claim.ts +96 -0
- package/template/apps/server/src/jobs/in-memory-execution.ts +336 -0
- package/template/apps/server/src/jobs/in-memory-lease.ts +66 -0
- package/template/apps/server/src/jobs/legacy-adapter.integration.test.ts +177 -0
- package/template/apps/server/src/jobs/legacy-adapter.test.ts +199 -0
- package/template/apps/server/src/jobs/legacy-adapter.ts +109 -0
- package/template/apps/server/src/jobs/legacy-service-runtime.ts +95 -0
- package/template/apps/server/src/jobs/repository.ts +141 -0
- package/template/apps/server/src/jobs/service.test.ts +64 -0
- package/template/apps/server/src/jobs/service.ts +44 -0
- package/template/apps/server/src/jobs/types.ts +180 -0
- package/template/apps/server/src/jobs/worker.ts +258 -0
- package/template/apps/server/src/license/legacy-license-resolver.ts +23 -0
- package/template/apps/server/src/license/license-resolver.test.ts +55 -0
- package/template/apps/server/src/license/license-resolver.ts +122 -0
- package/template/apps/server/src/license/reminder.test.ts +61 -0
- package/template/apps/server/src/license/reminder.ts +33 -0
- package/template/apps/server/src/license/restriction.test.ts +54 -0
- package/template/apps/server/src/license/restriction.ts +80 -0
- package/template/apps/server/src/license/routes-offline-code.test.ts +173 -0
- package/template/apps/server/src/license/routes.ts +99 -0
- package/template/apps/server/src/license/runtime-audit-reliability.test.ts +96 -0
- package/template/apps/server/src/license/runtime-reminder.test.ts +147 -0
- package/template/apps/server/src/license/runtime-service-test-http.ts +28 -0
- package/template/apps/server/src/license/runtime-service.test.ts +334 -0
- package/template/apps/server/src/license/runtime-service.ts +308 -0
- package/template/apps/server/src/module-composition.test.ts +70 -0
- package/template/apps/server/src/module-composition.ts +28 -0
- package/template/apps/server/src/notification/drizzle-repository.ts +233 -0
- package/template/apps/server/src/notification/repository.ts +160 -0
- package/template/apps/server/src/notification/routes.test.ts +151 -0
- package/template/apps/server/src/notification/routes.ts +185 -0
- package/template/apps/server/src/observability/bootstrap.ts +56 -0
- package/template/apps/server/src/observability/http-observability.test.ts +53 -0
- package/template/apps/server/src/observability/http-observability.ts +54 -0
- package/template/apps/server/src/observability/metrics.test.ts +36 -0
- package/template/apps/server/src/observability/metrics.ts +105 -0
- package/template/apps/server/src/observability/readiness.test.ts +36 -0
- package/template/apps/server/src/observability/readiness.ts +43 -0
- package/template/apps/server/src/observability/routes.test.ts +61 -0
- package/template/apps/server/src/observability/routes.ts +44 -0
- package/template/apps/server/src/pagination.ts +31 -0
- package/template/apps/server/src/persistence.integration.test.ts +54 -0
- package/template/apps/server/src/persistence.ts +118 -0
- package/template/apps/server/src/profile/routes.test.ts +190 -0
- package/template/apps/server/src/profile/routes.ts +173 -0
- package/template/apps/server/src/request-restriction.ts +29 -0
- package/template/apps/server/src/route-guards.test.ts +148 -0
- package/template/apps/server/src/route-guards.ts +63 -0
- package/template/apps/server/src/runtime-audit-list.test.ts +98 -0
- package/template/apps/server/src/runtime-config.ts +11 -0
- package/template/apps/server/src/runtime-development.ts +68 -0
- package/template/apps/server/src/runtime-license.ts +50 -0
- package/template/apps/server/src/runtime.test.ts +264 -0
- package/template/apps/server/src/runtime.ts +324 -0
- package/template/apps/server/src/scheduler/audit.ts +38 -0
- package/template/apps/server/src/scheduler/definitions.test.ts +35 -0
- package/template/apps/server/src/scheduler/definitions.ts +79 -0
- package/template/apps/server/src/scheduler/drizzle-durable-links.ts +52 -0
- package/template/apps/server/src/scheduler/drizzle-mappers.ts +36 -0
- package/template/apps/server/src/scheduler/drizzle-repository.integration.test.ts +174 -0
- package/template/apps/server/src/scheduler/drizzle-repository.ts +348 -0
- package/template/apps/server/src/scheduler/execution-context.ts +24 -0
- package/template/apps/server/src/scheduler/execution-recorder.ts +101 -0
- package/template/apps/server/src/scheduler/feature-preflight.ts +40 -0
- package/template/apps/server/src/scheduler/history.ts +22 -0
- package/template/apps/server/src/scheduler/overview.test.ts +89 -0
- package/template/apps/server/src/scheduler/overview.ts +125 -0
- package/template/apps/server/src/scheduler/recovery-conflict.ts +19 -0
- package/template/apps/server/src/scheduler/recovery-service.test.ts +238 -0
- package/template/apps/server/src/scheduler/recovery-service.ts +152 -0
- package/template/apps/server/src/scheduler/repository.ts +274 -0
- package/template/apps/server/src/scheduler/routes.test.ts +347 -0
- package/template/apps/server/src/scheduler/routes.ts +222 -0
- package/template/apps/server/src/scheduler/sensitive-text.ts +20 -0
- package/template/apps/server/src/scheduler/service-idle.test.ts +73 -0
- package/template/apps/server/src/scheduler/service.test.ts +330 -0
- package/template/apps/server/src/scheduler/service.ts +339 -0
- package/template/apps/server/src/scheduler/types.ts +103 -0
- package/template/apps/server/src/scheduler/worker.ts +38 -0
- package/template/apps/server/src/search/config.test.ts +43 -0
- package/template/apps/server/src/search/config.ts +62 -0
- package/template/apps/server/src/search/contracts.ts +127 -0
- package/template/apps/server/src/search/cursor.ts +39 -0
- package/template/apps/server/src/search/errors.ts +11 -0
- package/template/apps/server/src/search/host.ts +36 -0
- package/template/apps/server/src/search/masking.ts +6 -0
- package/template/apps/server/src/search/provider-execution.ts +195 -0
- package/template/apps/server/src/search/rate-limiter.ts +23 -0
- package/template/apps/server/src/search/registry.ts +105 -0
- package/template/apps/server/src/search/routes.test.ts +156 -0
- package/template/apps/server/src/search/routes.ts +95 -0
- package/template/apps/server/src/search/service.test.ts +314 -0
- package/template/apps/server/src/search/service.ts +257 -0
- package/template/apps/server/src/search/test-support.ts +122 -0
- package/template/apps/server/src/session/routes.test.ts +111 -0
- package/template/apps/server/src/session/routes.ts +56 -0
- package/template/apps/server/src/settings/drizzle-repository.ts +66 -0
- package/template/apps/server/src/settings/repository.ts +29 -0
- package/template/apps/server/src/settings/routes.test.ts +250 -0
- package/template/apps/server/src/settings/routes.ts +175 -0
- package/template/apps/server/src/settings/runtime.ts +13 -0
- package/template/apps/server/src/storage/blob-reference-registry.test.ts +25 -0
- package/template/apps/server/src/storage/blob-reference-registry.ts +15 -0
- package/template/apps/server/src/storage/drizzle-upload-repository.integration.test.ts +136 -0
- package/template/apps/server/src/storage/drizzle-upload-repository.ts +248 -0
- package/template/apps/server/src/storage/route-support.ts +84 -0
- package/template/apps/server/src/storage/routes.test.ts +288 -0
- package/template/apps/server/src/storage/routes.ts +297 -0
- package/template/apps/server/src/storage/runtime.ts +86 -0
- package/template/apps/server/src/system/audit-query.ts +17 -0
- package/template/apps/server/src/system/audit-routes.test.ts +139 -0
- package/template/apps/server/src/system/audit-routes.ts +113 -0
- package/template/apps/server/src/system/built-in-roles.ts +116 -0
- package/template/apps/server/src/system/department-routes.test.ts +80 -0
- package/template/apps/server/src/system/department-routes.ts +90 -0
- package/template/apps/server/src/system/drizzle-mapping.ts +53 -0
- package/template/apps/server/src/system/drizzle-repository.ts +298 -0
- package/template/apps/server/src/system/drizzle-scoped-repository.ts +235 -0
- package/template/apps/server/src/system/drizzle-system.ts +361 -0
- package/template/apps/server/src/system/entities.ts +78 -0
- package/template/apps/server/src/system/feature-routes.test.ts +55 -0
- package/template/apps/server/src/system/identity-route-config.ts +73 -0
- package/template/apps/server/src/system/interface-catalog.test.ts +103 -0
- package/template/apps/server/src/system/interface-catalog.ts +82 -0
- package/template/apps/server/src/system/menu-registry.test.ts +125 -0
- package/template/apps/server/src/system/menu-registry.ts +259 -0
- package/template/apps/server/src/system/menu-routes.test.ts +68 -0
- package/template/apps/server/src/system/menu-routes.ts +200 -0
- package/template/apps/server/src/system/mutation-runner.ts +33 -0
- package/template/apps/server/src/system/operation-monitoring.test.ts +78 -0
- package/template/apps/server/src/system/operation-monitoring.ts +233 -0
- package/template/apps/server/src/system/operations.test.ts +269 -0
- package/template/apps/server/src/system/operations.ts +155 -0
- package/template/apps/server/src/system/postgres-monitoring.ts +31 -0
- package/template/apps/server/src/system/redis-health.test.ts +116 -0
- package/template/apps/server/src/system/redis-health.ts +230 -0
- package/template/apps/server/src/system/repository.ts +234 -0
- package/template/apps/server/src/system/resource-access-response.ts +47 -0
- package/template/apps/server/src/system/resource-export-route.ts +64 -0
- package/template/apps/server/src/system/resource-route-support.ts +50 -0
- package/template/apps/server/src/system/response-projection.ts +24 -0
- package/template/apps/server/src/system/route-helpers.ts +104 -0
- package/template/apps/server/src/system/route-test-app.ts +27 -0
- package/template/apps/server/src/system/route-types.ts +52 -0
- package/template/apps/server/src/system/routes-validation.test.ts +61 -0
- package/template/apps/server/src/system/routes.test.ts +311 -0
- package/template/apps/server/src/system/routes.ts +354 -0
- package/template/apps/server/src/system/seed.test.ts +129 -0
- package/template/apps/server/src/system/seed.ts +237 -0
- package/template/apps/server/src/system/user-account-policy.test.ts +158 -0
- package/template/apps/server/src/system/user-account-policy.ts +103 -0
- package/template/apps/server/src/system/user-data-scope.ts +10 -0
- package/template/apps/server/src/system/user-department-validation.ts +17 -0
- package/template/apps/server/src/system/user-projection.test.ts +40 -0
- package/template/apps/server/src/system/user-projection.ts +35 -0
- package/template/apps/server/src/work-order/data-scope.integration.test.ts +171 -0
- package/template/apps/server/src/work-order/drizzle-repository.integration.test.ts +78 -0
- package/template/apps/server/src/work-order/drizzle-repository.ts +67 -0
- package/template/apps/server/src/work-order/foundation-modules.test.ts +85 -0
- package/template/apps/server/src/work-order/repository.ts +46 -0
- package/template/apps/server/src/work-order/routes.test.ts +209 -0
- package/template/apps/server/src/work-order/routes.ts +159 -0
- package/template/apps/server/src/work-order/search-api.test.ts +121 -0
- package/template/apps/server/src/work-order/search-provider.test.ts +201 -0
- package/template/apps/server/src/work-order/search-provider.ts +59 -0
- package/template/apps/server/src/work-order/service.ts +82 -0
- package/template/apps/server/src/work-order/task.test.ts +79 -0
- package/template/apps/server/src/work-order/task.ts +30 -0
- package/template/apps/server/src/workflow/assignee-directory.ts +23 -0
- package/template/apps/server/src/workflow/drizzle-repository.integration.test.ts +213 -0
- package/template/apps/server/src/workflow/drizzle-repository.ts +299 -0
- package/template/apps/server/src/workflow/effects.test.ts +64 -0
- package/template/apps/server/src/workflow/effects.ts +112 -0
- package/template/apps/server/src/workflow/repository.ts +160 -0
- package/template/apps/server/src/workflow/routes.test.ts +256 -0
- package/template/apps/server/src/workflow/routes.ts +249 -0
- package/template/apps/server/src/workflow/service.ts +196 -0
- package/template/apps/server/src/workflow/timeout-runtime.test.ts +96 -0
- package/template/apps/server/src/workflow/timeout-runtime.ts +66 -0
- package/template/apps/server/tsconfig.json +17 -0
- package/template/apps/web/Dockerfile +41 -0
- package/template/apps/web/components.json +24 -0
- package/template/apps/web/dev/dev-identity.ts +58 -0
- package/template/apps/web/dev/dev-port.test.ts +53 -0
- package/template/apps/web/dev/dev-port.ts +68 -0
- package/template/apps/web/dev/start.ts +37 -0
- package/template/apps/web/index.html +14 -0
- package/template/apps/web/package.json +44 -0
- package/template/apps/web/runtime-server.test.ts +86 -0
- package/template/apps/web/runtime-server.ts +143 -0
- package/template/apps/web/server.ts +21 -0
- package/template/apps/web/src/App.vue +22 -0
- package/template/apps/web/src/app/home/HomePage.vue +75 -0
- package/template/apps/web/src/app/home/HomeWelcome.vue +85 -0
- package/template/apps/web/src/app/home/HomeWelcome.webtest.ts +32 -0
- package/template/apps/web/src/app/layouts/AppLayout.vue +10 -0
- package/template/apps/web/src/components/auth/DevelopmentAuthWarning.vue +15 -0
- package/template/apps/web/src/components/auth/LoginForm.vue +80 -0
- package/template/apps/web/src/components/auth/LoginForm.webtest.ts +33 -0
- package/template/apps/web/src/components/auth/PasswordChangeForm.vue +90 -0
- package/template/apps/web/src/components/auth/UserSessionMenu.vue +60 -0
- package/template/apps/web/src/components/auth/UserSessionMenu.webtest.ts +45 -0
- package/template/apps/web/src/components/common/ConfirmDialog.vue +75 -0
- package/template/apps/web/src/components/common/DataPagination.vue +79 -0
- package/template/apps/web/src/components/common/DataPagination.webtest.ts +28 -0
- package/template/apps/web/src/components/common/EmptyState.vue +43 -0
- package/template/apps/web/src/components/common/FormDialog.vue +86 -0
- package/template/apps/web/src/components/common/ModalBody.vue +19 -0
- package/template/apps/web/src/components/common/ModalLayout.webtest.ts +54 -0
- package/template/apps/web/src/components/common/PageError.vue +46 -0
- package/template/apps/web/src/components/common/PageLoading.vue +41 -0
- package/template/apps/web/src/components/common/StatusSummary.vue +37 -0
- package/template/apps/web/src/components/common/UnsavedChangesDialog.vue +60 -0
- package/template/apps/web/src/components/common/UnsavedChangesDialog.webtest.ts +60 -0
- package/template/apps/web/src/components/license/LicenseActivationCodeForm.vue +80 -0
- package/template/apps/web/src/components/license/LicenseExpiryBanner.vue +54 -0
- package/template/apps/web/src/components/license/LicenseFlow.webtest.ts +170 -0
- package/template/apps/web/src/components/license/LicenseStatusCard.vue +95 -0
- package/template/apps/web/src/components/license/LicenseUploadForm.vue +79 -0
- package/template/apps/web/src/components/license/license-display.ts +12 -0
- package/template/apps/web/src/components/ui/alert/Alert.vue +21 -0
- package/template/apps/web/src/components/ui/alert/AlertAction.vue +17 -0
- package/template/apps/web/src/components/ui/alert/AlertDescription.vue +22 -0
- package/template/apps/web/src/components/ui/alert/AlertTitle.vue +22 -0
- package/template/apps/web/src/components/ui/alert/index.ts +25 -0
- package/template/apps/web/src/components/ui/badge/Badge.vue +29 -0
- package/template/apps/web/src/components/ui/badge/index.ts +28 -0
- package/template/apps/web/src/components/ui/breadcrumb/Breadcrumb.vue +18 -0
- package/template/apps/web/src/components/ui/breadcrumb/BreadcrumbEllipsis.vue +26 -0
- package/template/apps/web/src/components/ui/breadcrumb/BreadcrumbItem.vue +17 -0
- package/template/apps/web/src/components/ui/breadcrumb/BreadcrumbLink.vue +24 -0
- package/template/apps/web/src/components/ui/breadcrumb/BreadcrumbList.vue +22 -0
- package/template/apps/web/src/components/ui/breadcrumb/BreadcrumbPage.vue +20 -0
- package/template/apps/web/src/components/ui/breadcrumb/BreadcrumbSeparator.vue +23 -0
- package/template/apps/web/src/components/ui/breadcrumb/index.ts +7 -0
- package/template/apps/web/src/components/ui/button/Button.vue +31 -0
- package/template/apps/web/src/components/ui/button/index.ts +42 -0
- package/template/apps/web/src/components/ui/card/Card.vue +29 -0
- package/template/apps/web/src/components/ui/card/CardAction.vue +22 -0
- package/template/apps/web/src/components/ui/card/CardContent.vue +17 -0
- package/template/apps/web/src/components/ui/card/CardDescription.vue +17 -0
- package/template/apps/web/src/components/ui/card/CardFooter.vue +22 -0
- package/template/apps/web/src/components/ui/card/CardHeader.vue +22 -0
- package/template/apps/web/src/components/ui/card/CardTitle.vue +22 -0
- package/template/apps/web/src/components/ui/card/index.ts +7 -0
- package/template/apps/web/src/components/ui/checkbox/Checkbox.vue +41 -0
- package/template/apps/web/src/components/ui/checkbox/index.ts +1 -0
- package/template/apps/web/src/components/ui/dialog/Dialog.vue +15 -0
- package/template/apps/web/src/components/ui/dialog/DialogClose.vue +12 -0
- package/template/apps/web/src/components/ui/dialog/DialogContent.vue +62 -0
- package/template/apps/web/src/components/ui/dialog/DialogDescription.vue +30 -0
- package/template/apps/web/src/components/ui/dialog/DialogFooter.vue +33 -0
- package/template/apps/web/src/components/ui/dialog/DialogHeader.vue +17 -0
- package/template/apps/web/src/components/ui/dialog/DialogOverlay.vue +28 -0
- package/template/apps/web/src/components/ui/dialog/DialogScrollContent.vue +67 -0
- package/template/apps/web/src/components/ui/dialog/DialogTitle.vue +27 -0
- package/template/apps/web/src/components/ui/dialog/DialogTrigger.vue +12 -0
- package/template/apps/web/src/components/ui/dialog/index.ts +10 -0
- package/template/apps/web/src/components/ui/dropdown-menu/DropdownMenu.vue +19 -0
- package/template/apps/web/src/components/ui/dropdown-menu/DropdownMenuCheckboxItem.vue +50 -0
- package/template/apps/web/src/components/ui/dropdown-menu/DropdownMenuContent.vue +48 -0
- package/template/apps/web/src/components/ui/dropdown-menu/DropdownMenuGroup.vue +12 -0
- package/template/apps/web/src/components/ui/dropdown-menu/DropdownMenuItem.vue +41 -0
- package/template/apps/web/src/components/ui/dropdown-menu/DropdownMenuLabel.vue +30 -0
- package/template/apps/web/src/components/ui/dropdown-menu/DropdownMenuRadioGroup.vue +21 -0
- package/template/apps/web/src/components/ui/dropdown-menu/DropdownMenuRadioItem.vue +51 -0
- package/template/apps/web/src/components/ui/dropdown-menu/DropdownMenuSeparator.vue +23 -0
- package/template/apps/web/src/components/ui/dropdown-menu/DropdownMenuShortcut.vue +22 -0
- package/template/apps/web/src/components/ui/dropdown-menu/DropdownMenuSub.vue +19 -0
- package/template/apps/web/src/components/ui/dropdown-menu/DropdownMenuSubContent.vue +34 -0
- package/template/apps/web/src/components/ui/dropdown-menu/DropdownMenuSubTrigger.vue +36 -0
- package/template/apps/web/src/components/ui/dropdown-menu/DropdownMenuTrigger.vue +17 -0
- package/template/apps/web/src/components/ui/dropdown-menu/index.ts +16 -0
- package/template/apps/web/src/components/ui/input/Input.vue +33 -0
- package/template/apps/web/src/components/ui/input/index.ts +1 -0
- package/template/apps/web/src/components/ui/select/Select.vue +15 -0
- package/template/apps/web/src/components/ui/select/SelectContent.vue +61 -0
- package/template/apps/web/src/components/ui/select/SelectGroup.vue +23 -0
- package/template/apps/web/src/components/ui/select/SelectItem.vue +49 -0
- package/template/apps/web/src/components/ui/select/SelectItemText.vue +12 -0
- package/template/apps/web/src/components/ui/select/SelectLabel.vue +19 -0
- package/template/apps/web/src/components/ui/select/SelectScrollDownButton.vue +34 -0
- package/template/apps/web/src/components/ui/select/SelectScrollUpButton.vue +34 -0
- package/template/apps/web/src/components/ui/select/SelectSeparator.vue +21 -0
- package/template/apps/web/src/components/ui/select/SelectTrigger.vue +43 -0
- package/template/apps/web/src/components/ui/select/SelectValue.vue +12 -0
- package/template/apps/web/src/components/ui/select/index.ts +11 -0
- package/template/apps/web/src/components/ui/separator/Separator.vue +30 -0
- package/template/apps/web/src/components/ui/separator/index.ts +1 -0
- package/template/apps/web/src/components/ui/sheet/Sheet.vue +15 -0
- package/template/apps/web/src/components/ui/sheet/SheetClose.vue +12 -0
- package/template/apps/web/src/components/ui/sheet/SheetContent.vue +62 -0
- package/template/apps/web/src/components/ui/sheet/SheetDescription.vue +23 -0
- package/template/apps/web/src/components/ui/sheet/SheetFooter.vue +15 -0
- package/template/apps/web/src/components/ui/sheet/SheetHeader.vue +15 -0
- package/template/apps/web/src/components/ui/sheet/SheetOverlay.vue +28 -0
- package/template/apps/web/src/components/ui/sheet/SheetTitle.vue +25 -0
- package/template/apps/web/src/components/ui/sheet/SheetTrigger.vue +12 -0
- package/template/apps/web/src/components/ui/sheet/index.ts +8 -0
- package/template/apps/web/src/components/ui/sidebar/Sidebar.vue +114 -0
- package/template/apps/web/src/components/ui/sidebar/SidebarContent.vue +23 -0
- package/template/apps/web/src/components/ui/sidebar/SidebarFooter.vue +18 -0
- package/template/apps/web/src/components/ui/sidebar/SidebarGroup.vue +18 -0
- package/template/apps/web/src/components/ui/sidebar/SidebarGroupAction.vue +29 -0
- package/template/apps/web/src/components/ui/sidebar/SidebarGroupContent.vue +18 -0
- package/template/apps/web/src/components/ui/sidebar/SidebarGroupLabel.vue +29 -0
- package/template/apps/web/src/components/ui/sidebar/SidebarHeader.vue +18 -0
- package/template/apps/web/src/components/ui/sidebar/SidebarInput.vue +19 -0
- package/template/apps/web/src/components/ui/sidebar/SidebarInset.vue +22 -0
- package/template/apps/web/src/components/ui/sidebar/SidebarMenu.vue +18 -0
- package/template/apps/web/src/components/ui/sidebar/SidebarMenuAction.vue +37 -0
- package/template/apps/web/src/components/ui/sidebar/SidebarMenuBadge.vue +23 -0
- package/template/apps/web/src/components/ui/sidebar/SidebarMenuButton.vue +60 -0
- package/template/apps/web/src/components/ui/sidebar/SidebarMenuButtonChild.vue +36 -0
- package/template/apps/web/src/components/ui/sidebar/SidebarMenuItem.vue +18 -0
- package/template/apps/web/src/components/ui/sidebar/SidebarMenuSkeleton.vue +35 -0
- package/template/apps/web/src/components/ui/sidebar/SidebarMenuSub.vue +23 -0
- package/template/apps/web/src/components/ui/sidebar/SidebarMenuSubButton.vue +39 -0
- package/template/apps/web/src/components/ui/sidebar/SidebarMenuSubItem.vue +18 -0
- package/template/apps/web/src/components/ui/sidebar/SidebarProvider.vue +128 -0
- package/template/apps/web/src/components/ui/sidebar/SidebarRail.vue +94 -0
- package/template/apps/web/src/components/ui/sidebar/SidebarSeparator.vue +19 -0
- package/template/apps/web/src/components/ui/sidebar/SidebarTrigger.vue +28 -0
- package/template/apps/web/src/components/ui/sidebar/index.ts +62 -0
- package/template/apps/web/src/components/ui/sidebar/sidebar-width.ts +29 -0
- package/template/apps/web/src/components/ui/sidebar/sidebar-width.webtest.ts +28 -0
- package/template/apps/web/src/components/ui/sidebar/utils.ts +26 -0
- package/template/apps/web/src/components/ui/skeleton/Skeleton.vue +17 -0
- package/template/apps/web/src/components/ui/skeleton/index.ts +1 -0
- package/template/apps/web/src/components/ui/sonner/Sonner.vue +70 -0
- package/template/apps/web/src/components/ui/sonner/index.ts +1 -0
- package/template/apps/web/src/components/ui/switch/Switch.vue +47 -0
- package/template/apps/web/src/components/ui/switch/Switch.webtest.ts +23 -0
- package/template/apps/web/src/components/ui/switch/index.ts +1 -0
- package/template/apps/web/src/components/ui/table/Table.vue +19 -0
- package/template/apps/web/src/components/ui/table/TableBody.vue +17 -0
- package/template/apps/web/src/components/ui/table/TableCaption.vue +17 -0
- package/template/apps/web/src/components/ui/table/TableCell.vue +22 -0
- package/template/apps/web/src/components/ui/table/TableEmpty.vue +37 -0
- package/template/apps/web/src/components/ui/table/TableFooter.vue +19 -0
- package/template/apps/web/src/components/ui/table/TableHead.vue +22 -0
- package/template/apps/web/src/components/ui/table/TableHeader.vue +14 -0
- package/template/apps/web/src/components/ui/table/TableRow.vue +22 -0
- package/template/apps/web/src/components/ui/table/index.ts +9 -0
- package/template/apps/web/src/components/ui/table/utils.ts +10 -0
- package/template/apps/web/src/components/ui/tabs/Tabs.vue +27 -0
- package/template/apps/web/src/components/ui/tabs/TabsContent.vue +23 -0
- package/template/apps/web/src/components/ui/tabs/TabsList.vue +34 -0
- package/template/apps/web/src/components/ui/tabs/TabsTrigger.vue +33 -0
- package/template/apps/web/src/components/ui/tabs/index.ts +24 -0
- package/template/apps/web/src/components/ui/tooltip/Tooltip.vue +15 -0
- package/template/apps/web/src/components/ui/tooltip/TooltipContent.vue +49 -0
- package/template/apps/web/src/components/ui/tooltip/TooltipProvider.vue +14 -0
- package/template/apps/web/src/components/ui/tooltip/TooltipTrigger.vue +12 -0
- package/template/apps/web/src/components/ui/tooltip/index.ts +4 -0
- package/template/apps/web/src/composables/useAccessSnapshot.ts +55 -0
- package/template/apps/web/src/composables/useAccessSnapshot.webtest.ts +39 -0
- package/template/apps/web/src/composables/useAppToast.ts +30 -0
- package/template/apps/web/src/composables/useAuthSession.ts +127 -0
- package/template/apps/web/src/composables/useAuthSession.webtest.ts +48 -0
- package/template/apps/web/src/composables/useLicenseReminderRefresh.ts +27 -0
- package/template/apps/web/src/composables/useLicenseReminderRefresh.webtest.ts +30 -0
- package/template/apps/web/src/composables/useLicenseRuntime.ts +90 -0
- package/template/apps/web/src/composables/useLoginFlow.ts +39 -0
- package/template/apps/web/src/composables/useModuleConfigurations.ts +116 -0
- package/template/apps/web/src/composables/usePasswordChange.ts +31 -0
- package/template/apps/web/src/composables/usePlatformSettings.ts +90 -0
- package/template/apps/web/src/composables/useSessionContext.ts +56 -0
- package/template/apps/web/src/composables/useTheme.ts +123 -0
- package/template/apps/web/src/composables/useUnsavedChangesConfirmation.ts +55 -0
- package/template/apps/web/src/composables/useWatermarkSettings.ts +56 -0
- package/template/apps/web/src/composables/watermark-settings.ts +45 -0
- package/template/apps/web/src/composables/watermark-settings.webtest.ts +38 -0
- package/template/apps/web/src/env.d.ts +17 -0
- package/template/apps/web/src/layout/AppHeader.vue +107 -0
- package/template/apps/web/src/layout/AppShell.vue +55 -0
- package/template/apps/web/src/layout/AppShell.webtest.ts +75 -0
- package/template/apps/web/src/layout/AppSidebar.vue +262 -0
- package/template/apps/web/src/layout/AppSidebar.webtest.ts +167 -0
- package/template/apps/web/src/layout/GlobalWatermark.vue +38 -0
- package/template/apps/web/src/layout/NavigationSearchDialog.vue +166 -0
- package/template/apps/web/src/layout/NavigationSearchDialog.webtest.ts +84 -0
- package/template/apps/web/src/layout/NotificationMenu.vue +174 -0
- package/template/apps/web/src/layout/NotificationMenu.webtest.ts +102 -0
- package/template/apps/web/src/layout/ThemeToggle.vue +44 -0
- package/template/apps/web/src/layout/navigation.ts +103 -0
- package/template/apps/web/src/layout/navigation.webtest.ts +99 -0
- package/template/apps/web/src/lib/date-time.ts +21 -0
- package/template/apps/web/src/lib/date-time.webtest.ts +14 -0
- package/template/apps/web/src/lib/utils.ts +7 -0
- package/template/apps/web/src/main.ts +11 -0
- package/template/apps/web/src/pages/AccessDeniedPage.vue +61 -0
- package/template/apps/web/src/pages/auth/ChangePasswordPage.vue +46 -0
- package/template/apps/web/src/pages/auth/LoginPage.vue +63 -0
- package/template/apps/web/src/pages/configuration/ModuleConfigurationPage.vue +15 -0
- package/template/apps/web/src/pages/configuration/components/ModuleConfigRollbackDialog.vue +51 -0
- package/template/apps/web/src/pages/configuration/components/ModuleConfigVersionList.vue +116 -0
- package/template/apps/web/src/pages/configuration/components/ModuleConfigurationEditor.vue +126 -0
- package/template/apps/web/src/pages/configuration/components/ModuleConfigurationEditor.webtest.ts +73 -0
- package/template/apps/web/src/pages/configuration/components/ModuleConfigurationWorkbench.vue +236 -0
- package/template/apps/web/src/pages/dashboard/DashboardPage.vue +39 -0
- package/template/apps/web/src/pages/dashboard/DashboardPage.webtest.ts +37 -0
- package/template/apps/web/src/pages/dashboard/components/DashboardAttention.vue +36 -0
- package/template/apps/web/src/pages/dashboard/components/DashboardMetricCards.vue +28 -0
- package/template/apps/web/src/pages/dashboard/dashboard-presenter.ts +115 -0
- package/template/apps/web/src/pages/dashboard/dashboard-presenter.webtest.ts +92 -0
- package/template/apps/web/src/pages/license/LicensePage.vue +65 -0
- package/template/apps/web/src/pages/profile/PersonalSettingsPage.vue +177 -0
- package/template/apps/web/src/pages/profile/PersonalSettingsPage.webtest.ts +78 -0
- package/template/apps/web/src/pages/settings/BrandingSettingsSection.vue +198 -0
- package/template/apps/web/src/pages/settings/GlobalSettingsPage.vue +195 -0
- package/template/apps/web/src/pages/settings/GlobalSettingsPage.webtest.ts +314 -0
- package/template/apps/web/src/pages/settings/WatermarkSettingsSection.vue +115 -0
- package/template/apps/web/src/pages/settings/logo-file.ts +23 -0
- package/template/apps/web/src/pages/settings/logo-file.webtest.ts +14 -0
- package/template/apps/web/src/pages/system/SystemNotificationsPage.vue +262 -0
- package/template/apps/web/src/pages/system/SystemNotificationsPage.webtest.ts +88 -0
- package/template/apps/web/src/pages/system/SystemOperationsPage.vue +151 -0
- package/template/apps/web/src/pages/system/SystemOperationsPage.webtest.ts +146 -0
- package/template/apps/web/src/pages/system/SystemResourceRoutePage.vue +80 -0
- package/template/apps/web/src/pages/system/SystemResourceRoutePage.webtest.ts +100 -0
- package/template/apps/web/src/pages/system/components/AuditActionCell.vue +87 -0
- package/template/apps/web/src/pages/system/components/AuditActionCell.webtest.ts +66 -0
- package/template/apps/web/src/pages/system/components/AuditLogFilters.vue +119 -0
- package/template/apps/web/src/pages/system/components/AuditLogFilters.webtest.ts +59 -0
- package/template/apps/web/src/pages/system/components/DiskUsageChart.vue +62 -0
- package/template/apps/web/src/pages/system/components/FeatureLicensePolicyDialog.vue +136 -0
- package/template/apps/web/src/pages/system/components/FeatureLicensePolicyDialog.webtest.ts +67 -0
- package/template/apps/web/src/pages/system/components/NotificationPublishForm.vue +57 -0
- package/template/apps/web/src/pages/system/components/OperationCacheMonitor.vue +73 -0
- package/template/apps/web/src/pages/system/components/OperationOnlineUsers.vue +60 -0
- package/template/apps/web/src/pages/system/components/OperationOnlineUsers.webtest.ts +35 -0
- package/template/apps/web/src/pages/system/components/OperationServiceMonitor.vue +118 -0
- package/template/apps/web/src/pages/system/components/OperationServiceMonitor.webtest.ts +64 -0
- package/template/apps/web/src/pages/system/components/SchedulerOperationsPanel.vue +297 -0
- package/template/apps/web/src/pages/system/components/SchedulerOperationsPanel.webtest.ts +145 -0
- package/template/apps/web/src/pages/system/components/SchedulerRunTable.vue +127 -0
- package/template/apps/web/src/pages/system/components/SchedulerRunTable.webtest.ts +75 -0
- package/template/apps/web/src/pages/system/components/SchedulerStaleRecoveryForm.vue +125 -0
- package/template/apps/web/src/pages/system/components/SchedulerStaleRecoveryForm.webtest.ts +84 -0
- package/template/apps/web/src/pages/system/components/SystemResourceFilters.vue +64 -0
- package/template/apps/web/src/pages/system/components/SystemResourceForm.vue +102 -0
- package/template/apps/web/src/pages/system/components/SystemResourcePage.vue +360 -0
- package/template/apps/web/src/pages/system/components/SystemResourcePage.webtest.ts +263 -0
- package/template/apps/web/src/pages/system/components/SystemResourceTable.vue +242 -0
- package/template/apps/web/src/pages/system/components/SystemResourceTable.webtest.ts +196 -0
- package/template/apps/web/src/pages/system/components/dictionary-bulk/DictionaryBulkActions.vue +142 -0
- package/template/apps/web/src/pages/system/components/dictionary-bulk/DictionaryBulkJobDetail.vue +109 -0
- package/template/apps/web/src/pages/system/components/dictionary-bulk/DictionaryBulkJobList.vue +127 -0
- package/template/apps/web/src/pages/system/components/dictionary-bulk/DictionaryBulkPanel.vue +72 -0
- package/template/apps/web/src/pages/system/components/dictionary-bulk/DictionaryBulkPanel.webtest.ts +255 -0
- package/template/apps/web/src/pages/system/components/feature-license-policy.ts +12 -0
- package/template/apps/web/src/pages/system/components/menu-management/MenuManagementPage.vue +131 -0
- package/template/apps/web/src/pages/system/components/menu-management/MenuManagementPage.webtest.ts +228 -0
- package/template/apps/web/src/pages/system/components/menu-management/MenuStructureTable.vue +230 -0
- package/template/apps/web/src/pages/system/components/menu-management/menu-model.ts +161 -0
- package/template/apps/web/src/pages/system/components/menu-management/menu-model.webtest.ts +133 -0
- package/template/apps/web/src/pages/system/components/menu-management/useMenuManagement.ts +117 -0
- package/template/apps/web/src/pages/system/components/role-policy/RolePermissionTree.vue +144 -0
- package/template/apps/web/src/pages/system/components/role-policy/RolePermissionTree.webtest.ts +55 -0
- package/template/apps/web/src/pages/system/components/role-policy/RolePolicyForm.vue +134 -0
- package/template/apps/web/src/pages/system/components/role-policy/permission-tree.ts +58 -0
- package/template/apps/web/src/pages/system/components/role-policy/permission-tree.webtest.ts +80 -0
- package/template/apps/web/src/pages/system/components/user-account/UserAccountForm.vue +307 -0
- package/template/apps/web/src/pages/system/components/user-account/UserRoleSelector.vue +111 -0
- package/template/apps/web/src/pages/system/components/user-account/UserRoleSelector.webtest.ts +45 -0
- package/template/apps/web/src/pages/system/components/user-account/save-user-account.ts +47 -0
- package/template/apps/web/src/pages/system/composables/useDictionaryBulkJobs.ts +152 -0
- package/template/apps/web/src/pages/system/composables/useFeatureLicenseEditor.ts +38 -0
- package/template/apps/web/src/pages/system/composables/useSchedulerOperations.ts +141 -0
- package/template/apps/web/src/pages/system/composables/useSchedulerOperations.webtest.ts +224 -0
- package/template/apps/web/src/pages/system/composables/useSystemResource.ts +269 -0
- package/template/apps/web/src/pages/system/composables/useSystemResource.webtest.ts +51 -0
- package/template/apps/web/src/pages/system/dictionary-bulk-presenter.ts +126 -0
- package/template/apps/web/src/pages/system/resource-config.ts +233 -0
- package/template/apps/web/src/router/auth-navigation.ts +76 -0
- package/template/apps/web/src/router/index.ts +246 -0
- package/template/apps/web/src/router/index.webtest.ts +396 -0
- package/template/apps/web/src/router/manifest-routes.ts +59 -0
- package/template/apps/web/src/services/access-api.ts +26 -0
- package/template/apps/web/src/services/auth-api.ts +72 -0
- package/template/apps/web/src/services/bulk-data-api.ts +105 -0
- package/template/apps/web/src/services/configuration-api.ts +43 -0
- package/template/apps/web/src/services/http.ts +145 -0
- package/template/apps/web/src/services/http.webtest.ts +73 -0
- package/template/apps/web/src/services/license-api.ts +53 -0
- package/template/apps/web/src/services/notification-api.ts +51 -0
- package/template/apps/web/src/services/operations-api.ts +128 -0
- package/template/apps/web/src/services/platform-settings-api.ts +21 -0
- package/template/apps/web/src/services/profile-api.ts +17 -0
- package/template/apps/web/src/services/session-context-api.ts +20 -0
- package/template/apps/web/src/services/system-api.ts +156 -0
- package/template/apps/web/src/style.css +142 -0
- package/template/apps/web/src/style.webtest.ts +18 -0
- package/template/apps/web/tsconfig.json +23 -0
- package/template/apps/web/vite.config.ts +26 -0
- package/template/apps/web/vitest.config.ts +14 -0
- package/template/bunfig.toml +2 -0
- package/template/docker-compose.yml +74 -0
- package/template/docs/adapters/ruoyi-vue-compatibility.md +93 -0
- package/template/docs/architecture/admin-surface-boundary.md +24 -0
- package/template/docs/architecture/data-scope-query-enforcement.md +26 -0
- package/template/docs/architecture/durable-jobs.md +101 -0
- package/template/docs/architecture/minimal-approval-workflow.md +60 -0
- package/template/docs/architecture/module-manifest-composition.md +47 -0
- package/template/docs/architecture/object-storage.md +65 -0
- package/template/docs/architecture/search-provider-protocol.md +59 -0
- package/template/docs/development/crud-generator.md +57 -0
- package/template/docs/license/license-offline-activation-code.md +67 -0
- package/template/docs/operations/observability.md +50 -0
- package/template/docs/platform/agent-tools.md +37 -0
- package/template/docs/platform/audit-reliability.md +95 -0
- package/template/docs/platform/bulk-data-jobs.md +156 -0
- package/template/docs/platform/data-access-control.md +62 -0
- package/template/docs/platform/module-configuration.md +98 -0
- package/template/docs/platform/navigation-registry.md +36 -0
- package/template/docs/platform/notifications.md +33 -0
- package/template/docs/platform/operations-overview.md +35 -0
- package/template/docs/platform/organization-membership.md +31 -0
- package/template/docs/platform/platform-authentication.md +127 -0
- package/template/docs/platform/platform-shell-settings.md +88 -0
- package/template/docs/platform/scheduled-task-executor.md +89 -0
- package/template/docs/platform/system-crud-api.md +100 -0
- package/template/docs/platform/web-system-crud.md +96 -0
- package/template/docs/product/built-in-roles.md +26 -0
- package/template/drizzle.config.ts +16 -0
- package/template/examples/inventory-item.crud.json +55 -0
- package/template/package.json +55 -0
- package/template/packages/config/index.test.ts +114 -0
- package/template/packages/config/index.ts +4 -0
- package/template/packages/config/package.json +13 -0
- package/template/packages/config/src/definition.ts +109 -0
- package/template/packages/config/src/environment-loader.ts +240 -0
- package/template/packages/config/src/platform.ts +185 -0
- package/template/packages/config/src/secrets.ts +69 -0
- package/template/packages/crud-generator/index.ts +3 -0
- package/template/packages/crud-generator/package.json +12 -0
- package/template/packages/crud-generator/src/cli.ts +31 -0
- package/template/packages/crud-generator/src/definition.ts +48 -0
- package/template/packages/crud-generator/src/generator.test.ts +180 -0
- package/template/packages/crud-generator/src/generator.ts +99 -0
- package/template/packages/crud-generator/src/template-helpers.ts +72 -0
- package/template/packages/crud-generator/src/templates/domain.ts +27 -0
- package/template/packages/crud-generator/src/templates/drizzle-repository.ts +126 -0
- package/template/packages/crud-generator/src/templates/dto.ts +19 -0
- package/template/packages/crud-generator/src/templates/index.ts +8 -0
- package/template/packages/crud-generator/src/templates/manifest.ts +69 -0
- package/template/packages/crud-generator/src/templates/project.ts +161 -0
- package/template/packages/crud-generator/src/templates/repository.ts +23 -0
- package/template/packages/crud-generator/src/templates/routes.ts +158 -0
- package/template/packages/crud-generator/src/templates/schema.ts +45 -0
- package/template/packages/crud-generator/src/templates/service.ts +32 -0
- package/template/packages/crud-generator/src/validation.ts +205 -0
- package/template/packages/crud-generator/tsconfig.json +15 -0
- package/template/packages/database/drizzle/0000_organic_madame_web.sql +136 -0
- package/template/packages/database/drizzle/0001_flawless_senator_kelly.sql +80 -0
- package/template/packages/database/drizzle/0002_woozy_squadron_supreme.sql +53 -0
- package/template/packages/database/drizzle/0003_far_carnage.sql +17 -0
- package/template/packages/database/drizzle/0004_flat_bastion.sql +2 -0
- package/template/packages/database/drizzle/0005_fixed_enchantress.sql +6 -0
- package/template/packages/database/drizzle/0006_groovy_overlord.sql +146 -0
- package/template/packages/database/drizzle/0007_chubby_may_parker.sql +9 -0
- package/template/packages/database/drizzle/0008_secret_toxin.sql +21 -0
- package/template/packages/database/drizzle/0009_ambiguous_adam_warlock.sql +46 -0
- package/template/packages/database/drizzle/0010_complex_orphan.sql +42 -0
- package/template/packages/database/drizzle/0011_lowly_maria_hill.sql +42 -0
- package/template/packages/database/drizzle/0012_serious_marvex.sql +11 -0
- package/template/packages/database/drizzle/0013_mysterious_miek.sql +48 -0
- package/template/packages/database/drizzle/0014_graceful_husk.sql +1 -0
- package/template/packages/database/drizzle/0015_illegal_jazinda.sql +29 -0
- package/template/packages/database/drizzle/0016_seed_platform_roles.sql +21 -0
- package/template/packages/database/drizzle/0017_silly_thunderbolt.sql +35 -0
- package/template/packages/database/drizzle/0018_cheerful_alex_power.sql +22 -0
- package/template/packages/database/drizzle/0019_omniscient_luckman.sql +3 -0
- package/template/packages/database/drizzle/0020_handy_vertigo.sql +18 -0
- package/template/packages/database/drizzle/0021_plain_paladin.sql +51 -0
- package/template/packages/database/drizzle/0022_icy_rhodey.sql +2 -0
- package/template/packages/database/drizzle/0023_fresh_thunderbolt_ross.sql +138 -0
- package/template/packages/database/drizzle/0024_misty_lizard.sql +13 -0
- package/template/packages/database/drizzle/0025_premium_songbird.sql +6 -0
- package/template/packages/database/drizzle/0026_aberrant_doctor_octopus.sql +42 -0
- package/template/packages/database/drizzle/0027_tiny_diamondback.sql +5 -0
- package/template/packages/database/drizzle/0028_condemned_ulik.sql +27 -0
- package/template/packages/database/drizzle/0029_clean_nightshade.sql +5 -0
- package/template/packages/database/drizzle/0030_governed_export_constraints.sql +84 -0
- package/template/packages/database/drizzle/meta/0000_snapshot.json +973 -0
- package/template/packages/database/drizzle/meta/0001_snapshot.json +1559 -0
- package/template/packages/database/drizzle/meta/0002_snapshot.json +1911 -0
- package/template/packages/database/drizzle/meta/0003_snapshot.json +2047 -0
- package/template/packages/database/drizzle/meta/0004_snapshot.json +2059 -0
- package/template/packages/database/drizzle/meta/0005_snapshot.json +2084 -0
- package/template/packages/database/drizzle/meta/0006_snapshot.json +3192 -0
- package/template/packages/database/drizzle/meta/0007_snapshot.json +3208 -0
- package/template/packages/database/drizzle/meta/0008_snapshot.json +3367 -0
- package/template/packages/database/drizzle/meta/0009_snapshot.json +3629 -0
- package/template/packages/database/drizzle/meta/0010_snapshot.json +3955 -0
- package/template/packages/database/drizzle/meta/0011_snapshot.json +4299 -0
- package/template/packages/database/drizzle/meta/0012_snapshot.json +4368 -0
- package/template/packages/database/drizzle/meta/0013_snapshot.json +4483 -0
- package/template/packages/database/drizzle/meta/0014_snapshot.json +4489 -0
- package/template/packages/database/drizzle/meta/0015_snapshot.json +4771 -0
- package/template/packages/database/drizzle/meta/0016_snapshot.json +4694 -0
- package/template/packages/database/drizzle/meta/0017_snapshot.json +4731 -0
- package/template/packages/database/drizzle/meta/0018_snapshot.json +4978 -0
- package/template/packages/database/drizzle/meta/0019_snapshot.json +4996 -0
- package/template/packages/database/drizzle/meta/0020_snapshot.json +5140 -0
- package/template/packages/database/drizzle/meta/0021_snapshot.json +5535 -0
- package/template/packages/database/drizzle/meta/0022_snapshot.json +5541 -0
- package/template/packages/database/drizzle/meta/0023_snapshot.json +6667 -0
- package/template/packages/database/drizzle/meta/0024_snapshot.json +6780 -0
- package/template/packages/database/drizzle/meta/0025_snapshot.json +6849 -0
- package/template/packages/database/drizzle/meta/0026_snapshot.json +7185 -0
- package/template/packages/database/drizzle/meta/0027_snapshot.json +7225 -0
- package/template/packages/database/drizzle/meta/0028_snapshot.json +7454 -0
- package/template/packages/database/drizzle/meta/0029_snapshot.json +7460 -0
- package/template/packages/database/drizzle/meta/0030_snapshot.json +7473 -0
- package/template/packages/database/drizzle/meta/_journal.json +223 -0
- package/template/packages/database/index.ts +5 -0
- package/template/packages/database/package.json +17 -0
- package/template/packages/database/src/dialects.test.ts +33 -0
- package/template/packages/database/src/dialects.ts +139 -0
- package/template/packages/database/src/runner.test.ts +96 -0
- package/template/packages/database/src/runner.ts +175 -0
- package/template/packages/database/src/schema/bulk-data.ts +87 -0
- package/template/packages/database/src/schema/common.ts +33 -0
- package/template/packages/database/src/schema/durable-jobs.ts +266 -0
- package/template/packages/database/src/schema/file-storage.ts +94 -0
- package/template/packages/database/src/schema/governance.ts +195 -0
- package/template/packages/database/src/schema/governed-exports.ts +90 -0
- package/template/packages/database/src/schema/identity.ts +169 -0
- package/template/packages/database/src/schema/index.ts +33 -0
- package/template/packages/database/src/schema/license-legacy.ts +93 -0
- package/template/packages/database/src/schema/license-v1.ts +246 -0
- package/template/packages/database/src/schema/migration-history.ts +30 -0
- package/template/packages/database/src/schema/notifications.ts +60 -0
- package/template/packages/database/src/schema/platform-settings.ts +55 -0
- package/template/packages/database/src/schema/scheduler.ts +89 -0
- package/template/packages/database/src/schema/work-orders.ts +23 -0
- package/template/packages/database/src/schema/workflow.ts +86 -0
- package/template/packages/database/src/schema-durable-links.test.ts +27 -0
- package/template/packages/database/src/schema-governed-exports.test.ts +49 -0
- package/template/packages/database/src/schema-workflow-notification.test.ts +63 -0
- package/template/packages/database/src/schema.test.ts +343 -0
- package/template/packages/database/src/sql-store.test.ts +92 -0
- package/template/packages/database/src/sql-store.ts +101 -0
- package/template/packages/database/src/store.ts +32 -0
- package/template/packages/database/tsconfig.json +17 -0
- package/template/packages/example-work-order/index.ts +3 -0
- package/template/packages/example-work-order/package.json +13 -0
- package/template/packages/example-work-order/src/contract.ts +50 -0
- package/template/packages/example-work-order/src/manifest.test.ts +54 -0
- package/template/packages/example-work-order/src/manifest.ts +120 -0
- package/template/packages/example-work-order/src/schema.ts +27 -0
- package/template/packages/license-sdk/index.ts +13 -0
- package/template/packages/license-sdk/package.json +18 -0
- package/template/packages/license-sdk/src/bounded-json-body.test.ts +65 -0
- package/template/packages/license-sdk/src/bounded-json-body.ts +135 -0
- package/template/packages/license-sdk/src/canonical-json.test.ts +28 -0
- package/template/packages/license-sdk/src/canonical-json.ts +104 -0
- package/template/packages/license-sdk/src/client.test.ts +82 -0
- package/template/packages/license-sdk/src/client.ts +86 -0
- package/template/packages/license-sdk/src/device.ts +46 -0
- package/template/packages/license-sdk/src/file-storage.test.ts +80 -0
- package/template/packages/license-sdk/src/file-storage.ts +77 -0
- package/template/packages/license-sdk/src/installation.test.ts +241 -0
- package/template/packages/license-sdk/src/installation.ts +150 -0
- package/template/packages/license-sdk/src/license-parser.ts +56 -0
- package/template/packages/license-sdk/src/offline-code-base32.ts +57 -0
- package/template/packages/license-sdk/src/offline-code-decompression.ts +55 -0
- package/template/packages/license-sdk/src/offline-code-limits.ts +10 -0
- package/template/packages/license-sdk/src/offline-code-wire.ts +72 -0
- package/template/packages/license-sdk/src/offline-code.test.ts +172 -0
- package/template/packages/license-sdk/src/offline-code.ts +319 -0
- package/template/packages/license-sdk/src/payload.test.ts +72 -0
- package/template/packages/license-sdk/src/payload.ts +201 -0
- package/template/packages/license-sdk/src/storage.ts +64 -0
- package/template/packages/license-sdk/src/test-fixtures.ts +59 -0
- package/template/packages/license-sdk/src/v1-test-vector.ts +49 -0
- package/template/packages/license-sdk/src/validation.test.ts +62 -0
- package/template/packages/license-sdk/src/validation.ts +143 -0
- package/template/packages/license-sdk/src/verification.test.ts +97 -0
- package/template/packages/license-sdk/src/verification.ts +199 -0
- package/template/packages/license-sdk/tsconfig.json +17 -0
- package/template/packages/modules/index.ts +8 -0
- package/template/packages/modules/package.json +13 -0
- package/template/packages/modules/src/composition.test.ts +267 -0
- package/template/packages/modules/src/composition.ts +342 -0
- package/template/packages/modules/src/installed-business-modules.ts +10 -0
- package/template/packages/modules/src/manifest.ts +97 -0
- package/template/packages/modules/src/menu-composition.test.ts +64 -0
- package/template/packages/modules/src/menu-composition.ts +54 -0
- package/template/packages/modules/src/registry.ts +53 -0
- package/template/packages/modules/src/system-admin-routes.ts +134 -0
- package/template/packages/modules/src/system-agent-tools.ts +28 -0
- package/template/packages/modules/src/system-api-binding.ts +37 -0
- package/template/packages/modules/src/system-api-data-governance.ts +21 -0
- package/template/packages/modules/src/system-api-permissions.ts +344 -0
- package/template/packages/modules/src/system-audit-actions.ts +70 -0
- package/template/packages/modules/src/system-data-governance.ts +30 -0
- package/template/packages/modules/src/system-features.ts +143 -0
- package/template/packages/modules/src/system-governed-export-bindings.ts +31 -0
- package/template/packages/modules/src/system-module-catalog.test.ts +145 -0
- package/template/packages/modules/src/system-module-catalog.ts +250 -0
- package/template/packages/modules/src/system-modules.test.ts +344 -0
- package/template/packages/modules/src/system-modules.ts +335 -0
- package/template/packages/modules/src/system-permissions.ts +142 -0
- package/template/packages/modules/user/module.ts +72 -0
- package/template/packages/shared/index.ts +16 -0
- package/template/packages/shared/package.json +9 -0
- package/template/packages/shared/src/audit.test.ts +17 -0
- package/template/packages/shared/src/audit.ts +237 -0
- package/template/packages/shared/src/correlation.test.ts +10 -0
- package/template/packages/shared/src/correlation.ts +11 -0
- package/template/packages/shared/src/data-governance.test.ts +44 -0
- package/template/packages/shared/src/data-governance.ts +89 -0
- package/template/packages/shared/src/database.ts +67 -0
- package/template/packages/shared/src/feature.test.ts +54 -0
- package/template/packages/shared/src/feature.ts +104 -0
- package/template/packages/shared/src/license-legacy.ts +153 -0
- package/template/packages/shared/src/license.test.ts +63 -0
- package/template/packages/shared/src/license.ts +267 -0
- package/template/packages/shared/src/module-configuration.ts +50 -0
- package/template/packages/shared/src/notification.ts +46 -0
- package/template/packages/shared/src/platform-settings.ts +5 -0
- package/template/packages/shared/src/primitives.ts +47 -0
- package/template/packages/shared/src/profile.ts +13 -0
- package/template/packages/shared/src/rbac.ts +117 -0
- package/template/packages/shared/src/ruoyi.ts +98 -0
- package/template/packages/shared/src/scheduler.ts +108 -0
- package/template/packages/shared/src/search-provider.ts +24 -0
- package/template/packages/shared/src/workflow.test.ts +225 -0
- package/template/packages/shared/src/workflow.ts +307 -0
- package/template/packages/storage/index.ts +11 -0
- package/template/packages/storage/package.json +12 -0
- package/template/packages/storage/src/blob-store.ts +64 -0
- package/template/packages/storage/src/content-hash.ts +24 -0
- package/template/packages/storage/src/file-service.test.ts +100 -0
- package/template/packages/storage/src/file-service.ts +59 -0
- package/template/packages/storage/src/in-memory-upload-repository.ts +154 -0
- package/template/packages/storage/src/local-file-blob-store.test.ts +175 -0
- package/template/packages/storage/src/local-file-blob-store.ts +344 -0
- package/template/packages/storage/src/local-file-maintenance.ts +133 -0
- package/template/packages/storage/src/memory-blob-store.test.ts +16 -0
- package/template/packages/storage/src/memory-blob-store.ts +100 -0
- package/template/packages/storage/src/upload-repository.ts +43 -0
- package/template/packages/storage/src/upload-service.test.ts +246 -0
- package/template/packages/storage/src/upload-service.ts +334 -0
- package/template/packages/storage/src/upload-streams.ts +123 -0
- package/template/packages/storage/src/upload-types.ts +110 -0
- package/template/packages/storage/tsconfig.json +16 -0
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { TabsTriggerProps } from "reka-ui";
|
|
3
|
+
import type { HTMLAttributes } from "vue";
|
|
4
|
+
import { reactiveOmit } from "@vueuse/core";
|
|
5
|
+
import { TabsTrigger, useForwardProps } from "reka-ui";
|
|
6
|
+
import { cn } from "@/lib/utils";
|
|
7
|
+
|
|
8
|
+
const props = defineProps<
|
|
9
|
+
TabsTriggerProps & { class?: HTMLAttributes["class"] }
|
|
10
|
+
>();
|
|
11
|
+
|
|
12
|
+
const delegatedProps = reactiveOmit(props, "class");
|
|
13
|
+
|
|
14
|
+
const forwardedProps = useForwardProps(delegatedProps);
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<template>
|
|
18
|
+
<TabsTrigger
|
|
19
|
+
data-slot="tabs-trigger"
|
|
20
|
+
:class="
|
|
21
|
+
cn(
|
|
22
|
+
'gap-1.5 rounded-md border border-transparent px-1.5 py-0.5 text-sm font-medium group-data-[variant=default]/tabs-list:data-active:shadow-sm group-data-[variant=line]/tabs-list:data-active:shadow-none [&_svg:not([class*=size-])]:size-4 has-data-[icon=inline-end]:pr-1 has-data-[icon=inline-start]:pl-1 relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center whitespace-nowrap text-foreground/60 transition-all group-data-vertical/tabs:w-full group-data-vertical/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 dark:text-muted-foreground dark:hover:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0',
|
|
23
|
+
'group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-active:bg-transparent dark:group-data-[variant=line]/tabs-list:data-active:border-transparent dark:group-data-[variant=line]/tabs-list:data-active:bg-transparent',
|
|
24
|
+
'data-active:bg-background data-active:text-foreground dark:data-active:border-input dark:data-active:bg-input/30 dark:data-active:text-foreground',
|
|
25
|
+
'after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-horizontal/tabs:after:inset-x-0 group-data-horizontal/tabs:after:bottom-[-5px] group-data-horizontal/tabs:after:h-0.5 group-data-vertical/tabs:after:inset-y-0 group-data-vertical/tabs:after:-right-1 group-data-vertical/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-active:after:opacity-100',
|
|
26
|
+
props.class,
|
|
27
|
+
)
|
|
28
|
+
"
|
|
29
|
+
v-bind="forwardedProps"
|
|
30
|
+
>
|
|
31
|
+
<slot />
|
|
32
|
+
</TabsTrigger>
|
|
33
|
+
</template>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { VariantProps } from "class-variance-authority";
|
|
2
|
+
import { cva } from "class-variance-authority";
|
|
3
|
+
|
|
4
|
+
export { default as Tabs } from "./Tabs.vue";
|
|
5
|
+
export { default as TabsContent } from "./TabsContent.vue";
|
|
6
|
+
export { default as TabsList } from "./TabsList.vue";
|
|
7
|
+
export { default as TabsTrigger } from "./TabsTrigger.vue";
|
|
8
|
+
|
|
9
|
+
export const tabsListVariants = cva(
|
|
10
|
+
"rounded-lg p-0.75 group-data-horizontal/tabs:h-8 data-[variant=line]:rounded-none group/tabs-list inline-flex w-fit items-center justify-center text-muted-foreground group-data-vertical/tabs:h-fit group-data-vertical/tabs:flex-col",
|
|
11
|
+
{
|
|
12
|
+
variants: {
|
|
13
|
+
variant: {
|
|
14
|
+
default: "bg-muted",
|
|
15
|
+
line: "gap-1 bg-transparent",
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
defaultVariants: {
|
|
19
|
+
variant: "default",
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
);
|
|
23
|
+
|
|
24
|
+
export type TabsListVariants = VariantProps<typeof tabsListVariants>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { TooltipRootEmits, TooltipRootProps } from "reka-ui";
|
|
3
|
+
import { TooltipRoot, useForwardPropsEmits } from "reka-ui";
|
|
4
|
+
|
|
5
|
+
const props = defineProps<TooltipRootProps>();
|
|
6
|
+
const emits = defineEmits<TooltipRootEmits>();
|
|
7
|
+
|
|
8
|
+
const forwarded = useForwardPropsEmits(props, emits);
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<template>
|
|
12
|
+
<TooltipRoot v-slot="slotProps" data-slot="tooltip" v-bind="forwarded">
|
|
13
|
+
<slot v-bind="slotProps" />
|
|
14
|
+
</TooltipRoot>
|
|
15
|
+
</template>
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { TooltipContentEmits, TooltipContentProps } from "reka-ui";
|
|
3
|
+
import type { HTMLAttributes } from "vue";
|
|
4
|
+
import { reactiveOmit } from "@vueuse/core";
|
|
5
|
+
import {
|
|
6
|
+
TooltipArrow,
|
|
7
|
+
TooltipContent,
|
|
8
|
+
TooltipPortal,
|
|
9
|
+
useForwardPropsEmits,
|
|
10
|
+
} from "reka-ui";
|
|
11
|
+
import { cn } from "@/lib/utils";
|
|
12
|
+
|
|
13
|
+
defineOptions({
|
|
14
|
+
inheritAttrs: false,
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
const props = withDefaults(
|
|
18
|
+
defineProps<TooltipContentProps & { class?: HTMLAttributes["class"] }>(),
|
|
19
|
+
{
|
|
20
|
+
sideOffset: 0,
|
|
21
|
+
},
|
|
22
|
+
);
|
|
23
|
+
|
|
24
|
+
const emits = defineEmits<TooltipContentEmits>();
|
|
25
|
+
|
|
26
|
+
const delegatedProps = reactiveOmit(props, "class");
|
|
27
|
+
const forwarded = useForwardPropsEmits(delegatedProps, emits);
|
|
28
|
+
</script>
|
|
29
|
+
|
|
30
|
+
<template>
|
|
31
|
+
<TooltipPortal>
|
|
32
|
+
<TooltipContent
|
|
33
|
+
data-slot="tooltip-content"
|
|
34
|
+
v-bind="{ ...forwarded, ...$attrs }"
|
|
35
|
+
:class="
|
|
36
|
+
cn(
|
|
37
|
+
'data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 inline-flex items-center gap-1.5 rounded-md px-3 py-1.5 text-xs has-data-[slot=kbd]:pr-1.5 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-sm bg-foreground text-background z-50 w-fit max-w-xs origin-(--reka-tooltip-content-transform-origin)',
|
|
38
|
+
props.class,
|
|
39
|
+
)
|
|
40
|
+
"
|
|
41
|
+
>
|
|
42
|
+
<slot />
|
|
43
|
+
|
|
44
|
+
<TooltipArrow
|
|
45
|
+
class="size-2.5 rotate-45 rounded-xs bg-foreground fill-foreground z-50 translate-y-[calc(-50%_-_2px)]"
|
|
46
|
+
/>
|
|
47
|
+
</TooltipContent>
|
|
48
|
+
</TooltipPortal>
|
|
49
|
+
</template>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { TooltipProviderProps } from "reka-ui";
|
|
3
|
+
import { TooltipProvider } from "reka-ui";
|
|
4
|
+
|
|
5
|
+
const props = withDefaults(defineProps<TooltipProviderProps>(), {
|
|
6
|
+
delayDuration: 0,
|
|
7
|
+
});
|
|
8
|
+
</script>
|
|
9
|
+
|
|
10
|
+
<template>
|
|
11
|
+
<TooltipProvider v-bind="props">
|
|
12
|
+
<slot />
|
|
13
|
+
</TooltipProvider>
|
|
14
|
+
</template>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { TooltipTriggerProps } from "reka-ui";
|
|
3
|
+
import { TooltipTrigger } from "reka-ui";
|
|
4
|
+
|
|
5
|
+
const props = defineProps<TooltipTriggerProps>();
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<template>
|
|
9
|
+
<TooltipTrigger data-slot="tooltip-trigger" v-bind="props">
|
|
10
|
+
<slot />
|
|
11
|
+
</TooltipTrigger>
|
|
12
|
+
</template>
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { readonly, shallowReadonly, shallowRef } from "vue";
|
|
2
|
+
import type { WebAccessSnapshot } from "@/layout/navigation";
|
|
3
|
+
import { loadAccessSnapshot } from "@/services/access-api";
|
|
4
|
+
|
|
5
|
+
const snapshot = shallowRef<WebAccessSnapshot>();
|
|
6
|
+
const loading = shallowRef(false);
|
|
7
|
+
const error = shallowRef("");
|
|
8
|
+
let pending: Promise<WebAccessSnapshot> | undefined;
|
|
9
|
+
let generation = 0;
|
|
10
|
+
|
|
11
|
+
async function load(force = false): Promise<WebAccessSnapshot> {
|
|
12
|
+
if (pending) return pending;
|
|
13
|
+
if (snapshot.value && !force) return snapshot.value;
|
|
14
|
+
loading.value = true;
|
|
15
|
+
error.value = "";
|
|
16
|
+
const requestGeneration = generation;
|
|
17
|
+
const operation = loadAccessSnapshot()
|
|
18
|
+
.then((result) => {
|
|
19
|
+
if (requestGeneration === generation) snapshot.value = result;
|
|
20
|
+
return result;
|
|
21
|
+
})
|
|
22
|
+
.catch((currentError: unknown) => {
|
|
23
|
+
if (requestGeneration === generation) {
|
|
24
|
+
error.value =
|
|
25
|
+
currentError instanceof Error
|
|
26
|
+
? currentError.message
|
|
27
|
+
: String(currentError);
|
|
28
|
+
}
|
|
29
|
+
throw currentError;
|
|
30
|
+
})
|
|
31
|
+
.finally(() => {
|
|
32
|
+
if (requestGeneration === generation) loading.value = false;
|
|
33
|
+
if (pending === operation) pending = undefined;
|
|
34
|
+
});
|
|
35
|
+
pending = operation;
|
|
36
|
+
return operation;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export function resetAccessSnapshot(): void {
|
|
40
|
+
generation += 1;
|
|
41
|
+
snapshot.value = undefined;
|
|
42
|
+
loading.value = false;
|
|
43
|
+
error.value = "";
|
|
44
|
+
pending = undefined;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export function useAccessSnapshot() {
|
|
48
|
+
return {
|
|
49
|
+
snapshot: shallowReadonly(snapshot),
|
|
50
|
+
loading: readonly(loading),
|
|
51
|
+
error: readonly(error),
|
|
52
|
+
ensureLoaded: () => load(false),
|
|
53
|
+
refresh: () => load(true),
|
|
54
|
+
};
|
|
55
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { beforeEach, describe, expect, test, vi } from "vitest";
|
|
2
|
+
|
|
3
|
+
const mocks = vi.hoisted(() => ({ loadAccessSnapshot: vi.fn() }));
|
|
4
|
+
vi.mock("@/services/access-api", () => mocks);
|
|
5
|
+
|
|
6
|
+
import { resetAccessSnapshot, useAccessSnapshot } from "./useAccessSnapshot";
|
|
7
|
+
|
|
8
|
+
describe("权限快照 single-flight", () => {
|
|
9
|
+
beforeEach(() => {
|
|
10
|
+
resetAccessSnapshot();
|
|
11
|
+
mocks.loadAccessSnapshot.mockReset();
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
test("并发导航刷新只发起一个 foundation 请求", async () => {
|
|
15
|
+
const snapshot = {
|
|
16
|
+
actor: {
|
|
17
|
+
id: "user_1",
|
|
18
|
+
type: "user" as const,
|
|
19
|
+
name: "测试员",
|
|
20
|
+
roleCodes: ["member"],
|
|
21
|
+
permissionKeys: [],
|
|
22
|
+
},
|
|
23
|
+
menus: [],
|
|
24
|
+
permissions: [],
|
|
25
|
+
features: [],
|
|
26
|
+
};
|
|
27
|
+
mocks.loadAccessSnapshot.mockResolvedValue(snapshot);
|
|
28
|
+
const access = useAccessSnapshot();
|
|
29
|
+
|
|
30
|
+
const [first, second] = await Promise.all([
|
|
31
|
+
access.ensureLoaded(),
|
|
32
|
+
access.refresh(),
|
|
33
|
+
]);
|
|
34
|
+
|
|
35
|
+
expect(mocks.loadAccessSnapshot).toHaveBeenCalledTimes(1);
|
|
36
|
+
expect(first).toEqual(snapshot);
|
|
37
|
+
expect(second).toEqual(snapshot);
|
|
38
|
+
});
|
|
39
|
+
});
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { ExternalToast } from "vue-sonner";
|
|
2
|
+
import { toast } from "vue-sonner";
|
|
3
|
+
|
|
4
|
+
type ToastOptions = ExternalToast;
|
|
5
|
+
|
|
6
|
+
export function useAppToast() {
|
|
7
|
+
function success(message = "操作成功", options?: ToastOptions) {
|
|
8
|
+
return toast.success(message, options);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
function error(message = "操作失败,请稍后重试", options?: ToastOptions) {
|
|
12
|
+
return toast.error(message, options);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
function info(message = "已收到请求", options?: ToastOptions) {
|
|
16
|
+
return toast.info(message, options);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function loading(message = "正在处理,请稍候", options?: ToastOptions) {
|
|
20
|
+
return toast.loading(message, options);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
return {
|
|
24
|
+
success,
|
|
25
|
+
error,
|
|
26
|
+
info,
|
|
27
|
+
loading,
|
|
28
|
+
dismiss: toast.dismiss,
|
|
29
|
+
};
|
|
30
|
+
}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { computed, readonly, shallowReadonly, shallowRef } from "vue";
|
|
2
|
+
import type { WebAccessActor } from "@/layout/navigation";
|
|
3
|
+
import type { LoginCredentials } from "@/services/auth-api";
|
|
4
|
+
import {
|
|
5
|
+
loadCurrentSession,
|
|
6
|
+
loginWithPassword,
|
|
7
|
+
logoutCurrentSession,
|
|
8
|
+
} from "@/services/auth-api";
|
|
9
|
+
import { isApiErrorStatus, suspendDevelopmentAuth } from "@/services/http";
|
|
10
|
+
|
|
11
|
+
export type AuthPhase =
|
|
12
|
+
| "unknown"
|
|
13
|
+
| "checking"
|
|
14
|
+
| "authenticated"
|
|
15
|
+
| "anonymous"
|
|
16
|
+
| "error";
|
|
17
|
+
|
|
18
|
+
export interface AuthSessionSnapshot {
|
|
19
|
+
phase: AuthPhase;
|
|
20
|
+
actor?: WebAccessActor;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const phase = shallowRef<AuthPhase>("unknown");
|
|
24
|
+
const actor = shallowRef<WebAccessActor>();
|
|
25
|
+
const error = shallowRef("");
|
|
26
|
+
let pending: Promise<AuthSessionSnapshot> | undefined;
|
|
27
|
+
let generation = 0;
|
|
28
|
+
|
|
29
|
+
async function refresh(force = false): Promise<AuthSessionSnapshot> {
|
|
30
|
+
if (pending) return pending;
|
|
31
|
+
if (!force && phase.value !== "unknown" && phase.value !== "error") {
|
|
32
|
+
return currentSnapshot();
|
|
33
|
+
}
|
|
34
|
+
phase.value = "checking";
|
|
35
|
+
error.value = "";
|
|
36
|
+
const requestGeneration = generation;
|
|
37
|
+
const operation = loadCurrentSession()
|
|
38
|
+
.then((currentActor) => {
|
|
39
|
+
if (requestGeneration === generation) {
|
|
40
|
+
actor.value = currentActor;
|
|
41
|
+
phase.value = "authenticated";
|
|
42
|
+
}
|
|
43
|
+
return currentSnapshot();
|
|
44
|
+
})
|
|
45
|
+
.catch((current: unknown) => {
|
|
46
|
+
if (requestGeneration !== generation) return currentSnapshot();
|
|
47
|
+
actor.value = undefined;
|
|
48
|
+
if (isApiErrorStatus(current, 401)) {
|
|
49
|
+
phase.value = "anonymous";
|
|
50
|
+
return currentSnapshot();
|
|
51
|
+
}
|
|
52
|
+
phase.value = "error";
|
|
53
|
+
error.value = messageOf(current);
|
|
54
|
+
throw current;
|
|
55
|
+
})
|
|
56
|
+
.finally(() => {
|
|
57
|
+
if (pending === operation) pending = undefined;
|
|
58
|
+
});
|
|
59
|
+
pending = operation;
|
|
60
|
+
return operation;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
async function login(
|
|
64
|
+
credentials: LoginCredentials,
|
|
65
|
+
): Promise<AuthSessionSnapshot> {
|
|
66
|
+
error.value = "";
|
|
67
|
+
try {
|
|
68
|
+
await loginWithPassword(credentials);
|
|
69
|
+
suspendDevelopmentAuth();
|
|
70
|
+
phase.value = "unknown";
|
|
71
|
+
return await refresh(true);
|
|
72
|
+
} catch (current) {
|
|
73
|
+
if (isApiErrorStatus(current, 401)) phase.value = "anonymous";
|
|
74
|
+
error.value = messageOf(current);
|
|
75
|
+
throw current;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
async function logout(): Promise<void> {
|
|
80
|
+
error.value = "";
|
|
81
|
+
try {
|
|
82
|
+
await logoutCurrentSession();
|
|
83
|
+
clearAuthSession();
|
|
84
|
+
} catch (current) {
|
|
85
|
+
if (isApiErrorStatus(current, 401)) clearAuthSession();
|
|
86
|
+
else error.value = messageOf(current);
|
|
87
|
+
throw current;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
function currentSnapshot(): AuthSessionSnapshot {
|
|
92
|
+
return { phase: phase.value, actor: actor.value };
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export function clearAuthSession(): void {
|
|
96
|
+
generation += 1;
|
|
97
|
+
actor.value = undefined;
|
|
98
|
+
phase.value = "anonymous";
|
|
99
|
+
error.value = "";
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
export function resetAuthSession(): void {
|
|
103
|
+
generation += 1;
|
|
104
|
+
actor.value = undefined;
|
|
105
|
+
phase.value = "unknown";
|
|
106
|
+
error.value = "";
|
|
107
|
+
pending = undefined;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
export function useAuthSession() {
|
|
111
|
+
return {
|
|
112
|
+
phase: readonly(phase),
|
|
113
|
+
actor: shallowReadonly(actor),
|
|
114
|
+
error: readonly(error),
|
|
115
|
+
authenticated: computed(() => phase.value === "authenticated"),
|
|
116
|
+
checking: computed(() => phase.value === "checking"),
|
|
117
|
+
ensureInitialized: () => refresh(false),
|
|
118
|
+
refresh: () => refresh(true),
|
|
119
|
+
clear: clearAuthSession,
|
|
120
|
+
login,
|
|
121
|
+
logout,
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
function messageOf(value: unknown): string {
|
|
126
|
+
return value instanceof Error ? value.message : String(value);
|
|
127
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { beforeEach, describe, expect, test, vi } from "vitest";
|
|
2
|
+
|
|
3
|
+
const mocks = vi.hoisted(() => ({
|
|
4
|
+
loadCurrentSession: vi.fn(),
|
|
5
|
+
loginWithPassword: vi.fn(),
|
|
6
|
+
logoutCurrentSession: vi.fn(),
|
|
7
|
+
}));
|
|
8
|
+
|
|
9
|
+
vi.mock("@/services/auth-api", () => mocks);
|
|
10
|
+
|
|
11
|
+
import { resetAuthSession, useAuthSession } from "./useAuthSession";
|
|
12
|
+
|
|
13
|
+
describe("认证状态 single-flight", () => {
|
|
14
|
+
beforeEach(() => {
|
|
15
|
+
resetAuthSession();
|
|
16
|
+
mocks.loadCurrentSession.mockReset();
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
test("并发启动探测复用同一个请求", async () => {
|
|
20
|
+
mocks.loadCurrentSession.mockResolvedValue({
|
|
21
|
+
id: "user_1",
|
|
22
|
+
type: "user",
|
|
23
|
+
name: "测试员",
|
|
24
|
+
roleCodes: ["member"],
|
|
25
|
+
permissionKeys: [],
|
|
26
|
+
});
|
|
27
|
+
const auth = useAuthSession();
|
|
28
|
+
|
|
29
|
+
const [first, second] = await Promise.all([
|
|
30
|
+
auth.ensureInitialized(),
|
|
31
|
+
auth.refresh(),
|
|
32
|
+
]);
|
|
33
|
+
|
|
34
|
+
expect(mocks.loadCurrentSession).toHaveBeenCalledTimes(1);
|
|
35
|
+
expect(first.phase).toBe("authenticated");
|
|
36
|
+
expect(second.actor?.id).toBe("user_1");
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
test("非 401 故障保留 error 状态而不是伪装成匿名", async () => {
|
|
40
|
+
mocks.loadCurrentSession.mockRejectedValue(new Error("network down"));
|
|
41
|
+
const auth = useAuthSession();
|
|
42
|
+
|
|
43
|
+
await expect(auth.ensureInitialized()).rejects.toThrow("network down");
|
|
44
|
+
|
|
45
|
+
expect(auth.phase.value).toBe("error");
|
|
46
|
+
expect(auth.authenticated.value).toBe(false);
|
|
47
|
+
});
|
|
48
|
+
});
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { onMounted, onUnmounted } from "vue";
|
|
2
|
+
|
|
3
|
+
const DEFAULT_REFRESH_INTERVAL_MS = 60 * 1000;
|
|
4
|
+
|
|
5
|
+
export function useLicenseReminderRefresh(
|
|
6
|
+
refresh: () => Promise<unknown>,
|
|
7
|
+
intervalMs = DEFAULT_REFRESH_INTERVAL_MS,
|
|
8
|
+
): void {
|
|
9
|
+
let timer: ReturnType<typeof setInterval> | undefined;
|
|
10
|
+
let refreshing = false;
|
|
11
|
+
|
|
12
|
+
onMounted(() => {
|
|
13
|
+
timer = setInterval(() => {
|
|
14
|
+
if (refreshing) return;
|
|
15
|
+
refreshing = true;
|
|
16
|
+
void refresh()
|
|
17
|
+
.catch(() => undefined)
|
|
18
|
+
.finally(() => {
|
|
19
|
+
refreshing = false;
|
|
20
|
+
});
|
|
21
|
+
}, intervalMs);
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
onUnmounted(() => {
|
|
25
|
+
if (timer !== undefined) clearInterval(timer);
|
|
26
|
+
});
|
|
27
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { mount } from "@vue/test-utils";
|
|
2
|
+
import { defineComponent } from "vue";
|
|
3
|
+
import { afterEach, describe, expect, test, vi } from "vitest";
|
|
4
|
+
import { useLicenseReminderRefresh } from "./useLicenseReminderRefresh";
|
|
5
|
+
|
|
6
|
+
afterEach(() => {
|
|
7
|
+
vi.useRealTimers();
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
describe("License 提醒自动刷新", () => {
|
|
11
|
+
test("长时间停留会刷新本机状态,组件卸载后停止", async () => {
|
|
12
|
+
vi.useFakeTimers();
|
|
13
|
+
const refresh = vi.fn(async () => undefined);
|
|
14
|
+
const wrapper = mount(
|
|
15
|
+
defineComponent({
|
|
16
|
+
setup() {
|
|
17
|
+
useLicenseReminderRefresh(refresh, 1000);
|
|
18
|
+
return () => null;
|
|
19
|
+
},
|
|
20
|
+
}),
|
|
21
|
+
);
|
|
22
|
+
|
|
23
|
+
await vi.advanceTimersByTimeAsync(3000);
|
|
24
|
+
expect(refresh).toHaveBeenCalledTimes(3);
|
|
25
|
+
|
|
26
|
+
wrapper.unmount();
|
|
27
|
+
await vi.advanceTimersByTimeAsync(2000);
|
|
28
|
+
expect(refresh).toHaveBeenCalledTimes(3);
|
|
29
|
+
});
|
|
30
|
+
});
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { readonly, shallowReadonly, shallowRef } from "vue";
|
|
2
|
+
import {
|
|
3
|
+
installPlatformActivationCode,
|
|
4
|
+
installPlatformLicense,
|
|
5
|
+
loadPlatformLicense,
|
|
6
|
+
type PlatformLicenseSnapshot,
|
|
7
|
+
} from "@/services/license-api";
|
|
8
|
+
|
|
9
|
+
const snapshot = shallowRef<PlatformLicenseSnapshot>();
|
|
10
|
+
const loading = shallowRef(false);
|
|
11
|
+
const installing = shallowRef(false);
|
|
12
|
+
const error = shallowRef("");
|
|
13
|
+
let pending: Promise<PlatformLicenseSnapshot> | undefined;
|
|
14
|
+
let generation = 0;
|
|
15
|
+
|
|
16
|
+
async function load(force = false): Promise<PlatformLicenseSnapshot> {
|
|
17
|
+
if (pending) return pending;
|
|
18
|
+
if (snapshot.value && !force) return snapshot.value;
|
|
19
|
+
loading.value = true;
|
|
20
|
+
error.value = "";
|
|
21
|
+
const requestGeneration = generation;
|
|
22
|
+
const operation = loadPlatformLicense()
|
|
23
|
+
.then((value) => {
|
|
24
|
+
if (requestGeneration === generation) snapshot.value = value;
|
|
25
|
+
return value;
|
|
26
|
+
})
|
|
27
|
+
.catch((current: unknown) => {
|
|
28
|
+
if (requestGeneration === generation) error.value = messageOf(current);
|
|
29
|
+
throw current;
|
|
30
|
+
})
|
|
31
|
+
.finally(() => {
|
|
32
|
+
if (requestGeneration === generation) loading.value = false;
|
|
33
|
+
if (pending === operation) pending = undefined;
|
|
34
|
+
});
|
|
35
|
+
pending = operation;
|
|
36
|
+
return operation;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export function resetLicenseRuntime(): void {
|
|
40
|
+
generation += 1;
|
|
41
|
+
snapshot.value = undefined;
|
|
42
|
+
loading.value = false;
|
|
43
|
+
installing.value = false;
|
|
44
|
+
error.value = "";
|
|
45
|
+
pending = undefined;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
async function install(rawLicense: string): Promise<PlatformLicenseSnapshot> {
|
|
49
|
+
return performInstall(() => installPlatformLicense(rawLicense));
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
async function installActivationCode(
|
|
53
|
+
activationCode: string,
|
|
54
|
+
): Promise<PlatformLicenseSnapshot> {
|
|
55
|
+
return performInstall(() => installPlatformActivationCode(activationCode));
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
async function performInstall(
|
|
59
|
+
operation: () => ReturnType<typeof installPlatformLicense>,
|
|
60
|
+
): Promise<PlatformLicenseSnapshot> {
|
|
61
|
+
installing.value = true;
|
|
62
|
+
error.value = "";
|
|
63
|
+
try {
|
|
64
|
+
const result = await operation();
|
|
65
|
+
snapshot.value = result.snapshot;
|
|
66
|
+
return result.snapshot;
|
|
67
|
+
} catch (current) {
|
|
68
|
+
error.value = messageOf(current);
|
|
69
|
+
throw current;
|
|
70
|
+
} finally {
|
|
71
|
+
installing.value = false;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export function useLicenseRuntime() {
|
|
76
|
+
return {
|
|
77
|
+
snapshot: shallowReadonly(snapshot),
|
|
78
|
+
loading: readonly(loading),
|
|
79
|
+
installing: readonly(installing),
|
|
80
|
+
error: readonly(error),
|
|
81
|
+
ensureLoaded: () => load(false),
|
|
82
|
+
refresh: () => load(true),
|
|
83
|
+
install,
|
|
84
|
+
installActivationCode,
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
function messageOf(value: unknown): string {
|
|
89
|
+
return value instanceof Error ? value.message : String(value);
|
|
90
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { computed, shallowRef } from "vue";
|
|
2
|
+
import { useRoute, useRouter } from "vue-router";
|
|
3
|
+
import { resetAccessSnapshot } from "@/composables/useAccessSnapshot";
|
|
4
|
+
import { useAuthSession } from "@/composables/useAuthSession";
|
|
5
|
+
// @windy-module system.license begin
|
|
6
|
+
import { resetLicenseRuntime } from "@/composables/useLicenseRuntime";
|
|
7
|
+
// @windy-module system.license end
|
|
8
|
+
import { resetSessionContext } from "@/composables/useSessionContext";
|
|
9
|
+
import { safeReturnTo } from "@/router/auth-navigation";
|
|
10
|
+
import type { LoginCredentials } from "@/services/auth-api";
|
|
11
|
+
|
|
12
|
+
export function useLoginFlow() {
|
|
13
|
+
const auth = useAuthSession();
|
|
14
|
+
const route = useRoute();
|
|
15
|
+
const router = useRouter();
|
|
16
|
+
const submitError = shallowRef("");
|
|
17
|
+
const loading = computed(() => auth.phase.value === "checking");
|
|
18
|
+
|
|
19
|
+
async function submit(credentials: LoginCredentials): Promise<void> {
|
|
20
|
+
submitError.value = "";
|
|
21
|
+
try {
|
|
22
|
+
await auth.login(credentials);
|
|
23
|
+
resetAccessSnapshot();
|
|
24
|
+
// @windy-module system.license begin
|
|
25
|
+
resetLicenseRuntime();
|
|
26
|
+
// @windy-module system.license end
|
|
27
|
+
resetSessionContext();
|
|
28
|
+
await router.replace(safeReturnTo(route.query.returnTo));
|
|
29
|
+
} catch {
|
|
30
|
+
submitError.value = auth.error.value || "登录失败,请稍后重试";
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
return {
|
|
35
|
+
loading,
|
|
36
|
+
submitError,
|
|
37
|
+
submit,
|
|
38
|
+
};
|
|
39
|
+
}
|