@stacksjs/defaults 0.70.207 → 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,335 @@
|
|
|
1
|
+
@extends('layouts/default')
|
|
2
|
+
|
|
3
|
+
@section('content')
|
|
4
|
+
@title('Dashboard - Queries')
|
|
5
|
+
<div class="min-h-screen">
|
|
6
|
+
<header class="flex sticky top-0 z-10 flex-wrap gap-6 items-center justify-between px-4 py-4 sm:px-6 lg:px-8 bg-white dark:bg-neutral-900 shadow-sm">
|
|
7
|
+
<div>
|
|
8
|
+
<h1 class="font-semibold leading-7 text-gray-900 text-lg dark:text-white">Queries Dashboard</h1>
|
|
9
|
+
<p class="mt-1 leading-6 text-gray-500 text-sm dark:text-neutral-400">Monitor and analyze database query performance</p>
|
|
10
|
+
</div>
|
|
11
|
+
<div class="flex gap-3 items-center">
|
|
12
|
+
<div class="inline-flex rounded-md shadow-sm">
|
|
13
|
+
<button type="button" @click="setTimeRange('hour')" class="inline-flex relative items-center px-3 py-2 font-medium text-sm rounded-l-md ring-1 ring-gray-300 ring-inset dark:ring-neutral-700 {{ timeRange() === 'hour' ? 'bg-blue-600 text-white' : 'bg-white text-gray-700 dark:bg-neutral-800 dark:text-neutral-200 hover:bg-gray-50 dark:hover:bg-neutral-700' }}">Hour</button>
|
|
14
|
+
<button type="button" @click="setTimeRange('day')" class="inline-flex relative items-center -ml-px px-3 py-2 font-medium text-sm ring-1 ring-gray-300 ring-inset dark:ring-neutral-700 {{ timeRange() === 'day' ? 'bg-blue-600 text-white' : 'bg-white text-gray-700 dark:bg-neutral-800 dark:text-neutral-200 hover:bg-gray-50 dark:hover:bg-neutral-700' }}">Day</button>
|
|
15
|
+
<button type="button" @click="setTimeRange('week')" class="inline-flex relative items-center -ml-px px-3 py-2 font-medium text-sm rounded-r-md ring-1 ring-gray-300 ring-inset dark:ring-neutral-700 {{ timeRange() === 'week' ? 'bg-blue-600 text-white' : 'bg-white text-gray-700 dark:bg-neutral-800 dark:text-neutral-200 hover:bg-gray-50 dark:hover:bg-neutral-700' }}">Week</button>
|
|
16
|
+
</div>
|
|
17
|
+
<div>
|
|
18
|
+
<select id="connection" name="connection" x-model="selectedConnection" class="block pl-3 pr-10 py-2 w-full text-sm dark:text-neutral-200 bg-white dark:bg-neutral-800 border-gray-300 rounded-md dark:border-neutral-700 focus:border-blue-600 focus:outline-none focus:ring-blue-600">
|
|
19
|
+
<option value="all">All connections</option>
|
|
20
|
+
<option value="mysql">MySQL</option>
|
|
21
|
+
<option value="postgres">PostgreSQL</option>
|
|
22
|
+
<option value="sqlite">SQLite</option>
|
|
23
|
+
<option value="mongodb">MongoDB</option>
|
|
24
|
+
</select>
|
|
25
|
+
</div>
|
|
26
|
+
<div>
|
|
27
|
+
<select id="type" name="type" x-model="selectedType" class="block pl-3 pr-10 py-2 w-full text-sm dark:text-neutral-200 bg-white dark:bg-neutral-800 border-gray-300 rounded-md dark:border-neutral-700 focus:border-blue-600 focus:outline-none focus:ring-blue-600">
|
|
28
|
+
<option value="all">All types</option>
|
|
29
|
+
<option value="SELECT">SELECT</option>
|
|
30
|
+
<option value="INSERT">INSERT</option>
|
|
31
|
+
<option value="UPDATE">UPDATE</option>
|
|
32
|
+
<option value="DELETE">DELETE</option>
|
|
33
|
+
<option value="OTHER">OTHER</option>
|
|
34
|
+
</select>
|
|
35
|
+
</div>
|
|
36
|
+
</div>
|
|
37
|
+
</header>
|
|
38
|
+
|
|
39
|
+
<main class="px-4 py-8 sm:px-6 lg:px-8">
|
|
40
|
+
<div class="grid gap-5 grid-cols-1 sm:grid-cols-2 lg:grid-cols-6">
|
|
41
|
+
<div class="overflow-hidden px-4 py-5 sm:p-6 bg-white dark:bg-neutral-800 rounded-lg shadow">
|
|
42
|
+
<dt class="font-medium text-gray-500 text-sm truncate dark:text-neutral-400">Total Queries</dt>
|
|
43
|
+
<dd class="mt-1 font-semibold text-3xl text-gray-900 tracking-tight dark:text-white">{{ statsTotal() }}</dd>
|
|
44
|
+
</div>
|
|
45
|
+
<div class="overflow-hidden px-4 py-5 sm:p-6 bg-white dark:bg-neutral-800 rounded-lg shadow">
|
|
46
|
+
<dt class="font-medium text-gray-500 text-sm truncate dark:text-neutral-400">SELECT Queries</dt>
|
|
47
|
+
<dd class="mt-1 font-semibold text-3xl text-blue-600 tracking-tight dark:text-blue-400">{{ statsSelect() }}</dd>
|
|
48
|
+
</div>
|
|
49
|
+
<div class="overflow-hidden px-4 py-5 sm:p-6 bg-white dark:bg-neutral-800 rounded-lg shadow">
|
|
50
|
+
<dt class="font-medium text-gray-500 text-sm truncate dark:text-neutral-400">INSERT Queries</dt>
|
|
51
|
+
<dd class="mt-1 font-semibold text-3xl text-green-600 tracking-tight dark:text-green-400">{{ statsInsert() }}</dd>
|
|
52
|
+
</div>
|
|
53
|
+
<div class="overflow-hidden px-4 py-5 sm:p-6 bg-white dark:bg-neutral-800 rounded-lg shadow">
|
|
54
|
+
<dt class="font-medium text-gray-500 text-sm truncate dark:text-neutral-400">UPDATE Queries</dt>
|
|
55
|
+
<dd class="mt-1 font-semibold text-3xl text-amber-600 tracking-tight dark:text-amber-400">{{ statsUpdate() }}</dd>
|
|
56
|
+
</div>
|
|
57
|
+
<div class="overflow-hidden px-4 py-5 sm:p-6 bg-white dark:bg-neutral-800 rounded-lg shadow">
|
|
58
|
+
<dt class="font-medium text-gray-500 text-sm truncate dark:text-neutral-400">DELETE Queries</dt>
|
|
59
|
+
<dd class="mt-1 font-semibold text-3xl text-red-600 tracking-tight dark:text-red-400">{{ statsDelete() }}</dd>
|
|
60
|
+
</div>
|
|
61
|
+
<div class="overflow-hidden px-4 py-5 sm:p-6 bg-white dark:bg-neutral-800 rounded-lg shadow">
|
|
62
|
+
<dt class="font-medium text-gray-500 text-sm truncate dark:text-neutral-400">Slow Queries</dt>
|
|
63
|
+
<dd class="mt-1 font-semibold text-3xl text-yellow-600 tracking-tight dark:text-yellow-400">{{ statsSlow() }}</dd>
|
|
64
|
+
</div>
|
|
65
|
+
</div>
|
|
66
|
+
|
|
67
|
+
<div class="grid gap-5 grid-cols-1 lg:grid-cols-2 mt-8">
|
|
68
|
+
<div class="overflow-hidden bg-white dark:bg-neutral-800 rounded-lg shadow">
|
|
69
|
+
<div class="p-6">
|
|
70
|
+
<h3 class="font-semibold leading-6 text-base text-gray-900 dark:text-white">Query Volume</h3>
|
|
71
|
+
<p class="mt-2 text-gray-500 text-sm dark:text-neutral-400">Number of queries by type over time</p>
|
|
72
|
+
<div class="relative mt-6 h-80">
|
|
73
|
+
<div :show="isLoading" class="flex absolute inset-0 items-center justify-center bg-gray-100/50 dark:bg-neutral-800/50">
|
|
74
|
+
<div class="h-8 w-8 text-blue-600 dark:text-blue-400 animate-spin i-hugeicons-loading-01"></div>
|
|
75
|
+
</div>
|
|
76
|
+
<canvas id="queries_volume_chart"></canvas>
|
|
77
|
+
</div>
|
|
78
|
+
</div>
|
|
79
|
+
</div>
|
|
80
|
+
<div class="overflow-hidden bg-white dark:bg-neutral-800 rounded-lg shadow">
|
|
81
|
+
<div class="p-6">
|
|
82
|
+
<h3 class="font-semibold leading-6 text-base text-gray-900 dark:text-white">Query Duration</h3>
|
|
83
|
+
<p class="mt-2 text-gray-500 text-sm dark:text-neutral-400">Average query execution time over time</p>
|
|
84
|
+
<div class="relative mt-6 h-80">
|
|
85
|
+
<div :show="isLoading" class="flex absolute inset-0 items-center justify-center bg-gray-100/50 dark:bg-neutral-800/50">
|
|
86
|
+
<div class="h-8 w-8 text-blue-600 dark:text-blue-400 animate-spin i-hugeicons-loading-01"></div>
|
|
87
|
+
</div>
|
|
88
|
+
<canvas id="queries_duration_chart"></canvas>
|
|
89
|
+
</div>
|
|
90
|
+
</div>
|
|
91
|
+
</div>
|
|
92
|
+
</div>
|
|
93
|
+
|
|
94
|
+
<div class="mt-8">
|
|
95
|
+
<h3 class="font-semibold leading-6 text-base text-gray-900 dark:text-white">Recent Queries</h3>
|
|
96
|
+
<div class="overflow-hidden mt-6 ring-1 ring-black ring-opacity-5 rounded-lg shadow">
|
|
97
|
+
<table class="min-w-full divide-gray-300 divide-y dark:divide-neutral-700">
|
|
98
|
+
<thead class="bg-gray-50 dark:bg-neutral-800">
|
|
99
|
+
<tr>
|
|
100
|
+
<th scope="col" class="pl-4 pr-3 py-3.5 sm:pl-6 font-semibold text-gray-900 text-left text-sm dark:text-white">Query</th>
|
|
101
|
+
<th scope="col" class="hidden lg:table-cell px-3 py-3.5 font-semibold text-gray-900 text-left text-sm dark:text-white">Connection</th>
|
|
102
|
+
<th scope="col" class="hidden sm:table-cell px-3 py-3.5 font-semibold text-gray-900 text-left text-sm dark:text-white">Duration</th>
|
|
103
|
+
<th scope="col" class="hidden lg:table-cell px-3 py-3.5 font-semibold text-gray-900 text-left text-sm dark:text-white">Model</th>
|
|
104
|
+
<th scope="col" class="px-3 py-3.5 font-semibold text-gray-900 text-left text-sm dark:text-white">Status</th>
|
|
105
|
+
<th scope="col" class="hidden sm:table-cell px-3 py-3.5 font-semibold text-gray-900 text-left text-sm dark:text-white">Executed At</th>
|
|
106
|
+
<th scope="col" class="relative pl-3 pr-4 py-3.5 sm:pr-6"><span class="sr-only">View</span></th>
|
|
107
|
+
</tr>
|
|
108
|
+
</thead>
|
|
109
|
+
<tbody class="bg-white dark:bg-neutral-900 divide-gray-200 divide-y dark:divide-neutral-700">
|
|
110
|
+
<template :for="query in filteredQueries">
|
|
111
|
+
<tr>
|
|
112
|
+
<td class="pl-4 pr-3 py-4 sm:pl-6 text-sm">
|
|
113
|
+
<div class="flex gap-2 items-center mb-1">
|
|
114
|
+
<span class="{{ queryTypeBadgeClass(query.query) }} inline-flex items-center px-2 py-1 font-medium text-xs ring-1 ring-inset rounded-md">{{ getQueryType(query.query) }}</span>
|
|
115
|
+
<div class="font-medium font-mono text-gray-900 text-xs dark:text-white">{{ formatQuery(query.query) }}</div>
|
|
116
|
+
</div>
|
|
117
|
+
<div class="hidden xl:block text-gray-500 dark:text-neutral-400">
|
|
118
|
+
<template :for="tag in query.tags">
|
|
119
|
+
<span class="inline-flex items-center mr-1 px-2 py-1 font-medium text-xs rounded-md">{{ tag }}</span>
|
|
120
|
+
</template>
|
|
121
|
+
</div>
|
|
122
|
+
</td>
|
|
123
|
+
<td class="hidden lg:table-cell px-3 py-4 text-gray-500 text-sm dark:text-neutral-400">{{ query.connection }}</td>
|
|
124
|
+
<td class="hidden sm:table-cell px-3 py-4 text-gray-500 text-sm dark:text-neutral-400 {{ query.duration > 10 ? 'text-yellow-600 dark:text-yellow-400' : '' }}">{{ formatDuration(query.duration) }}</td>
|
|
125
|
+
<td class="hidden lg:table-cell px-3 py-4 text-gray-500 text-sm dark:text-neutral-400">{{ query.model }}</td>
|
|
126
|
+
<td class="px-3 py-4 text-sm">
|
|
127
|
+
<span class="{{ getQueryStatusColor(query.status) }} inline-flex items-center px-2 py-1 font-medium text-xs ring-1 ring-inset rounded-md">{{ query.status }}</span>
|
|
128
|
+
</td>
|
|
129
|
+
<td class="hidden sm:table-cell px-3 py-4 text-gray-500 text-sm dark:text-neutral-400">{{ query.executed_at }}</td>
|
|
130
|
+
<td class="relative pl-3 pr-4 py-4 sm:pr-6 font-medium text-right text-sm">
|
|
131
|
+
<StxLink to="/queries/{{ query.id }}" class="text-blue-600 dark:text-blue-400 hover:text-blue-900 dark:hover:text-blue-300">View<span class="sr-only">, {{ query.id }}</span></StxLink>
|
|
132
|
+
</td>
|
|
133
|
+
</tr>
|
|
134
|
+
</template>
|
|
135
|
+
</tbody>
|
|
136
|
+
</table>
|
|
137
|
+
</div>
|
|
138
|
+
</div>
|
|
139
|
+
</main>
|
|
140
|
+
</div>
|
|
141
|
+
|
|
142
|
+
<style>
|
|
143
|
+
.sql-highlight { color: #f8f8f2; }
|
|
144
|
+
.sql-highlight .keyword { color: #ff79c6; }
|
|
145
|
+
.sql-highlight .function { color: #50fa7b; }
|
|
146
|
+
.sql-highlight .number { color: #bd93f9; }
|
|
147
|
+
.sql-highlight .string { color: #f1fa8c; }
|
|
148
|
+
.sql-highlight .comment { color: #6272a4; }
|
|
149
|
+
|
|
150
|
+
.font-mono {
|
|
151
|
+
font-family: 'JetBrains Mono', Menlo, Monaco, Consolas, 'Courier New', monospace;
|
|
152
|
+
font-size: 0.85em;
|
|
153
|
+
line-height: 1.5;
|
|
154
|
+
}
|
|
155
|
+
</style>
|
|
156
|
+
|
|
157
|
+
<script client>
|
|
158
|
+
|
|
159
|
+
interface QueryRecord {
|
|
160
|
+
id: string
|
|
161
|
+
query: string
|
|
162
|
+
duration: number
|
|
163
|
+
normalized_query: string
|
|
164
|
+
connection: string
|
|
165
|
+
status: 'completed' | 'failed' | 'slow'
|
|
166
|
+
executed_at: string
|
|
167
|
+
bindings?: unknown[]
|
|
168
|
+
model?: string
|
|
169
|
+
method?: string
|
|
170
|
+
file?: string
|
|
171
|
+
line?: number
|
|
172
|
+
memory_usage?: number
|
|
173
|
+
rows_affected?: number
|
|
174
|
+
tags?: string[]
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
interface ChartLike { destroy: () => void }
|
|
178
|
+
type ChartCtor = new (canvas: HTMLElement, config: { type: string, data: unknown, options?: unknown }) => ChartLike
|
|
179
|
+
|
|
180
|
+
const stats = state({ total: 1286, select: 954, insert: 152, update: 98, delete: 82, slow: 24 })
|
|
181
|
+
|
|
182
|
+
const recentQueries = state<QueryRecord[]>([
|
|
183
|
+
{ id: '1', query: 'SELECT * FROM users WHERE email = ? LIMIT 1', normalized_query: 'SELECT * FROM users WHERE email = ? LIMIT ?', duration: 3.2, connection: 'mysql', status: 'completed', executed_at: '2024-03-14 10:16:32', bindings: ['user@example.com', 1], model: 'User', method: 'findByEmail', file: 'app/Models/User.php', line: 45, memory_usage: 2.4, rows_affected: 1, tags: ['auth'] },
|
|
184
|
+
{ id: '2', query: 'SELECT p.*, c.name as category_name FROM posts p JOIN categories c ON p.category_id = c.id WHERE p.published_at IS NOT NULL ORDER BY p.published_at DESC LIMIT 10', normalized_query: 'SELECT p.*, c.name as category_name FROM posts p JOIN categories c ON p.category_id = c.id WHERE p.published_at IS NOT NULL ORDER BY p.published_at DESC LIMIT ?', duration: 45.7, connection: 'mysql', status: 'slow', executed_at: '2024-03-14 10:15:30', bindings: [10], model: 'Post', method: 'getRecentPublishedWithCategory', file: 'app/Models/Post.php', line: 78, memory_usage: 5.8, rows_affected: 10, tags: ['content', 'frontend'] },
|
|
185
|
+
{ id: '3', query: 'INSERT INTO user_logs (user_id, action, ip_address, created_at) VALUES (?, ?, ?, ?)', normalized_query: 'INSERT INTO user_logs (user_id, action, ip_address, created_at) VALUES (?, ?, ?, ?)', duration: 2.1, connection: 'mysql', status: 'completed', executed_at: '2024-03-14 10:14:55', bindings: [42, 'login', '192.168.1.1', '2024-03-14 10:14:55'], model: 'UserLog', method: 'logAction', file: 'app/Services/LogService.php', line: 28, memory_usage: 1.8, rows_affected: 1, tags: ['logging'] },
|
|
186
|
+
{ id: '4', query: 'UPDATE products SET stock = stock - 1 WHERE id = ? AND stock > 0', normalized_query: 'UPDATE products SET stock = stock - ? WHERE id = ? AND stock > ?', duration: 4.5, connection: 'mysql', status: 'completed', executed_at: '2024-03-14 10:12:18', bindings: [1, 156, 0], model: 'Product', method: 'decrementStock', file: 'app/Models/Product.php', line: 112, memory_usage: 2.1, rows_affected: 1, tags: ['inventory', 'order'] },
|
|
187
|
+
{ id: '5', query: 'DELETE FROM carts WHERE user_id = ? AND updated_at < ?', normalized_query: 'DELETE FROM carts WHERE user_id = ? AND updated_at < ?', duration: 2.8, connection: 'mysql', status: 'completed', executed_at: '2024-03-14 10:10:05', bindings: [78, '2024-03-13 10:10:05'], model: 'Cart', method: 'clearOldCarts', file: 'app/Jobs/ClearOldCarts.php', line: 35, memory_usage: 1.9, rows_affected: 3, tags: ['cleanup', 'scheduled'] },
|
|
188
|
+
])
|
|
189
|
+
|
|
190
|
+
const timeRange = state('hour')
|
|
191
|
+
const selectedConnection = state('all')
|
|
192
|
+
const selectedType = state('all')
|
|
193
|
+
const isLoading = state(false)
|
|
194
|
+
|
|
195
|
+
let chartHandles: Array<{ destroy: () => void }> = []
|
|
196
|
+
|
|
197
|
+
const queryStatusColors: Record<string, string> = {
|
|
198
|
+
completed: 'text-green-700 dark:text-green-300 bg-green-50 dark:bg-green-900/50 ring-green-600/20',
|
|
199
|
+
slow: 'text-yellow-700 dark:text-yellow-300 bg-yellow-50 dark:bg-yellow-900/50 ring-yellow-600/20',
|
|
200
|
+
failed: 'text-red-700 dark:text-red-300 bg-red-50 dark:bg-red-900/50 ring-red-600/20',
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
const queryTypeBadges: Record<string, string> = {
|
|
204
|
+
SELECT: 'bg-blue-50 dark:bg-blue-900/20 text-blue-700 dark:text-blue-300 ring-blue-700/10 dark:ring-blue-400/30',
|
|
205
|
+
INSERT: 'bg-green-50 dark:bg-green-900/20 text-green-700 dark:text-green-300 ring-green-700/10 dark:ring-green-400/30',
|
|
206
|
+
UPDATE: 'bg-amber-50 dark:bg-amber-900/20 text-amber-700 dark:text-amber-300 ring-amber-700/10 dark:ring-amber-400/30',
|
|
207
|
+
DELETE: 'bg-red-50 dark:bg-red-900/20 text-red-700 dark:text-red-300 ring-red-700/10 dark:ring-red-400/30',
|
|
208
|
+
OTHER: 'bg-gray-50 dark:bg-neutral-900/20 text-gray-700 dark:text-neutral-300 ring-gray-700/10 dark:ring-neutral-400/30',
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
function statsTotal(): number { return stats().total }
|
|
212
|
+
function statsSelect(): number { return stats().select }
|
|
213
|
+
function statsInsert(): number { return stats().insert }
|
|
214
|
+
function statsUpdate(): number { return stats().update }
|
|
215
|
+
function statsDelete(): number { return stats().delete }
|
|
216
|
+
function statsSlow(): number { return stats().slow }
|
|
217
|
+
|
|
218
|
+
function getQueryStatusColor(status: string): string {
|
|
219
|
+
return queryStatusColors[status] || 'text-gray-700 dark:text-neutral-300 bg-gray-50 dark:bg-neutral-900/50 ring-gray-600/20'
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
function getQueryType(query: string): string {
|
|
223
|
+
const upper = query.trim().toUpperCase()
|
|
224
|
+
if (upper.startsWith('SELECT'))
|
|
225
|
+
return 'SELECT'
|
|
226
|
+
if (upper.startsWith('INSERT'))
|
|
227
|
+
return 'INSERT'
|
|
228
|
+
if (upper.startsWith('UPDATE'))
|
|
229
|
+
return 'UPDATE'
|
|
230
|
+
if (upper.startsWith('DELETE'))
|
|
231
|
+
return 'DELETE'
|
|
232
|
+
return 'OTHER'
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
function queryTypeBadgeClass(query: string): string {
|
|
236
|
+
return queryTypeBadges[getQueryType(query)] || queryTypeBadges.OTHER as string
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
function formatQuery(q: string): string {
|
|
240
|
+
return q.length > 100 ? `${q.substring(0, 100)}...` : q
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
function formatDuration(d: number): string {
|
|
244
|
+
return `${d.toFixed(2)} ms`
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
function setTimeRange(range: string): void {
|
|
248
|
+
timeRange.set(range)
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
const filteredQueries = derived(() => {
|
|
252
|
+
const list = recentQueries()
|
|
253
|
+
const conn = selectedConnection()
|
|
254
|
+
const type = selectedType()
|
|
255
|
+
return list.filter((q) => {
|
|
256
|
+
if (conn !== 'all' && q.connection !== conn)
|
|
257
|
+
return false
|
|
258
|
+
if (type !== 'all' && getQueryType(q.query) !== type)
|
|
259
|
+
return false
|
|
260
|
+
return true
|
|
261
|
+
})
|
|
262
|
+
})
|
|
263
|
+
|
|
264
|
+
function getPerformanceData() {
|
|
265
|
+
const labels = Array.from({ length: 24 }, (_, i) => `${i}:00`)
|
|
266
|
+
return {
|
|
267
|
+
labels,
|
|
268
|
+
datasets: [
|
|
269
|
+
{ label: 'SELECT', data: Array.from({ length: 24 }, () => Math.floor(Math.random() * 50) + 30), borderColor: 'rgb(59, 130, 246)', backgroundColor: 'rgba(59, 130, 246, 0.1)', fill: true },
|
|
270
|
+
{ label: 'INSERT', data: Array.from({ length: 24 }, () => Math.floor(Math.random() * 15) + 5), borderColor: 'rgb(16, 185, 129)', backgroundColor: 'rgba(16, 185, 129, 0.1)', fill: true },
|
|
271
|
+
{ label: 'UPDATE', data: Array.from({ length: 24 }, () => Math.floor(Math.random() * 12) + 3), borderColor: 'rgb(245, 158, 11)', backgroundColor: 'rgba(245, 158, 11, 0.1)', fill: true },
|
|
272
|
+
{ label: 'DELETE', data: Array.from({ length: 24 }, () => Math.floor(Math.random() * 8) + 2), borderColor: 'rgb(239, 68, 68)', backgroundColor: 'rgba(239, 68, 68, 0.1)', fill: true },
|
|
273
|
+
],
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
function getDurationData() {
|
|
278
|
+
const labels = Array.from({ length: 24 }, (_, i) => `${i}:00`)
|
|
279
|
+
return {
|
|
280
|
+
labels,
|
|
281
|
+
datasets: [{
|
|
282
|
+
label: 'Average Duration (ms)',
|
|
283
|
+
data: Array.from({ length: 24 }, () => Math.random() * 25 + 5),
|
|
284
|
+
borderColor: 'rgb(124, 58, 237)',
|
|
285
|
+
backgroundColor: 'rgba(124, 58, 237, 0.1)',
|
|
286
|
+
fill: true,
|
|
287
|
+
}],
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
const chartOptions = {
|
|
292
|
+
responsive: true,
|
|
293
|
+
maintainAspectRatio: false,
|
|
294
|
+
scales: {
|
|
295
|
+
y: { beginAtZero: true, grid: { color: 'rgba(200, 200, 200, 0.1)' }, ticks: { color: 'rgb(156, 163, 175)', font: { family: "'JetBrains Mono', monospace" } } },
|
|
296
|
+
x: { grid: { display: false }, ticks: { color: 'rgb(156, 163, 175)', font: { family: "'JetBrains Mono', monospace" } } },
|
|
297
|
+
},
|
|
298
|
+
plugins: {
|
|
299
|
+
legend: { display: true, position: 'top', align: 'end', labels: { color: 'rgb(156, 163, 175)', font: { family: "'JetBrains Mono', monospace" }, boxWidth: 12, padding: 15 } },
|
|
300
|
+
tooltip: { mode: 'index', intersect: false },
|
|
301
|
+
},
|
|
302
|
+
interaction: { mode: 'index', intersect: false },
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
onMount(async () => {
|
|
306
|
+
const { Chart, registerables } = await import('@stacksjs/charts')
|
|
307
|
+
Chart.register(...registerables)
|
|
308
|
+
const Ctor = Chart as unknown as ChartCtor
|
|
309
|
+
|
|
310
|
+
const volume = useChart({
|
|
311
|
+
Chart: Ctor,
|
|
312
|
+
id: 'queries_volume_chart',
|
|
313
|
+
type: 'line',
|
|
314
|
+
data: getPerformanceData(),
|
|
315
|
+
options: chartOptions,
|
|
316
|
+
})
|
|
317
|
+
|
|
318
|
+
const duration = useChart({
|
|
319
|
+
Chart: Ctor,
|
|
320
|
+
id: 'queries_duration_chart',
|
|
321
|
+
type: 'line',
|
|
322
|
+
data: getDurationData(),
|
|
323
|
+
options: chartOptions,
|
|
324
|
+
})
|
|
325
|
+
|
|
326
|
+
chartHandles = [volume.instance, duration.instance].filter((c): c is ChartLike => c !== null)
|
|
327
|
+
})
|
|
328
|
+
|
|
329
|
+
onDestroy(() => {
|
|
330
|
+
chartHandles.forEach(c => c.destroy())
|
|
331
|
+
chartHandles = []
|
|
332
|
+
})
|
|
333
|
+
</script>
|
|
334
|
+
|
|
335
|
+
@endsection
|