@libredb/studio 0.9.7 → 0.9.13
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/dist/chunk-34YQUUCM.mjs +319 -0
- package/dist/chunk-34YQUUCM.mjs.map +1 -0
- package/dist/chunk-4LVB3K53.mjs +37 -0
- package/dist/chunk-4LVB3K53.mjs.map +1 -0
- package/dist/chunk-6DRZXXNT.mjs +100 -0
- package/dist/chunk-6DRZXXNT.mjs.map +1 -0
- package/dist/chunk-CPF7XWV5.mjs +1289 -0
- package/dist/chunk-CPF7XWV5.mjs.map +1 -0
- package/dist/chunk-CZVV3JJB.mjs +160 -0
- package/dist/chunk-CZVV3JJB.mjs.map +1 -0
- package/dist/chunk-D4WVWWWF.js +332 -0
- package/dist/chunk-D4WVWWWF.js.map +1 -0
- package/dist/chunk-DY3KXE44.mjs +3 -0
- package/dist/chunk-DY3KXE44.mjs.map +1 -0
- package/dist/chunk-FYSE52VB.js +242 -0
- package/dist/chunk-FYSE52VB.js.map +1 -0
- package/dist/chunk-G3S66G64.mjs +6673 -0
- package/dist/chunk-G3S66G64.mjs.map +1 -0
- package/dist/chunk-G4WYE6TI.js +4 -0
- package/dist/chunk-G4WYE6TI.js.map +1 -0
- package/dist/chunk-HGPD6PWV.js +1310 -0
- package/dist/chunk-HGPD6PWV.js.map +1 -0
- package/dist/chunk-JZO5KRZN.js +165 -0
- package/dist/chunk-JZO5KRZN.js.map +1 -0
- package/dist/chunk-KV356UXJ.js +253 -0
- package/dist/chunk-KV356UXJ.js.map +1 -0
- package/dist/chunk-PPODO6HX.mjs +237 -0
- package/dist/chunk-PPODO6HX.mjs.map +1 -0
- package/dist/chunk-PTIRB2JO.js +258 -0
- package/dist/chunk-PTIRB2JO.js.map +1 -0
- package/dist/chunk-Q6LRDBK7.js +42 -0
- package/dist/chunk-Q6LRDBK7.js.map +1 -0
- package/dist/chunk-QJP5FZRY.mjs +255 -0
- package/dist/chunk-QJP5FZRY.mjs.map +1 -0
- package/dist/chunk-R3POCJK6.mjs +248 -0
- package/dist/chunk-R3POCJK6.mjs.map +1 -0
- package/dist/chunk-RCQB4FCE.js +186 -0
- package/dist/chunk-RCQB4FCE.js.map +1 -0
- package/dist/chunk-SR5DRGBX.mjs +174 -0
- package/dist/chunk-SR5DRGBX.mjs.map +1 -0
- package/dist/chunk-VLCRUZX7.js +102 -0
- package/dist/chunk-VLCRUZX7.js.map +1 -0
- package/dist/chunk-Y52UIFEX.js +6741 -0
- package/dist/chunk-Y52UIFEX.js.map +1 -0
- package/dist/components.d.mts +273 -0
- package/dist/components.d.ts +273 -0
- package/dist/components.js +59 -0
- package/dist/components.js.map +1 -0
- package/dist/components.mjs +6 -0
- package/dist/components.mjs.map +1 -0
- package/dist/custom-BNDOYC5P.js +134 -0
- package/dist/custom-BNDOYC5P.js.map +1 -0
- package/dist/custom-S2EKFMP3.mjs +132 -0
- package/dist/custom-S2EKFMP3.mjs.map +1 -0
- package/dist/gemini-4ASHNK4H.js +81 -0
- package/dist/gemini-4ASHNK4H.js.map +1 -0
- package/dist/gemini-C5RBLQEJ.mjs +79 -0
- package/dist/gemini-C5RBLQEJ.mjs.map +1 -0
- package/dist/index.d.mts +6 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +95 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +10 -0
- package/dist/index.mjs.map +1 -0
- package/dist/mongodb-XMZEZA4A.mjs +748 -0
- package/dist/mongodb-XMZEZA4A.mjs.map +1 -0
- package/dist/mongodb-YQJJTLX3.js +750 -0
- package/dist/mongodb-YQJJTLX3.js.map +1 -0
- package/dist/mssql-PMOU4D36.js +916 -0
- package/dist/mssql-PMOU4D36.js.map +1 -0
- package/{src/lib/db/providers/sql/mssql.ts → dist/mssql-ZH5VP2C5.mjs} +268 -423
- package/dist/mssql-ZH5VP2C5.mjs.map +1 -0
- package/{src/lib/db/providers/sql/mysql.ts → dist/mysql-I3WJQXN2.mjs} +277 -428
- package/dist/mysql-I3WJQXN2.mjs.map +1 -0
- package/dist/mysql-Y3MSA5QY.js +833 -0
- package/dist/mysql-Y3MSA5QY.js.map +1 -0
- package/dist/ollama-26BYLVEV.mjs +115 -0
- package/dist/ollama-26BYLVEV.mjs.map +1 -0
- package/dist/ollama-HVWAGKQC.js +117 -0
- package/dist/ollama-HVWAGKQC.js.map +1 -0
- package/dist/openai-4U56KPG7.mjs +111 -0
- package/dist/openai-4U56KPG7.mjs.map +1 -0
- package/dist/openai-AK3R37BS.js +113 -0
- package/dist/openai-AK3R37BS.js.map +1 -0
- package/dist/oracle-L6VEAVXO.js +917 -0
- package/dist/oracle-L6VEAVXO.js.map +1 -0
- package/{src/lib/db/providers/sql/oracle.ts → dist/oracle-P2G7T4P4.mjs} +321 -454
- package/dist/oracle-P2G7T4P4.mjs.map +1 -0
- package/{src/lib/db/providers/sql/postgres.ts → dist/postgres-O5KOQUVP.mjs} +261 -471
- package/dist/postgres-O5KOQUVP.mjs.map +1 -0
- package/dist/postgres-RLCWNFFX.js +971 -0
- package/dist/postgres-RLCWNFFX.js.map +1 -0
- package/dist/providers.d.mts +149 -0
- package/dist/providers.d.ts +149 -0
- package/dist/providers.js +44 -0
- package/dist/providers.js.map +1 -0
- package/dist/providers.mjs +7 -0
- package/dist/providers.mjs.map +1 -0
- package/dist/redis-4WMQOVLX.mjs +435 -0
- package/dist/redis-4WMQOVLX.mjs.map +1 -0
- package/dist/redis-QVQ6YU62.js +441 -0
- package/dist/redis-QVQ6YU62.js.map +1 -0
- package/dist/sqlite-4I2P2OGQ.js +554 -0
- package/dist/sqlite-4I2P2OGQ.js.map +1 -0
- package/dist/sqlite-OA4YJX5S.mjs +531 -0
- package/dist/sqlite-OA4YJX5S.mjs.map +1 -0
- package/dist/types-BJvJfxSY.d.mts +141 -0
- package/dist/types-BJvJfxSY.d.ts +141 -0
- package/dist/types-ClAg_v5k.d.mts +343 -0
- package/dist/types-Der_X8E8.d.ts +343 -0
- package/dist/types.d.mts +2 -0
- package/dist/types.d.ts +2 -0
- package/dist/types.js +6 -0
- package/dist/types.js.map +1 -0
- package/dist/types.mjs +3 -0
- package/dist/types.mjs.map +1 -0
- package/dist/workspace.d.mts +80 -0
- package/dist/workspace.d.ts +80 -0
- package/dist/workspace.js +4174 -0
- package/dist/workspace.js.map +1 -0
- package/dist/workspace.mjs +4147 -0
- package/dist/workspace.mjs.map +1 -0
- package/package.json +60 -5
- package/.claude/settings.local.json +0 -127
- package/.cursorrules +0 -426
- package/.devin/wiki.json +0 -143
- package/.dockerignore +0 -80
- package/.env.example +0 -159
- package/.github/ISSUE_TEMPLATE/bug_report.md +0 -49
- package/.github/ISSUE_TEMPLATE/feature_request.md +0 -29
- package/.github/PULL_REQUEST_TEMPLATE.md +0 -57
- package/.github/workflows/ci.yml +0 -185
- package/.github/workflows/codeql.yml +0 -57
- package/.github/workflows/docker-build-push.yml +0 -118
- package/.github/workflows/helm-release.yml +0 -113
- package/CLAUDE.md +0 -265
- package/CODE_OF_CONDUCT.md +0 -124
- package/CONTRIBUTING.md +0 -154
- package/Dockerfile +0 -73
- package/SECURITY.md +0 -107
- package/artifacthub-repo.yml +0 -4
- package/bun.lock +0 -1714
- package/bunfig.toml +0 -3
- package/charts/libredb-studio/.helmignore +0 -11
- package/charts/libredb-studio/Chart.lock +0 -6
- package/charts/libredb-studio/Chart.yaml +0 -50
- package/charts/libredb-studio/README.md +0 -206
- package/charts/libredb-studio/templates/NOTES.txt +0 -59
- package/charts/libredb-studio/templates/_helpers.tpl +0 -135
- package/charts/libredb-studio/templates/configmap.yaml +0 -37
- package/charts/libredb-studio/templates/deployment.yaml +0 -184
- package/charts/libredb-studio/templates/hpa.yaml +0 -32
- package/charts/libredb-studio/templates/ingress.yaml +0 -41
- package/charts/libredb-studio/templates/networkpolicy.yaml +0 -50
- package/charts/libredb-studio/templates/pdb.yaml +0 -18
- package/charts/libredb-studio/templates/pvc.yaml +0 -23
- package/charts/libredb-studio/templates/secret.yaml +0 -30
- package/charts/libredb-studio/templates/seed-configmap.yaml +0 -11
- package/charts/libredb-studio/templates/service.yaml +0 -22
- package/charts/libredb-studio/templates/serviceaccount.yaml +0 -13
- package/charts/libredb-studio/values.schema.json +0 -246
- package/charts/libredb-studio/values.yaml +0 -286
- package/components.json +0 -22
- package/conductor/code_styleguides/typescript.md +0 -43
- package/conductor/product-guidelines.md +0 -43
- package/conductor/product.md +0 -3
- package/conductor/setup_state.json +0 -1
- package/conductor/tech-stack.md +0 -39
- package/conductor/tracks/enhance_postgres_monitoring_20251227/metadata.json +0 -8
- package/conductor/tracks/enhance_postgres_monitoring_20251227/plan.md +0 -44
- package/conductor/tracks/enhance_postgres_monitoring_20251227/spec.md +0 -31
- package/conductor/tracks.md +0 -8
- package/conductor/workflow.md +0 -333
- package/database-compose.yml +0 -55
- package/docker/postgres-init/01-extensions.sql +0 -10
- package/docker/postgres-init/02-sample-data.sql +0 -585
- package/docker/postgres.yml +0 -68
- package/docker-compose.yml +0 -38
- package/docs/AI_PLAN.md +0 -74
- package/docs/API_DOCS.md +0 -875
- package/docs/ARCHITECTURE.md +0 -218
- package/docs/DATABASE_PROVIDERS.md +0 -358
- package/docs/FEATURES.md +0 -116
- package/docs/HELM_CHART.md +0 -252
- package/docs/LOGIN_PAGE.md +0 -178
- package/docs/MONACO_EDITOR_PERFORMANCE.md +0 -315
- package/docs/OIDC_ARCH.md +0 -681
- package/docs/OIDC_SETUP.md +0 -322
- package/docs/POSTGRES_METRICS.md +0 -516
- package/docs/QUERY_OPTIMIZATION.md +0 -370
- package/docs/SEED_CONNECTIONS.md +0 -468
- package/docs/SQL_ALIAS_COMPLETION.md +0 -190
- package/docs/STORAGE_ARCHITECTURE.md +0 -565
- package/docs/STORAGE_QUICK_SETUP.md +0 -419
- package/docs/TECHNICAL_PLAN.md +0 -36
- package/docs/THEMING.md +0 -345
- package/docs/adding-a-new-database-provider.md +0 -642
- package/docs/backlogs/000-PLATFORM_DATA_SYNC_DATABASE.md +0 -360
- package/docs/backlogs/001-INLINE_DATA_EDITING.md +0 -118
- package/docs/backlogs/002-DATA_IMPORT.md +0 -215
- package/docs/backlogs/003-QUERY_TIME_MACHINE.md +0 -183
- package/docs/backlogs/004-AI_DATA_STORYTELLER.md +0 -292
- package/docs/backlogs/005-QUERY_PLAYGROUND.md +0 -352
- package/docs/backlogs/006-DATA_MASKING.md +0 -418
- package/docs/enterprise-features.md +0 -718
- package/docs/kubernetes-helm-chart-artifacthub-plan.md +0 -803
- package/docs/medium-koyeb-article-en.md +0 -215
- package/docs/plans/test-plans.md +0 -445
- package/docs/releases/RELEASE.V0.3.0.md +0 -22
- package/docs/releases/RELEASE.V0.4.0.md +0 -154
- package/docs/releases/RELEASE.V0.5.0.md +0 -252
- package/docs/releases/RELEASE_v0.5.6.md +0 -145
- package/docs/releases/RELEASE_v0.6.1.md +0 -303
- package/docs/releases/RELEASE_v0.6.7.md +0 -292
- package/docs/releases/RELEASE_v0.7.0.md +0 -332
- package/docs/releases/RELEASE_v0.8.0.md +0 -521
- package/docs/sampledb/titanic.sql +0 -1379
- package/docs/superpowers/plans/2026-03-25-seed-connections.md +0 -1362
- package/docs/superpowers/specs/2026-03-25-seed-connections-design.md +0 -590
- package/e2e/admin-dashboard.spec.ts +0 -64
- package/e2e/connection-management.spec.ts +0 -58
- package/e2e/export.spec.ts +0 -34
- package/e2e/login.spec.ts +0 -85
- package/e2e/query-execution.spec.ts +0 -35
- package/e2e/tab-management.spec.ts +0 -64
- package/eslint.config.mjs +0 -28
- package/fly.toml +0 -43
- package/next.config.ts +0 -32
- package/playwright.config.ts +0 -34
- package/postcss.config.mjs +0 -7
- package/public/favicon-32x32.png +0 -0
- package/public/favicon.ico +0 -0
- package/public/file.svg +0 -1
- package/public/globe.svg +0 -1
- package/public/logo.svg +0 -32
- package/public/next.svg +0 -1
- package/public/screenshots/code-generator.png +0 -0
- package/public/screenshots/connection-modal.png +0 -0
- package/public/screenshots/data-profiler.png +0 -0
- package/public/screenshots/erd-diagram.png +0 -0
- package/public/screenshots/hero-editor.png +0 -0
- package/public/screenshots/nl2sql.png +0 -0
- package/public/vercel.svg +0 -1
- package/public/window.svg +0 -1
- package/render.yaml +0 -58
- package/scripts/merge-lcov.mjs +0 -239
- package/sonar-project.properties +0 -16
- package/src/app/admin/error.tsx +0 -46
- package/src/app/admin/page.tsx +0 -10
- package/src/app/api/admin/audit/route.ts +0 -52
- package/src/app/api/admin/fleet-health/route.ts +0 -81
- package/src/app/api/ai/autopilot/route.ts +0 -105
- package/src/app/api/ai/chat/route.ts +0 -132
- package/src/app/api/ai/describe-schema/route.ts +0 -52
- package/src/app/api/ai/explain/route.ts +0 -86
- package/src/app/api/ai/impact/route.ts +0 -97
- package/src/app/api/ai/index-advisor/route.ts +0 -98
- package/src/app/api/ai/nl2sql/route.ts +0 -87
- package/src/app/api/ai/query-safety/route.ts +0 -87
- package/src/app/api/auth/login/route.ts +0 -62
- package/src/app/api/auth/logout/route.ts +0 -25
- package/src/app/api/auth/me/route.ts +0 -10
- package/src/app/api/auth/oidc/callback/route.ts +0 -82
- package/src/app/api/auth/oidc/login/route.ts +0 -43
- package/src/app/api/connections/managed/route.ts +0 -35
- package/src/app/api/db/cancel/route.ts +0 -42
- package/src/app/api/db/disconnect/route.ts +0 -28
- package/src/app/api/db/health/route.ts +0 -49
- package/src/app/api/db/maintenance/route.ts +0 -72
- package/src/app/api/db/monitoring/route.ts +0 -62
- package/src/app/api/db/multi-query/route.ts +0 -116
- package/src/app/api/db/pool-stats/route.ts +0 -37
- package/src/app/api/db/profile/route.ts +0 -144
- package/src/app/api/db/provider-meta/route.ts +0 -49
- package/src/app/api/db/query/route.ts +0 -50
- package/src/app/api/db/schema/route.ts +0 -47
- package/src/app/api/db/schema-snapshot/route.ts +0 -42
- package/src/app/api/db/test-connection/route.ts +0 -55
- package/src/app/api/db/transaction/route.ts +0 -111
- package/src/app/api/storage/[collection]/route.ts +0 -67
- package/src/app/api/storage/config/route.ts +0 -17
- package/src/app/api/storage/migrate/route.ts +0 -45
- package/src/app/api/storage/route.ts +0 -32
- package/src/app/error.tsx +0 -49
- package/src/app/global-error.tsx +0 -55
- package/src/app/globals.css +0 -146
- package/src/app/icon.svg +0 -42
- package/src/app/layout.tsx +0 -34
- package/src/app/login/login-form.tsx +0 -301
- package/src/app/login/page.tsx +0 -11
- package/src/app/monitoring/page.tsx +0 -8
- package/src/app/not-found.tsx +0 -29
- package/src/app/page.tsx +0 -5
- package/src/components/AIAutopilotPanel.tsx +0 -238
- package/src/components/CodeGenerator.tsx +0 -271
- package/src/components/CommandPalette.tsx +0 -227
- package/src/components/ConnectionModal.tsx +0 -759
- package/src/components/CreateTableModal.tsx +0 -281
- package/src/components/DataCharts.tsx +0 -962
- package/src/components/DataImportModal.tsx +0 -582
- package/src/components/DataProfiler.tsx +0 -335
- package/src/components/DatabaseDocs.tsx +0 -251
- package/src/components/MaskingSettings.tsx +0 -414
- package/src/components/MobileNav.tsx +0 -50
- package/src/components/NL2SQLPanel.tsx +0 -281
- package/src/components/PivotTable.tsx +0 -257
- package/src/components/QueryEditor.tsx +0 -760
- package/src/components/QueryHistory.tsx +0 -344
- package/src/components/QuerySafetyDialog.tsx +0 -290
- package/src/components/ResultsGrid.tsx +0 -644
- package/src/components/SaveQueryModal.tsx +0 -104
- package/src/components/SavedQueries.tsx +0 -128
- package/src/components/SchemaDiagram.tsx +0 -473
- package/src/components/SchemaDiff.tsx +0 -473
- package/src/components/SnapshotTimeline.tsx +0 -116
- package/src/components/Studio.tsx +0 -639
- package/src/components/TestDataGenerator.tsx +0 -261
- package/src/components/VisualExplain.tsx +0 -820
- package/src/components/admin/AdminDashboard.tsx +0 -163
- package/src/components/admin/tabs/AuditTab.tsx +0 -531
- package/src/components/admin/tabs/MonitoringEmbed.tsx +0 -11
- package/src/components/admin/tabs/OperationsTab.tsx +0 -646
- package/src/components/admin/tabs/OverviewTab.tsx +0 -1328
- package/src/components/admin/tabs/SecurityTab.tsx +0 -284
- package/src/components/community-section.tsx +0 -92
- package/src/components/icons/db-icons.tsx +0 -84
- package/src/components/libredb-logo.tsx +0 -61
- package/src/components/monitoring/MonitoringDashboard.tsx +0 -345
- package/src/components/monitoring/tabs/MetricChart.tsx +0 -82
- package/src/components/monitoring/tabs/OverviewTab.tsx +0 -263
- package/src/components/monitoring/tabs/PerformanceTab.tsx +0 -254
- package/src/components/monitoring/tabs/PoolTab.tsx +0 -174
- package/src/components/monitoring/tabs/QueriesTab.tsx +0 -287
- package/src/components/monitoring/tabs/SessionsTab.tsx +0 -316
- package/src/components/monitoring/tabs/StorageTab.tsx +0 -335
- package/src/components/monitoring/tabs/TablesTab.tsx +0 -300
- package/src/components/results-grid/ResultCard.tsx +0 -111
- package/src/components/results-grid/RowDetailSheet.tsx +0 -178
- package/src/components/results-grid/StatsBar.tsx +0 -201
- package/src/components/results-grid/index.ts +0 -1
- package/src/components/results-grid/utils.ts +0 -23
- package/src/components/schema-explorer/ColumnList.tsx +0 -53
- package/src/components/schema-explorer/SchemaExplorer.tsx +0 -182
- package/src/components/schema-explorer/TableItem.tsx +0 -210
- package/src/components/schema-explorer/index.ts +0 -1
- package/src/components/sidebar/ConnectionItem.tsx +0 -105
- package/src/components/sidebar/ConnectionsList.tsx +0 -62
- package/src/components/sidebar/Sidebar.tsx +0 -130
- package/src/components/sidebar/index.ts +0 -2
- package/src/components/studio/BottomPanel.tsx +0 -286
- package/src/components/studio/QueryToolbar.tsx +0 -180
- package/src/components/studio/StudioDesktopHeader.tsx +0 -114
- package/src/components/studio/StudioMobileHeader.tsx +0 -340
- package/src/components/studio/StudioTabBar.tsx +0 -82
- package/src/components/studio/index.ts +0 -5
- package/src/components/ui/accordion.tsx +0 -66
- package/src/components/ui/alert-dialog.tsx +0 -157
- package/src/components/ui/alert.tsx +0 -66
- package/src/components/ui/aspect-ratio.tsx +0 -11
- package/src/components/ui/avatar.tsx +0 -53
- package/src/components/ui/badge.tsx +0 -46
- package/src/components/ui/breadcrumb.tsx +0 -109
- package/src/components/ui/button-group.tsx +0 -83
- package/src/components/ui/button.tsx +0 -60
- package/src/components/ui/calendar.tsx +0 -216
- package/src/components/ui/card.tsx +0 -92
- package/src/components/ui/carousel.tsx +0 -241
- package/src/components/ui/chart.tsx +0 -357
- package/src/components/ui/checkbox.tsx +0 -32
- package/src/components/ui/collapsible.tsx +0 -33
- package/src/components/ui/command.tsx +0 -184
- package/src/components/ui/context-menu.tsx +0 -252
- package/src/components/ui/dialog.tsx +0 -143
- package/src/components/ui/drawer.tsx +0 -135
- package/src/components/ui/dropdown-menu.tsx +0 -257
- package/src/components/ui/empty.tsx +0 -104
- package/src/components/ui/field.tsx +0 -248
- package/src/components/ui/form.tsx +0 -167
- package/src/components/ui/hover-card.tsx +0 -44
- package/src/components/ui/input-group.tsx +0 -170
- package/src/components/ui/input-otp.tsx +0 -77
- package/src/components/ui/input.tsx +0 -21
- package/src/components/ui/item.tsx +0 -193
- package/src/components/ui/kbd.tsx +0 -28
- package/src/components/ui/label.tsx +0 -24
- package/src/components/ui/menubar.tsx +0 -276
- package/src/components/ui/navigation-menu.tsx +0 -168
- package/src/components/ui/pagination.tsx +0 -127
- package/src/components/ui/popover.tsx +0 -48
- package/src/components/ui/progress.tsx +0 -31
- package/src/components/ui/radio-group.tsx +0 -45
- package/src/components/ui/resizable.tsx +0 -56
- package/src/components/ui/scroll-area.tsx +0 -58
- package/src/components/ui/select.tsx +0 -187
- package/src/components/ui/separator.tsx +0 -28
- package/src/components/ui/sheet.tsx +0 -139
- package/src/components/ui/sidebar.tsx +0 -726
- package/src/components/ui/skeleton.tsx +0 -13
- package/src/components/ui/slider.tsx +0 -63
- package/src/components/ui/sonner.tsx +0 -40
- package/src/components/ui/spinner.tsx +0 -16
- package/src/components/ui/switch.tsx +0 -31
- package/src/components/ui/table.tsx +0 -116
- package/src/components/ui/tabs.tsx +0 -66
- package/src/components/ui/textarea.tsx +0 -18
- package/src/components/ui/toggle-group.tsx +0 -83
- package/src/components/ui/toggle.tsx +0 -47
- package/src/components/ui/tooltip.tsx +0 -61
- package/src/exports/components.ts +0 -15
- package/src/exports/index.ts +0 -4
- package/src/exports/providers.ts +0 -4
- package/src/exports/types.ts +0 -26
- package/src/hooks/use-ai-chat.ts +0 -182
- package/src/hooks/use-all-connections.ts +0 -66
- package/src/hooks/use-api-call.ts +0 -71
- package/src/hooks/use-auth.ts +0 -51
- package/src/hooks/use-connection-form.ts +0 -349
- package/src/hooks/use-connection-manager.ts +0 -169
- package/src/hooks/use-connection-payload.ts +0 -15
- package/src/hooks/use-inline-editing.ts +0 -109
- package/src/hooks/use-mobile.ts +0 -20
- package/src/hooks/use-monitoring-data.ts +0 -270
- package/src/hooks/use-provider-metadata.ts +0 -62
- package/src/hooks/use-query-execution.ts +0 -478
- package/src/hooks/use-storage-sync.ts +0 -259
- package/src/hooks/use-tab-manager.ts +0 -231
- package/src/hooks/use-toast.ts +0 -20
- package/src/hooks/use-transaction-control.ts +0 -64
- package/src/lib/api/error-codes.ts +0 -30
- package/src/lib/api/errors.ts +0 -236
- package/src/lib/api/with-error-handler.ts +0 -41
- package/src/lib/audit.ts +0 -105
- package/src/lib/auth.ts +0 -87
- package/src/lib/connection-string-parser.ts +0 -172
- package/src/lib/data-masking.ts +0 -385
- package/src/lib/db/base-provider.ts +0 -325
- package/src/lib/db/errors.ts +0 -317
- package/src/lib/db/factory.ts +0 -324
- package/src/lib/db/index.ts +0 -123
- package/src/lib/db/providers/document/index.ts +0 -6
- package/src/lib/db/providers/document/mongodb.ts +0 -992
- package/src/lib/db/providers/keyvalue/redis.ts +0 -554
- package/src/lib/db/providers/sql/index.ts +0 -11
- package/src/lib/db/providers/sql/sql-base.ts +0 -174
- package/src/lib/db/providers/sql/sqlite.ts +0 -721
- package/src/lib/db/types.ts +0 -437
- package/src/lib/db/utils/pool-manager.ts +0 -287
- package/src/lib/db/utils/query-limiter.ts +0 -239
- package/src/lib/db-ui-config.ts +0 -86
- package/src/lib/editor/mongodb-completions.ts +0 -172
- package/src/lib/editor/sql-completions.ts +0 -280
- package/src/lib/llm/base-provider.ts +0 -117
- package/src/lib/llm/factory.ts +0 -102
- package/src/lib/llm/index.ts +0 -90
- package/src/lib/llm/providers/custom.ts +0 -181
- package/src/lib/llm/providers/gemini.ts +0 -126
- package/src/lib/llm/providers/ollama.ts +0 -154
- package/src/lib/llm/providers/openai.ts +0 -146
- package/src/lib/llm/types.ts +0 -173
- package/src/lib/llm/utils/config.ts +0 -187
- package/src/lib/llm/utils/retry.ts +0 -119
- package/src/lib/llm/utils/streaming.ts +0 -202
- package/src/lib/logger.ts +0 -127
- package/src/lib/monitoring-thresholds.ts +0 -44
- package/src/lib/oidc.ts +0 -262
- package/src/lib/query-generators.ts +0 -61
- package/src/lib/schema-diff/diff-engine.ts +0 -273
- package/src/lib/schema-diff/migration-generator.ts +0 -208
- package/src/lib/schema-diff/types.ts +0 -55
- package/src/lib/seed/config-loader.ts +0 -79
- package/src/lib/seed/connection-filter.ts +0 -49
- package/src/lib/seed/credential-resolver.ts +0 -62
- package/src/lib/seed/index.ts +0 -40
- package/src/lib/seed/resolve-connection.ts +0 -57
- package/src/lib/seed/types.ts +0 -69
- package/src/lib/sql/alias-extractor.ts +0 -267
- package/src/lib/sql/index.ts +0 -8
- package/src/lib/sql/statement-splitter.ts +0 -167
- package/src/lib/sql/types.ts +0 -40
- package/src/lib/ssh/tunnel.ts +0 -142
- package/src/lib/storage/factory.ts +0 -84
- package/src/lib/storage/index.ts +0 -14
- package/src/lib/storage/local-storage.ts +0 -99
- package/src/lib/storage/providers/postgres.ts +0 -225
- package/src/lib/storage/providers/sqlite.ts +0 -153
- package/src/lib/storage/storage-facade.ts +0 -272
- package/src/lib/storage/types.ts +0 -75
- package/src/lib/time-series-buffer.ts +0 -58
- package/src/lib/types.ts +0 -173
- package/src/lib/utils.ts +0 -6
- package/src/proxy.ts +0 -104
- package/src/types/db-drivers.d.ts +0 -23
- package/src/types/html2canvas.d.ts +0 -9
- package/tests/api/admin/audit.test.ts +0 -178
- package/tests/api/admin/fleet-health.test.ts +0 -183
- package/tests/api/ai/autopilot.test.ts +0 -174
- package/tests/api/ai/chat.test.ts +0 -250
- package/tests/api/ai/describe-schema.test.ts +0 -266
- package/tests/api/ai/explain.test.ts +0 -199
- package/tests/api/ai/impact.test.ts +0 -168
- package/tests/api/ai/index-advisor.test.ts +0 -171
- package/tests/api/ai/nl2sql.test.ts +0 -202
- package/tests/api/ai/query-safety.test.ts +0 -196
- package/tests/api/auth/login.test.ts +0 -170
- package/tests/api/auth/logout.test.ts +0 -140
- package/tests/api/auth/me.test.ts +0 -73
- package/tests/api/auth/oidc-callback.test.ts +0 -215
- package/tests/api/auth/oidc-login.test.ts +0 -127
- package/tests/api/db/cancel.test.ts +0 -198
- package/tests/api/db/disconnect.test.ts +0 -124
- package/tests/api/db/health.test.ts +0 -222
- package/tests/api/db/maintenance.test.ts +0 -263
- package/tests/api/db/monitoring.test.ts +0 -221
- package/tests/api/db/multi-query.test.ts +0 -316
- package/tests/api/db/pool-stats.test.ts +0 -135
- package/tests/api/db/profile.test.ts +0 -330
- package/tests/api/db/provider-meta.test.ts +0 -193
- package/tests/api/db/query.test.ts +0 -314
- package/tests/api/db/schema-snapshot.test.ts +0 -170
- package/tests/api/db/schema.test.ts +0 -191
- package/tests/api/db/test-connection.test.ts +0 -185
- package/tests/api/db/transaction.test.ts +0 -314
- package/tests/api/proxy.test.ts +0 -191
- package/tests/api/seed/managed-route.test.ts +0 -113
- package/tests/api/storage/config.test.ts +0 -42
- package/tests/api/storage/storage-routes.test.ts +0 -309
- package/tests/components/AIAutopilotPanel.test.tsx +0 -756
- package/tests/components/AdminPage.test.tsx +0 -33
- package/tests/components/CodeGenerator.test.tsx +0 -182
- package/tests/components/CommandPalette.test.tsx +0 -428
- package/tests/components/CommunitySection.test.tsx +0 -91
- package/tests/components/ConnectionModal.mobile.test.tsx +0 -284
- package/tests/components/ConnectionModal.test.tsx +0 -570
- package/tests/components/CreateTableModal.test.tsx +0 -383
- package/tests/components/DataCharts.test.tsx +0 -739
- package/tests/components/DataImportModal.test.tsx +0 -751
- package/tests/components/DataProfiler.test.tsx +0 -589
- package/tests/components/DatabaseDocs.test.tsx +0 -353
- package/tests/components/LoginPage.test.tsx +0 -163
- package/tests/components/LoginPageOIDC.test.tsx +0 -92
- package/tests/components/MaskingSettings.test.tsx +0 -498
- package/tests/components/MobileNav.test.tsx +0 -30
- package/tests/components/MonitoringPage.test.tsx +0 -32
- package/tests/components/NL2SQLPanel.test.tsx +0 -621
- package/tests/components/Page.test.tsx +0 -33
- package/tests/components/PivotTable.test.tsx +0 -350
- package/tests/components/QueryEditor.test.tsx +0 -1730
- package/tests/components/QueryHistory.test.tsx +0 -572
- package/tests/components/QuerySafetyDialog.test.tsx +0 -586
- package/tests/components/ResultsGrid.test.tsx +0 -804
- package/tests/components/RootLayout.test.tsx +0 -83
- package/tests/components/SaveQueryModal.test.tsx +0 -25
- package/tests/components/SavedQueries.test.tsx +0 -43
- package/tests/components/SchemaDiagram.test.tsx +0 -1034
- package/tests/components/SchemaDiff.test.tsx +0 -906
- package/tests/components/SnapshotTimeline.test.tsx +0 -174
- package/tests/components/Studio.test.tsx +0 -1030
- package/tests/components/TestDataGenerator.test.tsx +0 -291
- package/tests/components/VisualExplain.test.tsx +0 -704
- package/tests/components/admin/AdminDashboard.test.tsx +0 -205
- package/tests/components/admin/AuditTab.test.tsx +0 -220
- package/tests/components/admin/MonitoringEmbed.test.tsx +0 -58
- package/tests/components/admin/OperationsTab.test.tsx +0 -975
- package/tests/components/admin/OverviewTab.test.tsx +0 -254
- package/tests/components/admin/SecurityTab.test.tsx +0 -467
- package/tests/components/monitoring/MetricChart.test.tsx +0 -111
- package/tests/components/monitoring/MonitoringDashboard.test.tsx +0 -259
- package/tests/components/monitoring/OverviewTab.test.tsx +0 -78
- package/tests/components/monitoring/PerformanceTab.test.tsx +0 -87
- package/tests/components/monitoring/PoolTab.test.tsx +0 -42
- package/tests/components/monitoring/QueriesTab.test.tsx +0 -80
- package/tests/components/monitoring/SessionsTab.test.tsx +0 -154
- package/tests/components/monitoring/StorageTab.test.tsx +0 -127
- package/tests/components/monitoring/TablesTab.test.tsx +0 -153
- package/tests/components/results-grid/ResultCard.test.tsx +0 -105
- package/tests/components/results-grid/RowDetailSheet.test.tsx +0 -308
- package/tests/components/results-grid/StatsBar.test.tsx +0 -162
- package/tests/components/schema-explorer/ColumnList.test.tsx +0 -151
- package/tests/components/schema-explorer/SchemaExplorer.test.tsx +0 -461
- package/tests/components/schema-explorer/TableItem.test.tsx +0 -415
- package/tests/components/sidebar/ConnectionItem.test.tsx +0 -201
- package/tests/components/sidebar/ConnectionsList.test.tsx +0 -176
- package/tests/components/sidebar/Sidebar.test.tsx +0 -187
- package/tests/components/studio/BottomPanel.test.tsx +0 -383
- package/tests/components/studio/QueryToolbar.test.tsx +0 -321
- package/tests/components/studio/StudioDesktopHeader.test.tsx +0 -377
- package/tests/components/studio/StudioMobileHeader.test.tsx +0 -198
- package/tests/components/studio/StudioTabBar.test.tsx +0 -331
- package/tests/fixtures/connections.ts +0 -96
- package/tests/fixtures/masking-configs.ts +0 -86
- package/tests/fixtures/query-results.ts +0 -71
- package/tests/fixtures/schemas.ts +0 -64
- package/tests/fixtures/seed-connections/invalid-config.yaml +0 -7
- package/tests/fixtures/seed-connections/minimal-config.yaml +0 -8
- package/tests/fixtures/seed-connections/mixed-credentials.yaml +0 -23
- package/tests/fixtures/seed-connections/multi-role-config.yaml +0 -30
- package/tests/fixtures/seed-connections/valid-config.json +0 -15
- package/tests/fixtures/seed-connections/valid-config.yaml +0 -51
- package/tests/helpers/mock-fetch.ts +0 -59
- package/tests/helpers/mock-monaco.ts +0 -112
- package/tests/helpers/mock-navigation.ts +0 -28
- package/tests/helpers/mock-next.ts +0 -80
- package/tests/helpers/mock-provider.ts +0 -133
- package/tests/helpers/mock-sonner.ts +0 -29
- package/tests/helpers/render-with-providers.tsx +0 -19
- package/tests/hooks/use-ai-chat.test.ts +0 -600
- package/tests/hooks/use-auth.test.ts +0 -371
- package/tests/hooks/use-connection-form.test.ts +0 -743
- package/tests/hooks/use-connection-manager.test.ts +0 -466
- package/tests/hooks/use-inline-editing.test.ts +0 -321
- package/tests/hooks/use-mobile.test.ts +0 -177
- package/tests/hooks/use-monitoring-data.test.ts +0 -819
- package/tests/hooks/use-provider-metadata.test.ts +0 -228
- package/tests/hooks/use-query-execution.test.ts +0 -1212
- package/tests/hooks/use-tab-manager.test.ts +0 -756
- package/tests/hooks/use-toast.test.ts +0 -74
- package/tests/hooks/use-transaction-control.test.ts +0 -211
- package/tests/integration/db/mongodb-provider.test.ts +0 -698
- package/tests/integration/db/mssql-provider.test.ts +0 -840
- package/tests/integration/db/mysql-provider.test.ts +0 -872
- package/tests/integration/db/oracle-provider.test.ts +0 -843
- package/tests/integration/db/postgres-provider.test.ts +0 -1382
- package/tests/integration/db/redis-provider.test.ts +0 -526
- package/tests/integration/db/sqlite-provider.test.ts +0 -480
- package/tests/integration/seed/seed-pipeline.test.ts +0 -102
- package/tests/isolated/factory-singleton.test.ts +0 -150
- package/tests/isolated/use-storage-sync.test.ts +0 -389
- package/tests/run-components.sh +0 -196
- package/tests/setup-dom.ts +0 -58
- package/tests/setup.ts +0 -40
- package/tests/unit/api-errors.test.ts +0 -210
- package/tests/unit/code-generator-functions.test.ts +0 -271
- package/tests/unit/components/column-list.test.tsx +0 -190
- package/tests/unit/components/data-import-modal.test.tsx +0 -441
- package/tests/unit/components/studio-mobile-header.test.tsx +0 -327
- package/tests/unit/data-charts-functions.test.ts +0 -496
- package/tests/unit/data-import-functions.test.ts +0 -320
- package/tests/unit/data-import-utils.test.ts +0 -125
- package/tests/unit/db/base-provider.test.ts +0 -517
- package/tests/unit/db/errors.test.ts +0 -403
- package/tests/unit/db/factory.test.ts +0 -436
- package/tests/unit/db/pool-manager.test.ts +0 -440
- package/tests/unit/db/query-limiter.test.ts +0 -387
- package/tests/unit/db/sql-base.test.ts +0 -438
- package/tests/unit/lib/api/error-codes.test.ts +0 -39
- package/tests/unit/lib/audit.test.ts +0 -326
- package/tests/unit/lib/auth.test.ts +0 -146
- package/tests/unit/lib/connection-string-parser.test.ts +0 -424
- package/tests/unit/lib/data-masking.test.ts +0 -583
- package/tests/unit/lib/db-icons.test.tsx +0 -41
- package/tests/unit/lib/monitoring-thresholds.test.ts +0 -133
- package/tests/unit/lib/oidc.test.ts +0 -509
- package/tests/unit/lib/query-generators.test.ts +0 -127
- package/tests/unit/lib/storage/factory.test.ts +0 -71
- package/tests/unit/lib/storage/local-storage.test.ts +0 -114
- package/tests/unit/lib/storage/providers/postgres.test.ts +0 -312
- package/tests/unit/lib/storage/providers/sqlite.test.ts +0 -232
- package/tests/unit/lib/storage/storage-facade-extended.test.ts +0 -331
- package/tests/unit/lib/storage/storage-facade.test.ts +0 -184
- package/tests/unit/lib/storage.test.ts +0 -317
- package/tests/unit/lib/time-series-buffer.test.ts +0 -212
- package/tests/unit/lib/utils.test.ts +0 -24
- package/tests/unit/llm/base-provider.test.ts +0 -238
- package/tests/unit/llm/config.test.ts +0 -262
- package/tests/unit/llm/custom-provider.test.ts +0 -281
- package/tests/unit/llm/gemini-provider.test.ts +0 -248
- package/tests/unit/llm/llm-factory.test.ts +0 -155
- package/tests/unit/llm/ollama-provider.test.ts +0 -288
- package/tests/unit/llm/openai-provider.test.ts +0 -324
- package/tests/unit/llm/retry.test.ts +0 -180
- package/tests/unit/llm/streaming.test.ts +0 -355
- package/tests/unit/logger.test.ts +0 -198
- package/tests/unit/mongodb-completions.test.ts +0 -516
- package/tests/unit/pivot-table-functions.test.ts +0 -76
- package/tests/unit/query-cancelled-error.test.ts +0 -81
- package/tests/unit/schema-diff/diff-engine.test.ts +0 -367
- package/tests/unit/schema-diff/migration-generator.test.ts +0 -513
- package/tests/unit/seed/config-loader.test.ts +0 -73
- package/tests/unit/seed/connection-filter.test.ts +0 -91
- package/tests/unit/seed/credential-resolver.test.ts +0 -85
- package/tests/unit/seed/index.test.ts +0 -72
- package/tests/unit/seed/resolve-connection.test.ts +0 -74
- package/tests/unit/seed/types.test.ts +0 -129
- package/tests/unit/sql/alias-extractor.test.ts +0 -444
- package/tests/unit/sql/statement-splitter.test.ts +0 -348
- package/tests/unit/sql-completions.test.ts +0 -463
- package/tests/unit/ssh-tunnel.test.ts +0 -465
- package/tsconfig.json +0 -42
|
@@ -0,0 +1,1310 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkY52UIFEX_js = require('./chunk-Y52UIFEX.js');
|
|
4
|
+
var chunkQ6LRDBK7_js = require('./chunk-Q6LRDBK7.js');
|
|
5
|
+
var vaul = require('vaul');
|
|
6
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
7
|
+
var lucideReact = require('lucide-react');
|
|
8
|
+
var framerMotion = require('framer-motion');
|
|
9
|
+
var React = require('react');
|
|
10
|
+
|
|
11
|
+
function _interopNamespace(e) {
|
|
12
|
+
if (e && e.__esModule) return e;
|
|
13
|
+
var n = Object.create(null);
|
|
14
|
+
if (e) {
|
|
15
|
+
Object.keys(e).forEach(function (k) {
|
|
16
|
+
if (k !== 'default') {
|
|
17
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
18
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function () { return e[k]; }
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
n.default = e;
|
|
26
|
+
return Object.freeze(n);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
30
|
+
|
|
31
|
+
function Drawer(_a) {
|
|
32
|
+
var props = chunkQ6LRDBK7_js.__objRest(_a, []);
|
|
33
|
+
return /* @__PURE__ */ jsxRuntime.jsx(vaul.Drawer.Root, chunkQ6LRDBK7_js.__spreadValues({ "data-slot": "drawer" }, props));
|
|
34
|
+
}
|
|
35
|
+
function DrawerPortal(_a) {
|
|
36
|
+
var props = chunkQ6LRDBK7_js.__objRest(_a, []);
|
|
37
|
+
return /* @__PURE__ */ jsxRuntime.jsx(vaul.Drawer.Portal, chunkQ6LRDBK7_js.__spreadValues({ "data-slot": "drawer-portal" }, props));
|
|
38
|
+
}
|
|
39
|
+
function DrawerOverlay(_a) {
|
|
40
|
+
var _b = _a, {
|
|
41
|
+
className
|
|
42
|
+
} = _b, props = chunkQ6LRDBK7_js.__objRest(_b, [
|
|
43
|
+
"className"
|
|
44
|
+
]);
|
|
45
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
46
|
+
vaul.Drawer.Overlay,
|
|
47
|
+
chunkQ6LRDBK7_js.__spreadValues({
|
|
48
|
+
"data-slot": "drawer-overlay",
|
|
49
|
+
className: chunkY52UIFEX_js.cn(
|
|
50
|
+
"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",
|
|
51
|
+
className
|
|
52
|
+
)
|
|
53
|
+
}, props)
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
function DrawerContent(_a) {
|
|
57
|
+
var _b = _a, {
|
|
58
|
+
className,
|
|
59
|
+
children
|
|
60
|
+
} = _b, props = chunkQ6LRDBK7_js.__objRest(_b, [
|
|
61
|
+
"className",
|
|
62
|
+
"children"
|
|
63
|
+
]);
|
|
64
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(DrawerPortal, { "data-slot": "drawer-portal", children: [
|
|
65
|
+
/* @__PURE__ */ jsxRuntime.jsx(DrawerOverlay, {}),
|
|
66
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
67
|
+
vaul.Drawer.Content,
|
|
68
|
+
chunkQ6LRDBK7_js.__spreadProps(chunkQ6LRDBK7_js.__spreadValues({
|
|
69
|
+
"data-slot": "drawer-content",
|
|
70
|
+
className: chunkY52UIFEX_js.cn(
|
|
71
|
+
"group/drawer-content bg-background fixed z-50 flex h-auto flex-col",
|
|
72
|
+
"data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-lg data-[vaul-drawer-direction=top]:border-b",
|
|
73
|
+
"data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[80vh] data-[vaul-drawer-direction=bottom]:rounded-t-lg data-[vaul-drawer-direction=bottom]:border-t",
|
|
74
|
+
"data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=right]:sm:max-w-sm",
|
|
75
|
+
"data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=left]:sm:max-w-sm",
|
|
76
|
+
className
|
|
77
|
+
)
|
|
78
|
+
}, props), {
|
|
79
|
+
children: [
|
|
80
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "bg-muted mx-auto mt-4 hidden h-2 w-[100px] shrink-0 rounded-full group-data-[vaul-drawer-direction=bottom]/drawer-content:block" }),
|
|
81
|
+
children
|
|
82
|
+
]
|
|
83
|
+
})
|
|
84
|
+
)
|
|
85
|
+
] });
|
|
86
|
+
}
|
|
87
|
+
function DrawerHeader(_a) {
|
|
88
|
+
var _b = _a, { className } = _b, props = chunkQ6LRDBK7_js.__objRest(_b, ["className"]);
|
|
89
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
90
|
+
"div",
|
|
91
|
+
chunkQ6LRDBK7_js.__spreadValues({
|
|
92
|
+
"data-slot": "drawer-header",
|
|
93
|
+
className: chunkY52UIFEX_js.cn(
|
|
94
|
+
"flex flex-col gap-0.5 p-4 group-data-[vaul-drawer-direction=bottom]/drawer-content:text-center group-data-[vaul-drawer-direction=top]/drawer-content:text-center md:gap-1.5 md:text-left",
|
|
95
|
+
className
|
|
96
|
+
)
|
|
97
|
+
}, props)
|
|
98
|
+
);
|
|
99
|
+
}
|
|
100
|
+
function DrawerTitle(_a) {
|
|
101
|
+
var _b = _a, {
|
|
102
|
+
className
|
|
103
|
+
} = _b, props = chunkQ6LRDBK7_js.__objRest(_b, [
|
|
104
|
+
"className"
|
|
105
|
+
]);
|
|
106
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
107
|
+
vaul.Drawer.Title,
|
|
108
|
+
chunkQ6LRDBK7_js.__spreadValues({
|
|
109
|
+
"data-slot": "drawer-title",
|
|
110
|
+
className: chunkY52UIFEX_js.cn("text-foreground font-semibold", className)
|
|
111
|
+
}, props)
|
|
112
|
+
);
|
|
113
|
+
}
|
|
114
|
+
function DrawerDescription(_a) {
|
|
115
|
+
var _b = _a, {
|
|
116
|
+
className
|
|
117
|
+
} = _b, props = chunkQ6LRDBK7_js.__objRest(_b, [
|
|
118
|
+
"className"
|
|
119
|
+
]);
|
|
120
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
121
|
+
vaul.Drawer.Description,
|
|
122
|
+
chunkQ6LRDBK7_js.__spreadValues({
|
|
123
|
+
"data-slot": "drawer-description",
|
|
124
|
+
className: chunkY52UIFEX_js.cn("text-muted-foreground text-sm", className)
|
|
125
|
+
}, props)
|
|
126
|
+
);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
// src/lib/connection-string-parser.ts
|
|
130
|
+
function parseConnectionString(input) {
|
|
131
|
+
const trimmed = input.trim();
|
|
132
|
+
if (!trimmed) return null;
|
|
133
|
+
if (trimmed.startsWith("mongodb://") || trimmed.startsWith("mongodb+srv://")) {
|
|
134
|
+
return parseMongoDBString(trimmed);
|
|
135
|
+
}
|
|
136
|
+
if (trimmed.startsWith("postgres://") || trimmed.startsWith("postgresql://")) {
|
|
137
|
+
return parseGenericURL(trimmed, "postgres", "5432");
|
|
138
|
+
}
|
|
139
|
+
if (trimmed.startsWith("mysql://")) {
|
|
140
|
+
return parseGenericURL(trimmed, "mysql", "3306");
|
|
141
|
+
}
|
|
142
|
+
if (trimmed.startsWith("redis://") || trimmed.startsWith("rediss://")) {
|
|
143
|
+
return parseGenericURL(trimmed, "redis", "6379");
|
|
144
|
+
}
|
|
145
|
+
if (trimmed.startsWith("oracle://")) {
|
|
146
|
+
return parseGenericURL(trimmed, "oracle", "1521");
|
|
147
|
+
}
|
|
148
|
+
if (trimmed.startsWith("mssql://") || trimmed.startsWith("sqlserver://")) {
|
|
149
|
+
return parseGenericURL(trimmed, "mssql", "1433");
|
|
150
|
+
}
|
|
151
|
+
if (/^Server\s*=/i.test(trimmed)) {
|
|
152
|
+
return parseADONetString(trimmed);
|
|
153
|
+
}
|
|
154
|
+
return null;
|
|
155
|
+
}
|
|
156
|
+
function parseMongoDBString(uri) {
|
|
157
|
+
const result = {
|
|
158
|
+
type: "mongodb",
|
|
159
|
+
connectionString: uri
|
|
160
|
+
};
|
|
161
|
+
try {
|
|
162
|
+
const isSRV = uri.startsWith("mongodb+srv://");
|
|
163
|
+
const withoutProtocol = uri.replace(/^mongodb(\+srv)?:\/\//, "");
|
|
164
|
+
const atIndex = withoutProtocol.indexOf("@");
|
|
165
|
+
const afterAuth = atIndex >= 0 ? withoutProtocol.slice(atIndex + 1) : withoutProtocol;
|
|
166
|
+
const slashIndex = afterAuth.indexOf("/");
|
|
167
|
+
if (slashIndex >= 0) {
|
|
168
|
+
const pathPart = afterAuth.slice(slashIndex + 1);
|
|
169
|
+
const dbName = pathPart.split("?")[0];
|
|
170
|
+
if (dbName) result.database = decodeURIComponent(dbName);
|
|
171
|
+
}
|
|
172
|
+
if (atIndex >= 0) {
|
|
173
|
+
const authPart = withoutProtocol.slice(0, atIndex);
|
|
174
|
+
const colonIndex = authPart.indexOf(":");
|
|
175
|
+
if (colonIndex >= 0) {
|
|
176
|
+
result.user = decodeURIComponent(authPart.slice(0, colonIndex));
|
|
177
|
+
result.password = decodeURIComponent(authPart.slice(colonIndex + 1));
|
|
178
|
+
} else {
|
|
179
|
+
result.user = decodeURIComponent(authPart);
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
if (!isSRV && slashIndex >= 0) {
|
|
183
|
+
const hostPart = afterAuth.slice(0, slashIndex);
|
|
184
|
+
const firstHost = hostPart.split(",")[0];
|
|
185
|
+
const [host, port] = firstHost.split(":");
|
|
186
|
+
if (host) result.host = host;
|
|
187
|
+
if (port) result.port = port;
|
|
188
|
+
}
|
|
189
|
+
} catch (e) {
|
|
190
|
+
}
|
|
191
|
+
return result;
|
|
192
|
+
}
|
|
193
|
+
function parseADONetString(input) {
|
|
194
|
+
try {
|
|
195
|
+
const params = {};
|
|
196
|
+
input.split(";").forEach((part) => {
|
|
197
|
+
const eq = part.indexOf("=");
|
|
198
|
+
if (eq > 0) {
|
|
199
|
+
const key = part.slice(0, eq).trim().toLowerCase();
|
|
200
|
+
const val = part.slice(eq + 1).trim();
|
|
201
|
+
params[key] = val;
|
|
202
|
+
}
|
|
203
|
+
});
|
|
204
|
+
const host = params["server"] || params["data source"] || "localhost";
|
|
205
|
+
const [hostPart, portPart] = host.split(",");
|
|
206
|
+
return {
|
|
207
|
+
type: "mssql",
|
|
208
|
+
host: hostPart || "localhost",
|
|
209
|
+
port: portPart || "1433",
|
|
210
|
+
user: params["user id"] || params["uid"] || void 0,
|
|
211
|
+
password: params["password"] || params["pwd"] || void 0,
|
|
212
|
+
database: params["database"] || params["initial catalog"] || void 0
|
|
213
|
+
};
|
|
214
|
+
} catch (e) {
|
|
215
|
+
return null;
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
function parseGenericURL(uri, type, defaultPort) {
|
|
219
|
+
try {
|
|
220
|
+
const url = new URL(uri);
|
|
221
|
+
return {
|
|
222
|
+
type,
|
|
223
|
+
host: url.hostname || "localhost",
|
|
224
|
+
port: url.port || defaultPort,
|
|
225
|
+
user: url.username ? decodeURIComponent(url.username) : void 0,
|
|
226
|
+
password: url.password ? decodeURIComponent(url.password) : void 0,
|
|
227
|
+
database: url.pathname.slice(1) || void 0
|
|
228
|
+
// remove leading /
|
|
229
|
+
};
|
|
230
|
+
} catch (e) {
|
|
231
|
+
return null;
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
// src/hooks/use-connection-form.ts
|
|
236
|
+
function useConnectionForm({ isOpen, onConnect, editConnection, onTestConnection }) {
|
|
237
|
+
const [type, setType] = React.useState("postgres");
|
|
238
|
+
const [name, setName] = React.useState("");
|
|
239
|
+
const [host, setHost] = React.useState("localhost");
|
|
240
|
+
const [port, setPort] = React.useState("5432");
|
|
241
|
+
const [user, setUser] = React.useState("");
|
|
242
|
+
const [password, setPassword] = React.useState("");
|
|
243
|
+
const [database, setDatabase] = React.useState("");
|
|
244
|
+
const [isTesting, setIsTesting] = React.useState(false);
|
|
245
|
+
const [connectionString, setConnectionString] = React.useState("");
|
|
246
|
+
const [mongoConnectionMode, setMongoConnectionMode] = React.useState("host");
|
|
247
|
+
const [environment, setEnvironment] = React.useState("local");
|
|
248
|
+
const [testResult, setTestResult] = React.useState(null);
|
|
249
|
+
const [pasteInput, setPasteInput] = React.useState("");
|
|
250
|
+
const [showPasteInput, setShowPasteInput] = React.useState(false);
|
|
251
|
+
const [showSSL, setShowSSL] = React.useState(false);
|
|
252
|
+
const [sslMode, setSSLMode] = React.useState("disable");
|
|
253
|
+
const [caCert, setCaCert] = React.useState("");
|
|
254
|
+
const [clientCert, setClientCert] = React.useState("");
|
|
255
|
+
const [clientKey, setClientKey] = React.useState("");
|
|
256
|
+
const [showAdvanced, setShowAdvanced] = React.useState(false);
|
|
257
|
+
const [serviceName, setServiceName] = React.useState("");
|
|
258
|
+
const [instanceName, setInstanceName] = React.useState("");
|
|
259
|
+
const [showSSH, setShowSSH] = React.useState(false);
|
|
260
|
+
const [sshEnabled, setSSHEnabled] = React.useState(false);
|
|
261
|
+
const [sshHost, setSSHHost] = React.useState("");
|
|
262
|
+
const [sshPort, setSSHPort] = React.useState("22");
|
|
263
|
+
const [sshUsername, setSSHUsername] = React.useState("");
|
|
264
|
+
const [sshAuthMethod, setSSHAuthMethod] = React.useState("password");
|
|
265
|
+
const [sshPassword, setSSHPassword] = React.useState("");
|
|
266
|
+
const [sshPrivateKey, setSSHPrivateKey] = React.useState("");
|
|
267
|
+
const [sshPassphrase, setSSHPassphrase] = React.useState("");
|
|
268
|
+
const isEditMode = !!editConnection;
|
|
269
|
+
React.useEffect(() => {
|
|
270
|
+
var _a, _b;
|
|
271
|
+
if (editConnection) {
|
|
272
|
+
setType(editConnection.type);
|
|
273
|
+
setName(editConnection.name);
|
|
274
|
+
setHost(editConnection.host || "localhost");
|
|
275
|
+
setPort(((_a = editConnection.port) == null ? void 0 : _a.toString()) || chunkY52UIFEX_js.getDBConfig(editConnection.type).defaultPort);
|
|
276
|
+
setUser(editConnection.user || "");
|
|
277
|
+
setPassword(editConnection.password || "");
|
|
278
|
+
setDatabase(editConnection.database || "");
|
|
279
|
+
setConnectionString(editConnection.connectionString || "");
|
|
280
|
+
setEnvironment(editConnection.environment || "local");
|
|
281
|
+
if (editConnection.connectionString) {
|
|
282
|
+
setMongoConnectionMode("connectionString");
|
|
283
|
+
}
|
|
284
|
+
if (editConnection.serviceName) {
|
|
285
|
+
setServiceName(editConnection.serviceName);
|
|
286
|
+
setShowAdvanced(true);
|
|
287
|
+
}
|
|
288
|
+
if (editConnection.instanceName) {
|
|
289
|
+
setInstanceName(editConnection.instanceName);
|
|
290
|
+
setShowAdvanced(true);
|
|
291
|
+
}
|
|
292
|
+
if (editConnection.ssl) {
|
|
293
|
+
setSSLMode(editConnection.ssl.mode);
|
|
294
|
+
setCaCert(editConnection.ssl.caCert || "");
|
|
295
|
+
setClientCert(editConnection.ssl.clientCert || "");
|
|
296
|
+
setClientKey(editConnection.ssl.clientKey || "");
|
|
297
|
+
if (editConnection.ssl.mode !== "disable") setShowSSL(true);
|
|
298
|
+
}
|
|
299
|
+
if ((_b = editConnection.sshTunnel) == null ? void 0 : _b.enabled) {
|
|
300
|
+
setSSHEnabled(true);
|
|
301
|
+
setShowSSH(true);
|
|
302
|
+
setSSHHost(editConnection.sshTunnel.host);
|
|
303
|
+
setSSHPort(editConnection.sshTunnel.port.toString());
|
|
304
|
+
setSSHUsername(editConnection.sshTunnel.username);
|
|
305
|
+
setSSHAuthMethod(editConnection.sshTunnel.authMethod);
|
|
306
|
+
setSSHPassword(editConnection.sshTunnel.password || "");
|
|
307
|
+
setSSHPrivateKey(editConnection.sshTunnel.privateKey || "");
|
|
308
|
+
setSSHPassphrase(editConnection.sshTunnel.passphrase || "");
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
}, [editConnection]);
|
|
312
|
+
React.useEffect(() => {
|
|
313
|
+
if (!isOpen) {
|
|
314
|
+
setTestResult(null);
|
|
315
|
+
setShowPasteInput(false);
|
|
316
|
+
setPasteInput("");
|
|
317
|
+
if (!editConnection) {
|
|
318
|
+
setName("");
|
|
319
|
+
setUser("");
|
|
320
|
+
setPassword("");
|
|
321
|
+
setDatabase("");
|
|
322
|
+
setConnectionString("");
|
|
323
|
+
setMongoConnectionMode("host");
|
|
324
|
+
setType("postgres");
|
|
325
|
+
setHost("localhost");
|
|
326
|
+
setPort("5432");
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
}, [isOpen, editConnection]);
|
|
330
|
+
const buildConnection = React.useCallback(() => {
|
|
331
|
+
const sslConfig = sslMode !== "disable" ? chunkQ6LRDBK7_js.__spreadValues(chunkQ6LRDBK7_js.__spreadValues(chunkQ6LRDBK7_js.__spreadValues({
|
|
332
|
+
mode: sslMode
|
|
333
|
+
}, caCert ? { caCert } : {}), clientCert ? { clientCert } : {}), clientKey ? { clientKey } : {}) : void 0;
|
|
334
|
+
const sshConfig = sshEnabled ? chunkQ6LRDBK7_js.__spreadValues(chunkQ6LRDBK7_js.__spreadValues(chunkQ6LRDBK7_js.__spreadValues({
|
|
335
|
+
enabled: true,
|
|
336
|
+
host: sshHost,
|
|
337
|
+
port: parseInt(sshPort) || 22,
|
|
338
|
+
username: sshUsername,
|
|
339
|
+
authMethod: sshAuthMethod
|
|
340
|
+
}, sshAuthMethod === "password" ? { password: sshPassword } : {}), sshAuthMethod === "privateKey" ? { privateKey: sshPrivateKey } : {}), sshPassphrase ? { passphrase: sshPassphrase } : {}) : void 0;
|
|
341
|
+
return chunkQ6LRDBK7_js.__spreadValues(chunkQ6LRDBK7_js.__spreadValues(chunkQ6LRDBK7_js.__spreadValues(chunkQ6LRDBK7_js.__spreadValues(chunkQ6LRDBK7_js.__spreadValues({
|
|
342
|
+
id: (editConnection == null ? void 0 : editConnection.id) || Math.random().toString(36).substr(2, 9),
|
|
343
|
+
name: name || `${type}-connection`,
|
|
344
|
+
type,
|
|
345
|
+
host,
|
|
346
|
+
port: parseInt(port),
|
|
347
|
+
user,
|
|
348
|
+
password,
|
|
349
|
+
database,
|
|
350
|
+
createdAt: (editConnection == null ? void 0 : editConnection.createdAt) || /* @__PURE__ */ new Date(),
|
|
351
|
+
environment,
|
|
352
|
+
color: chunkY52UIFEX_js.ENVIRONMENT_COLORS[environment]
|
|
353
|
+
}, sslConfig ? { ssl: sslConfig } : {}), sshConfig ? { sshTunnel: sshConfig } : {}), chunkY52UIFEX_js.getDBConfig(type).showConnectionStringToggle && mongoConnectionMode === "connectionString" ? {
|
|
354
|
+
connectionString,
|
|
355
|
+
host: void 0,
|
|
356
|
+
port: void 0,
|
|
357
|
+
user: void 0,
|
|
358
|
+
password: void 0
|
|
359
|
+
} : {}), type === "oracle" && serviceName ? { serviceName } : {}), type === "mssql" && instanceName ? { instanceName } : {});
|
|
360
|
+
}, [
|
|
361
|
+
sslMode,
|
|
362
|
+
caCert,
|
|
363
|
+
clientCert,
|
|
364
|
+
clientKey,
|
|
365
|
+
sshEnabled,
|
|
366
|
+
sshHost,
|
|
367
|
+
sshPort,
|
|
368
|
+
sshUsername,
|
|
369
|
+
sshAuthMethod,
|
|
370
|
+
sshPassword,
|
|
371
|
+
sshPrivateKey,
|
|
372
|
+
sshPassphrase,
|
|
373
|
+
editConnection,
|
|
374
|
+
name,
|
|
375
|
+
type,
|
|
376
|
+
host,
|
|
377
|
+
port,
|
|
378
|
+
user,
|
|
379
|
+
password,
|
|
380
|
+
database,
|
|
381
|
+
environment,
|
|
382
|
+
mongoConnectionMode,
|
|
383
|
+
connectionString,
|
|
384
|
+
serviceName,
|
|
385
|
+
instanceName
|
|
386
|
+
]);
|
|
387
|
+
const handleTestConnection = React.useCallback(async () => {
|
|
388
|
+
setIsTesting(true);
|
|
389
|
+
setTestResult(null);
|
|
390
|
+
try {
|
|
391
|
+
const conn = buildConnection();
|
|
392
|
+
if (onTestConnection) {
|
|
393
|
+
const result = await onTestConnection(conn);
|
|
394
|
+
setTestResult({
|
|
395
|
+
success: result.success,
|
|
396
|
+
message: result.success ? `Connected successfully${result.latency ? ` (${result.latency}ms)` : ""}` : result.error || "Connection failed",
|
|
397
|
+
latency: result.latency
|
|
398
|
+
});
|
|
399
|
+
} else {
|
|
400
|
+
const response = await fetch("/api/db/test-connection", {
|
|
401
|
+
method: "POST",
|
|
402
|
+
headers: { "Content-Type": "application/json" },
|
|
403
|
+
body: JSON.stringify(conn)
|
|
404
|
+
});
|
|
405
|
+
const result = await response.json();
|
|
406
|
+
setTestResult({
|
|
407
|
+
success: result.success,
|
|
408
|
+
message: result.success ? `Connected successfully${result.latency ? ` (${result.latency}ms)` : ""}` : result.error || "Connection failed",
|
|
409
|
+
latency: result.latency
|
|
410
|
+
});
|
|
411
|
+
}
|
|
412
|
+
} catch (e) {
|
|
413
|
+
setTestResult({ success: false, message: "Network error - could not reach server" });
|
|
414
|
+
} finally {
|
|
415
|
+
setIsTesting(false);
|
|
416
|
+
}
|
|
417
|
+
}, [buildConnection, onTestConnection]);
|
|
418
|
+
const handleConnect = React.useCallback(async () => {
|
|
419
|
+
setIsTesting(true);
|
|
420
|
+
setTestResult(null);
|
|
421
|
+
try {
|
|
422
|
+
const conn = buildConnection();
|
|
423
|
+
let result;
|
|
424
|
+
if (onTestConnection) {
|
|
425
|
+
result = await onTestConnection(conn);
|
|
426
|
+
} else {
|
|
427
|
+
const response = await fetch("/api/db/test-connection", {
|
|
428
|
+
method: "POST",
|
|
429
|
+
headers: { "Content-Type": "application/json" },
|
|
430
|
+
body: JSON.stringify(conn)
|
|
431
|
+
});
|
|
432
|
+
result = await response.json();
|
|
433
|
+
}
|
|
434
|
+
if (result.success) {
|
|
435
|
+
onConnect(conn);
|
|
436
|
+
setName("");
|
|
437
|
+
setUser("");
|
|
438
|
+
setPassword("");
|
|
439
|
+
setDatabase("");
|
|
440
|
+
setConnectionString("");
|
|
441
|
+
setMongoConnectionMode("host");
|
|
442
|
+
setTestResult(null);
|
|
443
|
+
} else {
|
|
444
|
+
setTestResult({ success: false, message: result.error || "Connection failed" });
|
|
445
|
+
}
|
|
446
|
+
} catch (e) {
|
|
447
|
+
setTestResult({ success: false, message: "Network error - could not reach server" });
|
|
448
|
+
} finally {
|
|
449
|
+
setIsTesting(false);
|
|
450
|
+
}
|
|
451
|
+
}, [buildConnection, type, onConnect, onTestConnection]);
|
|
452
|
+
const handlePasteConnectionString = React.useCallback(() => {
|
|
453
|
+
const trimmed = pasteInput.trim();
|
|
454
|
+
if (!trimmed) return;
|
|
455
|
+
const parsed = parseConnectionString(trimmed);
|
|
456
|
+
if (!parsed) {
|
|
457
|
+
setTestResult({ success: false, message: "Could not parse connection string. Supported formats: postgres://, mysql://, mongodb://, redis://, oracle://, mssql://" });
|
|
458
|
+
return;
|
|
459
|
+
}
|
|
460
|
+
setType(parsed.type);
|
|
461
|
+
if (parsed.host) setHost(parsed.host);
|
|
462
|
+
if (parsed.port) setPort(parsed.port);
|
|
463
|
+
if (parsed.user) setUser(parsed.user);
|
|
464
|
+
if (parsed.password) setPassword(parsed.password);
|
|
465
|
+
if (parsed.database) setDatabase(parsed.database);
|
|
466
|
+
if (parsed.type === "mongodb" && parsed.connectionString) {
|
|
467
|
+
setConnectionString(parsed.connectionString);
|
|
468
|
+
setMongoConnectionMode("connectionString");
|
|
469
|
+
}
|
|
470
|
+
if (!name) {
|
|
471
|
+
const dbName = parsed.database || parsed.host || parsed.type;
|
|
472
|
+
setName(`${dbName}`);
|
|
473
|
+
}
|
|
474
|
+
setShowPasteInput(false);
|
|
475
|
+
setPasteInput("");
|
|
476
|
+
setTestResult({ success: true, message: "Connection string parsed successfully. Review the fields and connect." });
|
|
477
|
+
}, [pasteInput, name]);
|
|
478
|
+
const selectableTypes = ["postgres", "mysql", "oracle", "mssql", "mongodb", "redis"];
|
|
479
|
+
const dbTypes = selectableTypes.map((t) => {
|
|
480
|
+
const cfg = chunkY52UIFEX_js.getDBConfig(t);
|
|
481
|
+
return { value: t, label: cfg.label, icon: cfg.icon, color: cfg.color };
|
|
482
|
+
});
|
|
483
|
+
return {
|
|
484
|
+
// Connection fields
|
|
485
|
+
type,
|
|
486
|
+
setType,
|
|
487
|
+
name,
|
|
488
|
+
setName,
|
|
489
|
+
host,
|
|
490
|
+
setHost,
|
|
491
|
+
port,
|
|
492
|
+
setPort,
|
|
493
|
+
user,
|
|
494
|
+
setUser,
|
|
495
|
+
password,
|
|
496
|
+
setPassword,
|
|
497
|
+
database,
|
|
498
|
+
setDatabase,
|
|
499
|
+
connectionString,
|
|
500
|
+
setConnectionString,
|
|
501
|
+
mongoConnectionMode,
|
|
502
|
+
setMongoConnectionMode,
|
|
503
|
+
environment,
|
|
504
|
+
setEnvironment,
|
|
505
|
+
// UI state
|
|
506
|
+
isTesting,
|
|
507
|
+
testResult,
|
|
508
|
+
setTestResult,
|
|
509
|
+
pasteInput,
|
|
510
|
+
setPasteInput,
|
|
511
|
+
showPasteInput,
|
|
512
|
+
setShowPasteInput,
|
|
513
|
+
isEditMode,
|
|
514
|
+
// SSL/TLS
|
|
515
|
+
showSSL,
|
|
516
|
+
setShowSSL,
|
|
517
|
+
sslMode,
|
|
518
|
+
setSSLMode,
|
|
519
|
+
caCert,
|
|
520
|
+
setCaCert,
|
|
521
|
+
clientCert,
|
|
522
|
+
setClientCert,
|
|
523
|
+
clientKey,
|
|
524
|
+
setClientKey,
|
|
525
|
+
// Advanced (Oracle/MSSQL)
|
|
526
|
+
showAdvanced,
|
|
527
|
+
setShowAdvanced,
|
|
528
|
+
serviceName,
|
|
529
|
+
setServiceName,
|
|
530
|
+
instanceName,
|
|
531
|
+
setInstanceName,
|
|
532
|
+
// SSH Tunnel
|
|
533
|
+
showSSH,
|
|
534
|
+
setShowSSH,
|
|
535
|
+
sshEnabled,
|
|
536
|
+
setSSHEnabled,
|
|
537
|
+
sshHost,
|
|
538
|
+
setSSHHost,
|
|
539
|
+
sshPort,
|
|
540
|
+
setSSHPort,
|
|
541
|
+
sshUsername,
|
|
542
|
+
setSSHUsername,
|
|
543
|
+
sshAuthMethod,
|
|
544
|
+
setSSHAuthMethod,
|
|
545
|
+
sshPassword,
|
|
546
|
+
setSSHPassword,
|
|
547
|
+
sshPrivateKey,
|
|
548
|
+
setSSHPrivateKey,
|
|
549
|
+
sshPassphrase,
|
|
550
|
+
setSSHPassphrase,
|
|
551
|
+
// Handlers
|
|
552
|
+
handleTestConnection,
|
|
553
|
+
handleConnect,
|
|
554
|
+
handlePasteConnectionString,
|
|
555
|
+
// Derived data
|
|
556
|
+
dbTypes
|
|
557
|
+
};
|
|
558
|
+
}
|
|
559
|
+
var MOBILE_BREAKPOINT = 768;
|
|
560
|
+
function useIsMobile() {
|
|
561
|
+
const [isMobile, setIsMobile] = React__namespace.useState(false);
|
|
562
|
+
React__namespace.useEffect(() => {
|
|
563
|
+
const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`);
|
|
564
|
+
const onChange = () => {
|
|
565
|
+
setIsMobile(mql.matches);
|
|
566
|
+
};
|
|
567
|
+
setIsMobile(mql.matches);
|
|
568
|
+
mql.addEventListener("change", onChange);
|
|
569
|
+
return () => mql.removeEventListener("change", onChange);
|
|
570
|
+
}, []);
|
|
571
|
+
return isMobile;
|
|
572
|
+
}
|
|
573
|
+
function ConnectionModal({ isOpen, onClose, onConnect, editConnection, onTestConnection }) {
|
|
574
|
+
const isMobile = useIsMobile();
|
|
575
|
+
const {
|
|
576
|
+
// Connection fields
|
|
577
|
+
type,
|
|
578
|
+
setType,
|
|
579
|
+
name,
|
|
580
|
+
setName,
|
|
581
|
+
host,
|
|
582
|
+
setHost,
|
|
583
|
+
port,
|
|
584
|
+
setPort,
|
|
585
|
+
user,
|
|
586
|
+
setUser,
|
|
587
|
+
password,
|
|
588
|
+
setPassword,
|
|
589
|
+
database,
|
|
590
|
+
setDatabase,
|
|
591
|
+
connectionString,
|
|
592
|
+
setConnectionString,
|
|
593
|
+
mongoConnectionMode,
|
|
594
|
+
setMongoConnectionMode,
|
|
595
|
+
environment,
|
|
596
|
+
setEnvironment,
|
|
597
|
+
// UI state
|
|
598
|
+
isTesting,
|
|
599
|
+
testResult,
|
|
600
|
+
setTestResult,
|
|
601
|
+
pasteInput,
|
|
602
|
+
setPasteInput,
|
|
603
|
+
showPasteInput,
|
|
604
|
+
setShowPasteInput,
|
|
605
|
+
isEditMode,
|
|
606
|
+
// SSL/TLS
|
|
607
|
+
showSSL,
|
|
608
|
+
setShowSSL,
|
|
609
|
+
sslMode,
|
|
610
|
+
setSSLMode,
|
|
611
|
+
caCert,
|
|
612
|
+
setCaCert,
|
|
613
|
+
clientCert,
|
|
614
|
+
setClientCert,
|
|
615
|
+
clientKey,
|
|
616
|
+
setClientKey,
|
|
617
|
+
// Advanced (Oracle/MSSQL)
|
|
618
|
+
showAdvanced,
|
|
619
|
+
setShowAdvanced,
|
|
620
|
+
serviceName,
|
|
621
|
+
setServiceName,
|
|
622
|
+
instanceName,
|
|
623
|
+
setInstanceName,
|
|
624
|
+
// SSH Tunnel
|
|
625
|
+
showSSH,
|
|
626
|
+
setShowSSH,
|
|
627
|
+
sshEnabled,
|
|
628
|
+
setSSHEnabled,
|
|
629
|
+
sshHost,
|
|
630
|
+
setSSHHost,
|
|
631
|
+
sshPort,
|
|
632
|
+
setSSHPort,
|
|
633
|
+
sshUsername,
|
|
634
|
+
setSSHUsername,
|
|
635
|
+
sshAuthMethod,
|
|
636
|
+
setSSHAuthMethod,
|
|
637
|
+
sshPassword,
|
|
638
|
+
setSSHPassword,
|
|
639
|
+
sshPrivateKey,
|
|
640
|
+
setSSHPrivateKey,
|
|
641
|
+
sshPassphrase,
|
|
642
|
+
setSSHPassphrase,
|
|
643
|
+
// Handlers
|
|
644
|
+
handleTestConnection,
|
|
645
|
+
handleConnect,
|
|
646
|
+
handlePasteConnectionString,
|
|
647
|
+
// Derived data
|
|
648
|
+
dbTypes
|
|
649
|
+
} = useConnectionForm({ isOpen, onClose, onConnect, editConnection, onTestConnection });
|
|
650
|
+
const formContent = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
651
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "shrink-0 h-2 w-full bg-blue-600/20", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
652
|
+
framerMotion.motion.div,
|
|
653
|
+
{
|
|
654
|
+
initial: { width: 0 },
|
|
655
|
+
animate: { width: "100%" },
|
|
656
|
+
className: "h-full bg-blue-500 shadow-[0_0_15px_rgba(59,130,246,0.5)]"
|
|
657
|
+
}
|
|
658
|
+
) }),
|
|
659
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1 overflow-y-auto p-4 md:p-8", children: [
|
|
660
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mb-4 md:mb-8", children: [
|
|
661
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3 mb-2", children: [
|
|
662
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-2 rounded-xl bg-blue-500/10 border border-blue-500/20", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Zap, { strokeWidth: 1.5, className: "w-5 h-5 text-blue-400" }) }),
|
|
663
|
+
/* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-xs md:text-[0.8125rem] font-medium", children: isEditMode ? "Edit Connection" : "New Connection" })
|
|
664
|
+
] }),
|
|
665
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between", children: [
|
|
666
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-zinc-500", children: isEditMode ? "Update your database connection parameters." : "Configure your database connection parameters securely." }),
|
|
667
|
+
!isEditMode && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
668
|
+
"button",
|
|
669
|
+
{
|
|
670
|
+
onClick: () => setShowPasteInput(!showPasteInput),
|
|
671
|
+
className: "flex items-center gap-1.5 text-xs font-mediumr text-blue-400 hover:text-blue-300 transition-colors px-2 py-1 rounded-md hover:bg-blue-500/10",
|
|
672
|
+
children: [
|
|
673
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.ClipboardPaste, { strokeWidth: 1.5, className: "w-3 h-3" }),
|
|
674
|
+
"Paste URL"
|
|
675
|
+
]
|
|
676
|
+
}
|
|
677
|
+
)
|
|
678
|
+
] })
|
|
679
|
+
] }),
|
|
680
|
+
/* @__PURE__ */ jsxRuntime.jsx(framerMotion.AnimatePresence, { children: showPasteInput && /* @__PURE__ */ jsxRuntime.jsx(
|
|
681
|
+
framerMotion.motion.div,
|
|
682
|
+
{
|
|
683
|
+
initial: { height: 0, opacity: 0 },
|
|
684
|
+
animate: { height: "auto", opacity: 1 },
|
|
685
|
+
exit: { height: 0, opacity: 0 },
|
|
686
|
+
className: "mb-6 overflow-hidden",
|
|
687
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "p-3 rounded-lg border border-blue-500/20 bg-blue-500/5 space-y-2", children: [
|
|
688
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkY52UIFEX_js.Label, { className: "text-xs font-mediumr text-blue-400", children: "Paste Connection URL" }),
|
|
689
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex gap-2", children: [
|
|
690
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
691
|
+
chunkY52UIFEX_js.Input,
|
|
692
|
+
{
|
|
693
|
+
value: pasteInput,
|
|
694
|
+
onChange: (e) => setPasteInput(e.target.value),
|
|
695
|
+
placeholder: "postgres://user:pass@host:5432/db or mongodb://...",
|
|
696
|
+
className: "h-9 bg-zinc-900/50 border-white/5 focus:border-blue-500/50 text-xs font-mono flex-1",
|
|
697
|
+
onKeyDown: (e) => e.key === "Enter" && handlePasteConnectionString()
|
|
698
|
+
}
|
|
699
|
+
),
|
|
700
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
701
|
+
chunkY52UIFEX_js.Button,
|
|
702
|
+
{
|
|
703
|
+
size: "sm",
|
|
704
|
+
onClick: handlePasteConnectionString,
|
|
705
|
+
className: "bg-blue-600 hover:bg-blue-500 text-white h-9 px-4 text-xs font-medium",
|
|
706
|
+
children: "Parse"
|
|
707
|
+
}
|
|
708
|
+
)
|
|
709
|
+
] }),
|
|
710
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-zinc-500", children: "Supports: postgres://, mysql://, mongodb://, redis://, oracle://, mssql://" })
|
|
711
|
+
] })
|
|
712
|
+
}
|
|
713
|
+
) }),
|
|
714
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4 md:space-y-6", children: [
|
|
715
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
|
|
716
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 mb-1", children: [
|
|
717
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Database, { strokeWidth: 1.5, className: "w-3 h-3 text-zinc-500" }),
|
|
718
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkY52UIFEX_js.Label, { htmlFor: "name", className: "text-xs font-mediumr text-zinc-500", children: "Connection Name" })
|
|
719
|
+
] }),
|
|
720
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
721
|
+
chunkY52UIFEX_js.Input,
|
|
722
|
+
{
|
|
723
|
+
id: "name",
|
|
724
|
+
value: name,
|
|
725
|
+
onChange: (e) => setName(e.target.value),
|
|
726
|
+
placeholder: "My Database",
|
|
727
|
+
className: "h-10 bg-zinc-900/50 border-white/5 focus:border-blue-500/50 transition-all text-xs"
|
|
728
|
+
}
|
|
729
|
+
)
|
|
730
|
+
] }),
|
|
731
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
|
|
732
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkY52UIFEX_js.Label, { className: "text-xs font-mediumr text-zinc-500", children: "Environment" }),
|
|
733
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-wrap items-center gap-2", children: Object.keys(chunkY52UIFEX_js.ENVIRONMENT_COLORS).map((env) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
734
|
+
"button",
|
|
735
|
+
{
|
|
736
|
+
onClick: () => setEnvironment(env),
|
|
737
|
+
className: chunkY52UIFEX_js.cn(
|
|
738
|
+
"flex items-center gap-1.5 px-3 py-1.5 rounded-md text-xs font-mediumr transition-all border",
|
|
739
|
+
environment === env ? "border-white/20 bg-white/5 text-zinc-200" : "border-transparent text-zinc-500 hover:text-zinc-300 hover:bg-white/5"
|
|
740
|
+
),
|
|
741
|
+
children: [
|
|
742
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
743
|
+
"div",
|
|
744
|
+
{
|
|
745
|
+
className: "w-2 h-2 rounded-full",
|
|
746
|
+
style: { backgroundColor: chunkY52UIFEX_js.ENVIRONMENT_COLORS[env] }
|
|
747
|
+
}
|
|
748
|
+
),
|
|
749
|
+
env === "other" ? "Other" : chunkY52UIFEX_js.ENVIRONMENT_LABELS[env]
|
|
750
|
+
]
|
|
751
|
+
},
|
|
752
|
+
env
|
|
753
|
+
)) })
|
|
754
|
+
] }),
|
|
755
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid grid-cols-2 gap-3", children: dbTypes.map((db) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
756
|
+
"button",
|
|
757
|
+
{
|
|
758
|
+
onClick: () => {
|
|
759
|
+
setType(db.value);
|
|
760
|
+
const cfg = chunkY52UIFEX_js.getDBConfig(db.value);
|
|
761
|
+
if (cfg.defaultPort) setPort(cfg.defaultPort);
|
|
762
|
+
setTestResult(null);
|
|
763
|
+
},
|
|
764
|
+
disabled: isEditMode,
|
|
765
|
+
className: chunkY52UIFEX_js.cn(
|
|
766
|
+
"flex flex-col items-center justify-center p-3 md:p-4 rounded-xl border transition-all duration-200 gap-2 group",
|
|
767
|
+
type === db.value ? "bg-blue-600/10 border-blue-500/50 shadow-[0_0_20px_rgba(59,130,246,0.1)]" : "bg-zinc-900/50 border-white/5 hover:border-white/10 hover:bg-zinc-900",
|
|
768
|
+
isEditMode && type !== db.value && "opacity-30 cursor-not-allowed"
|
|
769
|
+
),
|
|
770
|
+
children: [
|
|
771
|
+
/* @__PURE__ */ jsxRuntime.jsx(db.icon, { className: chunkY52UIFEX_js.cn("w-6 h-6 mb-1 transition-transform group-hover:scale-110", type === db.value ? db.color : "text-zinc-600") }),
|
|
772
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: chunkY52UIFEX_js.cn("text-xs font-medium", type === db.value ? "text-zinc-200" : "text-zinc-500"), children: db.label })
|
|
773
|
+
]
|
|
774
|
+
},
|
|
775
|
+
db.value
|
|
776
|
+
)) }),
|
|
777
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-4 animate-in fade-in slide-in-from-bottom-4 duration-500", children: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
778
|
+
chunkY52UIFEX_js.getDBConfig(type).showConnectionStringToggle && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 p-1 rounded-lg bg-zinc-900/50 border border-white/5", children: [
|
|
779
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
780
|
+
"button",
|
|
781
|
+
{
|
|
782
|
+
onClick: () => setMongoConnectionMode("host"),
|
|
783
|
+
className: chunkY52UIFEX_js.cn(
|
|
784
|
+
"flex-1 flex items-center justify-center gap-2 px-3 py-2 rounded-md text-xs font-medium transition-all",
|
|
785
|
+
mongoConnectionMode === "host" ? "bg-blue-600/20 text-blue-400 border border-blue-500/30" : "text-zinc-500 hover:text-zinc-300"
|
|
786
|
+
),
|
|
787
|
+
children: [
|
|
788
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Globe, { strokeWidth: 1.5, className: "w-3 h-3" }),
|
|
789
|
+
"Host / Port"
|
|
790
|
+
]
|
|
791
|
+
}
|
|
792
|
+
),
|
|
793
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
794
|
+
"button",
|
|
795
|
+
{
|
|
796
|
+
onClick: () => setMongoConnectionMode("connectionString"),
|
|
797
|
+
className: chunkY52UIFEX_js.cn(
|
|
798
|
+
"flex-1 flex items-center justify-center gap-2 px-3 py-2 rounded-md text-xs font-medium transition-all",
|
|
799
|
+
mongoConnectionMode === "connectionString" ? "bg-blue-600/20 text-blue-400 border border-blue-500/30" : "text-zinc-500 hover:text-zinc-300"
|
|
800
|
+
),
|
|
801
|
+
children: [
|
|
802
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Link, { strokeWidth: 1.5, className: "w-3 h-3" }),
|
|
803
|
+
"Connection String"
|
|
804
|
+
]
|
|
805
|
+
}
|
|
806
|
+
)
|
|
807
|
+
] }),
|
|
808
|
+
chunkY52UIFEX_js.getDBConfig(type).showConnectionStringToggle && mongoConnectionMode === "connectionString" ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
809
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
|
|
810
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 mb-1", children: [
|
|
811
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Link, { strokeWidth: 1.5, className: "w-3 h-3 text-zinc-500" }),
|
|
812
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkY52UIFEX_js.Label, { htmlFor: "connectionString", className: "text-xs font-mediumr text-zinc-500", children: "Connection URI" })
|
|
813
|
+
] }),
|
|
814
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
815
|
+
chunkY52UIFEX_js.Input,
|
|
816
|
+
{
|
|
817
|
+
id: "connectionString",
|
|
818
|
+
value: connectionString,
|
|
819
|
+
onChange: (e) => setConnectionString(e.target.value),
|
|
820
|
+
placeholder: "mongodb://localhost:27017/mydb or mongodb+srv://...",
|
|
821
|
+
className: "h-10 bg-zinc-900/50 border-white/5 focus:border-blue-500/50 transition-all text-xs font-mono"
|
|
822
|
+
}
|
|
823
|
+
)
|
|
824
|
+
] }),
|
|
825
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
|
|
826
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 mb-1", children: [
|
|
827
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Database, { strokeWidth: 1.5, className: "w-3 h-3 text-zinc-500" }),
|
|
828
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkY52UIFEX_js.Label, { htmlFor: "database", className: "text-xs font-mediumr text-zinc-500", children: "Database Name (optional override)" })
|
|
829
|
+
] }),
|
|
830
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
831
|
+
chunkY52UIFEX_js.Input,
|
|
832
|
+
{
|
|
833
|
+
id: "database",
|
|
834
|
+
value: database,
|
|
835
|
+
onChange: (e) => setDatabase(e.target.value),
|
|
836
|
+
placeholder: "Extracted from URI if not provided",
|
|
837
|
+
className: "h-10 bg-zinc-900/50 border-white/5 focus:border-blue-500/50 transition-all text-xs font-mono"
|
|
838
|
+
}
|
|
839
|
+
)
|
|
840
|
+
] })
|
|
841
|
+
] }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
842
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
|
|
843
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 mb-1", children: [
|
|
844
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Globe, { strokeWidth: 1.5, className: "w-3 h-3 text-zinc-500" }),
|
|
845
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkY52UIFEX_js.Label, { htmlFor: "host", className: "text-xs font-mediumr text-zinc-500", children: "Host & Instance" })
|
|
846
|
+
] }),
|
|
847
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-1 md:grid-cols-4 gap-3", children: [
|
|
848
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
849
|
+
chunkY52UIFEX_js.Input,
|
|
850
|
+
{
|
|
851
|
+
id: "host",
|
|
852
|
+
value: host,
|
|
853
|
+
onChange: (e) => setHost(e.target.value),
|
|
854
|
+
placeholder: "localhost",
|
|
855
|
+
className: "md:col-span-3 h-10 bg-zinc-900/50 border-white/5 focus:border-blue-500/50 transition-all text-xs"
|
|
856
|
+
}
|
|
857
|
+
),
|
|
858
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
859
|
+
chunkY52UIFEX_js.Input,
|
|
860
|
+
{
|
|
861
|
+
id: "port",
|
|
862
|
+
value: port,
|
|
863
|
+
onChange: (e) => setPort(e.target.value),
|
|
864
|
+
className: "h-10 bg-zinc-900/50 border-white/5 focus:border-blue-500/50 transition-all text-xs font-mono"
|
|
865
|
+
}
|
|
866
|
+
)
|
|
867
|
+
] })
|
|
868
|
+
] }),
|
|
869
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
|
|
870
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
|
|
871
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 mb-1", children: [
|
|
872
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Key, { strokeWidth: 1.5, className: "w-3 h-3 text-zinc-500" }),
|
|
873
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkY52UIFEX_js.Label, { htmlFor: "user", className: "text-xs font-mediumr text-zinc-500", children: "Username" })
|
|
874
|
+
] }),
|
|
875
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
876
|
+
chunkY52UIFEX_js.Input,
|
|
877
|
+
{
|
|
878
|
+
id: "user",
|
|
879
|
+
value: user,
|
|
880
|
+
onChange: (e) => setUser(e.target.value),
|
|
881
|
+
placeholder: "postgres",
|
|
882
|
+
className: "h-10 bg-zinc-900/50 border-white/5 focus:border-blue-500/50 transition-all text-xs"
|
|
883
|
+
}
|
|
884
|
+
)
|
|
885
|
+
] }),
|
|
886
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
|
|
887
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 mb-1", children: [
|
|
888
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.ShieldCheck, { strokeWidth: 1.5, className: "w-3 h-3 text-zinc-500" }),
|
|
889
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkY52UIFEX_js.Label, { htmlFor: "password", className: "text-xs font-mediumr text-zinc-500", children: "Password" })
|
|
890
|
+
] }),
|
|
891
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
892
|
+
chunkY52UIFEX_js.Input,
|
|
893
|
+
{
|
|
894
|
+
id: "password",
|
|
895
|
+
type: "password",
|
|
896
|
+
value: password,
|
|
897
|
+
onChange: (e) => setPassword(e.target.value),
|
|
898
|
+
placeholder: "\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022",
|
|
899
|
+
className: "h-10 bg-zinc-900/50 border-white/5 focus:border-blue-500/50 transition-all text-xs"
|
|
900
|
+
}
|
|
901
|
+
)
|
|
902
|
+
] })
|
|
903
|
+
] }),
|
|
904
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
|
|
905
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 mb-1", children: [
|
|
906
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Database, { strokeWidth: 1.5, className: "w-3 h-3 text-zinc-500" }),
|
|
907
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkY52UIFEX_js.Label, { htmlFor: "database", className: "text-xs font-mediumr text-zinc-500", children: "Database Name" })
|
|
908
|
+
] }),
|
|
909
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
910
|
+
chunkY52UIFEX_js.Input,
|
|
911
|
+
{
|
|
912
|
+
id: "database",
|
|
913
|
+
value: database,
|
|
914
|
+
onChange: (e) => setDatabase(e.target.value),
|
|
915
|
+
placeholder: "production_db",
|
|
916
|
+
className: "h-10 bg-zinc-900/50 border-white/5 focus:border-blue-500/50 transition-all text-xs font-mono"
|
|
917
|
+
}
|
|
918
|
+
)
|
|
919
|
+
] })
|
|
920
|
+
] })
|
|
921
|
+
] }) }),
|
|
922
|
+
(type === "oracle" || type === "mssql") && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
|
|
923
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
924
|
+
"button",
|
|
925
|
+
{
|
|
926
|
+
type: "button",
|
|
927
|
+
onClick: () => setShowAdvanced(!showAdvanced),
|
|
928
|
+
className: "flex items-center gap-2 w-full px-3 py-2 rounded-lg border border-white/5 hover:border-white/10 bg-zinc-900/30 text-xs font-medium text-zinc-400 hover:text-zinc-200 transition-all",
|
|
929
|
+
children: [
|
|
930
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Settings2, { strokeWidth: 1.5, className: "w-3.5 h-3.5 text-orange-500" }),
|
|
931
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: "Advanced" }),
|
|
932
|
+
(serviceName || instanceName) && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ml-1 px-1.5 py-0.5 rounded text-[0.625rem] bg-orange-500/10 text-orange-400 border border-orange-500/20", children: "SET" }),
|
|
933
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronDown, { className: chunkY52UIFEX_js.cn("w-3 h-3 ml-auto transition-transform", showAdvanced && "rotate-180") })
|
|
934
|
+
]
|
|
935
|
+
}
|
|
936
|
+
),
|
|
937
|
+
/* @__PURE__ */ jsxRuntime.jsx(framerMotion.AnimatePresence, { children: showAdvanced && /* @__PURE__ */ jsxRuntime.jsx(
|
|
938
|
+
framerMotion.motion.div,
|
|
939
|
+
{
|
|
940
|
+
initial: { height: 0, opacity: 0 },
|
|
941
|
+
animate: { height: "auto", opacity: 1 },
|
|
942
|
+
exit: { height: 0, opacity: 0 },
|
|
943
|
+
className: "overflow-hidden",
|
|
944
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "p-3 rounded-lg border border-orange-500/10 bg-orange-500/5 space-y-3", children: [
|
|
945
|
+
type === "oracle" && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-1.5", children: [
|
|
946
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkY52UIFEX_js.Label, { className: "text-xs font-mediumr text-zinc-500", children: "Service Name" }),
|
|
947
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
948
|
+
chunkY52UIFEX_js.Input,
|
|
949
|
+
{
|
|
950
|
+
value: serviceName,
|
|
951
|
+
onChange: (e) => setServiceName(e.target.value),
|
|
952
|
+
placeholder: "ORCL or XEPDB1",
|
|
953
|
+
className: "h-9 bg-zinc-900/50 border-white/5 focus:border-orange-500/50 text-xs"
|
|
954
|
+
}
|
|
955
|
+
),
|
|
956
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-zinc-500", children: "If empty, the Database Name field is used as the service name." })
|
|
957
|
+
] }),
|
|
958
|
+
type === "mssql" && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-1.5", children: [
|
|
959
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkY52UIFEX_js.Label, { className: "text-xs font-mediumr text-zinc-500", children: "Instance Name" }),
|
|
960
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
961
|
+
chunkY52UIFEX_js.Input,
|
|
962
|
+
{
|
|
963
|
+
value: instanceName,
|
|
964
|
+
onChange: (e) => setInstanceName(e.target.value),
|
|
965
|
+
placeholder: "SQLEXPRESS",
|
|
966
|
+
className: "h-9 bg-zinc-900/50 border-white/5 focus:border-orange-500/50 text-xs"
|
|
967
|
+
}
|
|
968
|
+
),
|
|
969
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-zinc-500", children: "For named instances (e.g. SQLEXPRESS). Leave empty for default instance." })
|
|
970
|
+
] })
|
|
971
|
+
] })
|
|
972
|
+
}
|
|
973
|
+
) })
|
|
974
|
+
] }),
|
|
975
|
+
type !== "sqlite" && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
|
|
976
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
977
|
+
"button",
|
|
978
|
+
{
|
|
979
|
+
type: "button",
|
|
980
|
+
onClick: () => setShowSSL(!showSSL),
|
|
981
|
+
className: "flex items-center gap-2 w-full px-3 py-2 rounded-lg border border-white/5 hover:border-white/10 bg-zinc-900/30 text-xs font-medium text-zinc-400 hover:text-zinc-200 transition-all",
|
|
982
|
+
children: [
|
|
983
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Lock, { strokeWidth: 1.5, className: "w-3.5 h-3.5 text-emerald-500" }),
|
|
984
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: "SSL / TLS" }),
|
|
985
|
+
sslMode !== "disable" && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ml-1 px-1.5 py-0.5 rounded text-[0.625rem] bg-emerald-500/10 text-emerald-400 border border-emerald-500/20", children: sslMode.toUpperCase() }),
|
|
986
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronDown, { className: chunkY52UIFEX_js.cn("w-3 h-3 ml-auto transition-transform", showSSL && "rotate-180") })
|
|
987
|
+
]
|
|
988
|
+
}
|
|
989
|
+
),
|
|
990
|
+
/* @__PURE__ */ jsxRuntime.jsx(framerMotion.AnimatePresence, { children: showSSL && /* @__PURE__ */ jsxRuntime.jsx(
|
|
991
|
+
framerMotion.motion.div,
|
|
992
|
+
{
|
|
993
|
+
initial: { height: 0, opacity: 0 },
|
|
994
|
+
animate: { height: "auto", opacity: 1 },
|
|
995
|
+
exit: { height: 0, opacity: 0 },
|
|
996
|
+
className: "overflow-hidden",
|
|
997
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "p-3 rounded-lg border border-emerald-500/10 bg-emerald-500/5 space-y-3", children: [
|
|
998
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
|
|
999
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkY52UIFEX_js.Label, { className: "text-xs font-mediumr text-zinc-500", children: "SSL Mode" }),
|
|
1000
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-wrap gap-1.5", children: ["disable", "require", "verify-ca", "verify-full"].map((mode) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1001
|
+
"button",
|
|
1002
|
+
{
|
|
1003
|
+
type: "button",
|
|
1004
|
+
onClick: () => setSSLMode(mode),
|
|
1005
|
+
className: chunkY52UIFEX_js.cn(
|
|
1006
|
+
"px-2.5 py-1.5 rounded-md text-xs font-mediumr transition-all border",
|
|
1007
|
+
sslMode === mode ? "border-emerald-500/30 bg-emerald-500/10 text-emerald-400" : "border-transparent text-zinc-500 hover:text-zinc-300 hover:bg-white/5"
|
|
1008
|
+
),
|
|
1009
|
+
children: mode
|
|
1010
|
+
},
|
|
1011
|
+
mode
|
|
1012
|
+
)) })
|
|
1013
|
+
] }),
|
|
1014
|
+
sslMode !== "disable" && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-3", children: [
|
|
1015
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-1.5", children: [
|
|
1016
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkY52UIFEX_js.Label, { className: "text-xs font-mediumr text-zinc-500", children: "CA Certificate (PEM)" }),
|
|
1017
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1018
|
+
"textarea",
|
|
1019
|
+
{
|
|
1020
|
+
value: caCert,
|
|
1021
|
+
onChange: (e) => setCaCert(e.target.value),
|
|
1022
|
+
placeholder: "-----BEGIN CERTIFICATE-----\nPaste CA cert content here...\n-----END CERTIFICATE-----",
|
|
1023
|
+
rows: 3,
|
|
1024
|
+
className: "w-full rounded-md bg-zinc-900/50 border border-white/5 focus:border-emerald-500/50 text-xs font-mono text-zinc-300 p-2 resize-none placeholder:text-zinc-600"
|
|
1025
|
+
}
|
|
1026
|
+
)
|
|
1027
|
+
] }),
|
|
1028
|
+
(sslMode === "verify-ca" || sslMode === "verify-full") && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
1029
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-1.5", children: [
|
|
1030
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkY52UIFEX_js.Label, { className: "text-xs font-mediumr text-zinc-500", children: "Client Certificate (PEM)" }),
|
|
1031
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1032
|
+
"textarea",
|
|
1033
|
+
{
|
|
1034
|
+
value: clientCert,
|
|
1035
|
+
onChange: (e) => setClientCert(e.target.value),
|
|
1036
|
+
placeholder: "-----BEGIN CERTIFICATE-----\nOptional client cert...\n-----END CERTIFICATE-----",
|
|
1037
|
+
rows: 3,
|
|
1038
|
+
className: "w-full rounded-md bg-zinc-900/50 border border-white/5 focus:border-emerald-500/50 text-xs font-mono text-zinc-300 p-2 resize-none placeholder:text-zinc-600"
|
|
1039
|
+
}
|
|
1040
|
+
)
|
|
1041
|
+
] }),
|
|
1042
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-1.5", children: [
|
|
1043
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkY52UIFEX_js.Label, { className: "text-xs font-mediumr text-zinc-500", children: "Client Private Key (PEM)" }),
|
|
1044
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1045
|
+
"textarea",
|
|
1046
|
+
{
|
|
1047
|
+
value: clientKey,
|
|
1048
|
+
onChange: (e) => setClientKey(e.target.value),
|
|
1049
|
+
placeholder: "-----BEGIN PRIVATE KEY-----\nOptional client key...\n-----END PRIVATE KEY-----",
|
|
1050
|
+
rows: 3,
|
|
1051
|
+
className: "w-full rounded-md bg-zinc-900/50 border border-white/5 focus:border-emerald-500/50 text-xs font-mono text-zinc-300 p-2 resize-none placeholder:text-zinc-600"
|
|
1052
|
+
}
|
|
1053
|
+
)
|
|
1054
|
+
] })
|
|
1055
|
+
] })
|
|
1056
|
+
] })
|
|
1057
|
+
] })
|
|
1058
|
+
}
|
|
1059
|
+
) }),
|
|
1060
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
1061
|
+
"button",
|
|
1062
|
+
{
|
|
1063
|
+
type: "button",
|
|
1064
|
+
onClick: () => setShowSSH(!showSSH),
|
|
1065
|
+
className: "flex items-center gap-2 w-full px-3 py-2 rounded-lg border border-white/5 hover:border-white/10 bg-zinc-900/30 text-xs font-medium text-zinc-400 hover:text-zinc-200 transition-all",
|
|
1066
|
+
children: [
|
|
1067
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Terminal, { strokeWidth: 1.5, className: "w-3.5 h-3.5 text-purple-500" }),
|
|
1068
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: "SSH Tunnel" }),
|
|
1069
|
+
sshEnabled && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ml-1 px-1.5 py-0.5 rounded text-[0.625rem] bg-purple-500/10 text-purple-400 border border-purple-500/20", children: "ON" }),
|
|
1070
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronDown, { className: chunkY52UIFEX_js.cn("w-3 h-3 ml-auto transition-transform", showSSH && "rotate-180") })
|
|
1071
|
+
]
|
|
1072
|
+
}
|
|
1073
|
+
),
|
|
1074
|
+
/* @__PURE__ */ jsxRuntime.jsx(framerMotion.AnimatePresence, { children: showSSH && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1075
|
+
framerMotion.motion.div,
|
|
1076
|
+
{
|
|
1077
|
+
initial: { height: 0, opacity: 0 },
|
|
1078
|
+
animate: { height: "auto", opacity: 1 },
|
|
1079
|
+
exit: { height: 0, opacity: 0 },
|
|
1080
|
+
className: "overflow-hidden",
|
|
1081
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "p-3 rounded-lg border border-purple-500/10 bg-purple-500/5 space-y-3", children: [
|
|
1082
|
+
/* @__PURE__ */ jsxRuntime.jsxs("label", { className: "flex items-center gap-2 cursor-pointer", children: [
|
|
1083
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1084
|
+
"input",
|
|
1085
|
+
{
|
|
1086
|
+
type: "checkbox",
|
|
1087
|
+
checked: sshEnabled,
|
|
1088
|
+
onChange: (e) => setSSHEnabled(e.target.checked),
|
|
1089
|
+
className: "rounded border-white/20 bg-zinc-900/50"
|
|
1090
|
+
}
|
|
1091
|
+
),
|
|
1092
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs font-medium text-zinc-300", children: "Enable SSH Tunnel" })
|
|
1093
|
+
] }),
|
|
1094
|
+
sshEnabled && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-3", children: [
|
|
1095
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-1 md:grid-cols-4 gap-3", children: [
|
|
1096
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "md:col-span-3 space-y-1.5", children: [
|
|
1097
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkY52UIFEX_js.Label, { className: "text-xs font-mediumr text-zinc-500", children: "SSH Host" }),
|
|
1098
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1099
|
+
chunkY52UIFEX_js.Input,
|
|
1100
|
+
{
|
|
1101
|
+
value: sshHost,
|
|
1102
|
+
onChange: (e) => setSSHHost(e.target.value),
|
|
1103
|
+
placeholder: "bastion.example.com",
|
|
1104
|
+
className: "h-9 bg-zinc-900/50 border-white/5 focus:border-purple-500/50 text-xs"
|
|
1105
|
+
}
|
|
1106
|
+
)
|
|
1107
|
+
] }),
|
|
1108
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-1.5", children: [
|
|
1109
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkY52UIFEX_js.Label, { className: "text-xs font-mediumr text-zinc-500", children: "Port" }),
|
|
1110
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1111
|
+
chunkY52UIFEX_js.Input,
|
|
1112
|
+
{
|
|
1113
|
+
value: sshPort,
|
|
1114
|
+
onChange: (e) => setSSHPort(e.target.value),
|
|
1115
|
+
className: "h-9 bg-zinc-900/50 border-white/5 focus:border-purple-500/50 text-xs font-mono"
|
|
1116
|
+
}
|
|
1117
|
+
)
|
|
1118
|
+
] })
|
|
1119
|
+
] }),
|
|
1120
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-1.5", children: [
|
|
1121
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkY52UIFEX_js.Label, { className: "text-xs font-mediumr text-zinc-500", children: "Username" }),
|
|
1122
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1123
|
+
chunkY52UIFEX_js.Input,
|
|
1124
|
+
{
|
|
1125
|
+
value: sshUsername,
|
|
1126
|
+
onChange: (e) => setSSHUsername(e.target.value),
|
|
1127
|
+
placeholder: "ubuntu",
|
|
1128
|
+
className: "h-9 bg-zinc-900/50 border-white/5 focus:border-purple-500/50 text-xs"
|
|
1129
|
+
}
|
|
1130
|
+
)
|
|
1131
|
+
] }),
|
|
1132
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
|
|
1133
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkY52UIFEX_js.Label, { className: "text-xs font-mediumr text-zinc-500", children: "Auth Method" }),
|
|
1134
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex gap-2", children: [
|
|
1135
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1136
|
+
"button",
|
|
1137
|
+
{
|
|
1138
|
+
type: "button",
|
|
1139
|
+
onClick: () => setSSHAuthMethod("password"),
|
|
1140
|
+
className: chunkY52UIFEX_js.cn(
|
|
1141
|
+
"flex-1 px-3 py-1.5 rounded-md text-xs font-mediumr transition-all border",
|
|
1142
|
+
sshAuthMethod === "password" ? "border-purple-500/30 bg-purple-500/10 text-purple-400" : "border-transparent text-zinc-500 hover:text-zinc-300 hover:bg-white/5"
|
|
1143
|
+
),
|
|
1144
|
+
children: "Password"
|
|
1145
|
+
}
|
|
1146
|
+
),
|
|
1147
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1148
|
+
"button",
|
|
1149
|
+
{
|
|
1150
|
+
type: "button",
|
|
1151
|
+
onClick: () => setSSHAuthMethod("privateKey"),
|
|
1152
|
+
className: chunkY52UIFEX_js.cn(
|
|
1153
|
+
"flex-1 px-3 py-1.5 rounded-md text-xs font-mediumr transition-all border",
|
|
1154
|
+
sshAuthMethod === "privateKey" ? "border-purple-500/30 bg-purple-500/10 text-purple-400" : "border-transparent text-zinc-500 hover:text-zinc-300 hover:bg-white/5"
|
|
1155
|
+
),
|
|
1156
|
+
children: "Private Key"
|
|
1157
|
+
}
|
|
1158
|
+
)
|
|
1159
|
+
] })
|
|
1160
|
+
] }),
|
|
1161
|
+
sshAuthMethod === "password" ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-1.5", children: [
|
|
1162
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkY52UIFEX_js.Label, { className: "text-xs font-mediumr text-zinc-500", children: "SSH Password" }),
|
|
1163
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1164
|
+
chunkY52UIFEX_js.Input,
|
|
1165
|
+
{
|
|
1166
|
+
type: "password",
|
|
1167
|
+
value: sshPassword,
|
|
1168
|
+
onChange: (e) => setSSHPassword(e.target.value),
|
|
1169
|
+
placeholder: "\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022",
|
|
1170
|
+
className: "h-9 bg-zinc-900/50 border-white/5 focus:border-purple-500/50 text-xs"
|
|
1171
|
+
}
|
|
1172
|
+
)
|
|
1173
|
+
] }) : /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-3", children: [
|
|
1174
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-1.5", children: [
|
|
1175
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkY52UIFEX_js.Label, { className: "text-xs font-mediumr text-zinc-500", children: "Private Key (PEM)" }),
|
|
1176
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1177
|
+
"textarea",
|
|
1178
|
+
{
|
|
1179
|
+
value: sshPrivateKey,
|
|
1180
|
+
onChange: (e) => setSSHPrivateKey(e.target.value),
|
|
1181
|
+
placeholder: "-----BEGIN OPENSSH PRIVATE KEY-----\nPaste private key here...\n-----END OPENSSH PRIVATE KEY-----",
|
|
1182
|
+
rows: 4,
|
|
1183
|
+
className: "w-full rounded-md bg-zinc-900/50 border border-white/5 focus:border-purple-500/50 text-xs font-mono text-zinc-300 p-2 resize-none placeholder:text-zinc-600"
|
|
1184
|
+
}
|
|
1185
|
+
)
|
|
1186
|
+
] }),
|
|
1187
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-1.5", children: [
|
|
1188
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkY52UIFEX_js.Label, { className: "text-xs font-mediumr text-zinc-500", children: "Passphrase (optional)" }),
|
|
1189
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1190
|
+
chunkY52UIFEX_js.Input,
|
|
1191
|
+
{
|
|
1192
|
+
type: "password",
|
|
1193
|
+
value: sshPassphrase,
|
|
1194
|
+
onChange: (e) => setSSHPassphrase(e.target.value),
|
|
1195
|
+
placeholder: "Key passphrase (if encrypted)",
|
|
1196
|
+
className: "h-9 bg-zinc-900/50 border-white/5 focus:border-purple-500/50 text-xs"
|
|
1197
|
+
}
|
|
1198
|
+
)
|
|
1199
|
+
] })
|
|
1200
|
+
] })
|
|
1201
|
+
] })
|
|
1202
|
+
] })
|
|
1203
|
+
}
|
|
1204
|
+
) })
|
|
1205
|
+
] }),
|
|
1206
|
+
/* @__PURE__ */ jsxRuntime.jsx(framerMotion.AnimatePresence, { children: testResult && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1207
|
+
framerMotion.motion.div,
|
|
1208
|
+
{
|
|
1209
|
+
initial: { height: 0, opacity: 0 },
|
|
1210
|
+
animate: { height: "auto", opacity: 1 },
|
|
1211
|
+
exit: { height: 0, opacity: 0 },
|
|
1212
|
+
className: "overflow-hidden",
|
|
1213
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: chunkY52UIFEX_js.cn(
|
|
1214
|
+
"flex items-center gap-2 p-3 rounded-lg border text-xs",
|
|
1215
|
+
testResult.success ? "bg-emerald-500/5 border-emerald-500/20 text-emerald-400" : "bg-red-500/5 border-red-500/20 text-red-400"
|
|
1216
|
+
), children: [
|
|
1217
|
+
testResult.success ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CheckCircle2, { strokeWidth: 1.5, className: "w-3.5 h-3.5 shrink-0" }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.XCircle, { strokeWidth: 1.5, className: "w-3.5 h-3.5 shrink-0" }),
|
|
1218
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "leading-relaxed", children: testResult.message })
|
|
1219
|
+
] })
|
|
1220
|
+
}
|
|
1221
|
+
) })
|
|
1222
|
+
] })
|
|
1223
|
+
] }),
|
|
1224
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "shrink-0 bg-zinc-900/30 p-4 md:p-6 border-t border-white/5", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col-reverse gap-3 md:flex-row md:items-center md:justify-between", children: [
|
|
1225
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1226
|
+
chunkY52UIFEX_js.Button,
|
|
1227
|
+
{
|
|
1228
|
+
variant: "ghost",
|
|
1229
|
+
onClick: onClose,
|
|
1230
|
+
className: "w-full md:w-auto text-zinc-500 hover:text-zinc-200 hover:bg-white/5 text-xs font-medium",
|
|
1231
|
+
children: "Cancel"
|
|
1232
|
+
}
|
|
1233
|
+
),
|
|
1234
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-2 md:flex-row md:items-center md:gap-2", children: [
|
|
1235
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1236
|
+
chunkY52UIFEX_js.Button,
|
|
1237
|
+
{
|
|
1238
|
+
variant: "outline",
|
|
1239
|
+
onClick: handleTestConnection,
|
|
1240
|
+
disabled: isTesting,
|
|
1241
|
+
className: "w-full md:w-auto border-white/10 text-zinc-400 hover:text-white hover:bg-white/5 text-xs font-medium h-10 px-4",
|
|
1242
|
+
children: isTesting ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
1243
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-3 h-3 border-2 border-zinc-400/30 border-t-zinc-400 rounded-full animate-spin" }),
|
|
1244
|
+
"Testing..."
|
|
1245
|
+
] }) : "Test Connection"
|
|
1246
|
+
}
|
|
1247
|
+
),
|
|
1248
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1249
|
+
chunkY52UIFEX_js.Button,
|
|
1250
|
+
{
|
|
1251
|
+
onClick: handleConnect,
|
|
1252
|
+
disabled: isTesting || chunkY52UIFEX_js.getDBConfig(type).showConnectionStringToggle && mongoConnectionMode === "connectionString" && !connectionString.trim(),
|
|
1253
|
+
className: "w-full md:w-auto min-w-0 md:min-w-[140px] bg-blue-600 hover:bg-blue-500 text-white font-medium text-xs h-10 shadow-lg shadow-blue-900/20 group relative overflow-hidden",
|
|
1254
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(framerMotion.AnimatePresence, { mode: "wait", children: isTesting ? /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1255
|
+
framerMotion.motion.div,
|
|
1256
|
+
{
|
|
1257
|
+
initial: { opacity: 0 },
|
|
1258
|
+
animate: { opacity: 1 },
|
|
1259
|
+
exit: { opacity: 0 },
|
|
1260
|
+
className: "flex items-center gap-2",
|
|
1261
|
+
children: [
|
|
1262
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-3.5 h-3.5 border-2 border-white/30 border-t-white rounded-full animate-spin" }),
|
|
1263
|
+
"Connecting..."
|
|
1264
|
+
]
|
|
1265
|
+
},
|
|
1266
|
+
"testing"
|
|
1267
|
+
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
1268
|
+
framerMotion.motion.div,
|
|
1269
|
+
{
|
|
1270
|
+
initial: { opacity: 0 },
|
|
1271
|
+
animate: { opacity: 1 },
|
|
1272
|
+
exit: { opacity: 0 },
|
|
1273
|
+
className: "flex items-center gap-2",
|
|
1274
|
+
children: isEditMode ? "Save Changes" : "Establish Connection"
|
|
1275
|
+
},
|
|
1276
|
+
"connect"
|
|
1277
|
+
) })
|
|
1278
|
+
}
|
|
1279
|
+
)
|
|
1280
|
+
] })
|
|
1281
|
+
] }) })
|
|
1282
|
+
] });
|
|
1283
|
+
if (isMobile) {
|
|
1284
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Drawer, { open: isOpen, onOpenChange: (open) => {
|
|
1285
|
+
if (!open) onClose();
|
|
1286
|
+
}, children: /* @__PURE__ */ jsxRuntime.jsxs(DrawerContent, { className: "max-h-[95dvh] bg-[#0a0a0a] border-white/5 text-zinc-200 p-0 flex flex-col", children: [
|
|
1287
|
+
/* @__PURE__ */ jsxRuntime.jsxs(DrawerHeader, { className: "sr-only", children: [
|
|
1288
|
+
/* @__PURE__ */ jsxRuntime.jsx(DrawerTitle, { children: isEditMode ? "Edit Connection" : "New Connection" }),
|
|
1289
|
+
/* @__PURE__ */ jsxRuntime.jsx(DrawerDescription, { children: "Configure database connection parameters." })
|
|
1290
|
+
] }),
|
|
1291
|
+
formContent
|
|
1292
|
+
] }) });
|
|
1293
|
+
}
|
|
1294
|
+
return /* @__PURE__ */ jsxRuntime.jsx(chunkY52UIFEX_js.Dialog, { open: isOpen, onOpenChange: onClose, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1295
|
+
chunkY52UIFEX_js.DialogContent,
|
|
1296
|
+
{
|
|
1297
|
+
className: "sm:max-w-[500px] lg:max-w-[540px] max-h-[90vh] bg-[#0a0a0a] border-white/5 text-zinc-200 p-0 overflow-hidden shadow-2xl flex flex-col",
|
|
1298
|
+
showCloseButton: false,
|
|
1299
|
+
children: [
|
|
1300
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkY52UIFEX_js.DialogTitle, { className: "sr-only", children: isEditMode ? "Edit Connection" : "New Connection" }),
|
|
1301
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkY52UIFEX_js.DialogDescription, { className: "sr-only", children: "Configure database connection parameters." }),
|
|
1302
|
+
formContent
|
|
1303
|
+
]
|
|
1304
|
+
}
|
|
1305
|
+
) });
|
|
1306
|
+
}
|
|
1307
|
+
|
|
1308
|
+
exports.ConnectionModal = ConnectionModal;
|
|
1309
|
+
//# sourceMappingURL=chunk-HGPD6PWV.js.map
|
|
1310
|
+
//# sourceMappingURL=chunk-HGPD6PWV.js.map
|