@stacksjs/defaults 0.70.206 → 0.70.208
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/TODO.md +21 -0
- package/ai/AGENTS.md +79 -0
- package/ai/README.md +45 -0
- package/ai/claude/launch.json +12 -0
- package/ai/skills/stacks-actions/SKILL.md +128 -0
- package/ai/skills/stacks-ai/SKILL.md +276 -0
- package/ai/skills/stacks-alias/SKILL.md +94 -0
- package/ai/skills/stacks-analytics/SKILL.md +91 -0
- package/ai/skills/stacks-api/SKILL.md +738 -0
- package/ai/skills/stacks-arrays/SKILL.md +277 -0
- package/ai/skills/stacks-auth/SKILL.md +422 -0
- package/ai/skills/stacks-auto-imports/SKILL.md +138 -0
- package/ai/skills/stacks-brandkit/SKILL.md +811 -0
- package/ai/skills/stacks-browse/SKILL.md +127 -0
- package/ai/skills/stacks-browse/scripts/browse.ts +492 -0
- package/ai/skills/stacks-browser/SKILL.md +145 -0
- package/ai/skills/stacks-buddy/SKILL.md +676 -0
- package/ai/skills/stacks-build/SKILL.md +163 -0
- package/ai/skills/stacks-cache/SKILL.md +125 -0
- package/ai/skills/stacks-calendar/SKILL.md +113 -0
- package/ai/skills/stacks-chat/SKILL.md +371 -0
- package/ai/skills/stacks-cli/SKILL.md +112 -0
- package/ai/skills/stacks-cloud/SKILL.md +192 -0
- package/ai/skills/stacks-cms/SKILL.md +217 -0
- package/ai/skills/stacks-collections/SKILL.md +82 -0
- package/ai/skills/stacks-commerce/SKILL.md +114 -0
- package/ai/skills/stacks-composables/SKILL.md +161 -0
- package/ai/skills/stacks-config/SKILL.md +144 -0
- package/ai/skills/stacks-configuration/SKILL.md +154 -0
- package/ai/skills/stacks-cron/SKILL.md +123 -0
- package/ai/skills/stacks-crosswind/SKILL.md +190 -0
- package/ai/skills/stacks-dashboard/SKILL.md +173 -0
- package/ai/skills/stacks-database/SKILL.md +286 -0
- package/ai/skills/stacks-datetime/SKILL.md +269 -0
- package/ai/skills/stacks-dependencies/SKILL.md +111 -0
- package/ai/skills/stacks-deploy/SKILL.md +102 -0
- package/ai/skills/stacks-design-brutalist/SKILL.md +110 -0
- package/ai/skills/stacks-design-minimalist/SKILL.md +115 -0
- package/ai/skills/stacks-design-output/SKILL.md +55 -0
- package/ai/skills/stacks-design-soft/SKILL.md +156 -0
- package/ai/skills/stacks-design-taste/SKILL.md +1012 -0
- package/ai/skills/stacks-design-taste-codex/SKILL.md +294 -0
- package/ai/skills/stacks-desktop/SKILL.md +78 -0
- package/ai/skills/stacks-development/SKILL.md +298 -0
- package/ai/skills/stacks-dns/SKILL.md +149 -0
- package/ai/skills/stacks-docs/SKILL.md +109 -0
- package/ai/skills/stacks-email/SKILL.md +236 -0
- package/ai/skills/stacks-enums/SKILL.md +100 -0
- package/ai/skills/stacks-env/SKILL.md +181 -0
- package/ai/skills/stacks-error-handling/SKILL.md +137 -0
- package/ai/skills/stacks-events/SKILL.md +228 -0
- package/ai/skills/stacks-faker/SKILL.md +158 -0
- package/ai/skills/stacks-git/SKILL.md +158 -0
- package/ai/skills/stacks-guard/SKILL.md +98 -0
- package/ai/skills/stacks-health/SKILL.md +75 -0
- package/ai/skills/stacks-http/SKILL.md +316 -0
- package/ai/skills/stacks-i18n/SKILL.md +198 -0
- package/ai/skills/stacks-image-to-code/SKILL.md +629 -0
- package/ai/skills/stacks-imagegen-mobile/SKILL.md +1474 -0
- package/ai/skills/stacks-imagegen-web/SKILL.md +998 -0
- package/ai/skills/stacks-investigate/SKILL.md +119 -0
- package/ai/skills/stacks-jobs/SKILL.md +136 -0
- package/ai/skills/stacks-lint/SKILL.md +184 -0
- package/ai/skills/stacks-listeners/SKILL.md +99 -0
- package/ai/skills/stacks-logging/SKILL.md +78 -0
- package/ai/skills/stacks-mail/SKILL.md +120 -0
- package/ai/skills/stacks-middleware/SKILL.md +249 -0
- package/ai/skills/stacks-migrations/SKILL.md +105 -0
- package/ai/skills/stacks-models/SKILL.md +267 -0
- package/ai/skills/stacks-new-feature/SKILL.md +206 -0
- package/ai/skills/stacks-notifications/SKILL.md +210 -0
- package/ai/skills/stacks-objects/SKILL.md +205 -0
- package/ai/skills/stacks-office-hours/SKILL.md +134 -0
- package/ai/skills/stacks-orm/SKILL.md +342 -0
- package/ai/skills/stacks-path/SKILL.md +118 -0
- package/ai/skills/stacks-payments/SKILL.md +373 -0
- package/ai/skills/stacks-plan-review/SKILL.md +152 -0
- package/ai/skills/stacks-plugins/SKILL.md +149 -0
- package/ai/skills/stacks-push/SKILL.md +376 -0
- package/ai/skills/stacks-query-builder/SKILL.md +128 -0
- package/ai/skills/stacks-queue/SKILL.md +559 -0
- package/ai/skills/stacks-realtime/SKILL.md +442 -0
- package/ai/skills/stacks-redesign/SKILL.md +182 -0
- package/ai/skills/stacks-registry/SKILL.md +58 -0
- package/ai/skills/stacks-repl/SKILL.md +80 -0
- package/ai/skills/stacks-retro/SKILL.md +122 -0
- package/ai/skills/stacks-review/SKILL.md +135 -0
- package/ai/skills/stacks-router/SKILL.md +231 -0
- package/ai/skills/stacks-routes/SKILL.md +105 -0
- package/ai/skills/stacks-scaffolding/SKILL.md +162 -0
- package/ai/skills/stacks-scheduler/SKILL.md +363 -0
- package/ai/skills/stacks-search-engine/SKILL.md +112 -0
- package/ai/skills/stacks-security/SKILL.md +129 -0
- package/ai/skills/stacks-security-audit/SKILL.md +128 -0
- package/ai/skills/stacks-server/SKILL.md +458 -0
- package/ai/skills/stacks-shell/SKILL.md +62 -0
- package/ai/skills/stacks-slug/SKILL.md +87 -0
- package/ai/skills/stacks-sms/SKILL.md +385 -0
- package/ai/skills/stacks-socials/SKILL.md +303 -0
- package/ai/skills/stacks-storage/SKILL.md +576 -0
- package/ai/skills/stacks-strings/SKILL.md +416 -0
- package/ai/skills/stacks-stx/SKILL.md +176 -0
- package/ai/skills/stacks-technical-diagrams/LICENSE +22 -0
- package/ai/skills/stacks-technical-diagrams/SKILL.md +290 -0
- package/ai/skills/stacks-technical-diagrams/agents/openai.yaml +4 -0
- package/ai/skills/stacks-technical-diagrams/assets/template.html +1252 -0
- package/ai/skills/stacks-technical-diagrams/bin/technical-diagrams.mjs +289 -0
- package/ai/skills/stacks-technical-diagrams/bunfig.toml +1 -0
- package/ai/skills/stacks-technical-diagrams/examples/agent-run.lifecycle.json +64 -0
- package/ai/skills/stacks-technical-diagrams/examples/agent-tool-call.workflow.json +88 -0
- package/ai/skills/stacks-technical-diagrams/examples/cache-miss-request.sequence.json +75 -0
- package/ai/skills/stacks-technical-diagrams/examples/product-analytics.dataflow.json +70 -0
- package/ai/skills/stacks-technical-diagrams/examples/web-app.architecture.json +41 -0
- package/ai/skills/stacks-technical-diagrams/renderers/architecture/grid.mjs +62 -0
- package/ai/skills/stacks-technical-diagrams/renderers/architecture/render-architecture.mjs +371 -0
- package/ai/skills/stacks-technical-diagrams/renderers/dataflow/README.md +82 -0
- package/ai/skills/stacks-technical-diagrams/renderers/dataflow/render-dataflow.mjs +295 -0
- package/ai/skills/stacks-technical-diagrams/renderers/lifecycle/README.md +91 -0
- package/ai/skills/stacks-technical-diagrams/renderers/lifecycle/render-lifecycle.mjs +384 -0
- package/ai/skills/stacks-technical-diagrams/renderers/sequence/README.md +84 -0
- package/ai/skills/stacks-technical-diagrams/renderers/sequence/render-sequence.mjs +257 -0
- package/ai/skills/stacks-technical-diagrams/renderers/shared/cli.mjs +42 -0
- package/ai/skills/stacks-technical-diagrams/renderers/shared/generated-validators.mjs +13 -0
- package/ai/skills/stacks-technical-diagrams/renderers/shared/geometry.mjs +230 -0
- package/ai/skills/stacks-technical-diagrams/renderers/shared/layout-report.mjs +40 -0
- package/ai/skills/stacks-technical-diagrams/renderers/shared/utils.mjs +88 -0
- package/ai/skills/stacks-technical-diagrams/renderers/shared/validator.mjs +40 -0
- package/ai/skills/stacks-technical-diagrams/renderers/workflow/README.md +103 -0
- package/ai/skills/stacks-technical-diagrams/renderers/workflow/render-workflow.mjs +481 -0
- package/ai/skills/stacks-technical-diagrams/schemas/README.md +68 -0
- package/ai/skills/stacks-technical-diagrams/schemas/architecture.schema.json +121 -0
- package/ai/skills/stacks-technical-diagrams/schemas/common.schema.json +43 -0
- package/ai/skills/stacks-technical-diagrams/schemas/dataflow.schema.json +221 -0
- package/ai/skills/stacks-technical-diagrams/schemas/lifecycle.schema.json +241 -0
- package/ai/skills/stacks-technical-diagrams/schemas/sequence.schema.json +186 -0
- package/ai/skills/stacks-technical-diagrams/schemas/workflow.schema.json +332 -0
- package/ai/skills/stacks-technical-diagrams/scripts/check-render-output.mjs +297 -0
- package/ai/skills/stacks-technical-diagrams/scripts/render-examples.mjs +28 -0
- package/ai/skills/stacks-testing/SKILL.md +129 -0
- package/ai/skills/stacks-tunnel/SKILL.md +125 -0
- package/ai/skills/stacks-types/SKILL.md +178 -0
- package/ai/skills/stacks-ui/SKILL.md +246 -0
- package/ai/skills/stacks-utils/SKILL.md +444 -0
- package/ai/skills/stacks-validation/SKILL.md +371 -0
- package/ai/skills/stacks-whois/SKILL.md +315 -0
- package/assets/world-map-data.ts +121 -0
- package/bootstrap.ts +114 -0
- package/docs/api-examples.md +46 -0
- package/docs/index.md +24 -0
- package/docs/markdown-examples.md +87 -0
- package/functions/analytics.ts +97 -0
- package/functions/api.ts +143 -0
- package/functions/auth.ts +208 -0
- package/functions/billing/payments.ts +149 -0
- package/functions/blog.ts +120 -0
- package/functions/cms/categorizables.ts +107 -0
- package/functions/cms/pages.ts +108 -0
- package/functions/cms/posts.ts +100 -0
- package/functions/cms/taggables.ts +102 -0
- package/functions/commerce/coupons.ts +128 -0
- package/functions/commerce/customers.ts +128 -0
- package/functions/commerce/gift-cards.ts +119 -0
- package/functions/commerce/orders.ts +112 -0
- package/functions/commerce/payments.ts +119 -0
- package/functions/commerce/products/categories.ts +123 -0
- package/functions/commerce/products/manufacturers.ts +123 -0
- package/functions/commerce/products/products.ts +123 -0
- package/functions/commerce/products/reviews.ts +123 -0
- package/functions/commerce/products/units.ts +123 -0
- package/functions/commerce/products/variants.ts +123 -0
- package/functions/commerce/shippings/delivery-routes.ts +123 -0
- package/functions/commerce/shippings/digital-deliveries.ts +119 -0
- package/functions/commerce/shippings/drivers.ts +123 -0
- package/functions/commerce/shippings/license-keys.ts +123 -0
- package/functions/commerce/shippings/shipping-methods.ts +123 -0
- package/functions/commerce/shippings/shipping-rates.ts +119 -0
- package/functions/commerce/shippings/shipping-zones.ts +119 -0
- package/functions/commerce/taxes.ts +119 -0
- package/functions/commerce/waitlist/products.ts +123 -0
- package/functions/commerce/waitlist/restaurants.ts +123 -0
- package/functions/craft.ts +107 -0
- package/functions/dashboard.ts +153 -0
- package/functions/inbox.ts +95 -0
- package/functions/jobs.ts +86 -0
- package/functions/monitoring/errors.ts +295 -0
- package/functions/queue.ts +111 -0
- package/functions/realtime/websockets.ts +96 -0
- package/functions/realtime.ts +52 -0
- package/functions/releases.ts +49 -0
- package/functions/search.ts +126 -0
- package/functions/toasts.ts +95 -0
- package/functions/uploads.ts +216 -0
- package/ide/.gitignore +4 -0
- package/ide/cursor/rules/auto-imports.mdc +574 -0
- package/ide/cursor/rules/code-style.mdc +12 -0
- package/ide/cursor/rules/documentation.mdc +9 -0
- package/ide/cursor/rules/error-handling-validation.mdc +11 -0
- package/ide/cursor/rules/key-conventions.mdc +11 -0
- package/ide/cursor/rules/project-structure.mdc +169 -0
- package/ide/cursor/rules/readme.mdc +318 -0
- package/ide/cursor/rules/syntax-formatting.mdc +9 -0
- package/ide/cursor/rules/testing.mdc +10 -0
- package/ide/cursor/rules/typescript.mdc +9 -0
- package/ide/cursor/rules/ui-styling.mdc +0 -0
- package/ide/dictionary.txt +397 -0
- package/ide/jetbrains/.fleet/settings.json +4 -0
- package/ide/jetbrains/.idea/.gitignore +5 -0
- package/ide/jetbrains/.idea/.name +1 -0
- package/ide/jetbrains/.idea/inspectionProfiles/Project_Default.xml +6 -0
- package/ide/jetbrains/.idea/jsLinters/eslint.xml +7 -0
- package/ide/jetbrains/.idea/modules.xml +8 -0
- package/ide/jetbrains/.idea/stacks.iml +22 -0
- package/ide/jetbrains/.idea/vcs.xml +6 -0
- package/ide/jetbrains/.idea/webResources.xml +14 -0
- package/ide/jetbrains/IntelliJ IDEA Global Settings +0 -0
- package/ide/jetbrains/installed.txt +4 -0
- package/ide/jetbrains/options/github-copilot.xml +5 -0
- package/ide/jetbrains/options/nodejs.xml +7 -0
- package/ide/jetbrains/options/templates.xml +124 -0
- package/ide/jetbrains/templates/JavaScript.xml +6 -0
- package/ide/jetbrains/templates/Stacks.xml +8 -0
- package/ide/vscode/.vscode/README.md +23 -0
- package/ide/vscode/.vscode/extensions.json +5 -0
- package/ide/vscode/.vscode/settings.json +176 -0
- package/ide/vscode/.vscode/stacks.code-snippets +181 -0
- package/ide/vscode/LICENSE.md +21 -0
- package/ide/vscode/README.md +36 -0
- package/ide/vscode/logo.png +0 -0
- package/ide/vscode/package.json +79 -0
- package/ide/zed/.zed/settings.json +139 -0
- package/lang/README.md +28 -0
- package/lang/de.yml +14 -0
- package/lang/en.yml +15 -0
- package/package.json +19 -3
- package/project/bootstrap +161 -0
- package/project/buddy +175 -0
- package/project/storage/framework/tsconfig.app.json +50 -0
- package/project/storage/framework/tsconfig.base.json +58 -0
- package/routes/core.ts +78 -0
- package/routes/dashboard-api.ts +233 -0
- package/routes/dashboard.ts +739 -0
- package/routes/email.ts +129 -0
- package/stores/[name].stx +16 -0
- package/stores/git.ts +71 -0
- package/stores/payment.ts +474 -0
- package/stores/queue.ts +43 -0
- package/stores/user.ts +29 -0
- package/stx-components-plugin.ts +25 -0
- package/styles/design-tokens.css +597 -0
- package/types/dashboard.ts +70 -0
- package/types/defaults.ts +438 -0
- package/vcs/github/CODE_OF_CONDUCT.md +83 -0
- package/vcs/github/CONTRIBUTING.md +187 -0
- package/vcs/github/EXPLANATIONS.md +41 -0
- package/vcs/github/FUNDING.yml +1 -0
- package/vcs/github/ISSUE_TEMPLATE/bug_report.yml +49 -0
- package/vcs/github/ISSUE_TEMPLATE/config.yml +10 -0
- package/vcs/github/ISSUE_TEMPLATE/feature_request.yml +44 -0
- package/vcs/github/SECURITY.md +70 -0
- package/vcs/github/renovate.json +5 -0
- package/vcs/github/stale.yml +14 -0
- package/vcs/github/workflows/README.md +16 -0
- package/vcs/github/workflows/ci.yml +114 -0
- package/vcs/github/workflows/export-size.yml +25 -0
- package/vcs/github/workflows/labeler.yml +13 -0
- package/vcs/github/workflows/release.yml +219 -0
- package/views/[...all].stx +8 -0
- package/views/about.md +3 -0
- package/views/auth/login.stx +1 -0
- package/views/auth/signup.stx +85 -0
- package/views/dashboard/.discovered-models.json +542 -0
- package/views/dashboard/AUDIT.md +904 -0
- package/views/dashboard/[...all].stx +89 -0
- package/views/dashboard/access-tokens/index.stx +177 -0
- package/views/dashboard/actions/index.stx +129 -0
- package/views/dashboard/analytics/blog/index.stx +356 -0
- package/views/dashboard/analytics/browsers/index.stx +263 -0
- package/views/dashboard/analytics/commerce/sales/index.stx +329 -0
- package/views/dashboard/analytics/commerce/web/index.stx +379 -0
- package/views/dashboard/analytics/countries/index.stx +289 -0
- package/views/dashboard/analytics/devices/index.stx +305 -0
- package/views/dashboard/analytics/events/index.stx +536 -0
- package/views/dashboard/analytics/index.stx +88 -0
- package/views/dashboard/analytics/marketing/index.stx +315 -0
- package/views/dashboard/analytics/pages/index.stx +271 -0
- package/views/dashboard/analytics/referrers/index.stx +319 -0
- package/views/dashboard/analytics/web/index.stx +356 -0
- package/views/dashboard/buddy/index.stx +198 -0
- package/views/dashboard/ci/index.stx +462 -0
- package/views/dashboard/cloud/index.stx +452 -0
- package/views/dashboard/commands/index.stx +295 -0
- package/views/dashboard/commerce/categories/index.stx +406 -0
- package/views/dashboard/commerce/coupons/index.stx +485 -0
- package/views/dashboard/commerce/customers/index.stx +410 -0
- package/views/dashboard/commerce/dashboard/index.stx +287 -0
- package/views/dashboard/commerce/delivery/delivery-routes.stx +305 -0
- package/views/dashboard/commerce/delivery/digital-delivery.stx +332 -0
- package/views/dashboard/commerce/delivery/drivers.stx +397 -0
- package/views/dashboard/commerce/delivery/index.stx +18 -0
- package/views/dashboard/commerce/delivery/license-keys.stx +380 -0
- package/views/dashboard/commerce/delivery/shipping-methods.stx +346 -0
- package/views/dashboard/commerce/delivery/shipping-rates.stx +338 -0
- package/views/dashboard/commerce/delivery/shipping-zones.stx +302 -0
- package/views/dashboard/commerce/delivery/tabs.ts +25 -0
- package/views/dashboard/commerce/gift-cards/index.stx +561 -0
- package/views/dashboard/commerce/manufacturers/index.stx +308 -0
- package/views/dashboard/commerce/orders/index.stx +247 -0
- package/views/dashboard/commerce/payments/index.stx +535 -0
- package/views/dashboard/commerce/pos/index.stx +653 -0
- package/views/dashboard/commerce/printers/devices/index.stx +273 -0
- package/views/dashboard/commerce/printers/receipts/index.stx +308 -0
- package/views/dashboard/commerce/products/detail.stx +563 -0
- package/views/dashboard/commerce/products/index.stx +370 -0
- package/views/dashboard/commerce/reviews/index.stx +656 -0
- package/views/dashboard/commerce/reviews/index.ts +0 -0
- package/views/dashboard/commerce/taxes/index.stx +377 -0
- package/views/dashboard/commerce/units/index.stx +317 -0
- package/views/dashboard/commerce/variants/index.stx +319 -0
- package/views/dashboard/commerce/waitlist/products.stx +942 -0
- package/views/dashboard/commerce/waitlist/restaurant.stx +1024 -0
- package/views/dashboard/components/index.stx +330 -0
- package/views/dashboard/composables/index.ts +19 -0
- package/views/dashboard/composables/useChart.ts +77 -0
- package/views/dashboard/composables/useNavigation.ts +99 -0
- package/views/dashboard/composables/useRole.ts +58 -0
- package/views/dashboard/composables/useTheme.ts +74 -0
- package/views/dashboard/content/authors/index.stx +171 -0
- package/views/dashboard/content/blog/index.stx +493 -0
- package/views/dashboard/content/categories/index.stx +169 -0
- package/views/dashboard/content/comments/index.stx +189 -0
- package/views/dashboard/content/dashboard.stx +383 -0
- package/views/dashboard/content/files/index.stx +706 -0
- package/views/dashboard/content/pages/index.stx +174 -0
- package/views/dashboard/content/posts/index.stx +269 -0
- package/views/dashboard/content/seo/index.stx +240 -0
- package/views/dashboard/content/tags/index.stx +167 -0
- package/views/dashboard/data/activity/index.stx +261 -0
- package/views/dashboard/data/dashboard/index.stx +116 -0
- package/views/dashboard/data/subscribers.stx +270 -0
- package/views/dashboard/data/teams.stx +275 -0
- package/views/dashboard/data/users.stx +279 -0
- package/views/dashboard/dependencies/index.stx +178 -0
- package/views/dashboard/deployments/[id].stx +234 -0
- package/views/dashboard/deployments/index.stx +9 -0
- package/views/dashboard/dns/index.stx +163 -0
- package/views/dashboard/environment/index.stx +283 -0
- package/views/dashboard/errors/index.stx +274 -0
- package/views/dashboard/forgot-password.stx +57 -0
- package/views/dashboard/functions/index.stx +159 -0
- package/views/dashboard/health/index.stx +248 -0
- package/views/dashboard/inbox/activity.stx +350 -0
- package/views/dashboard/inbox/index.stx +452 -0
- package/views/dashboard/inbox/settings.stx +290 -0
- package/views/dashboard/index.stx +252 -0
- package/views/dashboard/insights/index.stx +529 -0
- package/views/dashboard/jobs/[id].stx +430 -0
- package/views/dashboard/jobs/history.stx +222 -0
- package/views/dashboard/jobs/index.stx +214 -0
- package/views/dashboard/kanban/[id].stx +899 -0
- package/views/dashboard/kanban/index.stx +260 -0
- package/views/dashboard/layouts/default.stx +565 -0
- package/views/dashboard/layouts/guest.stx +10 -0
- package/views/dashboard/login.stx +48 -0
- package/views/dashboard/logs/index.stx +540 -0
- package/views/dashboard/mailboxes/index.stx +149 -0
- package/views/dashboard/management/permissions/index.stx +490 -0
- package/views/dashboard/marketing/campaigns/index.stx +604 -0
- package/views/dashboard/marketing/lists/index.stx +514 -0
- package/views/dashboard/marketing/reviews/index.stx +475 -0
- package/views/dashboard/marketing/social-posts/index.stx +560 -0
- package/views/dashboard/models/[model].stx +195 -0
- package/views/dashboard/models/index.stx +159 -0
- package/views/dashboard/monitoring/errors/index.stx +415 -0
- package/views/dashboard/notifications/dashboard.stx +383 -0
- package/views/dashboard/notifications/email.stx +336 -0
- package/views/dashboard/notifications/history.stx +373 -0
- package/views/dashboard/notifications/sms.stx +332 -0
- package/views/dashboard/packages/index.stx +195 -0
- package/views/dashboard/queries/[id].stx +381 -0
- package/views/dashboard/queries/history.stx +227 -0
- package/views/dashboard/queries/index.stx +335 -0
- package/views/dashboard/queries/slow.stx +318 -0
- package/views/dashboard/queue/index.stx +427 -0
- package/views/dashboard/realtime/index.stx +429 -0
- package/views/dashboard/register.stx +46 -0
- package/views/dashboard/releases/index.stx +389 -0
- package/views/dashboard/requests/index.stx +462 -0
- package/views/dashboard/serverless/index.stx +475 -0
- package/views/dashboard/servers/[id].stx +299 -0
- package/views/dashboard/servers/index.stx +483 -0
- package/views/dashboard/settings/billing.stx +50 -0
- package/views/dashboard/settings/index.stx +256 -0
- package/views/dashboard/settings/mail.stx +252 -0
- package/views/dashboard/stores/auth.ts +123 -0
- package/views/dashboard/stores/ci.ts +342 -0
- package/views/dashboard/stores/index.ts +129 -0
- package/views/dashboard/stores/kanban.ts +723 -0
- package/views/dashboard/stores/rbac.ts +350 -0
- package/views/dashboard/stx.config.ts +34 -0
- package/views/dashboard/teams/[id].stx +170 -0
- package/views/forum/category.stx +92 -0
- package/views/forum/index.stx +209 -0
- package/views/forum/new-topic.stx +113 -0
- package/views/forum/profile.stx +1 -0
- package/views/forum/topic.stx +143 -0
- package/views/hello-world/[name].stx +47 -0
- package/views/index.stx +21 -0
- package/views/system-tray/index.stx +147 -0
|
@@ -0,0 +1,350 @@
|
|
|
1
|
+
@extends('layouts/default')
|
|
2
|
+
|
|
3
|
+
@section('content')
|
|
4
|
+
@title('Mail - Activity Dashboard')
|
|
5
|
+
<div class="min-h-screen dark:bg-neutral-800">
|
|
6
|
+
<div class="flex h-screen">
|
|
7
|
+
<EmailSidebar :activeFolder="activeFolder" :folders="folders" :unreadCounts="unreadCounts" @update:active-folder="handleFolderChange" @compose="handleCompose" />
|
|
8
|
+
|
|
9
|
+
<div class="flex overflow-hidden flex-1 flex-col">
|
|
10
|
+
<div class="px-6 py-4 bg-white dark:bg-neutral-700 border-b border-gray-200 dark:border-neutral-600">
|
|
11
|
+
<div class="flex items-center justify-between">
|
|
12
|
+
<h1 class="font-bold text-2xl text-gray-900 dark:text-white">Email Activity</h1>
|
|
13
|
+
<div class="flex space-x-2">
|
|
14
|
+
<button @click="changeTimeRange('day')" class="px-3 py-1.5 text-sm font-medium rounded-md {{ timeRange() === 'day' ? 'bg-blue-100 text-blue-700 dark:bg-blue-900 dark:text-blue-100' : 'text-gray-700 hover:bg-gray-100 dark:text-neutral-200 dark:hover:bg-neutral-600' }}">Day</button>
|
|
15
|
+
<button @click="changeTimeRange('week')" class="px-3 py-1.5 text-sm font-medium rounded-md {{ timeRange() === 'week' ? 'bg-blue-100 text-blue-700 dark:bg-blue-900 dark:text-blue-100' : 'text-gray-700 hover:bg-gray-100 dark:text-neutral-200 dark:hover:bg-neutral-600' }}">Week</button>
|
|
16
|
+
<button @click="changeTimeRange('month')" class="px-3 py-1.5 text-sm font-medium rounded-md {{ timeRange() === 'month' ? 'bg-blue-100 text-blue-700 dark:bg-blue-900 dark:text-blue-100' : 'text-gray-700 hover:bg-gray-100 dark:text-neutral-200 dark:hover:bg-neutral-600' }}">Month</button>
|
|
17
|
+
<button @click="changeTimeRange('year')" class="px-3 py-1.5 text-sm font-medium rounded-md {{ timeRange() === 'year' ? 'bg-blue-100 text-blue-700 dark:bg-blue-900 dark:text-blue-100' : 'text-gray-700 hover:bg-gray-100 dark:text-neutral-200 dark:hover:bg-neutral-600' }}">Year</button>
|
|
18
|
+
</div>
|
|
19
|
+
</div>
|
|
20
|
+
</div>
|
|
21
|
+
|
|
22
|
+
<div class="grid gap-4 grid-cols-1 md:grid-cols-2 lg:grid-cols-4 p-6">
|
|
23
|
+
@foreach(stats as stat, index)
|
|
24
|
+
<div class="p-4 bg-white dark:bg-neutral-700 rounded-lg shadow">
|
|
25
|
+
<div class="flex items-center">
|
|
26
|
+
<div class="flex-shrink-0 p-3 bg-gray-100 dark:bg-neutral-600 rounded-md">
|
|
27
|
+
<i class="text-xl {{ stat.icon }}"></i>
|
|
28
|
+
</div>
|
|
29
|
+
<div class="ml-4">
|
|
30
|
+
<p class="font-medium text-gray-500 text-sm dark:text-neutral-400">{{ stat.name }}</p>
|
|
31
|
+
<div class="flex items-baseline">
|
|
32
|
+
<p class="font-semibold text-2xl text-gray-900 dark:text-white">{{ stat.value }}</p>
|
|
33
|
+
<p class="ml-2 text-sm font-medium {{ stat.change.startsWith('+') ? 'text-green-600 dark:text-green-400' : 'text-red-600 dark:text-red-400' }}">{{ stat.change }}</p>
|
|
34
|
+
</div>
|
|
35
|
+
</div>
|
|
36
|
+
</div>
|
|
37
|
+
</div>
|
|
38
|
+
@endforeach
|
|
39
|
+
</div>
|
|
40
|
+
|
|
41
|
+
<div class="overflow-y-auto flex-1 p-6 space-y-6">
|
|
42
|
+
<div class="p-4 bg-white dark:bg-neutral-700 rounded-lg shadow">
|
|
43
|
+
<div class="flex items-center justify-between mb-4">
|
|
44
|
+
<h2 class="font-medium text-gray-900 text-lg dark:text-neutral-100">Email Volume</h2>
|
|
45
|
+
</div>
|
|
46
|
+
<div class="relative h-80">
|
|
47
|
+
<div :show="isLoading" class="flex absolute inset-0 z-10 items-center justify-center bg-opacity-75 bg-white dark:bg-neutral-700 dark:bg-opacity-75">
|
|
48
|
+
<div class="h-8 w-8 border-b-2 border-blue-500 rounded-full animate-spin"></div>
|
|
49
|
+
</div>
|
|
50
|
+
<canvas id="inbox_activity_volume"></canvas>
|
|
51
|
+
</div>
|
|
52
|
+
</div>
|
|
53
|
+
|
|
54
|
+
<div class="p-4 bg-white dark:bg-neutral-700 rounded-lg shadow">
|
|
55
|
+
<div class="flex items-center justify-between mb-4">
|
|
56
|
+
<h2 class="font-medium text-gray-900 text-lg dark:text-neutral-100">Average Response Time</h2>
|
|
57
|
+
</div>
|
|
58
|
+
<div class="relative h-64">
|
|
59
|
+
<div :show="isLoading" class="flex absolute inset-0 z-10 items-center justify-center bg-opacity-75 bg-white dark:bg-neutral-700 dark:bg-opacity-75">
|
|
60
|
+
<div class="h-8 w-8 border-b-2 border-blue-500 rounded-full animate-spin"></div>
|
|
61
|
+
</div>
|
|
62
|
+
<canvas id="inbox_activity_response"></canvas>
|
|
63
|
+
</div>
|
|
64
|
+
</div>
|
|
65
|
+
|
|
66
|
+
<div class="grid gap-6 grid-cols-1 md:grid-cols-2">
|
|
67
|
+
<div class="p-4 bg-white dark:bg-neutral-700 rounded-lg shadow">
|
|
68
|
+
<div class="flex items-center justify-between mb-4">
|
|
69
|
+
<h2 class="font-medium text-gray-900 text-lg dark:text-neutral-100">Email Categories</h2>
|
|
70
|
+
</div>
|
|
71
|
+
<div class="relative h-64">
|
|
72
|
+
<canvas id="inbox_activity_category"></canvas>
|
|
73
|
+
</div>
|
|
74
|
+
</div>
|
|
75
|
+
|
|
76
|
+
<div class="p-4 bg-white dark:bg-neutral-700 rounded-lg shadow">
|
|
77
|
+
<div class="flex items-center justify-between mb-4">
|
|
78
|
+
<h2 class="font-medium text-gray-900 text-lg dark:text-neutral-100">Device Usage</h2>
|
|
79
|
+
</div>
|
|
80
|
+
<div class="relative h-64">
|
|
81
|
+
<canvas id="inbox_activity_device"></canvas>
|
|
82
|
+
</div>
|
|
83
|
+
</div>
|
|
84
|
+
</div>
|
|
85
|
+
|
|
86
|
+
<div class="overflow-hidden bg-white dark:bg-neutral-700 rounded-lg shadow">
|
|
87
|
+
<div class="px-4 py-5 sm:px-6 border-b border-gray-200 dark:border-neutral-600">
|
|
88
|
+
<h3 class="font-medium text-gray-900 text-lg dark:text-neutral-100">Recent Activity</h3>
|
|
89
|
+
</div>
|
|
90
|
+
<div class="overflow-x-auto">
|
|
91
|
+
<table class="min-w-full divide-gray-200 divide-y dark:divide-neutral-600">
|
|
92
|
+
<thead class="bg-gray-50 dark:bg-neutral-600">
|
|
93
|
+
<tr>
|
|
94
|
+
<th scope="col" class="px-6 py-3 font-medium text-gray-500 text-left text-xs tracking-wider uppercase dark:text-neutral-300">Action</th>
|
|
95
|
+
<th scope="col" class="px-6 py-3 font-medium text-gray-500 text-left text-xs tracking-wider uppercase dark:text-neutral-300">Email</th>
|
|
96
|
+
<th scope="col" class="px-6 py-3 font-medium text-gray-500 text-left text-xs tracking-wider uppercase dark:text-neutral-300">Time</th>
|
|
97
|
+
<th scope="col" class="px-6 py-3 font-medium text-gray-500 text-left text-xs tracking-wider uppercase dark:text-neutral-300">Status</th>
|
|
98
|
+
</tr>
|
|
99
|
+
</thead>
|
|
100
|
+
<tbody class="bg-white dark:bg-neutral-700 divide-gray-200 divide-y dark:divide-neutral-600">
|
|
101
|
+
<tr>
|
|
102
|
+
<td class="px-6 py-4 whitespace-nowrap">
|
|
103
|
+
<div class="flex items-center">
|
|
104
|
+
<div class="flex flex-shrink-0 items-center justify-center h-8 w-8 bg-blue-100 rounded-full">
|
|
105
|
+
<i class="text-blue-600 i-hugeicons-mail-receive-02"></i>
|
|
106
|
+
</div>
|
|
107
|
+
<div class="ml-4">
|
|
108
|
+
<div class="font-medium text-gray-900 text-sm dark:text-white">Received Email</div>
|
|
109
|
+
</div>
|
|
110
|
+
</div>
|
|
111
|
+
</td>
|
|
112
|
+
<td class="px-6 py-4 whitespace-nowrap">
|
|
113
|
+
<div class="text-gray-900 text-sm dark:text-white">New Project Roadmap</div>
|
|
114
|
+
<div class="text-gray-500 text-xs dark:text-neutral-400">From: Chris Breuer</div>
|
|
115
|
+
</td>
|
|
116
|
+
<td class="px-6 py-4 text-gray-500 text-sm whitespace-nowrap dark:text-neutral-400">10 minutes ago</td>
|
|
117
|
+
<td class="px-6 py-4 whitespace-nowrap">
|
|
118
|
+
<span class="inline-flex px-2 font-semibold leading-5 text-green-800 text-xs dark:text-green-100 bg-green-100 dark:bg-green-900 rounded-full">Delivered</span>
|
|
119
|
+
</td>
|
|
120
|
+
</tr>
|
|
121
|
+
<tr>
|
|
122
|
+
<td class="px-6 py-4 whitespace-nowrap">
|
|
123
|
+
<div class="flex items-center">
|
|
124
|
+
<div class="flex flex-shrink-0 items-center justify-center h-8 w-8 bg-green-100 rounded-full">
|
|
125
|
+
<i class="text-green-600 i-hugeicons-mail-send-02"></i>
|
|
126
|
+
</div>
|
|
127
|
+
<div class="ml-4">
|
|
128
|
+
<div class="font-medium text-gray-900 text-sm dark:text-white">Sent Email</div>
|
|
129
|
+
</div>
|
|
130
|
+
</div>
|
|
131
|
+
</td>
|
|
132
|
+
<td class="px-6 py-4 whitespace-nowrap">
|
|
133
|
+
<div class="text-gray-900 text-sm dark:text-white">Re: Design Review Scheduled</div>
|
|
134
|
+
<div class="text-gray-500 text-xs dark:text-neutral-400">To: Blake</div>
|
|
135
|
+
</td>
|
|
136
|
+
<td class="px-6 py-4 text-gray-500 text-sm whitespace-nowrap dark:text-neutral-400">1 hour ago</td>
|
|
137
|
+
<td class="px-6 py-4 whitespace-nowrap">
|
|
138
|
+
<span class="inline-flex px-2 font-semibold leading-5 text-green-800 text-xs dark:text-green-100 bg-green-100 dark:bg-green-900 rounded-full">Sent</span>
|
|
139
|
+
</td>
|
|
140
|
+
</tr>
|
|
141
|
+
<tr>
|
|
142
|
+
<td class="px-6 py-4 whitespace-nowrap">
|
|
143
|
+
<div class="flex items-center">
|
|
144
|
+
<div class="flex flex-shrink-0 items-center justify-center h-8 w-8 bg-red-100 rounded-full">
|
|
145
|
+
<i class="text-red-600 i-hugeicons-spam"></i>
|
|
146
|
+
</div>
|
|
147
|
+
<div class="ml-4">
|
|
148
|
+
<div class="font-medium text-gray-900 text-sm dark:text-white">Spam Detected</div>
|
|
149
|
+
</div>
|
|
150
|
+
</div>
|
|
151
|
+
</td>
|
|
152
|
+
<td class="px-6 py-4 whitespace-nowrap">
|
|
153
|
+
<div class="text-gray-900 text-sm dark:text-white">Special Offer: Limited Time</div>
|
|
154
|
+
<div class="text-gray-500 text-xs dark:text-neutral-400">From: marketing@example.com</div>
|
|
155
|
+
</td>
|
|
156
|
+
<td class="px-6 py-4 text-gray-500 text-sm whitespace-nowrap dark:text-neutral-400">3 hours ago</td>
|
|
157
|
+
<td class="px-6 py-4 whitespace-nowrap">
|
|
158
|
+
<span class="inline-flex px-2 font-semibold leading-5 text-red-800 text-xs dark:text-red-100 bg-red-100 dark:bg-red-900 rounded-full">Blocked</span>
|
|
159
|
+
</td>
|
|
160
|
+
</tr>
|
|
161
|
+
<tr>
|
|
162
|
+
<td class="px-6 py-4 whitespace-nowrap">
|
|
163
|
+
<div class="flex items-center">
|
|
164
|
+
<div class="flex flex-shrink-0 items-center justify-center h-8 w-8 bg-yellow-100 rounded-full">
|
|
165
|
+
<i class="text-yellow-600 i-hugeicons-star"></i>
|
|
166
|
+
</div>
|
|
167
|
+
<div class="ml-4">
|
|
168
|
+
<div class="font-medium text-gray-900 text-sm dark:text-white">Starred Email</div>
|
|
169
|
+
</div>
|
|
170
|
+
</div>
|
|
171
|
+
</td>
|
|
172
|
+
<td class="px-6 py-4 whitespace-nowrap">
|
|
173
|
+
<div class="text-gray-900 text-sm dark:text-white">Weekly Team Update</div>
|
|
174
|
+
<div class="text-gray-500 text-xs dark:text-neutral-400">From: Sarah Johnson</div>
|
|
175
|
+
</td>
|
|
176
|
+
<td class="px-6 py-4 text-gray-500 text-sm whitespace-nowrap dark:text-neutral-400">Yesterday</td>
|
|
177
|
+
<td class="px-6 py-4 whitespace-nowrap">
|
|
178
|
+
<span class="inline-flex px-2 font-semibold leading-5 text-blue-800 text-xs dark:text-blue-100 bg-blue-100 dark:bg-blue-900 rounded-full">Read</span>
|
|
179
|
+
</td>
|
|
180
|
+
</tr>
|
|
181
|
+
</tbody>
|
|
182
|
+
</table>
|
|
183
|
+
</div>
|
|
184
|
+
</div>
|
|
185
|
+
</div>
|
|
186
|
+
</div>
|
|
187
|
+
</div>
|
|
188
|
+
</div>
|
|
189
|
+
|
|
190
|
+
<script client>
|
|
191
|
+
|
|
192
|
+
interface ChartLike { destroy: () => void, update: () => void, data: { labels: string[], datasets: Array<{ data: number[] }> } }
|
|
193
|
+
type ChartCtor = new (canvas: HTMLElement, config: { type: string, data: unknown, options?: unknown }) => ChartLike
|
|
194
|
+
|
|
195
|
+
const folders = [
|
|
196
|
+
{ id: 'inbox', name: 'Inbox', icon: 'inbox' },
|
|
197
|
+
{ id: 'starred', name: 'Starred', icon: 'star' },
|
|
198
|
+
{ id: 'sent', name: 'Sent', icon: 'mail-send-01' },
|
|
199
|
+
{ id: 'drafts', name: 'Drafts', icon: 'license-draft' },
|
|
200
|
+
{ id: 'archive', name: 'Archive', icon: 'archive' },
|
|
201
|
+
{ id: 'spam', name: 'Spam', icon: 'spam' },
|
|
202
|
+
{ id: 'trash', name: 'Trash', icon: 'waste' },
|
|
203
|
+
]
|
|
204
|
+
|
|
205
|
+
const unreadCounts = {
|
|
206
|
+
inbox: 2,
|
|
207
|
+
starred: 1,
|
|
208
|
+
sent: 0,
|
|
209
|
+
drafts: 0,
|
|
210
|
+
archive: 0,
|
|
211
|
+
spam: 1,
|
|
212
|
+
trash: 0,
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
const stats = [
|
|
216
|
+
{ name: 'Total Emails', value: '1,284', change: '+12.3%', icon: 'i-hugeicons-mail-02 text-blue-500' },
|
|
217
|
+
{ name: 'Average Response Time', value: '28 min', change: '-8.1%', icon: 'i-hugeicons-clock-01 text-green-500' },
|
|
218
|
+
{ name: 'Spam Detected', value: '124', change: '+3.2%', icon: 'i-hugeicons-spam text-red-500' },
|
|
219
|
+
{ name: 'Attachments', value: '256', change: '+18.7%', icon: 'i-hugeicons-attachment-01 text-purple-500' },
|
|
220
|
+
]
|
|
221
|
+
|
|
222
|
+
const timeRange = state('week')
|
|
223
|
+
const activeFolder = state('inbox')
|
|
224
|
+
const isLoading = state(false)
|
|
225
|
+
|
|
226
|
+
let charts: ChartLike[] = []
|
|
227
|
+
|
|
228
|
+
const lineChartOptions = {
|
|
229
|
+
responsive: true,
|
|
230
|
+
maintainAspectRatio: false,
|
|
231
|
+
scales: {
|
|
232
|
+
y: { beginAtZero: true, grid: { color: 'rgba(200, 200, 200, 0.1)' }, ticks: { color: 'rgb(156, 163, 175)', font: { family: "'JetBrains Mono', monospace" } } },
|
|
233
|
+
x: { grid: { display: false }, ticks: { color: 'rgb(156, 163, 175)', font: { family: "'JetBrains Mono', monospace" } } },
|
|
234
|
+
},
|
|
235
|
+
plugins: {
|
|
236
|
+
legend: { display: true, position: 'top', align: 'end', labels: { color: 'rgb(156, 163, 175)', font: { family: "'JetBrains Mono', monospace" }, boxWidth: 12, padding: 15 } },
|
|
237
|
+
tooltip: { mode: 'index', intersect: false },
|
|
238
|
+
},
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
const barChartOptions = {
|
|
242
|
+
...lineChartOptions,
|
|
243
|
+
plugins: { ...lineChartOptions.plugins, legend: { ...lineChartOptions.plugins.legend, display: false } },
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
const doughnutChartOptions = {
|
|
247
|
+
responsive: true,
|
|
248
|
+
maintainAspectRatio: false,
|
|
249
|
+
plugins: {
|
|
250
|
+
legend: { display: true, position: 'right', labels: { color: 'rgb(156, 163, 175)', font: { family: "'JetBrains Mono', monospace" }, boxWidth: 12, padding: 15 } },
|
|
251
|
+
tooltip: { mode: 'index', intersect: false },
|
|
252
|
+
},
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
function rangeMeta(): { labels: string[], dataPoints: number } {
|
|
256
|
+
const range = timeRange()
|
|
257
|
+
if (range === 'day')
|
|
258
|
+
return { labels: Array.from({ length: 24 }, (_, i) => `${i}:00`), dataPoints: 24 }
|
|
259
|
+
if (range === 'week')
|
|
260
|
+
return { labels: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'], dataPoints: 7 }
|
|
261
|
+
if (range === 'month')
|
|
262
|
+
return { labels: Array.from({ length: 30 }, (_, i) => `${i + 1}`), dataPoints: 30 }
|
|
263
|
+
return { labels: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], dataPoints: 12 }
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
function getEmailActivityData() {
|
|
267
|
+
const { labels, dataPoints } = rangeMeta()
|
|
268
|
+
return {
|
|
269
|
+
labels,
|
|
270
|
+
datasets: [
|
|
271
|
+
{ label: 'Received', data: Array.from({ length: dataPoints }, () => Math.floor(Math.random() * 50) + 20), borderColor: 'rgb(59, 130, 246)', backgroundColor: 'rgba(59, 130, 246, 0.1)', fill: true },
|
|
272
|
+
{ label: 'Sent', data: Array.from({ length: dataPoints }, () => Math.floor(Math.random() * 30) + 10), borderColor: 'rgb(16, 185, 129)', backgroundColor: 'rgba(16, 185, 129, 0.1)', fill: true },
|
|
273
|
+
{ label: 'Spam', data: Array.from({ length: dataPoints }, () => Math.floor(Math.random() * 10)), borderColor: 'rgb(239, 68, 68)', backgroundColor: 'rgba(239, 68, 68, 0.1)', fill: true },
|
|
274
|
+
],
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
function getResponseTimeData() {
|
|
279
|
+
const { labels, dataPoints } = rangeMeta()
|
|
280
|
+
return {
|
|
281
|
+
labels,
|
|
282
|
+
datasets: [{ label: 'Response Time (minutes)', data: Array.from({ length: dataPoints }, () => Math.floor(Math.random() * 60) + 5), backgroundColor: 'rgba(99, 102, 241, 0.8)' }],
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
const emailCategoryData = {
|
|
287
|
+
labels: ['Work', 'Personal', 'Promotions', 'Updates', 'Forums'],
|
|
288
|
+
datasets: [{ data: [45, 25, 15, 10, 5], backgroundColor: ['rgba(59, 130, 246, 0.8)', 'rgba(16, 185, 129, 0.8)', 'rgba(245, 158, 11, 0.8)', 'rgba(99, 102, 241, 0.8)', 'rgba(239, 68, 68, 0.8)'], borderWidth: 0 }],
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
const deviceUsageData = {
|
|
292
|
+
labels: ['Desktop', 'Mobile', 'Tablet'],
|
|
293
|
+
datasets: [{ data: [65, 30, 5], backgroundColor: ['rgba(59, 130, 246, 0.8)', 'rgba(16, 185, 129, 0.8)', 'rgba(245, 158, 11, 0.8)'], borderWidth: 0 }],
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
async function changeTimeRange(newRange: string): Promise<void> {
|
|
297
|
+
timeRange.set(newRange)
|
|
298
|
+
isLoading.set(true)
|
|
299
|
+
await new Promise(resolve => setTimeout(resolve, 500))
|
|
300
|
+
if (charts[0]) {
|
|
301
|
+
const data = getEmailActivityData()
|
|
302
|
+
charts[0].data.labels = data.labels
|
|
303
|
+
data.datasets.forEach((ds, i) => {
|
|
304
|
+
if (charts[0]?.data.datasets[i])
|
|
305
|
+
charts[0].data.datasets[i].data = ds.data
|
|
306
|
+
})
|
|
307
|
+
charts[0].update()
|
|
308
|
+
}
|
|
309
|
+
if (charts[1]) {
|
|
310
|
+
const data = getResponseTimeData()
|
|
311
|
+
charts[1].data.labels = data.labels
|
|
312
|
+
if (charts[1].data.datasets[0])
|
|
313
|
+
charts[1].data.datasets[0].data = data.datasets[0]?.data ?? []
|
|
314
|
+
charts[1].update()
|
|
315
|
+
}
|
|
316
|
+
isLoading.set(false)
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
function handleFolderChange(folder: string): void {
|
|
320
|
+
activeFolder.set(folder)
|
|
321
|
+
navigate(`/inbox?folder=${encodeURIComponent(folder)}`)
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
function handleCompose(): void {
|
|
325
|
+
navigate('/inbox?compose=true')
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
onMount(async () => {
|
|
329
|
+
isLoading.set(true)
|
|
330
|
+
const { Chart, registerables } = await import('@stacksjs/charts')
|
|
331
|
+
Chart.register(...registerables)
|
|
332
|
+
const Ctor = Chart as unknown as ChartCtor
|
|
333
|
+
|
|
334
|
+
const volume = useChart({ Chart: Ctor, id: 'inbox_activity_volume', type: 'line', data: getEmailActivityData(), options: lineChartOptions })
|
|
335
|
+
const response = useChart({ Chart: Ctor, id: 'inbox_activity_response', type: 'bar', data: getResponseTimeData(), options: barChartOptions })
|
|
336
|
+
const category = useChart({ Chart: Ctor, id: 'inbox_activity_category', type: 'doughnut', data: emailCategoryData, options: doughnutChartOptions })
|
|
337
|
+
const device = useChart({ Chart: Ctor, id: 'inbox_activity_device', type: 'doughnut', data: deviceUsageData, options: doughnutChartOptions })
|
|
338
|
+
|
|
339
|
+
charts = [volume.instance, response.instance, category.instance, device.instance].filter((c): c is ChartLike => c !== null)
|
|
340
|
+
await new Promise(resolve => setTimeout(resolve, 500))
|
|
341
|
+
isLoading.set(false)
|
|
342
|
+
})
|
|
343
|
+
|
|
344
|
+
onDestroy(() => {
|
|
345
|
+
charts.forEach(c => c.destroy())
|
|
346
|
+
charts = []
|
|
347
|
+
})
|
|
348
|
+
</script>
|
|
349
|
+
|
|
350
|
+
@endsection
|